/* HQ — the platform cockpit. Standalone: this page shares no code with the
   product app, so it carries its own tokens, written to the same scale the
   app uses (page / canvas / surface / inset grounds; ink / ink-2 / ink-3).
   One elevated pane on a bare page, hairlines between siblings, monochrome
   with colour as punctuation, and nothing that moves to say "state". */
:root {
  --page:#f3f4f5; --canvas:#ffffff; --surface:#ffffff; --inset:#f7f8f9; --hover:#f4f5f6; --hover-2:#e7e9eb;
  --line:#ecedef; --line-strong:#d9dbde; --ink:#1f2124; --ink-2:#62656b; --ink-3:#85888e; --ink-4:#a9acb1;
  --accent:#0285ff; --accent-tint:#e9f3ff; --green:#189a4d; --green-tint:#e8f5ed; --red:#e3474c; --red-tint:#fcecec; --orange:#ef720c; --orange-tint:#fdf1e5;
  --c-spend:#2a78d6; --c-runs:#1baf7a; --c-msgs:#eda100; --c-signups:#4a3aa7; --c-orgs:#008300; --c-tokens:#eb6834;
  --c-errors:#e34948; --c-tools:#0f8f9e; --c-latency:#8a4fbd; --c-turns:#5a6b7a; --c-outbound:#c2557a; --c-active:#3a7d5c; --c-people:#4a6cf7;
  --grid:#eef0f2; --tip-bg:#ffffff; --sel:#eef3fb; --shadow:0 8px 24px rgba(0,0,0,.12);
  --r-sm:6px; --r:10px; --r-lg:14px;
}
[data-theme="dark"] {
  --page:#17181a; --canvas:#1c1d1f; --surface:#232427; --inset:#1f2022; --hover:#2a2b2e; --hover-2:#313236;
  --line:#2e3033; --line-strong:#3a3c40; --ink:#f2f3f4; --ink-2:#a5a8ad; --ink-3:#6c6f75; --ink-4:#4f5257;
  --accent:#3d9aff; --accent-tint:#3d9aff29; --green:#3dbb72; --green-tint:#3dbb7224; --red:#ee5c61; --red-tint:#ee5c6124; --orange:#f68f3c; --orange-tint:#f68f3c24;
  --c-spend:#3987e5; --c-runs:#199e70; --c-msgs:#c98500; --c-signups:#9085e9; --c-orgs:#2f9e2f; --c-tokens:#d95926;
  --c-errors:#e66767; --c-tools:#1ba3b4; --c-latency:#a06fd0; --c-turns:#8b9aa8; --c-outbound:#d1698c; --c-active:#4f9a76; --c-people:#6f8cff;
  --grid:#26282b; --tip-bg:#232427; --sel:#1f2733; --shadow:0 8px 24px rgba(0,0,0,.5);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { background: var(--page); color: var(--ink); font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
svg.ic { width: 15px; height: 15px; fill: currentColor; flex: none; }

/* ---- shell: one pane on the page ---- */
.shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }
.side { padding: 14px 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 8px; padding: 2px 8px 10px; }
.brand b { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.brand span { color: var(--ink-3); font-size: 12px; }
.side .find { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink-3); font-size: 12.5px; border: 1px solid var(--line); background: var(--canvas); margin-bottom: 8px; }
.side .find:hover { color: var(--ink-2); border-color: var(--line-strong); }
.side .find kbd { margin-left: auto; font: 11px/1 ui-monospace, Menlo, monospace; color: var(--ink-4); }
.side .grp { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); padding: 12px 8px 4px; }
.side a.nav { display: flex; align-items: center; gap: 9px; padding: 0 8px; height: 30px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 13px; }
.side a.nav svg { color: var(--ink-3); }
.side a.nav:hover { background: var(--hover-2); color: var(--ink); }
.side a.nav.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.side a.nav.on svg { color: var(--ink); }
.side a.nav .n { margin-left: auto; font-size: 11.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; font-weight: 500; }
.side a.nav .n.hot { color: var(--red); }
.side .foot { margin-top: auto; padding: 8px 4px 0; display: flex; flex-direction: column; gap: 2px; }
.side .foot button { display: flex; align-items: center; gap: 9px; padding: 0 8px; height: 28px; border-radius: var(--r-sm); color: var(--ink-3); font-size: 12.5px; width: 100%; text-align: left; }
.side .foot button:hover { color: var(--ink); background: var(--hover-2); }

