:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --text: #13202c;
  --muted: #5b6b7a;
  --border: #d9e0e7;
  --brand: #0f2f4a;
  --accent: #0b7a75;
  --accent-ink: #ffffff;
  --accent-soft: #d8f0ee;
  --alert-bg: #fde8e8;
  --alert-ink: #8a1c1c;
  --ok: #1e7b46;
  --ok-bg: #e2f4e9;
  --warn: #8a5a00;
  --warn-bg: #fdf1d8;
  --map-has: #9fd3cf;
  --map-has-hover: #0b7a75;
  --map-none: #e3e7ec;
  --map-state: #c9d6e2;
  --map-state-hover: #7fb7b2;
  --map-stroke: #ffffff;
  --map-sel: #f2a33a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 6px 20px rgba(16, 32, 48, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d141b;
    --surface: #152029;
    --surface-2: #1c2a35;
    --text: #e6edf3;
    --muted: #93a4b4;
    --border: #2a3a47;
    --brand: #0a1f30;
    --accent: #3fc1b8;
    --accent-ink: #062320;
    --accent-soft: #123c3a;
    --alert-bg: #3a1717;
    --alert-ink: #ffb4b4;
    --ok: #7fd9a3;
    --ok-bg: #143322;
    --warn: #f3c46b;
    --warn-bg: #3a2c10;
    --map-has: #2a6f6a;
    --map-has-hover: #3fc1b8;
    --map-none: #24323d;
    --map-state: #2b3d4b;
    --map-state-hover: #2f7b75;
    --map-stroke: #0d141b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar { background: var(--brand); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 0 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 1.25rem; letter-spacing: .01em; }
.tagline { margin: 0; font-size: .85rem; opacity: .8; }

.emergency { background: var(--alert-bg); color: var(--alert-ink); font-size: .9rem; padding: 8px 0; }
.emergency a { color: inherit; font-weight: 700; }

.tabs { display: flex; gap: 4px; margin: 20px 0 16px; background: var(--surface-2); padding: 4px; border-radius: 12px; width: fit-content; }
.tabs button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600;
  padding: 8px 20px; border-radius: 9px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.search { position: relative; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 6px 6px 14px; box-shadow: var(--shadow);
}
.search-box:focus-within { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.search-icon { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.search-box input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 1.05rem; padding: 10px 4px;
}
.btn-primary, .btn {
  border: 0; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  padding: 10px 18px; background: var(--accent); color: var(--accent-ink);
}
.btn { background: var(--surface-2); color: var(--text); }
.hint { color: var(--muted); font-size: .9rem; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 3px 12px; font: inherit; font-size: .85rem; cursor: pointer;
}
.chip:hover, .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent-soft); }

.suggestions {
  position: absolute; z-index: 10; left: 0; right: 0; top: 62px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.suggestions li { padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--surface-2); }
.suggestions .kind { color: var(--muted); font-size: .8rem; }

.status { color: var(--muted); margin: 18px 0 8px; min-height: 1.5em; }
.status strong { color: var(--text); }
.results { display: grid; gap: 12px; margin-bottom: 32px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.card h2 { margin: 0; font-size: 1.05rem; }
.card .where { color: var(--muted); font-size: .9rem; }
.entry { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 12px 0 0; }
.entry + .entry { border-top: 1px solid var(--border); margin-top: 12px; }
.agency { font-weight: 600; }
.area { color: var(--muted); font-size: .85rem; }
.meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .82rem; color: var(--muted); align-items: center; }
.call {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.05rem;
  padding: 10px 16px; border-radius: 12px; font-variant-numeric: tabular-nums;
}
.call svg { width: 18px; height: 18px; fill: currentColor; }
.badge { border-radius: 999px; padding: 1px 9px; font-weight: 600; font-size: .75rem; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.note { margin: 10px 0 0; font-size: .88rem; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.copy { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: .82rem; padding: 0; }

.crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 12px; font-size: .95rem; }
.crumbs li + li::before { content: "›"; color: var(--muted); margin: 0 6px 0 2px; }
.crumbs button { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.crumbs [aria-current] { font-weight: 600; }

.pickers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.pickers label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.pickers select {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; min-width: 0; width: 100%;
}
.pickers select:disabled { opacity: .55; }

.map-frame {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
#map, #map-ca { display: block; width: 100%; height: auto; aspect-ratio: 975 / 610; touch-action: manipulation; }
#map path, #map-ca path { vector-effect: non-scaling-stroke; stroke: var(--map-stroke); stroke-linejoin: round; }
#map .state, #map-ca .state { fill: var(--map-state); stroke-width: 1; cursor: pointer; transition: fill .15s; }
#map .state:hover, #map .state:focus, #map-ca .state:hover, #map-ca .state:focus { fill: var(--map-state-hover); outline: none; }
#map .state.dim, #map-ca .state.dim { fill: var(--map-none); opacity: .5; cursor: pointer; }
#map .county, #map-ca .county { stroke-width: .6; cursor: pointer; transition: fill .15s; }
#map .county.has, #map-ca .county.has { fill: var(--map-has); }
#map .county.none, #map-ca .county.none { fill: var(--map-none); }
#map .county:hover, #map .county:focus, #map-ca .county:hover, #map-ca .county:focus { fill: var(--map-has-hover); outline: none; }
#map .county.sel, #map-ca .county.sel { fill: var(--map-sel); }
#map .state-borders, #map-ca .state-borders { fill: none; stroke: var(--map-stroke); stroke-width: 1.6; pointer-events: none; }
.map-tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--bg);
  font-size: .8rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -130%);
}
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.legend { font-size: .82rem; color: var(--muted); display: flex; gap: 8px; align-items: center; margin: 8px 0 0; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw-has { background: var(--map-has); }
.sw-none { background: var(--map-none); border: 1px solid var(--border); margin-left: 8px; }

.footer { color: var(--muted); font-size: .82rem; padding-bottom: calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); padding-top: 12px; }
.fine { font-size: .75rem; }

