/* ============================================================
   Brownfield Opportunities — design tokens
   v1.8 (2026-04-30): editorial refresh — serif headline, KPI strip,
   warmer surfaces, tighter chrome, perf-aware (no web fonts, no
   backdrop-blur on hot paths).
   ============================================================ */
:root {
  /* Surfaces — warmer, less SaaS-blue than v1.7 */
  --bg: #f1f2f4;
  --bg-elev: #fafafb;        /* hero / KPI strip background */
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --border: #d8dde6;
  --border-strong: #b8c0cc;
  --text: #15212e;
  --text-soft: #3b4655;
  --muted: #6b7480;
  /* Accent — deeper, less Microsoft-blue. Reads "policy / editorial". */
  --accent: #1c5e9e;
  --accent-strong: #0e4378;
  --accent-soft: rgba(28, 94, 158, 0.08);
  /* NPL status palette — single source of truth. */
  --status-final: #b8332f;
  --status-deleted: #8a94a3;
  --status-proposed: #b8821a;
  --status-other: #3f7a3f;
  --status-acres: #1c5e9e;
  /* "Site is transactable today" green — drives the Cleanup Complete and
     Active Reuse pills in the detail panel. Distinct from --status-other
     (which colors NPL "Not on NPL" pills) so the readiness signal isn't
     conflated with an NPL-status shade. */
  --readiness-ready: #2f7a4d;
  /* Suitability-score "marginal" amber — between ready-green and muted.
     Drives the siting-suitability meter for scores 25–49. */
  --suit-amber: #c46a14;
  /* Map markers and legend are colored by program (one dot per program). */
  --program-superfund: #b8332f;
  --program-brownfield: #1c5e9e;
  --program-fuds: #6f3691;
  --program-brac: #c46a14;
  /* Civilian nuclear pipeline overlay (⚛ markers + legend + category chips).
     Mirrors the INL AP1000-study readiness tiers: dark green = ready,
     light green = feasible, blue = restart / SMR / new entrant. Deliberately
     distinct from the gold ★ (confirmed deals), rust ◆ (retired industrial)
     and teal ⬢ (retiring plants) overlay palettes. */
  --nuclear-ready: #14663c;
  --nuclear-feasible: #3f8a4a;
  --nuclear-restart: #1f7ba8;
  /* Vector basemap palette */
  --map-ocean: #dde3ec;
  --map-land: #f5f7fa;
  --map-state-stroke: #4a5568;
  --map-county-stroke: #b9c2d0;
  --map-marker-stroke: #ffffff;
  --inset-bg: #ffffff;
  --inset-stroke: #4a5568;
  --shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.06);

  /* ----- Typography ----- */
  /* System sans for body. System serif for display — avoids any web-font
     fetch (Charter ships with macOS, Source Serif 4 with newer browsers,
     graceful fallback to Georgia / Times). Numbers always tabular. */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Charter", "Source Serif 4", "Source Serif Pro", "Iowan Old Style", "Apple Garamond", "Palatino", "Georgia", "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11", "tnum";
}

[data-theme="dark"] {
  --bg: #0d121a;
  --bg-elev: #131923;
  --surface: #161c26;
  --surface-2: #1d2531;
  --border: #2c3645;
  --border-strong: #3b4757;
  --text: #e8eaef;
  --text-soft: #b9c2d0;
  --muted: #94a0b1;
  --accent: #7eb6e8;
  --accent-strong: #a4cdf2;
  --accent-soft: rgba(126, 182, 232, 0.12);
  --status-final: #ef5050;
  --status-deleted: #94a0b1;
  --status-proposed: #d4a93f;
  --status-other: #5fa45f;
  --status-acres: #7eb6e8;
  --readiness-ready: #6cc18a;
  --suit-amber: #e6a040;
  --program-superfund: #ef5050;
  --program-brownfield: #7eb6e8;
  --program-fuds: #b47ad8;
  --program-brac: #e6a040;
  --nuclear-ready: #5fd39b;
  --nuclear-feasible: #9fd7a4;
  --nuclear-restart: #6fc8ee;
  --map-ocean: #0a0f17;
  --map-land: #1d2531;
  --map-state-stroke: #5a6577;
  --map-county-stroke: #2e3848;
  --map-marker-stroke: #0d121a;
  --inset-bg: #1d2531;
  --inset-stroke: #5a6577;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, .tab, a { touch-action: manipulation; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Visually hidden until keyboard-focused — first thing in tab order so a
   keyboard user can jump past the toolbar straight to the map/table. */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent-strong);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 2000;
  text-decoration: none;
  transition: top 120ms;
}
.skip-link:focus { top: 8px; outline: 2px solid var(--accent); outline-offset: 2px; }

main:focus { outline: none; }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 50;
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  gap: 16px;
}
.brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text);
}
.brand .sub {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 220px;
  max-width: 360px;
  display: flex;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  flex: 1;
  min-width: 0;
  transition: border-color 120ms, background 120ms;
}
.search-typeahead {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1000;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  max-height: 320px;
  overflow-y: auto;
}
[data-theme="dark"] .search-typeahead {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}
.search-typeahead[hidden] { display: none; }
.typeahead-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name program" "meta program";
  gap: 1px 8px;
  padding: 7px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text);
}
.typeahead-item:hover,
.typeahead-item.active {
  background: var(--accent-soft);
}
.typeahead-name {
  grid-area: name;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.typeahead-meta {
  grid-area: meta;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.typeahead-program {
  grid-area: program;
  align-self: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}
.search:focus-within { border-color: var(--accent); background: var(--surface); }
.search-icon {
  color: var(--muted);
  font-size: 14px;
  margin-right: 6px;
  user-select: none;
}
.search input {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  padding: 4px 0;
  outline: none;
  flex: 1;
  min-width: 0;
}
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search-count {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 360px;
  letter-spacing: 0.01em;
}
.search-count:empty { display: none; }
@media (max-width: 900px) {
  .search-count { display: none; }
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 32px; height: 32px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.icon-btn:hover { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.icon-btn[aria-expanded="true"] { background: var(--accent-strong); color: white; border-color: var(--accent-strong); }
/* Tiny chip on the filter button when filters are active. Lives outside
   the button hit area so the hit target stays 32px. */
.icon-btn .chip-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--surface);
}
.icon-btn[aria-expanded="true"] .chip-count { background: var(--surface); color: var(--accent-strong); }
/* Same trap as the detail-panel had: a `display: inline-flex` rule wins over
   the implicit `display: none` from [hidden]. Force it back. */
.chip-count[hidden] { display: none; }

.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.tab {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms, color 120ms, box-shadow 120ms;
  font-family: inherit;
}
.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.tab:hover:not(.active) { color: var(--text); }

/* ============================================================
   Hero strip — slim editorial intro above the map
   ============================================================ */
.hero {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 22px 24px 18px;
  position: relative;
  z-index: 40;
}
.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.hero-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 6px;
}
.hero-eyebrow .dot { color: var(--border-strong); margin: 0 5px; }
.hero h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 580px;
}
.hero p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 580px;
}
.hero p a { color: var(--accent); }

