:root,
:root[data-theme="light"] {
  --bg: #fafafa;
  --bg-translucent: rgba(250, 250, 250, 0.82);
  --surface: #ffffff;
  --surface-soft: #f0f0f0;
  --text: #0a0a0a;
  --text-soft: #525252;
  --text-muted: #737373;
  --text-faint: #a3a3a3;
  --border: #e7e7e7;
  --border-strong: #d4d4d4;
  --accent: #e6007e;
  --accent-deep: #b8005f;
  --accent-soft: #fbe4ef;
  --accent-fill: rgba(230, 0, 126, 0.06);
  --slate: #404040;
  --map-other: #1f2937;
  --map-style: 'carto-positron';
  --shadow-stuck: 0 4px 16px rgba(10, 10, 10, 0.04);
  --shadow-pop: 0 12px 32px rgba(10, 10, 10, 0.08), 0 2px 6px rgba(10, 10, 10, 0.04);
  --shadow-toggle: 0 1px 2px rgba(10, 10, 10, 0.06);
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-translucent: rgba(10, 10, 10, 0.78);
  --surface: #171717;
  --surface-soft: #262626;
  --text: #fafafa;
  --text-soft: #d4d4d4;
  --text-muted: #a3a3a3;
  --text-faint: #737373;
  --border: #262626;
  --border-strong: #404040;
  --accent: #ff2891;
  --accent-deep: #ff58a8;
  --accent-soft: rgba(255, 40, 145, 0.16);
  --accent-fill: rgba(255, 40, 145, 0.10);
  --slate: #d4d4d4;
  --map-other: #d4d4d4;
  --map-style: 'carto-darkmatter';
  --shadow-stuck: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-toggle: 0 1px 2px rgba(0, 0, 0, 0.5);
}

:root {
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --measure: 1080px;
  --radius: 12px;
  color-scheme: light dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  transition: background 0.2s, color 0.2s;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

::selection { background: var(--accent); color: white; }

h1, h2, h3, p, dl, dd, dt { margin: 0; }
ul { list-style: none; padding: 0; margin: 0; }
button { font-family: inherit; }

/* ─── PAGE HEADER ───────────────────────────────────────────────────────── */

.page-header {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 24px 32px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-muted);
}

.brand-mark {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent), transparent 88%);
}

.brand-name {
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-meta {
  margin-left: auto;
  color: var(--text-muted);
}

.theme-toggle {
  display: inline-flex;
  padding: 2px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.theme-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 5px 8px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.theme-toggle button:hover { color: var(--text); }

.theme-toggle button.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-toggle);
}

.theme-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.page-header h1 {
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 10px;
  max-width: 22ch;
}

.lead {
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--text-soft);
  max-width: 60ch;
  margin-bottom: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.lead a { color: var(--accent-deep); text-decoration-color: var(--accent-soft); }
.lead a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ─── FILTERS ───────────────────────────────────────────────────────────── */

.filters {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: background 0.2s, border-bottom-color 0.2s, box-shadow 0.2s;
}

.filters.is-stuck {
  background: var(--bg-translucent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-stuck);
}

.filters-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 12px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
}

@media (max-width: 640px) {
  .filters-inner {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }
}

.combobox { position: relative; }

.combobox label {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.combo-input-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.combo-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 88%);
}

.combobox input {
  width: 100%;
  padding: 12px 36px 12px 14px;
  background: transparent;
  border: 0;
  outline: none;
  font-family: var(--sans);
  font-size: 17px;
  color: var(--text);
}

.combobox input::placeholder { color: var(--text-faint); }

.combo-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--text-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 9px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.combo-clear:hover { color: var(--text); background: var(--surface-soft); }

.combo-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin: 6px 0 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  max-height: 320px;
  overflow-y: auto;
}

.combo-list li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  border-radius: 8px;
  transition: background 0.1s;
}

.combo-list li:hover,
.combo-list li.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.combo-list li.empty {
  color: var(--text-muted);
  cursor: default;
  background: transparent;
}

/* ─── MAIN ──────────────────────────────────────────────────────────────── */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── HEADLINE FIGURE ───────────────────────────────────────────────────── */

.headline {
  padding: 24px 0 28px;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.headline-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.headline-figure {
  font-family: var(--mono);
  font-size: clamp(56px, 9vw, 104px);
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.headline-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
  align-items: center;
  gap: 0;
}

.headline-dual .col {
  padding: 16px 24px;
}

.headline-dual .col + .col {
  border-left: 1px solid var(--border);
}

.headline-dual .pct {
  font-family: var(--mono);
  font-size: clamp(56px, 9.5vw, 116px);
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.headline-dual .pct .unit {
  color: color-mix(in srgb, var(--accent), transparent 50%);
  margin-left: 2px;
}

.headline-dual .label {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-soft);
  letter-spacing: -0.01em;
}

@media (max-width: 720px) {
  .headline-dual { grid-template-columns: 1fr; }
  .headline-dual .col + .col { border-left: 0; border-top: 1px solid var(--border); margin-top: 24px; padding-top: 36px; }
}

/* ─── SECTIONS ──────────────────────────────────────────────────────────── */

.section {
  padding: 18px 0 16px;
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 60ch;
}

.chart {
  width: 100%;
  min-height: 280px;
}

.map-chart {
  min-height: 440px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ─── LEGEND ────────────────────────────────────────────────────────────── */

.legend {
  display: none;
  flex-wrap: wrap;
  gap: 20px;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
}

.legend.is-visible { display: flex; }

.is-hidden { display: none !important; }

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-swatch.on { background: var(--accent); }
.legend-swatch.off { background: var(--surface-soft); }
.legend-swatch.nodata { background: transparent; border: 1px dashed var(--border-strong); }

/* ─── FOOTER ────────────────────────────────────────────────────────────── */

footer {
  max-width: var(--measure);
  margin: 16px auto 0;
  padding: 18px 32px 28px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.coverage-line {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  letter-spacing: -0.005em;
}

.colophon {
  font-size: 15px;
  color: var(--text-muted);
}
.colophon a { color: var(--text-soft); }

/* ─── LOADING ───────────────────────────────────────────────────────────── */

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 100;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text-muted);
}
.loading.hidden { display: none; }
.loading span::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 10px;
  vertical-align: middle;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* ─── ENTRY ─────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .page-header, main > section, footer {
    animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  }
  .page-header { animation-delay: 0.05s; }
  main > section:nth-of-type(1) { animation-delay: 0.18s; }
  main > section:nth-of-type(2) { animation-delay: 0.22s; }
  main > section:nth-of-type(3) { animation-delay: 0.26s; }
  main > section:nth-of-type(4) { animation-delay: 0.30s; }
  main > section:nth-of-type(5) { animation-delay: 0.34s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.headline-figure.flip,
.headline-dual .pct.flip {
  animation: flip 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes flip {
  0% { opacity: 0.3; transform: translateY(-2px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .page-header, .filters-inner, main, footer { padding-left: 22px; padding-right: 22px; }
}
