:root {
  --bg: #faf7f2;
  --fg: #1c1917;
  --muted: #78716c;
  --line: #e7e0d5;
  --card: #ffffff;
  --accent: #b3402a;
  --accent-ink: #ffffff;
  --focus: #7c2d1e;
}
html[data-theme="dark"] {
  --bg: #1c1917;
  --fg: #f5f0e8;
  --muted: #a8a29e;
  --line: #44403c;
  --card: #292524;
  --accent: #e0684b;
  --accent-ink: #1c1917;
  --focus: #f0a58c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  font-size: 17px;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: var(--accent-ink); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.9rem;
  height: 52px; padding: 0 1rem;
  background: var(--card); border-bottom: 1px solid var(--line);
  font-size: 0.95rem; white-space: nowrap;
}
.topbar .home { color: var(--fg); text-decoration: none; font-weight: 700; }
.topnav { display: flex; gap: 0.9rem; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a[aria-current="true"] { color: var(--fg); font-weight: 700; }
.topbar .spacer { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--fg);
  cursor: pointer; flex: none;
}
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }
section { scroll-margin-top: 64px; }
.icon-btn:focus-visible, button:focus-visible, a:focus-visible,
input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.hero { padding: 2.5rem 0 1rem; }
.kicker {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem;
  color: var(--accent); font-weight: 700; margin: 0 0 0.5rem;
}
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 1rem; }
.answer { font-size: 1.35rem; margin: 0 0 1rem; }
.answer strong { color: var(--accent); }
.standfirst { font-size: 1.05rem; margin: 0 0 0.75rem; }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
.controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: end;
  margin: 1rem 0; padding: 1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; }
.ctl { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem;
  color: var(--muted); margin: 0; padding: 0; border: 0; }
.ctl input {
  font-size: 1rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--fg); min-width: 12rem;
}
.seg { flex-direction: row; align-items: center; gap: 0.35rem; }
.seg legend { font-size: 0.85rem; color: var(--muted); padding: 0; margin-bottom: 0.35rem; }
.seg button {
  font-size: 0.9rem; padding: 0.4rem 0.8rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg); color: var(--fg); cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  font-weight: 700;
}
.count { margin: 0 0 0 auto; font-size: 0.85rem; color: var(--muted); align-self: center; }
.table-wrap { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 38rem; }
caption { text-align: left; color: var(--muted); font-size: 0.85rem; padding-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line);
  vertical-align: top; }
thead th { border-bottom: 2px solid var(--accent); white-space: nowrap; }
tbody th[scope="row"] { font-weight: 600; }
td.len { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
tr[data-urban="1"] td:first-child { border-left: 3px solid var(--accent); }
.note { background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem; margin: 1.5rem 0; }
.note h3 { margin-top: 0; }
.note p { margin-bottom: 0; }
.rules { padding-left: 1.25rem; }
.rules li { margin-bottom: 0.75rem; }
details { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 0.6rem;
  background: var(--card); }
summary { cursor: pointer; padding: 0.8rem 1rem; font-weight: 600; }
details p { padding: 0 1rem 1rem; margin: 0; }
a { color: var(--accent); }
footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0 2.5rem;
  color: var(--muted); font-size: 0.9rem; }
@media (max-width: 40rem) {
  h1 { font-size: 1.6rem; }
  .answer { font-size: 1.15rem; }
  .ctl input { min-width: 0; width: 100%; }
  .ctl { flex: 1 1 100%; }
}
