/* mswx — nerd-mode design system  ·  "weather ops terminal"
 *
 * Cyberpunk / phosphor-CRT theme. Near-black base, neon accents, glow,
 * scanlines, corner brackets, monospace-forward. Built to make the
 * multi-series chart MORE legible (neon lines pop on black), not less.
 *
 * Structure: tokens → CRT chrome → header/nav → primitives (page-head,
 * panel, controls, metric, table) → new components (boot, lab, glossary,
 * models, ticker) → page-specific → responsive.
 *
 * Every legacy class name from the pre-2026-05-26 design is preserved and
 * re-skinned, so the analysis pages (stations/verify/deltas/lapse/
 * inversions/records/last-frost) re-theme without per-page edits.
 */

/* ============================================================
   Tokens
   ============================================================ */
:root {
  /* base — near-black with a cold blue cast */
  --bg:        #05070b;
  --bg-2:      #0a0e16;
  --bg-3:      #0f1521;
  --bg-4:      #16203040;
  --line:      #1b2738;
  --line-soft: #131b28;
  --glass:     rgba(13, 20, 33, 0.72);

  /* text */
  --text:      #d6e6f5;
  --text-dim:  #7e93ad;
  --text-muted:#4f6178;

  /* neon palette */
  --cyan:      #2de2ff;
  --cyan-dim:  #178ca3;
  --magenta:   #ff2d9b;
  --magenta-dim:#a31e66;
  --green:     #39ff9e;
  --green-dim: #1f9c5f;
  --amber:     #ffb13d;
  --amber-dim: #b97c22;
  --violet:    #b07cff;
  --red:       #ff4d5e;

  /* semantic aliases (legacy names map here) */
  --accent:    var(--cyan);
  --accent-dim:var(--cyan-dim);
  --link:      var(--cyan);
  --danger:    var(--red);
  --canon:     var(--magenta);   /* composites / canonical = the "special" mark */
  --pos:       var(--amber);
  --neg:       var(--cyan);

  /* elevation-band colors (chart + cards) */
  --ridge:     #ffb13d;   /* plateau ridge — warm amber */
  --upper:     #ff7a45;   /* upper slope — hotter */
  --mid:       #2de2ff;   /* mid — cyan */
  --valley:    #39ff9e;   /* valley — green */

  /* glows */
  --glow-cyan:    0 0 8px rgba(45,226,255,0.55), 0 0 22px rgba(45,226,255,0.18);
  --glow-magenta: 0 0 8px rgba(255,45,155,0.55), 0 0 22px rgba(255,45,155,0.18);
  --glow-green:   0 0 8px rgba(57,255,158,0.5),  0 0 20px rgba(57,255,158,0.16);
  --glow-amber:   0 0 8px rgba(255,177,61,0.5),  0 0 20px rgba(255,177,61,0.16);

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  --nav-h: 52px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--sans);
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* faint cyber grid + radial vignette behind everything */
body {
  background-image:
    radial-gradient(1200px 700px at 80% -10%, rgba(45,226,255,0.06), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(255,45,155,0.05), transparent 55%),
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
}

/* CRT scanline overlay — fixed, non-interactive, very subtle */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.045) 3px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: overlay;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-shadow: var(--glow-cyan); }
code, .mono { font-family: var(--mono); }
.muted { color: var(--text-muted); }

