/* ==========================================================================
   DX — Atlas design layer
   Loaded AFTER css/style.css, BEFORE css/brand.css. Replaces css/fable.css.

   Purely additive: it re-voices the selectors the section JS already renders
   rather than replacing them, so all 17 sections inherit the redesign without
   being touched. Every color comes from a style.css theme token, so all seven
   themes keep working. Remove the <link> to revert to the plain design system.

   1  Added tokens
   2  Ground & stacking
   3  Typography
   4  Topbar
   5  Page masthead
   6  Telemetry strip
   7  Side navigation
   8  Panels & the section spine
   9  Rail layout
   10 Stat cards
   11 Band outlook meters
   12 Segmented control
   13 NOAA scale cards
   14 Beacon display
   15 Chips, tags, pills, buttons, forms
   16 Tables
   17 Maps & charts
   18 Feed
   19 Site footer
   20 Dialogs, palette & toast
   21 Reduced motion
   22 Narrow screens
   23 Accessibility corrections
   ========================================================================== */

/* ---------- 1. Added tokens ---------------------------------------------- */
:root {
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* type scale */
  --fs-display: clamp(30px, 3.4vw, 46px);
  --fs-h2: 18px;
  --fs-h3: 13px;
  --fs-body: 14px;
  --fs-small: 12.5px;
  --fs-micro: 11px;
  --track-micro: .12em;
  --track-wide: .16em;

  /* spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 26px; --sp-7: 34px; --sp-8: 44px;

  /* the hairline that draws the whole layout */
  --hair: 1px solid var(--line);
  --hair-soft: 1px solid var(--line2);

  --rail-w: 344px;
}

/* ---------- 2. Ground & stacking ----------------------------------------- */
/* Flat ground. Both reference designs are quiet surfaces with rules doing the
   dividing, so the old drifting ambient field and film grain are gone. */
html { background: var(--bg); }
body { background: var(--bg); }

/* #content wraps masthead + main + footer so the sidebar stays full height
   and the masthead can sit above the section without being inside #main
   (which App.show() wipes on every route change). */
#content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#main {
  flex: 1;
  padding: 0 var(--sp-6) var(--sp-8);
  max-width: 1560px;
}

/* ---------- 3. Typography ------------------------------------------------ */
/* Serif for anything that names a thing, sans for prose, mono for data.
   That split is what carries the editorial voice. */
body { font-size: var(--fs-body); }

.panel h2,
.call-detail-card h2 {
  font-family: var(--display);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--txt-bright);
  margin: 0;
}

.panel h3 {
  font-family: var(--sans);
  font-size: var(--fs-h3);
  font-weight: 650;
  letter-spacing: .04em;
  /* style.css shouts these in uppercase cyan; the reference designs use a
     quiet sentence-case sub-head, and several sections write real sentences
     here that read badly in caps. */
  text-transform: none;
  color: var(--txt-bright);
  margin: var(--sp-5) 0 var(--sp-2);
}
/* style.css gives h3 a decorative bullet; the spine does that job now. */
.panel h3::before { content: none; }

.panel h4 {
  font: 600 var(--fs-micro) / 1.4 var(--mono);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--dim);
  margin: var(--sp-4) 0 var(--sp-2);
}

.lede {
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--dim);
  max-width: 76ch;
  margin: var(--sp-2) 0 var(--sp-4);
}

.mono { font-variant-numeric: tabular-nums; }


/* ---------- 4. Topbar ---------------------------------------------------- */
/* The clock moves down into the masthead, so the bar carries identity and
   search only. */
#topbar {
  background: var(--bg);
  border-bottom: var(--hair);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#qthChip {
  border: var(--hair);
  border-radius: var(--rad-full);
  background: transparent;
  font-size: var(--fs-small);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
#qthChip:hover { border-color: var(--line-strong); background: var(--tint-subtle); }

.header-search-wrap input {
  background: var(--bg2);
  border: var(--hair);
  border-radius: var(--rad-full);
  font-size: var(--fs-small);
}

/* The topbar glyphs are line icons now, matching the nav, not emoji. */
#navToggle svg,
.top-glyph-btn svg { width: 17px; height: 17px; display: block; }
.header-search-icon svg,
.qth-icon svg { width: 14px; height: 14px; display: block; opacity: .7; }
.cmd-header > span svg { width: 16px; height: 16px; display: block; color: var(--dim); }
#navToggle, .top-glyph-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.header-search-icon, .qth-icon { display: inline-flex; align-items: center; }

/* ---------- 5. Page masthead --------------------------------------------- */
/* Every section gets a kicker, a serif title and a deck, filled by App.show()
   from the SECTIONS map in app.js. It is a sibling of #main, so sections never
   have to render it. */
#pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: var(--sp-6) var(--sp-6) var(--sp-4);
  max-width: 1560px;
  border-bottom: var(--hair);
  margin-bottom: var(--sp-5);
}

.ph-kicker {
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--dim-subtle);
  margin-bottom: var(--sp-3);
}

.ph-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.ph-title {
  font-family: var(--display);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.03em;
  color: var(--txt-bright);
  margin: 0;
}

.ph-deck {
  margin: 0;
  padding-left: var(--sp-5);
  border-left: var(--hair);
  max-width: 38ch;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--dim);
  align-self: center;
}

.ph-meta { text-align: right; flex: none; }
.ph-meta #clock {
  font: 300 clamp(20px, 2.2vw, 28px) / 1 var(--mono);
  letter-spacing: .01em;
  color: var(--txt-bright);
  text-shadow: none;
}
.ph-meta #clockSub {
  margin-top: var(--sp-1);
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--dim-subtle);
}

