/* Self-hosted YRT type, with the same Latin and Latin Extended subsets. */
@font-face {
  font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/dm-serif-display-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/dm-serif-display-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Manrope; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/assets/fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Manrope; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/assets/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Serif Display Fallback"; font-style: normal; font-weight: 400;
  src: local("Georgia"), local("Times New Roman"), local("Liberation Serif"), local("DejaVu Serif");
  ascent-override: 103.6%; descent-override: 33.5%; line-gap-override: 0%; size-adjust: 97%;
}
@font-face {
  font-family: "Manrope Fallback"; font-style: normal; font-weight: 400 800;
  src: local("Arial"), local("Helvetica Neue"), local("Roboto"), local("DejaVu Sans");
  ascent-override: 106.6%; descent-override: 30%; line-gap-override: 0%; size-adjust: 101%;
}

:root {
  --navy: #07192f;
  --navy-2: #0d2747;
  --night: #041120;
  --red: #c8102e;
  --red-deep: #a00d25;
  --red-soft: #ff4d61;
  --bone: #efe9dd;
  --paper: #f8f5ee;
  --ink: #0b1626;
  --on-navy: rgba(239,233,221,.82);
  --muted: #a9b8cc;
  --rule-navy: rgba(239,233,221,.18);
  --tint-navy: rgba(239,233,221,.08);
  --on-paper: #4d5867;
  --rule-paper: rgba(7,25,47,.18);
  --input-rule: #788394;
  --water: #081a31;
  --amber: #f0a050;
  --head: "DM Serif Display", "DM Serif Display Fallback", Georgia, serif;
  --ui: Manrope, "Manrope Fallback", system-ui, sans-serif;
  --ease: cubic-bezier(.22,1,.36,1);
  --focus: var(--red-soft);
  --bar: 76px;
  --radius: 16px;
  --control-radius: 12px;
  color-scheme: dark;
  scrollbar-color: #53667e transparent;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--night); color: var(--bone); font: 500 14px/1.55 var(--ui); }
body.modal-open { overflow: hidden; }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
::selection { background: var(--red-deep); color: #fff; }
:is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* Masthead and shared actions */
.masthead { position: sticky; top: 0; z-index: 40; background: var(--navy); color: var(--bone); border-bottom: 1px solid var(--rule-navy); --focus: var(--red-soft); }
.masthead-bar { height: calc(var(--bar) - 1px); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 clamp(20px, 3.5vw, 54px); }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; color: var(--bone); text-decoration: none; font: 400 28px/1 var(--head); letter-spacing: -.02em; }
.brand-mark { flex: none; }
.top-actions { display: flex; align-items: center; gap: 24px; }
.top-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--bone); text-decoration: none; white-space: nowrap; font: 800 12px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; }
.top-link:hover { text-decoration: underline; }
.top-actions .btn { border-radius: 999px; padding-inline: 22px; }
.btn, .search-btn { appearance: none; min-height: 44px; border: 1px solid transparent; border-radius: var(--control-radius); padding: 9px 16px; cursor: pointer; font: 800 11px/1.3 var(--ui); letter-spacing: .12em; text-transform: uppercase; transition: background .22s var(--ease), border-color .22s var(--ease), color .22s var(--ease); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; text-align: center; }
.btn-primary, .search-btn { background: var(--red); color: #fff; }
.btn-primary:hover, .search-btn:hover { background: var(--red-deep); }
.btn-ghost { border-color: var(--rule-navy); color: var(--bone); background: transparent; }
.btn-ghost:hover { border-color: var(--bone); background: var(--tint-navy); }
.btn[disabled] { opacity: .65; cursor: progress; }
.link-btn { display: inline-flex; align-items: center; border: 0; background: none; padding: 0; min-height: 44px; cursor: pointer; font: 750 12px var(--ui); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--red-soft); }

