/* "The runaway bill" (enterprise-bill.js): chat windows everywhere and a total out of control, folding into one
   calm Ulmero view of spending by department. Beside "Every employee has their own chat window." */
.v5-stakes-a.has-art-bill { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); column-gap: clamp(40px, 4.5vw, 88px); align-items: start; }
.v5-stakes-a.has-art-bill > :first-child { grid-column: 1; grid-row: 1; }
.v5-stakes-a.has-art-bill > .v5-aside { grid-column: 1; grid-row: 2; margin-left: min(16%, 8rem); }
.v5-stakes-a.has-art-bill > .eb-stage { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
@media (max-width: 900px) { .v5-stakes-a.has-art-bill { display: block !important; } .v5-stakes-a.has-art-bill > .v5-aside { margin-left: min(30%, 22rem); } .eb-stage { display: none; } }

.eb-label { margin: 0 0 18px; font-size: 16.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--turquoise); }
.eb-scene { position: relative; height: 560px; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--panel); overflow: hidden; }
.eb-meter-k { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.eb-total { margin: 4px 0 0; font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }

/* The chaos: the spinning total and the windows. */
.eb-chaos { position: absolute; inset: 0; }
.eb-meter { position: absolute; z-index: 3; left: 0; right: 0; top: 0; padding: 20px 24px 16px; background: linear-gradient(var(--panel) 78%, rgba(24, 24, 22, 0)); }
.eb-unknown { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.eb-unknown span { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 5px; border-radius: 6px; border: 1px dashed var(--line-strong); color: var(--turquoise); font-weight: 700; }
.eb-wins { position: absolute; left: 16px; right: 16px; top: 128px; bottom: 16px; }
.eb-win { position: absolute; width: 150px; padding: 8px 10px 9px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); transform: rotate(var(--r)); opacity: 0; }
.eb-win-h { display: flex; align-items: center; gap: 4px; margin: 0 0 7px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.eb-win-h b { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); flex: none; }
.eb-win-h span { margin-left: 5px; overflow: hidden; text-overflow: ellipsis; }
.eb-win-b { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
.eb-win-b i { height: 7px; width: 56%; border-radius: 4px; background: rgba(241, 238, 231, 0.12); }
.eb-win-b em { font-style: normal; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--turquoise); }

.eb-scene.chaos .eb-win { animation: eb-pop 0.4s var(--ease) both; animation-delay: calc(var(--i) * 0.28s); }
.eb-scene.chaos .eb-win-b em { animation: eb-tick 1.3s ease-in-out infinite; animation-delay: calc(var(--i) * 0.13s); }
.eb-scene.chaos .eb-win-b i { animation: eb-type 1.6s ease-in-out infinite alternate; animation-delay: calc(var(--i) * 0.11s); }
.eb-scene.chaos .eb-run { animation: eb-shake 0.18s linear infinite; animation-delay: 3.6s; }
.eb-scene.chaos .eb-unknown span { animation: eb-q 1.2s ease-in-out infinite; }
.eb-scene.chaos .eb-unknown span:nth-child(2) { animation-delay: 0.2s; }
.eb-scene.chaos .eb-unknown span:nth-child(3) { animation-delay: 0.4s; }
@keyframes eb-pop { 0% { opacity: 0; transform: rotate(var(--r)) scale(0.6) translateY(10px); } 100% { opacity: 1; transform: rotate(var(--r)) scale(1); } }
@keyframes eb-tick { 0%, 100% { opacity: 0.55; transform: none; } 45% { opacity: 1; transform: translateY(-3px); } }
@keyframes eb-type { from { width: 24%; } to { width: 62%; } }
@keyframes eb-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
@keyframes eb-q { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* The fold: every window flies into the middle and vanishes, then the calm view arrives. */
.eb-scene.fold .eb-win { left: 36% !important; top: 34% !important; opacity: 0 !important; transform: scale(0.25) !important; animation: none; transition: left 0.8s var(--ease-io), top 0.8s var(--ease-io), transform 0.8s var(--ease-io), opacity 0.8s ease; }
.eb-scene.fold .eb-meter { opacity: 0; transition: opacity 0.5s ease; }
.eb-scene.fold .eb-run { animation: none; }

/* The calm view. */
.eb-calm { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 22px 24px 20px; opacity: 0; visibility: hidden; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--accent); }
.eb-calm-h { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--turquoise); }
.eb-calm-h img { width: 18px; height: auto; }
.eb-calm-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.eb-steady { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.eb-steady::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--turquoise); box-shadow: 0 0 0 4px var(--accent-soft); }
.eb-rows { list-style: none; margin: 0; padding: 0; }
.eb-rows li { padding: 9px 0 8px; border-bottom: 1px solid var(--line); }
.eb-row-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 7px; font-size: 15px; color: var(--ink); }
.eb-row-h span { font-weight: 600; min-width: 5.6em; }
.eb-row-h em { font-style: normal; font-size: 13px; color: var(--faint); }
.eb-row-h strong { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.eb-row-h small { font-size: 13px; font-weight: 400; color: var(--faint); }
.eb-bar { position: relative; height: 7px; margin: 0; border-radius: 4px; background: rgba(241, 238, 231, 0.07); }
.eb-bar::after { content: ""; position: absolute; right: 0; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--line-strong); }
.eb-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 4px; background: var(--turquoise); transform-origin: left; transform: scaleX(0); }
.eb-foot { margin: auto 0 0; padding-top: 12px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.eb-foot p { margin: 0; }
.eb-agents { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px !important; }
.eb-agents span { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--ink); }
.eb-agents span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--turquoise); vertical-align: 1px; }

.eb-scene.calm .eb-chaos { visibility: hidden; }
.eb-scene.calm .eb-calm { opacity: 1; visibility: visible; transition: opacity 0.6s ease; }
.eb-scene.calm .eb-rows li { animation: eb-rise 0.5s var(--ease) both; animation-delay: calc(0.15s + var(--n) * 0.12s); }
.eb-scene.calm .eb-bar i { transform: scaleX(1); transition: transform 0.9s var(--ease); transition-delay: calc(0.3s + var(--n) * 0.12s); }
@keyframes eb-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { .eb-scene *, .eb-scene { animation: none !important; transition: none !important; } }
.eb-scene.still .eb-rows li { animation: none; }
.eb-scene.still .eb-bar i { transition: none; }
