:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #5f5f5a;
  --border: #e2e1dc;
  --accent: #b4432b;
  --accent-soft: #f5e3dd;
  --good: #2f7d4f;
  --dim: #a3a29c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171716;
    --surface: #222220;
    --text: #ecebe6;
    --muted: #a9a8a1;
    --border: #3a3936;
    --accent: #e9795f;
    --accent-soft: #3c2721;
    --good: #6cc391;
    --dim: #6c6b66;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171716; --surface: #222220; --text: #ecebe6; --muted: #a9a8a1; --border: #3a3936;
  --accent: #e9795f; --accent-soft: #3c2721; --good: #6cc391; --dim: #6c6b66; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 32px; }
h1 { font-size: 1.8rem; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 32px 0 10px; }
.lede { color: var(--muted); margin: 0 0 20px; max-width: 70ch; }
.note { color: var(--muted); font-size: 0.9rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }

fieldset { border: none; margin: 0 0 16px; padding: 0; }
fieldset:last-child { margin-bottom: 0; }
legend { font-weight: 700; font-size: 0.95rem; margin-bottom: 10px; padding: 0; }
.hint { font-weight: 400; color: var(--dim); }
.toggle { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; font-size: 0.9rem; }
.toggle label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.toggle input { accent-color: var(--accent); }
#budgetNote { margin: 10px 0 0; }
.inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.inputs label { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
input, select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.pick { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; cursor: pointer; }
.pick:hover { border-color: var(--accent); }
.pick .rank { font-size: 0.8rem; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.pick h3 { margin: 2px 0 6px; font-size: 1.2rem; }
.pick .score { font-size: 0.85rem; color: var(--muted); }
.pick ul { margin: 10px 0 0; padding-left: 18px; font-size: 0.9rem; }

.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 9px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
th:nth-child(2), td:nth-child(2), th:last-child, td:last-child { text-align: left; }
th { font-size: 0.78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--accent-soft); }
tbody tr.selected { background: var(--accent-soft); }
tbody tr.excluded td { color: var(--dim); }
tbody tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; }
.bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent); vertical-align: middle; margin-right: 6px; }
.tag { font-size: 0.75rem; color: var(--muted); }

.chart-box { position: relative; height: 300px; }
#detail { margin-top: 24px; }
#detail h2 { margin-top: 0; }

.method ul { padding-left: 18px; }
.method li { margin-bottom: 6px; }
main { padding-bottom: 48px; }
