/* Source Serif 4 (Adobe, SIL Open Font License: fonts/OFL-source-serif-4.txt), self-hosted: headings only */
@font-face {
  font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-wght.woff2?v=1") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}

:root {
  --bg: #faf8f4;
  --fg: #1d2327;
  --ink: #13202a;
  --muted: #5d6870;
  --card: #fff;
  --border: #e3ddd2;
  --accent: #17635f;
  --accent-dark: #0f4a47;
  --brand: #0e3b3a;       /* the hero band */
  --cream: #f3ecdf;       /* alternate section bands */
  --gold: #e8c46a;
  --shadow: 0 1px 2px rgba(16, 32, 48, 0.06), 0 4px 14px rgba(16, 32, 48, 0.06);
  --warn-bg: #fff6e0;
  --warn-border: #e8c46a;
  --radius: 8px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.01em; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; }
.card h2, .side h2 { font-family: inherit; font-weight: 700; letter-spacing: -0.01em; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.sub { margin: 0 0 0.75rem; color: var(--muted); }

.search { display: flex; gap: 0.5rem; max-width: 640px; }
.search input {
  flex: 1; min-width: 0; padding: 0.6rem 0.75rem; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.search button, button {
  padding: 0.6rem 1rem; font-size: 1rem; border: 0; border-radius: var(--radius);
  background: var(--accent); color: #fff; cursor: pointer;
}
.search button:disabled { opacity: 0.6; cursor: progress; }
.status { min-height: 1.3em; margin: 0.4rem 0 0; color: var(--muted); font-size: 0.9rem; }
.status.error { color: #a4262c; }

.disclaimer {
  margin: 0.5rem max(1rem, calc((100% - 1400px) / 2 + 1rem)); padding: 0.6rem 1rem;
  background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius);
  font-size: 0.9rem;
}
.freshness { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }

.layout {
  max-width: 1400px; margin: 0 auto; padding: 0.5rem 1rem 1rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1rem;
}
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.filters {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  margin: 0 0 0.5rem; padding: 0.5rem 0.75rem;
}
.filter-group, .filter-row { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: center; }
.filter-row { margin-top: 0.4rem; }
.filter-group label, .filter-row label { font-size: 0.9rem; display: inline-flex; align-items: center; gap: 0.3rem; }
select { font-size: 0.9rem; padding: 0.2rem; }

.swatch {
  display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35); flex: none;
}

#map {
  height: 60vh; min-height: 320px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.85rem; margin-top: 0.4rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.hint { color: var(--muted); font-size: 0.8rem; margin: 0.3rem 0 0; }

.side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.card h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.card h3 { font-size: 0.95rem; margin: 0.9rem 0 0.35rem; }
.card.small { font-size: 0.85rem; }
.muted { color: var(--muted); }
.city-pick { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; font-size: 0.9rem; }
.city-pick select { flex: 1; min-width: 0; }

.kv { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.kv th, .kv td { text-align: left; padding: 0.25rem 0.3rem; border-bottom: 1px solid var(--border); }
.kv td.num, .kv th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* year bar chart: rows of stacked horizontal bars */
.bars { display: flex; flex-direction: column; gap: 3px; font-size: 0.8rem; }
.bar-row { display: grid; grid-template-columns: 3em minmax(0, 1fr) 2.5em; gap: 0.4rem; align-items: center; }
.bar-track { display: flex; height: 14px; background: #eef0f2; border-radius: 3px; overflow: hidden; }
.bar-seg { height: 100%; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; }

.sources { margin: 0; padding-left: 1.1rem; }
.sources li { margin-bottom: 0.3rem; overflow-wrap: anywhere; }

.popup h4 { margin: 0 0 0.2rem; font-size: 0.95rem; }
.popup p { margin: 0.15rem 0; }
.popup .meta { color: var(--muted); font-size: 0.75rem; }
.popup .desc { font-size: 0.8rem; max-height: 8em; overflow: auto; }

.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 520px; }
.table-scroll.fit table { min-width: 0; }  /* few, short columns: fit the phone instead of scrolling */
.city-page dt { font-weight: 600; margin-top: 0.6rem; }
.city-page dd { margin: 0.2rem 0 0.4rem 1rem; }
.more-link { margin: 0.8rem 0 0; font-weight: 600; }

@media (max-width: 480px) {
  .layout { padding-left: 0.6rem; padding-right: 0.6rem; }
  .disclaimer { margin-left: 0.6rem; margin-right: 0.6rem; }
  #map { height: 50vh; }
}

.caveats {
  margin: 0.5rem 0 1rem;
  padding: 0.5rem 0.75rem 0.5rem 1.5rem;
  background: #fff8e6;
  border-left: 3px solid #d9a400;
  font-size: 0.85rem;
  color: #4a3b00;
}
.caveats li + li { margin-top: 0.35rem; }

.badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  border-radius: 0.6rem;
  background: #eee;
  color: #555;
  font-size: 0.72rem;
  font-weight: normal;
  vertical-align: middle;
}
.swatch.hollow {
  background: transparent !important;
  border: 1.5px dashed #555;
}

/* ---- city landing pages ---- */
.city-page .page-header, .city-page .city-main { max-width: 860px; margin: 0 auto; padding: 1rem; }
.city-page .page-header { padding-top: 2rem; }
.city-page .page-header > p:not(.crumbs) { font-size: 1.08rem; color: #3d4852; }
.city-page .city-main { padding-bottom: 3rem; line-height: 1.6; }
.city-page h1 { margin: 0.2rem 0 0.6rem; font-size: clamp(1.6rem, 3.5vw, 2.2rem); line-height: 1.2; letter-spacing: -0.02em; }
.city-page h2 { margin: 2.2rem 0 0.6rem; font-size: 1.35rem; }
.city-page h3 { font-size: 1.1rem; }
.city-page table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.95rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.city-page th, .city-page td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid #e8ebee; }
.city-page th { background: #f1f4f7; color: #3d4852; font-weight: 600; font-size: 0.88rem; }
.city-page tbody tr:last-child td { border-bottom: 0; }
.city-page td { font-variant-numeric: tabular-nums; }
.city-main .disclaimer { margin: 0.5rem 0 1rem; }
.city-page .city-main { min-height: 40vh; }
.crumbs { margin: 0; font-size: 0.9rem; }
.crumbs a { text-decoration: none; font-weight: 600; }
.city-page .caveats:empty { display: none; }
.button, a.button:visited {
  display: inline-block; padding: 0.65rem 1.15rem; border-radius: 8px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; box-shadow: var(--shadow);
}
.button:hover { background: var(--accent-dark); color: #fff; }
@media (max-width: 480px) {
  .city-page h1 { font-size: 1.3rem; }
  .city-page th, .city-page td { padding: 0.25rem 0.3rem; font-size: 0.85rem; }
}
.swatch.faded {
  background: #bbb !important;
  opacity: 0.5;
  border: 1px solid #888;
}

/* ---- featured (sponsored) builder ---- */
.featured { border: 1px solid #d7dde4; border-radius: 8px; padding: 0.75rem 1rem; margin: 1rem 0; background: #fbfcfd; }
.side .featured { margin: 0; }
.featured h2, .featured h3 { margin: 0.2rem 0 0.4rem; font-size: 1.1rem; }
.featured p { margin: 0.3rem 0; }
.featured.open-slot { border-style: dashed; background: transparent; }
.sponsored-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; margin: 0; }
.small { font-size: 0.8rem; }
.featured[hidden] { display: none; }


/* ---- site header and navigation (every page) ---- */
.topbar { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1100; }  /* above Leaflet controls (1000) */
.topbar-in {
  max-width: 1400px; margin: 0 auto; padding: 0.6rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; flex-wrap: wrap;
}
.logo { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink);
  font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 30px; height: 30px; flex: none; }
.topnav { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; }
.topnav a { display: block; padding: 0.4rem 0.7rem; border-radius: 8px; color: #33414c; text-decoration: none;
  font-weight: 500; font-size: 0.95rem; }
.topnav a:hover { background: #eef2f6; color: var(--ink); }
.nav-toggle, .menu-btn { display: none; }  /* the phone menu's switch (no JS): only at phone widths */
@media (max-width: 760px) {
  .topbar-in { flex-wrap: nowrap; }
  .nav-toggle { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; }
  .menu-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.8rem; border: 1px solid var(--border);
    border-radius: 8px; font-weight: 600; font-size: 0.95rem; color: var(--ink); cursor: pointer; user-select: none; }
  .menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 16px; height: 2px; background: currentColor;
    border-radius: 1px; position: relative; }
  .menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
  .menu-bars::before { top: -5px; } .menu-bars::after { top: 5px; }
  .nav-toggle:focus-visible + .menu-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-toggle:checked + .menu-btn { background: var(--cream); }
  .topnav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--card); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: 0.4rem 0.6rem 0.8rem; }
  .nav-toggle:checked ~ .topnav { display: flex; }
  .topnav a { padding: 0.7rem 0.8rem; font-size: 1.02rem; }
}

/* ---- home: banded sections ---- */
.band { padding: 3rem 0; }
.band-in { max-width: 1400px; margin: 0 auto; padding: 0 1rem; }
.band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.15; margin: 0 0 0.5rem; }
.band-lede { color: var(--muted); font-size: 1.05rem; max-width: 62ch; margin: 0 0 1.5rem; }
.band h3 { font-size: 1rem; margin: 1.6rem 0 0.6rem; }
.band .side h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }  /* the map panel's small card headings */