::selection { background: rgba(45,226,255,0.28); color: #fff; }

/* ============================================================
   Header / nav — terminal title bar
   ============================================================ */
header.top {
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px;
  height: var(--nav-h);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0b121d, #070b12);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(45,226,255,0.12), 0 8px 24px rgba(0,0,0,0.5);
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand .logo {
  display: flex; align-items: center;
  filter: drop-shadow(0 0 6px rgba(45,226,255,0.45));
}
.brand .wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.brand .wordmark .ms { color: var(--text); }
.brand .wordmark .wx { color: var(--cyan); text-shadow: var(--glow-cyan); }
.brand .wordmark .slash { color: var(--magenta); margin: 0 1px; }
.brand .wordmark .mode {
  color: var(--magenta);
  text-shadow: var(--glow-magenta);
  animation: flicker 6s infinite steps(1);
}
@keyframes flicker {
  0%, 92%, 96%, 100% { opacity: 1; }
  93%, 95% { opacity: 0.35; }
  94% { opacity: 0.8; }
}
.brand .tagline {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-left: 1px solid var(--line);
  padding-left: 11px;
}

nav {
  display: flex; gap: 1px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  justify-content: flex-end;
  scroll-behavior: smooth;
}
nav::-webkit-scrollbar { display: none; }
nav a {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: var(--mono);
  white-space: nowrap;
  transition: background 90ms, color 90ms, box-shadow 90ms;
  position: relative;
}
nav a:hover { background: var(--bg-3); color: var(--cyan); text-decoration: none; }
nav a.active {
  color: var(--cyan);
  background: rgba(45,226,255,0.08);
  box-shadow: inset 0 -2px 0 var(--cyan), var(--glow-cyan);
}
nav a.back-to-simple {
  color: var(--text-muted);
  font-size: 11.5px;
  margin-right: 4px;
  padding-right: 11px;
  border-right: 1px solid var(--line);
}
nav a.back-to-simple:hover { color: var(--magenta); box-shadow: none; background: transparent; }
/* group divider — subtle vertical rule before a new nav cluster */
nav a.nav-sep { margin-left: 9px; }
nav a.nav-sep::before {
  content: ""; position: absolute; left: -5px; top: 25%; bottom: 25%;
  width: 1px; background: var(--line);
}

main {
  padding: 24px 24px 56px;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}
/* full-bleed main — the command wall fills the whole screen, no cap */
main.full { max-width: none; padding: 0; }

/* wide-ass desktop: give the content more room and let auto-fill grids
   add columns. The fixed cyber-grid backdrop fills any side margins, so
   centered content never reads as "empty" on an ultrawide. */
@media (min-width: 1800px) {
  main { max-width: 1840px; padding: 30px 40px 64px; }
  .chart-large { height: 560px; }
  html, body { font-size: 15.5px; }
}
@media (min-width: 2400px) {
  main { max-width: 2200px; }
}

footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11.5px;
  font-family: var(--mono);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: linear-gradient(0deg, #070b12, transparent);
}
footer a { color: var(--text-dim); }
.footer-build { color: var(--text-muted); }

/* live status dot */
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: var(--glow-green);
  margin-right: 5px; vertical-align: middle;
  animation: pulse 2.2s infinite ease-in-out;
}
.live-dot.stale { background: var(--amber); box-shadow: var(--glow-amber); }
.live-dot.dead  { background: var(--red); box-shadow: 0 0 8px rgba(255,77,94,0.6); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ============================================================
   Page header
   ============================================================ */
.page-head, .hero { margin-bottom: 20px; }
.page-head h1, .hero h1 {
  font-size: 26px;
  margin: 0;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.5px;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  color: var(--text);
}
.page-head h1::before, .hero h1::before {
  content: "> ";
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}
.page-head h1 small, .hero h1 small {
  font-size: 13px;
  font-weight: 400;
  font-family: var(--mono);
  color: var(--text-muted);
  letter-spacing: 0;
}
.page-head .subtitle, .hero .subtitle {
  color: var(--text-dim);
  margin: 8px 0 0 0;
  max-width: 76ch;
  font-size: 14.5px;
  line-height: 1.6;
}
.page-head .subtitle code, .subtitle code { color: var(--cyan); }
.page-head .eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--magenta);
  margin-bottom: 6px;
  text-shadow: var(--glow-magenta);
}

/* ============================================================
   Panel — the canonical surface, with corner brackets
   ============================================================ */
.panel, .card, .table-wrap, .chart-large {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 16px;
  position: relative;
  backdrop-filter: blur(2px);
}
/* corner brackets — cyber HUD frame */
.panel::before, .panel::after,
.bracketed::before, .bracketed::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  pointer-events: none;
}
.panel::before, .bracketed::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan);
  border-top-left-radius: var(--r-md);
  box-shadow: -2px -2px 8px rgba(45,226,255,0.18);
}
.panel::after, .bracketed::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--magenta); border-right: 1px solid var(--magenta);
  border-bottom-right-radius: var(--r-md);
  box-shadow: 2px 2px 8px rgba(255,45,155,0.18);
}
.panel.no-bracket::before, .panel.no-bracket::after { display: none; }
.panel-tight { padding: 10px 14px; }
.panel-flush { padding: 0; }
.panel h2, .card h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--cyan);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.panel h2 small, .card h2 small {
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 8px;
}
.panel-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}

