/* The web app's look (W9g; W10c: the shell, the brand and every page laid out again).
   Colors are roles. Dark mode is its own steps, not a flip: paper blue (s1) and live orange (s2)
   pass every palette check on both surfaces; text inks pass AA on theirs. */
:root {
  color-scheme: light;
  --page: #f5f6fa;
  --surface: #ffffff;
  --raised: #f8f9fc;
  --ink: #0f172a;
  --ink-2: #556074;
  --grid: #e8eaf0;
  --axis: #cbd2dd;
  --ring: rgba(15, 23, 42, 0.09);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --good: #006c10;
  --bad: #c62828;
  --warn: #b45309;
  --s1: #257de0;
  --s2: #f47230;
  --accent: #4f46e5;
  --on-accent: #ffffff;
  --wash: rgba(79, 70, 229, 0.08);
  --good-wash: rgba(0, 108, 16, 0.09);
  --bad-wash: rgba(198, 40, 40, 0.08);
  --warn-wash: rgba(180, 83, 9, 0.10);
  /* the sidebar is the brand's own dark in both modes */
  --side: #0f1629;
  --side-ink: #cbd5e1;
  --side-ink-2: #8a97ad;
  --side-on: rgba(255, 255, 255, 0.08);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0b0f1a;
    --surface: #121829;
    --raised: #172036;
    --ink: #e5e7eb;
    --ink-2: #94a3b8;
    --grid: #222a3d;
    --axis: #364156;
    --ring: rgba(255, 255, 255, 0.08);
    --shadow: none;
    --good: #53c556;
    --bad: #eb6263;
    --warn: #f59e0b;
    --s1: #338ced;
    --s2: #e76624;
    --accent: #818cf8;
    --on-accent: #0b1222;
    --wash: rgba(129, 140, 248, 0.12);
    --good-wash: rgba(83, 197, 86, 0.12);
    --bad-wash: rgba(235, 98, 99, 0.12);
    --warn-wash: rgba(245, 158, 11, 0.12);
    --side: #090d18;
    --side-on: rgba(255, 255, 255, 0.07);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--page); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0; }
h3 { font-size: 14px; margin: 0; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.note { color: var(--ink-2); font-size: 13px; }
.pos { color: var(--good); } .neg { color: var(--bad); } .warn { color: var(--warn); }

/* ---- the brand */
.wordmark { display: flex; flex-direction: column; line-height: 1.05; margin: 0; }
.wordmark span { font-weight: 800; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; }
.wordmark small { font-size: 9.5px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-2); margin-top: 3px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; display: block; }

/* ---- the gate pages: signed out, waiting */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--wash), transparent), var(--page); }
.gate-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--ring); border-radius: 18px; box-shadow: var(--shadow); padding: 36px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gate-logo { border-radius: 16px; }
.gate-card .wordmark { align-items: center; }
.gate-card h1 { font-size: 20px; margin-top: 6px; }
.gate-card p { margin: 0; }