/* ---------- 6. Telemetry strip ------------------------------------------- */
/* Five primary readings on a hairline rule, each with a sparkline. The four
   secondary ones live behind the disclosure at the end. */
#kpiStrip {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 var(--sp-6);
  background: var(--bg2);
  border-top: var(--hair);
  border-bottom: var(--hair);
  overflow: hidden;
}

.kpi {
  flex: 1 1 0;
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
  border: 0;
  border-right: var(--hair-soft);
  background: transparent;
  transition: background .25s var(--ease);
}
.kpi:first-child { padding-left: 0; }
.kpi:hover { background: var(--tint-subtle); }
.kpi::after { content: none; }

.kpi label {
  display: block;
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--dim-subtle);
  margin-bottom: var(--sp-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
}

.kpi b {
  font: 500 17px / 1 var(--mono);
  color: var(--txt-bright);
  letter-spacing: 0;
  white-space: nowrap;
}
.kpi b.ok   { color: var(--green); }
.kpi b.warn { color: var(--amber); }
.kpi b.bad  { color: var(--red); }
.kpi b.info { color: var(--txt-bright); }

.kpi .kpi-unit {
  font: 400 var(--fs-small) var(--sans);
  color: var(--dim);
  margin-left: 3px;
}

.kpi .trend {
  display: block;
  margin-top: var(--sp-1);
  font: 400 var(--fs-micro) var(--mono);
  color: var(--dim-subtle);
  letter-spacing: .04em;
}

.kpi .spark {
  width: 74px;
  height: 26px;
  flex: none;
  opacity: .9;
}

/* NOAA scales tile keeps its badges rather than a sparkline */
.kpi.scales .scale-badges { gap: var(--sp-1); margin-top: 2px; }
.kpi.scales .scale {
  font: 600 11px var(--mono);
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: var(--rad-sm);
}

/* the secondary-readings disclosure */
#kpiMore {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 0 0 var(--sp-4);
  border: 0;
  border-left: var(--hair-soft);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font: 500 var(--fs-micro) var(--mono);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  transition: color .25s var(--ease);
}
#kpiMore:hover { color: var(--txt-bright); }
#kpiMore svg { width: 11px; height: 11px; transition: transform .25s var(--ease); }
#kpiStrip.more-open #kpiMore svg { transform: rotate(180deg); }

/* secondary tiles: hidden until the disclosure is open */
#kpiStrip .kpi.secondary { display: none; }
#kpiStrip.more-open .kpi.secondary { display: block; }

/* ---------- 7. Side navigation ------------------------------------------- */
#sidenav {
  background: var(--bg);
  border-right: var(--hair);
  padding: var(--sp-5) var(--sp-3);
  gap: 1px;
}

.nav-group {
  font: 500 var(--fs-micro) / 1 var(--mono);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--dim-subtle);
  padding: 0 var(--sp-3) var(--sp-2);
  margin-top: var(--sp-5);
}
.nav-group:first-child { margin-top: 0; }

#sidenav a {
  position: relative;
  border-radius: var(--rad-sm);
  font-size: var(--fs-small);
  font-weight: 500;
  padding: 7px var(--sp-3);
  transition: color .2s var(--ease), background .2s var(--ease);
}

/* an accent rule that grows in, rather than a filled block */
#sidenav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--cyan);
  border-radius: 0 2px 2px 0;
  transform: translateY(-50%);
  transition: height .25s var(--ease);
  box-shadow: none;
}
#sidenav a:hover::before { height: 40%; }
#sidenav a.active::before { height: 72%; }
#sidenav a.active {
  background: var(--tint-subtle);
  color: var(--txt-bright);
  font-weight: 600;
}
#sidenav a.active svg, #sidenav a.active .nav-ico { color: var(--cyan); }

.nav-foot {
  border-top: var(--hair-soft);
  font-size: var(--fs-micro);
  line-height: 1.6;
  color: var(--dim-subtle);
  padding-top: var(--sp-3);
}
.nav-foot b {
  display: block;
  font: 500 var(--fs-micro) var(--mono);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--dim-subtle);
  margin-bottom: var(--sp-1);
}

/* ---------- 8. Panels & the section spine -------------------------------- */
/* Panels are ruled sections, not floating cards: a flat surface, a hairline,
   and a numbered header. The counter is what gives every view its spine. */
#main { counter-reset: panel; }

.panel {
  background: var(--panel);
  border: var(--hair);
  border-radius: var(--rad-lg);
  box-shadow: none;
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-4);
  transition: border-color .25s var(--ease);
}
.panel:hover { transform: none; box-shadow: none; }

.panel:has(h2) { counter-increment: panel; }

/* "01 / The world now" — only on views with a real sequence of panels;
   App.show() sets .spine after the section mounts. */
#main.spine .panel h2::before {
  content: counter(panel, decimal-leading-zero) " / ";
  font-family: var(--mono);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--dim-subtle);
}

/* The header row sections already render as .row gets the rule under it. */
.panel > .row:first-child,
.panel > h2:first-child {
  padding-bottom: var(--sp-3);
  border-bottom: var(--hair-soft);
  margin-bottom: var(--sp-4);
}
.panel > h2:first-child { display: block; }
.panel > h2:first-child + .lede,
.panel > .row:first-child + .lede { margin-top: 0; }

.grid2 { gap: var(--sp-4); }
.grid3 { gap: var(--sp-4); }

/* ---------- 9. Rail layout ----------------------------------------------- */
/* The focal panel plus a narrow column beside it — the move both reference
   designs make, and the reason the fold can carry map, bands and weather. */
.rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  gap: var(--sp-4);
  align-items: start;
  margin-bottom: var(--sp-4);
}
.rail > * { min-width: 0; }