.chart-large {
  height: 480px;
  padding: 14px 16px 8px;
}
.chart-md {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  height: 280px;
  padding: 12px 14px;
  margin-bottom: 16px;
  position: relative;
  backdrop-filter: blur(2px);
}

/* ============================================================
   Controls / forms
   ============================================================ */
.controls, .variable-selector, .multi-selector, .delta-form {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 18px;
  backdrop-filter: blur(2px);
}
.controls label, form label {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
form select, form button, button.btn, .controls select, .controls button {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 100ms, box-shadow 100ms, color 100ms;
}
form select:hover, .controls select:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
button { cursor: pointer; }
button:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: var(--glow-cyan); }

/* segmented "pill" toggle group (window presets) */
.seg, .pill-group { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button, .pill-group button {
  border: none; border-right: 1px solid var(--line); border-radius: 0;
  background: var(--bg-2); color: var(--text-dim);
  font-family: var(--mono); font-size: 12.5px; padding: 6px 13px;
}
.seg button:last-child, .pill-group button:last-child { border-right: none; }
.seg button:hover, .pill-group button:hover { box-shadow: none; background: var(--bg-3); }
.seg button.active, .pill-group button.active {
  background: rgba(45,226,255,0.12); color: var(--cyan);
  box-shadow: inset 0 -2px 0 var(--cyan);
}

.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

fieldset.station-checks {
  border: 1px dashed var(--line);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0;
}
.station-checks legend {
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.station-checks label {
  background: var(--bg-3);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.station-checks label:hover { box-shadow: var(--glow-cyan); }
.station-checks .sid { font-family: var(--mono); margin-right: 4px; }
.station-checks .elev { color: var(--text-muted); font-size: 10px; }
.check-band-ridge { border-left: 3px solid var(--ridge); }
.check-band-upper { border-left: 3px solid var(--upper); }
.check-band-mid   { border-left: 3px solid var(--mid); }
.check-band-valley{ border-left: 3px solid var(--valley); }

/* ============================================================
   Metrics — small KPI / stat cards
   ============================================================ */
.metric-grid, .stats-grid, .summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric, .stat-card, .summary-card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 15px;
  border-left: 3px solid var(--text-muted);
  position: relative;
  overflow: hidden;
}
.metric::after, .stat-card::after, .summary-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, transparent 60%, rgba(45,226,255,0.04));
}
.metric.band-ridge,  .stat-card.band-ridge,  .summary-card.band-ridge  { border-left-color: var(--ridge); }
.metric.band-upper,  .stat-card.band-upper                            { border-left-color: var(--upper); }
.metric.band-mid,    .stat-card.band-mid                              { border-left-color: var(--mid); }
.metric.band-valley, .stat-card.band-valley                           { border-left-color: var(--valley); }
.metric.accent, .summary-card                                         { border-left-color: var(--cyan); }
.metric.canon                                                         { border-left-color: var(--magenta); }

.metric .label, .summary-card .label {
  display: block;
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.metric .value, .summary-card .value {
  display: block;
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1.15;
  color: var(--text);
  margin-top: 3px;
  text-shadow: 0 0 12px rgba(45,226,255,0.15);
}
.metric .hint, .summary-card .hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}
.stat-card h3 {
  font-family: var(--mono); font-size: 12px;
  margin: 0 0 6px 0; color: var(--cyan);
}
.stat-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; margin: 0; }
.stat-card dl > div { display: flex; gap: 6px; align-items: baseline; }
.stat-card dt { font-size: 10px; text-transform: uppercase; color: var(--text-muted); font-family: var(--mono); }
.stat-card dd { font-family: var(--mono); font-size: 13px; margin: 0; color: var(--text); }
.stat-card.empty p { font-size: 12px; margin: 0; color: var(--text-muted); }

/* ============================================================
   Tables — unified .data-table; legacy aliases kept
   ============================================================ */