/* KPI deck — Bloomberg/FT-style metric strip */
.kpi-deck {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
/* When the KPI deck lives inside the topbar it should integrate flush —
   no card border, no radius, just a top divider line. */
.topbar .kpi-deck {
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--border);
}
.topbar .kpi { padding: 7px 24px; }
.topbar .kpi:first-child { padding-left: 24px; }
.topbar .kpi-disclosure { display: block; }
.topbar .kpi-disclosure > .kpi-summary { display: none; }
}
.kpi {
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.kpi:last-child { border-right: none; }
.kpi-label {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
  /* Allow wrap so the label keeps its meaning rather than truncating to
     "ACRES TRACK..." on narrow tablet columns. The KPI cell sets a min
     line height so two-line and one-line labels align across cells. */
  min-height: 2.4em;
  line-height: 1.2;
}
.kpi-num {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--text);
  display: block;
}
.kpi-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.3;
  /* Truncate at one line on desktop (avoids a tall second row); allow wrap
     on the mobile carousel where each KPI gets generous min-width.
     `display: block` is required for `overflow: hidden` + `text-overflow:
     ellipsis` to take effect — those properties no-op on `display: inline`,
     which is the default for `<span>`. Without this, the subtext bleeds
     across the column boundary into the next KPI cell (UAT-006). */
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .kpi-sub { white-space: normal; overflow: visible; text-overflow: clip; }
}
.kpi-sub.kpi-sub-strong { color: var(--text-soft); }

/* Actionable KPI cells (Hyperscale, DC reuse candidates) act as
   click-to-filter shortcuts. Cursor + faint hover hint signals
   interactivity; `.kpi-active` shows the filter is engaged. */
.kpi.kpi-actionable {
  cursor: pointer;
  transition: background 90ms ease;
  border-radius: 0;
  outline-offset: -2px;
}
.kpi.kpi-actionable:hover { background: var(--surface-2); }
.kpi.kpi-actionable:focus-visible { outline: 2px solid var(--accent); }
.kpi.kpi-actionable.kpi-active {
  background: var(--accent-soft);
}
.kpi.kpi-actionable.kpi-active .kpi-num { color: var(--accent-strong, var(--accent)); }
.kpi.kpi-actionable.kpi-active .kpi-label::after {
  content: " · active";
  color: var(--accent);
  font-weight: 700;
}

/* KPI disclosure (mobile) — the deck is wrapped in <details> so the
   carousel can be collapsed behind a single-line summary on phones. On
   desktop, the disclosure is always-open and the <summary> is hidden so
   the deck reads as a static panel. The trick: forcing `open` via CSS
   isn't possible (the attribute is the source of truth), so app.js opens
   it once on first paint when the viewport is wider than 640px. */
.kpi-disclosure { display: block; }
.kpi-disclosure > .kpi-summary { display: none; }
.kpi-disclosure[open] > .kpi-deck { margin-top: 0; }

/* ============================================================
   JTBD quick-start strip — "what are you siting?" in one click.
   Chips borrow the .cand-filter visual language (small pills) so the
   header doesn't grow a second button vocabulary. `[hidden]` guard is
   mandatory: the strip sets `display: flex`, which would otherwise beat
   the hidden attribute (see CLAUDE.md "the [hidden] trap").
   ============================================================ */
.jtbd-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.jtbd-strip[hidden] { display: none; }
.jtbd-lead {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 2px;
}
.jtbd-chip {
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background 80ms, border-color 80ms, color 80ms;
}
.jtbd-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
.jtbd-chip:focus-visible,
.jtbd-dismiss:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jtbd-dismiss {
  margin-left: auto;
  flex: none;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
}
.jtbd-dismiss:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 640px) {
  .jtbd-strip { padding: 6px 12px; }
  .jtbd-lead { display: none; }
  .jtbd-dismiss { margin-left: 4px; }
}

@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 16px; }
  .hero h2 { font-size: 22px; }
}
@media (max-width: 640px) {
  .hero { padding: 12px 12px 10px; }
  .hero-eyebrow { font-size: 9.5px; }
  .hero h2 { font-size: 18px; }
  .hero p { font-size: 12.5px; }
  /* On phones the map is the product — hide hero copy entirely; the KPI
     deck collapses behind a disclosure with a compact summary strip. */
  .hero-copy { display: none; }
  .topbar .kpi-disclosure > .kpi-summary,
  .kpi-disclosure > .kpi-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    cursor: pointer;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11.5px;
    color: var(--muted);
    letter-spacing: 0.01em;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .topbar .kpi-disclosure > .kpi-summary::-webkit-details-marker,
  .kpi-disclosure > .kpi-summary::-webkit-details-marker { display: none; }
  .kpi-summary-pair {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
  }
  .kpi-summary-num {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
  }
  .kpi-summary-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 9.5px;
    font-weight: 600;
  }
  .kpi-summary-dot { color: var(--border-strong); }
  .kpi-summary-chevron {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    transform: rotate(45deg) translate(-1px, -1px);
    transition: transform 150ms ease;
  }
  .kpi-disclosure[open] .kpi-summary-chevron {
    transform: rotate(-135deg) translate(-1px, -1px);
  }
  .kpi-disclosure[open] > .kpi-deck { margin-top: 8px; }
  .kpi-deck {
    border-radius: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .kpi { scroll-snap-align: start; }
  .kpi-num { font-size: 19px; }
  .kpi-label { font-size: 9px; }
}

/* ============================================================
   Filters strip
   ============================================================ */
.filters {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filters[hidden] { display: none; }
/* Desktop: the sheet chrome (drag handle, title, close, action footer)
   doesn't render — the filters read as an inline strip below the hero. */
.filters-sheet-head,
.filters-sheet-actions,
.filters-backdrop { display: none; }
.filters-backdrop[hidden] { display: none; }
.filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.filter select, .filter input[type="range"] {
  font: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  min-width: 160px;
  font-weight: 400;
  font-family: var(--font-sans);
}
.filter select:hover { border-color: var(--border-strong); }
.filter input[type="range"] { padding: 0; min-width: 200px; accent-color: var(--accent); }
.filter select[multiple] { min-height: 60px; padding: 4px; }
.filter-acreage { min-width: 220px; }
.acreage-ticks-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}
.filter-status { min-width: 150px; }
.check-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 14px;
}
.check-group .check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  cursor: pointer;
}
.check-group .check input { accent-color: var(--accent); cursor: pointer; }
.filter-status legend { padding-bottom: 4px; }
.filter-program {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-program legend {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 0 2px 0;
}
.filter-program .check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  cursor: pointer;
}
.filter-program .check input { accent-color: var(--accent); cursor: pointer; }
.muted-num { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; text-transform: none; letter-spacing: 0; }
.text-btn {
  font: inherit;
  font-size: 12px;
  background: transparent;
  color: var(--accent);
  border: none;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
  font-family: inherit;
}
.text-btn:hover { color: var(--accent-strong); }

/* ============================================================
   Views (map + table)
   ============================================================ */
main {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.view {
  position: absolute;
  inset: 0;
  display: none;
}
.view.active { display: block; }
#map { width: 100%; height: 100%; background: var(--bg); }
.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  padding: 2px 6px !important;
}
.leaflet-container { background: var(--bg); }
[data-theme="dark"] .leaflet-control-attribution { background: rgba(20,25,35,0.85) !important; color: #aab !important; }
[data-theme="dark"] .leaflet-control-attribution a { color: var(--accent); }
/* Refined zoom control to match the new chrome */
.leaflet-bar {
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-soft) !important;
  border-radius: 6px !important;
  overflow: hidden;
}
.leaflet-bar a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-bottom-color: var(--border) !important;
}
.leaflet-bar a:hover { background: var(--surface-2) !important; }

/* ============================================================
   Inset region labels (AK / HI / PR / Pacific)
   ============================================================ */
.inset-label {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px 4px 0 0;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
}

/* ============================================================
   Map legend — flat card, per-program counts, no backdrop-blur
   (perf: backdrop-filter recomposites every pan/zoom frame)
   ============================================================ */
.legend {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px 8px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text);
  box-shadow: var(--shadow);
  max-width: 220px;
}
.legend-title {
  font-weight: 600;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.legend-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}
