/* ══════════════════════════════════════════════════════════════════════════
   static/_tokens.css — Alexander Atlas shared design tokens
   ══════════════════════════════════════════════════════════════════════════

   PURELY ADDITIVE. This file deliberately declares NO light-mode values.

   Every page still carries its own inline :root block, and those blocks have
   drifted: 14 of the 66 token names hold different values on different pages
   (--mute is #b8b2a4 on the map and #6b6558 on landing; reset/signup run a
   separate warmer palette entirely). Publishing one canonical light value per
   name would visibly change seven pages, so this file does not try.

   Instead the dark theme is declared on `html[data-theme="dark"]`, which has
   specificity (0,1,1) and therefore beats each page's `:root` (0,1,0)
   regardless of source order. Light mode is untouched — remove the attribute
   and every page renders exactly as it does today.

   Contrast figures are measured against the plate ground #12100c and the card
   ground #191611. Anything carrying body text clears 4.5:1.

   Activation:  <html data-theme="dark">   ·  removal reverts completely.
   ══════════════════════════════════════════════════════════════════════════ */

html[data-theme="dark"] {

  /* ── Surfaces ─────────────────────────────────────────────────────────── */
  --paper:        #12100c;   /* the plate ground                            */
  --paper2:       #1a160f;
  --bg:           #12100c;
  --cream:        #12100c;
  --white:        #191611;   /* "white" now means the raised card surface   */
  --card:         #191611;
  --paper-rgb:    18,16,12;
  /* Floating plates over the map — the cartouche, legend, layer box and
     zoom control. In light these are rgba(ink,.94): a near-opaque DARK
     plate on cream. --ink-rgb cannot serve here in dark, because its other
     job is a .03-.25 wash that must go light. Separate token, stays dark. */
  --plate-rgb:    26,22,15;
  --plate:        #1a160f;   /* solid form, for background:var(--ink) rules */
  --tint:         #2a2418;   /* warm selected/active fill (was #e9e2cd) */
  --surface-alt:  #191611;   /* a light surface with no existing token counterpart */
  --text-dim:     #a9a293;   /* body grey where the page's own --gray differs, so a
                                fallback against --gray would move light mode */
  --text-strong:  #ece7dc;   /* same, for near-black body text */
  --on-gold:      #12100c;   /* text ON a gold fill. Deliberately NOT --fg-elite:
                                that name already exists in RenoVision_Demo's own
                                :root, so a fallback against it never fires in light. */

  /* ── Ink ──────────────────────────────────────────────────────────────── */
  --ink:          #ece7dc;   /* 15.41:1 — mirrors light mode's 17.50:1      */
  --dark:         #ece7dc;
  --ink2:         #cdc6b8;
  --ink-rgb:      236,231,220;
  --mute:         #a9a293;   /* 7.49:1                                      */
  --muted:        #a9a293;
  --gray:         #a9a293;   /* 7.49:1                                      */
  --gray-rgb:     169,162,147;
  --faint:        #8b8376;   /* 5.03:1 — clears AA, so a form hint is safe   */

  /* ── Rules ────────────────────────────────────────────────────────────── */
  --line:         #2e2920;
  --border:       #2e2920;
  --line-strong:  #413a2d;

  /* ── Gold ─────────────────────────────────────────────────────────────── *
   * The brand gold #8a6d1d falls to 3.88:1 on this ground and can no longer
   * carry text. The light theme's ACCENT gold is promoted to primary; the old
   * brand gold survives only as an ornament weight.                        */
  --gold:         #d8b654;   /* 9.72:1  (was #8a6d1d)                       */
  --gold-lt:      #e3c877;   /* 11.58:1                                     */
  --gold2:        #e3c877;
  --gold-mid:     #c9a44a;
  --gold-rgb:     216,182,84;
  --gold2-rgb:    227,200,119;

  /* ── Choropleth ramp ──────────────────────────────────────────────────── *
   * Re-derived, not inverted: #6b2033 measured 1.70:1 and #174f4a 2.04:1 on
   * this ground — both ends of the ranking vanished. Hues held, lightness
   * lifted. Validator: CVD ΔE 14.9 deutan, normal-vision 16.5, all 5 ≥ 3:1. */
  --ramp0:        #c04d63;
  --ramp1:        #e08540;
  --ramp2:        #ebcd76;
  --ramp3:        #3d9a7a;
  --ramp4:        #7fdcb6;
  --nodata:       #4a453b;

  /* ── Score bands ──────────────────────────────────────────────────────── */
  --band-caution:   #e2707a;
  --band-spec:      #e08540;
  --band-mod:       #ebcd76;
  --band-modstrong: #4fae8c;
  --band-strong:    #7fdcb6;
  --band-elite:     #d8b654;

  /* Badge text ON a band. Every dark band is a light tone, so the text that
     sits on it is the plate ground rather than cream. */
  --fg-caution:     #12100c;
  --fg-spec:        #12100c;
  --fg-mod:         #12100c;
  --fg-modstrong:   #12100c;
  --fg-strong:      #12100c;
  --fg-elite:       #12100c;

  /* Band-coloured text ON the plate — in light mode these were darkened
     because a band light enough to need dark text is too light to BE text.
     On dark the relationship reverses and the band colour itself is legible. */
  --txt-caution:    #e2707a;
  --txt-spec:       #e08540;
  --txt-mod:        #ebcd76;
  --txt-modstrong:  #4fae8c;
  --txt-strong:     #7fdcb6;
  --txt-elite:      #d8b654;

  /* ── Market balance scale ─────────────────────────────────────────────── */
  --bal-sell2:    #c04d63;
  --bal-sell:     #e08540;
  --bal-bal:      #ebcd76;
  --bal-buy:      #3d9a7a;
  --bal-buy2:     #7fdcb6;

  /* ── Accents ──────────────────────────────────────────────────────────── */
  --forest:       #4fae8c;
  --forest2:      #7fdcb6;
  --green:        #5cc79e;
  --green-t:      #5cc79e;
  --olive:        #a8c46a;
  --amber:        #e0a84a;
  --burnt:        #e08540;
  --brick:        #e2707a;
  --brick2:       #eb8f97;
  --red:          #e2707a;
  --slate:        #7ba3d0;
  --slate-rgb:    123,163,208;
}

