/* Layout: a shopper's showroom. Car photo cards up front, one plain-English calculator, deeper tables lower down. */
:root {
  --bg: #f4f6f7;
  --surface: #ffffff;
  --ink: #13222b;
  --muted: #5a6d78;
  --line: #dce4e8;
  --accent: #0b6e99;
  --accent-soft: #e4f1f7;
  --save: #1d7a4b;
  --save-soft: #e3f4ea;
  --photo: #e8eef1;
  --font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", Roboto, Arial, sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e171d; --surface: #15232b; --ink: #e6eef2; --muted: #9db0ba; --line: #2a3e4a;
    --accent: #5cc2ea; --accent-soft: #163847; --save: #5fd39a; --save-soft: #17382a; --photo: #1c2e37;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e171d; --surface: #15232b; --ink: #e6eef2; --muted: #9db0ba; --line: #2a3e4a;
  --accent: #5cc2ea; --accent-soft: #163847; --save: #5fd39a; --save-soft: #17382a; --photo: #1c2e37;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
.wrap { max-width: 1040px; margin: 0 auto; display: grid; gap: 48px; }
.topbar { max-width: 1040px; margin: 0 auto; padding-block: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--ink); text-decoration: none; letter-spacing: 0.02em; }
.logo span { color: var(--accent); }
.topbar .tag { font-size: 0.9rem; color: var(--muted); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; line-height: 1.08; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.3rem, 6.4vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p { margin: 0; max-width: 62ch; }
.muted { color: var(--muted); }
.eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); font-weight: 700; }
.crumbs { font-size: 0.9rem; color: var(--muted); }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.hero { display: grid; gap: 14px; padding-top: 8px; }
.hero p { font-size: 1.15rem; color: var(--muted); }