.legend-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-soft);
}
.legend-num {
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}
.legend-foot {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.02em;
}
/* Reference campus row in legend */
.legend-row-ref {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.legend-star {
  color: #c8960c;
  font-size: 13px;
  line-height: 1;
  display: inline-block;
  width: 12px;
  text-align: center;
}

/* Reference campus map markers */
.ref-campus-icon {
  background: none !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ref-campus-icon span {
  font-size: 18px;
  color: #c8960c;
  text-shadow: 0 0 3px rgba(0,0,0,0.55);
  cursor: pointer;
  line-height: 1;
}
[data-theme="dark"] .ref-campus-icon span {
  color: #f0c040;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

/* Retired heavy-industrial overlay — rust diamond, distinct from the gold
   reference-campus stars and the program marker palette. */
.legend-diamond {
  color: #9a5b2e;
  font-size: 12px;
  line-height: 1;
  display: inline-block;
  width: 12px;
  text-align: center;
}
[data-theme="dark"] .legend-diamond { color: #cf9b6a; }

/* Announced-retirement power plants — teal hexagon, distinct from the rust
   retired-industrial diamonds (already dark) and gold stars (done deals):
   these interconnects free up on a KNOWN future date. */
.legend-hex {
  color: #0f766e;
  font-size: 12px;
  line-height: 1;
  display: inline-block;
  width: 12px;
  text-align: center;
}
[data-theme="dark"] .legend-hex { color: #5eead4; }
.planned-retirement-icon {
  background: none !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.planned-retirement-icon span {
  font-size: 15px;
  color: #0f766e;
  text-shadow: 0 0 3px rgba(0,0,0,0.55);
  cursor: pointer;
  line-height: 1;
}
[data-theme="dark"] .planned-retirement-icon span {
  color: #5eead4;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}
.retired-industrial-icon {
  background: none !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.retired-industrial-icon span {
  font-size: 15px;
  color: #9a5b2e;
  text-shadow: 0 0 3px rgba(0,0,0,0.55);
  cursor: pointer;
  line-height: 1;
}
[data-theme="dark"] .retired-industrial-icon span {
  color: #cf9b6a;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

/* Civilian nuclear pipeline — ⚛ atom glyph, colored by INL readiness tier
   from the --nuclear-* token pairs (theme-safe without a JS repaint). */
.legend-atom {
  color: var(--nuclear-ready);
  font-size: 15px;
  line-height: 1;
  display: inline-block;
  width: 12px;
  text-align: center;
}
.nuclear-site-icon {
  background: none !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  /* The atom is a fine, intricate glyph — it needs a couple more pixels than
     the solid ◆ / ⬢ / ★ overlay marks to stay legible on the basemap. */
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--nuclear-ready);
  text-shadow: 0 0 3px rgba(0,0,0,0.55);
}
[data-theme="dark"] .nuclear-site-icon { text-shadow: 0 0 4px rgba(0,0,0,0.8); }
.nuclear-cat-ready    { color: var(--nuclear-ready); }
.nuclear-cat-feasible { color: var(--nuclear-feasible); }
.nuclear-cat-restart  { color: var(--nuclear-restart); }

/* Reference campus popup */
.ref-campus-popup {
  font-size: 12.5px;
  line-height: 1.5;
  min-width: 200px;
}
.ref-campus-popup strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
  color: var(--text);
}
.ref-campus-company {
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 4px;
}
.ref-campus-prev {
  font-style: italic;
  font-size: 11.5px;
  color: var(--text-soft);
  margin-bottom: 6px;
  border-left: 2px solid var(--border);
  padding-left: 6px;
}
.ref-campus-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 11px;
  margin-bottom: 6px;
}
.ref-campus-meta span {
  color: var(--text-soft);
}
.ref-status-operational {
  color: var(--status-final) !important;
  font-weight: 600;
}
.ref-status-active {
  color: var(--accent) !important;
  font-weight: 600;
}
.ref-status-planned {
  color: var(--muted) !important;
}
.ref-campus-link {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
}
.ref-campus-link:hover { text-decoration: underline; }

/* ============================================================
   Table — paginated, sticky head
   ============================================================ */
.table-wrap {
  height: 100%;
  overflow: auto;
  padding: 0;
  background: var(--surface);
  /* Containment caps invalidation cost when rows append (pagination). */
  contain: layout paint;
}
#sites-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#sites-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  text-align: left;
  padding: 11px 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 1;
}
#sites-table thead th.num { text-align: right; }
#sites-table thead th[aria-sort] { color: var(--accent); }
#sites-table thead th[aria-sort]::after {
  content: " " attr(data-sort-glyph);
  font-size: 10px;
  opacity: 0.7;
}
#sites-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 90ms;
}
#sites-table tbody tr:hover { background: var(--surface-2); }
#sites-table tbody tr.selected { background: var(--accent-soft); }
[data-theme="dark"] #sites-table tbody tr.selected { background: rgba(126, 182, 232, 0.12); }
#sites-table td {
  padding: 9px 14px;
  vertical-align: top;
  color: var(--text-soft);
}
#sites-table td:first-child { color: var(--text); font-weight: 500; }
#sites-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-sentinel {
  width: 100%;
  height: 1px;
  pointer-events: none;
}

/* ============================================================
   Detail panel
   ============================================================ */
.detail {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 92vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px 24px 28px;
  overflow-y: auto;
  z-index: 1000;
  transform: translateX(0);
  visibility: visible;
  transition: transform 200ms cubic-bezier(.2,.8,.2,1), visibility 0s linear 0s;
  contain: layout paint;
}
/* Program-color top stripe — set by JS in selectSite() via --detail-stripe */
.detail::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--detail-stripe, var(--accent));
}
.detail[hidden] {
  display: block;
  transform: translateX(110%);
  pointer-events: none;
  visibility: hidden;
  transition: transform 200ms cubic-bezier(.4,0,.2,1), visibility 0s linear 200ms;
}
.detail h2 {
  margin: 0 36px 4px 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}
.detail h3 {
  margin: 22px 0 8px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-weight: 600;
}
/* Collapsible detail-panel sections. The <summary> inherits the h3 style
   so the visual treatment stays identical to the static-h3 sections; the
   chevron rotates between collapsed and expanded. On desktop they default
   to open (set programmatically once by app.js based on matchMedia); on
   mobile they default to closed so the panel fits in a 65vh sheet without
   immediate scroll. */
