/* Self-hosted variable fonts (latin subset, SIL OFL 1.1 — licences in /fonts/). No third-party font requests. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Daylight neutral defaults (metro dark/accent overrides live in engine/themes/<site_id>/theme.css) */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-hero: #0f172a;
  --bg-hero-mid: #1e293b;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #475569;
  --text-on-dark: #f8fafc;
  --text-on-dark-muted: #94a3b8;
  --accent-primary: #f59e0b;
  --accent-hover: #d97706;
  --accent-soft: #fef3c7;
  --accent-soft-text: #0f172a;
  --border-subtle: #e2e8f0;

  /* Unified Hero Slate-Navy & Rose daylight palette (no bright cobalt) */
  --link: #1e3a5f;
  --link-hover: #0f172a;
  --tone-low-text: #1e3a5f;
  --tone-low-bg: #edf2f7;
  --tone-mid-text: #475569;
  --tone-mid-bg: #f1f5f9;
  --tone-high-text: #be123c;
  --tone-high-bg: #fff1f2;

  /* Shared layout neutrals */
  --surface-subtle: #f1f5f9;
  --zebra: #f8fafc;
  --hover: #edf2f7;
  --control-border: #64748b;

  --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 112px; }
[id] { scroll-margin-top: 112px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--bg-hero); color: var(--text-on-dark);
  font-size: 0.85rem; padding: 8px 12px; z-index: 1200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Nocturnal Slate sticky header (hides on scroll down, reappears on scroll up) */
