:root {
  --navy: #121a24;
  --panel: #1c2634;
  --panel-2: #243142;
  --line: #2e3d50;
  --text: #f0f4f8;
  --muted: #9fb0c3;
  --red: #e74c3c;
  --amber: #f5b83d;
  --green: #2ecc71;
  --blue: #569cd6;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; margin-top: 1.6em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mt { margin-top: 18px; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--navy); z-index: 5;
}
.brand img { height: 44px; display: block; }
nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 6px 0; }
nav a:hover, nav a.active { color: var(--text); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
footer { max-width: 1100px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: .85rem; }
.loading { color: var(--muted); }

.hero { padding: 12px 0 8px; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 46em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 8px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px; font-weight: 700; text-decoration: none;
  background: var(--green); color: #08210f; border: 0; cursor: pointer; font-size: 1rem;
}
.btn.secondary { background: var(--panel-2); color: var(--text); }

.stack { display: grid; gap: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  text-decoration: none; color: inherit; display: block;
}
a.card:hover { border-color: var(--blue); }
.card h3 { margin-bottom: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800;
  letter-spacing: .02em; white-space: nowrap; color: #0b1118;
}
.v-best-buy, .v-good-buy { background: var(--green); }
.v-careful { background: var(--amber); }
.v-avoid { background: var(--red); color: #fff; }
.v-too-new, .v-none { background: var(--panel-2); color: var(--muted); }

.years { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.year {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  cursor: pointer; text-align: left; color: inherit; font: inherit;
}
.year[aria-expanded="true"] { border-color: var(--blue); }
.year .y { font-size: 1.3rem; font-weight: 800; }
.year .n { color: var(--muted); font-size: .85rem; }
.year-detail { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; border-left: 4px solid var(--blue); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; background: var(--panel); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.video { position: relative; aspect-ratio: 16 / 9; max-width: 720px; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

form.tool, .pickers { display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.pickers { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 600; }
select, input {
  font: inherit; color: var(--text); background: var(--navy); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; min-width: 0;
}
input[type="number"] { width: 6.5em; }
select { max-width: 100%; }

.results { display: grid; gap: 10px; margin-top: 18px; }
.result { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--panel-2); border-radius: var(--radius); padding: 12px 16px; }
.result.ok { border-left-color: var(--green); }
.result.open { border-left-color: var(--amber); }
.result.no { border-left-color: var(--red); }
.result .why { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }
.notice { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 16px; color: var(--muted); }

@media (max-width: 560px) {
  .brand img { height: 36px; }
  th, td { padding: 6px 8px; }
}

/* Trim comparison: first column stays put while the trims scroll sideways. */
.matrix table { min-width: 100%; width: max-content; }
.matrix th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 150px; max-width: 220px; white-space: normal; }
.matrix td { min-width: 120px; max-width: 220px; }
.matrix tr.group th { background: var(--panel-2); color: var(--text); font-weight: 700; position: static; }
.opt { color: var(--amber); font-weight: 600; }
a.chip.pick { background: var(--panel-2); color: var(--text); text-decoration: none; font-size: .85rem; padding: 4px 12px; }
a.chip.pick.on { background: var(--blue); color: #0b1118; }
ul.changes { padding-left: 1.2em; }
ul.changes li { margin: 4px 0; }
details > summary { cursor: pointer; font-weight: 700; }
form.tool.row { margin: 12px 0 4px; }
input[type="search"] { width: 18em; max-width: 100%; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { color: var(--blue); }