.data-table, .stations-table, .delta-table, .skill-table, .frost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td,
.stations-table th, .stations-table td,
.delta-table th, .delta-table td,
.skill-table th, .skill-table td,
.frost-table th, .frost-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  text-align: left;
}
.data-table th, .stations-table th, .delta-table th, .skill-table th, .frost-table th {
  background: var(--bg-2);
  color: var(--cyan);
  font-weight: 500;
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: sticky; top: var(--nav-h);
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.data-table td.num, .data-table th.num,
.stations-table td.num, .stations-table th.num,
.delta-table td.num, .delta-table th.num,
.skill-table td.num, .skill-table th.num,
.frost-table td.num, .frost-table th.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.data-table tbody tr:hover,
.stations-table tbody tr:hover,
.delta-table tbody tr:hover,
.skill-table tbody tr:hover,
.frost-table tbody tr:hover { background: rgba(45,226,255,0.04); }

.data-table tr.band-ridge,  .stations-table tr.band-ridge, .delta-table tr.band-ridge { background: rgba(255, 177, 61, 0.05); }
.data-table tr.band-upper,  .stations-table tr.band-upper                              { background: rgba(255, 122, 69, 0.05); }
.data-table tr.band-mid,    .stations-table tr.band-mid, .delta-table tr.band-mid     { background: rgba(45, 226, 255, 0.05); }
.data-table tr.band-valley, .stations-table tr.band-valley, .delta-table tr.band-valley{ background: rgba(57, 255, 158, 0.04); }
.data-table tr.canonical, .stations-table tr.canonical, .delta-table tr.canonical { box-shadow: inset 3px 0 0 var(--magenta); }

.table-wrap { padding: 0; overflow-x: auto; }
.table-wrap table { margin: 0; }

.station-name { font-weight: 600; }
.station-role { font-size: 11px; color: var(--cyan); margin-top: 2px; }
.station-note { color: var(--text-muted); font-size: 12px; margin-top: 4px; max-width: 60ch; }
.station-note.muted { font-style: italic; color: #4a5568; }
.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--magenta);
  color: #0a0410;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
  box-shadow: var(--glow-magenta);
}
.sid-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  padding: 1px 5px;
  background: rgba(45,226,255,0.08);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.td-name { color: var(--text-dim); }

/* delta bar */
.delta-cell { position: relative; width: 200px; }
.delta-bar {
  display: inline-block; position: relative;
  width: 140px; height: 10px;
  background: var(--bg-3); border-radius: 2px;
  vertical-align: middle; margin-right: 8px;
  border: 1px solid var(--line-soft);
}
.delta-bar .bar-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--text-muted); }
.delta-bar .bar-fill { position: absolute; top: 0; bottom: 0; }
.delta-bar .bar-fill.pos { left: 50%; background: var(--amber); box-shadow: var(--glow-amber); }
.delta-bar .bar-fill.neg { right: 50%; background: var(--cyan); box-shadow: var(--glow-cyan); }
.delta-value { font-family: var(--mono); font-size: 13px; }

/* MAE bar (verify) */
.mae { position: relative; width: 130px; }
.mae-bar { display: inline-block; height: 10px; background: var(--cyan); border-radius: 2px; vertical-align: middle; margin-right: 8px; box-shadow: var(--glow-cyan); }
.mae-value { font-family: var(--mono); font-size: 13px; }
.skill-wrap { margin: 18px 0; }
.skill-wrap h2 { font-size: 16px; margin-bottom: 8px; }

/* range bar (records) */
.range-cell { width: 220px; }
.range-bar { position: relative; height: 8px; background: var(--bg-3); border-radius: 2px; overflow: hidden; border: 1px solid var(--line-soft); }
.range-fill { position: absolute; top: 0; bottom: 0; background: linear-gradient(to right, var(--cyan), var(--amber), var(--red)); border-radius: 2px; }

/* ============================================================
   Stations page — composite-grouped cards
   ============================================================ */
.lapse-banner {
  margin: 0 0 16px 0;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  border-left: 3px solid var(--text-muted);
}
.lapse-banner.normal  { border-left-color: var(--valley); }
.lapse-banner.alert   { border-left-color: var(--magenta); color: var(--magenta); text-shadow: var(--glow-magenta); }

.composite-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
.composite-section { display: flex; flex-direction: column; gap: 10px; }

.member-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.other-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.card-station {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 15px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 120ms, box-shadow 120ms;
}
.card-station:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.card-station::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--text-muted);
}
.card-station.band-ridge::before  { background: var(--ridge); box-shadow: 0 0 12px var(--ridge); }
.card-station.band-upper::before  { background: var(--upper); box-shadow: 0 0 12px var(--upper); }
.card-station.band-mid::before    { background: var(--mid); box-shadow: 0 0 12px var(--mid); }
.card-station.band-valley::before { background: var(--valley); box-shadow: 0 0 12px var(--valley); }
.card-station.canon::before { width: 4px; }