.site-header {
  position: sticky; top: 0; z-index: 1100;
  background: var(--bg-hero); color: var(--text-on-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0;
}
.site-header.is-hidden { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.header-inner, .container, .footer-inner, .hero-inner {
  max-width: 1080px; margin: 0 auto; padding-left: 20px; padding-right: 20px;
}
.header-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.brand-link {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: #ffffff;
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.03em;
}
.brand-link:hover { color: #ffffff; text-decoration: none; }
.brand-mark-svg { display: block; width: 36px; height: 36px; flex-shrink: 0; }
.brand-wordmark { display: inline-flex; align-items: baseline; gap: 2px; }
.brand-accent { color: var(--accent-primary); }
.site-header :focus-visible { outline-color: var(--accent-primary); }
.nav-toggle {
  display: none; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid rgba(248, 250, 252, 0.3); border-radius: 6px;
  background: transparent; color: var(--text-on-dark);
  font-size: 0.86rem; font-weight: 600; cursor: pointer;
}
.nav-toggle:hover { background: rgba(248, 250, 252, 0.1); }
.nav-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 0.87rem; }
.nav-links a { color: var(--text-on-dark-muted); text-decoration: none; font-weight: 500; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text-on-dark); }

.container { flex: 1 0 auto; width: 100%; padding: 28px 20px 56px; }
h1 { margin: 0 0 10px; font-size: 2rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.025em; }
h2 {
  margin: 36px 0 14px; font-size: 1.32rem; font-weight: 700; color: var(--text-primary);
  position: relative; padding-top: 10px; letter-spacing: -0.015em;
}
h2::before {
  content: ""; position: absolute; top: 0; left: 0; width: 36px; height: 3px;
  border-radius: 2px; background: var(--accent-primary);
}
.lead { margin: 0 0 14px; color: var(--text-secondary); font-size: 0.98rem; max-width: 72ch; }
.town-intro-blurb {
  max-width: 74ch;
  margin: 0.75rem 0 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.context-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
.context-card p { margin: 0; max-width: 78ch; }
.breadcrumb { margin: 0 0 12px; color: var(--text-muted); font-size: 0.84rem; }
.breadcrumb a { color: var(--link); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }

/* Deterministic editorial summary callout */
.editorial-summary-card, .lede {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 16px 0 20px;
  color: var(--text-primary);
  font-size: 0.96rem;
  line-height: 1.55;
}
.editorial-summary-card p { margin: 0; }

/* Subtle daylight band */
.band-tint {
  background: var(--surface-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin: 24px -20px;
  padding: 22px 20px 26px;
}
.band-tint h2 { margin-top: 0; }

/* Crisp daylight KPI cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
  margin: 14px 0 22px;
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.card .metric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
.card .metric-unit { font-family: var(--font-ui); font-size: 0.86rem; font-weight: 500; color: var(--text-muted); }
.card .label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 600; margin-bottom: 6px; }
.card .sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.card .delta { display: inline-block; font-size: 0.76rem; font-weight: 600; margin-top: 6px; padding: 2px 7px; border-radius: 999px; }
.card a { font-size: 0.86rem; font-weight: 600; text-decoration: none; }
.card a:hover { text-decoration: underline; }

.tone-low { color: var(--tone-low-text) !important; }
.tone-mid { color: var(--tone-mid-text) !important; }
.tone-high { color: var(--tone-high-text) !important; }
.delta.tone-low { background: var(--tone-low-bg); }
.delta.tone-mid { background: var(--tone-mid-bg); }
.delta.tone-high { background: var(--tone-high-bg); }

/* Nocturnal Slate footer */
.site-footer {
  background: var(--bg-hero); color: var(--text-on-dark-muted);
  margin-top: 48px; padding: 26px 0 34px; font-size: 0.82rem; text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.site-footer a { color: var(--text-on-dark); }
.site-footer a:hover { color: var(--accent-primary); }
.site-footer :focus-visible { outline-color: var(--accent-primary); }

/* Full-bleed Nocturnal Slate Hero Banner & opt-in ad preview wireframe */
.hero-banner {
  position: relative;
  z-index: 40;
  overflow: visible;
  background: linear-gradient(180deg, #0b111e 0%, #10192b 58%, #1a273d 100%);
  color: var(--text-on-dark);
  border-bottom: 2px solid #1e293b;
  padding: 3.5rem 0 0;
  text-align: center;
}
.hero-banner :focus-visible { outline-color: var(--accent-primary); }
.hero-copy { max-width: 720px; margin: 0 auto; position: relative; z-index: 50; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-on-dark-muted);
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.hero-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-primary);
}
.hero-banner h1 {
  margin: 0 auto 14px;
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 18ch;
}
.text-accent { color: var(--accent-primary); }
.hero-subline {
  margin: 0 auto 24px;
  color: var(--text-on-dark-muted);
  font-size: 1rem;
  max-width: 58ch;
}
.hero-search { position: relative; z-index: 60; max-width: 500px; margin: 0 auto; }
.hero-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 14px;
  border: 1px solid rgba(248, 250, 252, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
}
.hero-search-bar:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22); }
.hero-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 0.94rem;
}
.hero-search input::placeholder { color: var(--text-on-dark-muted); }
.hero-search input:focus { outline: none; }
.hero-search-btn {
  padding: 9px 18px;
  border: none;
  border-radius: 7px;
  background: var(--accent-primary);
  color: var(--bg-hero);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.hero-search-btn:hover { background: var(--accent-hover); }
.hero-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 500;
  list-style: none; margin: 0; padding: 6px; text-align: left;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: 8px; box-shadow: 0 16px 36px rgba(15, 23, 42, 0.45);
}
.hero-search-results a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; border-radius: 6px; text-decoration: none;
  color: var(--text-primary); font-size: 0.9rem; font-weight: 600;
}
.hero-search-results a span { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; }
.hero-search-results a:hover, .hero-search-results a:focus-visible,
.hero-search-results li[aria-selected="true"] a { background: var(--hover); color: var(--link); }
.hero-popular {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px; margin-top: 14px; font-size: 0.8rem; color: var(--text-on-dark-muted);
}
.hero-popular a {
  padding: 3px 10px; border-radius: 5px;
  background: rgba(30, 41, 59, 0.75); border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-on-dark); text-decoration: none; font-weight: 500;
}
.hero-popular a:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.hero-visual { width: 100%; max-width: 1140px; margin: 3rem auto 0; padding: 0 1rem; line-height: 0; position: relative; z-index: 1; }
.hero-skyline-svg { display: block; width: 100%; height: auto; margin: 0 auto; }