.pane { margin: 8px 8px 0 0; background: var(--canvas); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; min-height: calc(100vh - 8px); min-width: 0; }
.head { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--canvas); z-index: 5; border-radius: var(--r) var(--r) 0 0; }
.head .title { font-size: 14px; font-weight: 600; }
.head .meta { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.head .meta b { color: var(--ink-2); font-weight: 500; }
.head .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.head a.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 12.5px; margin-right: 4px; }
.head a.back:hover { color: var(--ink); }
.body { padding: 14px 16px 60px; display: flex; flex-direction: column; gap: 22px; }
.body.wide { max-width: none; }

/* ---- controls (one system) ---- */
.ctl { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.ctl:hover { border-color: var(--line-strong); color: var(--ink); }
.ctl.on { color: var(--ink); border-color: var(--line-strong); font-weight: 600; }
.ctl svg { color: var(--ink-3); }
select.ctl { -webkit-appearance: none; appearance: none; padding-right: 22px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 12px) 12px, calc(100% - 8px) 12px; background-size: 4px 4px; background-repeat: no-repeat; }
input.ctl { cursor: text; width: 210px; outline: none; }
input.ctl::placeholder { color: var(--ink-4); }
input.ctl:focus { border-color: var(--line-strong); }
.ghost { color: var(--ink-3); font-size: 12.5px; padding: 0 6px; height: 28px; border-radius: var(--r-sm); }
.ghost:hover { color: var(--ink); background: var(--hover-2); }
.danger { color: var(--ink-4); font-size: 12px; }
.danger:hover { color: var(--red); }
.primary { height: 32px; padding: 0 14px; border-radius: var(--r-sm); background: var(--ink); color: var(--canvas); font-weight: 600; }

.fbar { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--canvas); }
.fbar .n { margin-left: auto; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.msel { position: relative; }
.msel-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; min-width: 240px; max-height: 320px; overflow-y: auto; box-shadow: var(--shadow); }
.msel-panel label { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 5px 6px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); }
.msel-panel label:hover { background: var(--hover); }
.msel-panel input[type=checkbox] { width: auto; margin: 0; }
.msel-panel .srch { width: 100%; margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-size: 12px; cursor: pointer; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.chip.on { color: var(--ink); border-color: var(--line-strong); }
.chip.on i { background: var(--chip-c); }

/* ---- sections ---- */
.sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sec-h { display: flex; align-items: baseline; gap: 10px; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.sec-h span { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12px; color: var(--ink-3); }
.sec-h .right { margin-left: auto; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
@media (max-width: 1100px) { .cols2, .cols3 { grid-template-columns: 1fr; } }
.empty { color: var(--ink-3); font-size: 12.5px; padding: 14px 0; }
.note { color: var(--ink-3); font-size: 12.5px; }

/* ---- the metric strip: quiet numbers divided by hairlines, never tiles ---- */
.kpis { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kpi { flex: 1 1 120px; min-width: 112px; padding: 10px 14px 9px 0; margin-right: 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.kpi:last-child { border-right: 0; }
.kpi i { font-style: normal; font-size: 11px; color: var(--ink-3); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.2; display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.kpi b small { font-size: 11.5px; font-weight: 600; }
.kpi b small.up { color: var(--green); } .kpi b small.down { color: var(--red); } .kpi b small.flat { color: var(--ink-4); }
.kpi s { text-decoration: none; font-size: 11.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.kpi svg.spark { margin-top: 3px; }
.kpi.bad b { color: var(--red); }
.kpi.link { cursor: pointer; } .kpi.link:hover i { color: var(--ink); }

/* ---- lists and tables: siblings share a ground, hairlines divide them ---- */
.scroll { overflow-x: auto; min-width: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 6px 10px; font-size: 12.5px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; height: 32px; }
th { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; user-select: none; background: var(--canvas); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th.sort { cursor: pointer; } th.sort:hover { color: var(--ink); }
th .dir { font-size: 9px; margin-left: 3px; }
td.soft { color: var(--ink-2); } td.muted { color: var(--ink-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; max-width: 460px; line-height: 1.35; }
td.trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
td.strong { font-weight: 600; }
tr.rowlink { cursor: pointer; } tr.rowlink:hover td { background: var(--hover); }
td.act, th.act { position: sticky; right: 0; background: var(--canvas); text-align: right; padding-left: 8px; }
tr.rowlink:hover td.act { background: var(--hover); }
tr.sel td { background: var(--sel); }
td .sub { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: -1px; }
.dash { color: var(--ink-4); }
.bad { color: var(--red); }
.good { color: var(--green); }
.warn { color: var(--orange); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; height: 18px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); white-space: nowrap; font-weight: 500; line-height: 1; }
.pill.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); background: var(--green-tint); }
.pill.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: var(--red-tint); }
.pill.warn { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 35%, transparent); background: var(--orange-tint); }
.pill.paid { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-tint); }
.pill.ink { color: var(--ink); border-color: var(--line-strong); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--ink-4); }
.dot.ok { background: var(--green); } .dot.bad { background: var(--red); } .dot.warn { background: var(--orange); } .dot.run { background: var(--accent); }
.meter { display: inline-block; width: 46px; height: 4px; border-radius: 2px; background: var(--inset); vertical-align: 2px; margin-left: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--red); }
.meter.ok i { background: var(--green); }
.bar-cell { display: inline-block; height: 5px; border-radius: 2px; background: var(--accent); vertical-align: 1px; opacity: .8; }
.stage { display: inline-flex; gap: 3px; }
.stage i { width: 8px; height: 8px; border-radius: 2px; background: var(--inset); border: 1px solid var(--line); }
.stage i.on { background: var(--green); border-color: var(--green); }
.stage i.paid { background: var(--accent); border-color: var(--accent); }
.more { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-2); font-size: 12.5px; padding: 7px; background: var(--surface); }
.more:hover { border-color: var(--line-strong); color: var(--ink); }
.tip { position: fixed; pointer-events: none; background: var(--tip-bg); color: var(--ink); font-size: 12px; padding: 6px 10px; border-radius: var(--r-sm); white-space: nowrap; z-index: 60; display: none; font-variant-numeric: tabular-nums; border: 1px solid var(--line); box-shadow: var(--shadow); line-height: 1.5; }
.tip b { font-weight: 600; }

