/* ==========================================================================
   Dispatch — "Signal Board" design tokens
   A cool blue-black instrument-panel dashboard, not a warm newspaper wire board (see the previous
   design's header comment — this file replaces it). Per-vertical accent color layered on top of
   shared light/dark tokens: crypto teal (flagship default), stocks blue, forex violet,
   fundamentals amber. Flat panels with a crosshair-tick corner mark instead of rounded cards —
   see plans/... this session's redesign plan for the full design rationale.
   ========================================================================== */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/instrumentsans/v4/pxiTypc9vsFDm051Uf6KVwgkfoSxQ0GsQv8ToedPibnr0SZe1Q.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

:root {
  --font-display: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 7rem;

  --radius: 0px;
  --max-w: 76rem;
  --measure: 65ch;

  /* Light (default) */
  --bg: #edf1f4;
  --bg-raised: #ffffff;
  --bg-sunken: #e1e7ec;
  --ink: #101820;
  --ink-dim: #56636e;
  --line: #cbd5dc;
  --accent: #1d7a80;
  --accent-ink: #ffffff;
  --accent-2: #b23a5c;
  --good: #1f8f5c;
  --danger: #b3432b;

  --shadow-card: 0 1px 0 var(--line);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f14;
    --bg-raised: #121a22;
    --bg-sunken: #060a0d;
    --ink: #dce6ec;
    --ink-dim: #7e8e99;
    --line: #1d2830;
    --accent: #3fbfc7;
    --accent-ink: #06181a;
    --accent-2: #e0577a;
    --good: #45ce93;
  }
}
:root[data-theme='dark'] {
  --bg: #0a0f14;
  --bg-raised: #121a22;
  --bg-sunken: #060a0d;
  --ink: #dce6ec;
  --ink-dim: #7e8e99;
  --line: #1d2830;
  --accent: #3fbfc7;
  --accent-ink: #06181a;
  --accent-2: #e0577a;
  --good: #45ce93;
}
:root[data-theme='light'] {
  --bg: #edf1f4;
  --bg-raised: #ffffff;
  --bg-sunken: #e1e7ec;
  --ink: #101820;
  --ink-dim: #56636e;
  --line: #cbd5dc;
  --accent: #1d7a80;
  --accent-ink: #ffffff;
  --accent-2: #b23a5c;
  --good: #1f8f5c;
}

/* Per-vertical accent — crypto is the flagship default (same value as the base tokens above,
   stated explicitly rather than relying on fallthrough), stocks/forex/fundamentals override. */
