:root {
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e3e5ea;
  --panel: #f7f8fa;
  --accent: #3b3f8c;
  --yes: #1f7a4d;
  --no: #b8412e;
}

* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: #fff; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 1.25rem; }
a { color: var(--accent); }
h2 { margin: 2.5rem 0 .5rem; font-size: 1.6rem; }
.intro { color: var(--muted); max-width: 52rem; margin-top: 0; }
footer { color: var(--muted); font-size: .85rem; padding: 2rem 1.25rem 3rem; }

.hero { background: linear-gradient(135deg, #12606e, #3b3f8c); color: #fff; padding: 3rem 0 1.5rem; }
.hero a { color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; opacity: .8; margin: 0 0 .5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 .5rem; }
.lede { font-size: 1.1rem; max-width: 50rem; opacity: .95; }
.hero nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.25rem; }
.hero nav a { text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: 2px; }
.hero nav a:hover, .hero nav a:focus-visible { border-bottom-color: #fff; }

.notice { background: #fff8e6; border: 1px solid #f0d78a; padding: .75rem 1rem; border-radius: 8px; }
.notice.error { background: #fdecea; border-color: #f0a8a0; }

/* score */
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .9rem; max-width: 40rem; }
.score-card { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; background: var(--panel); }
.score-card .label { font-weight: 600; }
.score-card .big { font-size: 3rem; font-weight: 800; color: var(--accent); line-height: 1.1; margin: .25rem 0; font-variant-numeric: tabular-nums; }
.score-card .range { color: var(--muted); font-size: .85rem; }

/* what it said yes to */
.yes-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; max-width: 46rem; }
.yes-list li { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .5rem; align-items: baseline; border-bottom: 1px solid var(--line); padding: .35rem 0; }
.yes-list .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.yes-list .runs-yes { color: var(--yes); font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; }

/* every question */
.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; margin-bottom: .5rem; }
.filters label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: .2rem; }
.filters .grow { flex: 1; min-width: 12rem; }
select, input[type=search] { font: inherit; color: var(--ink); padding: .4rem .55rem; border: 1px solid #c7cbd3; border-radius: 8px; background: #fff; }
.count { color: var(--muted); font-size: .85rem; }
.items { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .9rem; display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .1rem .8rem; align-items: center; }
.item.yes { border-left: 4px solid var(--yes); }
.item .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.item .text { font-weight: 500; }
.item .meta { grid-column: 2 / -1; color: var(--muted); font-size: .8rem; }
.items.compact .item { padding: .3rem .8rem; }
.chip { display: inline-block; min-width: 2.6rem; text-align: center; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff; }
.chip.yes { background: var(--yes); }
.chip.no { background: var(--no); }

/* runs */
.table-wrap { overflow-x: auto; max-width: 30rem; }
table.runs { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .92rem; }
table.runs th, table.runs td { padding: .35rem .6rem; border-bottom: 1px solid var(--line); text-align: right; }
table.runs th:first-child, table.runs td:first-child { text-align: left; }
table.runs tr.typical td:first-child::after { content: " (typical)"; color: var(--muted); font-size: .8rem; }
table.runs tr.selected { background: #eef0fb; }
table.runs button { font: inherit; font-size: .82rem; padding: .15rem .6rem; border: 1px solid #c7cbd3; border-radius: 6px; background: #fff; cursor: pointer; }
.run-detail { margin-top: 1.25rem; }

/* charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; }
.chart { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.chart img { width: 100%; display: block; }
.chart figcaption { padding: .7rem .9rem .9rem; font-size: .88rem; color: var(--muted); }
.chart figcaption strong { color: var(--ink); display: block; font-size: .98rem; }

/* setup */
.setup { display: grid; grid-template-columns: 11rem 1fr; gap: .4rem 1rem; }
.setup dt { font-weight: 600; }
.setup dd { margin: 0; word-break: break-word; }

@media (max-width: 640px) {
  .setup { grid-template-columns: 1fr; }
  .setup dd { margin-bottom: .5rem; }
}
