:root { --bg:#fff; --fg:#1d1f23; --muted:#667; --line:#dde0e6; --accent:#0b6bcb; --panel:#f6f7f9; }
@media (prefers-color-scheme: dark) { :root { --bg:#15171a; --fg:#e8eaed; --muted:#9aa0a6; --line:#2b2f36; --accent:#6ab0ff; --panel:#1c1f24; } }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); display: flex; flex-direction: column; }
header { display: flex; gap: 16px; align-items: baseline; padding: 8px 16px; border-bottom: 1px solid var(--line); }
h1 { font-size: 17px; margin: 0; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
main { flex: 1; display: flex; min-height: 0; }
aside { width: 300px; flex: none; overflow-y: auto; padding: 12px 16px; background: var(--panel); border-right: 1px solid var(--line); }
aside section { margin-bottom: 16px; }
#content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#map { flex: 1 1 60%; min-height: 240px; }
#table { flex: 1 1 40%; overflow: auto; border-top: 1px solid var(--line); padding: 8px 16px; min-height: 160px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.row { display: flex; gap: 8px; } .row label { flex: 1; font-size: 12px; color: var(--muted); }
input[type=date], input[type=text], select { width: 100%; padding: 4px 6px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; font: inherit; }
select { margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 12px; padding: 2px 9px; cursor: pointer; font: inherit; font-size: 12px; }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips.wide button { border-radius: 4px; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; padding: 0 4px; text-transform: none; letter-spacing: 0; }
label.inline { display: block; margin: 2px 0; }
ul#legend { list-style: none; padding: 0; margin: 0; }
#legend li { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
#legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; flex: none; }
#legend .cnt { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
a.button { display: block; text-align: center; padding: 6px 8px; border: 1px solid var(--accent); color: var(--accent); border-radius: 4px; text-decoration: none; }
.tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; position: sticky; top: -8px; background: var(--bg); padding: 4px 0; }
.tabs button { border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: 3px 10px; border-radius: 4px; cursor: pointer; font: inherit; }
.tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tabs #total { margin-left: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); font-weight: 600; position: sticky; top: 28px; background: var(--bg); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; } tr.click:hover { background: var(--panel); }
.bar { display: flex; height: 12px; width: 100%; min-width: 120px; border-radius: 2px; overflow: hidden; background: var(--line); }
.bar span { display: block; height: 100%; }
.maplibregl-popup-content { color: #1d1f23; font: 13px/1.4 system-ui, sans-serif; }
.maplibregl-popup-content h3 { margin: 0 0 4px; font-size: 14px; }
@media (max-width: 800px) {
  main { flex-direction: column; overflow-y: auto; }
  aside { width: auto; border-right: 0; border-bottom: 1px solid var(--line); max-height: 45vh; }
  #content { min-height: 520px; }
}
