/* ============ Boil Water Advisory ============
   One stylesheet, no framework. Tokens first (light, then dark), then layout, components, pages.
   Mobile first: the base rules are the phone layout; the media queries widen it. */

:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-2: #f0f4f8;
  --surface-3: #e6edf4;
  --ink: #0f1b2d;
  --ink-2: #334458;
  --muted: #5f7186;
  --line: #dfe7ef;
  --line-strong: #c9d5e1;

  --brand: #0b5cad;
  --brand-strong: #0a3f78;
  --brand-soft: #e3f0fc;
  --aqua: #0ea5c6;
  --focus: #2b8cff;

  --alert: #c62828;
  --alert-soft: #fdecec;
  --warn: #a15c07;
  --warn-soft: #fff4dc;
  --ok: #157f43;
  --ok-soft: #e5f6ec;
  --dnd: #6d3fd0;
  --dnd-soft: #efe9fc;
  --dnu: #b4134a;
  --dnu-soft: #fde8ef;

  /* Map: one warm hue from pale to deep, so more advisories always reads as hotter. */
  --map-empty: #e4ebf2;
  --map-edge: #ffffff;
  --map-state: #9aaabb;
  --map-1: #fde68a;
  --map-2: #fbbf24;
  --map-3: #f97316;
  --map-4: #dc2626;
  --map-5: #8f1414;
  --map-highlight: #0b5cad;
  --map-unconf: #a8b4c2;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 6px 20px rgba(15, 27, 45, .06);
  --shadow-lg: 0 8px 24px rgba(15, 27, 45, .10), 0 24px 60px rgba(15, 27, 45, .12);
  --topbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1220;
    --surface: #101b2e;
    --surface-2: #15223a;
    --surface-3: #1c2c48;
    --ink: #e6edf6;
    --ink-2: #c3cfdd;
    --muted: #8fa1b7;
    --line: #22324d;
    --line-strong: #2f4366;
    --brand: #5aa9f5;
    --brand-strong: #8cc4fa;
    --brand-soft: #142c4a;
    --aqua: #38bdf8;
    --alert: #f26b6b;
    --alert-soft: #3a1820;
    --warn: #f0b552;
    --warn-soft: #382a10;
    --ok: #4ccf86;
    --ok-soft: #12321f;
    --dnd: #a78bfa;
    --dnd-soft: #261b48;
    --dnu: #fb7199;
    --dnu-soft: #3d1426;
    --map-empty: #1a2740;
    --map-edge: #0a1220;
    --map-state: #4a5d7c;
    --map-highlight: #5aa9f5;
    --map-unconf: #4a5d7c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* or a class's display (.btn's inline-flex) would win */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 1.05rem + .9vw, 1.6rem); font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- Environment banner ---------- */
.env-banner {
  background: repeating-linear-gradient(-45deg, #fff4dc, #fff4dc 12px, #ffeec4 12px, #ffeec4 24px);
  color: #6b4204;
  font-size: .85rem;
  text-align: center;
  padding: .4rem 1rem;
  border-bottom: 1px solid #f3d38b;
}
@media (prefers-color-scheme: dark) {
  .env-banner { background: #2b2210; color: #f0c674; border-color: #4a3a12; }
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-size: 1.08rem; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text span { color: var(--brand); }

.nav-toggle {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }

.nav {
  position: fixed;
  inset: var(--topbar-h) 0 auto 0;
  display: none;
  flex-direction: column;
  gap: .25rem;
  padding: 12px 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.nav.is-open { display: flex; }
.nav-link {
  display: block;
  padding: .7rem .85rem;
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.is-active { color: var(--brand); background: var(--brand-soft); }
.nav-quiet { font-weight: 500; color: var(--muted); }
.nav-form { margin: 0; }
.nav-cta { margin-top: .4rem; }

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-left: auto;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    gap: .15rem;
  }
  .nav-link { width: auto; padding: .5rem .75rem; font-size: .92rem; }
  .nav-cta { margin: 0 0 0 .5rem; }
}

/* ---------- Layout ---------- */
.main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 16px 56px; }
.main-wide { max-width: none; padding: 0 0 56px; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.stack > * + * { margin-top: 1rem; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-flush { padding: 0; overflow: hidden; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: .4rem; }
.lead { font-size: clamp(1rem, .95rem + .3vw, 1.15rem); color: var(--ink-2); max-width: 62ch; }
.breadcrumbs { font-size: .88rem; color: var(--muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: .35rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span[aria-hidden] { opacity: .6; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: .6rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #06172b; }
  .btn-primary:hover { color: #06172b; }
}
.btn-danger { background: var(--alert); border-color: var(--alert); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .88rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field + .field { margin-top: 14px; }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=search], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: .65rem .85rem;
  min-height: 46px;
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.form-row { display: grid; gap: 14px; }
@media (min-width: 700px) { .form-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.alert-box { border-radius: 12px; padding: 12px 14px; font-size: .95rem; border: 1px solid; }
.alert-box.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ink); }
.alert-box.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--ink); }
.alert-box.bad { background: var(--alert-soft); border-color: color-mix(in srgb, var(--alert) 35%, transparent); color: var(--ink); }
.field-error { color: var(--alert); font-size: .85rem; }

/* ---------- Search with suggestions ---------- */
.search { position: relative; display: flex; gap: 8px; width: 100%; max-width: 640px; }
.search input { flex: 1; min-width: 0; padding-left: 2.6rem; height: 54px; font-size: 1.05rem; border-radius: 14px; box-shadow: var(--shadow); }
.search .search-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search .btn { height: 54px; border-radius: 14px; padding: 0 1.2rem; }
.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  list-style: none;
  margin: 0;
}
.suggest[hidden] { display: none; }
.suggest li { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 10px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-2); }
.suggest .s-type { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); width: 52px; flex: none; }
.suggest .s-label { font-weight: 650; }
.suggest .s-detail { font-size: .85rem; color: var(--muted); margin-left: auto; text-align: right; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--aqua) 28%, transparent), transparent 60%),
    radial-gradient(900px 400px at -10% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 1240px; margin: 0 auto; padding: 36px 16px 28px; }
