/* Kingsmen OS brandbook: Studio Black #080808, Pastel Lilac #C4AEF5, Soft Mint #A8E8D1,
   Mist Blue #AECDF5, Peach Glow #F3BDA8; glass = blur 8px, surface alpha 0.10. */
:root {
  --bg: #080808; --ink: #F5F3F8; --ink-2: #B6B0C0; --ink-3: #7d7787;
  --solid: #19171F; --glass: rgba(26,22,36,0.10); --line: rgba(255,255,255,0.12); --line-2: rgba(255,255,255,0.07);
  --lilac: #C4AEF5; --mint: #A8E8D1; --mist: #AECDF5; --peach: #F3BDA8; --red: #F2A0A0;
  --ease: cubic-bezier(.22,1,.36,1);
  --mono: 'JetBrains Mono', 'Noto Sans Georgian', ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: 'Inter', 'Noto Sans Georgian', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
}
[hidden] { display: none !important; }

/* colored light behind the glass (local panels, base stays #080808) */
.lights { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.lights span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .22; }
.l1 { width: 520px; height: 520px; background: var(--lilac); top: -180px; left: -120px; }
.l2 { width: 460px; height: 460px; background: var(--mist); top: 30%; right: -200px; opacity: .14 !important; }
.l3 { width: 420px; height: 420px; background: var(--mint); bottom: -220px; left: 30%; opacity: .10 !important; }

.glass {
  background: var(--glass); border: 1px solid var(--line); border-radius: 22px;
  backdrop-filter: blur(8px) saturate(125%); -webkit-backdrop-filter: blur(8px) saturate(125%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 20px 50px rgba(0,0,0,0.35);
}
@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) { .glass { background: var(--solid); } }

.reveal { animation: reveal 680ms var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

.ico { width: 18px; height: 18px; flex-shrink: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  font: 600 14px/1 'Inter', sans-serif; padding: 12px 18px; border-radius: 14px;
  transition: transform .2s var(--ease), background .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--lilac); color: #080808; }
.btn.primary:hover { background: #d3c2f8; }
.btn.ghost { background: rgba(255,255,255,0.06); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255,255,255,0.10); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }
.icon-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--ink-2); width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

