:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #1c2321;
  --muted: #5d6764;
  --border: #dedad0;
  --accent: #1f5f5b;
  --accent-soft: #e3efed;
  --ok-bg: #e2f1e7; --ok-fg: #1d5a34;
  --warn-bg: #fbf0d9; --warn-fg: #7a5300;
  --mute-bg: #ecebe7; --mute-fg: #555;
  --low: #9a4a12;
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615; --surface: #1a201e; --surface-2: #222a28; --text: #e7ece9; --muted: #a2adaa;
    --border: #33403d; --accent: #7cc4bd; --accent-soft: #1f3331;
    --ok-bg: #173826; --ok-fg: #9fdcb4; --warn-bg: #3a2e12; --warn-fg: #f0cd7d; --mute-bg: #2a302e; --mute-fg: #b5bdba;
    --low: #f0a26b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0.4em 0 0.3em; }
h2 { font-size: 1.35rem; margin: 1.8em 0 0.5em; }
h3 { font-size: 1.05rem; margin: 0 0 0.3em; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--surface); font-size: 1.1rem; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

main { padding-bottom: 48px; }
.hero { padding: 24px 0 8px; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 46rem; }
.stats { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 12px; }
.stats li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); }
.stat { display: block; font-size: 1.6rem; font-weight: 700; color: var(--text); }
.section-head p { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.strong { font-weight: 700; }
.mono { font-family: var(--mono); font-size: 0.95rem; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; }

.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; margin: 12px 0; }
.filters label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.filters label.check { display: flex; align-items: center; gap: 8px; }
select, input[type="number"] { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; min-height: 40px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
thead th { background: var(--surface-2); font-size: 0.85rem; font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--accent); }
th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.7em; }
th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.7em; }
.th-sub { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; white-space: normal; max-width: 9rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rank td:nth-child(2) { min-width: 16rem; }
.brand-name { font-weight: 600; }
.cat { display: block; font-size: 0.8rem; color: var(--muted); }
td.low { color: var(--low); font-weight: 600; }
tr[hidden] { display: none; }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge-muted { background: var(--mute-bg); color: var(--mute-fg); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px; margin: 32px 0; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card h2, .card h3 { font-size: 1.05rem; margin: 0 0 6px; color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.prose { max-width: 46rem; }
.prose li { margin: 0.3em 0; }
.crumbs { font-size: 0.88rem; color: var(--muted); margin-top: 20px; }
.eyebrow { color: var(--muted); font-size: 0.9rem; margin: 20px 0 0; }
.product header h1 { margin-top: 0.1em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 12px; margin: 20px 0; }
.facts div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.facts dt { font-size: 0.85rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts dd.big { font-size: 1.6rem; color: var(--accent); }
.similar { padding-left: 1.2em; }
.button { display: inline-block; background: var(--accent); color: var(--surface); padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.button:hover { filter: brightness(1.08); }

.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.calc label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.calc input, .calc select { width: 100%; }
.need { font-size: 1.1rem; margin: 16px 0 8px; }
.note { background: var(--warn-bg); color: var(--warn-fg); padding: 10px 12px; border-radius: 8px; }

/* Rankings as stacked cards on narrow screens, so the key number is always visible. */
@media (max-width: 720px) {
  .table-wrap:has(table.rank) { border: 0; background: none; overflow: visible; }
  table.rank thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.rank, table.rank tbody { display: block; }
  table.rank tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
  table.rank tr[hidden] { display: none; }
  table.rank td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  table.rank td.rank-no { display: none; }
  table.rank td.kit { grid-column: 1 / -1; min-width: 0; }
  table.rank td.data { grid-column: 1 / -1; }
  table.rank td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; font-weight: 400; color: var(--muted); }
  table.rank td.key { font-size: 1.1rem; color: var(--accent); }
}

.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.9rem; padding: 20px 0 32px; }
.site-footer p { margin: 0.4em 0; max-width: 50rem; }
.footer-links a { color: var(--muted); }
