:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6;
  --series-1-dim: #86b6ef;
  --accent-link: #1c5cab;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface-1: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --series-1: #3987e5;
    --series-1-dim: #1c5cab;
    --accent-link: #86b6ef;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface-1: #1a1a19;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --series-1: #3987e5;
  --series-1-dim: #1c5cab;
  --accent-link: #86b6ef;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}
main { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem 4rem; }
a { color: var(--accent-link); }
h1 { font-size: 1.6rem; line-height: 1.25; }
h2 { font-size: 1.2rem; margin-top: 2.2rem; }
h3 { font-size: 1rem; }

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1.25rem;
  display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap;
}
.site-header .brand { font-weight: 650; color: var(--text-primary); text-decoration: none; }
.site-header nav a { margin-right: 1rem; font-size: 0.92rem; }
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem; padding: 1.2rem 1.25rem;
  font-size: 0.85rem; color: var(--text-secondary);
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.9rem; margin: 1.2rem 0; }
.tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.tile .label { font-size: 0.85rem; color: var(--text-secondary); }
.tile .value { font-size: 1.9rem; font-weight: 600; margin: 0.15rem 0; }
.tile .context { font-size: 0.8rem; color: var(--muted); }

.figure {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem 0.7rem;
  margin: 1.4rem 0;
  overflow-x: auto;
}
.figure h3 { margin: 0 0 0.2rem; }
.figure .subtitle { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 0.6rem; }
.figure svg { max-width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 1.1rem; font-size: 0.82rem; color: var(--text-secondary); margin: 0.4rem 0 0.2rem; flex-wrap: wrap; }
.legend .key { display: inline-flex; align-items: center; gap: 0.4rem; }
.key .swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.key .swatch.dot { width: 9px; height: 9px; border-radius: 50%; }

.source { font-size: 0.78rem; color: var(--muted); margin: 0.5rem 0 0.3rem; }
.note { font-size: 0.85rem; color: var(--text-secondary); }

details.table-view { margin: 0.4rem 0 0.5rem; font-size: 0.85rem; }
details.table-view summary { cursor: pointer; color: var(--accent-link); }
table { border-collapse: collapse; margin: 0.6rem 0; width: 100%; }
th, td { text-align: right; padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; font-variant-numeric: normal; }
th { color: var(--text-secondary); font-weight: 600; font-size: 0.8rem; }

.lookup {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem;
  margin: 1.3rem 0;
}
.lookup form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.lookup input[type="text"] {
  flex: 1 1 12rem;
  padding: 0.55rem 0.7rem;
  font-size: 1rem;
  border: 1px solid var(--baseline);
  border-radius: 8px;
  background: var(--page);
  color: var(--text-primary);
}
.lookup button {
  padding: 0.55rem 1rem;
  font-size: 1rem;
  border: none; border-radius: 8px;
  background: var(--series-1);
  color: #fff;
  cursor: pointer;
}
.lookup .result { margin-top: 0.7rem; font-size: 0.95rem; min-height: 1.4rem; }

.la-list { columns: 3 14rem; column-gap: 2rem; font-size: 0.92rem; }
.la-list h3 { column-span: all; margin: 1.2rem 0 0.4rem; }
.la-list ul { margin: 0; padding-left: 1.1rem; }

.breadcrumb { font-size: 0.85rem; color: var(--text-secondary); margin-top: 1.2rem; }
.chart-note { font-size: 0.8rem; color: var(--muted); }
.notpub { color: var(--muted); }