.hero h1 { max-width: 20ch; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--brand), var(--aqua)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { margin-bottom: 1.2rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .9rem; font-size: .88rem; color: var(--muted); }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-right: .35rem; box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: live 2s infinite; vertical-align: 1px; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat-value { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.stat-note { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.stat-note[hidden] { display: none; }
.stat-alert .stat-value { color: var(--alert); }

/* ---------- Explorer (map + list) ---------- */
.explorer { max-width: 1240px; margin: 20px auto 0; padding: 0 16px; display: grid; gap: 16px; }
@media (min-width: 1080px) { .explorer { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; } }

.map-card { padding: 14px; }
@media (min-width: 700px) { .map-card { padding: 18px; } }
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.map-when { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.map-when-label { font-weight: 800; font-size: 1.05rem; margin-right: .3rem; }
.map-when input[type=date] { width: auto; min-height: 38px; padding: .3rem .6rem; font-size: .92rem; border-radius: 10px; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: .35rem .8rem;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.map-frame { position: relative; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.us-map { width: 100%; display: block; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.us-map.is-zoomed { touch-action: none; cursor: grab; }
#us-map { position: relative; }
.us-map-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.us-map.is-dragging { cursor: grabbing; }
.map-county { fill: var(--map-empty); stroke: var(--map-edge); stroke-width: .6; vector-effect: non-scaling-stroke; transition: fill .25s; }
.map-county.c1 { fill: var(--map-1); }
.map-county.c2 { fill: var(--map-2); }
.map-county.c3 { fill: var(--map-3); }
.map-county.c4 { fill: var(--map-4); }
.map-county.c5 { fill: var(--map-5); }
.map-county.hl { fill: var(--map-highlight); }
/* Only unconfirmed notices here: hatched, so it reads as "maybe" next to the solid shades. */
.map-county.unconf { fill: url(#map-unconf-hatch); }
.map-hatch-bg { fill: var(--map-empty); }
.map-hatch-line { stroke: var(--map-unconf); stroke-width: .9; }
.map-county.dim, .map-severe.dim { opacity: .28; }
.us-map-overlay g.dim { opacity: .2; }
.map-states { fill: none; stroke: var(--map-state); stroke-width: 1.1; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-severe { fill: none; stroke: var(--dnd); stroke-width: 2.4; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-hover { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-selected { fill: none; stroke: var(--brand); stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-dot { fill: var(--map-4); stroke: #fff; vector-effect: non-scaling-stroke; stroke-width: 1.2; pointer-events: none; }
.map-pulse { fill: none; stroke: var(--map-4); vector-effect: non-scaling-stroke; stroke-width: 2; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .map-pulse, .live-dot { animation: none; } .map-county { transition: none; } }
.map-status { margin: 0; padding: 5rem 1rem; text-align: center; color: var(--muted); font-size: .95rem; }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom .icon-btn { box-shadow: var(--shadow); }
.map-back { position: absolute; left: 10px; top: 10px; box-shadow: var(--shadow); }
.map-back[hidden] { display: none; }
.map-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  font-size: .85rem;
  max-width: 280px;
}
.map-tip[hidden] { display: none; }
.map-tip-title { font-weight: 800; }
.map-tip-sub { color: var(--muted); }
.map-tip ul { margin: 6px 0 0; padding: 0 0 0 1rem; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.map-key { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.map-swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.map-swatch.ring { background: transparent !important; box-shadow: inset 0 0 0 2.5px var(--dnd); }
.map-swatch.dot { border-radius: 50%; background: var(--map-4); box-shadow: 0 0 0 2px color-mix(in srgb, var(--map-4) 30%, transparent); }
.map-swatch.unconf { background: repeating-linear-gradient(45deg, var(--map-unconf) 0 2px, var(--map-empty) 2px 4px); }

/* Timeline: a year of daily counts to scrub through. */
.timeline { margin-top: 14px; }
.timeline-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.timeline svg { width: 100%; height: 64px; display: block; cursor: pointer; touch-action: pan-y; }
.tl-area { fill: color-mix(in srgb, var(--brand) 22%, transparent); }
.tl-line { fill: none; stroke: var(--brand); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tl-cursor { stroke: var(--alert); stroke-width: 2; vector-effect: non-scaling-stroke; }
.tl-hover { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.tl-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* Advisory list (the side panel, and every list on the site). */
.panel { padding: 0; display: flex; flex-direction: column; max-height: none; }
@media (min-width: 1080px) { .panel { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); } }
.panel-head { padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: .5rem; }
.panel-head p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.panel-body { overflow-y: auto; flex: 1; }
.panel-foot { padding: 10px 16px; border-top: 1px solid var(--line); }
.count-badge { font-size: .78rem; background: var(--surface-3); color: var(--ink-2); border-radius: 999px; padding: .1rem .55rem; font-weight: 700; }

.adv-list { list-style: none; margin: 0; padding: 0; }
.adv { border-bottom: 1px solid var(--line); }
.adv:last-child { border-bottom: 0; }
.adv a { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.adv a:hover { background: var(--surface-2); }
.adv-icon { grid-row: span 3; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-top: 2px; }
.adv-icon svg { width: 20px; height: 20px; }
.adv-title { font-weight: 700; line-height: 1.3; }
.adv-meta { font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .1rem .6rem; }
.adv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.list-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.list-more { width: 100%; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; border-radius: 999px; padding: .15rem .55rem; white-space: nowrap; }
.kind-boil { color: var(--warn); background: var(--warn-soft); }
.kind-dnd { color: var(--dnd); background: var(--dnd-soft); }
.kind-dnu { color: var(--dnu); background: var(--dnu-soft); }
.status-active { color: var(--alert); background: var(--alert-soft); }
.status-lifted { color: var(--ok); background: var(--ok-soft); }
.status-unconfirmed { color: var(--warn); background: var(--warn-soft); }
.adv.is-unconfirmed .adv-title { color: var(--ink-2); font-weight: 600; }
.adv-icon.kind-boil { background: var(--warn-soft); color: var(--warn); }
.adv-icon.kind-dnd { background: var(--dnd-soft); color: var(--dnd); }
.adv-icon.kind-dnu { background: var(--dnu-soft); color: var(--dnu); }
.adv-icon.is-lifted { background: var(--ok-soft); color: var(--ok); }

/* Mobile bottom sheet for a tapped county. */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  max-height: 70vh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
  transform: translateY(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.is-open { transform: translateY(0); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
.sheet .panel-body { overflow-y: auto; }
@media (min-width: 1080px) { .sheet { display: none; } }

/* ---------- Callouts & info cards ---------- */
.cta-band {
  margin-top: 40px;
  border-radius: 22px;
  padding: 28px 22px;
  background: linear-gradient(120deg, var(--brand-strong), var(--brand) 55%, var(--aqua));
  color: #fff;
  display: grid;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; margin-bottom: .3rem; }
.cta-band p { margin: 0; opacity: .92; max-width: 56ch; }
.cta-band .btn { background: #fff; color: var(--brand-strong); border-color: #fff; }
@media (prefers-color-scheme: dark) { .cta-band { background: linear-gradient(120deg, #0b3a6d, #0b5cad 55%, #0e7490); } .cta-band .btn { color: #0a3f78; } }
@media (min-width: 760px) { .cta-band { grid-template-columns: 1fr auto; padding: 32px 36px; } }

.info-grid { display: grid; gap: 14px; margin-top: 16px; }
@media (min-width: 860px) { .info-grid { grid-template-columns: repeat(3, 1fr); } }
.info-card h3 { display: flex; gap: .6rem; align-items: center; }
.info-card p { color: var(--ink-2); font-size: .95rem; margin: 0; }
.info-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.info-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.callout { border-radius: 16px; padding: 16px 18px; border: 1px solid; display: flex; gap: 14px; }
.callout svg { width: 26px; height: 26px; flex: none; margin-top: 2px; }
.callout h3 { margin-bottom: .25rem; }
.callout p { margin: 0; }
.callout-boil { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--ink); }
.callout-boil svg { color: var(--warn); }
.callout-dnd { background: var(--dnd-soft); border-color: color-mix(in srgb, var(--dnd) 35%, transparent); }
.callout-dnd svg { color: var(--dnd); }
.callout-dnu { background: var(--dnu-soft); border-color: color-mix(in srgb, var(--dnu) 35%, transparent); }
.callout-dnu svg { color: var(--dnu); }
.callout-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.callout-ok svg { color: var(--ok); }

/* ---------- Advisory page ---------- */
.adv-head { display: grid; gap: 10px; }
.adv-head h1 { margin: 0; }
.adv-head .adv-where { font-size: 1.05rem; color: var(--ink-2); }
.adv-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.adv-layout { display: grid; gap: 16px; margin-top: 18px; }
@media (min-width: 980px) { .adv-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.facts div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 600; }
@media (max-width: 520px) { .facts div { grid-template-columns: 1fr; gap: 2px; } }
.notice-text { white-space: pre-line; color: var(--ink-2); }
.events { list-style: none; margin: 0; padding: 0; position: relative; }
.events li { position: relative; padding: 0 0 16px 26px; }
.events li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.events li::after { content: ''; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.events li:last-child::after { display: none; }
.events .ev-lifted::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.events .ev-unconfirmed::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.events strong { display: block; }
.mini-map { margin-top: 6px; }
.share { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Check page ---------- */
.verdict { display: flex; gap: 16px; align-items: flex-start; border-radius: 20px; padding: 22px; border: 1px solid; }
.verdict svg { width: 44px; height: 44px; flex: none; }
.verdict h2 { margin: 0 0 .3rem; }
.verdict p { margin: 0; color: var(--ink-2); }
.verdict-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.verdict-ok svg { color: var(--ok); }
.verdict-bad { background: var(--alert-soft); border-color: color-mix(in srgb, var(--alert) 35%, transparent); }
.verdict-bad svg { color: var(--alert); }
.choices { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.choices a { display: flex; justify-content: space-between; gap: 1rem; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 650; }
.choices a:hover { border-color: var(--brand); }
.choices span { color: var(--muted); font-weight: 500; font-size: .9rem; }

/* ---------- Tables (admin, lists) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--alert-soft); color: var(--alert); }
.pill.off { background: var(--surface-2); color: var(--muted); }

.filters { display: grid; gap: 12px; }
@media (min-width: 760px) { .filters { grid-template-columns: 2fr repeat(3, 1fr) auto; align-items: end; } }

/* ---------- Prose pages ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.8em; }
.prose li { margin-bottom: .4em; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.kind-cards { display: grid; gap: 12px; }
@media (min-width: 860px) { .kind-cards { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Footer ---------- */
.footer { background: #0b1830; color: #c9d6e6; margin-top: auto; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 36px 16px 20px; display: grid; gap: 28px; }
@media (min-width: 860px) { .footer-inner { grid-template-columns: 1.2fr 2fr; } }
.footer-brand strong { color: #fff; font-size: 1.05rem; }
.footer-brand p { font-size: .9rem; margin: .4rem 0 0; max-width: 46ch; }
.footer-note { opacity: .75; font-size: .82rem !important; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.footer-links h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #8ea3bd; margin-bottom: .6rem; }
.footer-links a { display: block; color: #dbe6f3; text-decoration: none; font-size: .9rem; padding: .2rem 0; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-base { border-top: 1px solid rgba(255,255,255,.08); text-align: center; font-size: .8rem; color: #8ea3bd; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }

/* ---------- Email previews (admin) ---------- */
.email-preview { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

@media print {
  .topbar, .footer, .env-banner, .map-zoom, .map-toolbar, .cta-band, .sheet { display: none !important; }
  body { background: #fff; }
}
