:root {
  --bg: #0b1020;
  --surface: #141a2e;
  --surface-2: #1c2440;
  --text: #eef1f8;
  --muted: #9aa3c0;
  --faint: #6b7497;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #f59e0b;
  --accent-text: #fbbf24;
  --accent-bg: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-dim: color-mix(in srgb, var(--accent) 9%, transparent);
  --good: #22c55e;
  --bad: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 920px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7fb; --surface: #ffffff; --surface-2: #eef1f8;
    --text: #16203a; --muted: #5a6488; --faint: #8b93ad;
    --border: rgba(20,30,60,.10); --border-strong: rgba(20,30,60,.18);
    --accent: #d97706; --accent-text: #b45309;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
svg { width: 1em; height: 1em; }

.site-header { max-width: var(--maxw); margin: 0 auto; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; } .brand-icon { color: var(--accent); font-size: 1.3rem; }
.loc-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.loc-pill b { color: var(--accent-text); font-weight: 600; }
.loc-pill:hover { border-color: var(--border-strong); }

#main { max-width: var(--maxw); margin: 0 auto; padding: 4px 18px 40px; }
.intro h1 { font-size: 1.6rem; margin: 8px 0 4px; }
.intro .subtitle { color: var(--muted); margin: 0 0 18px; font-size: .95rem; }

.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.controls .grouplabel { width: 100%; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin: -2px 0 2px; }
.ctl { display: flex; flex-direction: column; gap: 5px; } .ctl.grow { flex: 1; min-width: 200px; }
.ctl label { font-size: .74rem; color: var(--muted); }
input, select { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 9px 11px; font: inherit; font-size: .88rem; max-width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.with-unit { display: flex; align-items: center; }
.with-unit.pre .unit { border-left: 1px solid var(--border); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.with-unit.pre input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; width: 110px; }
.with-unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; width: 110px; }
.with-unit .unit { font-size: .8rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-left: none; border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); padding: 9px 11px; white-space: nowrap; }
.hint { font-size: .72rem; color: var(--faint); }

.rangerow { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 240px; }
.rangerow .rl { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); }
.rangerow .rl b { color: var(--text); font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; background: var(--surface-2); border-radius: 999px; padding: 0; border: 1px solid var(--border); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }

/* verdict */
.verdict { border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; border: 1px solid var(--border); display: flex; gap: 14px; align-items: center; }
.verdict.yes { background: linear-gradient(180deg, color-mix(in srgb, var(--good) 14%, transparent), transparent), var(--surface); }
.verdict.close { background: linear-gradient(180deg, var(--accent-bg), transparent), var(--surface); }
.verdict.no { background: linear-gradient(180deg, color-mix(in srgb, var(--bad) 14%, transparent), transparent), var(--surface); }
.verdict .vicon { font-size: 1.8rem; flex: none; }
.verdict.yes .vicon { color: var(--good); } .verdict.close .vicon { color: var(--accent); } .verdict.no .vicon { color: var(--bad); }
.verdict .vh { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.verdict .vs { font-size: .88rem; color: var(--muted); margin-top: 2px; } .verdict .vs b { color: var(--text); }

/* result cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.rcard { background: linear-gradient(180deg, var(--accent-dim), transparent), var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.rcard .rv { font-size: 1.5rem; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rcard .rl { font-size: .72rem; color: var(--muted); margin-top: 3px; }
.rcard.hero .rv { color: var(--good); }

/* breakdown */
.breakdown { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 16px; margin-bottom: 16px; }
.brow { display: flex; justify-content: space-between; font-size: .88rem; padding: 9px 0; }
.brow + .brow { border-top: 1px solid var(--border); }
.brow .bl { color: var(--muted); } .brow .bv { font-weight: 600; font-variant-numeric: tabular-nums; }
.brow.credit .bv { color: var(--good); } .brow.net { font-size: .95rem; } .brow.net .bv { color: var(--accent-text); }

.context { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 15px; font-size: .85rem; color: var(--muted); margin-bottom: 16px; display: flex; flex-direction: column; gap: 7px; }
.context .row { display: flex; gap: 9px; align-items: flex-start; } .context .row svg { color: var(--accent-text); margin-top: 2px; flex: none; } .context b { color: var(--text); }

.actions { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: .85rem; font-weight: 500; border: 1px solid var(--border-strong); background: transparent; color: var(--text); border-radius: var(--radius-sm); padding: 9px 13px; cursor: pointer; }
.btn:hover { background: var(--surface-2); } .btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent-bg); border-color: transparent; color: var(--accent-text); }
.adv-toggle { background: none; border: none; color: var(--accent-text); font: inherit; font-size: .82rem; cursor: pointer; padding: 4px 0; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.adv-toggle:hover { text-decoration: underline; }

.ad-slot { margin: 24px 0; min-height: 120px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--faint); font-size: .78rem; background: var(--surface); }

/* cluster + trio nav */
.cluster { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 22px 0; font-size: .88rem; }
.cluster svg { color: var(--accent); font-size: 1.4rem; flex: none; }
.cluster .ct { color: var(--muted); } .cluster .ct b { color: var(--text); }
.cluster a { white-space: nowrap; font-weight: 500; margin-left: auto; }
.trio { font-size: .78rem; color: var(--faint); margin-top: 14px; }
.trio b { color: var(--muted); font-weight: 600; } .trio a { color: var(--accent-text); }

.popular { margin: 26px 0 8px; } .popular h2 { font-size: 1rem; margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .82rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px; }
.chip:hover { border-color: var(--accent); text-decoration: none; color: var(--accent-text); }

.about { margin-top: 26px; } .about h2 { font-size: 1rem; margin: 0 0 8px; } .about p { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.faq { margin-top: 22px; } .faq h2 { font-size: 1rem; margin: 0 0 10px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px; margin-bottom: 8px; background: var(--surface); }
.faq summary { cursor: pointer; padding: 12px 0; font-size: .9rem; font-weight: 500; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.1rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { font-size: .86rem; color: var(--muted); margin: 0 0 12px; }

.site-footer { max-width: var(--maxw); margin: 0 auto; padding: 24px 18px 40px; font-size: .76rem; color: var(--faint); text-align: center; }
.site-footer a { color: var(--faint); text-decoration: underline; }

/* state detail page */
.crumb { font-size: .78rem; color: var(--faint); margin: 4px 0 10px; } .crumb a { color: var(--muted); }
.specs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.spec { font-size: .78rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; } .spec b { color: var(--text); }
.prose { font-size: .92rem; color: var(--muted); }
.prose h2 { font-size: 1.15rem; color: var(--text); margin: 26px 0 8px; }
.prose p { margin: 0 0 12px; } .prose ul { margin: 0 0 12px; padding-left: 18px; } .prose li { margin-bottom: 6px; }

@media (max-width: 600px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cluster { flex-wrap: wrap; } .cluster a { margin-left: 0; }
}