/* ---- the shell: a sidebar, and a top bar with a drawer on narrow screens */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; gap: 22px; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 4px 8px; }
.side .wordmark span { color: #f8fafc; }
.side .wordmark small { color: var(--side-ink-2); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; color: var(--side-ink); padding: 9px 12px; border-radius: 8px; font-weight: 500; position: relative; }
.side nav a svg.i { color: var(--side-ink-2); }
.side nav a:hover { background: var(--side-on); text-decoration: none; }
.side nav a.on { background: var(--side-on); color: #ffffff; }
.side nav a.on svg.i { color: #a5b4fc; }
.side nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #818cf8; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 14px; color: #ffffff; background: linear-gradient(135deg, #2dd4bf, #8b5cf6); }
.me-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.me-text .me-name { max-width: 100%; }
.me-wallet { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; max-width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--side-ink-2); font-size: 12px; text-align: left; cursor: pointer; }
.me-wallet span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-address { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.me-balance { font-weight: 600; color: var(--side-ink); }
.me-wallet:hover, .me-wallet:focus-visible { color: #ffffff; text-decoration: underline; }
.wallet-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; }
.wallet-bar-address { flex: 1 1 320px; min-width: 0; }
.wallet-bar-address .address { margin-bottom: 0; }
.wallet-bar-balance { flex: none; padding-bottom: 10px; }
.wallet-bar-balance strong { display: block; font-size: 20px; margin-top: 4px; }
.side .icon-btn { color: var(--side-ink-2); }
.side .icon-btn:hover { color: #ffffff; background: var(--side-on); }
.topbar { display: none; }
.scrim { display: none; }
main { min-width: 0; padding: 28px 32px 48px; max-width: 1320px; width: 100%; }

/* ---- page heads */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.sub { color: var(--ink-2); margin: 4px 0 0; max-width: 72ch; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 500; margin-bottom: 10px; }
.crumb svg.i { width: 16px; height: 16px; }
.crumb:hover { color: var(--ink); text-decoration: none; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- the message line */
#msg { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: var(--wash); border: 1px solid var(--ring); }
#msg:empty { display: none; }
#msg.error { background: var(--bad-wash); color: var(--bad); }

/* ---- controls */
button, .button { font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; min-height: 36px; border: 1px solid var(--ring); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); }
button:hover, .button:hover { background: var(--raised); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, .button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-wash); }
button.small, .button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: 0.5; cursor: default; filter: none; }
button svg.i, .button svg.i { width: 16px; height: 16px; }
.icon-btn { min-height: 34px; width: 34px; padding: 0; border: 0; background: transparent; box-shadow: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input { font: inherit; padding: 8px 12px; min-height: 40px; border: 1px solid var(--axis); border-radius: 8px; background: var(--surface); color: inherit; width: 100%; }
input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--wash); }
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 6px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface); border: 1px solid var(--ring); box-shadow: var(--shadow); }
.seg button { min-height: 28px; padding: 3px 12px; border: 0; box-shadow: none; background: transparent; color: var(--ink-2); font-size: 13px; border-radius: 6px; }
.seg button:hover { color: var(--ink); background: var(--raised); }
.seg button.on { background: var(--accent); color: var(--on-accent); }

/* ---- cards */
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--grid); }
.card-head h2 { margin-right: auto; }
.card > .card-head:first-child { margin: -18px -20px 14px; }
.card.flush > .card-head:first-child { margin: 0; }
.card.flush > .note.pad { margin: 0; padding: 12px 20px 0; }
.card.flush > .note.pad:empty { display: none; }
.card .actions, .actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.split > .card { margin: 0; }
.empty { text-align: center; padding: 28px 20px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---- pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 999px; background: var(--raised); color: var(--ink-2); border: 1px solid var(--ring); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.paper::before { background: var(--s1); } .pill.live::before { background: var(--s2); }
.pill.paper, .pill.live { color: var(--ink); }
.pill.good { color: var(--good); background: var(--good-wash); border-color: transparent; }
.pill.bad { color: var(--bad); background: var(--bad-wash); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-wash); border-color: transparent; }
.pill.plain::before { display: none; }