.card-composite {
  background:
    linear-gradient(180deg, rgba(255,45,155,0.08), var(--glass) 55%);
  border-color: rgba(255,45,155,0.4);
  padding: 15px 17px 17px;
}
.card-composite::before { background: var(--magenta); width: 4px; box-shadow: 0 0 14px var(--magenta); }
.card-composite:hover { border-color: var(--magenta); box-shadow: var(--glow-magenta); }
.card-composite .cs-temp { font-size: 52px; }
.card-composite .cs-name .station-chip { font-size: 16px; }

.cs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cs-name { min-width: 0; flex: 1; }
.cs-name .station-chip { font-size: 14px; }
.cs-role { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }
.cs-meta {
  text-align: right; font-family: var(--mono); font-size: 10px;
  color: var(--text-muted); line-height: 1.4; flex-shrink: 0;
}
.cs-meta span { display: block; }
.cs-elev { color: var(--text-dim) !important; font-size: 11px !important; }
.cs-hw { color: var(--text-muted); }

.cs-body { display: flex; align-items: flex-end; gap: 14px; margin-top: 8px; }
.cs-temp {
  font-family: var(--mono); font-size: 36px; font-weight: 600;
  line-height: 1; letter-spacing: -1px; color: var(--text); flex-shrink: 0;
  text-shadow: 0 0 16px rgba(45,226,255,0.2);
}
.card-composite .cs-temp { text-shadow: 0 0 18px rgba(255,45,155,0.3); }
.cs-vars {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px 12px; margin: 0; padding: 0; flex: 1;
}
.cs-vars > div { display: flex; flex-direction: column; min-width: 0; }
.cs-vars dt { font-size: 9px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.08em; font-family: var(--mono); }
.cs-vars dd { font-family: var(--mono); font-size: 13px; margin: 0; color: var(--text-dim); }

.cs-spark { margin-top: 10px; height: 44px; }
.card-composite .cs-spark { height: 56px; }

.cs-desc { margin: 8px 0 0 0; font-size: 12px; color: var(--text-dim); line-height: 1.5; white-space: pre-wrap; }
.cs-notes { margin: 4px 0 0 0; font-size: 11px; color: var(--text-muted); font-style: italic; }

.cs-foot {
  display: flex; align-items: center; gap: 10px;
  padding-top: 8px; margin-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--text-muted); font-family: var(--mono);
}
.cs-time { flex-shrink: 0; }
.cs-id { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.cs-id code { background: transparent; padding: 0; }
.cs-graph { font-family: var(--mono); flex-shrink: 0; }

.big-temp {
  font-family: var(--mono); font-weight: 600; line-height: 1;
  letter-spacing: -1px; color: var(--text);
}

/* ============================================================
   Pool page — water/air summary tiles
   ============================================================ */
.tile-grid.pool-tiles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.pool-tiles .tile {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 13px 16px;
  position: relative; overflow: hidden;
}
.pool-tiles .tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.pool-tiles .tile-pool::before { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.pool-tiles .tile-air::before  { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.pool-tiles .tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-family: var(--mono); }
.pool-tiles .tile-temp {
  font-family: var(--mono); font-size: 36px; font-weight: 600; line-height: 1.1;
  letter-spacing: -1px; color: var(--text); margin-top: 2px;
  text-shadow: 0 0 16px rgba(45,226,255,0.2);
}
.pool-tiles .tile-sub { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-top: 4px; }
@media (max-width: 600px) { .tile-grid.pool-tiles { grid-template-columns: 1fr; } }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 22px 0 12px 0;
}
.section-head h2 {
  font-size: 13px; font-weight: 600; margin: 0; color: var(--cyan);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
}
.section-head h2::before { content: "// "; color: var(--magenta); }
.section-head h2 small {
  color: var(--text-muted); font-weight: 400; text-transform: none;
  letter-spacing: 0; margin-left: 6px; font-family: var(--mono);
}

.asof {
  text-align: right; color: var(--text-muted); margin-top: 12px;
  font-family: var(--mono); font-size: 11px;
}

/* ============================================================
   Stations directory
   ============================================================ */
.stations-table td > .station-role { display: none; }
.stations-directory .station-name-cell strong { font-family: var(--mono); font-size: 13px; }

/* ============================================================
   Misc / info panels / legends
   ============================================================ */
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); font-family: var(--mono); cursor: default; }
.swatch { width: 14px; height: 4px; display: inline-block; border-radius: 2px; }