/* At-a-glance panel: range, range bar, battery, size */
.glance { background: var(--accent-soft); border-radius: 12px; padding: 16px; display: grid; gap: 6px; }
.g-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.g-range { font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--accent); }
.g-range small { font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.g-type { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.g-lbl { font-size: 0.85rem; color: var(--muted); }
.g-bar { height: 8px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.g-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.g-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.glance.big { padding: 22px; }
.glance.big .g-range { font-size: 3.2rem; }

/* Car cards */
.cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.car { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 16px; text-decoration: none; color: var(--ink); display: grid; gap: 10px; align-content: start; transition: border-color .15s, transform .15s; }
.car:hover { border-color: var(--accent); transform: translateY(-2px); }
.car .meta { display: grid; gap: 2px; padding-inline: 6px; }
.car .b { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.car .m { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1.05; }
.car .price { font-size: 0.95rem; }
.car .facts { display: flex; flex-wrap: wrap; gap: 6px; padding-inline: 6px; }
.chip { font-size: 0.82rem; background: var(--accent-soft); color: var(--ink); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chip.save { background: var(--save-soft); }

/* Calculator */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 22px; }
.q { display: grid; gap: 8px; min-width: 0; }
.qs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.q > label, .q > .label { font-weight: 700; font-size: 1rem; }
select, input[type="number"] {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; width: 100%; min-width: 0;
}
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 700; }
.hint { font-size: 0.85rem; color: var(--muted); }

.result { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tile { border-radius: 12px; padding: 16px; display: grid; gap: 2px; background: var(--bg); }
.tile .big { font-family: var(--font-data); font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .lbl { font-size: 0.9rem; color: var(--muted); }
.tile.save { background: var(--save-soft); }
.tile.save .big { color: var(--save); }
.verdict { font-size: 1.1rem; }
.verdict strong { color: var(--save); }
details.more { border-top: 1px solid var(--line); padding-top: 14px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 14px; }

/* Model page top */
.model-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; }
@media (max-width: 760px) { .model-top { grid-template-columns: 1fr; } }
.keyfacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kf { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; }
.kf .v { font-family: var(--font-data); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kf .k { font-size: 0.85rem; color: var(--muted); }

.section { display: grid; gap: 14px; }
.section > p { color: var(--muted); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
table.wide { min-width: 720px; }
th, td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td.low { color: var(--save); font-weight: 700; }
td .brand { color: var(--muted); font-size: 0.82rem; display: block; }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin-top: 8px; color: var(--muted); }
ul.sources { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.88rem; display: grid; gap: 4px; }
footer { font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Nav, calls to action, compare and finder */
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 0.95rem; }
.topbar nav a { text-decoration: none; color: var(--ink); }
.topbar nav a:hover { color: var(--accent); }
.topbar nav .nav-cta { background: var(--accent); color: var(--surface); padding: 6px 14px; border-radius: 999px; font-weight: 700; }
.topbar nav .nav-cta:hover { color: var(--surface); opacity: 0.9; }
.btn { display: inline-block; background: var(--accent); color: var(--surface); text-decoration: none; padding: 10px 16px; border-radius: 999px; font-weight: 700; }
.cta-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cta { display: grid; gap: 4px; background: var(--accent-soft); border-radius: 14px; padding: 18px 20px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.cta:hover { border-color: var(--accent); }
.cta-t { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.pickers { margin-bottom: 4px; }
table.cmp { min-width: 640px; }
table.cmp th.cmp-head { vertical-align: bottom; text-align: left; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--ink); min-width: 190px; white-space: normal; }
table.cmp .glance { margin-bottom: 8px; }
table.cmp td { text-align: left; vertical-align: top; }
td .sub { display: block; font-family: var(--font-body); font-size: 0.8rem; color: var(--muted); white-space: normal; }
.wrap-cell { white-space: normal; }
tr.total td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--line); }
.picks { display: grid; gap: 16px; }
.pick { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; align-items: start; }
@media (max-width: 640px) { .pick { grid-template-columns: 1fr; } }
.pick-body { display: grid; gap: 6px; min-width: 0; }
.pick .rank { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--surface); background: var(--accent); border-radius: 999px; padding: 2px 10px; justify-self: start; }
.pick h3 { font-size: 1.6rem; }
.pick h3 a { color: var(--ink); text-decoration: none; }
.pick-total strong { font-family: var(--font-data); color: var(--save); font-size: 1.3rem; }
.pick ul, .others ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.others { display: grid; gap: 10px; color: var(--muted); }
.others h3 { color: var(--ink); }

/* Footer links and info pages */
.foot-links { display: flex; flex-wrap: wrap; gap: 14px; }
.prose .section h2 { font-size: 1.5rem; margin-top: 10px; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 4px; justify-self: start; max-width: 100%; }
.big-email { font-size: 1.25rem; font-weight: 700; word-break: break-all; }
.selectable { user-select: all; }

/* Head-to-head pages */
.vs-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; }
@media (max-width: 640px) { .vs-head { grid-template-columns: 1fr; } .vs-mark { justify-self: center; } }
.vs-car { display: grid; gap: 8px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.vs-car:hover { border-color: var(--accent); }
.vs-car .m { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; padding-inline: 4px; }
.vs-mark { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--muted); }
table.vs td, table.vs th { text-align: left; }
table.vs { min-width: 520px; }
.link-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.link-list.cols { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 24px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.two-col > div { display: grid; gap: 8px; min-width: 0; align-content: start; }

/* Car name first and prominent */
.car .meta .m { font-size: 2rem; }
.car > .meta:first-child { padding-top: 6px; }
.h1-model { display: block; font-size: clamp(2.6rem, 7.5vw, 4.2rem); line-height: 1; }
.h1-sub { display: block; font-size: clamp(1.4rem, 3.6vw, 2rem); color: var(--muted); font-weight: 600; margin-top: 6px; }
.vs-word { color: var(--muted); font-size: 0.6em; vertical-align: middle; }
.cmp-name { display: grid; font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; line-height: 1.05; color: var(--ink); text-decoration: none; margin-bottom: 10px; }
.cmp-name:hover { color: var(--accent); }
.cmp-brand { font-family: var(--font-body); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.cmp-var { font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.pick-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pick h3 { font-size: 2rem; line-height: 1.05; }
.vs-car .m { font-size: 2rem; }

/* Hybrid accent */
:root { --hy: #9a5b00; --hy-soft: #fbf0dc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hy: #f0b35a; --hy-soft: #3a2c16; } }
:root[data-theme="dark"] { --hy: #f0b35a; --hy-soft: #3a2c16; }
.glance.hy { background: var(--hy-soft); }
.glance.hy .g-range { color: var(--hy); }
.glance.hy .g-bar i { background: var(--hy); }
.chip.hy { background: var(--hy-soft); color: var(--hy); font-weight: 700; }
.eyebrow.eb-hy { color: var(--hy); }
.hy-tag { color: var(--hy); font-weight: 700; }
.answer { line-height: 1.5; }
.q { align-content: start; }

/* Plug-in hybrids */
:root { --ph: #5b47b8; --ph-soft: #eeeafb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ph: #b4a5ff; --ph-soft: #29234a; } }
:root[data-theme="dark"] { --ph: #b4a5ff; --ph-soft: #29234a; }
.glance.ph { background: var(--ph-soft); }
.glance.ph .g-range { color: var(--ph); }
.glance.ph .g-bar i { background: var(--ph); }
.chip.ph { background: var(--ph-soft); color: var(--ph); font-weight: 700; }
.eyebrow.eb-ph { color: var(--ph); }
.ph-tag { color: var(--ph); font-weight: 700; }
#powerFilter { margin-bottom: 14px; }
[hidden] { display: none !important; }