/* ---- charts ---- */
.chart { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 6px; background: var(--surface); min-width: 0; }
.chart h3 { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; display: flex; gap: 8px; align-items: baseline; }
.chart h3 em { font-style: normal; color: var(--ink-3); font-weight: 500; margin-left: auto; font-variant-numeric: tabular-nums; }
.chart svg { display: block; width: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 2px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.charts2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.charts3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .charts2, .charts3 { grid-template-columns: 1fr; } }

/* ---- what changed ---- */
.changes { display: flex; flex-direction: column; }
.change { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.change:hover .ct { color: var(--ink); }
.change .sev { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); align-self: center; }
.change .sev.s3 { background: var(--red); } .change .sev.s2 { background: var(--orange); } .change .sev.s1 { background: var(--accent); }
.change .ct { font-size: 13px; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.change .cd { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 1px; white-space: normal; }
.change .when { font-size: 11.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

/* ---- live ---- */
.live-row { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .live-row { grid-template-columns: 1fr; } }
.facts { display: flex; flex-direction: column; }
.fact { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.fact i { font-style: normal; color: var(--ink-3); flex: 1; }
.fact b { font-weight: 600; font-variant-numeric: tabular-nums; }
.fact .sub { color: var(--ink-3); font-size: 11.5px; }

/* ---- cost summary: outlier facts + the prompt-cache table ---- */
.fact.link { cursor: pointer; }
.fact.link:hover i, .fact.link:hover .sub { color: var(--ink-2); }
.cache { display: flex; flex-direction: column; }
.crow { display: grid; grid-template-columns: minmax(140px, 1fr) 120px 52px minmax(0, 1.1fr); gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.crow .cm { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .cb { height: 6px; background: var(--inset); border-radius: 3px; overflow: hidden; }
.crow .cb i { display: block; height: 100%; background: var(--c-active); }
.crow .cv { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.crow .cn { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
/* A rate measured over a handful of turns is an anecdote: it stays in the
   table (hiding it would be its own lie) but reads as the weaker claim. */
.crow.thin .cm, .crow.thin .cv { color: var(--ink-3); }
.crow.thin .cb i { background: var(--ink-4); }
@media (max-width: 800px) { .crow { grid-template-columns: minmax(0, 1fr) 52px; } .crow .cb, .crow .cn { display: none; } }

/* ---- funnel ---- */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.frow { display: grid; grid-template-columns: 220px minmax(0, 1fr) 120px; gap: 14px; align-items: center; font-size: 12.5px; }
.frow .fl { color: var(--ink-2); }
.frow .fb { height: 18px; background: var(--inset); border-radius: 3px; overflow: hidden; }
.frow .fb i { display: block; height: 100%; background: var(--c-active); }
.frow .fv { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.frow .fv s { text-decoration: none; color: var(--ink-3); margin-left: 6px; }

/* ---- cohort grid ---- */
.cohort { border-collapse: separate; border-spacing: 2px; width: auto; }
.cohort th, .cohort td { border: 0; height: auto; padding: 0; position: static; }
.cohort th { font-size: 10.5px; padding: 0 4px 4px; text-align: center; background: none; }
.cohort th.lab { text-align: left; }
.cohort td.lab { font-size: 12px; color: var(--ink-2); padding-right: 8px; white-space: nowrap; }
.cohort td.sz { font-size: 11.5px; color: var(--ink-3); padding-right: 6px; text-align: right; }
.cohort td.c { width: 44px; height: 24px; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; border-radius: 3px; color: var(--ink-2); background: var(--inset); }
.cohort td.c.na { background: transparent; color: var(--ink-4); }

/* ---- trace: waterfall + steps ---- */
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 18px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.props div { font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.props div i { display: block; font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; }
.props div span { font-variant-numeric: tabular-nums; }
.wf { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.wf svg { display: block; width: 100%; }
.wf .wf-lab { font-size: 11px; fill: var(--ink-2); }
.wf .wf-lab.dim { fill: var(--ink-3); }
.wf .wf-axis { font-size: 9.5px; fill: var(--ink-4); }
.wf rect.bar { cursor: pointer; }
.wf rect.bar.sel { stroke: var(--ink); stroke-width: 1; }
.wf-detail { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 10px 12px; font-size: 12.5px; }
.wf-detail h4 { font-size: 12.5px; font-weight: 600; display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.wf-detail h4 em { font-style: normal; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.plabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-top: 8px; font-weight: 650; }
pre.code { background: var(--inset); border-radius: var(--r-sm); padding: 8px 10px; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; color: var(--ink-2); }
pre.code.err { color: var(--red); }
.trace { display: flex; flex-direction: column; }
.tstep { padding: 7px 0; border-bottom: 1px solid var(--line); }
.tstep-h { display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.tstep-h:hover .tname { color: var(--ink); }
.tstep .tname { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.tstep .tkit { font-size: 11.5px; color: var(--ink-3); }
.tstep .tms { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tstep .tbar { height: 3px; border-radius: 2px; background: var(--inset); margin-top: 5px; overflow: hidden; max-width: 340px; }
.tstep .tbar i { display: block; height: 100%; background: var(--c-tools); }
.tstep.fail .tbar i { background: var(--red); }
.tbeat { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tbeat span { text-transform: uppercase; letter-spacing: .07em; font-weight: 650; margin-right: 8px; color: var(--ink-3); }
.tmsg { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto; }
.tmsg b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: 3px; }
.tmsg.err { color: var(--red); }

/* ---- money (unchanged shapes, new skin) ---- */
.money-flow { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; overflow-x: auto; background: var(--surface); }
.money-flow .sankey { display: block; width: 100%; min-width: 860px; max-height: 460px; }
.money-positive { color: var(--green); } .money-negative { color: var(--red); }
#ec-body table { min-width: 1400px; } #ec-body td.wrap { min-width: 280px; max-width: 380px; } #ei-body table { min-width: 1250px; }

/* ---- command palette ---- */
.pal-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; }
.pal { width: 560px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.pal input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 13px 16px; font-size: 14px; outline: none; }
.pal .res { max-height: 400px; overflow-y: auto; padding: 6px; }
.pal .rg { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-4); padding: 8px 10px 3px; font-weight: 650; }
.pal .ri { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); cursor: pointer; }
.pal .ri svg { color: var(--ink-3); }
.pal .ri .h { margin-left: auto; color: var(--ink-4); font-size: 11.5px; }
.pal .ri.on { background: var(--hover-2); color: var(--ink); }

.pal form { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.pal form h3 { font-size: 14px; font-weight: 600; }
.pal form p { font-size: 12.5px; color: var(--ink-3); }
.pal form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.pal form .ctl { width: 100%; height: 32px; }
.pal form .row { display: flex; gap: 8px; }
.pal form .row label { flex: 1; }
.pal form .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.pal form .primary { width: auto; margin: 0; }
.pal form .err { margin: 0; }

/* ---- gate ---- */
.gate { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; }
.gate h1 { font-size: 15px; font-weight: 650; }
.gate p { color: var(--ink-3); font-size: 12.5px; margin: 8px 0 14px; }
.gate input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; outline: none; }
.gate input:focus { border-color: var(--line-strong); }
.gate .primary { margin-top: 10px; width: 100%; }
.err { color: var(--red); font-size: 12.5px; margin-top: 10px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 2px 6px; padding: 8px 10px; }
  .side .grp { width: 100%; padding: 6px 4px 2px; }
  .side .foot { margin: 0; flex-direction: row; width: 100%; }
  .pane { margin: 0; border-radius: 0; border-left: 0; border-right: 0; }
  .head { border-radius: 0; }
  .kpi { flex-basis: 45%; }
  .frow { grid-template-columns: 130px minmax(0, 1fr) 90px; }
}
