/* GetSignal admin panel, v3 (docs/ADMIN-V3.md).
   Dark only: an ops console one person reads every day, in the same dark
   the app and the site already are. Inter for everything, DM Mono for
   numbers in tables, Syne for the wordmark and nothing else. */

/* ---- Fonts --------------------------------------------------------------
   ABSOLUTE urls on purpose. The panel is served from workers.dev as well as
   from getsignal.finance, and a root-relative /fonts/... resolves against
   whichever origin loaded the page - on workers.dev that is a 404 and the
   whole panel silently falls back to system faces. */
@font-face { font-family: 'Syne'; font-weight: 800; font-display: swap; src: url('https://getsignal.finance/fonts/syne-800.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('https://getsignal.finance/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('https://getsignal.finance/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 400; font-display: swap; src: url('https://getsignal.finance/fonts/dm-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 500; font-display: swap; src: url('https://getsignal.finance/fonts/dm-mono-500.woff2') format('woff2'); }

/* ---- Tokens ------------------------------------------------------------- */
:root {
  color-scheme: dark;
  /* The surface a table sits on, for its scroll cue (.tbl-wrap): the page,
     unless a panel, a drawer or an expanded row says otherwise. */
  --surface: var(--bg);
  --bg: #07090d;
  --s1: #11141d;
  --s2: #1c2030;
  --s3: #262c3d;
  --line: #1c2030;
  --line-2: #262c3d;
  --text: #e8eaf2;
  --text-2: #8a92a6;
  --text-3: #5d6578;
  --tint: #3b7fe8;
  --tint-btn: #2f6ede;
  --tint-text: #8ab4f8;
  --tint-soft: rgba(59, 127, 232, 0.1);
  --tint-chip: rgba(59, 127, 232, 0.14);
  /* Market direction only. Never an accent, never a button. */
  --up: #4ade80;
  --down: #ff4757;
  /* Status. */
  --ok: #3b7fe8;
  --warn: #ffc84a;
  --bad: #ff4757;
  --good: #4ade80;
  /* Series. */
  --c1: #3b7fe8;
  --c2: #8b9dff;
  --c3: #2dd4bf;
  --c4: #ff9248;
  --c5: #a78bfa;
  --c6: #ffc84a;

  --font-display: 'Syne', system-ui, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r: 10px;
  --r-sm: 6px;
  --rail: 220px;
  --head: 56px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3, p, ul, ol, dl, dd, dt { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--tint-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--tint-chip); }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Utilities ---------------------------------------------------------- */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.dim { color: var(--text-2); }
.faint { color: var(--text-3); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.tint { color: var(--tint-text); }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal; overflow-wrap: break-word; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Shown only under the phone breakpoint (the partner of .tbl .hide-narrow). */
.narrow-only { display: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.cluster { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-2); }
.ico { vertical-align: -3px; flex: none; }

/* ---- Boot skeleton ------------------------------------------------------ */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.boot-mark { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--s3); border-top-color: var(--tint); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Layout ------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--rail) 1fr; height: 100vh; }
.rail {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--s1);
  padding: 14px 12px;
  gap: 18px;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.02em; line-height: 1.1; }
.brand-sub { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; overflow: auto; }
.nav-group > .label { padding: 0 8px 6px; font-size: 10.5px; color: var(--text-3); }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 400; font-size: 13.5px;
}
.nav a:hover { background: var(--s2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--tint-soft); color: var(--text); font-weight: 700; }
.nav a .ico { color: var(--text-3); }
.nav a.active .ico { color: var(--tint-text); }
.nav a .n { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); background: var(--s2); padding: 1px 6px; border-radius: 999px; }
.nav a.active .n { background: var(--tint-chip); color: var(--tint-text); }
.nav a .flag { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.18); }
.rail-foot { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); padding: 10px 8px 0; border-top: 1px solid var(--line); white-space: pre-line; }
.rail-foot .who { color: var(--text-2); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.head {
  display: flex; align-items: center; gap: 12px;
  height: var(--head); padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex: none;
}
.head > div:first-child { flex: 0 1 auto; min-width: 0; }
.head h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.head .hint { margin-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 24px; }
.content > .stack { max-width: none; }
.content.inbox-page { padding: 0; }
/* A section that fills the screen: its .grow child (a panel or a row) takes
   the height the content leaves, so the first screen never ends in a black
   half. A panel marked fill is a column whose last child stretches, which
   is how a Chart with `fill` and a bar list with `.spread` get tall. */
.stack.fill { min-height: 100%; }
.stack.fill > .grow { flex: 1 1 auto; min-height: 0; }
.stack.fill > .row.grow { align-content: stretch; }
.panel.fill { display: flex; flex-direction: column; min-height: 0; }
.panel.fill > .panel-head { flex: none; }
.panel.fill > .chart.fill { flex: 1 1 auto; min-height: 0; }
.panel.fill > .spread { flex: 1 1 auto; justify-content: space-evenly; }
.panel.fill > .centered { flex: 1 1 auto; display: flex; align-items: center; }
.panel.fill > .centered > * { flex: 1 1 auto; min-width: 0; }
.chart.fill { display: flex; flex-direction: column; }
/* The plot box takes the height and the svg is drawn over it, so what the
   svg is never feeds back into how tall the box is (a01, 2026-10-26). */
.chart.fill > .chart-plot { flex: 1 1 auto; }
.chart.fill > .chart-plot > svg { position: absolute; top: 0; left: 0; }
.chart.fill > .legend { flex: none; }
.row > .stack { min-height: 0; }
.row > .stack > .panel.grow { flex: 1 1 auto; }

/* The health pill. */
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--s1); font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.pill .led { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.pill.ok .led { background: var(--ok); box-shadow: 0 0 0 3px var(--tint-soft); }
.pill.warn .led { background: var(--warn); }
.pill.bad .led { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.18); }
.pill.ok, .pill.warn, .pill.bad { color: var(--text); }
a.pill:hover { text-decoration: none; border-color: var(--text-3); }

