:root {
  --bg: #f4f1e8;
  --bg-surface: #fbf9f3;
  --bg-raised: #e9e3d2;
  --text-primary: #1c1f16;
  --text-secondary: #3f4536;
  --text-muted: #444a3a;
  --accent: #3e6b2f;
  --accent-strong: #2c4f21;
  --accent-soft: #c9d9b8;
  --border: #d3ccb7;
  --border-strong: #a9a184;
  --map-land: #e6e0cb;
  --map-county: #b9b094;
  --map-dot: rgba(62, 107, 47, 0.55);
  --map-named: #8a3b12;
  --map-named-ring: #f4f1e8;
  --map-pick: #1d5fae;
  --shadow: 0 1px 3px rgba(30, 30, 10, 0.12);
  --focus: #1d5fae;
  --bar: #3e6b2f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131510;
    --bg-surface: #1b1e16;
    --bg-raised: #23271c;
    --text-primary: #eeeadc;
    --text-secondary: #c9c4b0;
    --text-muted: #b8b39f;
    --accent: #9ccf7f;
    --accent-strong: #b9e39c;
    --accent-soft: #2f4226;
    --border: #353a2c;
    --border-strong: #545b47;
    --map-land: #262b1f;
    --map-county: #4d5442;
    --map-dot: rgba(156, 207, 127, 0.6);
    --map-named: #f0a86e;
    --map-named-ring: #131510;
    --map-pick: #7ab4ff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    --focus: #7ab4ff;
    --bar: #9ccf7f;
  }
}
:root[data-theme="dark"] {
  --bg: #131510;
  --bg-surface: #1b1e16;
  --bg-raised: #23271c;
  --text-primary: #eeeadc;
  --text-secondary: #c9c4b0;
  --text-muted: #b8b39f;
  --accent: #9ccf7f;
  --accent-strong: #b9e39c;
  --accent-soft: #2f4226;
  --border: #353a2c;
  --border-strong: #545b47;
  --map-land: #262b1f;
  --map-county: #4d5442;
  --map-dot: rgba(156, 207, 127, 0.6);
  --map-named: #f0a86e;
  --map-named-ring: #131510;
  --map-pick: #7ab4ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  --focus: #7ab4ff;
  --bar: #9ccf7f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .rail .dot, .rail .label { transition: none; } }
body {
  margin: 0; background: var(--bg); color: var(--text-primary);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; line-height: 1.6;
}
a { color: var(--accent-strong); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
section, article[id] { scroll-margin-top: 3.6rem; }
.sans { font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }

/* top bar ---------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; height: 3.1rem; padding: 0 1rem; background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.topbar .home { font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.topbar .home:hover { color: var(--accent-strong); }
.topnav { display: flex; gap: 1rem; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-family: -apple-system, sans-serif; font-size: 0.85rem; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { text-decoration: none; color: var(--text-secondary); padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.topnav a[aria-current="true"], .topnav a:hover { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }
.spacer { flex: 1; }
.chip { font-family: -apple-system, sans-serif; font-size: 0.78rem; text-decoration: none; color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: 999px; padding: 0.25rem 0.7rem; white-space: nowrap; }
.chip:hover { color: var(--accent-strong); border-color: var(--accent-strong); }
.icon-btn { width: 2rem; height: 2rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { color: var(--accent-strong); border-color: var(--accent-strong); }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }

/* layout ---------------------------------------------------------------- */
main { max-width: 46rem; margin: 0 auto; padding: 0 1.3rem; }
.wide { max-width: 68rem; margin-left: auto; margin-right: auto; }
.hero { padding: 3rem 0 1rem; }
.kicker { font-family: -apple-system, sans-serif; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); margin: 0 0 0.4rem; }
h1 { font-size: clamp(1.85rem, 4.3vw, 2.75rem); line-height: 1.15; margin: 0.4rem 0 1rem; letter-spacing: -0.01em; }
.deck { font-size: 1.18rem; color: var(--text-secondary); margin: 0 0 1rem; }
.byline { font-family: -apple-system, sans-serif; font-size: 0.8rem; color: var(--text-muted); }
h2 { font-size: 1.55rem; line-height: 1.25; margin: 2.8rem 0 0.9rem; }
h3 { font-size: 1.12rem; margin: 1.6rem 0 0.5rem; }
p { margin: 0 0 1.05rem; }
figure { margin: 1.4rem 0; }
figure img { width: 100%; height: auto; display: block; border-radius: 0.4rem; box-shadow: var(--shadow); }
figcaption { font-family: -apple-system, sans-serif; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.45rem; }
.hero-figure { margin: 1.6rem 0 0; }
.hero-figure img { border-radius: 0.6rem; }
.callout { background: var(--bg-raised); border-left: 3px solid var(--accent); border-radius: 0.3rem; padding: 1rem 1.2rem; margin: 1.4rem 0; font-size: 0.98rem; }
.callout h3 { margin-top: 0; }
.btn { font-family: -apple-system, sans-serif; font-size: 0.92rem; font-weight: 600; background: var(--accent-strong); color: var(--bg); border: none; border-radius: 0.5rem; padding: 0.7rem 1.2rem; cursor: pointer; }
.btn:hover { background: var(--accent); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--accent-strong); border: 1px solid var(--border-strong); font-weight: 500; }
.btn-ghost:hover { background: var(--bg-raised); }
.btn-small { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
select, input[type="text"] { font-family: -apple-system, sans-serif; font-size: 0.9rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border-strong); border-radius: 0.4rem; background: var(--bg-surface); color: var(--text-primary); max-width: 100%; }
label { font-family: -apple-system, sans-serif; font-size: 0.78rem; color: var(--text-muted); display: block; margin-bottom: 0.2rem; }
.status { font-family: -apple-system, sans-serif; font-size: 0.86rem; color: var(--text-secondary); min-height: 1.4rem; margin: 0.6rem 0; }