/* Desktop map fills the workspace; only the inner guide scrolls. */
.workspace { --edge: 20px; --guide: clamp(382px, 30vw, 440px); --map-left: calc(var(--guide) + 2 * var(--edge)); position: relative; display: grid; height: calc(100dvh - var(--bar)); min-height: 500px; isolation: isolate; }
.map-pane { grid-area: 1 / 1; position: relative; z-index: 0; background: var(--water); min-width: 0; overflow: hidden; }
.guide-pane { grid-area: 1 / 1; z-index: 20; align-self: stretch; justify-self: start; min-height: 0; width: var(--guide); margin: var(--edge); border: 1px solid var(--rule-navy); border-radius: var(--radius); background: var(--navy-2); overflow: hidden; }
.guide-scroll { height: 100%; display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.guide-scroll > * { flex-shrink: 0; }

/* Search and navigation */
.search-box { position: sticky; top: 0; z-index: 2; background: var(--navy-2); border-bottom: 1px solid var(--rule-navy); padding: 16px 16px 11px; }
.search-row { display: flex; align-items: center; min-height: 56px; background: #fff; border-radius: var(--control-radius); padding: 5px; color-scheme: light; }
.search-row:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.search-row .search-btn { flex: none; min-height: 46px; padding-inline: 20px; border-radius: 8px; }
.search-row .search-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.search-icon { flex: none; width: 19px; height: 19px; margin-left: 10px; fill: none; stroke: #5c697b; stroke-width: 1.8; stroke-linecap: round; }
.search-row input { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--ink); font: 600 16px var(--ui); }
.search-row input:focus-visible { outline: none; }
.search-row input::placeholder { color: #5c697b; opacity: 1; }
@media (max-width: 360px) {
  .search-row .search-btn { padding-inline: 10px; }
  .search-row input::placeholder { font-size: 13px; }
}
.search-suggestions { margin-top: 9px; overflow: hidden; border: 1px solid var(--rule-navy); border-radius: var(--control-radius); }
.sugg-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--rule-navy); background: var(--navy); cursor: pointer; text-align: left; }
.sugg-item:last-child { border-bottom: 0; }
.sugg-item:hover { background: var(--tint-navy); }
.sugg-item:focus-visible { outline-offset: -3px; }
.sugg-tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.search-status, .search-privacy { margin: 7px 0 0; font-size: 11px; color: var(--muted); }
.search-status:empty, .crumb-bar:empty { display: none; }
.crumb-bar { display: flex; align-items: center; gap: 0 9px; flex-wrap: wrap; padding: 0 22px; border-bottom: 1px solid var(--rule-navy); font: 750 12px/1.3 var(--ui); color: var(--muted); }
.crumb-bar button { min-height: 44px; border: 0; background: none; padding: 0; color: var(--on-navy); font: inherit; cursor: pointer; }
.crumb-bar button:hover { text-decoration: underline; }
.crumb-bar .cur { color: var(--bone); }

/* Guide hierarchy and record details */
.guide-body { display: flex; flex: 1; flex-direction: column; gap: 16px; padding: 20px 22px 24px; min-width: 0; }
.guide-body.view-enter { animation: view-in .24s var(--ease) both; }
@keyframes view-in { from { opacity: .68; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.loading-state { display: flex; align-items: center; gap: 10px; padding: 20px 0; color: var(--on-navy); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--rule-navy); border-top-color: var(--red-soft); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card { min-width: 0; padding: 16px; background: var(--navy-2); border: 1px solid var(--rule-navy); border-radius: var(--radius); overflow-wrap: anywhere; }
.directory-card { padding: 0; background: none; border: 0; border-radius: 0; }
.card-selected { border-color: var(--muted); scroll-margin-top: 102px; }
.card :is(h1,h2,h3), .home-intro h1 { margin: 0; color: var(--bone); font: 400 26px/1.08 var(--head); letter-spacing: -.02em; }
.card h1, .home-intro h1 { font-size: 38px; }
.card h3 { font-size: 21px; }
.home-intro { margin-bottom: 8px; }
.home-intro h1 { text-wrap: balance; }
.home-intro h1 strong { color: var(--red-soft); font-weight: 400; }
.eyebrow { margin: 0 0 6px; color: var(--red-soft); font: 800 11px/1.4 var(--ui); letter-spacing: .14em; text-transform: uppercase; }
.subcopy, .lede { margin: 7px 0 0; font-size: 15px; line-height: 1.55; color: var(--on-navy); }
.national-totals, .fine { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.title-row, .card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-head { margin-bottom: 12px; }
.card-kicker { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.count-note, .mini-label { color: var(--muted); font: 700 12px var(--ui); }
.mini-label { margin: 0 0 6px; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 15px; border-block: 1px solid var(--rule-navy); }
.kpi { min-width: 0; padding: 11px 8px 11px 0; }
.kpi + .kpi { padding-left: 10px; border-left: 1px solid var(--rule-navy); }
.kpi strong { display: block; font: 400 29px/1 var(--head); }
.kpi span { display: block; margin-top: 6px; color: var(--on-navy); font: 600 11px/1.35 var(--ui); }
.kpi .is-pending { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; font: 700 11px/1.3 var(--ui); background: var(--tint-navy); color: var(--bone); }
.badge .dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.b-open, .b-live { background: color-mix(in srgb, var(--red-soft) 12%, var(--navy)); color: var(--red-soft); }
.b-partial { background: rgba(240,160,80,.12); color: var(--amber); }
.b-pending { color: var(--muted); }
.b-private { border: 1px solid var(--rule-navy); flex-shrink: 0; }
.private-roster { --focus: var(--red-soft); background: var(--navy); color: var(--bone); }
.private-roster h2 { text-wrap: balance; }
.private-roster .btn { margin-top: 14px; }
.seo-page .private-roster { margin: 16px 0; }
.seo-page .private-roster :is(h2, p) { margin: 0 0 6px; }
.seo-page .private-roster h2 { color: var(--bone); }
.is-open-seat { color: var(--red-soft); }
.inline-filter { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--rule-navy); border-radius: var(--control-radius); background: var(--tint-navy); color: var(--bone); font: 600 14px var(--ui); }
.inline-filter::placeholder { color: var(--muted); opacity: 1; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.pill-btn { min-height: 44px; padding: 0 10px; border: 1px solid var(--rule-navy); border-radius: 999px; background: transparent; color: var(--on-navy); cursor: pointer; font: 750 12px var(--ui); font-variant-numeric: tabular-nums; }
.pill-btn:hover { color: var(--bone); border-color: var(--bone); }
.pill-btn.active { background: var(--bone); color: var(--navy); border-color: var(--bone); }

/* Number-led directory rows */
.list-wrap { border-top: 1px solid var(--rule-navy); }
.row-btn { width: 100%; min-height: 58px; padding: 8px 2px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid var(--rule-navy); background: transparent; text-align: left; cursor: pointer; }
.row-btn:hover, .row-btn.selected { background: var(--tint-navy); }
.row-btn:hover .row-title-text { text-decoration: underline; text-underline-offset: 3px; }
.row-main { min-width: 0; flex: 1; }
.row-title { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; font: 700 15px/1.3 var(--ui); }
.row-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-right { max-width: 49%; flex-shrink: 0; text-align: right; display: flex; justify-content: flex-end; align-items: baseline; gap: 7px; }
.row-num { font: 400 24px/1 var(--head); color: var(--bone); font-variant-numeric: tabular-nums; }
.row-num.open { color: var(--red-soft); }
.row-num.is-pending, .row-unit, .list-more { color: var(--muted); }
.row-unit { font-size: 11px; line-height: 1.3; }
.list-more { margin-bottom: 0; font-size: 12px; }

.meta-list, .seat-list, .dist-list { margin: 12px 0 0; padding: 0; border-top: 1px solid var(--rule-navy); list-style: none; }
.meta-list li, .dist-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule-navy); }
.meta-list .mk, .dist-list .dk { color: var(--muted); font: 700 12px/1.5 var(--ui); }
.meta-list .mk { flex: 0 0 10ch; overflow-wrap: normal; }
.meta-list .mv, .dist-list .dv { min-width: 0; text-align: right; font: 650 13px/1.5 var(--ui); }
.dist-list .dk b, .dist-list .dv small { display: block; }
.dist-list .dk b { font: 400 22px/1.2 var(--head); color: var(--bone); }
.dist-list .dv small { font-weight: 500; color: var(--muted); }
.pty { display: inline-block; margin-left: 6px; min-width: 17px; border-radius: 4px; background: var(--tint-navy); color: var(--on-navy); font-size: 11px; text-align: center; }
.vote-line, .seat-summary { margin: 10px 0 0; color: var(--on-navy); font-size: 13px; }
.vote-bar { display: flex; gap: 2px; height: 6px; margin-top: 7px; background: var(--rule-navy); border-radius: 999px; overflow: hidden; }
.vote-bar i { background: var(--on-navy); }
.vote-bar i + i { background: var(--muted); opacity: .55; }
.seat { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--rule-navy); }
.seat-role { color: var(--muted); font-size: 12px; }
.seat-holder { font-weight: 700; }
.seat-note { margin: 8px 0 0; color: var(--on-navy); font-size: 13px; }
.selected-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.selected-head .title-row { justify-content: flex-start; }
.method summary, .local-units summary { cursor: pointer; font-weight: 700; min-height: 44px; align-content: center; }
.method:not([open]) { padding-block: 2px; }
.county-admin .summary-meta { color: var(--muted); font-weight: 600; font-size: 12px; }
.routing-note { margin-top: 8px; }
.prov-box { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--rule-navy); color: var(--muted); font-size: 12px; }
.data-vintage { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.data-vintage .is-stale { color: var(--amber); }
.data-vintage .link-btn { text-align: start; }
.seo-page .data-vintage { color: var(--on-paper); }
.seo-page .data-vintage .is-stale { color: #8a460c; }
.cta-stack { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.cta-stack .btn { flex: 1 1 auto; }
.chair-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 9px; color: var(--on-navy); font-size: 13px; }
.chair-row strong { color: var(--bone); }
.county-contact { display: grid; gap: 6px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rule-navy); font-size: 13px; }
.county-contact > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: baseline; gap: 8px; }
.county-contact dt { color: var(--muted); }
.county-contact dd { margin: 0; }
.county-contact dd a:not(.src-icon) { display: inline-flex; align-items: center; min-height: 44px; }
.src, .src-unknown, .is-unknown { color: var(--muted); }
.src-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; margin-left: 6px; border-radius: 6px; text-decoration: none; vertical-align: middle; }
.county-contact .src-icon, .chair-row .src-icon { min-width: 44px; min-height: 44px; margin-left: 8px; }
.src-icon:hover { background: var(--tint-navy); }
.src-unknown { padding-inline: 4px; font-size: 12px; }
.src:hover { color: var(--bone); }
.local-units { margin: 6px 0; font-size: 13px; }
.local-units ul { max-height: 260px; overflow: auto; margin: 0 0 6px; padding-left: 18px; }
.guide-footer { margin-top: auto; padding: 14px 22px; background: var(--navy); color: var(--muted); border-top: 1px solid var(--rule-navy); }
.guide-footer p { margin-block: 0; font-size: 12px; }
.guide-footer p + p { margin-top: 8px; }