/* Ad slots (hidden when empty in production; wireframe preview on ?preview_ads=1) */
.ad-slot {
  min-height: 90px; margin: 24px auto; width: 100%; max-width: 728px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.78rem;
}
.ad-slot:empty { display: none; }
.ad-slot[data-slot="mid-rectangle"] { min-height: 250px; }
html[data-preview-ads="1"] .ad-slot:empty {
  display: flex; flex-direction: column; gap: 2px;
  background: repeating-linear-gradient(-45deg, var(--surface-subtle), var(--surface-subtle) 8px, var(--bg-surface) 8px, var(--bg-surface) 16px);
  border: 1.5px dashed var(--link); border-radius: 6px;
  color: var(--link); text-align: center; padding: 12px;
}
html[data-preview-ads="1"] .ad-slot[data-slot="top-banner"]:empty::before { content: "ADVERTISEMENT · top-banner (728×90 desktop / 320×100 mobile)"; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em; }
html[data-preview-ads="1"] .ad-slot[data-slot="mid-rectangle"]:empty::before { content: "ADVERTISEMENT · mid-rectangle (336×280 / 300×250)"; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em; }
html[data-preview-ads="1"] .ad-slot[data-slot="bottom-banner"]:empty::before { content: "ADVERTISEMENT · bottom-banner (728×90 desktop / 320×100 mobile)"; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em; }
.ad-preview-pill {
  position: fixed; right: 16px; bottom: 16px; z-index: 1250;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px;
  border-radius: 999px; background: var(--bg-hero); color: var(--text-on-dark);
  font-size: 0.78rem; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.3);
}
.ad-preview-pill button {
  background: transparent; border: 1px solid rgba(248, 250, 252, 0.45);
  border-radius: 999px; color: var(--text-on-dark); font: inherit; padding: 2px 8px; cursor: pointer;
}

/* Glassmorphic sticky jump-nav (clears sticky header when visible) */
.jump-nav {
  position: sticky;
  top: 61px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 20px;
  margin: 0 -20px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  transition: top 240ms ease-out;
}
body.header-hidden .jump-nav { top: 0; }
.jump-nav a { color: var(--text-secondary); text-decoration: none; font-weight: 600; }
.jump-nav a:hover, .jump-nav a:focus-visible { color: var(--link); text-decoration: underline; }

/* Controls & tabular data tables */
.controls { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 0 14px; }
.controls input, .controls select {
  padding: 8px 12px; border: 1px solid var(--control-border); border-radius: 6px;
  font-family: var(--font-ui); font-size: 0.88rem; color: var(--text-primary); background: var(--bg-surface);
}
.controls input[type="search"] { flex: 1 1 220px; }

.table-wrap {
  overflow-x: auto; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
th {
  background: var(--surface-subtle); font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-secondary); white-space: nowrap;
}
tbody tr:nth-child(even) { background: var(--zebra); }
tbody tr:hover { background: var(--hover); }
tr:last-child td { border-bottom: none; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.86rem; white-space: nowrap; }
.bold { font-weight: 600; }
.station-sub { display: block; font-family: var(--font-ui); font-size: 0.76rem; color: var(--text-muted); font-weight: 400; white-space: normal; }

/* Inline SVG range bullet */
.range-bullet-svg { display: block; width: 120px; height: 16px; }
.bullet-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 0; font-size: 0.8rem; color: var(--text-muted); }
.bullet-dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; margin-right: 5px; vertical-align: middle; }

.county-chip { color: var(--text-secondary); font-size: 0.86rem; font-weight: 500; text-decoration: none; }
.county-chip:hover { color: var(--link); text-decoration: underline; }

