:root {
  --ink: #16202b;
  --ink-2: #3c4a58;
  --muted: #6b7885;
  --line: #dde3e9;
  --bg: #f3f5f7;
  --card: #ffffff;
  --navy: #14222f;
  --navy-2: #1d3144;
  --accent: #e0703a;
  --accent-ink: #b4531f;
  --ok: #2f7d57;
  --warn: #c0392b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 34, 47, .06), 0 4px 16px rgba(20, 34, 47, .06);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
button, input, textarea, select { font: inherit; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 16px; padding: 10px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .01em; }
.brand .logo { width: 26px; height: 26px; border-radius: 6px; background: conic-gradient(from 45deg, var(--accent), #f3b27f, var(--accent)); }
.brand small { display: block; font-weight: 400; opacity: .7; font-size: .78rem; }
.topbar .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: .85rem; }
.clock { font-family: "IBM Plex Mono", monospace; font-size: 1.35rem; font-weight: 600; padding: 4px 14px; border-radius: 8px; background: rgba(255,255,255,.08); min-width: 118px; text-align: center; }
.clock.warn { background: #b8860b; }
.clock.crit { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .75; } }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.center-card { max-width: 560px; margin: 8vh auto; }

.btn { border: 0; border-radius: 8px; padding: 10px 18px; background: var(--navy-2); color: #fff; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.accent { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--warn); }
.btn.sm { padding: 6px 12px; font-size: .88rem; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], textarea, select { width: 100%; border: 1px solid #c9d2db; border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.group-grid button { padding: 14px 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 1.1rem; cursor: pointer; }
.group-grid button.sel { background: var(--navy-2); color: #fff; border-color: var(--navy-2); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 16px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .step { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: .75rem; margin-right: 6px; }
.tabs button.on .step { background: var(--accent); color: #fff; }

/* Slides */
.deck { background: var(--navy); color: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.slide { aspect-ratio: 16 / 9; padding: 5% 6%; display: flex; flex-direction: column; position: relative; }
.slide .kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: #f3b27f; margin-bottom: 10px; }
.slide h2 { font-size: clamp(1.3rem, 3vw, 2.2rem); margin-bottom: .6em; }
.slide .big { font-size: clamp(1rem, 1.9vw, 1.3rem); color: #d6dee6; }
.slide .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3%; flex: 1; min-height: 0; }
.slide .stat { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin-bottom: 12px; }
.slide .stat b { display: block; font-size: clamp(.95rem, 1.7vw, 1.2rem); }
.slide .stat span { font-size: .8rem; color: #9fb0c0; text-transform: uppercase; letter-spacing: .06em; }
.slide .footer { position: absolute; bottom: 12px; left: 6%; right: 6%; display: flex; justify-content: space-between; font-size: .75rem; color: #8195a8; }
.slide ul { margin: 0; padding-left: 1.2em; font-size: clamp(.95rem, 1.7vw, 1.2rem); color: #d6dee6; }
.slide li { margin-bottom: .45em; }
.slide .mapbox { background: #eef1ea; border-radius: 10px; overflow: hidden; min-height: 0; }
.slide .mapbox svg { width: 100%; height: 100%; display: block; }
.slide table { border-collapse: collapse; width: 100%; font-size: clamp(.8rem, 1.4vw, 1rem); color: #d6dee6; }
.slide td, .slide th { border-bottom: 1px solid rgba(255,255,255,.12); padding: 7px 6px; text-align: left; }
.slide th { color: #f3b27f; font-weight: 600; }
.deck-nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--navy-2); }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.25); cursor: pointer; }
.dots i.on { background: var(--accent); }

/* Portal */
.portal { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
.site-list button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); background: #fff; padding: 12px; border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.site-list button.on { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--accent); }
.badge { width: 28px; height: 28px; border-radius: 6px; color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.dossier-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.dossier-head .mapthumb { width: 300px; max-width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.acc { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; overflow: hidden; }
.acc > button { width: 100%; text-align: left; background: #fbfcfd; border: 0; padding: 12px 16px; font-weight: 600; display: flex; justify-content: space-between; cursor: pointer; }
.acc > button::after { content: "+"; color: var(--muted); font-weight: 400; }
.acc.open > button::after { content: "\2212"; }
.acc .body { display: none; padding: 4px 16px 14px; }
.acc.open .body { display: block; }
.kv { display: grid; grid-template-columns: minmax(140px, 32%) 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; }
.kv > * { padding: 8px 0; border-bottom: 1px solid #eef1f4; }
.memo { background: #fffaf2; border-left: 4px solid var(--accent); padding: 12px 16px; font-style: italic; border-radius: 6px; }
.classified { background: repeating-linear-gradient(45deg, #f1f3f5, #f1f3f5 8px, #e8ebee 8px, #e8ebee 16px); border-radius: 10px; padding: 14px 16px; color: var(--muted); font-size: .9rem; }

/* Cost model */
table.model { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.model th, table.model td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.model th:first-child, table.model td:first-child { text-align: left; }
table.model thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.model tr.total td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--ink); }
table.model input[type=range] { width: 100%; accent-color: var(--accent); }
.bar { height: 10px; border-radius: 5px; background: var(--accent); }

/* Decision */
.site-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.site-pick label { margin: 0; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; background: #fff; }
.site-pick input { accent-color: var(--accent); }
.site-pick label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 16px; }
.checks label { font-weight: 400; margin: 0; display: flex; gap: 8px; align-items: center; }

.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.banner.info { background: #e8f0f7; color: #1d3144; }
.banner.warn { background: #fff4e0; color: #7a4a00; }
.banner.ok { background: #e4f3ea; color: #1f5a3d; }
.banner.err { background: #fde8e6; color: #8a241a; }

/* Reveal */
table.reveal { width: 100%; border-collapse: collapse; }
table.reveal th, table.reveal td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.reveal th:first-child, table.reveal td:first-child { text-align: left; }
table.reveal tr.mine { background: #fff4ec; }
table.reveal td.hl { font-weight: 700; }
.tally { display: grid; gap: 8px; }
.tally .row { display: grid; grid-template-columns: 160px 1fr 40px; gap: 10px; align-items: center; }

.lobby-pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 1.4s infinite; margin-right: 8px; vertical-align: middle; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) {
  .portal, .grid-2 { grid-template-columns: 1fr; }
  .slide { aspect-ratio: auto; min-height: 420px; }
  .slide .grid2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
}
