:root {
  /* ============================================================
   * MERIDIAN — warm night-cockpit palette (UX-1: deepened + disciplined).
   * Surfaces darkened for real elevation headroom; elevation is LIGHTNESS,
   * not shadow. Existing token NAMES kept so the whole app re-skins with no
   * per-component edits; new semantic names are aliased below.
   * ============================================================ */

  /* Surfaces — three steps, then stop */
  --bg-outer: #0d0b08;   /* canvas (app bg, behind the map) — near-black, not #000 */
  --bg: #16120d;         /* surface (panels, table bodies, cards) */
  --surface: #201a13;    /* raised (popovers, menus, drawers, pinned tooltip) */
  --surface-2: #2a2219;  /* raised hover / second raised */

  /* Lines — hairlines carry structure on dark */
  --border: #2c241a;         /* default hairline (ramp step ~6) */
  --border-soft: #241d15;    /* faintest divider */
  --border-strong: #71634d;  /* input outlines / emphasised edges — 3.2:1 on surface (WCAG 1.4.11) */
  --row-line: #221b14;       /* table row divider */

  /* Accent — the single interactive/live hue. Here and nowhere else. */
  --accent: #d98a5c;         /* Approach Amber */
  --accent-hover: #e6a884;

  /* Status — desaturated for dark; text vs fill; never colour-alone */
  --teal: #6fb0ad;           /* info / non-financial data-viz / map non-accent series */
  --green: #4ec26e;          /* positive (text) */
  --green-fill: #2f9e50;     /* positive (fill / bar) */
  --red: #f2708a;            /* negative (text) */
  --red-fill: #b13a50;       /* negative (fill) — 4.7:1 under --text (badge/strip fills) */
  --red-deep: #c8455c;       /* kept name — legacy hatch-gradient consumers */
  --amber: #e0a53a;          /* warn (amber, not yellow — yellow glows on OLED) */
  --gold: #c9a86a;           /* First cabin (was a duplicated orphan hex) */

  --text: #ede6da;           /* warm near-white, never #fff (OLED bloom) */
  --muted: #a89b89;          /* labels / secondary — the common muted tier */
  --muted-2: #8f846e;        /* faintest — restrict to >=11px; 4.7:1 even on --bg-raised */
  --on-accent: #1c130b;      /* dark text/glyph on the amber accent */

  /* Semantic aliases (new names → existing tokens; forward-compat) */
  --bg-app: var(--bg-outer);
  --bg-surface: var(--bg);
  --bg-raised: var(--surface);
  --pos: var(--green);
  --pos-fill: var(--green-fill);
  --neg: var(--red);
  --neg-fill: var(--red-fill);
  --ok: var(--green);
  --warn: var(--amber);
  --err: var(--red);
  --live: var(--accent);       /* live = the interactive accent (auction lots, ticking) */
  --info: var(--teal);
  --money-pos: var(--green);
  --money-neg: var(--red);

  /* Type */
  --font-ui: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-display: "Space Grotesk", sans-serif;
  --fs-2xs: 9px;   /* scanned headers / tags only (>=11px for muted-2 text) */
  --fs-xs: 10px;
  --fs-sm: 11px;
  --fs-md: 12.5px;
  --fs-lg: 15px;
  --fs-title: 18px; /* section/page titles (plan scale: title 18–20) */
  --fs-xl: 22px;    /* KPI figures */
  --fs-hero: 30px;  /* hero numbers / standalone-page H1s (plan scale: hero 28–32) */

  /* Shape */
  --r-sm: 5px;
  --r-md: 7px;
  --r-lg: 11px;

  /* Chrome geometry — the shell pins these heights; full-bleed pages (map)
   * consume --chrome-height instead of hardcoding. Primary nav is the LEFT
   * RAIL (UX-2b), so vertical chrome is just header + footer.
   * +2px = header border-bottom + footer border-top. */
  --header-h: 52px;
  --footer-h: 24px;
  --pillrow-h: 34px; /* fallback section-pill row (pages without a PageHeader) */
  --chrome-height: calc(var(--header-h) + var(--footer-h) + 2px);
  --rail-w: 216px;
  --rail-w-collapsed: 56px;

  /* Spacing — 4px atom / 8px rhythm. The only spacing scale (legacy --s-* retired).
   * Law: internal spacing <= external spacing. Density (UX-3) remaps space-md. */
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Density (UX-3) — a GLOBAL token remap, never a per-component tweak.
   * These are the Comfortable values; the compact block below remaps them.
   * main.tsx stamps data-density pre-paint (default: compact). */
  --cell-py: 10px; /* table cell vertical pad — Comfortable row ≈ 40px */

  /* Dashboard widget board (v1.50.0) — the snap grid's row unit. */
  --dash-row: 112px;
}

:root[data-density="compact"] {
  --space-md: 12px;
  --cell-py: 6px; /* row ≈ 32px (≥24px hit-area preserved by row width) */
  --dash-row: 104px; /* the widget board tightens with the rest of the app */
}

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }

:root { --www-body: 16px; --www-body-sm: 14px; --www-label: 11px; --www-measure: 58ch; --plate-pad: clamp(18px, 2.6vw, 30px); }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg-outer); color: var(--text); font-family: var(--font-ui); font-size: var(--www-body); line-height: 1.65; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); }