/* Partial-data asterisk, footnote & notices */
.est-mark {
  display: inline-block; margin-left: 2px; padding: 0 3px; border: none; background: transparent;
  color: var(--text-muted); font-size: 0.9rem; font-weight: 700; line-height: 1; cursor: pointer; vertical-align: super;
}
.est-mark:hover, .est-mark:focus-visible { color: var(--accent-hover); }
.table-footnote { margin: 8px 0 0; font-size: 0.82rem; color: var(--text-muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.badge-warn { background: var(--status-warn-bg); color: var(--status-warn-text); }
.notice { display: block; padding: 12px 16px; border-radius: 6px; font-size: 0.88rem; margin: 14px 0 20px; }
.notice-warn { background: var(--status-warn-bg); color: var(--status-warn-text); border-left: 4px solid var(--accent-primary); }

/* Editorial notes & 12px comparison bars */
.notes-list { margin: 12px 0 22px; padding-left: 20px; max-width: 72ch; color: var(--text-secondary); }
.notes-list li { margin-bottom: 6px; }
.bar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; margin: 16px 0 6px; }
.bar-group h3 { margin: 0 0 10px; font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }
.bar-row { display: grid; grid-template-columns: 152px 1fr 56px; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.84rem; }
.bar-label { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; background: var(--border-subtle); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: var(--w, 0%); background: var(--tone-low-text); border-radius: 999px; }
.bar-fill.bar-mid { background: var(--tone-mid-text); }
.bar-fill.bar-high { background: var(--tone-high-text); }
.bar-fill.bar-county { background: #94a3b8; }
.bar-fill.bar-state { background: #64748b; }
.bar-val { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }

/* Tooltips */
.info-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-left: 4px; padding: 0;
  border: 1px solid var(--control-border); border-radius: 999px;
  background: var(--bg-surface); color: var(--text-muted);
  font-size: 0.74rem; font-weight: 700; line-height: 1; cursor: pointer; vertical-align: middle;
}
.info-tip:hover, .info-tip:focus-visible { border-color: var(--link); color: var(--link); background: var(--hover); }
.tip-popover {
  position: fixed; z-index: 1200; max-width: 280px; padding: 10px 12px; border-radius: 6px;
  background: var(--bg-hero); color: var(--text-on-dark);
  font-size: 0.82rem; line-height: 1.45; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
}

/* Interactive 2-dropdown comparison tool */
.compare-tool {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: 16px 18px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: 8px;
}
.compare-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 220px; min-width: 0; }
.compare-field label { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.compare-field select {
  width: 100%; max-width: 100%; min-width: 0;
  padding: 9px 12px; border: 1px solid var(--control-border); border-radius: 6px;
  font-family: var(--font-ui); font-size: 0.9rem; color: var(--text-primary); background: var(--bg-surface);
}
.compare-vs { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); padding-bottom: 10px; }
.compare-btn {
  padding: 10px 22px; border: none; border-radius: 6px;
  background: var(--link); color: #ffffff;
  font-family: var(--font-ui); font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.compare-btn:hover { background: var(--link-hover); }
.compare-output { margin-top: 16px; }

/* 2-column comparison list */
.pill-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; margin-top: 8px; }
.pill-link {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 6px;
  border-bottom: 1px solid var(--border-subtle); color: var(--link);
  text-decoration: none; font-size: 0.9rem; font-weight: 600;
}
.pill-link:hover { background: var(--hover); color: var(--link-hover); }

/* Map & 3-layer switcher */
.map-section { margin: 20px 0 28px; }
.map-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.map-header h2 { margin: 0; }
.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.map-toggle { display: inline-flex; border: 1px solid var(--control-border); border-radius: 6px; overflow: hidden; background: var(--bg-surface); }
.map-toggle button {
  padding: 7px 14px; border: none; border-right: 1px solid var(--border-subtle);
  background: transparent; color: var(--text-secondary);
  font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.map-toggle button:last-child { border-right: none; }
.map-toggle button[aria-pressed="true"] {
  background: var(--link); color: #ffffff;
}
.map-toggle button[aria-pressed="true"]::before { content: "✓ "; }
.map-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: var(--text-muted); }
.map-legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--text-muted); }
.safety-map { position: relative; z-index: 1; isolation: isolate; width: 100%; height: 540px; border: 1px solid var(--border-subtle); border-radius: 8px; background: #e8eef5; }
.safety-map .leaflet-interactive { cursor: pointer; }
.map-county-label {
  pointer-events: none; text-align: center;
  font-family: var(--font-ui); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.55); text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}