.detail .d-section { margin: 0; }
.detail .d-section > summary {
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail .d-section > summary::-webkit-details-marker { display: none; }
.detail .d-section > summary > h3 {
  margin: 22px 0 8px;
  flex: 1;
  /* Re-spec the border-top + padding-top here so the section divider lives
     on the summary row, not on the (potentially-hidden) inner h3. */
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.detail .d-section > summary::after {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 14px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 150ms ease;
}
.detail .d-section[open] > summary::after {
  transform: rotate(-135deg);
}
.detail .d-section[hidden] { display: none; }
.detail .muted { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}
.close:hover { background: var(--surface-2); color: var(--text); }

.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 7px 14px;
  font-size: 13px;
  margin: 0;
}
.kv dt { color: var(--muted); font-size: 12px; padding-top: 1px; }
.kv dd { margin: 0; word-wrap: break-word; color: var(--text-soft); }
.kv dd.muted-cell { color: var(--muted); font-style: italic; }
/* [hidden] trap belt-and-suspenders: keep optional rows (e.g. Parcel area)
   out of the grid when hidden even if a display override is ever added. */
.kv dt[hidden], .kv dd[hidden] { display: none; }
.kv dd .muted-cell { color: var(--muted); font-style: italic; margin-left: 2px; }
/* Same muted treatment for table cells when a column doesn't apply to the
   record's program — e.g. STATUS column for ACRES/BRAC (UAT-009). */
#sites-table td .muted-cell { color: var(--muted); font-style: italic; }
/* Inline acreage note for FUDS records lacking a digitized boundary. The
   parent `<dd>` itself isn't muted (acreage may say "N/A" but we still want
   regular weight); the note is. The `[hidden]` rule guards against the
   "[hidden] trap" — see CLAUDE.md. */
.acreage-note {
  display: inline;
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.acreage-note[hidden] { display: none; }
/* Sub-line under a `<dd>` value that surfaces qualifying criteria — used by
   the data-center reuse cell to expose the EPA RE-Powering rule
   ("≥50 acres · electric transmission · water service area") so the boolean
   isn't opaque. Same `[hidden]` belt-and-suspenders rule as `.acreage-note`. */
.dd-criteria {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.dd-criteria[hidden] { display: none; }
.children-list {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-soft);
}
.children-list li { margin: 2px 0; }
.children-list a { cursor: pointer; }

/* Federal documents block in detail panel */
#d-docs-block { margin-top: 16px; }
#d-docs-block h3 { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 6px; }
.docs-count { color: var(--muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.docs-list {
  margin: 4px 0 8px;
  padding-left: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-soft);
}
.docs-list li {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.docs-list li:last-child { border-bottom: 0; }
.docs-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.35;
}
.docs-list a:hover { text-decoration: underline; }
.doc-size { color: var(--muted); font-weight: 400; font-size: 12px; }
.doc-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.doc-date { font-variant-numeric: tabular-nums; }
.doc-cat::before { content: "· "; color: var(--border); }
.doc-cat:first-child::before { content: ""; }
.docs-source-line { margin: 6px 0 0; font-size: 12px; }
.docs-source-line a { color: var(--accent); }

.source { margin-top: 22px; font-size: 12px; }

/* ============================================================
   Detail-panel tab strip + panes (Overview vs Summary)
   ============================================================ */
.detail-tabs {
  display: flex;
  gap: 2px;
  margin: 14px 0 16px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.detail-tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms, color 120ms, box-shadow 120ms;
}
.detail-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.detail-tab:hover:not(.active) { color: var(--text); }
.dpane[hidden] { display: none; }

/* AI summary card (Claude Haiku output) */
.summary-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px 12px;
}
.summary-empty { font-size: 13px; margin: 0; }
#d-summary-body { font-size: 14px; color: var(--text-soft); line-height: 1.55; }
#d-summary-body p { margin: 0 0 10px; }
#d-summary-body p:last-child { margin-bottom: 0; }
.summary-meta {
  margin: 10px 0 0;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.summary-meta[hidden] { display: none; }
#d-summary-empty[hidden], #d-summary-body[hidden] { display: none; }

/* Nearby sites block in detail panel — up to 5 results within 25 mi */
.nearby-disclosure { margin-top: 16px; }
.nearby-disclosure[hidden] { display: none; }
.nearby-disclosure > summary {
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
  list-style: none;
}
.nearby-disclosure > summary::-webkit-details-marker { display: none; }
.nearby-disclosure > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 120ms;
}
.nearby-disclosure[open] > summary::before { content: "▾ "; }
.nearby-disclosure > summary .muted-cell {
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}
.nearby-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nearby-link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name dist" "meta dist";
  gap: 2px 8px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: background 90ms, border-color 90ms;
}
.nearby-link:hover { background: var(--surface-2); border-color: var(--border-strong); }
.nearby-name {
  grid-area: name;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nearby-meta {
  grid-area: meta;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nearby-dist {
  grid-area: dist;
  align-self: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

/* ECHO enforcement block in detail panel */
#d-echo-block { margin-top: 16px; }
#d-echo-block h3 { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 6px; }
#d-echo-block dd.violation { color: var(--status-final); font-weight: 500; }
#d-echo-block[hidden] { display: none; }
#d-grants-block[hidden] { display: none; }
#d-grants-block dd.ready { color: var(--readiness-ready); font-weight: 500; }

/* ============================================================
   Toast (non-blocking status messages)
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 10px 16px;
  font-size: 13px;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 180ms ease-out;
  z-index: 1100;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   Pills (NPL status + program label)
   ============================================================ */
.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--status-other);
  color: white;
  white-space: nowrap;
  vertical-align: middle;
}
.pill[data-status="F"] { background: var(--status-final); }
.pill[data-status="D"] { background: var(--status-deleted); }
.pill[data-status="P"] { background: var(--status-proposed); }
.pill[data-status="N"] { background: var(--status-other); }
.pill[data-program="superfund"] { background: var(--program-superfund); }
.pill[data-program="brownfield"] { background: var(--program-brownfield); }
.pill[data-program="fuds"] { background: var(--program-fuds); }
.pill[data-program="brac"] { background: var(--program-brac); }
.pill.dc-pill {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 9.5px;
  padding: 0 6px;
}
/* "Cleanup Complete" (NPL Deleted) + "Active Reuse" (RedevelopmentApp
   In_Reuse=Yes) — green outline pills, same shape as .dc-pill. Color
   comes from `--readiness-ready` so future readiness-tier badges share
   the token. Both pills sit in the detail panel's Program cell next to
   the program + DC-candidate pills. */
.pill.cleanup-pill,
.pill.reuse-pill {
  background: transparent;
  color: var(--readiness-ready);
  border: 1px solid var(--readiness-ready);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 9.5px;
  padding: 0 6px;
}

/* Opportunity Zone pill — financial signal, not technical. Outlined in
   accent (matches dc-pill, since OZ is a "look at this" indicator rather
   than a "ready to ship" indicator like cleanup-complete). */
.pill.oz-pill {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 9.5px;
  padding: 0 6px;
}

/* Opportunity Zone "Yes" rendering in the detail-panel infra section —
   reuses the `ready` green color token shared with flood-zone Zone X
   and the kV / pp chips. Anchor `<a>` inside the dd uses the same color. */
#d-opp-zone.ready { color: var(--readiness-ready); font-weight: 500; }
#d-opp-zone.ready a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Filter checkbox row for "Opportunity Zone only" — sits in the filter
   strip alongside the persona buttons. Compact, single-line label. */
.filter-opp-zone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.filter-opp-zone input { margin: 0; }
.filter-opp-zone span { color: var(--text); }

/* DC suitability tier pill (Tier 0 score). Outline-only — accent-colored
   for sub-hyperscale (edge / colo) and green-tinted (`.ready`) for
   hyperscale / mega so the strongest signal pops without color clash. */
.pill.dc-tier-pill {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 9.5px;
  padding: 0 6px;
}
.pill.dc-tier-pill.ready {
  color: var(--readiness-ready);
  border-color: var(--readiness-ready);
}

/* Voltage chip rendered next to the transmission distance in the detail
   panel ("0.4 mi  ·  230 kV"). Same outline-pill shape as the DC tier
   chip but slightly smaller, sits inline. */
.kv-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 5px;
  margin-left: 4px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface);
  vertical-align: 1px;
  font-variant-numeric: tabular-nums;
}
.kv-chip.ready {
  color: var(--readiness-ready);
  border-color: var(--readiness-ready);
}

/* Power-plant chip — matches kv-chip but slightly wider since it carries
   MW + fuel ("450 MW · natural gas"). `.ready` lights up green when the
   nameplate is large enough to host a hyperscale DC behind the meter. */
.pp-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 6px;
  margin-left: 4px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface);
  vertical-align: 1px;
  font-variant-numeric: tabular-nums;
}
.pp-chip.ready {
  color: var(--readiness-ready);
  border-color: var(--readiness-ready);
}

/* Flood-zone cell — bare text (not a chip), with status-color tinting on
   the whole <dd> when the SFHA classification is known.
   - .violation = red (Special Flood Hazard Area — permitting risk)
   - .ready = green (Zone X — minimal hazard) */
