  /* ── Page-level overrides over tokens.css ─────────────────────── */
  :root {
    --font-sans: "Cabin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }

  /* density ramp — set on body via Tweak */
  body[data-density="compact"]    { --d-pad: 14px; --d-gap: 12px; --d-row: 10px; --d-card-pad: 14px; }
  body[data-density="comfortable"]{ --d-pad: 22px; --d-gap: 18px; --d-row: 16px; --d-card-pad: 20px; }
  body[data-density="spacious"]   { --d-pad: 32px; --d-gap: 28px; --d-row: 24px; --d-card-pad: 28px; }

  /* accent — Tweak overrides --accent and --accent-faint */
  /* default already from tokens.css (blue-500) */

  html, body { margin: 0; padding: 0; }
  body {
    font-family: var(--font-sans);
    background: var(--bg-canvas);
    color: var(--fg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  .theme-light { color-scheme: light; }
  .theme-dark  { color-scheme: dark; }

  *, *::before, *::after { box-sizing: border-box; }
  a { color: var(--accent); text-decoration: none; }
  a:hover { color: var(--accent-hover); }

  .container { max-width: 1240px; margin: 0 auto; padding: 0 var(--d-pad, 22px); }

  /* ── Header ───────────────────────────────────────────────────── */
  .site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    /* z-index 2000 keeps the sticky chrome above Leaflet's internal stack
       (Leaflet controls live around 1000, popups around 700). */
    position: sticky; top: 0; z-index: 2000;
  }
  .site-header .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    height: 76px;
  }
  .brand-mark {
    display: flex; align-items: center; gap: 10px;
    color: var(--fg-strong);
  }
  .brand-mark .glyph {
    width: 28px; height: 28px; border-radius: 7px;
    background: var(--fg-strong);
    color: var(--bg-surface);
    display: grid; place-items: center;
    font-weight: 700; font-size: 13px;
  }
  .brand-mark .wordmark {
    font-family: var(--font-sans);
    font-weight: 700; font-size: 15px;
    letter-spacing: -0.01em;
    color: var(--fg-strong);
  }
  .brand-mark .wordmark em {
    font-style: normal; font-weight: 400;
    color: var(--fg-muted); margin-left: 2px;
  }

  .header-search {
    position: relative; max-width: 480px; width: 100%; justify-self: center;
  }
  .header-search input {
    width: 100%; height: 36px;
    padding: 0 12px 0 36px;
    background: var(--bg-inset);
    border: 1px solid var(--blue-800);
    border-radius: 8px;
    color: var(--fg-strong);
    font-family: var(--font-sans); font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
  }
  .header-search input::placeholder { color: var(--fg-muted); }
  /* clear the placeholder as soon as the field is focused/clicked */
  .header-search input:focus::placeholder { color: transparent; }
  .header-search input:focus {
    border-color: var(--accent);
    box-shadow: var(--ring-focus);
  }
  .header-search .lucide-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--fg-muted); pointer-events: none;
  }
  .header-search kbd {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    padding: 2px 6px; border: 1px solid var(--border-default); border-radius: 4px;
    background: var(--bg-surface); color: var(--fg-muted);
  }

  /* ── Header search dropdown (#up-results) ─────────────────────── */
  .up-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: var(--shadow-dropdown-light);
    max-height: 360px;
    overflow-y: auto;
    z-index: 200;
    display: none;
  }
  .up-results.open { display: block; }
  .up-results__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
  }
  .up-results__item:last-child { border-bottom: none; }
  .up-results__item:hover,
  .up-results__item.is-active {
    background: var(--bg-hover);
    color: var(--fg-strong);
  }
  .up-results__name {
    font-weight: 600;
    color: var(--fg-strong);
  }
  .up-results__sep {
    color: var(--fg-faint);
    font-family: var(--font-mono);
  }
  .up-results__meta {
    color: var(--fg-muted);
  }
  .up-results__empty {
    padding: 14px;
    font-size: 13px;
    color: var(--fg-muted);
    text-align: center;
  }

  .site-nav {
    display: flex; gap: 4px; align-items: center;
  }
  .site-nav a {
    color: var(--fg);
    font-size: 14px; font-weight: 500;
    padding: 6px 10px; border-radius: 6px;
    transition: background .1s, color .1s;
  }
  .site-nav a:hover { background: var(--bg-hover); color: var(--fg-strong); }
  .site-nav .pkg-cta {
    background: var(--accent); color: #fff;
    padding: 7px 12px; margin-left: 6px;
    font-weight: 600;
  }
  .site-nav .pkg-cta:hover { background: var(--accent-hover); color: #fff; }

  /* ── Breadcrumb strip ────────────────────────────────────────── */
  .crumbs {
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border-default);
    padding: 9px 0;
    font-size: 14px; color: var(--fg-muted);
    /* Above Leaflet content so the breadcrumb strip never disappears
       behind map markers when scrolling near a sticky map. */
    position: relative; z-index: 1900;
  }
  .crumbs .container { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .crumbs a { color: var(--fg-muted); }
  .crumbs a:hover { color: var(--fg-strong); }
  .crumbs .sep { opacity: .4; }
  .crumbs .here { color: var(--fg-strong); font-weight: 600; }

  /* ── HERO ─────────────────────────────────────────────────────── */
  .hero {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    padding: 12px 0 12px;
  }
  .hero .container { display: grid; gap: 6px; }
  .hero-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: center;
  }
  .hero-eyebrow {
    display: flex; gap: 8px; align-items: center;
    font-family: var(--font-mono);
    /* 12px — smaller than the 14px breadcrumbs, larger than the 11px design package default. */
    font-size: 12px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--fg-muted);
    margin-bottom: 4px;
  }
  .hero-eyebrow .badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    background: var(--bg-active-chip);
    color: var(--bg-active-chip-text);
    border-radius: 4px;
    font-size: 12px; letter-spacing: 0.06em;
  }
  .hero-name {
    font-family: var(--font-sans);
    font-size: 36px; font-weight: 700;
    letter-spacing: -0.02em; line-height: 1;
    color: var(--fg-strong);
    margin: 0;
  }
  .hero-name em {
    font-style: normal; font-weight: 400;
    color: var(--fg-muted);
    font-size: 0.7em;
    margin-left: 4px;
  }
  .hero-sub {
    margin-top: 2px;
    font-size: 14px; color: var(--fg-muted);
    display: flex; gap: 14px; flex-wrap: wrap;
    align-items: center;
  }
  .hero-sub .pip {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--fg-faint);
  }
  .hero-actions { display: flex; gap: 8px; }
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 14px;
    font-family: var(--font-sans); font-size: 13px; font-weight: 600;
    border-radius: 7px; border: 1px solid var(--border-default);
    background: var(--bg-surface); color: var(--fg-strong);
    cursor: pointer; transition: background .1s, border-color .1s, color .1s;
  }
  .btn:hover { background: var(--bg-hover); }
  .btn-primary { background: var(--accent); color: #fff; border-color: transparent; }
  .btn-primary:hover { background: var(--accent-hover); color: #fff; }
  .btn .lucide-icon { width: 14px; height: 14px; }

  /* ── Stats strip ──────────────────────────────────────────────── */
  .stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-surface);
  }
  .stat {
    padding: 14px 16px;
    border-right: 1px solid var(--border-default);
    position: relative;
    background: var(--bg-surface);
  }
  .stat:last-child { border-right: none; }
  /* Source line as a full-width footer row inside the white stats grid */
  .stats > .card-source { grid-column: 1 / -1; margin-top: 0; }
  .stat-label {
    display: flex; gap: 6px; align-items: center;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--fg-muted); margin-bottom: 8px;
  }
  .stat-label .lucide-icon { width: 12px; height: 12px; }
  .stat-val {
    font-family: var(--font-sans);
    font-size: 24px; font-weight: 700;
    color: var(--fg-strong);
    letter-spacing: -0.01em;
    line-height: 1;
  }
  .stat-meta {
    margin-top: 6px;
    font-size: 11px; color: var(--fg-muted);
    display: flex; align-items: center; gap: 4px;
  }
  .stat-meta .delta-up   { color: var(--green-600); }
  .stat-meta .delta-down { color: var(--red-600); }
  .stat-spark { margin-top: 8px; height: 24px; }

  /* ── At-a-glance 3D terrain map ──────────────────────────────── */
  .glance {
    margin-top: var(--d-row);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  }
  .glance-map {
    width: 100%;
    height: 460px;
    background: var(--bg-inset);
  }
  .glance-map .maplibregl-ctrl-attrib { font-family: var(--font-sans); font-size: 10px; }

  /* Overlay panels on the map */
  .glance-overlay-tl {
    position: absolute; top: 16px; left: 16px; z-index: 5;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--fg-strong);
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    max-width: 360px;
  }
  .glance-eyebrow {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--fg-muted); margin-bottom: 8px;
  }
  .glance-eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--green-600);
    box-shadow: 0 0 0 3px rgba(22,163,74,.18);
    animation: glance-pulse 1.6s ease-in-out infinite;
  }
  @keyframes glance-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
  .glance-title {
    font-size: 18px; font-weight: 700;
    color: var(--fg-strong); margin-bottom: 6px;
    letter-spacing: -0.01em;
    font-family: var(--font-sans);
  }
  .glance-desc {
    font-size: 12.5px; color: var(--fg-muted); line-height: 1.55;
  }

  /* Bottom-left status chip */
  .glance-status {
    position: absolute; bottom: 16px; left: 16px; z-index: 5;
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    color: var(--fg-strong);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 6px 11px;
    border-radius: 20px;
    border: 1px solid var(--border-default);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  }
  .glance-status .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--green-600);
    animation: glance-pulse 1.4s infinite;
  }

  /* Bottom-right controls */
  .glance-controls {
    position: absolute; bottom: 16px; right: 16px; z-index: 5;
    display: flex; gap: 8px;
  }
  .glance-btn {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-default);
    color: var(--fg-strong);
    font-family: var(--font-sans);
    font-size: 12px; font-weight: 500;
    padding: 7px 13px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    transition: background 0.15s, transform 0.15s;
  }
  .glance-btn:hover { background: #fff; border-color: var(--accent); }
  .glance-btn .lucide-icon { width: 13px; height: 13px; }

  /* Top-right legend (positioned below MapLibre nav controls) */
  .glance-legend {
    position: absolute; top: 145px; right: 16px; z-index: 6;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    color: var(--fg-strong);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    font-family: var(--font-sans);
    font-size: 11px;
  }
  .glance-legend-title {
    font-family: var(--font-mono);
    font-size: 9px; letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin-bottom: 6px;
  }
  .glance-legend-row {
    display: flex; align-items: center; gap: 7px;
    padding: 2px 0;
    color: var(--fg);
  }
  .glance-legend-row .swatch {
    width: 10px; height: 10px; border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25);
  }

  /* Hide previous left/right column rules — kept names so legacy CSS does not collide */
  .glance-left, .glance-right { display: none; }

  /* ── Section header ──────────────────────────────────────────── */
  .section-head {
    display: flex; align-items: baseline; gap: 12px;
    margin: 28px 0 14px;
    padding: 0;
  }
  .section-head h2 {
    font-family: var(--font-sans);
    font-size: 18px; font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fg-strong);
    margin: 0;
  }
  .section-head .count {
    font-family: var(--font-mono);
    font-size: 11px; color: var(--fg-muted);
    font-weight: 500;
  }
  .section-head .link {
    margin-left: auto;
    font-size: 12px; font-weight: 600; color: var(--accent);
    display: inline-flex; align-items: center; gap: 4px;
  }
  .section-head .link .lucide-icon { width: 13px; height: 13px; }

  /* ── Layout grid ─────────────────────────────────────────────── */
  .page { padding: 0 0 56px; }
  .page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: var(--d-gap);
    align-items: start;
  }
  .data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--d-gap);
  }
  .data-grid > .span-full { grid-column: 1 / -1; }
  .data-grid > .span-2of3 { grid-column: span 1; }

  /* ── Card ─────────────────────────────────────────────────────── */
  .card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: var(--d-card-pad);
    position: relative;
    transition: border-color .15s;
  }
  .card[hidden-by-tweak] { display: none; }

  .card-header {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 14px;
  }
  .card-title {
    font-size: 14px; font-weight: 700;
    color: var(--fg-strong);
    line-height: 1.3;
    letter-spacing: -0.005em;
  }
  .card-title .qual {
    font-weight: 400; color: var(--fg-muted); font-size: 13px;
  }
  .card-sub {
    font-size: 12px; color: var(--fg-muted);
    margin-top: 2px;
  }
  .card-tag {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 500;
    padding: 3px 7px; border-radius: 4px;
    background: var(--bg-inset);
    color: var(--fg-muted);
    border: 1px solid var(--border-default);
    text-transform: uppercase; letter-spacing: 0.06em;
    white-space: nowrap;
  }
  .card-source {
    margin-top: 12px;
    padding: 10px 18px 9px;
    border-top: 1px dashed var(--border-default);
    font-family: var(--font-mono);
    font-size: 10px; color: var(--fg-muted);
    letter-spacing: 0.02em;
    display: flex; align-items: center; gap: 6px;
  }
  .card-source .lucide-icon { width: 11px; height: 11px; }

  .card-figure { margin: 0; }
  .card-figure svg { display: block; width: 100%; height: auto; overflow: visible; }
  .card-figure .legend {
    display: flex; flex-wrap: wrap; gap: 12px 18px;
    margin-top: 10px; font-size: 12px; color: var(--fg);
  }
  .card-figure .legend > span { display: inline-flex; align-items: center; gap: 6px; }
  .card-figure .legend .swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

  .callout {
    display: flex; align-items: flex-start; gap: 8px;
    margin-top: 12px; padding: 10px 12px;
    background: var(--bg-inset);
    border-left: 2px solid var(--accent);
    border-radius: 0 6px 6px 0;
    font-size: 12px; color: var(--fg);
    line-height: 1.5;
  }
  .callout .lucide-icon { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
  .callout strong { color: var(--fg-strong); font-weight: 700; }

  /* ── Community-page data card framework ───────────────────────────
     Shared by every community subpage (overview, government, education,
     compare, nearby). Lifted here from the per-template <style> blocks
     2026-05-15 per CSS_CONSOLIDATION.md.

     The `var(--navy)`, `var(--white)`, etc. tokens come from the
     `.community-page` legacy compatibility shim defined inline in each
     template — once `tokens.css` absorbs those vars, this section is
     fully canonical. Until then, every page that uses .data-card MUST
     wrap its content in `<div class="community-page">`. */

  /* — Tier 1 — base card shell — */
  .data-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
  /* Anchored cards (id="…") get extra scroll-margin so their header
     clears the ~76px sticky page-nav when jumped to via #fragment.
     Wired by the rail's per-page section sub-nav (scroll-spy). */
  .data-card[id] { scroll-margin-top: 100px; }
  .data-card-header { padding: 14px 18px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
  .data-card-header svg { width: 16px; height: 16px; color: var(--navy); flex-shrink: 0; }
  .data-card-header h2 { font-family: 'Varela Round', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); margin: 0; letter-spacing: -0.005em; }
  .data-card-body { padding: 20px 22px; }

  /* — Tier 2 — KPI strip (big number + small label, repeated horizontally) — */
  .kpi-strip { display: flex; gap: 32px; margin-bottom: 22px; flex-wrap: wrap; }
  .kpi { display: flex; flex-direction: column; gap: 2px; }
  .kpi-value { font-family: 'Cabin', sans-serif; font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1; }
  .kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
  @media (max-width: 640px) {
    .kpi-value { font-size: 22px; }
  }

  /* — Tier 3a — page content wrapper inside .community-page — */
  .page-content { max-width: 1200px; margin: 0 auto; padding: 18px 24px 64px; }
  @media (max-width: 640px) { .page-content { padding: 14px 16px 48px; } }

  /* — Tier 3b — italic source/caveat line under charts.
     Tightened spacing (6/8) chosen as canonical so cards stay compact.
     Government cards inherit this tightening when their pages are
     re-checked; loosen per-card via scoped override if needed. — */
  .caveat-note {
    font-size: 12px; color: var(--muted); font-style: italic;
    line-height: 1.5;
    margin: 6px 22px 0;
    padding: 8px 0 12px;
    border-top: 1px solid var(--border);
  }

  /* — Tier 3c — pending-data placeholder card — */
  .pending-card { background: var(--white); border: 1px dashed var(--border); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px; }
  .pending-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin: 0; }
  .pending-label svg { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }

  /* — Tier 3d — disambiguation note. Page-top variant was retired
       2026-05-14; inline-in-About-card variant is what Overview uses. — */
  .disambig-note { background: var(--green-bg); border-left: 4px solid var(--green-dk); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 18px; font-size: 13.5px; color: var(--text); line-height: 1.65; margin-bottom: 24px; }
  .disambig-note em { font-style: italic; }
  .disambig-note a  { color: var(--navy); text-decoration: underline; }
  .disambig-note a:hover { color: var(--navy-dark); }
  .disambig-note--inline { margin-top: 14px; margin-bottom: 0; padding-top: 14px; }
  .commdef-text + .disambig-note--inline { border-top: 1px solid var(--border); padding-top: 14px; border-radius: 0 0 var(--radius) var(--radius); }

  /* ── Sidebar ─────────────────────────────────────────────────── */
  .sidebar { position: sticky; top: 92px; display: grid; gap: var(--d-gap); }
  .sb-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 16px;
  }
  .sb-label {
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--fg-muted); margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
  }
  .sb-label .lucide-icon { width: 12px; height: 12px; }
  .sb-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
  .sb-nav li > a {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 9px; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    color: var(--fg); transition: background .1s, color .1s;
  }
  .sb-nav li > a:hover { background: var(--bg-hover); color: var(--fg-strong); }
  .sb-nav li > a .lucide-icon { width: 14px; height: 14px; color: var(--fg-muted); }
  .sb-nav li.active > a {
    background: var(--bg-active-chip);
    color: var(--bg-active-chip-text);
    font-weight: 600;
  }
  .sb-nav li.active > a .lucide-icon { color: var(--bg-active-chip-text); }
  .sb-nav li > a kbd {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 500;
    padding: 1px 5px; border-radius: 3px;
    background: var(--bg-inset); color: var(--fg-muted);
    border: 1px solid var(--border-default);
  }

  .sb-promo {
    background: var(--bg-active-chip);
    border-color: transparent;
    color: var(--bg-active-chip-text);
  }
  .sb-promo h4 {
    margin: 0 0 6px;
    font-size: 14px; font-weight: 700;
    color: var(--fg-strong);
  }
  .theme-light .sb-promo { background: #eff6ff; }
  .sb-promo p { font-size: 12px; color: var(--fg); line-height: 1.55; margin: 0 0 10px; }
  .sb-promo ul { margin: 0 0 12px; padding-left: 16px; font-size: 12px; line-height: 1.7; }
  .sb-promo .btn-primary { width: 100%; justify-content: center; }

  .sb-mini-stat { display: grid; gap: 10px; }
  .sb-mini-stat .row { display: flex; justify-content: space-between; font-size: 12px; }
  .sb-mini-stat .row .k { color: var(--fg-muted); }
  .sb-mini-stat .row .v { font-weight: 700; color: var(--fg-strong); font-variant-numeric: tabular-nums; }

  /* ── Tabbed sub-nav (under hero) ─────────────────────────────── */
  .pagetabs {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    /* z-index above Leaflet (controls ~1000) but below .site-header (2000). */
    position: sticky; top: 76px; z-index: 1500;
  }
  .pagetabs .container {
    display: flex; gap: 2px; align-items: center;
    overflow-x: auto;
  }
  .pagetabs .lead {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--fg-muted); padding: 12px 12px 12px 0;
    margin-right: 6px; white-space: nowrap;
    border-right: 1px solid var(--border-default);
  }
  .pagetab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 11px 12px;
    font-size: 13px; font-weight: 500;
    color: var(--fg);
    border-bottom: 2px solid transparent;
    transition: color .12s, border-color .12s;
    white-space: nowrap;
  }
  .pagetab .lucide-icon { width: 14px; height: 14px; }
  .pagetab:hover { color: var(--fg-strong); }
  .pagetab.active { color: var(--fg-strong); border-bottom-color: var(--accent); font-weight: 600; }
  .pagetab .pulse {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--green-600);
    box-shadow: 0 0 0 3px rgba(22,163,74,.18);
  }

  /* ── Charts (custom svg styles) ──────────────────────────────── */
  .axis line, .axis path { stroke: var(--border-default); stroke-width: 1; fill: none; }
  .axis text { fill: var(--fg-muted); font-family: var(--font-mono); font-size: 10px; }
  .grid line { stroke: var(--border-default); stroke-width: 1; stroke-dasharray: 2 3; opacity: .6; }
  .data-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .data-area { fill: var(--accent); opacity: .08; }
  .data-bar { fill: var(--accent); }
  .data-point { fill: var(--bg-surface); stroke: var(--accent); stroke-width: 2; }
  .data-label { fill: var(--fg); font-family: var(--font-mono); font-size: 10px; font-weight: 500; }
  .data-label-strong { fill: var(--fg-strong); font-family: var(--font-sans); font-size: 11px; font-weight: 700; }
  .annot { font-family: var(--font-sans); font-size: 11px; font-weight: 500; fill: var(--fg-muted); }
  .annot-line { stroke: var(--fg-muted); stroke-width: 1; stroke-dasharray: 2 2; opacity: .6; }
  .axis-label { fill: var(--fg-muted); font-size: 10px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
  .axis-tick-label { fill: var(--fg-muted); font-family: var(--font-sans); font-size: 11px; }

  /* ── Embedded StrataMap ──────────────────────────────────────── */
  .rm-embed {
    position: relative;
    height: 580px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-default);
    background: var(--bg-inset);
    user-select: none;
  }
  .rm-header {
    position: absolute;
    top: 0; left: 0; right: 0; height: 44px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    display: flex; align-items: center;
    padding: 0 14px; gap: 12px;
    z-index: 10;
    font-family: var(--font-sans);
  }
  .rm-h-title { font-size: 13px; font-weight: 700; color: var(--fg-strong); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
  .rm-h-title .glyph {
    width: 20px; height: 20px; border-radius: 5px;
    background: var(--fg-strong); color: var(--bg-surface);
    display: grid; place-items: center;
    font-size: 11px; font-weight: 700;
  }
  .rm-h-sep { width: 1px; height: 18px; background: var(--border-default); flex-shrink: 0; }
  .rm-h-meta { font-size: 11px; color: var(--fg-muted); white-space: nowrap; }
  .rm-h-url { font-size: 11px; color: var(--accent); font-family: var(--font-mono); margin-left: auto; }
  .rm-svg {
    position: absolute;
    top: 44px; left: 0; right: 0; bottom: 0;
    width: 100%; height: calc(100% - 44px);
    cursor: grab; display: block;
  }
  .rm-svg.panning { cursor: grabbing; }
  .rm-edge-line { stroke: var(--slate-400); stroke-width: 2; opacity: .55; }
  .theme-dark .rm-edge-line { stroke: var(--slate-600); }
  .rm-edge-line.financial { stroke: var(--green-600); stroke-width: 2.5; opacity: .9; }
  .rm-edge-line.former { stroke-dasharray: 7 4; opacity: .55; }
  .rm-edge-label { fill: var(--fg-muted); font-size: 10px; font-weight: 500; pointer-events: none; dominant-baseline: middle; font-family: var(--font-sans); }
  .rm-node-group { cursor: pointer; }
  .rm-node-circle { stroke-width: 2.5; transition: filter 0.12s; }
  .rm-node-group:hover .rm-node-circle { filter: brightness(1.18) drop-shadow(0 0 8px rgba(0,0,0,.18)); }
  .rm-node-label { fill: var(--fg-strong); font-size: 11px; font-weight: 600; pointer-events: none; text-anchor: middle; dominant-baseline: hanging; font-family: var(--font-sans); }
  .rm-node-icon { pointer-events: none; }
  .rm-info-panel {
    position: absolute;
    top: 56px; right: 14px;
    width: 256px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 14px;
    box-shadow: var(--shadow-dropdown-light);
    display: none;
    max-height: calc(100% - 80px);
    overflow-y: auto;
    z-index: 20;
    font-family: var(--font-sans);
  }
  .theme-dark .rm-info-panel { box-shadow: var(--shadow-dropdown-dark); }
  .rm-ip-name { font-size: 14px; font-weight: 700; color: var(--fg-strong); margin-bottom: 2px; padding-right: 18px; }
  .rm-ip-type { font-size: 11px; color: var(--fg-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
  .rm-ip-rel { font-size: 12px; color: var(--fg); padding: 7px 0; border-bottom: 1px solid var(--border-default); line-height: 1.4; }
  .rm-ip-rel:last-child { border-bottom: none; }
  .rm-ip-dir { font-size: 10px; color: var(--fg-muted); font-family: var(--font-mono); }
  .rm-ip-close {
    position: absolute; top: 10px; right: 10px;
    width: 22px; height: 22px;
    background: none; border: none; cursor: pointer;
    color: var(--fg-muted);
    display: grid; place-items: center;
    border-radius: 4px;
  }
  .rm-ip-close:hover { background: var(--bg-hover); color: var(--fg-strong); }
  .rm-watermark {
    position: absolute;
    bottom: 8px; left: 50%; transform: translateX(-50%);
    font-size: 10px; color: var(--fg-faint);
    pointer-events: none; white-space: nowrap;
    font-family: var(--font-mono);
  }
  .rm-controls {
    position: absolute; bottom: 14px; right: 14px;
    display: flex; flex-direction: column; gap: 4px;
    z-index: 15;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 7px;
    box-shadow: var(--shadow-input-light);
    padding: 3px;
  }
  .rm-ctl {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    background: transparent; border: none; border-radius: 4px;
    color: var(--fg); cursor: pointer;
    transition: background .1s;
  }
  .rm-ctl:hover { background: var(--bg-hover); color: var(--fg-strong); }
  .rm-ctl .lucide-icon { width: 14px; height: 14px; }

  .rm-legend {
    position: absolute;
    bottom: 14px; left: 14px;
    display: flex; gap: 14px; padding: 8px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 7px;
    z-index: 15;
    font-size: 11px;
    box-shadow: var(--shadow-input-light);
  }
  .rm-legend .item { display: inline-flex; align-items: center; gap: 5px; color: var(--fg); }
  .rm-legend .swatch { width: 10px; height: 10px; border-radius: 50%; }

  /* ── Skip-to-content (a11y) ──────────────────────────────────
     Hidden by default; becomes visible only when a keyboard user
     Tabs into it. WCAG 2.4.1 "Bypass Blocks" — lets screen reader
     and keyboard users skip the header nav and jump to <main>. */
  .skip-link {
    position: absolute; left: -9999px; top: auto;
    width: 1px; height: 1px; overflow: hidden;
  }
  .skip-link:focus {
    position: static; width: auto; height: auto;
    background: var(--accent); color: #fff; padding: 8px 12px;
    border-radius: 4px;
  }

  /* ── Footer ──────────────────────────────────────────────────── */
  .site-footer {
    border-top: 1px solid var(--border-default);
    background: var(--bg-surface);
    padding: 24px 0;
    margin-top: 40px;
    font-size: 14px; color: var(--fg-muted);
  }
  .site-footer .container { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
  .site-footer a { color: var(--fg-muted); }
  .site-footer a:hover { color: var(--fg-strong); }
  .site-footer .spacer { flex: 1; }
  /* Footer logo — visually smaller than the 56px header lockup.
     CSS height overrides the inline height attribute on the shared partial. */
  .site-footer svg { height: 36px; }

  /* ── Misc helpers ────────────────────────────────────────────── */
  .lucide-icon {
    display: inline-block;
    width: 16px; height: 16px;
    stroke-width: 2;
    vertical-align: middle;
  }
  .num-mono { font-variant-numeric: tabular-nums; }
  .text-muted { color: var(--fg-muted); }
  .text-strong { color: var(--fg-strong); }

  /* ── Community-page 2-column layout + right rail ─────────────────
     Shared between templates/community/overview.html and government.html
     (and any future community subpage that wants the rail). The rail
     uses legacy design tokens (--navy, --muted, --border, --green-bg,
     --green-dk, --white, --radius, --navy-dark) which are defined
     inside the .community-page wrapper on each page. These rules only
     resolve correctly when their markup is nested inside .community-page.

     Markup partial: templates/_partials/community_rail.html */

  .community-2col {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
  }
  @media (max-width: 980px) {
    .community-2col { grid-template-columns: 1fr; }
  }
  .community-2col-main { min-width: 0; }

  /* Sticky on desktop, hidden on narrow viewports. Sticks at top: 132px
     = 76 (site-header) + ~46 (pagetabs) + breathing. Pagetabs already
     provide nav on mobile, so the rail's secondary info just clutters
     mobile scroll. */
  .right-rail {
    display: flex; flex-direction: column; gap: 16px;
    position: sticky; top: 132px;
    align-self: start;
  }
  @media (max-width: 980px) {
    .right-rail { display: none; }
  }

  .rail-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
  }
  .rail-label {
    font-family: 'Varela Round', sans-serif;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--muted);
    display: flex; align-items: center; gap: 6px;
    margin: 0 0 10px;
  }
  .rail-label i, .rail-label svg { width: 13px; height: 13px; flex-shrink: 0; }

  /* Pages mini-nav */
  .rail-pages ol {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 2px;
  }
  .rail-pages a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
  }
  .rail-pages a:hover { background: var(--green-bg); text-decoration: none; }
  .rail-pages a.active { background: #e9f0ff; color: var(--navy); font-weight: 700; }
  .rail-pages a .page-name { display: flex; align-items: center; gap: 8px; }
  .rail-pages a .page-name i { width: 14px; height: 14px; }
  .rail-pages a .page-num {
    font-family: 'Varela Round', sans-serif;
    font-size: 11px;
    background: #f1f3f7; color: var(--muted);
    border-radius: 4px;
    padding: 2px 7px;
  }
  .rail-pages a.active .page-num { background: var(--navy); color: #fff; }

  /* Section sub-nav — appears under the active page row as a small
     indented list with a soft left border. Scroll-spy adds .is-current
     to the link whose section is in view. */
  .rail-pages .rail-subnav {
    list-style: none;
    margin: 4px 0 8px 28px;
    padding: 0 0 0 12px;
    border-left: 2px solid rgba(59, 81, 163, 0.18);
    display: flex; flex-direction: column;
    gap: 0;
  }
  .rail-pages .rail-subnav li { display: block; margin: 0; }
  .rail-pages .rail-sublink {
    display: block;
    padding: 5px 8px;
    font-size: 12.5px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 4px;
    line-height: 1.35;
    transition: background .12s ease, color .12s ease;
  }
  .rail-pages .rail-sublink:hover {
    background: var(--green-bg);
    color: var(--text);
    text-decoration: none;
  }
  .rail-pages .rail-sublink.is-current {
    color: var(--navy);
    font-weight: 700;
    background: rgba(59, 81, 163, 0.06);
  }
  /* Smooth-scroll for in-page jumps (Safari already enables this for
     fragment nav; explicit here for consistency across browsers). */
  html { scroll-behavior: smooth; }

  /* Quick facts — tight rows with thin separator between each fact */
  .rail-facts dl {
    margin: 0;
    display: grid; grid-template-columns: 1fr auto;
    column-gap: 12px; row-gap: 0;
    font-size: 14px;
    line-height: 1.35;
  }
  .rail-facts dt, .rail-facts dd {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
  }
  .rail-facts dt:first-of-type,
  .rail-facts dd:first-of-type { padding-top: 0; }
  .rail-facts dt:last-of-type,
  .rail-facts dd:last-of-type { padding-bottom: 0; border-bottom: none; }
  .rail-facts dt { color: var(--muted); }
  .rail-facts dd {
    margin: 0; color: var(--text); font-weight: 700;
    font-family: 'Cabin', sans-serif;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }
  .rail-facts dd.tbd { color: var(--muted); font-weight: 500; font-style: italic; font-size: 13px; }

  /* CTA card */
  .rail-cta {
    background: linear-gradient(135deg, #eaf2ff 0%, var(--green-bg) 100%);
    border-color: #c8dcff;
  }
  .rail-cta h3 {
    font-family: 'Cabin', sans-serif;
    font-size: 16px; font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
  }
  .rail-cta p {
    font-size: 13px; color: var(--muted);
    line-height: 1.5; margin: 0 0 10px;
  }
  .rail-cta ul {
    list-style: none; margin: 0 0 12px; padding: 0;
  }
  .rail-cta li {
    font-size: 13px; color: var(--navy);
    padding: 2px 0;
    display: flex; align-items: center; gap: 6px;
  }
  .rail-cta li::before {
    content: ''; display: inline-block;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--green-dk); flex-shrink: 0;
  }
  .rail-cta .btn-cta {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 9px 12px;
    background: var(--navy); color: #fff;
    border-radius: 6px;
    text-decoration: none; font-weight: 700; font-size: 14px;
  }
  .rail-cta .btn-cta:hover { background: var(--navy-dark); color: #fff; text-decoration: none; }

  /* ── Peer-comparison cards (UP_DEMOG_CARDS.md) ───────────────────
     Shared chrome for the redesigned demographic cards on overview.html.
     Used by Household types, Occupied housing tenure, and Residential
     mobility. Each card has the same control row (peer-set tabs +
     optional view toggle + metric switcher + median chip), the same
     lollipop list pattern, the same drawer-on-click, and the same
     floating tooltip. Card-specific visualizations (ternary, scatter)
     are styled below this block. */

  /* — Peer-set tabs (underline style, matches site .pagetabs convention) — */
  .peer-tabs {
    display: flex; gap: 4px;
    border-bottom: 1px solid var(--border);
    margin: 4px 0 16px;
  }
  .peer-tabs button {
    font-family: 'Varela Round', sans-serif;
    font-size: 13px; letter-spacing: .02em;
    border: 0; background: transparent;
    color: var(--muted);
    padding: 10px 14px 12px;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1px;
    transition: color .15s ease, border-color .15s ease;
  }
  .peer-tabs button:hover { color: var(--text); }
  .peer-tabs button.active {
    color: var(--navy);
    border-bottom-color: var(--navy);
    font-weight: 700;
  }

  /* — Compare controls row: view toggle + metric switcher + median chip — */
  .compare-controls {
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .compare-controls .controls-left {
    display: flex; align-items: center;
    gap: 10px; flex-wrap: wrap;
  }

  /* — View-mode toggle (List vs Constellation/Map) — */
  .view-toggle {
    display: inline-flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
  }
  .view-toggle button {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Varela Round', sans-serif;
    font-size: 12px; letter-spacing: .02em;
    border: 0; background: transparent; color: var(--muted);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s ease;
  }
  .view-toggle button svg { width: 14px; height: 14px; }
  .view-toggle button.active {
    background: var(--white); color: var(--navy);
    box-shadow: 0 1px 2px rgba(20,28,60,.10);
    font-weight: 700;
  }
  .view-toggle button:hover:not(.active) { color: var(--text); }

  /* — Metric switcher (pill toggle) — */
  .metric-switch {
    display: flex; gap: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px; padding: 3px;
    transition: opacity .15s ease;
  }
  .metric-switch.hidden { display: none; }
  .metric-switch button {
    font-family: 'Varela Round', sans-serif;
    font-size: 12px; letter-spacing: .03em;
    border: 0; background: transparent; color: var(--muted);
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all .15s ease;
  }
  .metric-switch button.active {
    background: var(--navy); color: var(--white);
    box-shadow: 0 1px 3px rgba(59,81,163,.25);
  }
  .metric-switch button:hover:not(.active) { color: var(--text); }

  /* — Median chip (dashed red prefix indicates the chart's median line) — */
  .median-chip {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Varela Round', sans-serif;
    font-size: 11px; letter-spacing: .04em;
    background: rgba(184,78,72,0.06);
    border: 1px solid rgba(184,78,72,0.18);
    color: #b94e48;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: help;
  }
  .median-chip .mc-label { color: #b94e48; opacity: 0.85; }
  .median-chip .mc-val {
    font-family: 'Cabin', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 700; letter-spacing: 0;
    color: #b94e48;
  }
  .median-chip::before {
    content: '';
    display: inline-block;
    width: 18px; height: 0;
    border-top: 2px dashed #b94e48;
    opacity: 0.6;
    margin-right: -2px;
  }

  /* — Lollipop list (single-metric peer comparison) —
       Grid columns: peer-name | track | metric | details-tag.
       peer-name has a min-width so community names don't truncate; the
       track flexes to fill remaining space. On narrow viewports / narrow
       cards (community page main column ~520-620px), the row collapses
       to a 2-line layout (name on top, track+metric+tag on second line). */
  .lolli-axis {
    display: grid;
    grid-template-columns: minmax(120px, 1.4fr) minmax(120px, 2.6fr) 56px 78px;
    gap: 12px;
    font-size: 10.5px; color: var(--muted);
    font-family: 'Varela Round', sans-serif;
    margin-top: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }
  .lolli-axis .ticks { position: relative; height: 18px; }
  .lolli-axis .tick {
    position: absolute; transform: translateX(-50%); top: 0;
    font-variant-numeric: tabular-nums;
  }
  .lolli-axis .tick::before {
    content: ''; display: block;
    width: 1px; height: 4px;
    background: var(--border);
    margin: 0 auto 2px;
  }
  .lolli-list { margin-top: 2px; }
  .lolli-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.4fr) minmax(120px, 2.6fr) 56px 78px;
    align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    cursor: pointer;
    transition: background .12s ease;
  }
  /* Stack the row on phone widths only — Household card spans both
     columns of demog-pair-grid so it has room for a single-row layout
     even on tablet widths. */
  @media (max-width: 560px) {
    .lolli-axis, .lolli-row {
      grid-template-columns: 1fr 56px 70px;
      grid-template-areas: 'name name name' 'track metric tag';
      row-gap: 4px;
    }
    .lolli-row > .peer-name { grid-area: name; }
    .lolli-row > .lolli-track { grid-area: track; }
    .lolli-row > .lolli-metric { grid-area: metric; }
    .lolli-row > .details-tag { grid-area: tag; }
    .lolli-axis { grid-template-columns: 1fr 56px 70px; }
    .lolli-axis > :first-child { display: none; }
  }
  .lolli-row:hover { background: rgba(59,81,163,0.025); }
  .lolli-row:last-of-type { border-bottom: none; }
  .lolli-row.is-self {
    background: rgba(252,186,111,0.10);
    border-left: 3px solid var(--amber);
    padding-left: 9px;
    margin-left: -12px;
    border-radius: 4px 0 0 4px;
  }
  .lolli-row.is-self:hover { background: rgba(252,186,111,0.14); }
  .lolli-row.is-self strong { color: var(--navy-hero, var(--navy-dark)); }
  /* Name column: 2-line stack — name + (type) inline on line 1,
     county on line 2. The (type) is muted-italic so it visually
     subordinates to the bold community name. */
  .lolli-row .peer-name {
    line-height: 1.35;
  }
  .lolli-row .peer-name strong {
    color: var(--text); font-weight: 700;
  }
  .lolli-row .peer-name .peer-type-inline {
    color: var(--muted); font-weight: 400;
    font-size: 12px;
    font-style: italic;
    margin-left: 3px;
  }
  .lolli-row .peer-name .peer-type {
    display: block;
    font-size: 11.5px; color: var(--muted);
  }

  .lolli-track { position: relative; height: 24px; }
  .lolli-track .axis-line {
    position: absolute; top: 50%; left: 0; right: 0;
    height: 1px; background: var(--border);
  }
  .lolli-track .median-line {
    position: absolute; top: 3px; bottom: 3px;
    width: 0; border-left: 1.5px dashed #b94e48;
    opacity: 0.55;
    cursor: help;
  }
  .lolli-track .stick {
    position: absolute; top: calc(50% - 1px);
    height: 2px; background: rgba(59,81,163,0.35);
    border-radius: 1px;
  }
  .lolli-track .stick.self { background: rgba(252,186,111,0.7); }
  .lolli-track .dot {
    position: absolute; top: 50%;
    width: 13px; height: 13px; border-radius: 50%;
    transform: translate(-50%, -50%);
    background: var(--navy);
    border: 2px solid var(--white);
    box-shadow: 0 1px 2px rgba(20,28,60,.18);
    transition: transform .12s ease, box-shadow .12s ease;
    cursor: pointer;
  }
  .lolli-track .dot:hover {
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 2px 6px rgba(20,28,60,.28);
  }
  .lolli-track .dot.self {
    background: var(--amber);
    border: 2.5px solid #e89c47;
    width: 17px; height: 17px;
    box-shadow: 0 1px 3px rgba(232,156,71,.4);
  }
  .lolli-metric {
    font-family: 'Cabin', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 700; color: var(--text);
    text-align: right;
  }
  .lolli-row.is-self .lolli-metric { color: #e89c47; }

  /* — Details affordance — pill that brightens on hover, fills on open — */
  .details-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: 'Varela Round', sans-serif;
    font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px 4px 9px;
    justify-self: end;
    transition: all .12s ease;
    white-space: nowrap;
  }
  .details-tag svg { width: 11px; height: 11px; transition: transform .15s ease; }
  .lolli-row:hover .details-tag {
    color: var(--navy);
    background: rgba(59,81,163,0.06);
    border-color: rgba(59,81,163,0.25);
  }
  .lolli-row.open .details-tag {
    color: var(--white); background: var(--navy); border-color: var(--navy);
  }
  .lolli-row.open .details-tag svg { transform: rotate(90deg); }

  /* — Detail drawer (composition strip + 2-col legend) — */
  .lolli-detail {
    grid-column: 1 / -1;
    display: none;
    padding: 16px 18px 18px;
    margin: 6px -12px 10px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    animation: lolliSlideIn .15s ease-out;
  }
  @keyframes lolliSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  /* Drawer visibility. The .shown class is added by peer_compare.js when
     the user clicks a row — robust against row reorders. The
     adjacent-sibling rule is kept as a no-JS fallback. */
  .lolli-detail.shown,
  .lolli-row.open + .lolli-detail { display: block; }
  .ld-title-row {
    display: flex; align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px; gap: 12px;
  }
  .ld-title {
    font-family: 'Varela Round', sans-serif;
    font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--navy);
  }
  .ld-total {
    font-size: 11.5px; color: var(--muted);
    font-family: 'Cabin', sans-serif; font-variant-numeric: tabular-nums;
  }
  .ld-strip {
    display: flex; width: 100%; height: 26px;
    border-radius: 5px; overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--border);
    margin-bottom: 12px;
  }
  .ld-strip .seg { height: 100%; cursor: default; transition: filter .12s ease; }
  .ld-strip .seg:hover { filter: brightness(1.1); }
  .ld-strip-note {
    font-size: 11px; color: var(--muted);
    margin-bottom: 10px;
    font-style: italic;
  }
  .ld-rows {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 6px 20px; font-size: 12.5px;
  }
  .ld-rows .lrow {
    display: grid; grid-template-columns: 12px 1fr 64px 46px;
    align-items: center; gap: 8px;
  }
  .ld-rows .sw { width: 10px; height: 10px; border-radius: 2px; }
  .ld-rows .ll { color: var(--text); }
  .ld-rows .lc { color: var(--muted); font-family: 'Cabin', sans-serif; font-variant-numeric: tabular-nums; text-align: right; }
  .ld-rows .lp { color: var(--text); font-family: 'Cabin', sans-serif; font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }

  /* Drawer footer with a CTA link to the peer community's own page.
     Rendered only on non-self rows — clicking takes the user to
     /{county_slug}/{place_slug}/{type_slug}/ for that community. */
  .lolli-detail .ld-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  .lolli-detail .ld-cta {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Varela Round', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--navy);
    background: var(--white, #ffffff);
    border: 1.5px solid var(--navy);
    border-radius: 999px;
    padding: 7px 14px 7px 16px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, transform .12s ease;
  }
  .lolli-detail .ld-cta svg { width: 14px; height: 14px; transition: transform .15s ease; }
  .lolli-detail .ld-cta:hover {
    background: var(--navy);
    color: var(--white, #ffffff);
    text-decoration: none;
  }
  .lolli-detail .ld-cta:hover svg { transform: translateX(2px); }
  .lolli-detail .ld-cta:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
  }

  .peer-bucket-note {
    font-size: 11.5px; color: var(--muted);
    margin: 14px 0 0; line-height: 1.45;
  }

  /* — Floating tooltip (white, matches production Municipal Tax Rate chip) — */
  .tt {
    position: fixed; z-index: 1000; pointer-events: none;
    background: var(--white, #ffffff);
    color: var(--text);
    font-size: 12.5px; line-height: 1.5;
    padding: 11px 14px; border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(20,28,60,.12), 0 1px 3px rgba(20,28,60,.06);
    opacity: 0; transition: opacity .12s ease;
    max-width: 340px;
  }
  .tt.show { opacity: 1; }
  .tt .tt-name {
    font-family: 'Cabin', sans-serif;
    font-weight: 700; font-size: 13.5px;
    color: var(--navy-hero, var(--navy-dark));
    margin-bottom: 5px; display: block;
  }
  .tt .tt-line {
    display: flex; align-items: baseline; gap: 8px;
    font-size: 12.5px; color: var(--muted);
  }
  .tt .tt-line .tt-num {
    font-family: 'Cabin', sans-serif; font-variant-numeric: tabular-nums;
    font-weight: 700; color: var(--text);
  }
  .tt .tt-delta-up   { color: var(--green-dk); }
  .tt .tt-delta-down { color: #b94e48; }
  .tt .tt-delta-flat { color: var(--muted); }
  .tt .tt-sw {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 2px; vertical-align: middle;
    margin-right: 6px;
  }
  .tt .tt-meta {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    font-size: 11.5px; color: var(--navy);
    font-style: italic;
  }

  /* — Constellation wrap (ternary for tenure, scatter for mobility) —
       Two-column layout: SVG chart on the left, side panel on the right
       with "How to read it" explainer + sorted community list.
       Stacks on narrow widths. */
  .constellation-wrap {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 4px;
  }
  @media (max-width: 880px) {
    .constellation-wrap { grid-template-columns: 1fr; }
  }
  .ternary-frame { position: relative; width: 100%; }
  .ternary-frame svg {
    width: 100%; height: auto;
    display: block;
    overflow: visible;
  }
  .tn-edge { stroke: var(--border); stroke-width: 1.2; fill: none; }
  .tn-grid { stroke: var(--border); stroke-width: 0.6; fill: none; stroke-dasharray: 3 3; }
  .tn-corner-label {
    font-family: 'Varela Round', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .04em;
  }
  .tn-corner-sub {
    font-family: 'Cabin', sans-serif;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
  }
  .tn-tick-lbl {
    font-family: 'Varela Round', sans-serif;
    font-size: 16px;
    fill: var(--muted);
  }
  .tn-median { fill: #b94e48; stroke: var(--white, #ffffff); stroke-width: 1.5; cursor: help; }
  .tn-median-line { stroke: #b94e48; stroke-width: 1.4; opacity: .5; }
  .tn-dot {
    fill: var(--navy);
    stroke: var(--white, #ffffff);
    stroke-width: 2;
    cursor: pointer;
    transition: transform .12s ease, fill .12s ease;
    transform-origin: center;
    transform-box: fill-box;
  }
  .tn-dot:hover { transform: scale(1.35); fill: var(--navy-dark); }
  .tn-dot.self {
    fill: var(--amber);
    stroke: #e89c47;
    stroke-width: 2.5;
  }
  .tn-dot.self:hover { transform: scale(1.25); }
  .tn-label {
    font-family: 'Cabin', sans-serif;
    font-size: 16px;
    fill: var(--text);
    pointer-events: none;
  }
  .tn-label.self {
    font-weight: 700;
    fill: var(--navy-hero, var(--navy-dark));
    font-size: 18px;
  }

  /* — Constellation side panel (right column inside .constellation-wrap) — */
  .constellation-side { font-size: 13px; }
  .cs-section { margin-bottom: 18px; }
  .cs-section h3 {
    font-family: 'Varela Round', sans-serif;
    font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--navy);
    margin: 0 0 8px;
  }
  .cs-help {
    background: rgba(59,81,163,0.04);
    border: 1px solid rgba(59,81,163,0.10);
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 12px; color: var(--muted);
    line-height: 1.55;
  }
  .cs-help strong { color: var(--navy-hero, var(--navy-dark)); }
  .cs-help p { margin: 0 0 6px; }
  .cs-help p:last-child { margin-bottom: 0; }
  .cs-help .sw {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 2px;
    vertical-align: middle;
    margin: 0 4px 1px 1px;
  }
  .cs-list { display: grid; gap: 6px; font-size: 12.5px; }
  .cs-list .row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 10px;
  }
  .cs-list .row .v {
    font-family: 'Cabin', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 700; color: var(--text);
  }
  .cs-list .row.self {
    background: rgba(252,186,111,0.12);
    border-left: 2.5px solid var(--amber);
    padding: 3px 8px 3px 7px;
    margin-left: -10px;
    border-radius: 3px;
  }
  .cs-list .row.self .v { color: #e89c47; }
  .cs-list .row a {
    color: inherit;
    text-decoration: none;
    transition: color .12s ease;
  }
  .cs-list .row a:hover { color: var(--navy); }

  /* — Tenure segment swatch colors (used by .ld-strip, drawer rows, and
       the cs-help legend chips). Match the live-site donut palette. — */
  .ten-own-mtg   { background: #3b51a3; fill: #3b51a3; }
  .ten-own-nomtg { background: #6c80c9; fill: #6c80c9; }
  .ten-rent      { background: #5fa86b; fill: #5fa86b; }

  /* — Median-age trend mini-chart inside the lollipop drawer.
       Tiny 4-point fever chart per community (320×80), navy line + dots,
       year labels along the bottom and value labels at the y extents. */
  .ma-mini-wrap {
    margin: 6px 0 14px;
    padding: 6px 0;
    background: var(--white, #ffffff);
    border-radius: 6px;
  }
  .ma-mini { width: 100%; max-width: 320px; height: 80px; display: block; }
  .ma-mini-grid { stroke: var(--border); stroke-width: 0.7; fill: none; }
  .ma-mini-line {
    fill: none;
    stroke: var(--navy);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .ma-mini-dot {
    fill: var(--navy);
    stroke: var(--white, #ffffff);
    stroke-width: 1.5;
    transition: r .12s ease;
    pointer-events: none;
  }
  /* Larger transparent hit-area sits on top so the dot is easy to hover
     even at r=3. Grows the underlying .ma-mini-dot via sibling selector
     so the hover target gives visual feedback. */
  .ma-mini-hit { cursor: help; }
  .ma-mini-hit:hover + .ma-mini-yearlbl,
  .ma-mini-hit:hover ~ .ma-mini-dot { /* nothing — kept as a hook if needed */ }
  .ma-mini-axlbl {
    font-family: 'Cabin', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    fill: var(--muted);
  }
  .ma-mini-yearlbl {
    font-family: 'Varela Round', sans-serif;
    font-size: 10.5px;
    fill: var(--muted);
  }

  /* — Mobility segment swatch colors. Navy → amber gradient encodes
       distance from local to international: stayed (deep navy),
       same county (mid navy), other NY (light navy), other state
       (warm orange), abroad (orange). — */
  .mob-stayed       { background: #3b51a3; fill: #3b51a3; }
  .mob-samecounty   { background: #6c80c9; fill: #6c80c9; }
  .mob-othernyco    { background: #9eb5e0; fill: #9eb5e0; }
  .mob-otherstate   { background: #f0997b; fill: #f0997b; }
  .mob-abroad       { background: #d85a30; fill: #d85a30; }

  /* ── Mobility Map (scatter plot) — Phase 3 ─────────────────────────
     Two-column wrap (chart + side panel) parallel to .constellation-wrap.
     Slightly wider chart column because the scatter benefits from
     horizontal space. */
  .map-wrap {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 4px;
  }
  @media (max-width: 880px) {
    .map-wrap { grid-template-columns: 1fr; }
  }
  .map-frame { position: relative; width: 100%; }
  .map-frame svg {
    width: 100%; height: auto;
    display: block;
    overflow: visible;
  }
  .mp-axis-line { stroke: var(--border); stroke-width: 1.2; fill: none; }
  .mp-grid { stroke: var(--border); stroke-width: 0.5; stroke-dasharray: 3 3; fill: none; }
  .mp-median { stroke: #b94e48; stroke-width: 1.2; stroke-dasharray: 5 4; opacity: .55; fill: none; cursor: help; }
  .mp-tick-lbl {
    font-family: 'Varela Round', sans-serif;
    font-size: 15px;
    fill: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .mp-axis-title {
    font-family: 'Varela Round', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    fill: var(--text);
  }
  .mp-axis-arrow {
    font-family: 'Varela Round', sans-serif;
    font-size: 13px;
    fill: var(--muted);
    letter-spacing: .04em;
  }
  .mp-quadrant-label {
    font-family: 'Varela Round', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    fill: rgba(59,81,163,.18);
    pointer-events: none;
  }
  .mp-dot {
    fill: var(--navy);
    stroke: var(--white, #ffffff);
    stroke-width: 2;
    cursor: pointer;
    transition: transform .12s ease, fill .12s ease;
    transform-origin: center;
    transform-box: fill-box;
  }
  .mp-dot:hover { transform: scale(1.18); fill: var(--navy-dark); }
  .mp-dot.self {
    fill: var(--amber);
    stroke: #e89c47;
    stroke-width: 2.5;
  }
  .mp-dot.self:hover { transform: scale(1.15); }
  .mp-label {
    font-family: 'Cabin', sans-serif;
    font-size: 14px;
    fill: var(--text);
    pointer-events: none;
  }
  .mp-label.self {
    font-weight: 700;
    fill: var(--navy-hero, var(--navy-dark));
    font-size: 17px;
  }

  /* Mobility-Map side panel: quadrant guide + stability ranking */
  .ms-quad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
    font-size: 11px;
  }
  .ms-quad {
    padding: 7px 9px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    line-height: 1.4;
    color: var(--muted);
  }
  .ms-quad strong {
    display: block;
    color: var(--navy-hero, var(--navy-dark));
    font-size: 11px;
    margin-bottom: 2px;
  }

  /* ── Responsive ───────────────────────────────────────────────── */
  /* Tablet */
  @media (max-width: 1080px) {
    .page-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .stats { grid-template-columns: repeat(3, 1fr); }
    .stats .stat:nth-child(3n) { border-right: none; }
    .stats .stat:nth-child(n+4) { border-top: 1px solid var(--border-default); }
    .glance-map { height: 380px; }
    .glance-overlay-tl { max-width: 280px; padding: 12px 14px; }
    .glance-legend { display: none; }
    .header-search input { width: 100%; min-width: 0; }
  }
  /* Phone */
  @media (max-width: 720px) {
    .container { padding: 0 14px; }
    .data-grid { grid-template-columns: 1fr; }
    .data-grid > .span-full { grid-column: 1; }
    .data-grid > .span-2of3 { grid-column: 1; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stats .stat { border-right: 1px solid var(--border-default) !important; border-bottom: 1px solid var(--border-default); }
    .stats .stat:nth-child(2n) { border-right: none !important; }
    .hero-name { font-size: 30px; }
    .hero-top { grid-template-columns: 1fr; gap: 16px; }
    .hero-actions { flex-wrap: wrap; }

    /* Header: shrink logo + height, drop nav, KEEP search.
       Search is the primary navigation aid on mobile — see UP_REDESIGN.md
       "Entitlement & Access Control / Visibility rule." Get Pro and all
       nav links are hidden on phone to keep the bar uncluttered; users
       reach Services via the search results page footers / community pages. */
    .container { padding: 0 16px; }
    .site-header .container {
      height: 60px;
      gap: 10px;
      grid-template-columns: auto 1fr;  /* drop the third (nav) column */
    }
    .brand-mark svg { height: 40px !important; }
    .header-search { display: block; }
    .header-search input { height: 34px; font-size: 13px; }
    .site-nav { display: none; }

    /* Sticky offsets follow the smaller header */
    .pagetabs { top: 60px; }
    .pagetabs .container { gap: 0; padding-left: 14px; padding-right: 14px; -webkit-overflow-scrolling: touch; }
    .pagetabs .lead { display: none; }
    .pagetab { white-space: nowrap; }

    /* Crumbs: keep on one line, scroll if needed */
    .crumbs .container { flex-wrap: nowrap; overflow-x: auto; }
    .crumbs .container > * { flex: 0 0 auto; }

    /* Footer: stack rather than tile */
    .site-footer .container { gap: 8px 14px; }
    .site-footer .spacer { flex-basis: 100%; height: 0; }
  }

/* ── Peer-comparison lock teaser ──────────────────────────────────────
   Shown in place of a card's peer-comparison tabs for non-subscribers.
   The real peer data is withheld server-side (UP_MONETIZATION.md §8); this
   is purely an upsell affordance. Used via _partials/peer_lock.html. */
.peer-lock {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 14px;
  padding: 12px 16px;
  background: var(--green-bg, #eef5ee);
  border: 1px dashed var(--green-dk, #2e7d52);
  border-radius: 10px;
}
.peer-lock-icon {
  flex: none; display: inline-flex;
  color: var(--green-dk, #2e7d52);
}
.peer-lock-icon svg { width: 20px; height: 20px; }
.peer-lock-body { display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.peer-lock-title {
  font-family: 'Cabin', sans-serif; font-weight: 700;
  font-size: 13.5px; color: var(--text, #1b2620);
}
.peer-lock-cta {
  font-family: 'Roboto', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--green-dk, #2e7d52); text-decoration: none;
}
.peer-lock-cta:hover { text-decoration: underline; }

/* ── Locked peer tabs + in-panel teaser (non-subscriber) ──────────────
   Peer tabs stay visible but get a lock treatment, distinct from the active
   self tab and the free County tab. Clicking one reveals .peer-lock-panel in
   the chart area (data withheld server-side). See _partials/peer_lock.html. */
.chart-tab.locked { color: var(--muted, #71807a); }
.chart-tab.locked .lock-ic {
  width: 12px; height: 12px; margin-right: 4px; vertical-align: -1.5px; opacity: 0.85;
}
.chart-tab.locked.active {
  color: var(--green-dk, #1f6f44);
  background: var(--green-bg, #eef5ee);
}
.peer-lock-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; min-height: 200px; padding: 36px 20px;
  background: var(--green-bg, #eef5ee);
  border: 1px dashed var(--green-dk, #2e7d52);
  border-radius: 12px;
}
.peer-lock-panel-icon { color: var(--green-dk, #2e7d52); display: inline-flex; }
.peer-lock-panel-icon svg { width: 30px; height: 30px; }
.peer-lock-panel-title {
  font-family: 'Cabin', sans-serif; font-weight: 700; font-size: 15px;
  color: var(--text, #1b2620); margin: 0;
}
.peer-lock-panel-cta {
  font-family: 'Roboto', sans-serif; font-size: 13.5px; font-weight: 500;
  color: var(--green-dk, #2e7d52); text-decoration: none;
}
.peer-lock-panel-cta:hover { text-decoration: underline; }


  /* ══════════════════════════════════════════════════════════════════
     Tools dropdown + Account drawer  (Auth Phase 1.5, 2026-07-25)
     ------------------------------------------------------------------
     Two panels, one behaviour (static/js/account-panels.js). The Tools
     menu is a dropdown because navigation reads as "where can I go";
     the Account drawer slides from the right because it reads as "my
     stuff". Shared: badges, rows, chevrons.
     Mockup of record: mockups/account_tools_chrome_v1.html
     ══════════════════════════════════════════════════════════════════ */

  .nav-anchor { position: relative; display: inline-flex; }

  .site-nav button.navbtn {
    color: var(--fg); font-family: inherit; font-size: 14px; font-weight: 500;
    padding: 6px 10px; border-radius: 6px; background: transparent; border: 0;
    cursor: pointer; display: inline-flex; align-items: center; gap: 5px; line-height: 1.5;
  }
  .site-nav button.navbtn:hover,
  .site-nav button.navbtn[aria-expanded="true"] {
    background: var(--bg-hover); color: var(--fg-strong);
  }
  .site-nav .caret { width: 12px; height: 12px; opacity: .6; transition: transform .15s; }
  .site-nav button.navbtn[aria-expanded="true"] .caret { transform: rotate(180deg); }

  .acct-btn .initial {
    width: 24px; height: 24px; border-radius: 50%;
    background: #1e3a6b; color: #fff;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
  }

  /* ── Badges: the three gate states (products.py) ─────────────────── */
  .badge {
    font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
    padding: 2px 7px; border-radius: 999px; white-space: nowrap;
    text-transform: uppercase; font-family: var(--font-sans);
  }
  .badge.active { background: #dcfce7; color: #15803d; }
  .badge.meter  { background: var(--bg-active-chip); color: var(--blue-700); }
  .badge.metered{ background: var(--bg-active-chip); color: var(--blue-700); }
  .badge.offer  { background: #fef3c7; color: #a16207; }

  /* ── Tools dropdown ──────────────────────────────────────────────── */
  .tools-menu {
    position: absolute; top: calc(100% + 10px); right: 0; width: 430px;
    background: var(--bg-surface); border: 1px solid var(--border-default);
    border-radius: 12px; padding: 6px;
    box-shadow: 0 12px 32px rgba(15,23,42,.14), 0 2px 6px rgba(15,23,42,.06);
    z-index: 2600; opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity .15s, transform .15s;
  }
  .tools-menu.open { opacity: 1; transform: none; pointer-events: auto; }
  .tools-menu .tm-row { display: block; padding: 11px 12px; border-radius: 9px; color: var(--fg); }
  .tools-menu .tm-row:hover { background: var(--bg-hover); color: var(--fg); }
  .tools-menu .tm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
  .tools-menu .tm-name { font-size: 14px; font-weight: 700; color: var(--fg-strong); }
  .tools-menu .tm-desc { display: block; font-size: 12.5px; color: var(--fg-muted); line-height: 1.45; }
  .tools-menu .tm-sample { display: block; font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 5px; }
  .tools-menu .tm-quiet { color: var(--fg-muted); font-weight: 500; }
  .tools-menu .tm-foot {
    border-top: 1px solid var(--border-subtle); margin-top: 6px; padding: 10px 12px 6px;
    display: flex; justify-content: space-between; align-items: center;
  }
  .tools-menu .tm-foot span { font-size: 12px; color: var(--fg-muted); }
  .tools-menu .tm-foot a { font-size: 12.5px; font-weight: 600; }

  /* ── Account drawer ──────────────────────────────────────────────── */
  .panel-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,.32); z-index: 2500;
    opacity: 0; transition: opacity .18s;
  }
  .panel-backdrop.open { opacity: 1; }

  .acct-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw;
    background: var(--bg-surface); border-left: 1px solid var(--border-default);
    box-shadow: -10px 0 40px rgba(15,23,42,.12); z-index: 2700;
    display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .22s cubic-bezier(.4,0,.2,1);
  }
  .acct-drawer.open { transform: none; }
  .acct-drawer[hidden] { display: none; }
  .panel-backdrop[hidden] { display: none; }

  .ad-top { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px 0; }
  .ad-email { font-size: 12.5px; color: var(--fg-muted); word-break: break-all; }
  .ad-close { background: transparent; border: 0; cursor: pointer; color: var(--fg-muted);
              padding: 2px; border-radius: 6px; line-height: 0; }
  .ad-close:hover { background: var(--bg-hover); color: var(--fg-strong); }

  .ad-body { overflow-y: auto; padding: 0 20px 20px; flex: 1; }
  .ad-greet { font-size: 26px; font-weight: 700; color: var(--fg-strong);
              letter-spacing: -.4px; margin: 14px 0 4px; line-height: 1.15; }
  .ad-toplink { font-size: 13px; font-weight: 600; }
  .ad-plan { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; }
  .ad-plan .name { font-size: 15px; font-weight: 700; color: var(--fg-strong); }

  .ad-sec { margin-top: 22px; }
  .ad-sec-h { font-size: 11px; font-weight: 700; letter-spacing: .07em;
              text-transform: uppercase; color: var(--fg-muted); margin-bottom: 6px; }

  .ad-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
            padding: 11px 10px; margin: 0 -10px; border-radius: 8px;
            color: var(--fg-strong); font-size: 14px; }
  a.ad-row:hover { background: var(--bg-hover); color: var(--fg-strong); }
  .ad-row .r-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .ad-row .r-right { display: flex; align-items: center; gap: 8px; color: var(--fg-muted);
                     font-size: 13px; font-weight: 600; flex-shrink: 0; }
  .r-sub { font-size: 12px; color: var(--fg-muted); font-weight: 400; }
  .chev { width: 14px; height: 14px; color: var(--fg-faint); }
  .ad-count { font-variant-numeric: tabular-nums; }

  .ad-foot { border-top: 1px solid var(--border-subtle); padding: 12px 20px;
             display: flex; justify-content: space-between; align-items: center; }
  .ad-foot a { font-size: 13px; color: var(--fg-muted); font-weight: 500; }
  .ad-foot a:hover { color: var(--fg-strong); }

  /* Loading skeleton — the drawer's contents arrive on first open */
  .ad-skeleton { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; }
  .ad-skeleton .sk { display: block; height: 14px; border-radius: 6px;
                     background: linear-gradient(90deg, var(--bg-inset), var(--bg-hover), var(--bg-inset));
                     background-size: 200% 100%; animation: sk-shimmer 1.2s linear infinite; }
  .ad-skeleton .sk-lg { height: 26px; width: 62%; }
  .ad-skeleton .sk-sm { width: 40%; }
  @keyframes sk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
  @media (prefers-reduced-motion: reduce) {
    .ad-skeleton .sk { animation: none; }
    .acct-drawer, .tools-menu, .panel-backdrop { transition: none; }
  }

  /* ── Meters (shared: drawer + account page) ──────────────────────── */
  .meter-row { padding: 12px 10px; margin: 0 -10px; border-radius: 8px; }
  .meter-row.wide { margin: 0; padding: 14px 16px; background: var(--bg-surface);
                    border: 1px solid var(--border-default); margin-bottom: 10px; }
  .meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .meter-name { font-size: 14px; font-weight: 600; color: var(--fg-strong); }
  .meter-val { font-size: 12px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
  .meter-track { height: 6px; background: var(--slate-200); border-radius: 999px;
                 margin-top: 8px; overflow: hidden; }
  .meter-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s; }
  .meter-fill.warn { background: var(--amber-500); }
  .meter-note { font-size: 11.5px; color: var(--fg-muted); margin-top: 6px; }
  .meter-note a { font-weight: 600; }

  /* ── Offer cards (shared) ────────────────────────────────────────── */
  .offer-card { background: var(--bg-inset); border: 1px solid var(--border-default);
                border-radius: 10px; padding: 12px 13px; margin-top: 8px; }
  .offer-card .oc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .offer-card .oc-name { font-size: 13.5px; font-weight: 700; color: var(--fg-strong); }
  .offer-card .oc-desc { font-size: 12px; color: var(--fg-muted); margin-top: 2px; line-height: 1.45; }
  .offer-card .oc-links { margin-top: 8px; display: flex; gap: 14px; font-size: 12px; font-weight: 600; }

  /* ── Account page ────────────────────────────────────────────────── */
  .acct-page { padding: 34px 0 80px; }
  .acct-hero h1 { font-size: 30px; font-weight: 700; letter-spacing: -.5px;
                  color: var(--fg-strong); margin: 0 0 4px; }
  .acct-sub { font-size: 14px; color: var(--fg-muted); margin: 0 0 10px; }
  .acct-planline { display: flex; align-items: center; gap: 10px; }

  .acct-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 6px; }
  .acct-jump a { font-size: 13px; font-weight: 600; color: var(--fg);
                 background: var(--bg-surface); border: 1px solid var(--border-default);
                 padding: 6px 12px; border-radius: 999px; }
  .acct-jump a:hover { background: var(--bg-hover); color: var(--fg-strong); }

  .acct-sec { margin-top: 34px; scroll-margin-top: 96px; }
  .acct-sec > h2 { font-size: 17px; font-weight: 700; color: var(--fg-strong);
                   margin: 0 0 12px; }

  .acct-table { width: 100%; border-collapse: collapse; background: var(--bg-surface);
                border: 1px solid var(--border-default); border-radius: 10px; overflow: hidden; }
  .acct-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em;
                   text-transform: uppercase; color: var(--fg-muted);
                   padding: 10px 14px; border-bottom: 1px solid var(--border-default); }
  .acct-table td { padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--border-subtle); }
  .acct-table tr:last-child td { border-bottom: 0; }
  .acct-table .num { text-align: right; font-variant-numeric: tabular-nums; }
  .acct-table td .r-sub { margin-left: 6px; }

  .acct-qlist { list-style: none; margin: 0; padding: 0;
                background: var(--bg-surface); border: 1px solid var(--border-default);
                border-radius: 10px; overflow: hidden; }
  .acct-qlist .q-text { font-size: 14px; color: var(--fg-strong); }
  .acct-qlist .q-meta { font-size: 12px; color: var(--fg-muted); white-space: nowrap; flex-shrink: 0; }
  .acct-qlist .q-flag { color: var(--amber-500); font-weight: 600; }

  .acct-empty { background: var(--bg-surface); border: 1px dashed var(--slate-300);
                border-radius: 10px; padding: 22px; }
  .acct-empty p { margin: 0 0 4px; font-size: 14px; color: var(--fg-strong); }
  .acct-empty p.r-sub { color: var(--fg-muted); }

  .acct-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
  .acct-offers .offer-card { margin-top: 0; }

  .acct-dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 20px; margin: 0;
             background: var(--bg-surface); border: 1px solid var(--border-default);
             border-radius: 10px; padding: 18px 20px; }
  .acct-dl dt { font-size: 12px; font-weight: 700; letter-spacing: .05em;
                text-transform: uppercase; color: var(--fg-muted); }
  .acct-dl dd { margin: 0; font-size: 14px; color: var(--fg-strong); }

  /* ── Mobile ──────────────────────────────────────────────────────── */
  /* Interim: the drawer goes full-width and the dropdown spans the viewport.
     The proper small-screen answer is ONE hamburger sheet with Tools as a
     section inside it — that ships with the tool-pages IA work, not here. */
  @media (max-width: 720px) {
    .tools-menu { position: fixed; top: 76px; left: 8px; right: 8px; width: auto; }
    .acct-drawer { width: 100%; max-width: 100%; }
    .acct-dl { grid-template-columns: 1fr; gap: 4px 0; }
    .acct-dl dd { margin-bottom: 10px; }
  }

  /* ── Display-name form on /account#settings (2026-07-25) ─────────── */
  .acct-dl dd .r-sub { display: block; margin-top: 4px; }
  .name-form { display: flex; gap: 8px; align-items: center; max-width: 420px; }
  .name-form input[type="text"] {
    flex: 1; height: 34px; padding: 0 10px;
    background: var(--bg-inset); border: 1px solid var(--border-default);
    border-radius: 7px; color: var(--fg-strong);
    font-family: var(--font-sans); font-size: 14px; outline: none;
  }
  .name-form input[type="text"]:focus {
    border-color: var(--accent); box-shadow: var(--ring-focus);
  }
  .name-form button {
    height: 34px; padding: 0 14px; border: 0; border-radius: 7px; cursor: pointer;
    background: var(--accent); color: #fff;
    font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  }
  .name-form button:hover { background: var(--accent-hover); }

  .acct-flash { font-size: 13px; padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; }
  .acct-flash.ok   { background: #dcfce7; color: #15803d; }
  .acct-flash.warn { background: #fef3c7; color: #a16207; }
  .acct-flash code { font-family: var(--font-mono); font-size: 12px; }


  /* ══════════════════════════════════════════════════════════════════
     Auth pages  (base_auth.html — 2026-07-25)
     ------------------------------------------------------------------
     Replaces the hand-rolled dark card in login.html (#0f172a body,
     #1e293b card, system fonts, no logo). Same tokens as the rest of
     the site; no navigation, by design.
     ══════════════════════════════════════════════════════════════════ */

  .auth-body {
    min-height: 100vh;
    background: var(--bg-canvas);
    display: flex; align-items: center; justify-content: center;
    padding: 32px 20px;
  }

  .auth-shell {
    width: 100%; max-width: 420px;
    display: flex; flex-direction: column; align-items: center;
  }

  .auth-lockup { display: block; margin-bottom: 26px; }
  .auth-lockup svg { height: 62px; width: auto; display: block; }

  .auth-card {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 14px;
    padding: 32px 30px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  }

  .auth-title {
    font-size: 22px; font-weight: 700; letter-spacing: -.3px;
    color: var(--fg-strong); margin: 0 0 4px; text-align: center;
  }
  .auth-sub {
    font-size: 13.5px; color: var(--fg-muted); margin: 0 0 22px;
    text-align: center; line-height: 1.5;
  }

  .auth-flash {
    background: #fef3c7; color: #a16207;
    border-radius: 8px; padding: 10px 13px;
    font-size: 13px; margin-bottom: 16px;
  }

  .auth-form label {
    display: block; font-size: 12px; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase;
    color: var(--fg-muted); margin-bottom: 6px;
  }
  .auth-form input[type="text"],
  .auth-form input[type="email"],
  .auth-form input[type="password"] {
    width: 100%; height: 40px; padding: 0 12px; margin-bottom: 16px;
    background: var(--bg-inset);
    border: 1px solid var(--border-default); border-radius: 8px;
    color: var(--fg-strong);
    font-family: var(--font-sans); font-size: 14px;
    outline: none; transition: border-color .15s, box-shadow .15s;
  }
  .auth-form input::placeholder { color: var(--fg-faint); }
  .auth-form input:focus {
    border-color: var(--accent); box-shadow: var(--ring-focus);
  }

  .auth-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 42px; border: 0; border-radius: 8px; cursor: pointer;
    font-family: var(--font-sans); font-size: 14px; font-weight: 600;
    text-decoration: none; transition: background .15s, border-color .15s;
  }
  .auth-btn-primary { background: var(--accent); color: #fff; }
  .auth-btn-primary:hover { background: var(--accent-hover); color: #fff; }

  .auth-btn-secondary {
    background: var(--bg-surface); color: var(--fg);
    border: 1px solid var(--border-default);
  }
  .auth-btn-secondary:hover { background: var(--bg-hover); color: var(--fg-strong); }

  .auth-btn-google {
    background: var(--bg-surface); color: var(--fg-strong);
    border: 1px solid var(--border-default);
  }
  .auth-btn-google:hover { background: var(--bg-hover); color: var(--fg-strong); }

  /* "or" rule — a centred label on a hairline */
  .auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 16px 0; color: var(--fg-faint); font-size: 12px;
  }
  .auth-divider::before, .auth-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border-default);
  }

  .auth-aux { text-align: center; margin-top: 14px; }
  .auth-linkbtn {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--accent); font-family: var(--font-sans); font-size: 13px;
  }
  .auth-linkbtn:hover { color: var(--accent-hover); text-decoration: underline; }

  .auth-foot {
    font-size: 12.5px; color: var(--fg-muted); text-align: center;
    line-height: 1.55; margin: 18px 4px 0; max-width: 380px;
  }

  .auth-legal {
    margin-top: 22px; display: flex; gap: 8px; align-items: center;
    font-size: 12px; color: var(--fg-faint);
  }
  .auth-legal a { color: var(--fg-muted); }
  .auth-legal a:hover { color: var(--fg-strong); }

  @media (max-width: 480px) {
    .auth-card { padding: 26px 20px; }
    .auth-lockup svg { height: 54px; }
  }

  /* auth page extras — copy blocks, spinner, hints (2026-07-25) */
  .auth-copy { font-size: 14px; color: var(--fg); line-height: 1.6; margin: 0 0 14px; text-align: center; }
  .auth-hint { font-size: 12px; color: var(--fg-muted); margin: -8px 0 16px; }
  .auth-ok {
    background: #dcfce7; color: #15803d; border-radius: 8px;
    padding: 12px 14px; font-size: 13.5px; text-align: center;
  }
  .auth-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .auth-spinner {
    width: 26px; height: 26px; margin: 4px 0 14px;
    border: 3px solid var(--border-default); border-top-color: var(--accent);
    border-radius: 50%; animation: auth-spin .8s linear infinite;
  }
  @keyframes auth-spin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) { .auth-spinner { animation: none; } }


  /* ══════════════════════════════════════════════════════════════════
     Shared tool hero  (_partials/tool_hero.html — 2026-07-25)
     ------------------------------------------------------------------
     ONE hero band for Ask Upstate, CP Analyzer, and Planning
     Intelligence. Previously each carried its own gradient (navy /
     navy+purple / forest green) which read as three separate products.

     ⇩ CHANGE THE HERO COLOUR HERE AND NOWHERE ELSE ⇩
     All three tool pages move together. That is the point.
     ══════════════════════════════════════════════════════════════════ */
  :root {
    --tool-hero-from: #e9f1fd;   /* light blue, top-left  */
    --tool-hero-to:   #d8e7f8;   /* light blue, bottom-right */
    --tool-hero-fg:   #1e3a6b;   /* brand navy — text on the band */
  }

  .tool-hero {
    background: linear-gradient(135deg, var(--tool-hero-from) 0%, var(--tool-hero-to) 100%);
    border-bottom: 1px solid var(--border-default);
    color: var(--tool-hero-fg);
    padding: 40px 24px 36px;
  }
  .tool-hero__inner { max-width: 760px; margin: 0 auto; text-align: center; }

  .tool-hero__eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--blue-700);
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(30, 58, 107, .14);
    padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
  }
  /* Linked chip — report pages point theirs back at the tool (2026-07-26).
     Same pill, just clickable; the underline would fight the border. */
  a.tool-hero__eyebrow { text-decoration: none; transition: background .15s ease, border-color .15s ease; }
  a.tool-hero__eyebrow:hover,
  a.tool-hero__eyebrow:focus-visible { background: #fff; border-color: rgba(30, 58, 107, .32); }

  .tool-hero h1 {
    font-size: 34px; font-weight: 700; line-height: 1.2;
    letter-spacing: -.5px; margin: 0 0 10px; color: var(--tool-hero-fg);
  }
  .tool-hero h1 span { color: var(--accent); }

  .tool-hero p {
    font-size: 16px; line-height: 1.6; margin: 0 auto;
    max-width: 580px; color: rgba(30, 58, 107, .78);
  }

  @media (max-width: 620px) {
    .tool-hero { padding: 28px 18px 26px; }
    .tool-hero h1 { font-size: 26px; }
    .tool-hero p { font-size: 14.5px; }
  }

  /* ── Saved CP report, inline view (cp_report_inline.html, 2026-07-25) ─── */
  .cp-report-actions {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; padding: 16px 22px 0; font-size: 13px; font-weight: 600;
  }
  .cp-report-actions .cp-report-dl {
    border: 1px solid var(--border-default); border-radius: 7px;
    padding: 6px 12px; color: var(--fg);
  }
  .cp-report-actions .cp-report-dl:hover { background: var(--bg-hover); color: var(--fg-strong); }
  .cp-report-inline { padding-bottom: 60px; }


  /* ── Expandable question history (/account#ask-history, 2026-07-25) ───── */
  .acct-qlist { background: var(--bg-surface); border: 1px solid var(--border-default);
                border-radius: 10px; overflow: hidden; }

  .qa-item { border-bottom: 1px solid var(--border-subtle); }
  .qa-item:last-child { border-bottom: 0; }

  .qa-item > summary,
  .qa-item--flat {
    display: flex; align-items: baseline; gap: 10px;
    padding: 12px 14px; cursor: pointer; list-style: none;
  }
  .qa-item > summary::-webkit-details-marker { display: none; }   /* Safari */
  .qa-item > summary:hover { background: var(--bg-hover); }
  .qa-item--flat { cursor: default; }

  .qa-chev { width: 13px; height: 13px; flex-shrink: 0; color: var(--fg-faint);
             transition: transform .15s; align-self: center; }
  .qa-item[open] > summary .qa-chev { transform: rotate(90deg); }
  .qa-chev-spacer { width: 13px; flex-shrink: 0; }

  .qa-item .q-text { font-size: 14px; color: var(--fg-strong); flex: 1; }
  .qa-item .q-meta { font-size: 12px; color: var(--fg-muted); white-space: nowrap; flex-shrink: 0; }
  .qa-item .q-flag { color: var(--amber-500); font-weight: 600; }

  .qa-answer { padding: 2px 14px 18px 37px; font-size: 14px; line-height: 1.65; color: var(--fg); }
  .qa-answer > *:first-child { margin-top: 0; }
  .qa-answer > *:last-child  { margin-bottom: 0; }
  .qa-answer h1, .qa-answer h2, .qa-answer h3 {
    font-size: 14.5px; font-weight: 700; color: var(--fg-strong); margin: 16px 0 6px;
  }
  .qa-answer p { margin: 0 0 10px; }
  .qa-answer ul, .qa-answer ol { margin: 0 0 10px; padding-left: 20px; }
  .qa-answer li { margin-bottom: 4px; }
  .qa-answer strong { color: var(--fg-strong); }
  .qa-answer code { font-family: var(--font-mono); font-size: 12.5px;
                    background: var(--bg-inset); border: 1px solid var(--border-default);
                    border-radius: 4px; padding: 1px 5px; }
  .qa-answer table { border-collapse: collapse; margin: 4px 0 12px; font-size: 13px; width: 100%; }
  .qa-answer th, .qa-answer td { border: 1px solid var(--border-default); padding: 6px 10px; text-align: left; }
  .qa-answer th { background: var(--bg-inset); font-weight: 700; color: var(--fg-strong); }
  .qa-answer td { font-variant-numeric: tabular-nums; }

  @media (max-width: 620px) {
    .qa-item > summary, .qa-item--flat { flex-wrap: wrap; }
    .qa-item .q-meta { flex-basis: 100%; padding-left: 23px; }
    .qa-answer { padding-left: 14px; }
  }

/* ── Tool-page gating (UP_TOOL_GATING.md, 2026-07-28) ─────────────────────────
   The metered question meter (Ask Upstate + Planning Intelligence) and the
   locked banner (CP Analyzer). Visual sibling of .peer-lock above. */
.tool-gate-meter {
  margin: 10px 0 2px;
  font-family: 'Roboto', sans-serif;
}
.tool-gate-meter__row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-top: 6px;
  font-size: 12.5px; color: var(--muted, #6b7280);
}
.tool-gate-meter__label b { color: var(--text, #1b2620); font-weight: 700; }
.tool-gate-meter__left { flex: none; }
.tool-gate-meter__label--ok { font-size: 12.5px; color: var(--muted, #6b7280); }
.tool-gate-meter__label--warn { color: #a15c00; font-weight: 600; }
.tool-gate-bar {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--border, #e5e7eb);
}
.tool-gate-bar__fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--blue, #3b51a3); transition: width .35s ease;
}
.tool-gate-meter.is-exhausted .tool-gate-bar__fill { background: #d08700; }
.tool-gate-meter__cta {
  flex: none; font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: var(--blue, #3b51a3);
}
.tool-gate-meter__cta:hover { text-decoration: underline; }

.tool-gate-lock {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 4px 0 18px; padding: 14px 18px;
  background: #fbf6ec; border: 1px dashed #d0a24c; border-radius: 10px;
}
.tool-gate-lock__icon { flex: none; display: inline-flex; color: #a15c00; margin-top: 1px; }
.tool-gate-lock__icon svg { width: 20px; height: 20px; }
.tool-gate-lock__title {
  font-family: 'Cabin', sans-serif; font-weight: 700;
  font-size: 14px; color: var(--text, #1b2620); margin: 0 0 6px;
}
.tool-gate-lock__ctas { display: flex; flex-wrap: wrap; gap: 16px; }
.tool-gate-lock__cta {
  font-size: 13px; font-weight: 600; text-decoration: none; color: #a15c00;
}
.tool-gate-lock__cta:hover { text-decoration: underline; }
.tool-gate-lock__cta--primary { color: var(--blue, #3b51a3); }

/* action controls disabled by a gate (grayed + inert) */
.gate-disabled, .tool-gate-meter.is-exhausted ~ * .ask-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Turnstile widget on the anonymous Ask box (Phase B, 2026-07-28) */
.ts-wrap { margin: 10px 0 2px; min-height: 0; }
.ts-wrap .cf-turnstile { display: inline-block; }