.info-panel {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 16px; margin-top: 16px;
}
.info-panel summary {
  cursor: pointer; color: var(--cyan); font-size: 13px; font-family: var(--mono);
  user-select: none; padding: 2px 0; list-style: none;
}
.info-panel summary::before { content: "[+] "; color: var(--magenta); }
.info-panel[open] summary::before { content: "[−] "; }
.info-panel summary:hover { text-shadow: var(--glow-cyan); }
.info-panel ul, .info-panel p { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; }
.info-panel ul { padding-left: 18px; }
.info-panel h3 { color: var(--cyan); font-size: 13px; font-family: var(--mono); }

.ref-caption {
  color: var(--text-dim); font-size: 12px; margin: 0 0 10px 0;
  padding: 8px 12px; background: rgba(45,226,255,0.05);
  border-left: 3px solid var(--cyan); border-radius: 4px;
}

/* station chip + tooltip */
.station-chip {
  font-family: var(--mono); font-weight: 600; cursor: help;
  border-bottom: 1px dotted var(--text-muted);
  padding: 1px 2px; border-radius: 2px; position: relative; outline: none;
}
.station-chip:hover, .station-chip:focus {
  color: var(--cyan); border-bottom-color: var(--cyan);
  background: rgba(45,226,255,0.08); text-shadow: var(--glow-cyan);
}
.tip-popover {
  position: fixed; z-index: 1000;
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--cyan);
  border-radius: var(--r-md); padding: 11px 14px;
  font-family: var(--sans); font-size: 12px; line-height: 1.5;
  max-width: 320px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.7), var(--glow-cyan);
  pointer-events: none; opacity: 0; transition: opacity 90ms ease;
}
.tip-popover.show { opacity: 1; pointer-events: auto; }
.tip-popover strong { color: var(--cyan); }
.tip-popover em { color: var(--text-dim); font-style: italic; }

.station-checks label.check-band-ridge,
.station-checks label.check-band-mid,
.station-checks label.check-band-valley,
.station-checks label.check-band-upper { cursor: help; }

/* last-frost page */
.frost-table .hd-mswx  { background: rgba(255,45,155,0.10); color: var(--magenta); text-align: center; }
.frost-table .hd-hsvwx { background: rgba(45,226,255,0.10); color: var(--cyan);    text-align: center; }
.frost-table tbody td { font-variant-numeric: tabular-nums; }
.frost-table .pos { color: var(--magenta); }
.frost-table .neg { color: var(--cyan); }

/* ============================================================
   NEW — term links (glossary cross-references)
   ============================================================ */
.term {
  color: var(--cyan);
  border-bottom: 1px dashed var(--cyan-dim);
  cursor: help;
  font-weight: 500;
}
.term:hover { text-shadow: var(--glow-cyan); border-bottom-color: var(--cyan); text-decoration: none; }

/* ============================================================
   NEW — boot / terminal hero (landing)
   ============================================================ */
.boot {
  font-family: var(--mono);
  background: linear-gradient(180deg, rgba(45,226,255,0.04), transparent);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 26px;
  position: relative;
  overflow: hidden;
}
.boot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 200px at 100% 0%, rgba(255,45,155,0.06), transparent 70%);
}
.boot .b-prompt { color: var(--magenta); }
.boot .b-line { color: var(--text-dim); font-size: 13.5px; margin: 2px 0; }
.boot .b-line .ok { color: var(--green); text-shadow: var(--glow-green); }
.boot .b-line .val { color: var(--cyan); }
.boot .b-line .warn { color: var(--amber); }
.boot .b-title {
  font-size: 30px; font-weight: 700; letter-spacing: -1px; color: var(--text);
  margin: 6px 0 4px;
}
.boot .b-title .c { color: var(--cyan); text-shadow: var(--glow-cyan); }
.boot .b-title .m { color: var(--magenta); text-shadow: var(--glow-magenta); }
.boot .cursor {
  display: inline-block; width: 9px; height: 16px; background: var(--cyan);
  vertical-align: text-bottom; margin-left: 3px; animation: blink 1.1s steps(1) infinite;
  box-shadow: var(--glow-cyan);
}
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