/* ── Colourblind-safe palette, on the dark ground ────────────────────────── *
 * The live CB ramp is cream-calibrated: #002466 measures 1.31:1 and #294978
 * 2.10:1 here — the bottom two bands of the ranking are simply not present.
 * This holds the blue→yellow structure that makes it CVD-safe and lifts the
 * floor clear of the plate. Against the LIVE CB ramp: separation ΔE 12.7 vs
 * 11.2, normal-vision 13.4 vs 12.0, and all five stops clear contrast where
 * two failed. Better than what ships today on every check.
 * Specificity (0,2,1) so it beats the dark block above.                     */
html[data-theme="dark"] body.cb-mode {
  --band-caution:#2f66b4; --band-spec:#6ba4e2; --band-mod:#8f8a80;
  --band-modstrong:#e5c266; --band-strong:#fff2ab; --band-elite:#fff8cf;
  --fg-caution:#f2f6fc; --fg-spec:#0b0f16; --fg-mod:#0b0906;
  --fg-modstrong:#0b0906; --fg-strong:#0b0906; --fg-elite:#0b0906;
  --txt-caution:#5b90d8; --txt-spec:#6ba4e2; --txt-mod:#a8a296;
  --txt-modstrong:#e5c266; --txt-strong:#fff2ab; --txt-elite:#fff8cf;
  --ramp0:#2f66b4; --ramp1:#6ba4e2; --ramp2:#8f8a80;
  --ramp3:#e5c266; --ramp4:#fff2ab;
  --bal-sell2:#2f66b4; --bal-sell:#6ba4e2; --bal-bal:#8f8a80;
  --bal-buy:#e5c266; --bal-buy2:#fff2ab;
}

/* ── Native form controls ────────────────────────────────────────────────── *
 * Without this, date pickers, selects and scrollbars keep rendering as light
 * widgets on a dark page — the single most common dark-mode tell.          */
html[data-theme="dark"] { color-scheme: dark; }