:root[data-vertical='crypto'] { --accent: #1d7a80; --accent-ink: #ffffff; }
:root[data-vertical='crypto'][data-theme='dark'] { --accent: #3fbfc7; --accent-ink: #06181a; }
:root[data-vertical='stocks'] { --accent: #2b62c6; --accent-ink: #ffffff; }
:root[data-vertical='stocks'][data-theme='dark'] { --accent: #6fa8f0; --accent-ink: #07142a; }
:root[data-vertical='forex'] { --accent: #6b4fbf; --accent-ink: #ffffff; }
:root[data-vertical='forex'][data-theme='dark'] { --accent: #a990f0; --accent-ink: #160e2e; }
:root[data-vertical='fundamentals'] { --accent: #9c7a1f; --accent-ink: #ffffff; }
:root[data-vertical='fundamentals'][data-theme='dark'] { --accent: #e0b94a; --accent-ink: #241c05; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  transition: background 0.2s ease, color 0.2s ease;
}
.mono { font-family: var(--font-mono); }
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-5); }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-weight: 700; line-height: 1.05; font-size: clamp(2.1rem, 4vw, 3.15rem); }
h2 { font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-weight: 700; font-size: 1rem; }
p { line-height: 1.6; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.8125rem; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { opacity: 0.88; }
.btn-outline { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Panels get a small crosshair-tick corner mark instead of a rounded corner/drop shadow — the
   one signature detail this design is built around. */
.panel {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
}
.panel::before, .panel::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid var(--accent);
  opacity: 0.55;
}
.panel::before { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.panel::after { bottom: 4px; right: 4px; border-left: none; border-top: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
  padding: var(--space-4) 0;
}
/* gap is var(--space-4), not the site-wide var(--space-5) — same tight-row reasoning as before,
   now moot for .vertical-chips specifically (see below) but still relevant to masthead/nav-links/
   header-actions sharing this row. */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.masthead { display: flex; align-items: baseline; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.masthead .live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block;
  box-shadow: 0 0 0 0 rgba(31, 143, 92, 0.5); animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 143, 92, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(31, 143, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 143, 92, 0); }
}
.masthead b { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.masthead .kicker { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-dim); letter-spacing: 0.03em; }

/* Vertical chips — the header nav for switching between products (crypto/stocks/forex/
   fundamentals/political and whatever comes next). Deliberately on its OWN full-width row
   (flex-basis: 100%, order pushes it after the other three .wrap children regardless of source
   order) rather than fighting masthead/nav-links/header-actions for space on one line — that
   approach needed re-tuning (see git history) every time a vertical was added, and finally broke
   for real at 5: only ~13px of margin was left at the row's fixed 1216px max-width, confirmed via
   getBoundingClientRect. A dedicated row has no such ceiling — it scrolls horizontally
   (overflow-x: auto) if the chip count ever exceeds even a full-width row, so this never needs
   revisiting again as more verticals are added. */
.vertical-chips {
  display: flex;
  gap: 0.375rem;
  flex-basis: 100%;
  order: 3;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 2px; /* keeps focus rings from being clipped by the scroll container */
}
.vertical-chips::-webkit-scrollbar { display: none; }
.vertical-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-dim);
  flex: 0 0 auto;
}
.vertical-chip:hover { border-color: var(--chip-accent, var(--accent)); color: var(--ink); }
.vertical-chip.is-active {
  background: var(--chip-accent, var(--accent));
  border-color: var(--chip-accent, var(--accent));
  color: var(--chip-accent-ink, var(--accent-ink));
}

.nav-links { display: flex; align-items: center; gap: var(--space-4); }
.nav-links a { text-decoration: none; color: var(--ink-dim); font-size: 0.875rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  font-size: 0.75rem;
  font-weight: 600;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: var(--space-3); }
.nav-toggle { display: none; background: none; border: none; color: var(--ink); padding: 0.4rem; cursor: pointer; }

/* ---------- hero ---------- */
.hero { padding: var(--space-8) 0 var(--space-6); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--space-7); align-items: center; }
.lede { display: block; margin-top: var(--space-5); font-size: 1.0625rem; color: var(--ink-dim); max-width: 34rem; line-height: 1.55; }
.hero-ctas { display: flex; gap: var(--space-3); margin-top: var(--space-6); flex-wrap: wrap; }

.tile-board { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile {
  position: relative; display: block; background: var(--bg-raised); padding: var(--space-4) var(--space-5);
  text-decoration: none; transition: background-color 0.15s ease;
}
.tile:hover { background: var(--bg-hover, var(--line)); }
.tile:hover .tile-label { color: var(--ink); }
.tile::before, .tile::after {
  content: ''; position: absolute; width: 7px; height: 7px; border: 1px solid var(--accent); opacity: 0.55;
}
.tile::before { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.tile::after { bottom: 4px; right: 4px; border-left: none; border-top: none; }
.tile-label { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-dim); letter-spacing: 0.04em; text-transform: uppercase; }
.tile-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.75rem; font-weight: 700; margin-top: 0.3rem; }
.tile-value.accent { color: var(--accent); }

.hero-panel { grid-column: 1 / -1; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-dim);
}
.panel-body { padding: var(--space-4) var(--space-5); font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.tok-key { color: var(--accent-2); }
.tok-str { color: var(--good); }
.tok-punc { color: var(--ink-dim); }
.live-chip { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.05em; color: var(--accent); }

/* ---------- stat strip ---------- */
.stat-strip { border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.stat-strip dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.stat { padding: var(--space-4) 0; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat dt { font-size: 0.6875rem; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.stat dd { font-family: var(--font-mono); font-weight: 700; font-size: 1.375rem; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }

/* ---------- section ---------- */
.section { padding: var(--space-8) 0; border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: var(--space-6); max-width: 40rem; }
.section-head p { margin-top: var(--space-3); color: var(--ink-dim); font-size: 0.9375rem; }

/* desks / feature grid */
.desks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.desk { position: relative; background: var(--bg-raised); padding: var(--space-5); }
.desk::before, .desk::after {
  content: ''; position: absolute; width: 7px; height: 7px; border: 1px solid var(--accent); opacity: 0.5;
}
.desk::before { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.desk::after { bottom: 4px; right: 4px; border-left: none; border-top: none; }
.desk-tag { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 700; color: var(--accent); letter-spacing: 0.05em; }
.desk h3 { margin-top: var(--space-2); }
.desk p { margin-top: var(--space-2); font-size: 0.8375rem; color: var(--ink-dim); line-height: 1.55; }

/* endpoint directory */
.directory { border: 1px solid var(--line); overflow-x: auto; }
.dir-row {
  display: flex; align-items: center; gap: var(--space-4); padding: 0.7rem var(--space-4);
  font-family: var(--font-mono); font-size: 0.8125rem; border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--good);
}
.dir-row:last-child { border-bottom: none; }
.dir-row:nth-child(odd) { background: var(--bg-raised); }
.dir-row:nth-child(even) { background: var(--bg-sunken); }
.dir-method { color: var(--good); font-weight: 700; width: 2.75rem; flex-shrink: 0; }
.dir-path { color: var(--ink); flex-shrink: 0; }
.dir-desc { color: var(--ink-dim); font-family: var(--font-body); margin-left: auto; text-align: right; font-size: 0.8125rem; white-space: nowrap; }

/* code tabs (documentation.html examples) */
.code-tabs { border: 1px solid var(--line); }
.tab-list { display: flex; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.tab-btn {
  padding: 0.6rem 1rem; border: none; background: none; color: var(--ink-dim); font-size: 0.8125rem;
  font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab-btn[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { padding: var(--space-4) var(--space-5); font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; white-space: pre-wrap; overflow-x: auto; }
.tab-panel:not(.is-active) { display: none; }

/* pricing */
.pricing-note { color: var(--ink-dim); margin-bottom: var(--space-5); }
/* auto-fit, not a fixed column count: handles 3 standard tiers (Stocks/Forex/Political/
   Fundamentals) or 4 (Crypto) identically, and keeps working without a special case if a vertical
   ever adds a 5th priced tier — the old fixed-4 grid needed an explicit nth-child(5) escape hatch
   for exactly this, and it still looked stretched/unbalanced once triggered (a lone full-width
   card with mostly empty space). Enterprise/custom tiers never enter this grid at all now — see
   .plan-custom below — so this grid only ever holds real self-serve tiers, whatever their count. */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.plan { position: relative; border: 1px solid var(--line); padding: var(--space-5); background: var(--bg-raised); }
.plan.is-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan::before, .plan::after {
  content: ''; position: absolute; width: 7px; height: 7px; border: 1px solid var(--accent); opacity: 0.5;
}
.plan::before { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.plan::after { bottom: 4px; right: 4px; border-left: none; border-top: none; }
.plan-badge {
  position: absolute; top: -0.6rem; right: var(--space-4); background: var(--accent); color: var(--accent-ink);
  font-size: 0.6875rem; font-weight: 700; padding: 0.15rem 0.5rem; letter-spacing: 0.03em; text-transform: uppercase;
}
.plan-name { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-dim); }
.plan-price { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; margin-top: 0.4rem; }
.plan-price span { font-size: 0.9rem; font-weight: 400; color: var(--ink-dim); }
.plan-features { margin: var(--space-4) 0; display: flex; flex-direction: column; gap: 0.45rem; }
.plan-features li { font-size: 0.8125rem; color: var(--ink-dim); padding-left: 1rem; position: relative; }
.plan-features li::before { content: '·'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* Enterprise/custom tiers (priceCents === null) — deliberately NOT another card in .pricing-grid.
   A "Custom" tier has no per-month price and often fewer bullets than the paid tiers above it;
   stretched to match the grid's card width it left a lot of dead space (confirmed live). Shaped
   like .docs-cta instead — a distinct horizontal banner, the same "talk to us" pattern already
   used elsewhere on this page — so it reads as its own thing, not an oddly-empty pricing card. */
.plan-custom {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  border: 1px solid var(--line); padding: var(--space-5) var(--space-6); margin-top: var(--space-4);
  background: var(--bg-sunken); flex-wrap: wrap;
}
.plan-custom::before, .plan-custom::after {
  content: ''; position: absolute; width: 7px; height: 7px; border: 1px solid var(--accent); opacity: 0.5;
}
.plan-custom::before { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.plan-custom::after { bottom: 4px; right: 4px; border-left: none; border-top: none; }
.plan-custom .plan-price { font-size: 1.3rem; margin-top: 0.2rem; }
.plan-features-inline { flex-direction: row; flex-wrap: wrap; column-gap: var(--space-5); row-gap: 0.3rem; margin: 0; flex: 1 1 auto; }

.docs-cta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  border: 1px solid var(--line); padding: var(--space-6); flex-wrap: wrap; background: var(--bg-sunken);
}
.docs-cta p { color: var(--ink-dim); margin-top: 0.3rem; }

/* ---------- footer ---------- */
.site-footer { padding: var(--space-7) 0 var(--space-6); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: var(--space-6); }
.footer-col h4 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-dim); margin-bottom: var(--space-3); }
.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a { color: var(--ink-dim); text-decoration: none; font-size: 0.875rem; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3);
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-dim);
}

/* ---------- WebSocket example block ---------- */
.ws-example { border: 1px solid var(--line); background: var(--bg-sunken); padding: var(--space-5); margin-top: var(--space-5); }
.ws-example pre { margin: var(--space-3) 0 0; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; overflow-x: auto; }

/* Live ticker widget — powered by the public, unauthenticated /public/stream/prices-demo socket
   (see PublicPriceDemoSocket.ts), NOT the real /v1/stream/prices product. Visual proof the data
   is real, deliberately not the thing being sold. */
.live-ticker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.live-ticker-status { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-dim); }
.live-ticker-dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--ink-dim);
}
.live-ticker-status[data-state="live"] .live-ticker-dot {
  background: var(--good);
  animation: live-ticker-pulse 2s ease-in-out infinite;
}
.live-ticker-status[data-state="error"] .live-ticker-dot { background: var(--danger); }
@keyframes live-ticker-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.live-ticker-item { display: inline-flex; align-items: baseline; gap: 0.5rem; }
.live-ticker-symbol { color: var(--ink-dim); }
.live-ticker-price { font-weight: 600; transition: color 0.2s ease; }
.live-ticker-price[data-direction="up"] { color: var(--good); }
.live-ticker-price[data-direction="down"] { color: var(--danger); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .desks { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .stat-strip dl { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .dir-desc { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start;
    background: var(--bg-raised); border-bottom: 1px solid var(--line); padding: var(--space-4) var(--space-5);
    gap: var(--space-4); display: none;
  }
  .nav-links.is-open { display: flex; }
  .header-cta-desktop { display: none; }
}
@media (min-width: 861px) {
  .header-cta-only-mobile { display: none; }
}
@media (max-width: 560px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Customer portal compatibility (views/*.ejs, views/partials/*.ejs)
   The portal (login/signup/dashboard) shares this stylesheet but wasn't part of this redesign
   pass — out of scope this session (see the redesign plan). These keep it fully functional and
   on-brand against the new Signal Board tokens, rather than left broken by the token/class
   rename above. header.ejs was updated directly to the new masthead markup; everything else
   below is a compatibility layer, not a second design system.
   ========================================================================== */
:root { --ink-70: var(--ink-dim); --ink-50: var(--ink-dim); --wire: var(--accent); --wire-ink: var(--accent-ink); }

.btn-wire { background: var(--accent); color: var(--accent-ink); }
.btn-wire:hover { opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--ink-dim); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); }

.auth-shell { max-width: 26rem; padding-block: var(--space-8); }
.auth-switch { margin-top: var(--space-5); font-size: 0.875rem; color: var(--ink-dim); }
.auth-switch a { color: var(--accent); }

.form-field { margin-top: var(--space-4); display: flex; flex-direction: column; gap: 0.35rem; }
.form-field label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-dim); }
.form-field input {
  padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raised); color: var(--ink); font: inherit; font-size: 0.9375rem;
}
.form-field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-field .hint { font-size: 0.75rem; color: var(--ink-dim); }
.form-submit { margin-top: var(--space-5); width: 100%; justify-content: center; }
.form-error {
  border: 1px solid var(--danger); background: var(--bg-sunken); color: var(--danger);
  padding: 0.75rem 1rem; font-size: 0.875rem; margin-top: var(--space-4);
}

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-6); align-items: start; }
.stack { display: flex; flex-direction: column; }
.dash-card { border: 1px solid var(--line); background: var(--bg-raised); padding: var(--space-5); }
.dash-card h3 { margin-bottom: var(--space-3); }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; padding: 0.4rem 0; font-size: 0.875rem; }
.kv-row dt { color: var(--ink-dim); }
.kv-row dd { margin: 0; }