/* live readout strip on landing */
.readout {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; margin-bottom: 26px;
}
.readout .ro {
  background: var(--bg-2); padding: 12px 14px;
}
.readout .ro .k { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.readout .ro .v { font-family: var(--mono); font-size: 22px; color: var(--text); margin-top: 3px; }
.readout .ro .v.cyan { color: var(--cyan); text-shadow: var(--glow-cyan); }
.readout .ro .v.magenta { color: var(--magenta); text-shadow: var(--glow-magenta); }
.readout .ro .v.green { color: var(--green); text-shadow: var(--glow-green); }
.readout .ro .v.amber { color: var(--amber); text-shadow: var(--glow-amber); }
.readout .ro .sub { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ============================================================
   NEW — lab grid (landing tool cards)
   ============================================================ */
.lab-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.lab-card {
  display: block; background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px;
  position: relative; overflow: hidden;
  transition: border-color 130ms, box-shadow 130ms, transform 130ms;
  color: var(--text);
}
.lab-card:hover {
  border-color: var(--cyan); box-shadow: var(--glow-cyan);
  transform: translateY(-2px); text-decoration: none;
}
.lab-card::after {
  content: attr(data-idx); position: absolute; top: 10px; right: 14px;
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.1em;
}
.lab-card .lc-glyph { font-size: 22px; line-height: 1; }
.lab-card .lc-title {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  color: var(--cyan); margin: 10px 0 4px; letter-spacing: -0.2px;
}
.lab-card:hover .lc-title { text-shadow: var(--glow-cyan); }
.lab-card .lc-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.lab-card .lc-tag {
  display: inline-block; margin-top: 10px; font-family: var(--mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--magenta); border: 1px solid var(--magenta-dim);
  border-radius: 3px; padding: 1px 6px;
}
.lab-card.feature { grid-column: span 2; border-color: rgba(255,45,155,0.35); }
.lab-card.feature::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, rgba(255,45,155,0.06), transparent 50%);
}
.lab-card.feature:hover { border-color: var(--magenta); box-shadow: var(--glow-magenta); }
.lab-card.feature .lc-title { color: var(--magenta); }
.lab-card.feature:hover .lc-title { text-shadow: var(--glow-magenta); }

/* ============================================================
   NEW — glossary / decoder
   ============================================================ */
.gloss-nav {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px;
}
.gloss-nav a {
  font-family: var(--mono); font-size: 12px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text-dim);
  background: var(--bg-2);
}
.gloss-nav a:hover { border-color: var(--cyan); color: var(--cyan); text-decoration: none; box-shadow: var(--glow-cyan); }

.gloss-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.term-card {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 15px 17px;
  border-left: 3px solid var(--cyan); scroll-margin-top: 70px;
  position: relative;
}
.term-card.kind-composite { border-left-color: var(--magenta); }
.term-card.kind-model     { border-left-color: var(--amber); }
.term-card.kind-radar     { border-left-color: var(--green); }
.term-card.kind-metric    { border-left-color: var(--violet); }
.term-card .t-name {
  font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--text);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.term-card .t-abbr { color: var(--cyan); }
.term-card.kind-composite .t-abbr { color: var(--magenta); }
.term-card .t-say {
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  font-style: italic;
}
.term-card .t-kind {
  font-family: var(--mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted);
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px;
  margin-left: auto;
}
.term-card .t-def { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; margin: 9px 0 0; }
.term-card .t-def b { color: var(--text); }
.term-card .t-def code { color: var(--cyan); font-size: 12.5px; }
.term-card .t-eg {
  font-size: 12px; color: var(--text-muted); margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--line-soft);
  font-style: italic;
}

/* ============================================================
   NEW — models page
   ============================================================ */