/* ── Surveyor bearing labels ─────────────────────────────────────────────── *
 * The traverse and closure figures on the landing page draw their bearing
 * calls ("N88°E 24.9 ch") with a HALO: a fat stroke painted behind the glyph
 * via paint-order, so a call stays readable where it crosses a survey line.
 *
 * Two things go wrong on the plate.
 *
 * 1. The halo is hardcoded #fff / #faf8f2 / #111318 — it was the paper colour,
 *    which made it invisible. On a dark ground a cream halo is the brightest
 *    thing on screen, and at 8px type it is most of what you see. A halo must
 *    always be the SURFACE, never a colour: it is a knockout, not an object.
 *
 * 2. The stroke is 3–3.4px on 8–8.5px type. RenoVision_Demo's POI labels
 *    settled on 2.2px for 10px serif, with the note that 3px "clogs the
 *    counters ... and the labels read as outlined bubble text". These are
 *    smaller type carrying a heavier stroke, so they clog worse.
 *
 * CSS rather than editing the three JS call sites, because CSS overrides SVG
 * presentation attributes — the same reasoning already recorded above the
 * #poi-layer rule in RenoVision_Demo.html. Scoped to dark, so light is
 * untouched by construction.                                               */
html[data-theme="dark"] #trv text,
html[data-theme="dark"] #clo text,
html[data-theme="dark"] #fclose text {
  stroke: var(--paper);
  stroke-width: 2.2px;
  fill: var(--gold);
  opacity: .92;
}

/* ══════════════════════════════════════════════════════════════════════════
   Dark plate · round 2 — market_profile's component layer
   ══════════════════════════════════════════════════════════════════════════

   C4's patcher tokenised nine of the ten pages. market_profile kept 87 bare
   light literals in its <style> block, which is why every chip, pill, tag,
   bar track and prose block on that page still paints the cream design on the
   plate. Three separate failures show up in the live screenshots:

     · light PILLS  — a cream or pastel fill that was a quiet tint on paper is
                      the loudest object on the page here (.pchip, .cchip,
                      .yrtag, .anch, .anchor-line, .note, .town.seat, .tt,
                      .ls-*, .fund.partial)
     · light TRACKS — an unfilled bar (#f4efe3) reads as a filled one
                      (.ind-bg, .comp-bg, .lad-bg, .lstrk, .skel)
     · dark PROSE   — #2a2d35 / #23262e body copy on a #12100c ground. The
                      bolds carry var(--ink) and lifted; the sentences around
                      them did not, which is why only the numbers were legible
                      (.narr, .invsum, .clim-desc, .transit-line)

   Every rule here is prefixed html[data-theme="dark"], so it is (0,n+1) against
   the page's own (0,n) and wins on specificity without touching source order —
   and light mode cannot move, by construction.

   The chip idiom for dark is a low-alpha wash of the chip's own hue over the
   card, a stronger rule of the same hue, and the hue itself lifted to a
   legible tone as text. Tokens rather than literals so the chip families stay
   in step.
   ══════════════════════════════════════════════════════════════════════════ */

html[data-theme="dark"] {
  /* chip washes — the fill and rule for a tinted chip on the card ground */
  --chip-gold-bg:   rgba(216,182,84,.13);
  --chip-gold-br:   rgba(216,182,84,.32);
  --chip-good-bg:   rgba(127,220,182,.11);
  --chip-good-br:   rgba(127,220,182,.30);
  --chip-bad-bg:    rgba(226,112,122,.12);
  --chip-bad-br:    rgba(226,112,122,.30);
  --chip-warn-bg:   rgba(224,133,64,.13);
  --chip-warn-br:   rgba(224,133,64,.32);
  --chip-slate-bg:  rgba(123,163,208,.12);
  --chip-slate-br:  rgba(123,163,208,.32);
  --chip-slate-fg:  #9fc0e4;
  --chip-plum-bg:   rgba(168,132,196,.13);
  --chip-plum-br:   rgba(168,132,196,.32);
  --chip-plum-fg:   #c4a3d8;
  --chip-leaf-bg:   rgba(140,168,120,.13);
  --chip-leaf-br:   rgba(140,168,120,.32);
  --chip-leaf-fg:   #a8c46a;
  --chip-neutral-bg:rgba(169,162,147,.10);
  --chip-neutral-br:rgba(169,162,147,.26);
  --track:          #26211a;   /* an EMPTY bar. Must read as a groove, not a fill. */
}