/* Panels in a rail take their natural height. The map canvas is a 2:1
   equirectangular projection that stretches to whatever box it is given, so
   it must never be flexed to fill a taller row — the continents would
   distort. An uneven row bottom is the correct outcome here. */
.rail > .panel { margin-bottom: 0; }
.rail-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.rail-col .panel { margin-bottom: 0; }

@media (max-width: 1180px) {
  .rail { grid-template-columns: 1fr; }
  /* one column: the live dashboard reads map, station, scales, beacons, K index */
  .dash-rail > .rail-col { display: contents; }
  .dash-map { order: 1; } .dash-station { order: 2; } .dash-wx { order: 3; } .dash-beacon { order: 4; } .dash-solar { order: 5; }
}

/* ---------- 10. Stat cards ----------------------------------------------- */
/* Tracked micro-label over a serif numeral. */
.statcards { gap: var(--sp-3); }

.stat {
  background: var(--bg2);
  border: var(--hair-soft);
  border-radius: var(--rad-md);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color .25s var(--ease);
}
.stat:hover { transform: none; box-shadow: none; border-color: var(--line); }

/* Several sections (cw.js especially) use .stat as a generic card container
   with arbitrary markup inside, and style.css styles `.stat label` / `.stat b`
   as descendants — so a radio label deep inside one of those cards came out
   shouted in uppercase with its text block-stacked under the button. Reset
   the descendant case, then style the real pair as direct children; all 276
   genuine stat cards put label and value directly inside .stat.
   Equal specificity, so source order decides: reset first. */
.stat label {
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
  font-weight: inherit;
}
.stat b {
  display: inline;
  font: inherit;
  margin-top: 0;
  color: inherit;
}

.stat > label {
  display: block;
  font: 500 var(--fs-micro) / 1.3 var(--mono);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--dim-subtle);
  margin-bottom: var(--sp-2);
}

.stat > b {
  /* Most stat values are short numerals, but several views put a whole phrase
     here ("US Call Area 1 — New England"), so this has to wrap gracefully at
     a size that still reads as a value rather than as prose. */
  font: 500 16px / 1.35 var(--mono);
  color: var(--txt-bright);
  letter-spacing: 0;
  display: block;
  overflow-wrap: anywhere;
}

/* ---------- 11. Band outlook meters -------------------------------------- */
/* Replaces the band card grid: a label, a track, a verdict. Reads top to
   bottom as a single answer to "what can I work right now". */
.band-outlook {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.band-meter {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 78px;
  align-items: center;
  gap: var(--sp-3);
}

.band-meter .bm-band {
  font: 500 var(--fs-small) var(--mono);
  color: var(--txt);
  white-space: nowrap;
}

.band-meter .bm-track {
  height: 7px;
  border-radius: var(--rad-full);
  background: var(--line2);
  overflow: hidden;
}

.band-meter .bm-fill {
  display: block;
  height: 100%;
  border-radius: var(--rad-full);
  background: var(--dim-subtle);
  transition: width .5s var(--ease), background .3s var(--ease);
}

.band-meter .bm-st {
  font: 500 var(--fs-micro) var(--mono);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  text-align: right;
  color: var(--dim-subtle);
}

.band-meter.open     .bm-fill { background: var(--green); }
.band-meter.open     .bm-st   { color: var(--green); }
.band-meter.marginal .bm-fill { background: var(--amber); }
.band-meter.marginal .bm-st   { color: var(--amber); }
.band-meter.closed   .bm-fill { background: var(--dim-subtle); }
.band-meter.closed   .bm-st   { color: var(--dim-subtle); }

/* ---------- 12. Segmented control ---------------------------------------- */
.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--bg2);
  border: var(--hair);
  border-radius: var(--rad-md);
}

.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  padding: 5px var(--sp-3);
  border-radius: calc(var(--rad-md) - 3px);
  font: 500 var(--fs-small) var(--sans);
  letter-spacing: .01em;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.seg button:hover { color: var(--txt-bright); }
.seg button.active {
  background: var(--panel-elevated);
  color: var(--txt-bright);
  box-shadow: var(--shadow-sm);
}

/* ---------- 13. NOAA scale cards ----------------------------------------- */
.scale-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}

.scale-card {
  text-align: center;
  padding: var(--sp-3) var(--sp-2);
  background: var(--bg2);
  border: var(--hair-soft);
  border-radius: var(--rad-md);
}

.scale-card .sc-lvl {
  display: block;
  font: 600 22px / 1 var(--mono);
  color: var(--txt-bright);
}
.scale-card .sc-name {
  display: block;
  margin-top: var(--sp-2);
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--dim);
}
.scale-card .sc-state {
  display: block;
  margin-top: var(--sp-1);
  font: 500 var(--fs-micro) var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim-subtle);
}
.scale-card[data-lvl="0"] .sc-state { color: var(--green); }
.scale-card:not([data-lvl="0"]) .sc-lvl { color: var(--amber); }
.scale-card:not([data-lvl="0"]) .sc-state { color: var(--amber); }
.scale-card[data-lvl="3"] .sc-lvl,
.scale-card[data-lvl="4"] .sc-lvl,
.scale-card[data-lvl="5"] .sc-lvl { color: var(--red); }
.scale-card[data-lvl="3"] .sc-state,
.scale-card[data-lvl="4"] .sc-state,
.scale-card[data-lvl="5"] .sc-state { color: var(--red); }

/* ---------- 14. Beacon display ------------------------------------------- */
.beacon-now {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
  padding-bottom: var(--sp-4);
  border-bottom: var(--hair-soft);
  margin-bottom: var(--sp-4);
}