#d-flood-zone.violation { color: var(--status-final); font-weight: 500; }
#d-flood-zone.ready { color: var(--readiness-ready); font-weight: 500; }

/* Persona presets in the filter strip — one button per ladder rung.
   Active state matches the program-checkbox emphasis: filled bg, accent
   border. Each button has a label + small acreage threshold. */
.filter-personas legend { font-weight: 600; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.persona-row { display: flex; flex-wrap: wrap; gap: 6px; }
.persona-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  line-height: 1.15;
  min-width: 110px;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}
.persona-btn:hover { border-color: var(--accent); }
.persona-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.persona-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.persona-btn.active .persona-min { color: rgba(255,255,255,0.78); }
.persona-label { font-weight: 600; font-size: 12px; }
.persona-min { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* State data-center tax incentive block in the detail panel. The chip
   anchors to the source URL so the user can verify the program; meta line
   below carries program + investment threshold + sunset / status. */
.tax-incentive-block {
  margin: 12px 0 4px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.tax-chip {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid var(--border);
}
.tax-chip.tax-tier-1 {
  color: #fff;
  background: var(--readiness-ready);
  border-color: var(--readiness-ready);
}
.tax-chip.tax-tier-2 {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent);
}
.tax-chip.tax-tier-3 {
  color: var(--muted);
  background: transparent;
  border-color: var(--border);
}
.tax-chip:hover { filter: brightness(0.92); text-decoration: underline; }
.tax-meta {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.35;
}

/* ----- Siting suitability block (detail panel) ----- */
.suitability { margin-top: 4px; }
.suit-lens { margin: 0 0 14px; }
.suit-lens:last-of-type { margin-bottom: 6px; }
.suit-lens-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.suit-lens-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-soft);
}
.suit-score {
  font-weight: 800;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.suit-score[data-tier="strong"]   { color: var(--readiness-ready); }
.suit-score[data-tier="moderate"] { color: var(--accent); }
.suit-score[data-tier="marginal"] { color: var(--suit-amber); }
.suit-score[data-tier="weak"]     { color: var(--muted); }
.suit-score-max {
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  margin-left: 1px;
}
.suit-track {
  position: relative;
  height: 6px;
  margin: 6px 0 7px;
  background: var(--accent-soft);
  border-radius: 3px;
  overflow: hidden;
}
.suit-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  transition: width 0.25s ease;
}
.suit-fill[data-tier="strong"]   { background: var(--readiness-ready); }
.suit-fill[data-tier="moderate"] { background: var(--accent); }
.suit-fill[data-tier="marginal"] { background: var(--suit-amber); }
.suit-fill[data-tier="weak"]     { background: var(--muted); }
.suit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.suit-chip {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text-soft);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.suit-chip.suit-penalty {
  color: #fff;
  background: var(--program-superfund);
  border-color: transparent;
}
.suit-na {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
}
.suit-note {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.35;
}
.suit-flood {
  margin: 4px 0 8px;
  padding: 7px 10px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-soft);
  background: rgba(184, 51, 47, 0.10);
  border-left: 3px solid var(--program-superfund);
  border-radius: 3px;
}
.suit-flood[hidden] { display: none; }

/* The hero KPI deck's existing `.kpi-sub.kpi-sub-strong` rule already
   styles the "≥50 ac · power · water" subtext for #kpi-dc — the new
   #kpi-hyperscale subtext picks up the same treatment automatically
   because the markup pattern is identical. No new rules needed here. */

/* ============================================================
   Footer — sources (editorial sites cite, SaaS dashboards don't)
   ============================================================ */