/* ---- figures: the dashboard's overview, and rows of tiles */
.overview { display: grid; grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 16px; margin-bottom: 16px; }
.overview .hero { grid-row: span 2; }
.kpis { display: grid; gap: 16px; margin-bottom: 16px; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tile-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.tile-value { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-value .unit, .hero-value .unit { font-size: 0.55em; font-weight: 600; color: var(--ink-2); margin-left: 5px; letter-spacing: 0; }
.tile-note { font-size: 12.5px; color: var(--ink-2); }
.hero { justify-content: space-between; gap: 14px; padding: 22px 24px; background: linear-gradient(160deg, var(--wash), transparent 60%), var(--surface); }
.hero-value { font-size: 44px; line-height: 1.05; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.legs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.leg { background: var(--raised); border: 1px solid var(--ring); border-radius: 10px; padding: 10px 12px; }
.leg-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.leg-value { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }

/* ---- the welcome card for a user with no bots */
.welcome { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 24px; background: linear-gradient(120deg, var(--wash), transparent 70%), var(--surface); }
.welcome h2 { font-size: 18px; margin-bottom: 4px; }
.welcome ol { margin: 10px 0 0; padding-left: 20px; color: var(--ink-2); }
.welcome ol li { margin: 3px 0; }
.welcome .actions { margin: 0; flex-direction: column; }

/* ---- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
thead th { font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); background: var(--raised); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--raised); }
th.tick, td.tick { width: 36px; padding-right: 0; }
td .name { font-weight: 600; color: var(--ink); white-space: nowrap; }
td .name:hover { color: var(--accent); }
td details summary { cursor: pointer; color: var(--accent); font-size: 12.5px; margin-top: 2px; }
td details ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 12.5px; color: var(--ink-2); }
.flags { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---- bots */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.bot-grid > .card { margin: 0; }
.bot { display: flex; flex-direction: column; gap: 14px; }
.bot-head { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bot-name { font-weight: 700; font-size: 15px; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.bot-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--ring); border-radius: 10px; background: var(--raised); }
.stat { padding: 10px 12px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--ring); }
.stat-label { font-size: 11.5px; color: var(--ink-2); }
.stat-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value .unit { font-size: 11px; font-weight: 600; color: var(--ink-2); margin-left: 3px; }
.bot-lines { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.bot-lines li.warn { color: var(--warn); }
.bot .actions { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--grid); }
.bot .actions .push { margin-left: auto; }
.bot .history, .bot .details { border-top: 1px solid var(--grid); padding-top: 10px; }

/* ---- facts: a bot's settings, what it follows */
.facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; }
.facts dt, .facts dd { padding: 9px 0; border-bottom: 1px solid var(--grid); margin: 0; }
.facts dt { color: var(--ink-2); padding-right: 18px; }
.facts dd { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.lines-list { margin: 0; padding: 0; list-style: none; }
.lines-list li { padding: 8px 0; border-bottom: 1px solid var(--grid); }
.lines-list li:last-child { border-bottom: 0; }
.details h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin: 0 0 6px; }
.details h3 + ul { margin-bottom: 14px; }
.details ul { margin: 0; padding-left: 1.1em; }
.details ul li { margin: 3px 0; }

/* ---- a bot's positions */
.history { overflow-x: auto; }
.history td, .history th { white-space: nowrap; }
.history td { padding-top: 9px; padding-bottom: 9px; }
.history tr.trade td { font-size: 12.5px; color: var(--ink-2); padding-top: 5px; padding-bottom: 5px; border-bottom-style: dashed; }
.history tr.position td { font-weight: 500; }
.history .empty { padding: 24px; }

/* ---- the wallet */
.address { display: flex; align-items: center; gap: 8px; background: var(--raised); border: 1px solid var(--ring); border-radius: 10px; padding: 8px 8px 8px 14px; margin: 6px 0 4px; }
.address code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.callout { border-radius: 10px; padding: 10px 12px; background: var(--raised); border: 1px solid var(--ring); font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.callout.warn { background: var(--warn-wash); border-color: transparent; color: var(--warn); }

/* ---- messages */
.notice { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 4px 14px; padding: 14px 20px; border-bottom: 1px solid var(--grid); }
.notice:last-child { border-bottom: 0; }
.notice-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--ring); font-size: 17px; }
.notice-text { white-space: pre-wrap; margin: 0; overflow-wrap: anywhere; }
.notice time { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.pnl-card { grid-column: 2; display: block; max-width: 100%; width: 360px; border-radius: 10px; border: 1px solid var(--ring); margin-top: 6px; }

/* ---- users */
.user { padding: 0; }
.user-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; flex-wrap: wrap; }
.user-row .avatar { width: 40px; height: 40px; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.user-who { flex: 1; min-width: 180px; }
.user-who strong { display: block; }
.user > details { border-top: 1px solid var(--grid); }
.user > details > summary { cursor: pointer; padding: 10px 20px; color: var(--ink-2); font-weight: 500; }
.user > details > .bot-grid { padding: 0 20px 20px; }

/* ---- forms */
.copy-form { max-width: 720px; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.verdict { margin: 0; padding: 0; list-style: none; }
.verdict li { padding: 8px 0; border-bottom: 1px solid var(--grid); }
.verdict li:last-child { border-bottom: 0; }
#copy-card { max-width: 720px; }
dialog { border: 1px solid var(--ring); border-radius: 16px; background: var(--surface); color: var(--ink); padding: 24px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25); }
dialog::backdrop { background: rgba(9, 13, 24, 0.55); }
dialog h2 { font-size: 17px; margin-bottom: 16px; }
dialog input { margin-bottom: 14px; }
menu { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 16px 0 0; }

/* ---- charts: thin marks, hairline grid, the series colors on marks only (text stays in the inks) */
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 10px; }
.chart-head h3 { flex: 0 0 auto; font-size: 15px; }
.chart-sub { flex: 1 1 100%; order: 2; margin: 0; font-size: 12.5px; color: var(--ink-2); }
.legend { display: flex; gap: 14px; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: 12.5px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.key { display: inline-block; flex: none; }
.key.line { width: 14px; height: 2px; border-radius: 1px; }
.key.rect { width: 10px; height: 10px; border-radius: 3px; }
.key.s1 { background: var(--s1); } .key.s2 { background: var(--s2); }
.plot { position: relative; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot svg:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.plot-empty { display: grid; place-items: center; text-align: center; min-height: 150px; border: 1px dashed var(--axis); border-radius: 10px; color: var(--ink-2); font-size: 13px; padding: 16px; background: var(--raised); }
svg .grid { stroke: var(--grid); stroke-width: 1; }
svg .base { stroke: var(--axis); stroke-width: 1; }
svg .tick { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
svg .end, svg .value { fill: var(--ink); font-size: 12px; }
svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg .line.s1 { stroke: var(--s1); } svg .line.s2 { stroke: var(--s2); }
svg .area.s1 { fill: var(--s1); opacity: 0.10; }
svg .dot { stroke: var(--surface); stroke-width: 2; }
svg .dot.s1, svg .col.s1 { fill: var(--s1); } svg .dot.s2, svg .col.s2 { fill: var(--s2); }
svg .cross { stroke: var(--axis); stroke-width: 1; }
svg .hit { fill: transparent; }
svg .bar-row:hover .col, svg .bar-row:focus .col { opacity: 0.8; }
svg .bar-row:focus { outline: none; }
svg .bar-row:focus .hit { fill: var(--wash); }
.tip { position: absolute; min-width: 150px; background: var(--surface); border: 1px solid var(--ring); border-radius: 8px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); font-size: 12px; pointer-events: none; z-index: 1; }
.tip-title { color: var(--ink-2); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row strong { font-variant-numeric: tabular-nums; }
.tip-name { color: var(--ink-2); }
.table-view { margin-top: 8px; font-size: 13px; }
.table-view summary { cursor: pointer; color: var(--ink-2); }
.table-view table { margin-top: 6px; }
.table-view td, .table-view th { padding: 4px 10px; }

/* ---- narrower screens */
@media (max-width: 1180px) {
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview .hero { grid-column: 1 / -1; grid-row: auto; }
  .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 5; padding: 10px 14px; background: var(--side); color: var(--side-ink); }
  .topbar .wordmark span { color: #f8fafc; font-size: 13.5px; }
  .topbar .wordmark small { color: var(--side-ink-2); font-size: 8.5px; }
  .topbar .icon-btn { color: var(--side-ink); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 7; width: 272px; height: auto; transform: translateX(-100%); transition: transform 0.2s ease; }
  .side.open { transform: none; box-shadow: 0 0 48px rgba(0, 0, 0, 0.4); }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 6; background: rgba(9, 13, 24, 0.5); }
  main { padding: 20px 16px 40px; }
  h1 { font-size: 21px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .welcome { grid-template-columns: minmax(0, 1fr); }
  .welcome .actions { flex-direction: row; }
}
@media (max-width: 560px) {
  .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.three > :first-child { grid-column: 1 / -1; }
  .tile { padding: 12px 14px; }
  .tile-value { font-size: 19px; }
  .hero-value { font-size: 34px; }
  .page-head { align-items: flex-start; }
  .card { padding: 16px; }
  .card > .card-head:first-child { margin: -16px -16px 12px; padding: 12px 16px; }
  .bot-grid { grid-template-columns: minmax(0, 1fr); }
  .notice { grid-template-columns: 32px minmax(0, 1fr); padding: 12px 16px; }
  .notice time { grid-column: 2; grid-row: 2; }
  .notice-icon { width: 32px; height: 32px; }
  .input-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