.beacon-call {
  font: 600 clamp(26px, 2.8vw, 36px) / 1 var(--mono);
  color: var(--cyan);
  letter-spacing: .01em;
}
.beacon-loc {
  margin-top: var(--sp-1);
  font-size: var(--fs-small);
  color: var(--dim);
}

.beacon-freq {
  font: 400 21px / 1 var(--mono);
  color: var(--txt-bright);
}
.beacon-band {
  margin-top: var(--sp-1);
  font: 400 11px var(--mono);
  letter-spacing: .04em;
  color: var(--dim-subtle);
}

.beacon-next { flex: 1 1 200px; min-width: 160px; }
.beacon-next .bn-label {
  font: 500 var(--fs-micro) var(--mono);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--dim-subtle);
}
.beacon-next .bn-count {
  margin: var(--sp-1) 0 var(--sp-2);
  font: 500 24px / 1 var(--mono);
  color: var(--txt-bright);
}
.beacon-next .bn-track {
  height: 5px;
  border-radius: var(--rad-full);
  background: var(--line2);
  overflow: hidden;
}
.beacon-next .bn-fill {
  display: block;
  height: 100%;
  border-radius: var(--rad-full);
  background: var(--green);
}

/* ---------- 15. Chips, tags, pills, buttons, forms ----------------------- */
.pill {
  border-radius: var(--rad-full);
  font: 500 var(--fs-micro) var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid transparent;
}

.chip {
  border-radius: var(--rad-full);
  font-size: var(--fs-small);
  border: var(--hair);
}

.btn {
  border-radius: var(--rad-full);
  border: 1px solid var(--line-strong);
  font: 500 11px var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: background .25s var(--ease), border-color .25s var(--ease),
              color .25s var(--ease);
}
.btn:hover { transform: none; }
.btn:active { transform: none; }

.tabs { gap: var(--sp-1); border-bottom: var(--hair); }
.tabs button {
  font-size: var(--fs-small);
  font-weight: 500;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  border-bottom-color: var(--cyan);
  background: transparent;
  color: var(--txt-bright);
}

input, select, textarea {
  border-radius: var(--rad-sm);
  border: var(--hair);
  background: var(--bg2);
  font-size: var(--fs-small);
}

/* Every interactive control gets a visible, on-brand focus ring. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: var(--rad-sm);
}

/* Callsign search modes: the chips pick the field, the row carries an optional
   state, and free-text modes drop the callsign input's spaced uppercase. */
.call-modes { margin: 0 0 var(--sp-4); }
.call-lookup-form [hidden],
#callLookupResult [hidden] { display: none !important; }
.call-search-input.call-search-text {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 20px !important;
}
.call-state-select { flex: 0 0 auto; width: 120px; }
.call-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-2);
}
.call-filters .tag { flex: 1 1 260px; }
.call-matches .section-row h3 { margin-top: 0; }
.call-match-table td { vertical-align: middle; }
.call-more { margin: var(--sp-4) auto 0; display: flex; }
.call-back { margin-bottom: var(--sp-3); }
@media (max-width: 680px) {
  .call-state-select { width: 100%; }
}

/* New Hams and Analytics: an SVG state choropleth and SVG column charts.
   Shading is one hue (--cyan) stepped by opacity, so it reads light-to-strong
   on every theme without per-theme ramps. */
.usmap-card { margin: var(--sp-4) 0; }
.usmap-card .section-row h3 { margin-top: 0; }
.metric-toggle { margin: 0; }
.usmap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--sp-5);
  align-items: start;
}
.usmap { position: relative; min-width: 0; }
.usmap svg { display: block; width: 100%; height: auto; }
.us-states path,
.us-callouts rect {
  stroke: var(--bg2);
  stroke-width: 0.8;
  transition: fill-opacity 0.2s ease;
  cursor: default;
}
.us-states path.hot,
.us-callouts rect.hot { stroke: var(--txt-bright); stroke-width: 1.6; }
.us-borders { fill: none; stroke: var(--bg2); stroke-width: 1; pointer-events: none; }
.us-labels text,
.us-callouts text {
  font: 600 12px var(--mono);
  fill: var(--txt-bright);
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: var(--bg2);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}
.us-labels text.sm { font-size: 9.5px; }
.us-callouts line { stroke: var(--line-strong); stroke-width: 0.8; }
.usmap-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-2);
  font-size: 11px;
}
.usmap-legend, .usmap-extras { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-2); }
.usmap-legend i { width: 22px; height: 10px; border-radius: 2px; background: var(--cyan); }
.usmap-legend i:first-of-type { margin-left: var(--sp-1); }
.usmap-legend span:last-child { margin-left: var(--sp-1); }
.usmap-tile {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 4px;
  border: 1px solid var(--line);
  border-radius: var(--rad-sm);
  font: 600 11px var(--mono);
  color: var(--txt);
}
.usmap-tile i { width: 12px; height: 12px; border-radius: 2px; }
.usmap-tip b, .cc-tip b { display: block; margin-bottom: 3px; }
.usmap-card .state-ranking { background: none; border: 0; padding: 0; }
.usmap-card .state-ranking h3 { margin-top: 0; }

