:root {
  --bg: #fbfaf7; --surface: #ffffff; --text: #1d2125; --muted: #5f6770; --line: #e3e0d8;
  --accent: #0f6b5c; --accent-soft: #e4f1ee; --stripe: #f6f4ef;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181b; --surface: #1d2125; --text: #e8e6e1; --muted: #9aa1a8; --line: #2e3439;
    --accent: #5cc5b0; --accent-soft: #1d3330; --stripe: #1a1e21;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15181b; --surface: #1d2125; --text: #e8e6e1; --muted: #9aa1a8; --line: #2e3439;
  --accent: #5cc5b0; --accent-soft: #1d3330; --stripe: #1a1e21;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 700; color: var(--text); }
.search input { width: min(320px, 100%); }
.search { flex: 1 1 200px; display: flex; justify-content: flex-end; }
input[type=search] { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); }

main { max-width: 1000px; margin: 0 auto; padding: 16px; }
.crumbs { font-size: 14px; color: var(--muted); }
h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; margin: 12px 0; }
h1 small { display: block; font-size: 16px; font-weight: 400; color: var(--muted); margin-top: 4px; }
h2 { font-size: 20px; margin: 32px 0 8px; }
.lead { font-size: 18px; color: var(--muted); max-width: 70ch; }
.note { font-size: 14px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card .label { font-size: 14px; color: var(--muted); }
.card .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .note { font-size: 13px; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
thead th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--stripe); }
tbody th { font-weight: 500; }
tbody tr:last-child > * { border-bottom: 0; }
td.n, .places td { text-align: right; }

.big-search input { width: 100%; font-size: 18px; padding: 14px 16px; margin-top: 8px; }
.results { list-style: none; margin: 4px 0 0; padding: 0; border-radius: 12px; overflow: hidden; }
.results:not(:empty) { border: 1px solid var(--line); background: var(--surface); }
.results li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; color: var(--text);
  border-bottom: 1px solid var(--line); }
.results li:last-child a { border-bottom: 0; }
.results li a:hover, .results li a:focus { background: var(--accent-soft); text-decoration: none; }
.results .ctx { color: var(--muted); font-size: 14px; white-space: nowrap; }

footer { max-width: 1000px; margin: 40px auto 0; padding: 16px; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line); }