.model-card {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 14px;
  position: relative; overflow: hidden;
}
.model-card .m-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.model-card .m-code {
  font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--cyan);
}
.model-card .m-name { font-size: 14px; color: var(--text); }
.model-card .m-origin { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-left: auto; }
.model-card .m-body { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; margin: 10px 0 0; }
.model-card .m-body b { color: var(--text); }
.model-card .m-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 11px;
}
.model-card .m-meta .mm { color: var(--text-muted); }
.model-card .m-meta .mm b { color: var(--text-dim); font-weight: 500; }
/* importance dots */
.m-imp { display: inline-flex; gap: 3px; vertical-align: middle; }
.m-imp i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: inline-block; }
.m-imp i.on { background: var(--cyan); box-shadow: var(--glow-cyan); }
.model-card.tier-core   { border-left: 3px solid var(--magenta); }
.model-card.tier-core .m-code { color: var(--magenta); }
.model-card.tier-support{ border-left: 3px solid var(--cyan); }
.model-card.tier-archive{ border-left: 3px solid var(--text-muted); }
.tier-tag {
  font-family: var(--mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 1px 7px; border-radius: 3px;
}
.tier-tag.core { background: var(--magenta); color: #0a0410; }
.tier-tag.support { background: rgba(45,226,255,0.15); color: var(--cyan); border: 1px solid var(--cyan-dim); }
.tier-tag.archive { background: var(--bg-3); color: var(--text-muted); border: 1px solid var(--line); }

/* generic prose block for primers */
.prose { max-width: 76ch; }
.prose p { color: var(--text-dim); font-size: 14.5px; line-height: 1.7; }
.prose h3 { color: var(--cyan); font-family: var(--mono); font-size: 14px; margin: 22px 0 8px; }
.prose h3::before { content: "// "; color: var(--magenta); }
.prose code { color: var(--cyan); font-size: 13px; }
.prose b, .prose strong { color: var(--text); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  main { padding: 18px 14px 40px; }
  .composite-grid { grid-template-columns: 1fr; gap: 14px; }
  .member-grid { grid-template-columns: 1fr 1fr; }
  .other-grid { grid-template-columns: 1fr 1fr; }
  .chart-large { height: 380px; }
  .lab-card.feature { grid-column: span 1; }

  .brand .tagline { display: none; }

  header.top {
    flex-direction: column; align-items: stretch; height: auto;
    padding: 0; gap: 0;
  }
  .brand { padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
  nav {
    flex: 0 1 auto; width: 100%; justify-content: flex-start;
    padding: 7px 12px; background: var(--bg-2);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
  }
  nav a { padding: 6px 10px; font-size: 12.5px; flex-shrink: 0; }
  nav a.back-to-simple { padding-right: 11px; }

  /* Stations directory: collapse to "list of cards" layout */
  .stations-table thead { display: none; }
  .stations-table, .stations-table tbody, .stations-table tr, .stations-table td { display: block; width: 100%; }
  .stations-table tr {
    background: var(--bg-2) !important; border: 1px solid var(--line);
    border-radius: var(--r-md); margin-bottom: 8px; padding: 10px 12px; position: relative;
  }
  .stations-table tr.canonical { box-shadow: inset 3px 0 0 var(--magenta); }
  .stations-table tr.band-ridge { box-shadow: inset 3px 0 0 var(--ridge); }
  .stations-table tr.band-upper { box-shadow: inset 3px 0 0 var(--upper); }
  .stations-table tr.band-mid   { box-shadow: inset 3px 0 0 var(--mid); }
  .stations-table tr.band-valley{ box-shadow: inset 3px 0 0 var(--valley); }
  .stations-table tr.canonical.band-ridge,
  .stations-table tr.canonical.band-mid,
  .stations-table tr.canonical.band-valley { box-shadow: inset 3px 0 0 var(--magenta); }
  .stations-table td { border: none; padding: 2px 0; }
  .stations-table td[data-label]::before {
    content: attr(data-label); display: inline-block; min-width: 64px;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); margin-right: 6px; font-family: var(--mono);
  }
  .stations-table td.row-head { padding-bottom: 6px; }
  .stations-table td.row-head strong { font-family: var(--mono); font-size: 14px; }

  .table-wrap { overflow-x: auto; }
}

@media (max-width: 600px) {
  header.top { padding: 0; }
  nav { gap: 0; }
  nav a { padding: 6px 9px; font-size: 12px; }
  .member-grid, .other-grid { grid-template-columns: 1fr; }
  .metric-grid, .stats-grid, .summary-row { grid-template-columns: 1fr 1fr; }
  .cs-vars { grid-template-columns: repeat(2, 1fr); }
  .card-composite .cs-temp { font-size: 44px; }
  .gloss-grid, .lab-grid { grid-template-columns: 1fr; }
  .boot .b-title { font-size: 23px; }
  .page-head h1, .hero h1 { font-size: 22px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .brand .wordmark .mode, .live-dot, .boot .cursor { animation: none; }
}

/* nav highlight legacy */
nav a.highlight { color: var(--magenta); }
nav a.active.highlight { color: #0a0410; background: var(--magenta); }