.colchart { position: relative; height: 220px; }
.colchart-tall { height: 280px; }
.colchart svg { display: block; overflow: visible; }
.cc-grid line { stroke: var(--line2); stroke-width: 1; }
.cc-grid line.zero { stroke: var(--line-strong); }
.cc-grid text, .cc-x text { font: 10.5px var(--mono); fill: var(--dim); }
.cc-grid text { text-anchor: end; dominant-baseline: central; }
.cc-x text { text-anchor: middle; }
.cc-clip text { font: 600 10px var(--mono); fill: var(--txt-bright); text-anchor: middle; paint-order: stroke; stroke: var(--bg2); stroke-width: 3px; }
.cc-hit rect { fill: transparent; }
.cc-hit rect.on { fill: var(--tint-hover); }
.cc-tip { min-width: 0; white-space: nowrap; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-2); font-size: 12px; color: var(--txt); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 2px; }
.chart-note { margin: var(--sp-2) 0 0; font-size: 12px; }
.new-hams-intro .filter-chips { margin-top: var(--sp-2); }
.format-bars > div { grid-template-columns: 130px 1fr 52px; }
.analytics-totals { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.analytics-grid { margin-top: var(--sp-4); }

@media (max-width: 1100px) {
  .usmap-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .colchart-tall { height: 240px; }
  .format-bars > div { grid-template-columns: 110px 1fr 48px; }
  .analytics-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Account menu, Google sign-in and Settings. */
.top-glyph-btn.signed-in { padding: 0; }
.account-initials {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--bg);
  font: 700 11px var(--sans);
  letter-spacing: 0.02em;
}
.account-dropdown { min-width: 250px; }
.account-who { display: flex; flex-direction: column; gap: 4px; padding: 4px 12px 10px; }
.account-who b { color: var(--txt-bright); font-size: 13px; }
.account-who .mono { font-size: 11px; overflow-wrap: anywhere; }
.account-who .pill { align-self: flex-start; margin-top: 2px; }
.account-link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--txt);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.account-note { margin: 0 12px 10px; font-size: 12px; line-height: 1.45; }
.account-dropdown .google-signin { margin: 0 12px 12px; width: calc(100% - 24px); }
.google-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: var(--sp-3);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}
.google-signin svg { flex: 0 0 auto; background: #fff; border-radius: 50%; padding: 2px; box-sizing: content-box; }
.call-signin { margin-top: var(--sp-4); }
.settings-panel + .settings-panel { margin-top: var(--sp-5); }
.settings-panel .lede { max-width: 720px; }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }
.settings-row > label:first-child { flex: 0 0 100%; color: var(--txt-bright); font-weight: 650; }
.settings-row select { min-width: 240px; }
.settings-add input[type="email"] { flex: 1 1 260px; max-width: 420px; }
.settings-actions { text-align: right; white-space: nowrap; }
.settings-actions .btn + .btn { margin-left: var(--sp-2); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
@media (max-width: 680px) {
  .settings-row select, .settings-add input[type="email"] { flex: 1 1 100%; max-width: none; min-width: 0; }
  .settings-actions { white-space: normal; }
}

/* ---------- Home: the landing guide ---------------------------------------
   The masthead is hidden here; the hero carries the page title. Every color is
   a theme token, so the globe and the illustrations follow all seven themes. */
body.view-home #pagehead { display: none; }
body.view-home #main { padding-top: var(--sp-5); }
.home-h2 { font-family: var(--display); font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.02em; color: var(--txt-bright); margin: 0; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: center;
  padding: var(--sp-4) 0 var(--sp-6);
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--cyan);
}
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: heroDot 2.4s ease-out infinite; }
@keyframes heroDot { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.hero-title {
  margin: var(--sp-4) 0 0;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(38px, 4.6vw, 68px); line-height: 1; letter-spacing: -.035em;
  color: var(--txt-bright);
}
.hero-title em { font-style: normal; color: var(--dim-subtle); }
.hero-deck { margin: var(--sp-4) 0 0; max-width: 560px; font-size: 15px; line-height: 1.6; color: var(--dim); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }
.hero-now {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--sp-6); border-top: var(--hair); border-bottom: var(--hair);
}
.now-cell { padding: var(--sp-3) var(--sp-3) var(--sp-3) 0; }
.now-cell + .now-cell { padding-left: var(--sp-3); border-left: var(--hair-soft); }
.now-cell label { display: block; font: 500 var(--fs-micro) / 1 var(--mono); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--dim-subtle); }
.now-cell b { display: block; margin-top: 6px; font: 500 22px / 1 var(--mono); color: var(--txt-bright); }
.now-cell span { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--dim); }
.now-cell span:not(:empty)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; background: var(--green); }
.now-cell[data-tone="warn"] span::before { background: var(--amber); }
.now-cell[data-tone="bad"] span::before { background: var(--red); }

.hero-globe { margin: 0; position: relative; }
.hero-globe svg { display: block; width: 100%; max-width: 560px; margin: 0 auto; overflow: visible; cursor: grab; touch-action: none; user-select: none; }
.hero-globe svg.dragging { cursor: grabbing; }
.hero-globe figcaption { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: var(--sp-2); text-align: center; }
.globe-note { font-size: 12px; }
.globe-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px var(--sp-4); font-size: 11.5px; color: var(--txt); }
.globe-legend span { display: inline-flex; align-items: center; gap: 6px; }
.globe-legend i { width: 18px; height: 3px; border-radius: 2px; }
.lg-open { background: var(--green); } .lg-marginal { background: var(--amber); }
.lg-closed { background: repeating-linear-gradient(90deg, var(--dim) 0 3px, transparent 3px 6px); }
.lg-grayline { background: var(--amber); opacity: .55; height: 6px !important; filter: blur(1px); }

