:root {
  --bg: #f6f5f1; --panel: #ffffff; --line: #e2e0d8; --text: #1f1e1b; --muted: #6b6a64;
  --accent: #185fa5; --good: #0f6e56; --warn: #854f0b; --bad: #a32d2d;
  --infra: #534ab7; --client: #888780; --free-bg: #e1f5ee; --free-fg: #085041; --cost-bg: #faece7; --cost-fg: #712b13;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b19; --panel: #242422; --line: #3a3a37; --text: #ecebe6; --muted: #a3a29b;
    --accent: #85b7eb; --good: #5dcaa5; --warn: #ef9f27; --bad: #f09595;
    --infra: #afa9ec; --client: #b4b2a9; --free-bg: #085041; --free-fg: #9fe1cb; --cost-bg: #712b13; --cost-fg: #f5c4b3;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
header { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
header .sub { flex: 1 1 24rem; order: 3; }
.rules { color: var(--accent); font-size: 14px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, sans-serif; }
header, .tables, footer { padding: 12px 16px; }
h1 { font-size: 20px; font-weight: 500; margin: 0; }
h2 { font-size: 17px; font-weight: 500; margin: 24px 0 4px; }
.sub { color: var(--muted); font-size: 13px; }
main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 12px; padding: 0 16px; }
@media (max-width: 900px) { main { grid-template-columns: minmax(0, 1fr); } }
.mapbox { position: relative; }
#map { height: 72vh; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; }
.legend { position: absolute; z-index: 500; bottom: 10px; left: 10px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; line-height: 1.6; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 4px; }
.legend i.dot { width: 10px; height: 10px; border: 0; border-radius: 50%; }
.legend i.dot.hollow { border: 2px dashed; background: transparent; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; max-height: 72vh; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
select, input, button { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; }
button { cursor: pointer; }
button:hover { border-color: var(--muted); }
.seg { display: flex; }
.seg button { border-radius: 0; }
.seg button:first-child { border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.seg button.on { background: var(--accent); color: var(--panel); border-color: var(--accent); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.metric { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.metric .l { font-size: 12px; color: var(--muted); }
.metric .v { font-size: 20px; font-weight: 500; }
.ok { color: var(--good); } .no { color: var(--bad); } .mid { color: var(--warn); }
.strip { list-style: none; margin: 0; padding: 0; }
.strip li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 6px 0;
  border-top: 1px solid var(--line); }
.strip .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--client); }
.strip .dot.infra { background: var(--infra); }
.strip .name { font-weight: 500; }
.strip .meta { font-size: 12px; color: var(--muted); }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.pill.free { background: var(--free-bg); color: var(--free-fg); }
.pill.cost { background: var(--cost-bg); color: var(--cost-fg); }
.whatif { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.whatif input { width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
th, td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 13px; border-top: 0; }
.tablewrap { overflow-x: auto; }
code { font-size: 12px; }
.leaflet-popup-content { font-size: 13px; }
.leaflet-popup-content button { margin-top: 6px; padding: 3px 8px; font-size: 12px; }