/* near you --------------------------------------------------------------- */
.near-controls { display: flex; flex-wrap: wrap; gap: 0.9rem 1.4rem; align-items: end; margin: 1rem 0; }
.near-list { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.6rem; }
.near-item { display: grid; grid-template-columns: 4.2rem 1fr auto; gap: 0.2rem 0.9rem; align-items: center; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.7rem 0.9rem; }
.near-item .dist { font-family: -apple-system, sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--accent-strong); }
.near-item .dist small { display: block; font-weight: 400; font-size: 0.7rem; color: var(--text-muted); }
.near-item .what { font-size: 0.98rem; }
.near-item .what strong { display: block; }
.near-item .meta { display: block; font-family: -apple-system, sans-serif; font-size: 0.78rem; color: var(--text-muted); }
.near-item .acts { display: flex; flex-direction: column; gap: 0.3rem; align-items: end; }
.near-item .acts a, .near-item .acts button { font-family: -apple-system, sans-serif; font-size: 0.76rem; }
.near-item.no-dist { grid-template-columns: 1fr auto; }
.near-item.is-target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* filters ---------------------------------------------------------------- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 0.7rem 1rem; align-items: end; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 0.6rem; padding: 0.9rem 1rem; margin: 1rem 0; }
.filters .check { display: flex; align-items: center; gap: 0.45rem; font-family: -apple-system, sans-serif; font-size: 0.85rem; color: var(--text-secondary); padding-bottom: 0.4rem; }
.filters .check input { margin: 0; }
.filters .reset { padding-bottom: 0.1rem; }
.filter-count { font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-muted); margin: 0.2rem 0 0.8rem; }