.terminal { border: 1px solid var(--line); background: var(--bg-sunken); }
.terminal-head {
  padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--line); font-family: var(--font-mono);
  font-size: 0.75rem; color: var(--ink-dim);
}
.terminal-body { padding: var(--space-4); font-size: 0.8125rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.key-reveal { border: 1px solid var(--accent); background: var(--bg-sunken); padding: var(--space-5); margin-top: var(--space-6); }
.key-warning { margin-top: var(--space-4); font-size: 0.8125rem; color: var(--ink-dim); line-height: 1.6; }

.usage-bar-track { margin-top: var(--space-2); height: 6px; background: var(--bg-sunken); border: 1px solid var(--line); }
.usage-bar-fill { height: 100%; background: var(--accent); }
.usage-bar-fill.is-over { background: var(--danger); }

.usage-analytics-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.usage-range-select {
  font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink); background: var(--bg-sunken);
  border: 1px solid var(--line); padding: 0.35rem 0.6rem;
}
.usage-chart-wrap { position: relative; height: 220px; margin-top: var(--space-4); }
.usage-chart-wrap.is-tall { height: 280px; }
.usage-table-scroll { max-height: 260px; overflow-y: auto; margin-top: var(--space-4); border-top: 1px solid var(--line); }
.usage-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.usage-table th { text-align: left; color: var(--ink-dim); font-weight: 500; padding: 0.4rem 0.5rem; position: sticky; top: 0; background: var(--bg-raised); border-bottom: 1px solid var(--line); }
.usage-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); }
.usage-table tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* documentation.html-specific — kept light-touch this pass (header/links updated to match the
   new design, content otherwise unchanged), so these classes get the same compatibility
   treatment as the portal above rather than a full rebuild. */
.steps { display: flex; flex-direction: column; gap: var(--space-6); }
.step { display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--space-4); }
.step-num {
  width: 2.5rem; height: 2.5rem; border: 1px solid var(--accent); display: flex; align-items: center;
  justify-content: center; font-family: var(--font-mono); font-weight: 700; color: var(--accent);
}
.step-num::before { counter-increment: step; content: counter(step); }
.steps { counter-reset: step; }
.step h3 { margin-bottom: var(--space-2); }
.step p { color: var(--ink-dim); font-size: 0.9375rem; }

.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.ref-card { border: 1px solid var(--line); background: var(--bg-raised); padding: var(--space-5); }
.ref-card h3 { margin-bottom: var(--space-3); }
.ref-card table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.ref-card td { padding: 0.4rem 0; border-bottom: 1px solid var(--line); color: var(--ink-dim); }
.ref-card td:first-child { font-family: var(--font-mono); color: var(--ink); white-space: nowrap; padding-right: var(--space-3); }
.ref-card tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
  .ref-grid { grid-template-columns: 1fr; }
}