.hero-band { background: var(--brand); color: #e4ece9;
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(232, 196, 106, 0.16), transparent 60%); }
.hero { padding-top: 3.5rem; padding-bottom: 3rem; }
.hero-photo { display: none; }  /* desktop only (see the <picture> media query) */
@media (min-width: 1000px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 3rem; align-items: center; }
  /* pinned to the top (not centered with the text), so a search message that grows the text column can't
     shift the photo (Cloudflare flagged CLS 0.24 on it); the margin keeps it level with the headline block */
  .hero-photo { display: block; margin: 0; align-self: start; margin-top: 7rem; }
  .hero-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); border: 4px solid rgba(255, 255, 255, 0.08); }
  .hero-photo figcaption { margin-top: 0.5rem; font-size: 0.75rem; color: #8fa8a3; text-align: right; }
}
.hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.08; max-width: 22ch; margin: 0.9rem 0 0.8rem; }
.hero .sub { font-size: 1.12rem; max-width: 60ch; color: #c9d7d3; margin: 0 0 1.6rem; }
.eyebrow { display: inline-block; margin: 0; padding: 0.25rem 0.75rem; border-radius: 999px; background: rgba(255, 255, 255, 0.1);
  color: var(--gold); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; }
.hero .search { max-width: 680px; }
.hero .search input { padding: 0.95rem 1.1rem; font-size: 1.05rem; border: 0; border-radius: 10px; }
.hero .search button { padding: 0.95rem 1.5rem; font-weight: 700; border-radius: 10px; background: var(--gold); color: var(--ink); }
.hero .search button:hover { background: #f0d38a; }
.hero .status { color: #c9d7d3; }
.hero .status.error { color: #ffd2cc; }
.hero-link { margin: 0.4rem 0 0; }
.hero-link a { display: inline-block; color: #fff; font-weight: 600; text-decoration: none; padding: 0.55rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 10px; }
.hero-link a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.stats { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 2.5rem 0 0; padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14); }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font-family: var(--serif); font-size: 1.9rem; font-weight: 600; color: #fff; line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.stats dt { color: #a9bdb8; font-size: 0.85rem; }

.tools-band { background: var(--cream); }
.tool-cards { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tool-card { display: flex; flex-direction: column; gap: 0.35rem; height: 100%; padding: 1.4rem; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--fg);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.tool-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--fg); }
.tool-icon { width: 44px; height: 44px; border-radius: 12px; background: #e3efec; display: grid; place-items: center;
  margin-bottom: 0.4rem; }
.tool-icon svg { width: 24px; height: 24px; fill: var(--accent); }
.tool-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--ink); }
.tool-text { color: var(--muted); }

.map-band { background: var(--card); padding-bottom: 1rem; scroll-margin-top: 3.5rem; }  /* clear the sticky header */
.map-band .layout { padding-top: 0; }
.data-note { margin: 0 0 1.2rem; font-size: 0.88rem; color: var(--muted); max-width: 110ch; }
.data-note strong { color: var(--fg); }
.home .freshness { display: inline; margin: 0; }
.home .freshness::before { content: " "; }

.areas-band { background: var(--cream); }
.tiles.regions { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.8rem; }
.tiles.regions .tile, .tiles.guide-cards .tile { padding: 1.1rem 1.2rem; border-radius: 12px; }
.tiles.regions .tile-name, .tiles.guide-cards .tile-name { font-family: var(--serif); font-size: 1.18rem; }
.tiles.guide-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.8rem; }
.tiles.guide-cards .tile-meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.browse-all { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.browse-all > summary { cursor: pointer; display: inline-block; font-weight: 600; color: var(--accent-dark);
  padding: 0.55rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.browse-all > summary:hover { border-color: var(--accent); }
.browse-all[open] > summary { margin-bottom: 0.5rem; }
.guides-band { background: var(--bg); }

@media (max-width: 480px) {
  .band { padding: 2.25rem 0; }
  .band-in { padding: 0 0.75rem; }
  .hero { padding-top: 2.25rem; padding-bottom: 2.25rem; }
  .hero .sub { font-size: 1.02rem; }
  .hero .search { flex-direction: column; }
  .stats { gap: 1rem 1.5rem; }
  .stats div { flex: 1 1 40%; }
  .stats dd { font-size: 1.45rem; }
}

/* ---- link cards ---- */
.tiles { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem; }
.tile { display: block; height: 100%; padding: 0.75rem 0.9rem; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
.tile:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tile-name { display: block; color: var(--ink); font-weight: 600; line-height: 1.3; }
.tile-meta:empty { display: none; }
.tile-meta { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.city-main .tiles { margin: 1rem 0; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- site footer (every page) ---- */
.map-credit { max-width: 1400px; margin: 0 auto; padding: 0 1rem 1rem; color: var(--muted); font-size: 0.75rem; }
.site-foot { background: var(--cream); color: var(--muted); padding: 2.5rem 1rem 1.5rem; font-size: 0.9rem;
  border-top: 1px solid var(--border); }
.foot-in { max-width: 1368px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.5rem; }
.site-foot .logo, .site-foot .logo:hover { color: var(--ink); }
.foot-about p { max-width: 36ch; }
.foot-h { margin: 0 0 0.5rem; color: var(--ink); font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.06em; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin: 0 0 0.35rem; }
.site-foot a:not(.logo) { color: #3d4852; text-decoration: none; }
.site-foot a:not(.logo):hover { color: var(--accent-dark); text-decoration: underline; }
.foot-note { max-width: 1368px; margin: 2rem auto 0; padding-top: 1rem; border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--muted); }
@media (max-width: 720px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-about { grid-column: 1 / -1; } }

/* data hub: region subtotal rows */
.city-page tr.group-row td { background: #f7f9fb; }

/* city pages: "In short" summary */
.summary { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 0.4rem 1.1rem 0.6rem; margin: 0.5rem 0 1rem; }
.city-page .summary h2 { margin: 0.6rem 0 0.3rem; font-size: 1.1rem; }
.summary ul { margin: 0; padding-left: 1.2rem; }
.summary li { margin: 0.2rem 0; }

/* cost estimator */
.estimator { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; align-items: end;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin: 0 0 1.25rem; }
.estimator label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.estimator select, .estimator input { font-size: 1rem; padding: 0.5rem 0.6rem; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; }
.estimator button { font-weight: 600; padding: 0.6rem 1rem; }
.estimator .status { grid-column: 1 / -1; margin: 0; }
.summary.estimate h2 { font-size: 1.4rem; }

/* related pages: chip groups instead of link walls */
.related { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.rel-group { margin: 0 0 1rem; }
.city-page .rel-group h3 { margin: 0 0 0.5rem; font-size: 0.95rem; color: #3d4852; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips a { display: inline-block; padding: 0.3rem 0.7rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); text-decoration: none; font-size: 0.9rem; color: var(--ink); }
.chips a:hover { border-color: var(--accent); color: var(--accent-dark); }
.more-chips { margin-top: 0.4rem; }
.more-rows { margin: 0.5rem 0 1rem; }
.more-chips summary, .more-rows summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; }

/* "On this page" contents for long pages */
.toc { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 1rem; margin: 0 0 1rem; }
.toc-h { margin: 0 0 0.3rem; font-weight: 600; font-size: 0.85rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.05em; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; font-size: 0.92rem; }
.toc li { margin: 0.15rem 0; break-inside: avoid; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
.city-page h2[id] { scroll-margin-top: 4.5rem; }  /* clear the sticky header when jumping to a section */
.year-chart { margin: 0 0 0.75rem; }
.year-chart .bars { font-size: 0.85rem; gap: 4px; }
.year-chart .bar-row { grid-template-columns: 6.5em minmax(0, 1fr) 3.5em; }
.year-chart .bar-row > span:first-child { white-space: nowrap; }

.byline { font-size: 0.9rem !important; color: var(--muted) !important; }

/* city ADU rules table */
.rules th[scope="row"] { font-weight: 600; width: 22%; vertical-align: top; }
.rules td { vertical-align: top; font-size: 0.93rem; }
.rules-status { padding: 0.6rem 0.9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card);
  font-size: 0.95rem; }
.rules-status.conflict { border-left: 4px solid #b4532a; }
.rules-status.watch { border-left: 4px solid var(--gold); }
@media (max-width: 640px) {  /* each rule becomes a small card: the city's rule, then state law */
  .rules thead { display: none; }
  .rules, .rules tbody, .rules tr, .rules th, .rules td { display: block; width: auto; }
  .rules tr { border-bottom: 1px solid var(--border); padding: 0.4rem 0; }
  .rules th[scope="row"] { width: auto; border: 0; background: none; font-size: 1rem; color: var(--ink); }
  .rules td { border: 0; padding: 0.2rem 0.75rem; }
  .rules td::before { content: attr(data-label); display: block; font-size: 0.78rem; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
}
.rules-status.none { border-left: 4px solid #9aa5ae; }
.estimator .hint { font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.estimator.calc { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* the home hero's link to the address check */
.hero-link { margin: 0.25rem 0 0; font-size: 0.95rem; }
.hero-link a { color: inherit; font-weight: 600; }

/* ---- content pages: header band, stat tiles, quiet data note (redesign phase 2) ---- */
.city-page .page-header { background: var(--cream); padding-bottom: 2rem; margin-bottom: 1.5rem;
  box-shadow: 0 0 0 100vmax var(--cream); clip-path: inset(0 -100vmax); }  /* full-width band, text column kept */
.city-page .page-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.12; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.button.ghost, a.button.ghost:visited { background: var(--card); color: var(--accent-dark); box-shadow: none;
  border: 1px solid var(--border); }
.button.ghost:hover { background: var(--card); color: var(--accent-dark); border-color: var(--accent); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; margin: 1.5rem 0 0; }
.stat-tiles div { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.9rem 1rem; }
.stat-tiles dd { order: 1; margin: 0; font-family: var(--serif); font-size: 1.75rem; font-weight: 600; line-height: 1.15;
  color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-tiles dt { order: 2; color: var(--muted); font-size: 0.88rem; }
.stat-tiles dd.stat-sub { order: 3; font-family: inherit; font-size: 0.82rem; font-weight: 600; color: var(--accent-dark); }
.city-main .data-note { font-size: 0.85rem; color: var(--muted); margin: 0 0 1.5rem; }
.about-data { margin-top: 0.3rem; }
.about-data summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.about-data .caveats { margin-top: 0.5rem; }
@media (max-width: 480px) {
  .stat-tiles { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .stat-tiles dd { font-size: 1.35rem; }
  .header-actions .button { width: 100%; text-align: center; }
}

/* guides: "The short answer" as a key-facts box */
.key-facts { background: var(--card); border: 1px solid var(--border); border-top: 4px solid var(--gold);
  border-radius: 12px; padding: 0.2rem 1.3rem 0.6rem; margin: 0 0 1.5rem; box-shadow: var(--shadow); }
.city-page .key-facts h2 { margin-top: 1rem; font-size: 1.3rem; }