@media (max-width: 600px) {
  .tabs { width: 100%; }
  .tabs button { flex: 1; }
  .pickers { grid-template-columns: 1fr; }
  .search-box .btn-primary { padding: 10px 12px; }
  .entry { grid-template-columns: 1fr; }
  .call { justify-content: center; }
  .suggestions { top: 60px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- location, notices, change requests, pin ---- */
.btn-location { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .92rem; padding: 8px 14px; }
.btn-location svg { width: 18px; height: 18px; fill: currentColor; }
.btn-small { font-size: .82rem; padding: 6px 12px; font-weight: 600; }
.address { color: var(--muted); font-size: .88rem; }
.unverified { color: var(--muted); font-size: .8rem; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border); }
.notice { margin: 0; font-size: .78rem; color: var(--muted); flex: 1 1 260px; }

.sheet { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.sheet::backdrop { background: rgba(10, 20, 30, .45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet h2 { margin: 0; font-size: 1.15rem; }
.icon-btn { border: 0; background: none; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.muted { color: var(--muted); font-size: .88rem; margin: 4px 0 12px; }
.field { display: grid; gap: 4px; margin: 0 0 12px; font-size: .85rem; font-weight: 600; color: var(--muted); border: 0; padding: 0; }
.field legend { padding: 0; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  font: inherit; font-weight: 400; font-size: .95rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; width: 100%; }
.field textarea { resize: vertical; }
.field ::placeholder { color: var(--muted); opacity: .75; }
.check { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-weight: 400; color: var(--text); font-size: .95rem; }
.error { color: var(--alert-ink); font-size: .85rem; min-height: 1.2em; margin: 0 0 8px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }

#map .pin path, #map-ca .pin path { fill: #d6452b; stroke: #fff; stroke-width: 1.2; }
#map .pin circle, #map-ca .pin circle { fill: #fff; }
[hidden] { display: none !important; }
.field .check input { width: auto; padding: 0; }

.kind-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.muted-num { color: var(--muted); font-size: .85rem; }
.city-lines:empty { display: none; }
.all-agencies { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.all-agencies summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }
.all-agencies .entry { padding-top: 10px; }

.country-switch { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 10px; margin: 0 0 12px; }
.country-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 600; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.country-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Support (tips), app store links, short messages */
.support { margin: 8px 0 16px; }
.btn-tip { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 420px;
  border: 0; border-radius: 14px; padding: 16px 22px; cursor: pointer; font: inherit; font-size: 1.15rem; font-weight: 800;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(11, 122, 117, .28); }
.btn-tip:hover { filter: brightness(1.06); }
.btn-tip:active { transform: translateY(1px); }
.btn-tip span { color: #ff8fa8; font-size: 1.3rem; line-height: 1; }
.get-app { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.store-link { display: inline-block; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .82rem; }
.store-link:hover { border-color: var(--accent); color: var(--accent); }
.tip-text { margin: 10px 0 14px; line-height: 1.45; }
.tip-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tip-amounts button { flex: 1 1 88px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 12px 10px; font: inherit; font-weight: 700; cursor: pointer; }
.tip-amounts button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tip-amounts button:disabled { opacity: .55; cursor: not-allowed; }
.money { display: flex; align-items: center; gap: 6px; }
.money span { font-weight: 700; color: var(--text); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); z-index: 50;
  max-width: calc(100vw - 32px); background: #13202c; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); opacity: 0; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#tip-error:empty, #tip-note:empty { display: none; }

/* Thank-you animation (js/celebrate.js): donut chase, ~2.6s, tap to skip */
.cz { position: fixed; inset: 0; z-index: 100; overflow: hidden; cursor: pointer; background: rgba(8, 16, 26, .72);
  animation: cz-in .18s ease-out both; -webkit-tap-highlight-color: transparent; }
.cz.cz-out { animation: cz-fade .18s ease-in both; }
.cz-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 0% 50%, rgba(255, 59, 59, .55), transparent 55%), radial-gradient(circle at 100% 50%, rgba(59, 123, 255, .55), transparent 55%);
  animation: cz-flash 1.2s ease-in-out .5s 1 both; }
.cz-title { position: absolute; left: 0; right: 0; top: 26%; margin: 0; text-align: center; color: #fff;
  font-size: clamp(1.8rem, 7vw, 2.8rem); font-weight: 800; text-shadow: 0 3px 12px rgba(0,0,0,.4); animation: cz-pop .5s cubic-bezier(.2, 1.4, .4, 1) .15s both; }
.cz-skip { position: absolute; left: 0; right: 0; bottom: calc(28px + env(safe-area-inset-bottom)); margin: 0; text-align: center;
  color: rgba(255,255,255,.75); font-size: .85rem; }
.cz-road { position: absolute; left: 0; right: 0; top: 52%; height: 120px; border-bottom: 3px dashed rgba(255,255,255,.35); }
/* Car and donut travel together so the car is always right on the donut's tail. */
.cz-convoy { position: absolute; bottom: 0; left: 0; display: flex; align-items: flex-end; will-change: transform;
  animation: cz-convoy 2.4s cubic-bezier(.4, .05, .6, .95) both; }
.cz-car-wrap { width: min(220px, 50vw); flex: none; animation: cz-chase .6s ease-in-out infinite alternate; }
.cz-donut-wrap { width: 60px; height: 60px; flex: none; margin-left: 28px; animation: cz-hop .3s ease-out infinite alternate; }
.cz-donut { width: 100%; height: 100%; animation: cz-roll .45s linear infinite; }
.cz-car { width: 100%; height: auto; display: block; }
.cz-red { animation: cz-blink .34s steps(1) infinite; }
.cz-blue { animation: cz-blink .34s steps(1) .17s infinite; }
.cz-wheel { transform-box: fill-box; transform-origin: center; animation: cz-roll .35s linear infinite; }
@keyframes cz-in { from { opacity: 0; } }
@keyframes cz-fade { to { opacity: 0; } }
@keyframes cz-pop { from { opacity: 0; transform: scale(.6); } }
@keyframes cz-roll { to { transform: rotate(360deg); } }
@keyframes cz-blink { 50% { opacity: .25; } }
@keyframes cz-convoy { from { transform: translateX(-100%); } to { transform: translateX(100vw); } }
@keyframes cz-chase { to { transform: translateX(14px); } }
@keyframes cz-hop { to { transform: translateY(-14px); } }
@keyframes cz-flash { 0%, 100% { opacity: 0; } 20% { opacity: 1; } 40% { opacity: .1; } 60% { opacity: 1; } 80% { opacity: .1; } }
@media (prefers-reduced-motion: reduce) { .cz { display: none; } }

/* Search-engine pages (tools/build_pages.py, website only) */
.brand-link { color: inherit; text-decoration: none; }
.brand-name { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: .01em; }
.seo-page { padding-top: 16px; padding-bottom: 24px; }
.crumbs-seo { font-size: .85rem; color: var(--muted); margin: 4px 0 10px; }
.seo-h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 14px; }
.seo-card { margin-bottom: 16px; }
.seo-card .agency { margin: 2px 0 10px; }
.seo-card .call { display: inline-block; text-decoration: none; }
.seo-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 0; font-size: .85rem; }
.seo-cta { margin: 0 0 14px; }
.seo-cta .btn-primary { display: inline-block; text-decoration: none; }
.seo-towns h2, .browse h2 { font-size: 1rem; margin: 18px 0 6px; }
.seo-list { columns: 2 180px; padding-left: 18px; line-height: 1.8; }
.browse { font-size: .85rem; line-height: 1.8; margin: 0 0 14px; }
.policy h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.policy p { line-height: 1.55; margin: 0 0 10px; }