/* Map controls, hints, and attribution */
.map-canvas { position: absolute; inset: 0; }
.map-canvas canvas:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
#district-select { display: none; }
.map-loading { position: absolute; top: 50%; left: calc(var(--map-left) + (100% - var(--map-left)) / 2); translate: -50% -50%; z-index: 2; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid var(--rule-navy); border-radius: var(--control-radius); background: rgba(7,25,47,.94); color: var(--on-navy); font: 600 13px/1.3 var(--ui); pointer-events: none; }
.map-hud, .map-jump, .overlay-switch, .map-legend, .map-hint, .map-tip, .map-toast { position: absolute; z-index: 1; border: 1px solid var(--rule-navy); border-radius: var(--control-radius); background: rgba(7,25,47,.95); color: var(--bone); }
.overlay-switch { top: var(--edge); left: var(--map-left); display: flex; gap: 2px; padding: 4px; max-width: calc(100% - var(--map-left) - var(--edge)); overflow-x: auto; scrollbar-width: none; border-radius: 999px; background: rgba(7,25,47,.85); }
/* Narrow screens: fade the right edge so the hidden district tabs read as "swipe for more". */
@media (max-width: 640px) {
  .overlay-switch { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 28px; }
  .overlay-switch.at-end { -webkit-mask-image: none; mask-image: none; }
}
.fill-mode, .district-tabs { display: flex; flex: none; gap: 2px; }
.ov-btn { flex: none; min-height: 38px; padding: 0 13px; border: 0; border-radius: 999px; color: var(--bone); background: transparent; font: 750 12px var(--ui); cursor: pointer; white-space: nowrap; }
.ov-btn:hover:not(:disabled) { background: var(--tint-navy); }
.ov-btn.active, .ov-btn.active:hover { background: var(--red); color: #fff; }
.ov-btn:disabled { color: var(--muted); cursor: default; }
.ov-btn:focus-visible, .hud-btn:focus-visible { outline-offset: -3px; }
.mobile-bar, .mobile-view, .mobile-help-link { display: none; }
.map-jump { top: calc(var(--edge) + 58px); left: var(--map-left); z-index: 2; }
.map-jump summary { min-height: 44px; align-content: center; padding: 0 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.map-jump .hud-btn { width: 100%; border-top: 1px solid var(--rule-navy); font-size: 12px; }
.map-hud { top: 50%; right: var(--edge); translate: 0 -50%; display: flex; flex-direction: column; align-items: center; }
.hud-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 19px; }
.hud-btn:hover { background: var(--tint-navy); }
#btn-us-fit { border-top: 1px solid var(--rule-navy); border-radius: 0 0 10px 10px; }
.zoom-slider { writing-mode: vertical-lr; direction: rtl; appearance: none; width: 44px; height: 108px; padding: 10px 0; margin: 0; background: transparent; cursor: ns-resize; border-top: 1px solid var(--rule-navy); accent-color: var(--red-soft); }
.zoom-slider:focus-visible { outline-offset: -3px; }
.zoom-slider::-webkit-slider-runnable-track { width: 4px; border-radius: 4px; background: #53667e; }
.zoom-slider::-moz-range-track { width: 4px; border-radius: 4px; background: #53667e; }
.zoom-slider::-webkit-slider-thumb { appearance: none; width: 17px; height: 17px; margin-left: -6.5px; border: 3px solid var(--red-soft); border-radius: 50%; background: var(--navy); }
.zoom-slider::-moz-range-thumb { width: 11px; height: 11px; border: 3px solid var(--red-soft); border-radius: 50%; background: var(--navy); }
.map-tip { z-index: 3; top: 0; left: 0; max-width: min(265px, 80%); padding: 9px 13px; pointer-events: none; font-size: 12px; }
.map-tip strong { display: block; font: 400 20px/1.2 var(--head); }
.map-tip span, .map-tip em { display: block; margin-top: 3px; color: var(--on-navy); font-style: normal; }
.map-tip .tip-hint { border-top: 1px solid var(--rule-navy); margin-top: 6px; padding-top: 5px; }
.map-hint { margin: 0; padding: 7px 12px; bottom: 103px; left: var(--map-left); font-size: 12px; color: var(--on-navy); pointer-events: none; }
.map-legend { left: var(--map-left); bottom: 32px; max-width: calc(100% - var(--map-left) - var(--edge)); padding: 9px 13px; font: 600 11px/1.35 var(--ui); }
.map-legend:empty { display: none; }
.leg-title { margin: 0 0 5px; color: var(--bone); font-weight: 800; }
.leg-items { display: flex; flex-wrap: wrap; gap: 5px 13px; align-items: center; color: var(--on-navy); }
.leg-item, .leg-steps { display: inline-flex; align-items: center; gap: 5px; }
.leg-steps { gap: 0; border-radius: 2px; overflow: hidden; }
.swatch { width: 11px; height: 11px; display: inline-block; flex: none; border: 1px solid var(--rule-navy); border-radius: 2px; }
.leg-steps .swatch { border: 0; border-radius: 0; }
.map-toast { top: calc(var(--edge) + 57px); left: var(--map-left); z-index: 3; max-width: calc(100% - var(--map-left) - 70px); padding: 9px 13px; font-size: 13px; }
.map-pane .maplibregl-ctrl-attrib { border-radius: 10px; background: var(--navy); color: var(--muted); font: 600 11px/20px var(--ui); }
.map-pane .maplibregl-ctrl-attrib a { color: var(--on-navy); }
.map-pane .maplibregl-ctrl-attrib-button { filter: invert(1); }
.map-pane .maplibregl-ctrl-attrib.maplibregl-compact-show { padding-bottom: 2px; }

/* Paper forms retain the existing modal and focus handling. */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(4,17,32,.76); }
.modal-card { --focus: var(--red); color-scheme: light; color: var(--ink); display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); background: var(--paper); border: 1px solid var(--rule-paper); border-radius: var(--radius); overflow: hidden; }
.modal-head { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--rule-paper); }
.modal-head h2 { margin: 0; font: 400 30px/1.1 var(--head); letter-spacing: -.02em; }
.modal-close { flex: none; width: 44px; height: 44px; border: 1px solid var(--rule-navy); border-radius: var(--control-radius); background: transparent; font-size: 22px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: var(--tint-navy); }
.modal-card .modal-close, .modal-card .btn-ghost { border-color: var(--input-rule); color: var(--ink); }
.modal-card .modal-close:hover, .modal-card .btn-ghost:hover { background: #efe9dd; border-color: var(--ink); }
.modal-form { display: flex; flex-direction: column; gap: 12px; padding: 14px 20px 0; overflow: auto; overscroll-behavior: contain; scroll-padding-block: 12px 76px; }
.modal-form > * { flex-shrink: 0; }
.form-context { padding: 10px 12px; background: var(--bone); border-radius: var(--control-radius); color: var(--on-paper); font-size: 13px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modal-form label { display: flex; flex-direction: column; min-width: 0; gap: 5px; font: 700 13px/1.3 var(--ui); }
.modal-form :is(input, select, textarea) { min-height: 44px; min-width: 0; padding: 0 10px; background: #fff; color: var(--ink); border: 1px solid var(--input-rule); border-radius: var(--control-radius); font: 500 14px var(--ui); }
.modal-form input::placeholder, .modal-form textarea::placeholder { color: var(--on-paper); opacity: 1; }
.modal-form textarea { padding-block: 8px; resize: vertical; }
.form-note summary { min-height: 44px; align-content: center; cursor: pointer; color: var(--on-paper); font-size: 13px; }
.consent-group { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.consent-group legend { padding: 0; margin-bottom: 6px; font-weight: 750; }
.modal-form .check-row { flex-direction: row; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--rule-paper); border-radius: var(--control-radius); font: 500 12px/1.55 var(--ui); cursor: pointer; }
.modal-form .check-row input { flex: none; min-height: 0; width: 18px; height: 18px; margin: 1px 0 0; padding: 0; accent-color: var(--red); }
.check-row:has(input:checked) { border-color: var(--ink); }
.consent-tag { margin-right: 3px; color: var(--red-deep); }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form-msg { padding: 10px 12px; font-size: 13px; font-weight: 750; border: 1px solid var(--rule-paper); border-radius: var(--control-radius); }
.form-msg.ok { background: #e9f1e8; color: #2d5438; }
.form-msg.err { background: #f9e8e5; color: var(--red-deep); }
.modal-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 0 -20px; padding: 10px 20px; background: var(--paper); border-top: 1px solid var(--rule-paper); }
.ask-destinations { display: flex; flex-wrap: wrap; gap: 0 14px; font-size: 13px; }
.ask-destinations p { flex: 0 0 100%; margin: 0; overflow-wrap: anywhere; }
.ask-destinations a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 960px) {
  :root { --bar: 64px; }
  .masthead-bar { padding-inline: 16px; }
  .brand { gap: 8px; font-size: 25px; }
  .brand-mark { width: 29px; height: 29px; }
  .top-actions { gap: 12px; }
  .top-actions .btn { padding-inline: 15px; }
  .workspace { --edge: 10px; --map-left: var(--edge); display: flex; flex-direction: column; height: auto; min-height: 0; }
  .map-pane { order: -1; height: 44dvh; min-height: 330px; }
  .guide-pane { width: auto; margin: 0; border: 0; border-top: 1px solid var(--rule-navy); border-radius: 0; }
  .guide-scroll { height: auto; overflow: visible; }
  .search-box { position: relative; padding: 14px 16px 10px; }
  .guide-body { padding: 18px 16px 24px; }
  .crumb-bar { padding-inline: 16px; }
  .card h1, .home-intro h1 { font-size: 34px; }
  .inline-filter { font-size: 16px; }
  .card-selected { scroll-margin-top: calc(var(--bar) + 10px); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 16px 0; }
  .mobile-view { display: flex; align-self: start; gap: 2px; padding: 3px; border: 1px solid var(--rule-navy); border-radius: 999px; }
  .workspace[data-mobile-view="list"] .map-pane { display: none; }
  .workspace[data-mobile-view="list"] .guide-pane { border-top: 0; }
  .map-loading { left: 50%; }
  .overlay-switch .ov-btn, .mobile-view .ov-btn { min-height: 44px; }
  .overlay-switch { scroll-padding-inline: 5px; }
  .map-hud { top: 64px; translate: none; }
  .zoom-slider { height: 56px; }
  .map-legend { bottom: 29px; }
  .map-hint { display: none; }
  .map-jump { top: 64px; }
  .modal-backdrop { align-items: end; padding: 8px; }
  .modal-card { max-height: calc(100dvh - 16px); }
  .modal-head { padding-inline: 14px; }
  .modal-head h2 { font-size: 26px; }
  .modal-form { padding-inline: 14px; }
  .modal-form :is(input, select, textarea):not([type=checkbox]) { font-size: 16px; }
  .modal-actions { margin-inline: -14px; padding-inline: 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  .top-link { display: none; }
  .mobile-help-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-navy); font: 700 12px/1.2 var(--ui); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
  .mobile-help-link:hover { color: var(--bone); }
  .field-full-mobile { grid-column: 1 / -1; }
  /* Preserve the upstream compact district picker on phones. */
  .overlay-switch .district-tabs { display: none; }
  #district-select { display: block; flex: none; min-height: 44px; max-width: 132px; padding: 0 28px 0 12px; border: 0; border-radius: 999px; color: var(--bone); background: transparent; font: 750 12px var(--ui); }
  #district-select:disabled { opacity: .5; }
  #district-select option { color: #07192f; background: #fff; }
  .row-right { gap: 5px; }
  .row-sub { white-space: normal; }
  .row-unit { max-width: 12ch; }
  .map-pane .maplibregl-ctrl-attrib.maplibregl-compact-show { max-width: calc(100vw - 20px); }
  .map-legend { bottom: 39px; }
}
@media (hover: none) { .map-tip { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