/* ── 1 · breadcrumb ──────────────────────────────────────────────────────── *
 * .back was the highest-contrast object in the light bar — a near-black pill
 * with cream text. It inverted into a cream pill with cream text, i.e. the
 * "View on map" call to action became the least readable thing on the page.
 * The faithful translation is not "dark pill" but "still the strongest object
 * in the bar", which on this ground is the solid gold.                      */
html[data-theme="dark"] .crumb .back {
  background: var(--gold);
  color: var(--on-gold);
  border-color: var(--gold);
}
html[data-theme="dark"] .crumb .back:hover {
  background: var(--gold-lt);
  color: var(--on-gold);
  border-color: var(--gold-lt);
}
html[data-theme="dark"] .crumb a:hover { background: var(--tint); }

/* ── 2 · buttons ─────────────────────────────────────────────────────────── */
html[data-theme="dark"] .btn.ghost { border-color: var(--line-strong); }

/* .btn.dark was INVISIBLE in dark, not merely quiet. Its rule is
       background: var(--plate, var(--ink))
   and in dark --plate (#1a160f) IS the page ground (#12100c) — a 1.1:1 fill.
   Round 2 tokenised that declaration and checked contrast on text pairs but
   never on a fill against the backdrop it had just been moved onto.

   The replacement is the house primary-CTA idiom, --gold + --on-gold, which
   RenoVision_Demo already uses a dozen times and this page never adopted.
       #12100c on #d8b654  →  9.7:1

   Deliberately dark-only: light keeps its black fill (#fff on #111318, 17.4:1),
   which was never broken. Drop the html[data-theme="dark"] prefix on these three
   rules to promote the treatment to both modes. */