.site-footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 8px 24px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.01em;
}
.site-footer a { color: var(--text-soft); text-decoration-color: var(--border-strong); }
.site-footer a:hover { color: var(--accent); }
.site-footer .footer-sources { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.site-footer .footer-meta { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Footer sources disclosure — on desktop the <summary> is hidden and the
   source list reads as an always-visible inline span (the historical
   behavior). On mobile we hide the source list by default and surface a
   tappable "Sources" summary that expands the list when tapped. */
.footer-sources-disclosure { flex: 1 1 auto; min-width: 0; }
.footer-sources-disclosure > .footer-sources-summary {
  display: none;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.footer-sources-disclosure > .footer-sources-summary::-webkit-details-marker {
  display: none;
}
.footer-sources-disclosure > .footer-sources { display: inline; }
/* Belt-and-suspenders for the [hidden] trap pattern — see design.md § 8.1. */
.footer-sources-disclosure[hidden] { display: none; }

/* ============================================================
   Mobile — hero compresses, detail becomes bottom sheet
   ============================================================ */
@media (max-width: 640px) {
  .topbar-row { padding: 6px 12px; gap: 6px; flex-wrap: wrap; }
  .topbar .kpi { padding: 6px 12px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .topbar-controls { width: 100%; gap: 4px; flex-wrap: wrap; }
  .search { flex: 1; min-width: 0; order: -1; }
  .search input { font-size: 16px; /* avoid iOS auto-zoom */ }
  .brand h1 { font-size: 16px; }
  .brand .sub { font-size: 10px; margin-top: 1px; }
  .icon-btn { width: 30px; height: 30px; }
  .tab { padding: 6px 12px; font-size: 13px; }
  .tabs { padding: 2px; }
  .kv { grid-template-columns: 96px 1fr; gap: 6px 12px; }
  #sites-table { font-size: 12px; }
  #sites-table th, #sites-table td { padding: 9px 10px; }
  /* On phones the table drops City + County + DC tier (6th, 7th, 8th
     columns) — those values still live in the detail panel. The Program
     pill loses its filled background and reads as a small uppercase label
     colored by program so the cell fits in ~64px without truncation. */
  #sites-table th:nth-child(6),
  #sites-table th:nth-child(7),
  #sites-table th:nth-child(8),
  #sites-table td:nth-child(6),
  #sites-table td:nth-child(7),
  #sites-table td:nth-child(8) { display: none; }
  #sites-table td:nth-child(2) .pill {
    background: transparent !important;
    padding: 0;
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 0;
  }
  #sites-table td:nth-child(2) .pill[data-program="superfund"] { color: var(--program-superfund); }
  #sites-table td:nth-child(2) .pill[data-program="brownfield"] { color: var(--program-brownfield); }
  #sites-table td:nth-child(2) .pill[data-program="fuds"] { color: var(--program-fuds); }
  #sites-table td:nth-child(2) .pill[data-program="brac"] { color: var(--program-brac); }
  /* Filters become a bottom sheet on phones — same pattern as the detail
     panel. The inline strip behavior is replaced with a slide-up overlay
     so the map stays visible underneath while the user picks filters. */
  .filters {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: auto;
    width: 100%;
    max-height: 80vh;
    padding: 16px 16px calc(76px + env(safe-area-inset-bottom));
    gap: 14px;
    background: var(--surface);
    border-bottom: none;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    box-shadow: var(--shadow);
    z-index: 1050;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    transform: translateY(0);
    transition: transform 220ms cubic-bezier(.2,.8,.2,1);
  }
  .filters[hidden] {
    display: flex;
    transform: translateY(110%);
    pointer-events: none;
  }
  .filters-sheet-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    position: sticky;
    top: 0;
    margin: -16px -16px 6px;
    padding: 10px 16px 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 2;
  }
  .filters-sheet-handle {
    position: absolute;
    top: 6px; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
  }
  .filters-sheet-title {
    margin: 8px 0 0;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    grid-column: 1;
  }
  .filters-sheet-close {
    grid-column: 2;
    background: transparent;
    border: none;
    color: var(--muted);
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    margin-top: 6px;
  }
  .filters-sheet-close:hover { background: var(--surface-2); color: var(--text); }
  .filter { width: 100%; gap: 6px; }
  .filter select, .filter input[type="range"] { width: 100%; min-width: 0; }
  .filter-acreage { min-width: 0; }
  /* Hide the desktop inline "Reset" link; the sheet has its own action row. */
  #filters-reset { display: none; }
  .filters-sheet-actions {
    display: flex;
    gap: 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 2;
  }
  .filters-sheet-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
  }
  .filters-sheet-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  .filters-sheet-btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
  .filters-sheet-btn.ghost { color: var(--text-soft); }
  /* Backdrop dims the map behind the sheet. */
  .filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1040;
    opacity: 1;
    transition: opacity 200ms ease;
  }
  .filters-backdrop[hidden] {
    opacity: 0;
    pointer-events: none;
  }
  [data-theme="dark"] .filters-backdrop { background: rgba(0, 0, 0, 0.55); }
  .filter select, .filter input[type="range"] { min-width: 120px; font-size: 14px; }

  .legend { font-size: 10.5px; padding: 8px 10px 6px; max-width: 180px; }
  .legend-title { font-size: 9px; }
  /* Detail-panel h3s tighten on phones (less section divider, tighter set). */
  .detail h3 { font-size: 10px; letter-spacing: 0.14em; padding-top: 14px; margin: 16px 0 6px; }
  .detail .d-section > summary > h3 { padding-top: 14px; margin: 16px 0 6px; }
  /* Persona buttons fit 3 per row at 375px instead of 2 + scroll. */
  .persona-btn { min-width: 96px; padding: 5px 8px; }
  .persona-label { font-size: 11.5px; }
  .persona-min { font-size: 10px; }
  /* Detail panel headline shrinks to match the topbar treatment. The
     bottom-sheet padding override lives on the `.detail` block below
     (this section reaches it through the cascade). */
  .detail h2 { font-size: 18px; }
  /* Acreage tick labels stay readable but don't overflow on narrow viewports. */
  .acreage-ticks-labels { font-size: 9px; }

  .site-footer { padding: 6px 12px; font-size: 10.5px; gap: 4px 10px; }
  /* Source list collapses behind a tappable "Sources" pill on phones. */
  .footer-sources-disclosure > .footer-sources-summary {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .footer-sources-disclosure > .footer-sources { display: none; }
  .footer-sources-disclosure[open] > .footer-sources {
    display: block;
    margin-top: 6px;
    width: 100%;
    line-height: 1.4;
  }

  /* Bottom-sheet detail panel — easier reach, doesn't block the map. */
  .detail {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 65vh;
    max-height: 78vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(0);
  }
  .detail[hidden] { transform: translateY(110%); }
  .detail::before {
    border-radius: 14px 14px 0 0;
  }
  .detail::after {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
    margin: -4px auto 10px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
  }
  .close { top: 14px; right: 10px; }
}

/* Tablet (641–1024) */
@media (min-width: 641px) and (max-width: 1024px) {
  .topbar-row { padding: 10px 16px; }
  .topbar .kpi { padding: 7px 16px; }
  .filters { padding: 10px 16px; }
  .hero { padding: 18px 16px 14px; }
}

/* ============================================================
   DC Candidates view
   ============================================================ */
#view-candidates.view.active {
  display: flex;
  flex-direction: column;
}
.candidates-header {
  flex-shrink: 0;
  padding: 10px 14px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.candidates-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cand-filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.cand-filter-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-right: 2px;
  white-space: nowrap;
}
.cand-filter {
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 80ms, border-color 80ms, color 80ms;
  touch-action: manipulation;
  white-space: nowrap;
}
.cand-filter:hover:not(.active) {
  border-color: var(--border-strong);
  color: var(--text);
}
.cand-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cand-filter-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
.candidates-stats {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
/* "How this ranking works" explainer — collapsed by default so it doesn't
   eat map/table real estate, but one click decodes the whole view. */
.cand-help {
  font-size: 12px;
  margin-top: 2px;
}
.cand-help > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  width: fit-content;
  list-style-position: inside;
}
.cand-help > summary:hover { text-decoration: underline; }
.cand-help-body {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: 6px;
  max-width: 70ch;
  line-height: 1.5;
}
.cand-help-body p { margin: 0 0 8px; }
.cand-help-body p:last-child { margin-bottom: 0; }
.cand-help-pos { color: var(--readiness-ready); font-weight: 600; }
.cand-help-neg { color: var(--program-superfund); font-weight: 600; }
#candidates-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  contain: layout paint;
}
#candidates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#candidates-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 1;
}
#candidates-table thead th.num { text-align: right; }
#candidates-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 90ms;
}
#candidates-table tbody tr:hover { background: var(--surface-2); }
#candidates-table tbody tr.selected { background: var(--accent-soft); }
[data-theme="dark"] #candidates-table tbody tr.selected { background: rgba(126, 182, 232, 0.12); }
#candidates-table td {
  padding: 8px 12px;
  vertical-align: middle;
  color: var(--text-soft);
}
#candidates-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cand-rank {
  color: var(--muted) !important;
  font-size: 11px;
  width: 36px;
}
.cand-name {
  color: var(--text) !important;
  font-weight: 500;
  max-width: 200px;
}
.cand-prog {
  display: block;
  margin-top: 3px;
}
.cand-score { white-space: nowrap; }
.cand-score .suit-score { font-size: 16px; font-weight: 800; }
.cand-plant {
  max-width: 180px;
  white-space: nowrap;
}
.cand-signals { white-space: nowrap; }