.g-ocean-hi { stop-color: color-mix(in srgb, var(--cyan) 12%, var(--bg2)); }
.g-ocean-lo { stop-color: var(--bg2); }
.g-halo-0 { stop-color: var(--cyan); stop-opacity: 0; }
.g-halo-1 { stop-color: var(--cyan); stop-opacity: .14; }
.g-graticule { fill: none; stroke: var(--line2); stroke-width: .6; }
.g-land { fill: color-mix(in srgb, var(--txt) 15%, var(--bg2)); stroke: color-mix(in srgb, var(--txt) 28%, var(--bg2)); stroke-width: .5; }
.g-night path { fill: #000; fill-opacity: .15; pointer-events: none; }
.g-grayline { fill: none; stroke: var(--amber); stroke-width: 1.3; stroke-dasharray: 2 4; stroke-linecap: round; opacity: .9; }
.g-grayline-glow { fill: none; stroke: var(--amber); stroke-width: 9; opacity: .22; }
.g-rim { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.g-path { fill: none; stroke-width: 1.7; stroke-linecap: round; }
.g-path.g-open { stroke: var(--green); stroke-dasharray: 7 5; animation: gFlow 1.4s linear infinite; }
.g-path.g-marginal { stroke: var(--amber); stroke-dasharray: 7 5; animation: gFlow 2.2s linear infinite; }
.g-path.g-closed { stroke: var(--dim); stroke-dasharray: 2 5; opacity: .45; }
@keyframes gFlow { to { stroke-dashoffset: -24; } }
.g-packet.g-open { fill: var(--green); } .g-packet.g-marginal { fill: var(--amber); }
.g-packet { filter: drop-shadow(0 0 4px currentColor); }
.g-target circle { stroke: var(--bg2); stroke-width: 2; }
.g-target.g-open circle { fill: var(--green); } .g-target.g-marginal circle { fill: var(--amber); } .g-target.g-closed circle { fill: var(--dim); }
.g-target text { font: 600 11px var(--mono); fill: var(--txt-bright); paint-order: stroke; stroke: var(--bg2); stroke-width: 3px; stroke-linejoin: round; }
.g-qth-dot { fill: var(--cyan); stroke: var(--bg2); stroke-width: 2; }
.g-qth-ring { fill: none; stroke: var(--cyan); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: gRing 2.6s ease-out infinite; }
@keyframes gRing { from { transform: scale(.35); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

.home-bands { margin-top: var(--sp-3); padding: var(--sp-5); background: var(--bg2); border: var(--hair); border-radius: var(--rad-lg); }
.home-bands-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--sp-2) var(--sp-4); }
.band-meters { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--sp-3); margin-top: var(--sp-5); }
.band-meter-col { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.bm-track { position: relative; width: 100%; max-width: 54px; height: 96px; border-radius: 6px; background: var(--line2); overflow: hidden; }
.bm-track i {
  position: absolute; inset: 0; border-radius: 6px; background: var(--line-strong);
  transform-origin: bottom; transform: scaleY(var(--fill, 0)); transition: transform 1s cubic-bezier(.2, .8, .2, 1);
}
.band-meter-col[data-state="open"] i { background: linear-gradient(0deg, color-mix(in srgb, var(--green) 55%, transparent), var(--green)); }
.band-meter-col[data-state="marginal"] i { background: linear-gradient(0deg, color-mix(in srgb, var(--amber) 55%, transparent), var(--amber)); }
.band-meter-col b { font-size: 12px; color: var(--txt-bright); }
.band-meter-col span { font-size: 10.5px; }
.region-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-5); }
.region { display: grid; grid-template-columns: 10px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: var(--sp-2) 0; border-top: var(--hair-soft); }
.region i { grid-row: span 2; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.region[data-state="open"] i { background: var(--green); } .region[data-state="marginal"] i { background: var(--amber); }
.region b { font-size: 12.5px; color: var(--txt-bright); font-weight: 600; }
.region span { grid-column: 2; font-size: 11px; }
.region em { grid-row: 1 / span 2; grid-column: 3; font-style: normal; font-size: 11.5px; color: var(--txt); }

.home-pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-6); }
.pillar { --accent: var(--cyan); display: flex; flex-direction: column; padding: 0 0 var(--sp-3); background: var(--bg2); border: var(--hair); border-radius: var(--rad-lg); overflow: hidden; }
.pillar-explore { --accent: var(--amber); }
.pillar-tools { --accent: var(--purple); }
.pillar-art { height: 128px; border-bottom: var(--hair-soft); background: radial-gradient(120% 90% at 50% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); }
.pillar-art svg { display: block; width: 100%; height: 100%; }
.pillar-head { display: flex; align-items: baseline; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5) 0; }
.pillar-num { font-size: 11px; color: var(--accent); letter-spacing: var(--track-micro); }
.pillar-line { margin: var(--sp-2) var(--sp-5) var(--sp-3); font-size: 12.5px; color: var(--dim); line-height: 1.5; }
.pillar-list { list-style: none; margin: 0; padding: 0 var(--sp-2); }
.pillar-list a {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-3); border-radius: var(--rad-md); color: inherit; text-decoration: none;
  transition: background .15s ease;
}
.pillar-list a:hover, .pillar-list a:focus-visible { background: var(--tint-hover); }
.pillar-list a > svg { width: 18px; height: 18px; color: var(--accent); }
.pl-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-text b { font-size: 13px; color: var(--txt-bright); font-weight: 600; }
.pl-text small { font-size: 11.5px; color: var(--dim); line-height: 1.4; }
.pl-live { font-style: normal; font-size: 10.5px; color: var(--accent); white-space: nowrap; }

.art-grid path { stroke: var(--line2); stroke-width: 1; fill: none; }
.art-ripples circle { fill: none; stroke: var(--accent); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; opacity: 0;
  animation: artRipple 3.6s ease-out infinite; animation-delay: calc(var(--i) * .9s); }