/* map -------------------------------------------------------------------- */
.map-wrap { position: relative; margin: 0.4rem 0 0.6rem; background: var(--bg-raised); border-radius: 0.6rem; overflow: hidden; touch-action: pan-y pinch-zoom; }
.map-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.map-svg { position: relative; width: 100%; height: auto; display: block; cursor: crosshair; }
.map-top { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.map-top .named { pointer-events: auto; }
.map-top .named:focus-visible { outline: none; stroke: var(--focus); stroke-width: 3; }
.map-svg .land { fill: var(--map-land); stroke: none; }
.map-svg .county { fill: transparent; stroke: var(--map-county); stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.map-svg .county.is-on { fill: var(--accent-soft); fill-opacity: 0.5; }
.map-svg .cname { font-family: -apple-system, sans-serif; font-size: 11px; fill: var(--text-muted); pointer-events: none; text-anchor: middle; }
.map-top .named { fill: var(--map-named); stroke: var(--map-named-ring); stroke-width: 2; cursor: pointer; }
.map-top .named-label { font-family: -apple-system, sans-serif; font-weight: 600; fill: var(--text-primary); pointer-events: none; paint-order: stroke; stroke: var(--bg-raised); stroke-linejoin: round; }
.map-top .pick { fill: none; stroke: var(--map-pick); stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-top .pick-dot { fill: var(--map-pick); }
.map-tools { position: absolute; right: 0.6rem; top: 0.6rem; z-index: 3; display: flex; flex-direction: column; gap: 0.3rem; }
.map-tools button { width: 2rem; height: 2rem; border-radius: 0.4rem; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-primary); font-size: 1.1rem; cursor: pointer; }
.map-legend { font-family: -apple-system, sans-serif; font-size: 0.78rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.4rem 0; }
.map-legend span::before { content: ""; display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 999px; margin-right: 0.35rem; background: var(--map-dot); vertical-align: middle; }
.map-legend span.named::before { background: var(--map-named); width: 0.75rem; height: 0.75rem; border: 2px solid var(--map-named-ring); }
.map-caption { font-family: -apple-system, sans-serif; font-size: 0.78rem; color: var(--text-muted); margin: 0.3rem 0 0; }
.map-picked { margin-top: 1rem; }

/* giants ----------------------------------------------------------------- */
.giant { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 2rem; margin: 2.4rem 0; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.giant:last-of-type { border-bottom: none; }
.giant h3 { font-size: 1.35rem; margin: 0 0 0.2rem; }
.giant .place { font-family: -apple-system, sans-serif; font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.8rem; }
.giant figure { margin: 0 0 1rem; }
.giant-facts { font-family: -apple-system, sans-serif; font-size: 0.86rem; border-collapse: collapse; width: 100%; margin: 0.6rem 0 1rem; }
.giant-facts th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.4rem 0.6rem 0.4rem 0; width: 8.5rem; vertical-align: top; border-bottom: 1px solid var(--border); }
.giant-facts td { padding: 0.4rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.tag { display: inline-block; font-family: -apple-system, sans-serif; font-size: 0.7rem; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-secondary); margin-left: 0.4rem; vertical-align: middle; }
.tag.c14 { border-color: var(--accent); color: var(--accent-strong); }
.giant .sources { font-family: -apple-system, sans-serif; font-size: 0.78rem; color: var(--text-muted); padding-left: 1.1rem; }
@media (min-width: 60rem) {
  .giant.has-photo { grid-template-columns: 22rem minmax(0, 1fr); }
  .giant.has-photo figure { grid-row: 1 / span 5; }
}

/* tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table.data { width: 100%; border-collapse: collapse; font-family: -apple-system, sans-serif; font-size: 0.84rem; }
table.data th, table.data td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap; }
table.data th { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; position: sticky; top: 3.1rem; background: var(--bg); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.wrap { white-space: normal; min-width: 9rem; }
table.data tr[hidden] { display: none; }
table.data tr[id] { scroll-margin-top: 6.5rem; }
table.data tr.is-target td { background: var(--accent-soft); }
table.data a.county-link { color: var(--text-primary); text-decoration: underline dotted; }
.table-foot { display: flex; align-items: center; gap: 1rem; font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-muted); margin: 0.6rem 0 0; }
table.age-table caption { text-align: left; font-family: -apple-system, sans-serif; font-size: 0.8rem; color: var(--text-muted); padding: 0 0 0.5rem; }
table.age-table { table-layout: fixed; }
table.age-table th, table.age-table td { white-space: normal; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
table.age-table th:nth-child(1) { width: 20%; }
table.age-table th:nth-child(2) { width: 18%; }
table.age-table th:nth-child(3) { width: 19%; }
table.age-table th:nth-child(4) { width: 19%; }
table.age-table th:nth-child(5) { width: 24%; }

.sources-list { font-size: 0.9rem; padding-left: 1.2rem; }
.sources-list li { margin-bottom: 0.45rem; }

footer.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.6rem 0 2.4rem; font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-muted); }
footer.site-footer a { color: var(--text-muted); }
footer.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-bottom: 0.8rem; }

/* reading rail ------------------------------------------------------------- */
.rail { position: fixed; right: 1.4rem; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 0.85rem; z-index: 20; }
.rail a { position: relative; display: block; width: 6px; height: 6px; text-decoration: none; }
.rail .dot { display: block; width: 6px; height: 6px; border-radius: 999px; background: var(--border-strong); transition: transform 0.15s, background 0.15s; }
.rail a[aria-current="true"] .dot { background: var(--accent-strong); transform: scale(1.45); }
.rail .label { position: absolute; right: 100%; top: 50%; transform: translate(4px, -50%); margin-right: 0.6rem; font-family: -apple-system, sans-serif; font-size: 0.76rem; color: var(--text-secondary); opacity: 0; white-space: nowrap; transition: opacity 0.15s, transform 0.15s; pointer-events: none; }
.rail a:hover .label, .rail a:focus-visible .label { opacity: 1; transform: translate(0, -50%); }
@media (min-width: 76rem) { .rail { display: flex; } }
@media print { .rail, .topbar, .map-tools { display: none; } }

@media (max-width: 30rem) {
  main { padding: 0 1rem; }
  .hero { padding-top: 2rem; }
  .near-item { grid-template-columns: 3.6rem 1fr; }
  .near-item.no-dist { grid-template-columns: 1fr; }
  .near-item .acts { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; }
  table.data th { top: 3.05rem; }
}

@media (max-width: 42rem) {
  table.age-table, table.age-table tbody, table.age-table tr, table.age-table td { display: block; width: 100%; }
  table.age-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  table.age-table tr { padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
  table.age-table td { display: grid; grid-template-columns: minmax(7.5rem, 38%) 1fr; gap: 0.7rem; padding: 0.35rem 0; border: 0; }
  table.age-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
}