.map-city-pin { pointer-events: none; text-align: center; }
.map-city-pin span {
  display: inline-block; padding: 2px 7px; border-radius: 999px;
  background: var(--bg-hero); color: var(--accent-primary);
  font-family: var(--font-ui); font-size: 0.7rem; font-weight: 700; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.cell-label { display: none; }

/* Subtle motion & scroll-reveal (WCAG 2.3.3) */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes growBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .reveal { opacity: 0; transform: translateY(10px); transition: opacity 380ms ease-out, transform 380ms ease-out; }
  .reveal.is-visible { opacity: 1; transform: none; }
  .site-header { transition: transform 240ms ease-out, opacity 240ms ease-out; }
  .bar-fill { transform-origin: left center; transition: transform 820ms cubic-bezier(0.22, 1, 0.36, 1) 140ms; }
  .reveal:not(.is-visible) .bar-fill { transform: scaleX(0); }
  .reveal.is-visible .bar-fill { transform: scaleX(1); }
  a, tbody tr, .pill-link, .info-tip, .est-mark, .nav-toggle, .map-toggle button {
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
  }
  .tip-popover:not([hidden]) { animation: fadeIn 120ms ease-out both; }
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero-copy { padding-bottom: 12px; }
  .hero-visual { margin: 0 -20px; }
  .hero-banner h1 { font-size: 1.85rem; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; flex-direction: column; gap: 0; width: 100%;
    padding-top: 10px; border-top: 1px solid rgba(248, 250, 252, 0.16);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 10px 0; border-bottom: 1px solid rgba(248, 250, 252, 0.08); }
  .nav-links a:last-child { border-bottom: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.55rem; }
  .safety-map { height: 380px; }
  .band-tint { margin: 18px -20px; padding: 18px 20px; }
  .grid-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .card { padding: 12px 14px; }
  .pill-list { grid-template-columns: 1fr; }
  .table-wrap { overflow: visible; }
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); padding: 14px 16px; }
  tbody tr:nth-child(even) { background: var(--zebra); }
  tbody tr:last-child { border-bottom: none; }
  tbody td { border: none; padding: 4px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  tbody td.num { white-space: normal; text-align: right; }
  tbody td .cell-label { display: inline; font-family: var(--font-ui); font-size: 0.78rem; font-weight: 500; color: var(--text-muted); }
  tbody td.cell-primary { display: block; padding: 0 0 8px; margin-bottom: 4px; }
  tbody td.cell-primary .cell-label { display: none; }
}
@media (max-width: 359px) {
  /* Two KPI cards side by side don't fit large figures below 360px (WCAG 1.4.10 reflow at 320px). */
  .grid-cards { grid-template-columns: minmax(0, 1fr); }
}

/* Metro-isolated overrides for phlburbs.com (daylight neutrals stay in base.css) */
:root[data-site="phlburbs"] {
  --bg-hero: #0f172a;
  --bg-hero-mid: #1e293b;
  --accent-primary: #f59e0b;
  --accent-hover: #d97706;
  --accent-soft: #fef3c7;
  --accent-soft-text: #0f172a;
  --skyline-tower-dark: #1e293b;
  --skyline-tower-mid: #334155;
  --skyline-window-lit: #fbbf24;
}