@keyframes artRipple { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(4.6); opacity: 0; } }
.art-tower { fill: none; stroke: var(--txt); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.art-tip { fill: var(--accent); animation: artBlink 1.8s ease-in-out infinite; }
@keyframes artBlink { 50% { opacity: .3; } }
.art-orbit ellipse { fill: none; stroke: var(--line-strong); stroke-dasharray: 3 5; }
.art-earth { fill: var(--cyan); offset-path: path("M212 60a92 30 0 1 1 -184 0a92 30 0 1 1 184 0"); offset-rotate: 0deg; animation: artOrbit 14s linear infinite; }
.art-earth { cx: 0; cy: 0; }
@keyframes artOrbit { to { offset-distance: 100%; } }
.art-sun { fill: var(--accent); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 70%, transparent)); }
.art-rays { transform-box: view-box; transform-origin: 120px 60px; animation: artSpin 40s linear infinite; }
.art-rays path { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; opacity: .7; }
@keyframes artSpin { to { transform: rotate(360deg); } }
.art-flare { fill: #fff; opacity: 0; animation: artFlare 6s ease-in-out infinite; }
@keyframes artFlare { 0%, 70%, 100% { opacity: 0; } 78% { opacity: .9; } }
.art-trace { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 70%, transparent)); animation: artScroll 5s linear infinite; }
@keyframes artScroll { to { transform: translateX(var(--loop)); } }
.art-bezel { fill: none; stroke: var(--line-strong); }

.home-journeys { margin-top: var(--sp-6); }
.journey-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-4); }
.journey { padding: var(--sp-4) var(--sp-5); background: var(--bg2); border: var(--hair); border-radius: var(--rad-lg); }
.journey h3 { margin: 0; font-size: 14px; color: var(--txt-bright); }
.journey p { margin: 4px 0 var(--sp-3); font-size: 12px; }
.journey-steps { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.journey-steps li { display: flex; align-items: center; gap: var(--sp-2); }
.journey-steps a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px;
  border: var(--hair); border-radius: var(--rad-full); background: var(--bg); color: var(--txt); text-decoration: none; font-size: 12.5px;
  transition: border-color .15s ease, color .15s ease;
}
.journey-steps a:hover { border-color: var(--cyan); color: var(--txt-bright); }
.journey-steps a > svg { width: 15px; height: 15px; color: var(--cyan); }
.js-n { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--tint-active); color: var(--cyan); font-size: 10.5px; }
.js-link { width: 34px; height: 12px; flex: 0 0 auto; }
.js-link path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.js-link path:first-child { stroke-dasharray: 3 3; animation: gFlow 1.2s linear infinite; }

@media (max-width: 1180px) {
  .home-hero { grid-template-columns: 1fr; }
  .hero-globe svg { max-width: 480px; }
  .region-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .home-pillars { grid-template-columns: 1fr; }
  .journey-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .hero-now { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .now-cell:nth-child(3) { padding-left: 0; border-left: 0; }
  .now-cell:nth-child(n+3) { border-top: var(--hair-soft); }
  .band-meters { gap: 6px; }
  .bm-track { height: 72px; }
  .band-meter-col span { display: none; }
  .region-list { grid-template-columns: 1fr; }
  .home-bands { padding: var(--sp-4); }
  .js-link { width: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-dot, .g-path, .g-qth-ring, .art-ripples circle, .art-tip, .art-earth, .art-rays, .art-flare, .art-trace, .js-link path { animation: none !important; }
  .art-ripples circle { opacity: .5; transform: scale(2); }
  .bm-track i { transition: none; }
}

/* Desktop menu button: fold the nav to an icon rail. */
@media (min-width: 921px) {
  html.nav-rail #sidenav { width: 64px; flex-basis: 64px; padding-left: 8px; padding-right: 8px; }
  html.nav-rail #sidenav a { justify-content: center; padding-left: 0; padding-right: 0; }
  html.nav-rail #sidenav a span { display: none; }
  html.nav-rail #sidenav .nav-group { font-size: 0; height: 1px; padding: 0; margin: var(--sp-4) 10px var(--sp-3); background: var(--line); }
  html.nav-rail #sidenav .nav-foot { display: none; }
}

/* ---------- 16. Tables --------------------------------------------------- */
table { font-variant-numeric: tabular-nums; }

table.dt th {
  font: 600 var(--fs-micro) var(--mono) !important;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--dim-subtle);
  background: var(--bg2);
  border-bottom: var(--hair);
}

table.dt td {
  font-size: var(--fs-small);
  border-bottom: var(--hair-soft);
}

tbody tr { transition: background .2s var(--ease); }
tbody tr:hover { background: var(--tint-subtle); }

.tablewrap {
  border: var(--hair);
  border-radius: var(--rad-md);
  overflow: auto;
}

/* ---------- 17. Maps & charts -------------------------------------------- */
.map-container,
.chart-container {
  border: var(--hair);
  border-radius: var(--rad-md);
  overflow: hidden;
  box-shadow: none;
}

.map-ctrl-btn {
  border-radius: var(--rad-sm);
  border: var(--hair);
  background: var(--panel-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .25s var(--ease), border-color .25s var(--ease);
}

.map-legend {
  font: 400 var(--fs-micro) var(--mono);
  letter-spacing: .04em;
}

/* ---------- 18. Feed ----------------------------------------------------- */
.feed .item {
  border-bottom: var(--hair-soft);
  padding: var(--sp-3) 0;
}
.feed .item .hdr { margin-bottom: var(--sp-2); }
.feed .item time {
  font: 400 var(--fs-micro) var(--mono);
  color: var(--dim-subtle);
  letter-spacing: .04em;
}

/* ---------- 19. Site footer ---------------------------------------------- */
#sitefoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  max-width: 1560px;
  margin: 0;
  padding: var(--sp-4) var(--sp-6) var(--sp-6);
  border-top: var(--hair);
  font-size: var(--fs-small);
  color: var(--dim-subtle);
}
#sitefoot .sf-left { display: flex; align-items: center; gap: var(--sp-2); }
#sitefoot a { color: var(--dim); }
#sitefoot a:hover { color: var(--txt-bright); }
#sitefoot .sf-note {
  font: 400 var(--fs-micro) var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- 20. Dialogs, palette & toast --------------------------------- */
/* These sit on top of every view, so they carry the same voice: a serif
   title, hairline edges, and a toast that states rather than shouts. */
dialog {
  border: var(--hair);
  border-radius: var(--rad-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-lg);
}
dialog h3 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--txt-bright);
  margin: 0 0 var(--sp-2);
}
dialog p.dim {
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--dim);
  margin: 0 0 var(--sp-4);
}
dialog label { font-size: var(--fs-small); color: var(--dim); }
dialog::backdrop {
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#cmdDialog { padding: 0; max-width: 620px; }
.cmd-header {
  background: var(--bg2);
  border-bottom: var(--hair);
  padding: var(--sp-3) var(--sp-4);
}
.cmd-header input { font-size: 14px; }
.cmd-item {
  font-size: var(--fs-small);
  border-radius: var(--rad-sm);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.cmd-item:hover, .cmd-item.selected {
  background: var(--tint-subtle);
  color: var(--txt-bright);
}
.cmd-item kbd {
  font: 400 var(--fs-micro) var(--mono);
  border: var(--hair);
  background: var(--bg2);
  color: var(--dim-subtle);
}

#toast {
  background: var(--panel-elevated);
  border: var(--hair);
  border-left: 2px solid var(--cyan);
  border-radius: var(--rad-sm);
  font: 500 var(--fs-small) var(--sans);
  padding: var(--sp-3) var(--sp-5);
  box-shadow: var(--shadow-md);
}

.glyph-dropdown {
  border: var(--hair);
  border-radius: var(--rad-md);
  box-shadow: var(--shadow-lg);
}
.glyph-dropdown-header {
  font: 500 var(--fs-micro) var(--mono);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--dim-subtle);
}
.theme-opt { font-size: var(--fs-small); border-radius: var(--rad-sm); }