/* ---- Gate --------------------------------------------------------------- */
.gate { max-width: 380px; margin: 12vh auto 0; padding: 28px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 14px; }
.gate h2 { font-size: 18px; }
.gate p { color: var(--text-2); }

/* ---- Controls ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--s1); color: var(--text);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.btn:hover { background: var(--s2); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--tint-btn); border-color: var(--tint-btn); color: #fff; }
.btn.primary:hover { background: var(--tint); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--s2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: rgba(255, 71, 87, 0.12); border-color: rgba(255, 71, 87, 0.3); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.icon { padding: 0; width: 32px; }
.btn.icon.sm { width: 26px; }
.btn .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: currentColor; animation: spin 0.8s linear infinite; }

.seg { display: inline-flex; background: var(--s1); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 2px; }
.seg button { height: 26px; padding: 0 10px; border-radius: 4px; color: var(--text-2); font-size: 12.5px; font-weight: 700; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--s3); color: var(--text); }
.seg.sm button { height: 22px; padding: 0 8px; font-size: 12px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
button.chip:hover { color: var(--text); background: var(--s2); }
.chip.on { background: var(--tint-chip); border-color: transparent; color: var(--tint-text); }
.chip.ok { color: var(--tint-text); }
.chip.warn { color: var(--warn); }
.chip.bad { color: var(--bad); }
.chip-n { font-family: var(--font-mono); font-size: 11px; opacity: 0.85; }

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; background: var(--s2); color: var(--text-2); }
.badge.ok, .badge.tint { background: var(--tint-chip); color: var(--tint-text); }
.badge.warn { background: rgba(255, 200, 74, 0.14); color: var(--warn); }
.badge.bad { background: rgba(255, 71, 87, 0.14); color: var(--bad); }
.badge.muted { background: transparent; border: 1px solid var(--line-2); color: var(--text-3); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.ghost { border: 1px dashed var(--text-3); background: transparent; }
.swatch { display: inline-flex; align-items: center; gap: 6px; }

.toggle { display: inline-flex; align-items: center; gap: 8px; }
.toggle .knob { width: 30px; height: 18px; border-radius: 999px; background: var(--s3); position: relative; transition: background 0.12s; }
.toggle .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform 0.12s, background 0.12s; }
.toggle.on .knob { background: var(--tint-btn); }
.toggle.on .knob::after { transform: translateX(12px); background: #fff; }

.in { height: 32px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 13px; }
.in:focus { border-color: var(--tint); outline: none; }
.in::placeholder { color: var(--text-3); opacity: 1; }
textarea.in { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; font-family: var(--font-sans); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > .label { font-size: 10.5px; }

.capbar { display: inline-flex; align-items: center; gap: 2px; width: 100%; max-width: 140px; }
.capbar-track { flex: 1; height: 4px; border-radius: 2px; background: var(--s3); overflow: hidden; }
.capbar-fill { display: block; height: 100%; background: var(--tint); border-radius: 2px; }
.capbar.over .capbar-track .capbar-fill { background: var(--warn); }
.capbar-over { width: 34px; height: 4px; border-radius: 2px; background: rgba(255, 71, 87, 0.18); overflow: hidden; }
.capbar-over .capbar-fill { background: var(--bad); }
.sharebar { display: block; height: 2px; border-radius: 1px; background: var(--s3); margin-top: 3px; overflow: hidden; }
.sharebar > span { display: block; height: 100%; background: var(--tint); }

/* ---- Panels and grid ---------------------------------------------------- */
.panel { --surface: var(--s1); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.panel.flush { padding: 0; }
.panel.flush .panel-head { padding: 12px 16px 8px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.panel-title h2 { font-size: 13px; font-weight: 700; }
.panel-title .hint { font-size: 12px; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.info { color: var(--text-3); cursor: help; display: inline-flex; }
.info:hover { color: var(--text-2); }
.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.row > * { grid-column: span 12; }

/* ---- KPIs --------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; text-align: left; }
.kpi.click { cursor: pointer; }
.kpi.click:hover { border-color: var(--line-2); background: var(--s2); }
.kpi-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-row { display: flex; align-items: baseline; gap: 2px 8px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.kpi.warn .kpi-value { color: var(--warn); }
.kpi.bad .kpi-value { color: var(--bad); }
.kpi.ok .kpi-value { color: var(--tint-text); }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 22px; margin-top: auto; }
/* Two lines, then an ellipsis. One line cut 'warn 0 · pass 69 · hidden…' and
   hid the audit's last run on a 1440 screen, and a phone has no hover to read
   the rest (a36, 2026-10-26). */
.kpi-sub { min-width: 0; font-size: 12px; line-height: 1.35; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; }
.delta { display: inline-flex; align-items: center; gap: 2px; height: 18px; padding: 0 6px; border-radius: 5px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.good { background: rgba(74, 222, 128, 0.12); color: var(--good); }
.delta.bad { background: rgba(255, 71, 87, 0.12); color: var(--bad); }
.delta.tint { background: var(--tint-chip); color: var(--tint-text); }
.delta.muted { background: var(--s2); color: var(--text-3); }
.spark { flex: none; }
/* Two tiles a row on a phone leave a subtitle about 70px beside the
   sparkline, so the sparkline goes under it, on the right, and a delta that
   does not fit beside its value goes under it (a38). */
@media (max-width: 600px) {
  .kpi-row { flex-wrap: wrap; }
  .kpi-foot { flex-direction: column; align-items: flex-end; gap: 4px; }
  .kpi-foot > :first-child { align-self: stretch; }
}

/* ---- Chart -------------------------------------------------------------- */
.chart { position: relative; width: 100%; }
.chart-plot { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--text-3); font-family: var(--font-mono); font-size: 10.5px; }
.chart .tick.bad { fill: var(--bad); }
.chart .crosshair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .hardline { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 5 4; opacity: 0.8; }
.chart .clipmark { fill: var(--bad); font-size: 9px; }
.chart-tip { position: absolute; z-index: 5; min-width: 150px; max-width: 220px; padding: 8px 10px; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow); pointer-events: none; font-size: 12px; }
.chart-tip-head { font-weight: 700; margin-bottom: 4px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.6; }
.chart-tip-label { color: var(--text-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 6px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.legend-item:hover { color: var(--text); }
.legend-item.off { opacity: 0.4; text-decoration: line-through; }
.donut { display: flex; align-items: center; gap: 18px; }
.donut-center { fill: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
/* The word under the total ('devices', 'sessions'). It borrowed the chart's
   .tick class, whose colour is scoped to .chart, and drew black on the dark
   panel (a37, 2026-10-26). */
.donut-sub { fill: var(--text-2); font-size: 11px; }
.donut-legend { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.donut-legend li { display: grid; grid-template-columns: 8px 1fr auto auto; gap: 8px; align-items: center; font-size: 12.5px; }
.donut-legend .donut-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Tables ------------------------------------------------------------- */
.tbl-wrap { overflow: auto; max-width: 100%; }
/* A table wider than its panel says so (a21, 2026-10-26). macOS hides the
   scrollbar until a scroll and draws it under the last row, so a 13-column
   table at 1440 just looked like it ended at 'LAS'. A glow sits on the edge
   that has more; two covers in the surface colour scroll with the table and
   hide each glow once that edge is reached. Every .tbl-wrap gets it, the
   hand-built ones too. --surface is the colour the table sits on. */
.tbl-wrap {
  background:
    linear-gradient(to right, var(--surface), var(--surface) 30%, transparent) left center / 36px 100% no-repeat local,
    linear-gradient(to left, var(--surface), var(--surface) 30%, transparent) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(138, 180, 248, 0.4), transparent) left center / 16px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(138, 180, 248, 0.4), transparent) right center / 16px 100% no-repeat scroll;
}
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--s1); text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); padding: 8px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th.sorted { color: var(--text); }
.tbl .sort-ind { margin-left: 4px; font-size: 9px; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl.dense td { padding: 5px 10px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .right { text-align: right; }
.tbl .center { text-align: center; }
.tbl td.mono, .tbl td.right { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tbl td.dim { color: var(--text-2); }
.tbl .sticky { position: sticky; left: 0; background: var(--s1); z-index: 1; }
.tbl th.sticky { z-index: 3; }
.tbl.clickable tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--s2); }
.tbl tbody tr.selected td { background: var(--tint-soft); }
.tbl tbody tr.bad, .tbl tbody tr.warn { color: inherit; }
.tbl tbody tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.tbl tbody tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.tbl .w-disc { width: 28px; color: var(--text-3); padding-right: 0; }
.tbl .group-row td { padding: 10px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); background: var(--s1); border-bottom: 0; }
.tbl .expand-row td { --surface: var(--bg); background: var(--bg); padding: 12px 16px 14px 40px; }
.cell-bar { display: block; min-width: 56px; }
.cell-val { display: block; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.pager .dim { margin-right: auto; }
.cell-sub { display: block; font-size: 11.5px; color: var(--text-2); font-family: var(--font-sans); }
td.heat { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- Notices, states ---------------------------------------------------- */
.notice { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); }
.notice-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.notice.ok .notice-dot { background: var(--ok); }
.notice.warn .notice-dot { background: var(--warn); }
.notice.bad .notice-dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.16); }
.notice-text { flex: 1; min-width: 0; }
.notice-text b { font-weight: 700; }
.notice-action { flex: none; }
/* What is being done about a Needs attention line (founder decision
   2026-10-26, lib/oncall.ts): a chip before the words, the on-call's note
   under them. Waiting on you is the strongest thing on the list: a solid
   chip, the line ringed and the question in full ink. */
.hchip { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin-right: 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; vertical-align: 1px; border: 1px solid transparent; }
.hchip.heal { background: rgba(45, 212, 191, 0.12); color: var(--c3); }
.hchip.fix { background: var(--tint-chip); color: var(--tint-text); }
.hchip.vendor { background: rgba(255, 146, 72, 0.13); color: var(--c4); }
.hchip.watch { background: rgba(167, 139, 250, 0.13); color: var(--c5); }
.hchip.done { background: rgba(74, 222, 128, 0.12); color: var(--good); }
.hchip.quiet { border-color: var(--line-2); color: var(--text-3); }
.hchip.none { border: 1px dashed var(--line-2); color: var(--text-3); font-weight: 400; }
.hchip.ask { background: var(--warn); color: #07090d; }
.hnote { display: block; margin-top: 3px; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.hnote.ask { color: var(--text); font-weight: 700; font-size: 12.5px; }
.notice.ask { border-color: rgba(255, 200, 74, 0.55); background: rgba(255, 200, 74, 0.06); box-shadow: inset 3px 0 0 var(--warn); }
.empty { display: flex; align-items: center; gap: 12px; padding: 18px 16px; color: var(--text-2); font-size: 13px; }
.empty.bad { color: var(--bad); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 16px; }
.fact dt { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.fact dd { font-size: 13px; margin-top: 2px; overflow-wrap: break-word; }
/* A value with a button beside it ('subscribed' + Mark unsubscribed) puts
   the button on the next line rather than squeezing the word (a16). */
.fact dd .cluster.tight { flex-wrap: wrap; }

/* ---- Skeletons ---------------------------------------------------------- */
.sk-line { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--s2) 25%, var(--s3) 50%, var(--s2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-line.tall { height: 22px; margin: 6px 0; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; }
.sk-rows { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; }
.sk-block { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--s1) 25%, var(--s2) 50%, var(--s1) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.kpi.sk { gap: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- Drawer ------------------------------------------------------------- */
.drawer-host { position: fixed; inset: 0; z-index: 40; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(3, 5, 9, 0.55); }
.drawer { --surface: var(--s1); position: absolute; top: 0; right: 0; bottom: 0; max-width: 100vw; background: var(--s1); border-left: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide 0.16s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 15px; font-weight: 700; }
/* A long address wraps under the close button instead of pushing the
   drawer's tools off a phone screen (a15, 2026-10-26). */
.drawer-head > div:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.drawer-head > .cluster { flex: none; flex-wrap: nowrap; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 18px 30px; display: flex; flex-direction: column; gap: 14px; }
.drawer-body .panel { --surface: var(--bg); background: var(--bg); }

/* ---- Palette ------------------------------------------------------------ */
.palette-host { position: fixed; inset: 0; z-index: 50; background: rgba(3, 5, 9, 0.6); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette { width: 560px; max-width: calc(100vw - 32px); background: var(--s1); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.palette-in input { flex: 1; background: none; border: 0; outline: none; font-size: 14px; color: var(--text); }
.palette-in kbd { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; }
.palette-list { max-height: 50vh; overflow: auto; padding: 6px; }
.palette-g { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.palette-item { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); text-align: left; }
.palette-item.on { background: var(--s2); }
.palette-t { font-weight: 700; }
.palette-s { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Toasts ------------------------------------------------------------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { padding: 10px 14px; border-radius: var(--r-sm); background: var(--s2); border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--text); font-size: 13px; text-align: left; animation: rise 0.16s ease-out; }
.toast.ok { border-color: rgba(59, 127, 232, 0.4); }
.toast.error { border-color: rgba(255, 71, 87, 0.5); color: #ffd3d8; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Inbox layout (Content) ---------------------------------------------- */
.inbox { display: grid; grid-template-columns: 380px 1fr; height: 100%; min-height: 0; }
.inbox-list { --surface: var(--s1); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--s1); }
.inbox-top { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.inbox-rows { flex: 1; overflow: auto; min-height: 0; }
.inbox-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.inbox-row:hover { background: var(--s2); }
.inbox-row.on { background: var(--tint-soft); box-shadow: inset 3px 0 0 var(--tint); }
.inbox-row .r1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.inbox-row .r2 { grid-column: 1 / -1; color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row .rank { font-family: var(--font-mono); font-size: 11px; color: var(--tint-text); font-weight: 500; }
.inbox-row .sym { font-family: var(--font-mono); font-weight: 500; }
.inbox-row .age { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.inbox-detail { min-width: 0; min-height: 0; overflow: auto; padding: 18px 22px 40px; }
.inbox-detail > .stack { max-width: none; }
.inbox-empty { display: grid; place-items: center; height: 100%; color: var(--text-2); }
.story { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.story-text textarea { width: 100%; min-height: 220px; font-size: 14px; line-height: 1.55; }
.card-box { position: relative; width: 100%; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.card-box img { display: block; width: 100%; height: auto; }
.card-box .sk-block { position: absolute; inset: 0; }
.meter { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.meter-track { height: 4px; border-radius: 2px; background: var(--s3); overflow: hidden; }
.meter-fill { height: 100%; background: var(--tint); }
.meter.warn .meter-fill { background: var(--warn); }
.meter.bad .meter-fill { background: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.counter { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.counter.over { color: var(--bad); }
.reasons { display: flex; flex-direction: column; gap: 4px; color: var(--bad); font-size: 12.5px; }
kbd.key { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; margin-left: 4px; }

/* ---- Timeline (scheduled) ------------------------------------------------ */
.timeline { display: flex; flex-direction: column; gap: 6px; }
.tl-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); }
.tl-row .t { font-family: var(--font-mono); font-size: 12px; color: var(--tint-text); }
.tl-row .x { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  .rail { flex-direction: row; align-items: center; gap: 12px; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; gap: 2px; }
  .nav-group { display: contents; }
  .nav-group > .label { display: none; }
  .rail-foot { display: none; }
  .head { position: sticky; top: 0; z-index: 10; height: auto; padding: 10px 14px; flex-wrap: wrap; }
  /* The tools wrap onto their own line: the window control, the health pill,
     Search, Refresh and Sign out are about 520px, and on one line they sat
     off a 390px screen and widened the page (a15, 2026-10-26). */
  .head-tools { flex-wrap: wrap; margin-left: 0; width: 100%; row-gap: 8px; }
  .head-tools .pill { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .content { padding: 14px 14px 30px; overflow: visible; }
  /* Every panel in a row takes the full width. Panel writes its span as an
     inline style, which beat the one-column rule above, so a phone kept the
     desktop's 8+4 and 4+4+4 and squeezed panels to 100-240px (a14,
     2026-10-26). The !important is what outranks the inline style, and it
     covers the hand-written spans in the tabs as well. */
  .row > * { grid-column: 1 / -1 !important; }
  .toasts { left: 14px; right: 14px; bottom: 14px; max-width: none; }
  .tbl .hide-narrow { display: none; }
  .narrow-only { display: block; margin-top: 4px; }
  /* A prose cell (a note, a reason, a card title) keeps a readable width on
     a phone and the table scrolls sideways, instead of the column shrinking
     to its longest word and each row running ten lines (a16). */
  .tbl td .wrap { display: inline-block; min-width: 200px; }
  /* Facts run two a row at 390 (160px left one). */
  .facts { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  /* A panel's tools (a segmented control, chips, buttons) go under its
     title when both do not fit, instead of being drawn over it (a14). */
  .panel-head { flex-wrap: wrap; }
  .panel-tools { flex: 0 1 auto; flex-wrap: wrap; max-width: 100%; }
  /* A ring beside a table: the table goes under the ring (a14). */
  .ring-row { flex-wrap: wrap; }
  .ring-row > .tbl { flex: 1 1 100%; }
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { max-height: 45vh; }
  .story { grid-template-columns: 1fr; }
}

/* ---- Growth tab ----------------------------------------------------------- */
.g-funnel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: start; padding-top: 4px; }
.g-step { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.g-step-n { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.g-bar { height: 150px; display: flex; align-items: flex-end; background: var(--bg); border-radius: 4px; overflow: hidden; }
.g-bar > span { display: block; width: 100%; background: var(--tint); border-radius: 3px 3px 0 0; opacity: 0.85; }
.g-step.leak .g-bar > span { background: var(--bad); }
.g-step-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-step-rate { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.3; color: var(--text-3); overflow-wrap: anywhere; }
.g-search { width: 240px; height: 28px; font-size: 12.5px; }
@media (max-width: 900px) { .g-funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- Website tab (generic rules appended, tabs/website.tsx) ---------------- */
/* A heat cell fills its td: the td padding is pulled back in so the tint
   reads as the cell, not as a pill inside it. */
.tbl td > .heat-cell { display: block; margin: -8px -12px; padding: 8px 12px; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; border-radius: 3px; }
.tbl.dense td > .heat-cell { margin: -5px -10px; padding: 5px 10px; }
/* A group row that carries the figures for the rows under it. */
.tbl tbody tr.lead td { font-weight: 700; background: rgba(59, 127, 232, 0.05); }
.tbl tbody tr.lead td:first-child { box-shadow: inset 2px 0 0 var(--tint); }
.tbl tbody tr.lead:hover td { background: var(--s2); }
.cluster.tight { gap: 6px; flex-wrap: nowrap; }

/* ---- Ads tab ------------------------------------------------------------ */
/* Padded content inside a flush panel, for facts that sit above a table. */
.pad { padding: 0 16px 12px; }

/* ---- Costs tab ----------------------------------------------------------- */
.conn-list { display: flex; flex-direction: column; }
.conn-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.conn-row:last-child { border-bottom: 0; }
.conn-row .conn-name { font-weight: 700; }
.conn-row .conn-secret { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .in { width: 100%; }
.form-foot { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.form-foot .grow { flex: 1; }

/* ---- Content tab (tabs/content): inbox rows with a checkbox, the story's
   side column, the reject box, the brief lines ------------------------------ */
.inbox-row { cursor: pointer; }
.inbox-row.pick { grid-template-columns: auto 1fr auto; }
.inbox-row.pick > .r2 { grid-column: 2 / -1; }
.inbox-row > .cb { grid-row: 1 / span 2; align-self: start; margin: 3px 0 0; }
.inbox-row.bad { box-shadow: inset 3px 0 0 var(--bad); }
.inbox-row.on.bad { box-shadow: inset 3px 0 0 var(--bad); }
.inbox-row .r1 { flex-wrap: wrap; row-gap: 2px; }
.inbox-row .metric, .metric { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.inbox-row .metric b, .metric b { font-weight: 500; color: var(--text-2); }
.inbox-top .cb, .inbox-row .cb { width: 14px; height: 14px; margin: 0; accent-color: var(--tint); cursor: pointer; }
.inbox-top .bulk { padding: 8px 10px; border-radius: var(--r-sm); background: var(--tint-soft); border: 1px solid rgba(59, 127, 232, 0.25); }
.sk-row { display: flex; flex-direction: column; gap: 9px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.story-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.story-text > .field textarea { min-height: 0; font-size: 13px; }
.card-box > .sk-block { height: auto !important; }
.posted-text { white-space: pre-wrap; line-height: 1.55; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.reject-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid rgba(255, 71, 87, 0.35); border-radius: var(--r-sm); background: var(--bg); }
.reject-box .in { width: 100%; }
.reasons { list-style: none; }
.reasons li::before { content: '•'; margin-right: 6px; }
.tl-row { grid-template-columns: 74px minmax(0, 1fr) auto; }
.tl-row.on { border-color: var(--tint); }
.tl-row .x { display: flex; align-items: center; gap: 6px; }
.tl-row .x .dim { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-reject { grid-column: 1 / -1; }
.brief-line { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13px; line-height: 1.5; }
.brief-line > .label { padding-top: 3px; }
.quote { margin: 0 0 8px; padding: 8px 12px; border-left: 2px solid var(--line-2); color: var(--text-2); font-size: 13px; }
a.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.inbox-detail .inbox-empty kbd.key { margin: 0 2px 0 6px; }
.inbox-top .hint.right { text-align: right; }

/* ---- Shared additions --------------------------------------------------- */
.tags { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.tag { display: inline-block; height: 18px; line-height: 18px; padding: 0 6px; border-radius: 4px; background: var(--s2); color: var(--text-2); font-size: 11px; font-weight: 700; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
a.btn { text-decoration: none; }
a.btn:hover { text-decoration: none; }
.meter > .meter-track { width: 100%; }
.cluster.nowrap { flex-wrap: nowrap; }

/* ---- Ops tab (tabs/ops/*) ------------------------------------------------- */
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.stack-pre { margin: 0; padding: 10px 12px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; color: var(--text-2); }
.chips-row { padding: 0 16px 10px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field .hint { font-size: 11.5px; }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.push-preview { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 14px; }
.push-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--s2); display: grid; place-items: center; }
.pp-app { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); }
.pp-title { display: block; margin-top: 2px; font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.pp-body { display: block; font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .compose, .field-row { grid-template-columns: 1fr; } }

/* ---- Growth tab, second pass (tabs/growth.tsx): horizontal funnel, the
   activation checklist, the push panel's inner grid and its tiles -------- */
.g-hf { display: flex; flex-direction: column; gap: 6px; }
.g-hf-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 56px 150px; gap: 10px; align-items: center; height: 26px; }
.g-hf-label { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-hf-bar { height: 14px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.g-hf-bar > span { display: block; height: 100%; background: var(--tint); opacity: 0.85; border-radius: 3px; }
.g-hf-row.leak .g-hf-bar > span { background: var(--bad); }
.g-hf-row.leak .g-hf-label { color: var(--text); font-weight: 700; }
/* The rows beside the chain ("Tapped a card", a06) wrap their label
   rather than cutting it at the 140px column (integration check, 2026-10-26). */
.g-hf-row.side { height: auto; min-height: 26px; }
/* The optional steps past Granted push and the card tap, apart from the
   chain (final verification, 2026-10-26). */
.g-hf-side { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
.g-hf-row.side .g-hf-label { white-space: normal; line-height: 1.25; }
.g-hf-n { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.g-hf-rate { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.g-act { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.g-act-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px 36px; gap: 2px 10px; align-items: center; }
.g-act-label { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-2); }
.g-act-bar { position: relative; height: 8px; background: var(--bg); border-radius: 4px; overflow: visible; }
.g-act-bar > .fill { display: block; height: 100%; background: var(--tint); border-radius: 4px; }
.g-act-bar > .tick { position: absolute; top: -3px; width: 2px; height: 14px; margin-left: -1px; background: var(--text-2); border-radius: 1px; }
.g-act-pct { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.g-act-n { text-align: right; font-size: 11.5px; }
.tbl td .cell-sub.mono { font-family: var(--font-mono); }
/* The Accounts table's first column: an address longer than this wraps
   instead of pushing Plan and Source off a 1440 screen (a21, 2026-10-26). */
.acct-cell { display: block; max-width: 280px; overflow-wrap: break-word; }
/* Growth › Live: a guest's row opens nothing, so no pointer (verify F8,
   2026-11-24). */
.tbl.clickable tbody tr.inert { cursor: default; }
/* On a phone the table is wider than the screen, so the person shrank to
   its narrowest (an email breaks after its @) and what they are doing ran
   two words a line; 180px keeps it one line and Plan and Platform beside. */
@media (max-width: 900px) { .tbl td .live-who { min-width: 180px; } }
.ring-row > .tbl { flex: 1; min-width: 0; }
/* On a phone a funnel step is two lines: the label, the count and the rate,
   then the bar under them at the full width. Four columns left the bar about
   50px and pushed the leak badge past the panel's edge (a14, 2026-10-26). */
@media (max-width: 900px) {
  .g-hf-row { grid-template-columns: minmax(0, 1fr) auto auto; height: auto; row-gap: 3px; }
  .g-hf-row > .g-hf-label { grid-column: 1; grid-row: 1; }
  .g-hf-row > .g-hf-n { grid-column: 2; grid-row: 1; }
  .g-hf-row > .g-hf-rate { grid-column: 3; grid-row: 1; }
  .g-hf-row > .g-hf-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* ---- Website tab (tabs/website): nested channel rows, a caption between
   two tables in one panel ---------------------------------------------------- */
.tbl tbody tr.nest td:first-child { padding-left: 30px; }
/* A landing path: three lines at most, the rest on hover (a16). */
.tbl td .path-cell { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tbl tbody tr.nest td { color: var(--text-2); }
.label.tbl-cap { padding: 12px 12px 4px; }
.row.top { align-items: start; }

/* ---- Ads tab (tabs/ads*) ---------------------------------------------------- */
.tbar { display: block; width: 100%; max-width: 170px; padding: 3px 0; }
.tbar-track { position: relative; height: 6px; border-radius: 3px; background: var(--s3); }
.tbar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--tint); }
.tbar.warn .tbar-fill { background: var(--warn); }
.tbar.bad .tbar-fill { background: var(--bad); }
.tbar-tick { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; background: var(--text-2); border-radius: 1px; }
.tbar-tick.target { background: var(--c3); }
.tbar-tick.cap { background: var(--text); }
.tbar-tick.warn { background: var(--warn); }
.tbar-legend { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--text-3); }
.tbar-legend i { display: inline-block; width: 2px; height: 9px; margin-right: 3px; vertical-align: -1px; background: var(--text-2); }
.tbar-legend i.target { background: var(--c3); }
.tbar-legend i.cap { background: var(--text); }
.tbar-legend i.warn { background: var(--warn); }
.band { display: block; position: relative; width: 100%; max-width: 110px; height: 6px; margin-top: 3px; border-radius: 3px; background: var(--s3); }
.band > span { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--c3); }
.band > i { position: absolute; top: -2px; width: 2px; height: 10px; margin-left: -1px; background: var(--text-2); }
.band > i.half { background: var(--text-3); }
.band > i.abs { background: var(--c1); }
.band.win > span { background: var(--up); }
.leak { color: var(--bad); }
.targets-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.targets-form .in { width: 100%; min-width: 0; }
.kpi-of { font-size: 15px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }

/* ---- Costs tab, second pass (tabs/costs.tsx): strip titles, the budget
   pacing bar, the category legend with deltas, action-prompt tile values -- */
.strip-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.strip-head .strip-title { font-size: 13px; font-weight: 700; white-space: nowrap; }
.strip-head .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-head .grow { flex: 1; }
.kpi-value .kpi-set { font-size: 15px; font-weight: 700; color: var(--tint-text); letter-spacing: 0; }
.kpi-value .kpi-of { font-size: 14px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
/* A state in place of a figure ("not measured", Performance's Reach tile,
   a10): at the 26px figure size it ran past its tile on a phone, where two
   tiles share a row (a38; integration check, 2026-10-26). */
.kpi-value .kpi-word { font-size: 18px; font-weight: 700; color: var(--text-2); letter-spacing: 0; white-space: normal; }
.kpi-sub .ln2 { display: block; white-space: normal; line-height: 1.35; }
.kpi-sub .ln2 .badge { vertical-align: middle; height: 16px; font-size: 10px; }
.cell-delta { display: inline-flex; align-items: center; gap: 6px; }
.pace { display: flex; flex-direction: column; gap: 22px; padding: 14px 4px 4px; }
.pace-bar { position: relative; height: 10px; border-radius: 5px; background: var(--s3); }
.pace-seg { position: absolute; top: 0; height: 100%; }
.pace-seg.fill { background: var(--tint); border-radius: 5px 0 0 5px; }
.pace-seg.proj { background: repeating-linear-gradient(135deg, var(--tint) 0 3px, transparent 3px 7px); }
.pace-seg.over { background: var(--bad); }
.pace-seg.over.proj { background: repeating-linear-gradient(135deg, var(--bad) 0 3px, transparent 3px 7px); }
.pace-tick, .pace-cap { position: absolute; top: -4px; height: 18px; width: 2px; margin-left: -1px; }
.pace-tick { background: var(--warn); }
.pace-cap { background: var(--text); }
.pace-tick > span, .pace-cap > span { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; white-space: nowrap; color: var(--text-2); }
.pace-cap > span { font-family: var(--font-mono); }
.pace-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--text-2); }
.pace-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--tint); }
.pace-key.tick { width: 2px; background: var(--warn); border-radius: 0; }
.pace-key.proj { background: repeating-linear-gradient(135deg, var(--tint) 0 2px, transparent 2px 4px); }
.pace-key.proj.over { background: repeating-linear-gradient(135deg, var(--bad) 0 2px, transparent 2px 4px); }
.ring-row { display: flex; align-items: center; gap: 18px; }
.ring-only .donut-legend { display: none; }
.cat-legend { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; list-style: none; margin: 0; padding: 0; }
.cat-legend li { display: grid; grid-template-columns: 8px 1fr auto auto auto; gap: 8px; align-items: center; font-size: 12.5px; }
.cat-legend .donut-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Content tab, second pass (tabs/content/performance.tsx): the inbox over
   a scrolling measurement section, urgency on a list row ------------------- */
.inbox-below { padding: 18px 20px 24px; height: 100%; overflow: auto; }
.inbox-below > .stack.fill { min-height: 100%; }
.inbox-detail > .stack.fill { min-height: 100%; }
.inbox-row .age.urgent { color: var(--bad); font-weight: 500; }
.perf .label.grow { align-self: center; }
/* A post preview in a table: two lines at most, never narrower than a
   readable column, so a narrow screen scrolls the table instead of
   stacking five-line rows beside a short panel. */
.tbl td .post-cell { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 240px; }
/* Posted's text: whole above the phone breakpoint, two lines on a phone (a16). */
@media (min-width: 901px) { .tbl td .post-cell.whole { display: block; -webkit-line-clamp: unset; overflow: visible; overflow-wrap: break-word; } }

/* ---- Ops tab, second pass (tabs/ops/pipeline, delivery, latency) ---------- */
/* A row whose percentile rests on too few rows to trust. */
.tbl tbody tr.thin td { color: var(--text-3); }
.tbl tbody tr.thin td .cell-sub { color: var(--text-3); }
/* The chart legend drawn by hand when a series needs a second marker. */
.legend > span.legend-item { cursor: default; }
.legend-item > .dot + .dot { margin-left: 2px; }
.panel-tools .chip { height: 24px; }

/* ---- Sections: the rail sub-menu and the header switcher ---------------- */
.nav-item { display: flex; flex-direction: column; }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 14px; padding-left: 10px; border-left: 1px solid var(--line-2); }
.nav-sub a { padding: 4px 8px; font-size: 12.5px; color: var(--text-3); }
.nav-sub a:hover { color: var(--text); background: var(--s2); }
.nav-sub a.active { color: var(--tint-text); font-weight: 700; background: transparent; }
.head-sections { margin-left: 18px; flex: none; }
.head-sections .seg button { white-space: nowrap; }
.head-tools .seg { flex: none; }
.head-section { color: var(--text-2); font-weight: 400; }
@media (max-width: 900px) {
  .nav-sub { display: none; }
  /* No left margin on its own line: 18px of it on a full-width strip made
     every tab with sections 4px wider than the phone, and the page scrolled
     sideways (integration review 2026-10-26). */
  .head-sections { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
}

/* ---- IPO desk (tabs/ipo.tsx, 2026-11-24) ----------------------------------- */
/* A company is EDGAR's name as stored (47 characters at most today): one
   line, the whole in its title, so Terms stays on a 1440 screen. */
.ipo-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipo-co .tags { margin-top: 3px; }
/* The verdict's reason under another kind: one line, the whole on hover,
   so 15 rows still fit 1080p. */
.ipo-why { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips-scroll { display: flex; gap: 6px; flex-wrap: wrap; }
.ipo-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.ipo-dots i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--line-2); }
.ipo-dots i.on { background: var(--tint); border-color: var(--tint); }
/* Needs you keeps its first page's height (tabs/ipo.tsx Steady) with the
   pager at its foot, so a short last page never moves Previous and Next
   (verify S4: 300px up, and the chart grew to fill). */
.ipo-steady { display: flex; flex-direction: column; }
.ipo-steady > .tbl-wrap { flex: 1 1 auto; display: flex; flex-direction: column; }
.ipo-steady .pager { margin-top: auto; }
/* A drawer action beside what it does, before the first press. The column
   fits the widest armed label, "Confirm: Pin for broadcast" (175px), so an
   armed button never covers its own effect line (verify S1). */
.ipo-act { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 10px; align-items: start; }
.ipo-act > .btn { justify-self: start; }
@media (max-width: 900px) {
  /* The chip rows scroll sideways on a phone; the page never does. */
  .chips-scroll { flex-wrap: nowrap; overflow-x: auto; }
  .ipo-act { grid-template-columns: 1fr; gap: 4px; }
  /* A Pipeline company at 150px, and Terms free to wrap if it must, so
     Terms and Article stay on a 390 screen ("$15.00–18.00" and a
     "shadow" badge beside it); the verdict's reason ellipsises (verify
     S2: Company took 300px). */
  .acct-cell.ipo-deal { max-width: 150px; }
  .ipo-terms { white-space: normal; }
}
