/* ==========================================================================
   The Battin Front: shared design system (css/tbf.css)

   Loaded on every public page AFTER css/styles.css and any page stylesheet,
   by the head partial that tools/sync-partials.ps1 stamps into each page.
   The internal tools (knowledge-base.html, metassist.html, ...) do not load
   it, so nothing here can change them.

   Layout of this file:
     1. Tokens (light default, dark via system or the manual switch)
     2. Base
     3. Header: nav, tabs, menu, sub-nav
     4. Alert strip
     5. Components: buttons, pills, cards, tables, forms, town picker
     6. Broadcast 5-day card (dark in both themes)
     7. Home page
     8. Footer
     9. Legacy bridge: maps css/styles.css onto the tokens
    10. Page bridges (weather, climatology, space weather, maps, chase log)
    11. Reduced motion

   Dark values come from the Hub's stylesheet; the light theme uses the same
   TBF blue with cool greys. The logo gradient (--brand-grad) is for follow
   and subscribe buttons only.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #eef2f8;
  --bg-2: #f7f9fc;
  --panel: #ffffff;
  --panel-2: #f1f4f9;
  --raise: rgba(12,30,60,.04);
  --raise-2: rgba(12,30,60,.08);
  --line: rgba(12,30,60,.10);
  --line-strong: rgba(12,30,60,.20);
  --text: #0d1524;
  --dim: #45526a;
  --mute: #66728a;
  --accent: #1a5fb4;
  --accent-hover: #154c90;
  --accent-text: #1a5fb4;
  --accent-soft: rgba(26,95,180,.12);
  --accent-line: rgba(26,95,180,.45);
  --on-accent: #ffffff;
  --nav-bg: linear-gradient(180deg, #ffffff, #f3f6fb);
  --glow: rgba(26,95,180,.10);
  --shadow: 0 10px 28px -18px rgba(12,30,60,.45);
  --warm-text: #c2410c;
  --cold-text: #0369a1;
  --even-text: #a16207;
  --good-text: #15803d;
  --bad-text: #b91c1c;
  --brand-grad: linear-gradient(90deg, #3230e6, #8b2be2 52%, #e02be2);
  --live: #15803d;
  --live-bg: rgba(21,128,61,.10);
  --watch: #a16207;
  --watch-bg: rgba(202,138,4,.14);
  /* chart colors: Chart.js reads these through TBF.token() */
  --chart-text: #45526a;
  --chart-grid: rgba(12,30,60,.10);
  --chart-bar: #8a96ab;
  --chart-hi: #c2410c;
  /* outlook categories and the meteorologist's-lean card (climatology.css) */
  --cat-above: #c62828; --cat-near: #b45309; --cat-below: #2e7d32; --cat-info: #0277bd; --cat-happened: #b45309;
  --lean: #7c3aed; --lean-text: #5b21b6; --lean-soft: rgba(124,58,237,.10);
  --lean-temp: #c2410c; --lean-precip: #a16207; --lean-snow: #1a5fb4;
  --inset: rgba(12,30,60,.04);

  /* broadcast graphics stay dark in both themes, like the Hub's slides */
  --gfx-text: #eaeef6;
  --gfx-dim: #b5c3d8;
  --strip-dark: #0b0f18;

  --r1: 6px; --r2: 9px; --r3: 14px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-xs: 12.5px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: clamp(24px, 3.4vw, 30px);
  --fs-2xl: clamp(28px, 5vw, 44px);
  --ease: cubic-bezier(.22,1,.36,1);
  --wrap: 1160px;
  --gutter: 16px;
}
@media (min-width: 700px) { :root { --gutter: 24px; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #070a11; --bg-2: #0b0f18; --panel: #0f141f; --panel-2: #161d2b;
    --raise: rgba(255,255,255,.035); --raise-2: rgba(255,255,255,.07);
    --line: rgba(255,255,255,.08); --line-strong: rgba(255,255,255,.16);
    --text: #eaeef6; --dim: #97a3b6; --mute: #7d889c;
    --accent-hover: #2170cf;
    --accent-text: #72a9f0; --accent-soft: rgba(26,95,180,.22); --accent-line: rgba(114,169,240,.55);
    --nav-bg: linear-gradient(180deg, rgba(18,26,42,.98), rgba(9,13,22,.98));
    --glow: rgba(26,95,180,.18);
    --shadow: 0 16px 36px -20px rgba(0,0,0,.8);
    --warm-text: #ffb570; --cold-text: #9fd8ff; --even-text: #ffb02e;
    --good-text: #5ee08f; --bad-text: #ff8a8a;
    --live: #2bd46e; --live-bg: rgba(43,212,110,.12); --watch: #ffb02e; --watch-bg: rgba(255,176,46,.12);
    --chart-text: #97a3b6; --chart-grid: rgba(255,255,255,.08); --chart-bar: #5c6b84; --chart-hi: #ffb570;
    --cat-above: #ef5350; --cat-near: #ff9800; --cat-below: #66bb6a; --cat-info: #4fc3f7; --cat-happened: #fbbf24;
    --lean: #a78bfa; --lean-text: #ddd6fe; --lean-soft: rgba(124,58,237,.22);
    --lean-temp: #e0662c; --lean-precip: #d6a45c; --lean-snow: #93c5fd;
    --inset: rgba(4,7,13,.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070a11; --bg-2: #0b0f18; --panel: #0f141f; --panel-2: #161d2b;
  --raise: rgba(255,255,255,.035); --raise-2: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.08); --line-strong: rgba(255,255,255,.16);
  --text: #eaeef6; --dim: #97a3b6; --mute: #7d889c;
  --accent-hover: #2170cf;
  --accent-text: #72a9f0; --accent-soft: rgba(26,95,180,.22); --accent-line: rgba(114,169,240,.55);
  --nav-bg: linear-gradient(180deg, rgba(18,26,42,.98), rgba(9,13,22,.98));
  --glow: rgba(26,95,180,.18);
  --shadow: 0 16px 36px -20px rgba(0,0,0,.8);
  --warm-text: #ffb570; --cold-text: #9fd8ff; --even-text: #ffb02e;
  --good-text: #5ee08f; --bad-text: #ff8a8a;
  --live: #2bd46e; --live-bg: rgba(43,212,110,.12); --watch: #ffb02e; --watch-bg: rgba(255,176,46,.12);
  --chart-text: #97a3b6; --chart-grid: rgba(255,255,255,.08); --chart-bar: #5c6b84; --chart-hi: #ffb570;
    --cat-above: #ef5350; --cat-near: #ff9800; --cat-below: #66bb6a; --cat-info: #4fc3f7; --cat-happened: #fbbf24;
    --lean: #a78bfa; --lean-text: #ddd6fe; --lean-soft: rgba(124,58,237,.22);
    --lean-temp: #e0662c; --lean-precip: #d6a45c; --lean-snow: #93c5fd;
    --inset: rgba(4,7,13,.45);
}

/* 2. Base ------------------------------------------------------------------ */
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 500px at 70% -120px, var(--glow), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.6 var(--font);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
h1, h2, h3 { text-wrap: balance; }
.num, time { font-variant-numeric: tabular-nums; }
.eyebrow { font: 700 12px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.note { font-size: 13px; color: var(--mute); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: var(--r2); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
:where(a, button, select, input, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 4px;
}
/* plain links in running text get the link blue and an underline */
:where(main) :where(p, li, td, dd, figcaption) > a:not([class]) {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
img, svg, video, canvas, iframe { max-width: 100%; }
/* ...except inside a Leaflet map. Leaflet only exempts its own overlay pane;
   a custom pane (the alerts map's county outline) is
   a 0-wide div, so its SVG would be clamped to 0 px and vanish. */
.leaflet-container svg, .leaflet-container canvas, .leaflet-container img { max-width: none; max-height: none; }

/* 3. Header ---------------------------------------------------------------- */
.site-header { position: relative; z-index: 900; }
.site-nav {
  position: relative;
  background: var(--nav-bg);
}
.site-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--accent-text), transparent 70%); opacity: .6;
}
.nav-row {
  max-width: var(--wrap); margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap;
}
/* Brand: the TBF lightning letters (cropped from the Hub logo, white outline
   so they read on light and dark) + the name set in Inter. The old PNG had a
   black wordmark baked in that vanished on the dark header. */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand picture { display: block; flex: none; }
.brand-mark { height: 36px; width: auto; display: block; }
.brand-text { display: grid; gap: 3px; }
.brand-name { font: 700 17px/1.05 var(--font); letter-spacing: -.01em; color: var(--text); white-space: nowrap; }
.brand-sub { font: 500 12px/1.1 var(--font); color: var(--dim); white-space: nowrap; }
.tabs { display: flex; gap: 4px; margin-left: auto; min-width: 0; }
.tab {
  font: 600 14px/1 var(--font); color: var(--dim); text-decoration: none; white-space: nowrap;
  padding: 9px 12px; border-radius: var(--r2); border: 1px solid transparent;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.tab:hover { background: var(--raise-2); color: var(--text); }
.tab.on { color: var(--text); background: var(--accent-soft); border-color: var(--accent-line); }
.nav-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.menu-btn {
  width: 38px; height: 38px; border-radius: var(--r2); border: 1px solid var(--line-strong);
  background: transparent; color: var(--dim); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.menu-btn:hover { background: var(--raise-2); color: var(--text); }
.menu-btn svg { width: 18px; height: 18px; }
.site-menu {
  position: absolute; right: var(--gutter); top: calc(100% + 6px); z-index: 950;
  width: min(300px, calc(100vw - 2 * var(--gutter)));
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px; display: grid; gap: 12px;
}
.site-menu[hidden] { display: none; }
.site-menu .eyebrow { margin-bottom: -4px; }
.site-menu nav { display: grid; gap: 2px; }
.site-menu nav a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: var(--r1); font-weight: 500; font-size: 15px; }
.site-menu nav a:hover { background: var(--raise-2); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r2); overflow: hidden; }
.seg button { font: 600 13px/1 var(--font); padding: 9px 12px; background: transparent; color: var(--dim); border: 0; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.subnav { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.subnav-row {
  max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gutter);
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
}
.subnav-row::-webkit-scrollbar { display: none; }
.subnav a {
  font: 600 13px/1 var(--font); color: var(--dim); text-decoration: none; white-space: nowrap;
  padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line);
}
.subnav a:hover { color: var(--text); border-color: var(--line-strong); }
.subnav a[aria-current="page"] { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }

/* 901-1100: the name + eight tabs + menu only just fit on one row */
@media (min-width: 901px) and (max-width: 1100px) {
  .brand-sub { display: none; }
  .tabs { gap: 2px; }
  .tab { padding-inline: 8px; }
}
@media (min-width: 901px) and (max-width: 1000px) {
  .nav-row { column-gap: 12px; }
  .brand-mark { height: 30px; }
  .brand-name { font-size: 16px; }
  .tab { font-size: 13px; padding-inline: 6px; }
}

@media (max-width: 900px) {
  .nav-row { padding-block: 10px 0; }
  .brand { gap: 8px; }
  .brand-mark { height: 30px; }
  .brand-name { font-size: 16px; }
  .brand-sub { display: none; }
  .nav-tools { margin-left: auto; }
  .tabs {
    order: 3; flex: 1 0 100%; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 10px;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { font-size: 13px; padding: 8px 10px; }
}

/* 4. Alert strip ------------------------------------------------------------ */
/* Snow Day Chance: the tab and the homepage banner exist only while an
   estimate is current (js/tbf.js adds them from api/snow-day.php). */
.tab-snowday:not(.on) { color: var(--accent-text); }
.snowday-banner { margin: 0 0 14px; }
.snowday-banner-link {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 16px;
  border-radius: 12px; border: 1px solid var(--accent-line); background: var(--accent-soft);
  color: var(--text); text-decoration: none;
}
.snowday-banner-link b { font: 800 17px/1.25 var(--font); }
.snowday-banner-link span { color: var(--dim); font-weight: 600; }
.snowday-banner-link:hover span { color: var(--accent-text); }

.alert-strip { border-bottom: 1px solid var(--line); background: var(--raise); }
.alert-strip[hidden] { display: none; }
.alert-row {
  max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gutter);
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  font-size: var(--fs-sm); color: var(--dim);
}
.alert-row a { color: inherit; }
.alert-strip.is-active { background: var(--strip-dark); border-bottom-color: rgba(255,255,255,.08); }
.alert-strip.is-active .alert-row { color: var(--gfx-dim); }
.alert-strip.is-active .alert-row a:not(.hz) { color: #72a9f0; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  font: 700 11.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; background: var(--live-bg); color: var(--live); border: 1px solid currentColor;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.watch { background: var(--watch-bg); color: var(--watch); }
/* hazard chips: --hz is the Hub hazard color, set inline per alert */
.hz {
  --hz: #b8c2d0;
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 11.5px/1.15 var(--font); letter-spacing: .05em; text-transform: uppercase; text-decoration: none;
  padding: 6px 9px; border-radius: var(--r1);
  color: var(--hz); border: 1px solid color-mix(in srgb, var(--hz) 50%, transparent);
  background: color-mix(in srgb, var(--hz) 12%, transparent);
}
.hz:hover { background: color-mix(in srgb, var(--hz) 22%, transparent); }
.hz b { font-weight: 800; color: #eaeef6; }
@media (max-width: 620px) {
  .alert-row { font-size: 13px; padding-block: 7px; }
  .alert-strip:not(.is-active) .alert-msg { display: none; }
}

/* 5. Components -------------------------------------------------------------- */
.btn, a.btn, button.btn {
  font: 600 14px/1 var(--font); padding: 11px 16px; border-radius: var(--r2);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease);
  box-shadow: none; transform: none;
}
.btn:hover { transform: none; box-shadow: none; }
.btn-primary, .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-ghost, .btn.ghost, .btn-secondary, .btn-outline {
  background: var(--raise); color: var(--text); border: 1px solid var(--line-strong);
}
.btn-ghost:hover, .btn.ghost:hover, .btn-secondary:hover, .btn-outline:hover {
  background: var(--raise-2); color: var(--text); border-color: var(--accent-line);
}
.btn-brand, .btn.brand { background: var(--brand-grad); color: #fff; border: 0; }
.btn-brand:hover, .btn.brand:hover { filter: brightness(1.08); color: #fff; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr; min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); border-left: 3px solid var(--accent);
}
.card-head h2, .card-head h3 { margin: 0; font: 700 14px/1.2 var(--font); letter-spacing: .02em; color: var(--text); }
.card-head span { font: 700 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.card-body { padding: 14px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.quiet { font-size: var(--fs-sm); color: var(--dim); margin: 0; }

.table-wrap { overflow-x: auto; }
.tbf-table, .table-wrap table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbf-table th, .table-wrap th {
  text-align: left; font: 700 11px/1.2 var(--font); letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); padding: 8px; border-bottom: 1px solid var(--line-strong);
}
.tbf-table td, .table-wrap td { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }

.picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picker label { font: 700 12px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.picker .note { margin-left: auto; }
.tbf-select, .picker select {
  font: 600 15px/1.2 var(--font); color: var(--text); background-color: var(--panel);
  border: 1px solid var(--line-strong); border-radius: var(--r2); padding: 10px 36px 10px 12px;
  appearance: none; -webkit-appearance: none; max-width: 100%;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.tbf-select option, .picker select option { background: var(--panel); color: var(--text); }

/* empty / unavailable state: says plainly what is missing (never a blank
   box, never Err or NaN) and, where there is one, where else to look */
.data-empty {
  border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--panel);
  padding: 22px 18px; text-align: center; color: var(--dim);
}
.data-empty h2, .data-empty h3 { margin: 0 0 6px; font: 700 var(--fs-md)/1.3 var(--font); color: var(--text); }
.data-empty p { margin: 0 auto; max-width: 62ch; font-size: var(--fs-sm); color: var(--dim); }
.data-empty p + p { margin-top: 8px; }
.data-empty .btn-row { justify-content: center; margin-top: 14px; }

/* page title band used by every inner page */
.page-title { padding: 28px 0 8px; }
.page-title h1 { margin: 0 0 6px; font: 800 var(--fs-2xl)/1.05 var(--font); letter-spacing: -.015em; color: var(--text); }
.page-title p { margin: 0; color: var(--dim); font-size: var(--fs-md); max-width: 68ch; }

/* 6. Broadcast 5-day card ---------------------------------------------------- */
.slide {
  border-radius: var(--r3); overflow: hidden; color: var(--gfx-text);
  background: linear-gradient(168deg, #1c3d68, #0e2242 62%, #0a1526);
  border: 1px solid var(--line);
}
.slide-head { position: relative; display: flex; align-items: stretch; flex-wrap: wrap; background: linear-gradient(180deg, rgba(19,29,52,.98), rgba(9,14,26,.97)); }
.slide-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, #1a5fb4, #72a9f0); }
.slide-title { padding: 16px 18px 12px; display: grid; gap: 4px; min-width: 0; }
.slide-title h2 { margin: 0; font: 800 clamp(24px, 4vw, 40px)/1 var(--font); letter-spacing: -.01em; text-transform: uppercase; color: var(--gfx-text); }
.slide-title p { margin: 0; color: var(--gfx-dim); font-size: 14px; }
.slide-sub {
  margin-left: auto; align-self: center; margin-right: 18px; background: #1a5fb4; color: #fff;
  font: 800 12px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px; border-radius: var(--r1);
}
.days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.day {
  border-radius: 12px; background: linear-gradient(180deg, rgba(86,120,205,.40), rgba(12,20,44,.72));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); padding: 12px 10px 14px;
  display: grid; gap: 6px; justify-items: center; align-content: start; text-align: center; min-width: 0;
}
.day b { font: 800 15px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; padding-bottom: 6px; border-bottom: 2px solid #72a9f0; }
.day .wx { width: 44px; height: 44px; }
.day .hi { font: 800 clamp(26px, 4vw, 42px)/1 var(--font); letter-spacing: -.02em; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.day .lo { font: 700 16px/1 var(--font); color: #9fd8ff; }
.day .sky { font-size: 12.5px; color: var(--gfx-dim); line-height: 1.3; }
.day .pop { font: 700 12px/1 var(--font); color: #9fd8ff; }
.slide-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 12px; padding: 0 16px 14px; color: #a3afc4; font-size: 12.5px; flex-wrap: wrap; }
.slide-foot a { color: #9fc6ff; font-weight: 600; }
.slide-foot .stamp { font: 600 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.slide-foot .stale { flex-basis: 100%; color: #ffb02e; font-weight: 600; }
.slide-empty { padding: 28px 18px; color: var(--gfx-dim); }
@media (max-width: 620px) {
  .slide-sub { display: none; }
  .days { grid-template-columns: 1fr; gap: 6px; padding: 10px; }
  .day {
    grid-template-columns: 46px 34px minmax(0, 1fr) auto; justify-items: start; align-items: center;
    text-align: left; padding: 8px 10px; gap: 8px;
  }
  .day b { border: 0; padding: 0; font-size: 14px; }
  .day .wx { width: 32px; height: 32px; grid-row: 1 / span 2; grid-column: 2; }
  .day b { grid-row: 1 / span 2; grid-column: 1; }
  .day .sky { grid-column: 3; grid-row: 1; font-size: 13px; color: var(--gfx-text); }
  .day .pop { grid-column: 3; grid-row: 2; }
  .day .temps { grid-column: 4; grid-row: 1 / span 2; }
  .day .hi { font-size: 26px; }
}
.day .temps { display: grid; gap: 6px; justify-items: center; }
@media (max-width: 620px) { .day .temps { display: flex; align-items: baseline; gap: 8px; } }

/* 7. Home -------------------------------------------------------------------- */
.home { padding-block: 22px 40px; display: grid; gap: 22px; }
.home-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 16px; }
.lean { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.lean li { border-radius: var(--r2); padding: 10px 6px; text-align: center; background: var(--raise); border: 1px solid var(--line); display: grid; gap: 4px; }
.lean em { font-style: normal; font: 800 22px/1 var(--font); }
.lean small { font: 700 10.5px/1.25 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.lean .up em { color: var(--warm-text); }
.lean .down em { color: var(--cold-text); }
.lean .level em { color: var(--even-text); }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r2); overflow: hidden; background: #0a1220; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: rgba(0,0,0,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%23fff'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.vid-title { color: var(--text); font-weight: 600; text-decoration: none; }
.vid-title:hover { color: var(--accent-text); }
.post { display: grid; gap: 4px; text-decoration: none; color: var(--text); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.post:last-of-type { border-bottom: 0; padding-bottom: 0; }
.post strong { font-weight: 600; font-size: 15px; line-height: 1.35; }
.post:hover strong { color: var(--accent-text); }
.post span { font-size: var(--fs-xs); color: var(--mute); }
.about-band { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.about-band p { margin: 0; color: var(--dim); max-width: 64ch; }
/* Latest graphics: the newest three from the Graphics Room gallery */
.gfx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gfx { display: grid; gap: 4px; align-content: start; min-width: 0; text-decoration: none; color: var(--text); }
.gfx-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r2); overflow: hidden; background: #0a1220; border: 1px solid var(--line); margin-bottom: 4px; }
.gfx-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gfx-badge { position: absolute; left: 8px; bottom: 8px; font: 700 10.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.6); padding: 5px 7px; border-radius: 6px; }
.gfx strong { font-weight: 600; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.gfx:hover strong { color: var(--accent-text); }
.gfx:hover .gfx-thumb { border-color: var(--accent-line); }
.gfx > span:last-child { font-size: var(--fs-xs); color: var(--mute); }
@media (max-width: 900px) { .home-row { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .gfx-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gfx:first-child, .gfx:nth-child(2):last-child { grid-column: 1 / -1; }
  .gfx:not(:first-child) strong { font-size: 14px; }
}
@media (max-width: 620px) { .picker .note { display: none; } .picker select { flex: 1 1 100%; } .home { padding-top: 14px; gap: 14px; } }

/* 8. Footer -------------------------------------------------------------------- */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 32px; }
.foot-row {
  max-width: var(--wrap); margin: 0 auto; padding: 18px var(--gutter);
  display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--mute);
}
.foot-row p { margin: 0; }
.foot-row nav { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.foot-row a { color: var(--dim); text-decoration: none; }
.foot-row a:hover { color: var(--accent-text); text-decoration: underline; }
.foot-legal { border-top: 1px solid var(--line); }
.foot-legal .foot-row { padding-block: 10px 14px; font-size: 12px; }

/* 9. Legacy bridge: css/styles.css on the new tokens ---------------------------- */
:root {
  --primary-color: var(--accent);
  --primary-dark: var(--accent-hover);
  --primary-light: var(--accent-text);
  --secondary-color: var(--warm-text);
  --dark-bg: var(--bg);
  --dark-bg-secondary: var(--panel);
  --dark-bg-tertiary: var(--panel-2);
  --text-light: var(--text);
  --text-gray: var(--dim);
  --text-dark: var(--text);
  --storm-gradient: linear-gradient(var(--accent-text), var(--accent-text));
  --accent-gradient: linear-gradient(var(--accent), var(--accent));
}
body { font-family: var(--font); }
/* the old headings were gradient-clipped text; the new look is plain text */
.page-header h1, .hero-title, .section-title, .about-content h2, .about-text h2, .mission-section h2,
.team-section h2, .location-section h2, .footer-section h3, .forecast-title-area h2, .condition-temp {
  background: none; -webkit-text-fill-color: currentColor; color: var(--text);
}
.page-header {
  padding: 28px 0 10px; background: none; border-bottom: 0; text-align: left;
}
.page-header h1 { font: 800 var(--fs-2xl)/1.05 var(--font); letter-spacing: -.015em; margin: 0 0 6px; }
.page-header p { font-size: var(--fs-md); color: var(--dim); margin: 0; max-width: 68ch; }
.page-header .container { text-align: left; }
.section-title { font-weight: 800; letter-spacing: -.01em; }
.container { max-width: var(--wrap); padding: 0 var(--gutter); }

/* borders the old stylesheet drew in white-on-dark */
.blog-card, .video-card, .team-member, .mission-card, .content-item, .modal-content, .sw-card, .sw-image-card,
.sw-chart-card, .guide-card, .alerts-map, .chase-map-controls, .map-control-btn, .filter-toggle-btn,
.forecast-card, .city-forecast-card, .history-card, .verification-card, .city-history-item,
.city-verification-item, .loading-message, .auth-message, .about-image-large .image-placeholder, .alert-filter-control {
  border-color: var(--line);
}
.blog-card, .video-card, .mission-card, .team-member, .sw-card, .sw-chart-card, .guide-card, .forecast-card,
.city-forecast-card, .history-card, .verification-card {
  background: var(--panel); box-shadow: none;
}
.blog-card:hover, .video-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.forecast-tabs, .history-header, .verification-header, .comparison-row, .condition-card-header,
.forecast-header, .condition-details, .chase-list-section, .chase-detail-header, .chase-detail-summary,
.sw-alert-body, .sw-image-label, .filter-header, .filter-actions, .guide-card h3 { border-color: var(--line); }
.chase-filter-panel, .chase-detail-panel { border-color: var(--line); background: var(--panel); }
.blog-card-category, .filter-btn.active, .stat-card, .mission-icon { background: var(--accent); color: var(--on-accent); }
.filter-btn {
  background: var(--raise); color: var(--dim); border: 1px solid var(--line-strong); border-radius: 999px;
  font: 600 13px/1 var(--font); padding: 9px 14px;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent-line); }
.filter-btn.active { border-color: var(--accent); }
.form-group input, .form-group select, .form-group textarea, .filter-group input[type=text], .filter-group select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line-strong);
}
.modal { background: rgba(4,7,13,.88); }
.modal-content { background: var(--panel); color: var(--text); }
.modal-close { background: var(--panel-2); color: var(--text); }
#modal-post-content .post-meta { border-color: var(--line); }
.sw-alert-item { background: var(--raise); }
.sw-alert-item:hover { background: var(--raise-2); }
.info.legend, .filter-header { color: var(--text); }
.info.legend { background: var(--panel); border-color: var(--line); }
.alert-filter-control { background: var(--panel); color: var(--text); }
.filter-checkbox:hover, .filter-header:hover { background: var(--raise-2); }
.alerts-map { background-color: var(--panel-2); }
.city-selector { background: var(--raise); border-color: var(--line); }
.city-selector select, .city-selector select option { color: var(--text); background-color: var(--panel); }
.forecast-header { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.forecast-header::before { display: none; }
/* forecasts.html uses .forecast-header on its page title too: keep that one plain */
.page-header.forecast-header { background: none; border: 0; border-radius: 0; }
.page-header.forecast-header, .page-header.forecast-header .container { text-align: left; }
.fb-post-card { background: var(--panel) !important; border-color: var(--line) !important; }
.fb-post-image { background: var(--panel-2) !important; }
.fb-post-link { background: var(--raise) !important; border-top-color: var(--line) !important; }
.fb-post-modal-content { background: var(--panel); border-color: var(--line); }
.fb-post-modal-body { border-left-color: var(--line); }
.fb-post-modal-meta { border-top-color: var(--line); }
.carousel-slide img { background: var(--panel-2); }
.alert-modal { background: rgba(4,7,13,.8); }
.alert-modal-content { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.loading-spinner { border-color: var(--line-strong); border-top-color: var(--accent-text); }

/* the old sections were spaced for a hero above them */
.blog-section, .videos-section, .photos-section, .forecast-section, .chase-archive-section { padding-top: 16px; }

/* 10. Page bridges ---------------------------------------------------------------- */
/* weather.html */
.weather-section { padding: 22px 0; }
.weather-section-title { color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.forecast-city-name { color: var(--accent-text); }
.forecast-note { margin: 14px 0; color: var(--dim); font-size: var(--fs-sm); }
.forecast-note.has-note { border-left: 4px solid var(--warm-text); padding-left: 10px; color: var(--text); }

/* climatology.html (Seasonal Outlook) */
.outlook-card, .so-card, .so-lean, .climatology-card, .chart-card, .so-panel { border-color: var(--line); }

/* graphics-room.html (its own <style> block was dark-only). The graphics
   themselves are images and look the same in both themes. */
.graphic-card { background: var(--panel); border-color: var(--line); }
.graphic-card:hover { border-color: var(--accent-line); }
.graphic-card-header, .graphic-card-footer { background: var(--raise); }
.graphic-card-title, .no-graphics h3 { color: var(--text); }
.graphic-card-time, .graphic-card-empty .empty-title, .no-graphics { color: var(--dim); }
.graphic-card-type, .graphic-card-empty .empty-text, .refresh-indicator { color: var(--mute); }
.graphic-card-empty { background: var(--raise); border-color: var(--line-strong); }
.badge-just-updated { color: var(--good-text); }
.badge-recent { color: var(--accent-text); }
.badge-stale { color: var(--even-text); }
.lightbox-title { color: #eaeef6; }

/* graphics-room.html empty state spans the grid */
.graphics-grid > .data-empty { grid-column: 1 / -1; }

/* spaceweather.html: a reading NOAA did not send is "--" plus a line saying so */
.sw-updated { margin: -4px 0 14px; }
.sw-card.is-unavailable .sw-value { color: var(--mute); }
.sw-status { margin-top: 6px; font-size: var(--fs-xs); color: var(--mute); }
.sw-chart-container { position: relative; }
.sw-chart-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--mute); font-size: var(--fs-sm);
}

/* forecasts.html: public scorecard (forecasts are logged in the Hub) */
.scorecard { margin-bottom: 22px; }
.scorecard .quiet { margin: 6px 0 16px; max-width: 72ch; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 620px) {
  .scorecard { padding: 18px 16px; }
  .scorecard h2 { font-size: var(--fs-lg); }
  .score-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .score { padding: 12px; }
}
.score { background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.score-label { font: 700 11px/1.2 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.score-value { margin-top: 6px; font: 800 var(--fs-xl)/1.1 var(--font); color: var(--text); }
.score-sub { margin-top: 4px; font-size: var(--fs-xs); color: var(--dim); }
.scorecard-sub { margin: 8px 0 4px; font: 700 var(--fs-md)/1.3 var(--font); color: var(--text); }
.scorecard-table td { white-space: nowrap; }
.scorecard-table .closer { color: var(--good-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