/* ---------- 21. Reduced motion ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .panel, .stat, .btn, .chip, .tag, .pill, .kpi, .seg button,
  #sidenav a, #sidenav a::before, #qthChip, tbody tr,
  .band-meter .bm-fill, .map-ctrl-btn { transition: none !important; }
  .panel:hover, .stat:hover, .btn:hover { transform: none; }
}

/* ---------- 22. Narrow screens ------------------------------------------- */
@media (max-width: 920px) {
  #pagehead {
    padding: var(--sp-5) var(--sp-4) var(--sp-3);
    margin-bottom: var(--sp-4);
    align-items: flex-start;
    flex-direction: column;
    gap: var(--sp-3);
  }
  .ph-meta { text-align: left; }
  .ph-deck {
    padding-left: 0;
    border-left: 0;
    max-width: none;
  }
  #main { padding: 0 var(--sp-4) var(--sp-7); }
  #sitefoot { padding: var(--sp-4); }

  #kpiStrip {
    padding: 0 var(--sp-4);
    overflow-x: auto;
    /* style.css makes this a mandatory snap carousel, which snaps the first
       tile past the strip's own left padding and clips it. The strip is a
       continuous ruled row now, not a card carousel — free scrolling. */
    scroll-snap-type: none;
  }
  .kpi { flex: 0 0 168px; scroll-snap-align: none; }
  .kpi .spark { width: 52px; }
  #kpiMore { flex: 0 0 auto; padding-right: var(--sp-2); }
}

@media (max-width: 780px) {
  .panel { padding: var(--sp-4); border-radius: var(--rad-md); }
  .beacon-now { gap: var(--sp-4); }
}

@media (max-width: 640px) {
  /* The topbar ran ~60px past the viewport on a phone, giving the whole page
     a horizontal scrollbar (pre-dates this layer). The flex children had no
     min-width:0, so the search box refused to shrink, and a keyboard-shortcut
     button is meaningless on a touch device in the first place. */
  #topbar { padding: 0 8px; gap: 8px; }
  /* only the search box may shrink; letting .top-actions shrink just makes
     its own buttons overflow it instead. */
  #topbar > * { min-width: 0; }
  /* the 30px chrome mark and its wordmark are wider than the old lockup, so the
     toggle is pinned and the brand gap trimmed to keep the row intact. */
  #navToggle { flex: none; }
  #brand { gap: 8px; }
  .top-actions { flex: none; }
  #helpBtn { display: none; }
  .header-search-wrap { flex: 1 1 auto; min-width: 0; }
  #headerSearchInput { width: 100%; min-width: 0; }
  #headerSearchInput:focus { width: 100%; }
  #qthChip { flex: 0 1 auto; overflow: hidden; }
  #qthGrid { overflow: hidden; text-overflow: ellipsis; }

  .ph-title { font-size: clamp(26px, 8vw, 34px); }
  .band-meter { grid-template-columns: 52px minmax(0, 1fr) 70px; }
  .scale-cards { gap: var(--sp-1); }
  .beacon-now { gap: var(--sp-3); }
  #sitefoot { font-size: var(--fs-micro); }
}

/* ---------- 23. Accessibility ------------------------------------------- */
/* Text and semantic colors come from the brand tokens in style.css, which
   clear AA at 12px on every surface of both grounds. */
.kpi label { overflow-wrap: anywhere; }
.kpi { min-width: 0; }