/* Signal badges — readiness and risk flags in the DC Candidates table */
.sig-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-right: 3px;
  white-space: nowrap;
}
.sig-badge.sig-oz {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.sig-badge.sig-ready {
  background: rgba(47, 122, 77, 0.1);
  color: var(--readiness-ready);
  border: 1px solid var(--readiness-ready);
}
.sig-badge.sig-dc {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.sig-badge.sig-flood {
  background: rgba(184, 51, 47, 0.1);
  color: var(--program-superfund);
  border: 1px solid var(--program-superfund);
}
.sig-badge.sig-grid {
  background: rgba(111, 54, 145, 0.1);
  color: var(--program-fuds);
  border: 1px solid var(--program-fuds);
}
[data-theme="dark"] .sig-badge.sig-ready { background: rgba(108, 193, 138, 0.12); }
[data-theme="dark"] .sig-badge.sig-flood { background: rgba(239, 80, 80, 0.12); }
[data-theme="dark"] .sig-badge.sig-grid  { background: rgba(180, 122, 216, 0.12); }
.sig-badge.sig-fedfast {
  background: rgba(196, 106, 20, 0.1);
  color: var(--program-brac);
  border: 1px solid var(--program-brac);
}
[data-theme="dark"] .sig-badge.sig-fedfast { background: rgba(230, 160, 64, 0.12); }
.sig-badge.sig-water {
  background: rgba(28, 94, 158, 0.1);
  color: var(--program-brownfield);
  border: 1px solid var(--program-brownfield);
}
[data-theme="dark"] .sig-badge.sig-water { background: rgba(126, 182, 232, 0.12); }
.sig-badge.sig-plant {
  background: rgba(139, 69, 19, 0.1);
  color: #7a3a0a;
  border: 1px solid #7a3a0a;
}
[data-theme="dark"] .sig-badge.sig-plant {
  background: rgba(210, 140, 60, 0.12);
  color: #d28c3c;
  border: 1px solid #d28c3c;
}
.pill.eo14318-pill {
  background: transparent;
  color: var(--program-brac);
  border: 1px solid var(--program-brac);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 9.5px;
  padding: 0 6px;
}
/* IRA energy community pill — clean-energy incentive, green to distinguish
   from the OZ pill's accent-blue. Stacks with OZ in the program-cell row. */
.pill.ira-pill {
  background: transparent;
  color: var(--readiness-ready);
  border: 1px solid var(--readiness-ready);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 9.5px;
  padding: 0 6px;
}
.sig-badge.sig-ira {
  background: rgba(47, 122, 77, 0.1);
  color: var(--readiness-ready);
  border: 1px solid var(--readiness-ready);
}
[data-theme="dark"] .sig-badge.sig-ira { background: rgba(108, 193, 138, 0.12); }
/* SWRAU "Land Ready" — the strongest public land-availability signal, so it
   gets a solid-fill green chip to stand out from the outline-green readiness
   badges (Clean / Reuse / IRA) rather than blending into them. */
.sig-badge.sig-land {
  background: var(--readiness-ready);
  color: #fff;
  border: 1px solid var(--readiness-ready);
}
[data-theme="dark"] .sig-badge.sig-land { color: #0d1b12; }
/* IRA "Yes" rendering in the detail-panel infra section — green ready token,
   same as OZ's #d-opp-zone.ready treatment. */
#d-energy-community.ready { color: var(--readiness-ready); font-weight: 500; }
#d-energy-community.ready a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cand-sentinel { height: 1px; }

/* Narrow screens: hide plant + gas columns */
@media (max-width: 768px) {
  #candidates-table th:nth-child(9),
  #candidates-table td:nth-child(9),
  #candidates-table th:nth-child(10),
  #candidates-table td:nth-child(10) { display: none; }
}

/* ----- About view ----- */
.about-view { overflow-y: auto; }
.about-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
/* Retired Sites stats view */
.retired-view { overflow: auto; }
.retired-wrap { max-width: 1000px; margin: 0 auto; padding: 28px 24px 64px; }
.retired-lead h2 { margin: 0 0 6px; font-family: var(--font-serif); font-size: 24px; }
.retired-lead p { margin: 0 0 20px; color: var(--text-soft); max-width: 70ch; line-height: 1.5; font-size: 13px; }
.retired-kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.retired-kpi {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2); border-radius: 8px; padding: 12px 18px; min-width: 120px;
}
.retired-kpi-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: #9a5b2e; }
[data-theme="dark"] .retired-kpi-num { color: #cf9b6a; }
.retired-kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.retired-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .retired-cols { grid-template-columns: 1fr; gap: 24px; } }
.retired-col h3 { margin: 0 0 10px; font-size: 14px; }
.retired-bars { display: flex; flex-direction: column; gap: 5px; }
.retired-bar-row { display: grid; grid-template-columns: 13em 1fr 3em; align-items: center; gap: 8px; font-size: 12px; }
.retired-bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.retired-bar-track { background: var(--surface-2); border-radius: 3px; height: 14px; overflow: hidden; }
.retired-bar-fill { display: block; height: 100%; background: #9a5b2e; border-radius: 3px; }
.retired-bar-fill.alt { background: var(--accent); }
[data-theme="dark"] .retired-bar-fill { background: #cf9b6a; }
.retired-bar-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-soft); }
.retired-foot { margin-top: 24px; font-size: 12px; line-height: 1.5; max-width: 70ch; }

/* ----- AP1000 reactor-siting view ----- */
.ap1000-view { overflow: auto; }
.ap1000-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.ap1000-lead h2 { margin: 0 0 6px; font-family: var(--font-serif); font-size: 24px; }
.ap1000-lead p { margin: 0 0 14px; color: var(--text-soft); max-width: 84ch; line-height: 1.55; font-size: 13px; }
.ap1000-export {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 12px;
  cursor: pointer; margin: 0 0 14px;
}
.ap1000-export:hover { border-color: var(--accent); }
.ap1000-export:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#export-csv[hidden] { display: none; }
.ap1000-janus-key { color: var(--suit-amber); font-weight: 600; white-space: nowrap; }
.ap1000-rflp-key { color: var(--accent); font-weight: 600; white-space: nowrap; }
.ap1000-flag-amber { color: var(--suit-amber); font-weight: 600; }
.ap1000-flag-red { color: var(--status-final); font-weight: 600; }
.ap1000-help { margin: 0 0 18px; font-size: 12.5px; }
.ap1000-help > summary { cursor: pointer; color: var(--accent); font-weight: 600; width: fit-content; }
.ap1000-help-body { margin-top: 8px; padding-left: 2px; max-width: 86ch; }
.ap1000-help-body p { margin: 0 0 8px; color: var(--text-soft); line-height: 1.55; }

.ap1000-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.ap1000-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ap1000-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--muted);
  text-align: left; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 9px 10px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.ap1000-table th.num, .ap1000-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ap1000-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ap1000-row { cursor: pointer; }
.ap1000-row:hover { background: var(--surface-2); }
.ap1000-row.ap1000-open { background: var(--surface-2); }
.ap1000-rank-cell { color: var(--muted); white-space: nowrap; }
/* The expand affordance is a real <button> (keyboard-focusable, aria-expanded),
   styled to read like the old rank cell. */
.ap1000-expand {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; margin: -2px -4px; padding: 2px 4px;
  font: inherit; color: var(--muted); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ap1000-expand:hover { color: var(--text); }
.ap1000-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
.ap1000-caret { display: inline-block; color: var(--muted); transition: transform 0.15s ease; }
.ap1000-row.ap1000-open .ap1000-caret { transform: rotate(90deg); }
.ap1000-name-cell { line-height: 1.25; }
.ap1000-name { display: block; font-weight: 600; color: var(--text); }
.ap1000-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.ap1000-janus { margin-left: 6px; color: var(--suit-amber); font-weight: 600; white-space: nowrap; }
.ap1000-rflp { margin-left: 6px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.ap1000-kvmi { white-space: nowrap; font-size: 12px; }
.ap1000-cell-src { display: block; margin-top: 2px; font-size: 10px; font-weight: 600; text-transform: none; }
.ap1000-workforce-cell { min-width: 180px; }
.ap1000-workforce-area { display: block; margin-top: 3px; color: var(--text-soft); font-size: 11px; line-height: 1.3; max-width: 24ch; }

.ap1000-score-cell { white-space: nowrap; }
.ap1000-score-chip {
  display: inline-block; min-width: 30px; text-align: center;
  padding: 3px 8px; border-radius: 6px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #fff;
}
.ap1000-tier-strong   { background: var(--readiness-ready); }
.ap1000-tier-moderate { background: var(--accent); }
.ap1000-tier-marginal { background: var(--suit-amber); }
.ap1000-tier-weak     { background: var(--muted); }

.ap1000-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; text-transform: capitalize;
  border: 1px solid transparent; white-space: nowrap;
}
.ap1000-tag.ok   { color: var(--readiness-ready); border-color: var(--readiness-ready); background: color-mix(in srgb, var(--readiness-ready) 12%, transparent); }
.ap1000-tag.warn { color: var(--suit-amber); border-color: var(--suit-amber); background: color-mix(in srgb, var(--suit-amber) 12%, transparent); }
.ap1000-tag.bad  { color: var(--status-final); border-color: var(--status-final); background: color-mix(in srgb, var(--status-final) 12%, transparent); }

.ap1000-flags-cell { font-size: 11px; line-height: 1.5; }
.ap1000-flag { white-space: nowrap; }
.ap1000-flag.warn { color: var(--suit-amber); }
.ap1000-flag.bad  { color: var(--status-final); }
.ap1000-flags-cell .muted-cell { color: var(--muted); font-style: italic; }

/* Expandable detail row */
.ap1000-detail[hidden] { display: none; }
.ap1000-detail > td { background: var(--surface-2); padding: 14px 16px 18px; }
.ap1000-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--border); margin-bottom: 10px; max-width: 640px; }
.ap1000-seg { display: block; min-width: 0; }
.ap1000-seg-water        { background: var(--accent); }
.ap1000-seg-acreage      { background: var(--readiness-ready); }
.ap1000-seg-transmission { background: var(--suit-amber); }
.ap1000-seg-substation   { background: var(--program-fuds); }
.ap1000-seg-workforce    { background: #3a8fa0; }
.ap1000-seg-fiber        { background: var(--muted); }
.ap1000-seg-rest         { background: transparent; }
.ap1000-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ap1000-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px; font-size: 11.5px;
}
.ap1000-chip-k { color: var(--muted); }
.ap1000-chip-v { font-weight: 700; font-variant-numeric: tabular-nums; }
.ap1000-chip-cap { color: var(--muted); font-weight: 400; }
.ap1000-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 0 0 6px; }
@media (max-width: 760px) { .ap1000-facts { grid-template-columns: 1fr; } }
.ap1000-facts > div { min-width: 0; }
.ap1000-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin-bottom: 3px; }
.ap1000-facts dd { margin: 0; font-size: 12.5px; line-height: 1.5; }
.ap1000-note { margin: 3px 0 0; color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.ap1000-siting { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; }
.ap1000-siting-label { color: var(--suit-amber); font-weight: 600; }
.ap1000-nuke { margin: 6px 0 0; font-size: 12px; line-height: 1.5; }

/* Grid context section */
.ap1000-grid-ctx { margin: 10px 0 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.ap1000-grid-summary { cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 7px 10px; background: var(--surface); user-select: none; list-style: none; }
.ap1000-grid-summary::-webkit-details-marker { display: none; }
.ap1000-grid-note { font-weight: 400; color: var(--muted); margin-left: 4px; }
.ap1000-grid-facts { margin: 0; padding: 10px 12px 12px; background: var(--surface); border-top: 1px solid var(--border); }
/* Active-plant badge (⚡): warm amber highlight */
.ap1000-grid-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 10px; margin: 2px 3px 0 0; white-space: nowrap; }
.ap1000-grid-badge.active { color: #7a5c00; background: color-mix(in srgb, #f0b429 20%, transparent); border: 1px solid color-mix(in srgb, #f0b429 50%, transparent); }
[data-theme="dark"] .ap1000-grid-badge.active { color: #f0c85a; background: color-mix(in srgb, #f0b429 18%, transparent); border-color: color-mix(in srgb, #f0b429 35%, transparent); }
/* Retired-plant badge (♻): teal/slate — stranded grid signal */
.ap1000-grid-badge.retired { color: #1a5a6e; background: color-mix(in srgb, #3a9cb8 15%, transparent); border: 1px solid color-mix(in srgb, #3a9cb8 40%, transparent); }
[data-theme="dark"] .ap1000-grid-badge.retired { color: #7ecfe8; background: color-mix(in srgb, #3a9cb8 15%, transparent); border-color: color-mix(in srgb, #3a9cb8 35%, transparent); }

/* ============================================================
   Civilian nuclear pipeline (Nuclear Siting tab, below the military
   screen) + the ⚛ map-marker popup. Reuses the .ap1000-table chrome so
   the two tables read as one view.
   ============================================================ */
.nuke-civ { margin-top: 28px; }
.nuke-civ h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.nuke-civ-lead {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 78ch;
  margin: 0 0 12px;
}
.nuke-civ-lead a { color: var(--accent); }
.nuke-civ-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.nuke-civ-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nuke-civ-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--muted);
  text-align: left; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 9px 10px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.nuke-civ-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.nuke-civ-table tbody tr:hover { background: var(--surface-2); }
.nuke-civ-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nuke-civ-name { font-weight: 600; color: var(--text); }
.nuke-civ-owner { color: var(--text-soft); max-width: 26ch; }
.nuke-civ-cat {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid currentColor;
}
.nuke-civ-cat.cat-ready    { color: var(--nuclear-ready); }
.nuke-civ-cat.cat-feasible { color: var(--nuclear-feasible); }
.nuke-civ-cat.cat-restart  { color: var(--nuclear-restart); }
.nuke-civ-map {
  border: 0; background: none; padding: 2px 4px; margin: -2px -4px;
  font: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--accent); cursor: pointer; white-space: nowrap;
  touch-action: manipulation; border-radius: 4px;
}
.nuke-civ-map:hover { text-decoration: underline; }
.nuke-civ-map:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nuke-civ-foot { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.nuke-civ-foot a { color: var(--accent); }

/* ⚛ popup extras — layered on the shared .ref-campus-popup chrome. */
.nuke-pop-cat { font-weight: 600; font-size: 11.5px; margin-bottom: 4px; }
.nuke-pop-cat.cat-ready    { color: var(--nuclear-ready); }
.nuke-pop-cat.cat-feasible { color: var(--nuclear-feasible); }
.nuke-pop-cat.cat-restart  { color: var(--nuclear-restart); }
.nuke-pop-near { margin-top: 6px; font-size: 11.5px; color: var(--text-soft); }
.nuke-pop-near strong { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.nuke-pop-near ul { margin: 3px 0 0; padding-left: 16px; }
.nuke-pop-near li { margin-bottom: 1px; }

.about-lead {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.about-lead h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
}
.about-lead p {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0;
  max-width: 680px;
  line-height: 1.6;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 48px;
}
.about-section h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.about-dl, .about-programs {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
}
.about-dl dt, .about-programs dt {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 12px 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.about-dl dt:first-child, .about-programs dt:first-child { margin-top: 0; }
.about-dl dd, .about-programs dd {
  grid-column: 1 / -1;
  margin: 0 0 0 0;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
}
.about-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.about-glyph {
  display: inline-block;
  width: 12px;
  text-align: center;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1;
}
.about-subhead {
  grid-column: 1 / -1;
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.about-sources { grid-column: 1 / -1; }
.about-source-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px 24px;
}
.about-source-list li {
  font-size: 13px;
  color: var(--text-soft);
}
.about-source-list a {
  color: var(--accent);
  text-decoration: none;
}
.about-source-list a:hover { text-decoration: underline; }
.about-note {
  font-size: 12px;
  color: var(--text-soft);
  margin: 0;
}
.about-note a { color: var(--accent); }
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-sources { grid-column: 1; }
  .about-wrap { padding: 20px 16px 48px; }
}

/* ACRES cleanup status in table STATUS column and detail panel */
.cleanup-status { font-size: 0.8rem; }
.cleanup-status.ready {
  color: var(--readiness-ready);
  font-weight: 500;
}

/* --- Sources & evidence (detail panel) -------------------------------------
   One row per claim: what published it, how it was derived, when it was
   pulled, and a link that resolves to this site at the source. Built lazily
   on first expand — see renderEvidence() in app.js. */
.evidence-intro {
  margin: 0 0 .6rem;
  font-size: .78rem;
  line-height: 1.45;
  color: var(--muted);
}
.evidence-group {
  margin: .85rem 0 .35rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.evidence-group:first-child { margin-top: 0; }
.evidence-row {
  padding: .5rem 0;
  border-top: 1px solid var(--border);
}
.evidence-label {
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .15rem;
}
.evidence-source { font-size: .78rem; }
.evidence-layer {
  font-size: .72rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-word;
}
.evidence-derivation {
  margin-top: .25rem;
  font-size: .76rem;
  line-height: 1.45;
  color: var(--muted);
}
.evidence-foot {
  margin-top: .3rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: baseline;
  font-size: .72rem;
}
.evidence-asof { color: var(--muted); font-variant-numeric: tabular-nums; }
.evidence-verify { color: var(--accent); text-decoration: none; }
.evidence-verify:hover { text-decoration: underline; }
.evidence-code {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: .8;
}