html[data-theme="dark"] .btn.dark {
  background: var(--gold);
  color: var(--on-gold, #12100c);
  border: 1px solid var(--gold);
}
html[data-theme="dark"] .btn.dark:hover {
  background: var(--gold-lt);
  border-color: var(--gold-lt);
}
/* The page's money action outranks the two paywall CTAs that share .btn.dark, so
   the extra weight rides on its own class rather than on .btn.dark. */
html[data-theme="dark"] .btn.dark.cta {
  font-size: 14.5px;
  padding: 12px 18px;
  letter-spacing: .01em;
}

/* ── 3 · ranking / confidence / anchor chips ─────────────────────────────── */
html[data-theme="dark"] .pchip,
html[data-theme="dark"] .tt {
  background: var(--chip-slate-bg);
  border-color: var(--chip-slate-br);
  color: var(--chip-slate-fg);
}
/* .note was in this group in round 2 and should not have been: it is declared
   in market_profile's <style> but never emitted there, and it IS live on the
   landing page as .hero .note, where the gold wash was never wanted. */
html[data-theme="dark"] .anchor-line,
html[data-theme="dark"] .anch {
  background: var(--chip-gold-bg);
  border-color: var(--chip-gold-br);
}
html[data-theme="dark"] .town.seat { background: var(--chip-gold-bg); }
html[data-theme="dark"] .flagchip  { border-color: var(--line-strong); }
html[data-theme="dark"] .cal       { border-color: var(--line-strong); }

/* ── 4 · year tags on the fundamentals grid ──────────────────────────────── *
 * FINAL is the settled year and PARTIAL the incomplete one; the pair has to
 * stay distinguishable at 9px, so gold vs. burnt orange rather than two
 * weights of the same wash.                                                 */
html[data-theme="dark"] .yrtag.final {
  background: var(--chip-gold-bg);
  color: var(--gold-lt);
}
html[data-theme="dark"] .yrtag.part {
  background: var(--chip-warn-bg);
  border-color: var(--chip-warn-br);
  color: #f0a878;
}
html[data-theme="dark"] .fund.partial {
  background: rgba(224,133,64,.055);
  border-color: var(--chip-warn-br);
}

/* ── 5 · body prose ──────────────────────────────────────────────────────── *
 * --ink2 rather than --ink: the bolds inside these blocks already resolve to
 * --ink, and if the surrounding sentence carried the same value the emphasis
 * would disappear. This keeps the light theme's RELATIONSHIP (body a step back
 * from its own bolds) rather than its absolute values.                      */
html[data-theme="dark"] .narr,
html[data-theme="dark"] .invsum,
html[data-theme="dark"] .clim-desc,
html[data-theme="dark"] .transit-line { color: var(--ink2); }

/* ── 6 · bar tracks ──────────────────────────────────────────────────────── */
html[data-theme="dark"] .ind-bg,
html[data-theme="dark"] .comp-bg,
html[data-theme="dark"] .lad-bg,
html[data-theme="dark"] .lstrk { background: var(--track); }
html[data-theme="dark"] .lsfil { background: #6f6857; }
html[data-theme="dark"] .skel {
  background: linear-gradient(90deg,#1c1913 25%,#2a2418 37%,#1c1913 63%);
  background-size: 400% 100%;
}

/* ── 7 · lender-share table ──────────────────────────────────────────────── */
html[data-theme="dark"] .lsr { border-bottom-color: var(--line); }
html[data-theme="dark"] .lsscroll::-webkit-scrollbar-thumb { background: var(--line-strong); }
html[data-theme="dark"] .lsmore:hover { background: var(--tint); }
html[data-theme="dark"] .ls-investor {
  background: var(--chip-gold-bg);  border-color: var(--chip-gold-br);  color: var(--gold-lt);
}
html[data-theme="dark"] .ls-nonqm {
  background: var(--chip-plum-bg);  border-color: var(--chip-plum-br);  color: var(--chip-plum-fg);
}
html[data-theme="dark"] .ls-builder {
  background: var(--chip-leaf-bg);  border-color: var(--chip-leaf-br);  color: var(--chip-leaf-fg);
}
html[data-theme="dark"] .ls-bank {
  background: var(--chip-slate-bg); border-color: var(--chip-slate-br); color: var(--chip-slate-fg);
}
html[data-theme="dark"] .ls-credit_union {
  background: var(--chip-good-bg);  border-color: var(--chip-good-br);  color: var(--txt-strong);
}
html[data-theme="dark"] .ls-retail {
  background: var(--chip-neutral-bg); border-color: var(--chip-neutral-br); color: var(--gray);
}
html[data-theme="dark"] .ls-other {
  background: var(--chip-neutral-bg); border-color: var(--chip-neutral-br); color: var(--faint);
}
html[data-theme="dark"] .cmp-recon { border-top-color: var(--line); }

/* ── 8 · SVG figures built in JS ─────────────────────────────────────────── *
 * The score-history chart writes its colours as SVG presentation attributes
 * from string literals, so no token reaches them. A CSS property beats a
 * presentation attribute, and an attribute SELECTOR can pick out exactly the
 * literal that was written — which lets the brand gold and the reprice blue
 * lift independently, without touching the JS and without flattening the two
 * into one colour.
 *
 * #8a6d1d is 3.88:1 on this plate — legible only because it is bold. The ramp
 * gold clears 9.7:1.                                                        */
html[data-theme="dark"] svg [fill="#8a6d1d"]   { fill: var(--gold); }
html[data-theme="dark"] svg [stroke="#8a6d1d"] { stroke: var(--gold); }
html[data-theme="dark"] svg [fill="#4a6d94"]   { fill: var(--slate); }
html[data-theme="dark"] svg [stroke="#4a6d94"] { stroke: var(--slate); }
html[data-theme="dark"] svg [stroke="#c9b479"] { stroke: var(--gold-mid); }
html[data-theme="dark"] svg [fill="#b8b2a4"]   { fill: var(--mute); }
html[data-theme="dark"] svg [stroke="#f4efe3"] { stroke: var(--line); }
/* the area wash under the score line: .33 of a warm gold is a whisper on
   cream and an olive wedge on #12100c that competes with the line itself */
html[data-theme="dark"] svg stop[stop-color="#c9b479"] { stop-color: var(--gold-mid); }
html[data-theme="dark"] svg stop[stop-opacity=".33"]   { stop-opacity: .17; }

/* ── 8b · map POI labels ─────────────────────────────────────────────────── *
 * _renderPOIs gives every GLYPH a cream backing plate (r 7.6, #faf8f2 @ .8) so
 * it separates from whatever county fill it lands on. The LABELS never got one —
 * they rely on the halo in RenoVision_Demo.html:
 *
 *     #poi-layer .poi text { paint-order:stroke fill; stroke:var(--paper) }
 *
 * --paper is cream in light and #12100c in dark, so in dark that halo went black
 * while the fills below stayed hardcoded near-black. Dark text in a dark outline:
 * the labels only surfaced where they happened to cross a pale fill. University
 * read least-badly because #6d5617 is a brass and section 8 already lifts its
 * glyph to var(--gold).
 *
 * Lift the TEXT, not the halo. Light text turns that dark stroke into the
 * effective background, so a label reads the same over the unscored ground as
 * over the deepest red on the ramp — better than light mode, where a cream halo
 * has to fight the orange end of the choropleth.                              */
html[data-theme="dark"] #poi-layer text[fill="#2c2e33"] { fill: var(--ink); }   /* city */
html[data-theme="dark"] #poi-layer text[fill="#3a3d45"] { fill: var(--ink); }   /* airport */
html[data-theme="dark"] #poi-layer text[fill="#6d5617"] { fill: var(--ink); }   /* university */
/* 111 hospitals against 20 cities: at full --ink the map becomes a wall of
   hospital names. --mute is 7.49:1 on the halo and matches the recessive role
   the geometry already gives them (smallest size, only non-bold weight). */
html[data-theme="dark"] #poi-layer text[fill="#3d4a54"] { fill: var(--mute); }  /* hospital */
/* 2.2px was measured for DARK text on a CREAM halo, where stroke and glyph merge.
   Light-on-dark is a hard outline and 2.2 muds the counters of 10px serif —
   checked by rendering both at 2x and looking. Light keeps 2.2. */
html[data-theme="dark"] #poi-layer .poi text { stroke-width: 1.8px; }

/* ── 9 · dashboard ───────────────────────────────────────────────────────── *
 * Same complaint, other page: the ZIP watchlist score badge and the buyer-type
 * badge are pastel fills that were quiet on cream. The hue of each band is
 * preserved exactly — green / blue / amber / plum / red — only the fill
 * becomes a wash and the text the lifted hue.                               */
html[data-theme="dark"] {
  --zw-bg4: var(--chip-good-bg);   --zw-fg4: var(--txt-strong);
  --zw-bg3: var(--chip-slate-bg);  --zw-fg3: var(--chip-slate-fg);
  --zw-bg2: var(--chip-gold-bg);   --zw-fg2: var(--gold-lt);
  --zw-bg1: var(--chip-plum-bg);   --zw-fg1: var(--chip-plum-fg);
  --zw-bg0: var(--chip-bad-bg);    --zw-fg0: var(--txt-caution);
}
html[data-theme="dark"] .new-key-box { background: var(--chip-gold-bg); }

/* ══════════════════════════════════════════════════════════════════════════
   Dark plate · round 3 — pale chips and the county medallion
   ══════════════════════════════════════════════════════════════════════════

   Three treatments were doing one job. The COUNTY qualifier was a white pill,
   the NC chip was a white pill, and the SC chip beside it was a dark pill at
   1.5:1 — so a pair that means "two states" read as "one of these matters".

   All three take the round-2 wash idiom: a faint tint of the chip's own hue,
   a hairline rule of the same hue, the hue lifted as text. NC and SC share one
   token, so the pair is symmetric and only the letters differ.

   The state chips carry their rule as an inset box-shadow rather than a border,
   because they have no border today and a real one would move light mode by 2px.
   ══════════════════════════════════════════════════════════════════════════ */

html[data-theme="dark"] {
  /* the NC / SC pair in the distribution strip — one token, both chips */
  --chip-state-bg: rgba(216,182,84,.10);
  --chip-state-br: rgba(216,182,84,.26);
  --chip-state-fg: var(--gold-lt);

  /* The rent and ZIP-count values in that strip. Deliberately NOT --forest and
     --ink2: RenoVision_Demo declares both in its own :root (#174f4a, #2c2e33),
     so a fallback against those names would never fire in light and the light
     strip would move. Same trap --fg-elite fell into in C4. */
  --kpi-rent:  var(--forest);
  --kpi-count: var(--ink2);

  /* ── The county medallion ──────────────────────────────────────────────
     Nine tokens rather than nine literals in the JS, so the seal can be
     re-tuned from here. Deliberately dark-only names: every one is absent in
     light, where the function's fallbacks are the values that ship today.
     Treatment: struck brass — a thin gold wash in the disc so it reads as
     metal rather than as a sheet of paper glued to a black page.          */
  --seal-face:   rgba(216,182,84,.13);
  --seal-ring:   var(--gold);
  --seal-rule:   var(--gold-mid);
  --seal-rule2:  rgba(216,182,84,.32);
  --seal-name:   var(--gold-lt);
  --seal-sub:    var(--gold-mid);
  --seal-star:   var(--gold);
  --seal-hub:    var(--plate);
  --seal-hub-fg: var(--gold-lt);
}

/* the COUNTY qualifier on a metric box — CSS, so the map page needs no edit */
html[data-theme="dark"] .geo-chip {
  background: var(--chip-gold-bg);
  border-color: var(--chip-gold-br);
  color: var(--gold);
}

/* ══════════════════════════════════════════════════════════════════════════
   Dark plate · round 3 — the map panel's Score History + Market Pulse modules
   ══════════════════════════════════════════════════════════════════════════

   Both modules render inside the map's ZIP/county panel and were built in the
   light era: every var-driven declaration flips with the theme, every bare
   cream literal does not. The visible casualty is .ap-note — the ladder
   summary strip — whose color:var(--ink) flips to cream ON the stuck-light
   #f6efdc bar, wiping the sentence while its gold <b>s survive.

   Tokens for the JS-emitted inline literals live ONLY in this block, so the
   inline fallback (var(--ap-red, #b3403a)) never fires in light — light mode
   cannot move, by construction. Rung fills escalate by hue on the plate
   (gold → amber → burnt → brick), the same idiom as the dark score bands.
   ══════════════════════════════════════════════════════════════════════════ */
html[data-theme="dark"] {
  --ap-red:  #e2707a;   /* brick text/fill tone — matches --brick             */
  --ap-lad2: #e0a84a;   /* 2–3x rung fill (was #8a6d1d — 1.9:1 on the track)  */
  --ap-lad3: #e08540;   /* 3–4x rung fill (was #7a4a1e — vanished)            */
}

/* the light hairline #eee8da is the loudest rule on the plate */
html[data-theme="dark"] .ash,
html[data-theme="dark"] .ash-tog button,
html[data-theme="dark"] .ap-strip,
html[data-theme="dark"] .ap-acc,
html[data-theme="dark"] .ap-chip,
html[data-theme="dark"] .ap-chart,
html[data-theme="dark"] .ap-rank-row,
html[data-theme="dark"] .ap-skel { border-color: var(--line); }

/* the reported bug: cream text on the stuck-light note bar */
html[data-theme="dark"] .ap-note {
  background: var(--chip-gold-bg);
  border-color: var(--chip-gold-br);
}

/* score-history delta chips + band-change pill — the round-2 wash idiom */
html[data-theme="dark"] .ash-chip.up { color: var(--green);  background: var(--chip-good-bg); }
html[data-theme="dark"] .ash-chip.dn { color: var(--brick);  background: var(--chip-bad-bg); }
html[data-theme="dark"] .ash-chip.fl { background: var(--chip-neutral-bg); }
html[data-theme="dark"] .ash-evt {
  background: var(--chip-gold-bg);
  border-color: var(--chip-gold-br);
}

/* an EMPTY calibration track must read as a groove, not a fill */
html[data-theme="dark"] .ap-calib-bar { background: var(--track); }

/* stalest-ZIP share % — lift the red like every other brick text */
html[data-theme="dark"] .ap-rank-share { color: var(--brick); }

/* hover was #7a5f18 on a gold button — dark-on-dark; house hover is gold-lt */
html[data-theme="dark"] .ap-cta:hover { background: var(--gold-lt); }

/* the sparklines' bold end-count is drawn fill="#111318" — light ink. The
   generic svg overrides above cover every other hex the two charts emit;
   this closes the set. #111318 as an svg fill always MEANS ink-text.       */
html[data-theme="dark"] svg [fill="#111318"] { fill: var(--ink); }