/* LOCK */
.lock { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.lock-card { width: 100%; max-width: 380px; padding: 36px 30px 28px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.lock-logo { height: 34px; margin: 0 auto 6px; }
.lock-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.lock-sub { color: var(--ink-2); font-size: 13.5px; margin-top: -8px; margin-bottom: 8px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font: 500 11px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.pin-form { display: flex; flex-direction: column; gap: 12px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; height: 12px; }
.pin-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink-3); transition: all .2s var(--ease); }
.pin-dots i.on { background: var(--lilac); border-color: var(--lilac); transform: scale(1.1); }
#pin {
  width: 100%; text-align: center; font: 600 20px var(--mono); letter-spacing: 10px; color: var(--ink);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
}
#pin::placeholder { letter-spacing: 3px; font-size: 14px; color: var(--ink-3); }
#pin:focus { outline: none; border-color: rgba(196,174,245,0.6); }
.lock-msg { min-height: 20px; font-size: 13px; color: var(--ink-2); }
.lock-msg.err { color: var(--red); }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* SHEET */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.5); display: grid; place-items: end center; padding: 18px; }
.sheet { width: 100%; max-width: 420px; padding: 24px; animation: up .5s var(--ease) both; background: rgba(26,22,36,0.85); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-title { font-weight: 700; font-size: 17px; }
.sheet-text { color: var(--ink-2); font-size: 14px; margin: 8px 0 18px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* APP */
.app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 22px 22px 28px; padding-top: max(22px, env(safe-area-inset-top)); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.top-logo { height: 34px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.collector { display: inline-flex; align-items: center; gap: 8px; font: 500 11px var(--mono); letter-spacing: .6px; color: var(--ink-2); text-transform: uppercase; }
.collector .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.collector.on .dot { background: var(--mint); box-shadow: 0 0 0 0 rgba(168,232,209,.6); animation: pulse 2s infinite; }
.collector.off .dot { background: var(--peach); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(168,232,209,.55); } 70% { box-shadow: 0 0 0 9px rgba(168,232,209,0); } 100% { box-shadow: 0 0 0 0 rgba(168,232,209,0); } }
#refresh-btn.busy .spin-ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { margin: 46px 0 26px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.hero p { color: var(--ink-2); margin-top: 10px; max-width: 620px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 16px; transition: border-color .3s, opacity .3s; }
.card.enter { animation: reveal 680ms var(--ease) both; }
.card.enter:nth-child(2) { animation-delay: 70ms; } .card.enter:nth-child(3) { animation-delay: 140ms; } .card.enter:nth-child(4) { animation-delay: 210ms; }
.card.stale .win, .card.stale .big { opacity: .45; filter: grayscale(1); }
.c-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.vendor { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vmark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 700 13px var(--mono); flex-shrink: 0; }
.vmark.claude { background: rgba(243,189,168,0.14); color: var(--peach); border: 1px solid rgba(243,189,168,0.25); }
.vmark.openai { background: rgba(168,232,209,0.12); color: var(--mint); border: 1px solid rgba(168,232,209,0.22); }
.vname { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.vacct { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { font: 600 10px var(--mono); letter-spacing: .8px; text-transform: uppercase; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); }
.chip.def { color: var(--lilac); border-color: rgba(196,174,245,0.35); }
.pill { font: 600 11px var(--mono); letter-spacing: .6px; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--mint); background: rgba(168,232,209,0.10); }
.pill.warning { color: var(--peach); background: rgba(243,189,168,0.10); }
.pill.limited { color: var(--red); background: rgba(242,160,160,0.10); }
.pill.unknown { color: var(--ink-2); background: rgba(255,255,255,0.06); }

.big { display: flex; align-items: baseline; gap: 10px; }
.big b { font: 700 40px var(--mono); letter-spacing: -2px; }
.big span { color: var(--ink-2); font-size: 13px; }
.wins { display: flex; flex-direction: column; gap: 12px; }
.win-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.win-label { color: var(--ink); font-weight: 500; }
.win-val { font: 600 13px var(--mono); }
.bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.07); overflow: hidden; margin: 7px 0 5px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--lilac), var(--mist)); transition: width 1.1s var(--ease); }
.bar i.warn { background: linear-gradient(90deg, var(--lilac), var(--peach)); }
.bar i.full { background: linear-gradient(90deg, var(--peach), var(--red)); }
.win-reset { font: 400 11.5px var(--mono); color: var(--ink-3); }
.win-reset .cd { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.big-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.next { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.next span { font: 600 10px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-3); }
.next b { font: 600 20px var(--mono); color: var(--lilac); font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.card.stale .next b { color: var(--ink-2); }
.empty { color: var(--ink-2); font-size: 13.5px; padding: 6px 0; }
.note { font-size: 12.5px; color: var(--peach); background: rgba(243,189,168,0.07); border: 1px solid rgba(243,189,168,0.18); padding: 9px 11px; border-radius: 12px; }

.agents { border-top: 1px solid var(--line-2); padding-top: 14px; }
.a-title { font: 600 10.5px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; display: flex; justify-content: space-between; }
.a-list { display: flex; flex-direction: column; gap: 7px; }
.a-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.a-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-name small { color: var(--ink-3); margin-left: 6px; }
.a-meta { font: 400 11px var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.sd { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sd.working { background: var(--mint); animation: pulse 1.6s infinite; }
.sd.active { background: var(--lilac); }
.sd.idle { background: rgba(255,255,255,0.22); }
.sd.stuck { background: var(--peach); }
.a-more { background: none; border: 0; color: var(--ink-2); font: 500 12px 'Inter', sans-serif; cursor: pointer; text-align: left; padding: 2px 0; }
.a-more:hover { color: var(--ink); }
.c-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: 400 11px var(--mono); color: var(--ink-3); border-top: 1px solid var(--line-2); padding-top: 12px; }
.stale-tag { color: var(--peach); }

.legend { margin-top: 26px; padding: 18px 4px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 22px; color: var(--ink-2); font-size: 13px; }
.legend .sd { margin-right: 8px; }
.legend b { color: var(--ink); font-weight: 600; }
.legend-note { grid-column: 1 / -1; color: var(--ink-3); font-size: 12.5px; margin-top: 6px; }
.foot { text-align: center; color: var(--ink-3); font: 400 11px var(--mono); letter-spacing: 1px; text-transform: uppercase; margin-top: 30px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; background: rgba(26,22,36,0.92); border: 1px solid var(--line); color: var(--ink); padding: 11px 16px; border-radius: 14px; font-size: 13.5px; transition: all .35s var(--ease); z-index: 60; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
  .legend { grid-template-columns: 1fr; }
  .collector #collector-text { display: none; }
  .app { padding-left: 16px; padding-right: 16px; }
  .card { padding: 18px; }
  .a-meta { max-width: 46%; }
  .hero { margin: 30px 0 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.full-row { grid-column: 1 / -1; }
.v-text { min-width: 0; }
.chip.warn { color: var(--peach); border-color: rgba(243,189,168,0.35); }

/* flash a value when it changes */
.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { color: var(--lilac); text-shadow: 0 0 18px rgba(196,174,245,.6); } 100% { text-shadow: none; } }

/* agent share */
.share { border-top: 1px solid var(--line-2); padding-top: 14px; }
.share-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.share-head span { font: 600 10.5px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); }
.stack { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,0.05); gap: 2px; }
.stack i { display: block; height: 100%; transition: flex-grow .9s var(--ease); min-width: 3px; }
.share-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 10px; font-size: 12.5px; }
.share-list div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.share-list .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.share-list b { font: 600 12px var(--mono); }
.sw { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.share-note { font: 400 11px var(--mono); color: var(--ink-3); margin-top: 8px; }

.seg { display: inline-flex; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.seg button { background: none; border: 0; color: var(--ink-2); font: 600 11px var(--mono); padding: 6px 10px; border-radius: 8px; cursor: pointer; letter-spacing: .5px; }
.seg button.on { background: rgba(196,174,245,0.18); color: var(--ink); }
.seg.small button { padding: 4px 8px; font-size: 10.5px; }

/* spend */
.spend { margin-top: 18px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.sp-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.sp-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.sp-head p { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 10px; }
.kpi { background: rgba(255,255,255,0.03); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.kpi .l { font: 600 9.5px var(--mono); letter-spacing: 1.3px; text-transform: uppercase; color: var(--ink-3); }
.kpi .v { font: 700 22px var(--mono); margin-top: 4px; letter-spacing: -0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.kpi-top .v { font-size: 20px; color: var(--lilac); }
.chart svg { width: 100%; height: 220px; display: block; overflow: visible; }
.chart rect.b { transition: opacity .2s; }
.chart rect.b:hover { opacity: .75; }
.chart text { fill: var(--ink-3); font: 400 10px 'JetBrains Mono', monospace; }
.chart line { stroke: rgba(255,255,255,0.06); }
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend-row span { display: inline-flex; align-items: center; gap: 7px; }
.ranks { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.rank-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rank-head > span { font: 600 10.5px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); }
.r-row { display: grid; grid-template-columns: minmax(0, 150px) 1fr 74px; align-items: center; gap: 10px; font-size: 13px; padding: 4px 0; }
.r-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-row .bar2 { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.06); overflow: hidden; }
.r-row .bar2 i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--lilac), var(--mist)); transition: width .9s var(--ease); }
.r-row b { font: 600 12.5px var(--mono); text-align: right; }
.sp-note { font-size: 12px; color: var(--ink-3); }
@media (max-width: 820px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.kpi-top { grid-column: 1 / -1; }
  .ranks { grid-template-columns: 1fr; }
  .spend { padding: 18px; }
  .r-row { grid-template-columns: minmax(0, 110px) 1fr 64px; }
  .chart svg { height: 180px; }
}

/* chart hover */
.chart { position: relative; }
.chart rect.hit { fill: transparent; cursor: crosshair; }
.chart rect.hit:hover { fill: rgba(255,255,255,0.04); }
.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; background: rgba(20,17,28,0.96); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; box-shadow: 0 12px 30px rgba(0,0,0,0.45); opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.tip.show { opacity: 1; transform: none; }
.tip .t-h { font: 600 11px var(--mono); color: var(--ink-2); letter-spacing: .5px; margin-bottom: 6px; }
.tip .t-total { font: 700 18px var(--mono); margin-bottom: 6px; }
.tip .t-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; color: var(--ink-2); padding: 1px 0; }
.tip .t-row span { display: inline-flex; align-items: center; gap: 7px; }
.tip .t-row b { font: 600 12px var(--mono); color: var(--ink); }
@media (max-width: 820px) { .top-logo { height: 30px; } }

/* switch animations (minimal) */
.seg button { transition: background .25s var(--ease), color .25s var(--ease); }
.chart g.col { transition: opacity .2s; }
.chart g.col.dim { opacity: .45; }
.chart g.col.grow { transform-box: fill-box; transform-origin: 50% 100%; animation: grow .55s var(--ease) both; }
@keyframes grow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.fade-in.go { animation: fadeUp .45s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.r-row .bar2 i { width: 0; }
.stack i { transition: flex-grow .7s var(--ease); }

/* ---------- v6: sparkline, live API, why panel, tips, all-models ---------- */
.spark { margin-top: -4px; }
.spark-head { display: flex; justify-content: space-between; font: 600 10px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.spark svg { width: 100%; height: 36px; display: block; }
.sp-line { fill: none; stroke: var(--lilac); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.sp-area { fill: rgba(196,174,245,0.12); }

.live-api { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; background: rgba(255,255,255,0.02); }
.live-head { display: flex; align-items: center; gap: 9px; font: 600 10.5px var(--mono); letter-spacing: 1.3px; text-transform: uppercase; color: var(--ink-2); }
.live-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 18px; margin-top: 10px; }
.live-item { display: flex; align-items: center; gap: 9px; font-size: 13px; min-width: 0; }
.live-item .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item .meta { flex: 1; min-width: 0; font: 400 11px var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item b { font: 600 12.5px var(--mono); }

.chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hint { font: 400 11px var(--mono); color: var(--ink-3); }
.chart rect.hit { cursor: pointer; }
.chart g.col.sel { filter: drop-shadow(0 0 6px rgba(196,174,245,0.7)); }

.why { border: 1px solid rgba(196,174,245,0.3); background: rgba(196,174,245,0.06); border-radius: 16px; padding: 16px 18px; animation: fadeUp .4s var(--ease) both; }
.why-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.why-t { font: 700 16px var(--mono); }
.why-s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.icon-btn.small { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.r-row b small { display: block; font: 400 10.5px var(--mono); color: var(--ink-3); }

.tips { display: flex; flex-direction: column; gap: 8px; }
.tips-head { font: 600 10.5px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); }
.tip-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border-radius: 13px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.025); font-size: 13.5px; }
.tip-item .ti { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(196,174,245,0.14); color: var(--lilac); flex-shrink: 0; font-size: 13px; }
.tip-item .ta { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }

.rank-ctl { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rt { font: 600 9.5px var(--mono); font-style: normal; letter-spacing: .6px; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; margin-left: 6px; vertical-align: 1px; }
.rt.sub { color: var(--lilac); background: rgba(196,174,245,0.12); }
.rt.paid { color: var(--mist); background: rgba(174,205,245,0.10); }
.r-note { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }
.r-row { grid-template-columns: minmax(0, 1.2fr) 1fr 84px; }

@media (max-width: 820px) {
  .live-list { grid-template-columns: 1fr; }
  .rank-head { flex-wrap: wrap; gap: 8px; }
}

/* ---------- light theme (brandbook: #FFFFFF, ink #19161F, Deep Iris #7050A8) ---------- */
:root.light {
  --bg: #FFFFFF; --ink: #19161F; --ink-2: #655E70; --ink-3: #8E8799;
  --solid: #F5F2FA; --glass: rgba(255,255,255,0.72); --line: rgba(40,27,65,0.12); --line-2: rgba(40,27,65,0.08);
}
:root.light .lights span { opacity: .18 !important; }
:root.light .glass { box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 16px 40px rgba(40,27,65,0.08); }

:root.light .btn.ghost, :root.light .icon-btn, :root.light #pin, :root.light .seg, :root.light .kpi, :root.light .live-api, :root.light .tip-item { background: rgba(40,27,65,0.035); }
:root.light .bar, :root.light .stack, :root.light .r-row .bar2 { background: rgba(40,27,65,0.07); }
:root.light .seg button.on { background: rgba(112,80,168,0.14); }
:root.light .chart line { stroke: rgba(40,27,65,0.08); }
:root.light .tip { background: rgba(255,255,255,0.97); box-shadow: 0 12px 30px rgba(40,27,65,0.15); }
:root.light .next b, :root.light .kpi.kpi-top .v, :root.light .chip.def, :root.light .rt.sub, :root.light .tip-item .ti, :root.light .a-more:hover { color: #7050A8; }
:root.light .pill.ok { color: #2E8F6F; background: rgba(46,143,111,0.10); }
:root.light .pill.warning { color: #B5603A; background: rgba(181,96,58,0.10); }
:root.light .pill.limited { color: #C04040; background: rgba(192,64,64,0.10); }
:root.light .vmark.claude { color: #B5603A; }
:root.light .vmark.openai { color: #2E8F6F; }
:root.light .note { color: #9A4F2E; }
:root.light .collector.on .dot, :root.light .sd.working { background: #3FB58C; }
:root.light .sp-area { fill: rgba(112,80,168,0.10); }
:root.light .sp-line { stroke: #7050A8; }
:root.light .rt.paid { color: #3D6FAE; }
:root.light .sheet { background: rgba(255,255,255,0.95); }
:root.light .toast { background: rgba(255,255,255,0.97); color: var(--ink); }

/* v7: prices + total cost */
.chip.price { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,0.05); }
:root.light .chip.price { background: rgba(40,27,65,0.04); }
.kpis.four { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); }
.kpi .v small { font-size: 12px; color: var(--ink-3); margin-left: 2px; }
@media (max-width: 820px) { .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* v8 — cost by business system */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sys { background: rgba(255,255,255,0.03); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px 10px; min-width: 0; display: flex; flex-direction: column; gap: 6px; transition: border-color .2s, transform .2s var(--ease); }
.sys:hover { border-color: var(--line); transform: translateY(-1px); }
.sys-top { display: flex; align-items: center; gap: 8px; }
.sys-name { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys-top b { font: 700 16px var(--mono); }
.sys-sub { font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.trend { font: 500 10.5px var(--mono); color: var(--ink-3); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); }
.trend.up { color: var(--peach, #F3BDA8); border-color: rgba(243,189,168,0.35); }
.trend.down { color: var(--mint, #A8E8D1); border-color: rgba(168,232,209,0.35); }
.sys-bars { width: 100%; height: 40px; display: block; overflow: visible; }
.sys-bars rect { opacity: .85; transition: opacity .15s; }
.sys-bars rect:hover { opacity: 1; }
.sys-bars g.b.grow { transform-box: fill-box; transform-origin: 50% 100%; animation: grow .5s var(--ease) both; }
.sys-foot { display: flex; justify-content: space-between; gap: 8px; font: 400 10.5px var(--mono); color: var(--ink-3); }
.sys-foot span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys-foot span:last-child { flex-shrink: 0; }
:root.light .sys { background: rgba(40,27,65,0.025); }
:root.light .trend.up { color: #B5603E; }
:root.light .trend.down { color: #2E8A6B; }
@media (max-width: 820px) { .sys-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .sys-grid { grid-template-columns: 1fr; } }
/* Georgian section labels: no all-caps (it would switch to Mtavruli) and tighter tracking */
.a-title, .share-head span, .rank-head > span, .spark-head, .live-head, .tips-head { text-transform: none; letter-spacing: .3px; font-size: 11.5px; }

/* v9 — theme logos, scroll reveal, phone status bar, systems hover */
.logo-l { display: none; }
:root.light .logo-d { display: none; }
:root.light .logo-l { display: block; }
.lock-logo.logo-l { margin: 0 auto 6px; }
.logo-wrap { display: inline-flex; align-items: center; }
/* entrance: transform + opacity only (a blur filter over glass cards drops frames on iPhone) */
.sr { opacity: 0; transform: translateY(22px); }
.sr.in { animation: rise 760ms cubic-bezier(.16,1,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sr { opacity: 1; transform: none; } .sr.in { animation: none; } }
/* iOS 26 Safari tints its top/bottom bars live from the background-color of a full-width fixed element touching the edge.
   It skips elements with backdrop-filter (then falls back to a one-off pixel sample that never updates), so keep these solid. */
.topcap, .botcap { position: fixed; left: 0; right: 0; background-color: var(--bg); z-index: 70; pointer-events: none; }
.topcap { top: 0; height: max(22px, env(safe-area-inset-top, 0px)); }
.botcap { bottom: 0; height: 4px; }
@media (max-width: 800px) { .topcap { height: max(16px, env(safe-area-inset-top, 0px)); } }
@media (max-width: 820px) { .l1 { top: 140px; left: -220px; } }
#sy-grid { position: relative; }
.sys-chart { position: relative; }
.sys-bars rect.hit { fill: transparent; cursor: crosshair; }
.sys-bars g.b.on { opacity: 1; filter: drop-shadow(0 0 4px currentColor); }
.sys-bars:hover g.b:not(.on) { opacity: .45; }
.sys.zero .sys-bars { opacity: .25; }
.sys-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11.5px; color: var(--ink-3); }
.chip.new { color: var(--mint, #A8E8D1); border-color: rgba(168,232,209,0.4); padding: 2px 6px; }

/* v10 — AI vs external split */
.sys-bars rect.ex { opacity: .42; }
.sys-split { display: flex; gap: 12px; font: 500 11px var(--mono); color: var(--ink-2); }
.sys-split span { display: inline-flex; align-items: center; gap: 5px; }
.sys-split .sw.ex { opacity: .42; }

.spark.idle .sp-line { opacity: .35; stroke-dasharray: 4 4; }

.note.warn { border-color: rgba(243,189,168,0.45); color: var(--ink); background: rgba(243,189,168,0.08); }

/* v12 — theme switch: circular reveal from the click point (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; } ::view-transition-new(root) { z-index: 2; }
.theme-reveal *, .theme-reveal *::before, .theme-reveal *::after { transition: none !important; }

:root { color-scheme: dark; } :root.light { color-scheme: light; }

/* v13 — splash: Kingsmen badge draws in (outline → fill), then un-draws in reverse when the page is ready.
   Matches the real logo: dark theme = thick white outline badge + white K; light theme = black badge + white K. */
:root { --sp-line: #ffffff; --sp-badge: transparent; }
:root.light { --sp-line: #090909; --sp-badge: #090909; }
.splash { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center;
  animation: splashFailsafe .3s ease 7s forwards; }          /* never block the page if JS fails */
.splash .sp-logo { width: 120px; height: 120px; overflow: hidden; }   /* the source svg also holds the 'studio' wordmark outside the badge */
.splash .sp-badge { stroke: var(--sp-line); stroke-width: 100; fill: var(--sp-badge); fill-opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; }
.splash .sp-k { stroke: var(--sp-line); stroke-width: 18; stroke-linejoin: round; fill: #fff; fill-opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; }
.splash.draw .sp-badge { animation: spDraw .8s cubic-bezier(.65,0,.35,1) forwards, spFillBadge .35s ease .8s forwards; }
.splash.draw .sp-k { animation: spDraw .8s cubic-bezier(.65,0,.35,1) .25s forwards, spFillK .35s ease 1.05s forwards; }
.splash.out .sp-badge { stroke-dashoffset: 0; fill-opacity: 1; animation: spUnfillBadge .15s ease .05s forwards, spUndraw .35s cubic-bezier(.65,0,.35,1) .15s forwards; }
.splash.out .sp-k { stroke-dashoffset: 0; fill-opacity: 1; stroke-opacity: 0; animation: spUnfillK .15s ease forwards, spUndraw .35s cubic-bezier(.65,0,.35,1) .1s forwards; }
/* leaving overlaps the page's entrance (it starts rising underneath), so there is never an empty background */
.splash.out, .splash.quick { pointer-events: none; }
.splash.out { animation: splashFade .4s ease .3s forwards; }
.splash.quick { animation: splashFade .42s ease .06s forwards; }   /* ready mid-drawing: don't wait, the logo zooms out softly */
.splash.quick .sp-logo { animation: spAway .42s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes spAway { to { opacity: 0; transform: scale(1.12); } }
@media (max-width: 600px) { .splash .sp-logo { width: 72px; height: 72px; } }
@keyframes spDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes spUndraw { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 1; } }
@keyframes spFillBadge { from { fill-opacity: 0; } to { fill-opacity: 1; } }
@keyframes spUnfillBadge { from { fill-opacity: 1; } to { fill-opacity: 0; } }
@keyframes spFillK { from { fill-opacity: 0; stroke-opacity: 1; } to { fill-opacity: 1; stroke-opacity: 0; } }
@keyframes spUnfillK { from { fill-opacity: 1; stroke-opacity: 0; } to { fill-opacity: 0; stroke-opacity: 1; } }
@keyframes splashFade { to { opacity: 0; visibility: hidden; } }
@keyframes splashFailsafe { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .splash { display: none; } }

/* v15 — lock → dashboard: dots turn mint, the card lifts away while data loads */
.pin-dots.ok i { background: var(--mint); border-color: var(--mint); transform: scale(1.15); }
:root.light .pin-dots.ok i { background: #3FB58C; border-color: #3FB58C; }
.lock-card.leave { animation: lockLeave .44s cubic-bezier(.4,0,.2,1) .08s both; pointer-events: none; }
@keyframes lockLeave { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-14px) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .lock-card.leave { animation: none; opacity: 0; } }
.pin-dots.ok i { animation: dotPulse .9s ease-in-out infinite alternate; }
.pin-dots.ok i:nth-child(2) { animation-delay: .12s; } .pin-dots.ok i:nth-child(3) { animation-delay: .24s; } .pin-dots.ok i:nth-child(4) { animation-delay: .36s; }
@keyframes dotPulse { from { opacity: 1; transform: scale(1.15); } to { opacity: .45; transform: scale(.9); } }
.lock.leaving { position: fixed; inset: 0; z-index: 20; pointer-events: none; }

/* v16 — Refresh = Kingsmen OS radial button (platform ui/radial-button): page-coloured rest, an inverse fill that
   spreads from the pointer on hover/press and stays full (icon spinning) while the Mac mini is refreshing. */
.rbtn { --rb-rest: var(--bg); --rb-text: #f6f6f6; --rb-fill: #f6f6f6; --rb-ink: #121212; --rb-edge: rgba(255,255,255,.14);
  position: relative; isolation: isolate; overflow: hidden; height: 42px; padding: 0 18px; border: 1px solid var(--rb-edge); border-radius: 999px;
  background: var(--rb-rest); color: var(--rb-text); font: 600 14px/1 'Inter', sans-serif; cursor: pointer;
  transition: scale .18s ease-out; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:root.light .rbtn { --rb-text: #151517; --rb-fill: #151517; --rb-ink: #ffffff; --rb-edge: rgba(0,0,0,.12); }
.rbtn .rb-row { display: flex; align-items: center; justify-content: center; gap: 8px; height: 100%; pointer-events: none; }
.rbtn .rb-fill { position: absolute; inset: -1px; display: flex; align-items: center; justify-content: center; background: var(--rb-fill); color: var(--rb-ink);
  clip-path: circle(0px at 50% 50%); pointer-events: none; }
.rbtn:active:not(:disabled) { scale: .97; }
.rbtn:disabled { cursor: progress; }
.rbtn:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.rbtn.busy .spin-ico { animation: spin 1s linear infinite; }
@media (max-width: 820px) {   /* phone: icon only, same footprint as the theme / lock buttons */
  .top .rbtn { width: 42px; padding: 0; border-radius: 13px; }
  .rbtn .refresh-label { display: none; }
}
/* v17 — theme + lock use the same radial button; phone header: badge height = button height, live times beside the dot */
.rbtn.icon { width: 42px; padding: 0; border-radius: 13px; }
.collector .c-short { display: none; }
@media (max-width: 820px) {
  .top { gap: 10px; }
  .top-right { gap: 8px; min-width: 0; }
  .logo-wrap { flex-shrink: 0; }
  .top-logo.logo-d { height: 42px; }                  /* the dark logo's outlined badge spans the full svg height → 42px badge */
  .top-logo.logo-l { height: 44.6px; margin: -1.3px 0; } /* the light svg has ~3% padding around the badge */
  .collector { gap: 7px; min-width: 0; margin-right: 2px; }
  .collector .c-short { display: block; font: 500 9.5px/1.3 var(--mono); letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: clip; }
  .collector .c-short b { font-weight: 500; color: var(--ink-3); }
}
@media (max-width: 820px) {
  .top { gap: 8px; }
  .top-right { gap: 6px; }
  .top-right .rbtn { flex-shrink: 0; }
  .collector { gap: 6px; margin-right: 0; }
  .collector .c-short { font-size: 9px; letter-spacing: .2px; }
}
@media (max-width: 380px) {   /* small iPhones: keep badge = button height, just a size smaller */
  .top-right .rbtn { width: 38px; height: 38px; border-radius: 12px; }
  .top-logo.logo-d { height: 38px; }
  .top-logo.logo-l { height: 40.4px; margin: -1.2px 0; }
}
@media (max-width: 820px) {
  .collector { gap: 5px; padding-left: 4px; }
  .collector .c-short { font-size: 9px; letter-spacing: 0; text-transform: none; overflow: visible; }
  .collector.on .dot { animation-name: pulseSm; }
  @keyframes pulseSm { 0% { box-shadow: 0 0 0 0 rgba(168,232,209,.55); } 70% { box-shadow: 0 0 0 5px rgba(168,232,209,0); } 100% { box-shadow: 0 0 0 0 rgba(168,232,209,0); } }
}
.collector .dot { flex-shrink: 0; }
@media (max-width: 820px) { .collector { padding-left: 0; } .collector .c-short { overflow: hidden; } }
@media (max-width: 380px) { .collector .c-short b { display: none; } }   /* small iPhones: just the two ages */
@media (max-width: 820px) { .collector .c-short b { display: none; } .collector .c-short { font-size: 11px; } .collector.off .c-short { color: var(--peach); } }   /* phone: dot + one age only */
/* v19 — the badge's thick outline reads heavier than the thin button edge, so it sits ~10% under the button height */
@media (max-width: 820px) {
  .top-logo.logo-d { height: 38px; }
  .top-logo.logo-l { height: 40.4px; margin: -1.2px 0; }
}
@media (max-width: 380px) {
  .top-logo.logo-d { height: 34px; }
  .top-logo.logo-l { height: 36.1px; margin: -1.05px 0; }
}
/* v21 — lock / enroll buttons use the radial button too; touch screens get a real press instead of a fake hover */
.rbtn.wide { width: 100%; height: 52px; }
.sheet-actions .rbtn { height: 44px; }
@media (hover: none) {
  .rbtn { transition: scale .2s cubic-bezier(.2,.8,.2,1), background-color .2s ease; }
  .rbtn:active:not(:disabled) { scale: .93; background-color: color-mix(in srgb, var(--rb-text) 14%, var(--rb-rest)); transition-duration: .06s; }
}
.rbtn.wide { border-radius: 14px; }   /* matches the PIN field above it */
/* v22 — plain background: no coloured glow behind the page (Studio Black in dark, white in light) */
.lights { display: none; }

/* v23 — Agents list + per-agent panel */
.ag-link { cursor: pointer; }
.a-name.ag-link:hover, .share-list .ag-link:hover .nm, .r-row.ag-link:hover .nm, .live-item.ag-link:hover .nm { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(196,174,245,.6); }
.ag-cols, .ag-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) 140px 120px 76px; gap: 12px; align-items: center; }
.ag-cols { grid-template-columns: minmax(0, 1fr) 140px 120px 76px; padding: 0 14px 0 40px; font: 600 10px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-3); margin-bottom: -10px; }
.ag-cols span:nth-child(n+3) { text-align: right; }
.ag-list { display: flex; flex-direction: column; gap: 4px; }
.ag-row { width: 100%; text-align: left; background: rgba(255,255,255,0.02); border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 14px; color: var(--ink); cursor: pointer; font: inherit;
  transition: background .2s, border-color .2s, scale .18s ease-out; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .ag-row:hover { background: rgba(255,255,255,0.05); border-color: var(--line); } }
.ag-row:active { scale: .985; }
.ag-nm { min-width: 0; display: flex; flex-direction: column; }
.ag-nm b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-nm small { color: var(--ink-3); font: 400 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-spark { width: 140px; height: 26px; }
.ag-spark path { fill: none; stroke: var(--lilac); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.ag-n { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ag-n b { font: 600 13px var(--mono); }
.ag-bar { width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; display: block; }
.ag-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--lilac), var(--mist)); transition: width .9s var(--ease); }
.ag-p { text-align: right; font: 600 13px var(--mono); }
.ag-p .mut { color: var(--ink-3); font-weight: 400; }
@media (max-width: 820px) {
  .ag-cols { display: none; }
  .ag-row { grid-template-columns: 10px minmax(0, 1fr) 64px 58px; gap: 10px; padding: 10px 12px; }
  .ag-row .c-sp { display: none; }
}
/* panel: right drawer on desktop, bottom sheet on phone */
.agd-wrap { position: fixed; inset: 0; z-index: 80; }
.agd-back { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .3s ease; }
.agd-wrap.open .agd-back { opacity: 1; }
.agd { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(600px, calc(100vw - 24px)); display: flex; flex-direction: column;
  background: #0d0c11; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  transform: translateX(calc(100% + 24px)); transition: transform .38s cubic-bezier(.22,1,.36,1); overflow: hidden; }
.agd-wrap.open .agd { transform: none; }
:root.light .agd { background: #fff; box-shadow: 0 30px 80px rgba(40,27,65,.18); }
:root.light .agd-back { background: rgba(20,16,30,.25); }
.agd-grip { display: none; }
.agd-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 18px 12px; }
.agd-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.agd-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font: 700 14px var(--mono); color: #0b0b0e; flex-shrink: 0; }
.agd-tt { min-width: 0; }
.agd-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.agd-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.agd-sub .sd { margin-right: 2px; }
.agd-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 24px; -webkit-overflow-scrolling: touch; }
.agd-rangebar { position: sticky; top: 0; z-index: 3; padding: 4px 0 12px; background: inherit; }
.agd .agd-rangebar { background: linear-gradient(#0d0c11 75%, rgba(13,12,17,0)); }
:root.light .agd .agd-rangebar { background: linear-gradient(#fff 75%, rgba(255,255,255,0)); }
.agd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.agd-kpis .kpi .v { font-size: 20px; }
.agd-kpis .kpi .s { font-size: 10.5px; line-height: 1.3; }
.agd-sec { margin-top: 22px; }
.agd-chart svg { width: 100%; height: auto; display: block; }
.agd-chart .empty { padding: 26px 0; }
.agd .legend-row { margin-top: 8px; }
.ag-r { grid-template-columns: minmax(0, 1.4fr) 1fr 74px; }
.ag-r .nm { display: flex; align-items: center; gap: 7px; }
.ag-r .nm .sw { flex-shrink: 0; }
.src-ic { width: 16px; text-align: center; color: var(--ink-3); flex-shrink: 0; }
.tip .t-foot { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 4px; color: var(--ink-3); }
.t-total small { font: 500 11px var(--mono); color: var(--ink-3); }
html.agd-open, html.agd-open body { overflow: hidden; }
@media (max-width: 820px) {
  .agd { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 90dvh; height: 90dvh; border-radius: 22px 22px 0 0; border-bottom: 0;
    transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
  .agd-grip { display: flex; justify-content: center; padding: 8px 0 0; }
  .agd-grip i { width: 38px; height: 5px; border-radius: 3px; background: var(--line); }
  .agd-head { padding: 8px 16px 10px; }
  .agd-scroll { padding: 0 16px 28px; }
  .agd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ag-r { grid-template-columns: minmax(0, 1.5fr) 0.8fr 64px; }
}
@media (prefers-reduced-motion: reduce) { .agd, .agd-back { transition: none; } }
.agd-sub { display: block; }
.agd-sub .sd { margin: 0 4px 1px 0; vertical-align: middle; }
@media (max-width: 820px) {
  .ag-r { grid-template-columns: minmax(0, 1fr) 72px; }
  .ag-r .bar2 { display: none; }
  .ag-r .nm { flex-wrap: wrap; row-gap: 2px; white-space: normal; }
  .ag-r .nm .rt { margin-left: 0; }
}
.ag-r .nm.src { flex-wrap: nowrap; }
.src-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; padding: 0 4px; }
.ag-cap { font: 500 11px var(--mono); color: var(--ink-3); }
.ag-foot .a-more { margin: 0; }
.kpi-btn { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .2s, background .2s, scale .18s ease-out; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .kpi-btn:hover { border-color: var(--line); } }
.kpi-btn:active { scale: .97; }
.kpi-btn.on { border-color: rgba(196,174,245,.55); background: rgba(196,174,245,.10); box-shadow: inset 0 0 0 1px rgba(196,174,245,.25); }
.kpi-btn.on .l { color: var(--lilac); }
:root.light .kpi-btn.on { border-color: rgba(112,80,168,.45); background: rgba(112,80,168,.07); }
:root.light .kpi-btn.on .l { color: #7050A8; }
/* v27 — live indicator: green "Live" while the page reaches the server and the Mac mini is sending; red when either breaks */
.collector.on .c-short { color: var(--mint); }
.collector.off .dot { background: #FF5A5F; box-shadow: 0 0 0 0 rgba(255,90,95,.6); animation: pulseRed 1.6s infinite; }
.collector.off #collector-text, .collector.off .c-short { color: #FF7A7E; }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(255,90,95,.55); } 70% { box-shadow: 0 0 0 7px rgba(255,90,95,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,95,0); } }
:root.light .collector.on .c-short { color: #2E8F6F; }
:root.light .collector.off #collector-text, :root.light .collector.off .c-short { color: #D33A3F; }
@media (max-width: 820px) { .collector .c-short { font-weight: 600; letter-spacing: .3px; } }

/* v29: live "working now" rows */
.ag-now { color: var(--mint); font-weight: 600; }
:root.light .ag-now { color: #2E9C76; }
.ag-row.is-working { border-color: rgba(120, 230, 180, 0.28); background: rgba(120, 230, 180, 0.045); }
:root.light .ag-row.is-working { border-color: rgba(46, 156, 118, 0.35); background: rgba(46, 156, 118, 0.06); }

/* v32: Agents is the first section, above the subscription cards */
.hero + #agents-sec { margin-top: 0; }
#agents-sec + .grid { margin-top: 18px; }
