:root {
  --bg: #f3f4f6; --panel: #fff; --line: #d9dde3; --text: #1b1f24; --muted: #5b6470;
  --accent: #13294b; --accent-2: #1d4f91; --ok: #1d6b40; --bad: #b3261e; --warn: #85560a;
  --ok-bg: #e5f3ea; --bad-bg: #fbe9e7; --warn-bg: #fdf2dc; --r: 6px;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); height: 100vh; display: flex; flex-direction: column; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 6px; z-index: 10; }
.top { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--accent); color: #fff; }
.top h1 { font-size: 18px; margin: 0; letter-spacing: .02em; }
.top p { margin: 0; flex: 1; opacity: .8; font-size: 13px; }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr) 400px; gap: 0; }
.col { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: #fff; }
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.tabs button { border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 8px 14px; border-radius: var(--r) var(--r) 0 0; cursor: pointer; color: var(--muted); font: inherit; }
.tabs button[aria-selected="true"] { background: #fff; border-color: var(--line); color: var(--accent); font-weight: 600; margin-bottom: -1px; }
.stage { flex: 1; min-height: 0; position: relative; }
.stage > section { position: absolute; inset: 0; }
.stage > section[hidden] { display: none; }
#map, #profile { width: 100%; height: 100%; display: block; }
#view3d { width: 100%; height: 100%; }
#compare { height: 100%; overflow: auto; padding: 16px; }
.hint { position: absolute; left: 12px; bottom: 8px; margin: 0; padding: 3px 8px; background: rgba(255,255,255,.92); border-radius: 4px; font-size: 12px; color: var(--muted); pointer-events: none; }
#map-hint, #profile-hint { top: 8px; bottom: auto; }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.6); color: var(--accent); font-weight: 600; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.card > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.card h3 { font-size: 14px; margin: 12px 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
label.row { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
input, select, button { font: inherit; color: inherit; }
input[type=number], input[type=text], input[type=file], select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; width: 100%; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, canvas:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
input[type=range] { width: 100%; accent-color: var(--accent-2); }
button { border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 4px; cursor: pointer; }
button:hover:not(:disabled) { background: #eef1f5; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-2); }
button.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
button.ghost:hover { background: rgba(255,255,255,.12); }
button.big { width: 100%; padding: 11px; font-size: 15px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 10px; }
.seg label { flex-direction: row; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; color: var(--text); cursor: pointer; font-size: 12.5px; }
.seg label:has(input:checked) { border-color: var(--accent-2); background: #eaf1fb; }
.note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eceff3; }
.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #ecd49a; padding: 7px 9px; border-radius: 4px; font-size: 12.5px; margin-top: 8px; }
.alert { background: var(--bad-bg); color: var(--bad); border: 1px solid #efb8b1; padding: 8px 10px; border-radius: 4px; font-size: 13px; margin: 8px 0; }
.okbox { background: var(--ok-bg); color: var(--ok); border: 1px solid #b6dcc3; padding: 8px 10px; border-radius: 4px; font-size: 13px; margin: 8px 0; }
.point { display: grid; grid-template-columns: 22px 1fr 1fr; gap: 6px 8px; align-items: end; margin-top: 8px; }
.point .tag { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.mat { border-top: 1px solid var(--line); padding: 6px 0; }
.mat:first-of-type { border-top: 0; }
.mat summary { cursor: pointer; display: flex; gap: 8px; align-items: center; list-style: none; }
.mat summary::-webkit-details-marker { display: none; }
.mat summary .name { flex: 1; font-size: 13px; }
.mat summary .caret { color: var(--muted); font-size: 11px; }
.mat .props { margin-top: 8px; }
.progress { height: 8px; background: #e3e7ec; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; width: 0; background: var(--accent-2); transition: width .25s; }
.cands { display: flex; flex-direction: column; gap: 6px; }
.cand { display: grid; grid-template-columns: 20px 1fr auto; gap: 4px 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; background: #fff; }
.cand[aria-checked="true"] { border-color: var(--accent-2); background: #eaf1fb; box-shadow: inset 3px 0 0 var(--accent-2); }
.cand .n { font-weight: 600; } .cand .c { font-variant-numeric: tabular-nums; font-weight: 600; }
.cand .sub { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.kpi { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
.kpi .l { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.cost { grid-column: 1 / 3; } .kpi.cost .v { font-size: 26px; color: var(--accent); }
.kpi.bad .v { color: var(--bad); } .kpi.ok .v { color: var(--ok); }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
td { padding: 5px 6px; border-bottom: 1px solid #edf0f3; vertical-align: top; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 5px; background: #e3e7ec; border-radius: 3px; margin-top: 3px; }
.bar > i { display: block; height: 100%; background: var(--accent-2); border-radius: 3px; }
.bar.cs > i { background: var(--ok); } .bar.cs.low > i { background: var(--bad); }
.cmp { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cmp .card canvas { width: 100%; height: 140px; display: block; background: #f7f8fa; border-radius: 4px; margin: 6px 0 8px; }
.cmp .best { border-color: var(--ok); }
.exports { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slider { margin: 6px 0; } .slider .top2 { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.slider .top2 b { color: var(--text); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 8px; }
#toasts { position: fixed; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 20; max-width: 380px; }
.toast { background: var(--accent); color: #fff; padding: 9px 12px; border-radius: 5px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.toast.error { background: var(--bad); }
dialog { max-width: 620px; border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; }
dialog h2 { margin-top: 0; } dialog li { margin: 4px 0; } dialog form { text-align: right; margin-top: 12px; }
@media (max-width: 1180px) {
  body { height: auto; } .layout { grid-template-columns: 1fr; } .col { overflow: visible; }
  .center { min-height: 70vh; border: 0; } .top p { display: none; }
}
.cmp table { table-layout: fixed; }
.cmp td:first-child { width: 38%; color: var(--muted); }
.cmp td.n { white-space: normal; overflow-wrap: anywhere; }