.top { display: flex; align-items: center; justify-content: space-between; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark { width: 22px; height: 22px; border-radius: var(--r-md); background: var(--accent); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1.5px dashed var(--on-accent); opacity: 0.85; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.top-nav { display: flex; gap: 22px; align-items: center; font-size: var(--www-body-sm); }
.top-nav a { color: var(--muted); }
.top-nav a:hover { color: var(--text); }
.btn { display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: 0.04em; padding: 9px 20px; border-radius: var(--r-md); background: var(--accent); color: var(--on-accent); }
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.top-nav a.btn, .top-nav a.btn:hover { color: var(--on-accent); }

.binder { display: flex; flex-direction: column; gap: clamp(26px, 4vw, 44px); padding-block: clamp(16px, 2.5vw, 28px) clamp(48px, 6vw, 80px); }
.plate { position: relative; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg); overflow: hidden; }
.plate::before, .plate::after { content: ""; position: absolute; top: 0; bottom: 0; width: 5px; background: repeating-linear-gradient(to bottom, var(--border-strong) 0 1px, transparent 1px 16px); opacity: 0.45; pointer-events: none; }
.plate::before { left: 0; }
.plate::after { right: 0; }
.brief { display: flex; align-items: stretch; border-bottom: 1px solid var(--border-strong); background: var(--surface); font-family: var(--font-mono); font-size: var(--www-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); overflow-x: auto; }
.b-cell { padding: 9px 14px; border-right: 1px solid var(--border-soft); white-space: nowrap; display: flex; align-items: center; }
.b-num { color: var(--text); font-weight: 600; letter-spacing: 0.16em; }
.b-title { font-family: var(--font-display); font-weight: 600; color: var(--text); letter-spacing: 0.1em; }
.b-tag { color: var(--muted); }
.b-ix { color: var(--accent); }
a.b-ix:hover { color: var(--accent-hover); background: var(--surface-2); }
.b-eff { margin-left: auto; border-right: none; border-left: 1px solid var(--border-soft); color: var(--muted); }
.plate-notes { display: flex; gap: 14px; align-items: baseline; padding: 10px var(--plate-pad); border-top: 1px solid var(--border-soft); font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.pn-k { color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase; flex: none; }
.pn-v { color: var(--muted); letter-spacing: 0.02em; }

/* the bulletin board: strip rows, newest first */
.news-list { display: flex; flex-direction: column; }
.news-row { display: flex; align-items: baseline; gap: 16px; padding: 14px var(--plate-pad); border-bottom: 1px solid var(--border-soft); color: var(--text); border-left: 3px solid transparent; }
.news-row:last-child { border-bottom: none; }
.news-row:hover { background: var(--surface); }
/* The 3px left rail is the Flight Strip's signature slot (rigid geometry).
 * Only bulletins color it — radar teal is the informational-status hue.
 * Releases keep it transparent: amber never carries semantic status (the
 * One Amber Rule), and the kind cell already names the kind. */
.news-row.bulletin { border-left-color: var(--teal); }
.nr-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted-2); flex: none; width: 96px; }
.nr-kind { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); flex: none; width: 76px; }
.nr-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nr-title { font-weight: 600; }
.nr-summary { color: var(--muted); font-size: var(--www-body-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-go { font-family: var(--font-mono); font-size: 12px; color: var(--accent); flex: none; }
.news-empty { padding: 40px var(--plate-pad); color: var(--muted-2); font-family: var(--font-mono); font-size: 13px; }

/* the reading column */
.post-body { padding: clamp(24px, 3.5vw, 40px) var(--plate-pad) clamp(40px, 5vw, 64px); }
.prose { max-width: 72ch; }
.prose h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; margin-bottom: 14px; }
.prose .lede { color: var(--muted); max-width: var(--www-measure); margin-bottom: 26px; }
.prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 21px; margin: 34px 0 12px; }
.prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 17px; margin: 26px 0 10px; }
.prose h4 { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 20px 0 8px; }
.prose p { color: var(--muted); margin: 0 0 14px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; color: var(--muted); }
.prose li { margin-bottom: 8px; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 4px; padding: 1px 5px; }
.prose pre { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-sm); padding: 14px 16px; overflow-x: auto; margin: 0 0 14px; }
.prose pre code { background: none; border: none; padding: 0; font-size: 12.5px; }
.prose blockquote { border-left: 3px solid var(--border-strong); padding-left: 14px; color: var(--muted); margin: 0 0 14px; }
.prose hr { border: none; border-top: 1px solid var(--border-soft); margin: 24px 0; }
.prose .table-scroll { overflow-x: auto; margin: 0 0 14px; }
.prose table { border-collapse: collapse; font-size: var(--www-body-sm); }
.prose th, .prose td { border: 1px solid var(--border-soft); padding: 6px 12px; text-align: left; color: var(--muted); }
.prose th { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

footer { border-top: 1px solid var(--border); background: var(--bg); }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 22px; font-size: 13.5px; color: var(--muted-2); }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }

@media (max-width: 700px) {
  .nr-summary { display: none; }
  .nr-date { width: 84px; }
  .top-nav { gap: 14px; }
}
