/* CarFit India
   Palette: asphalt ink on cool concrete, number-plate blue for actions, turn-signal amber for scores.
   Type: Saira Condensed (display, plates, figures) + Hanken Grotesk (body). */

:root {
  --bg: #eceeeb;
  --surface: #f9faf8;
  --surface-2: #e2e6e1;
  --ink: #1d2125;
  --ink-2: #454c53;
  --muted: #687077;
  --line: #d2d7d1;
  --blue: #1b4db1;
  --blue-ink: #ffffff;
  --blue-soft: #dce5f7;
  --signal: #e89f00;
  --signal-soft: #fbebc4;
  --signal-ink: #6f4b00;
  --go: #16805a;
  --go-soft: #d5eee2;
  --warn: #b86e00;
  --stop: #c3352b;
  --stop-soft: #f6dad7;
  --no: #a4aaaf;
  --focus: #1b4db1;
  --radius: 12px;
  --shadow: 0 1px 0 rgb(0 0 0 / 4%), 0 10px 30px -18px rgb(20 30 40 / 35%);
  --f-display: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111417;
    --surface: #191d21;
    --surface-2: #232a30;
    --ink: #e6e8e4;
    --ink-2: #bcc2c6;
    --muted: #8d959b;
    --line: #2d343a;
    --blue: #7fa5ff;
    --blue-ink: #0b1430;
    --blue-soft: #1c2a4a;
    --signal: #ffb627;
    --signal-soft: #3a2e12;
    --signal-ink: #ffd47e;
    --go: #43c48d;
    --go-soft: #14352a;
    --warn: #f0a640;
    --stop: #ff6e61;
    --stop-soft: #3d1d1a;
    --no: #59626a;
    --focus: #9dbaff;
    --shadow: 0 1px 0 rgb(0 0 0 / 30%), 0 12px 30px -18px rgb(0 0 0 / 80%);
    color-scheme: dark;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--f-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.sheet-open { overflow: hidden; }

main { flex: 1; outline: none; }

h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.1; margin: 0 0 .4em; letter-spacing: .005em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; color: var(--ink-2); margin-top: 1em; }
p { margin: 0 0 .8em; }
a { color: var(--blue); text-underline-offset: 2px; }
small { font-size: .82em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
  font: 700 .78rem/1.2 var(--f-body);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6em;
}
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.fine { font-size: .84rem; color: var(--muted); }
.hint { display: block; font-size: .85rem; color: var(--muted); margin-top: 4px; }

.callout {
  background: var(--blue-soft);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .95rem;
}
.callout.warn { background: var(--signal-soft); color: var(--ink); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 700 1.25rem/1 var(--f-display);
  letter-spacing: .02em;
  margin-right: auto;
}
.brand b { color: var(--blue); font-weight: 800; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current='page'] { color: var(--ink); background: var(--surface); box-shadow: inset 0 -2px 0 var(--blue); }
.nav-sm { display: none; }
.badge:not(:empty) {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--signal);
  color: #1d2125;
  font-size: .75rem;
  font-weight: 700;
  margin-left: 2px;
}

/* ---------- Number plate (the car's nameplate) ---------- */

.plate {
  display: inline-flex;
  align-items: stretch;
  background: #fff;
  color: #111;
  border: .12em solid #111;
  border-radius: .32em;
  box-shadow: inset 0 0 0 .1em #fff, inset 0 0 0 .16em #111, 0 1px 2px rgb(0 0 0 / 25%);
  font-family: var(--f-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: middle;
  max-width: 100%;
}
.plate-ind {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25em;
  margin: .2em 0 .2em .2em;
  padding: 0 .38em;
  background: #1b47a8;
  color: #fff;
  border-radius: .12em;
  font-size: .38em;
  letter-spacing: .06em;
}
.plate-ind i {
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: conic-gradient(from 40deg, #c8d2df, #f6f8fb, #9db0c8, #eef2f6, #b9c6d6, #c8d2df);
}
.plate-txt { padding: .3em .55em .24em; overflow: hidden; text-overflow: ellipsis; }
.plate-xs { font-size: 12px; }
.plate-sm { font-size: 13px; }
.plate-md { font-size: 18px; }
.plate-lg { font-size: clamp(30px, 5.4vw, 50px); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 1rem/1 var(--f-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: var(--blue-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--blue) 86%, black); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.btn-big { min-height: 52px; padding: 0 26px; font-size: 1.08rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; text-decoration: underline; cursor: pointer; }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  flex: none;
}

/* ---------- Form controls ---------- */

.field { display: block; margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.label { display: block; font-weight: 600; margin-bottom: 8px; padding: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; align-items: start; }
.field-row > .callout { grid-column: 1 / -1; margin: -6px 0 20px; }

.money,
.unit {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  min-height: 48px;
  max-width: 340px;
}
.money:focus-within,
.unit:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.money > span,
.unit > span { color: var(--muted); font-weight: 600; white-space: nowrap; }
.money input,
.unit input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 600 1.15rem/1 var(--f-display);
  letter-spacing: .02em;
  padding: 10px 0;
  outline: none;
}
.money input:focus-visible,
.unit input:focus-visible { outline: none; }

select,
input[type='search'] {
  width: 100%;
  max-width: 340px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 500 1rem var(--f-body);
}

input[type='range'] {
  width: 100%;
  max-width: 420px;
  accent-color: var(--blue);
  height: 28px;
  margin: 0;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 500 .93rem var(--f-body);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed='true']::before { content: '✓ '; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}
.seg-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font: 600 .93rem var(--f-body);
  cursor: pointer;
}
.seg-btn[aria-checked='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 15%); }

.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--blue); }

/* ---------- Scores ---------- */

.t-good { --tone: var(--go); --tone-soft: var(--go-soft); }
.t-ok { --tone: var(--signal); --tone-soft: var(--signal-soft); }
.t-warn { --tone: var(--warn); --tone-soft: var(--signal-soft); }
.t-bad { --tone: var(--stop); --tone-soft: var(--stop-soft); }

.gauge { min-width: 150px; }
.gauge-top { display: flex; align-items: baseline; gap: 8px; }
.gauge-num { font: 800 3rem/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.gauge-lbl { font-weight: 700; color: var(--ink-2); }
.gauge-bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-top: 8px; }
.gauge-bar i { height: 10px; border-radius: 2px; background: var(--surface-2); }
.gauge-bar i.on { background: var(--tone); }
.gauge-sub { margin-top: 6px; font-weight: 600; color: var(--tone); font-size: .92rem; }

.pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 42px;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--tone-soft);
  color: var(--ink);
  font: 700 1.05rem/1.2 var(--f-display);
  font-variant-numeric: tabular-nums;
  box-shadow: inset 3px 0 0 var(--tone);
}
.pill small { font: 500 .72rem var(--f-body); color: var(--muted); }

.mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 700; font-size: .95rem; }
.mark-std { color: var(--go); background: var(--go-soft); }
.mark-higher { color: var(--warn); background: var(--signal-soft); }
.mark-no { color: var(--no); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.stars { color: var(--signal); letter-spacing: 1px; white-space: nowrap; }
.stars-off { color: var(--surface-2); }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink-2);
}
.tag-ex { background: var(--surface-2); }
.tag-over { background: var(--stop-soft); color: var(--stop); }
.tag-miss { background: var(--signal-soft); color: var(--signal-ink); }
.tag-fuel { margin: 1px 0; }

.kv { display: grid; gap: 0; margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font: 600 1.05rem/1.3 var(--f-display); letter-spacing: .02em; }
.kv dd small { font: 400 .8rem var(--f-body); color: var(--muted); letter-spacing: 0; }
.kv .kv-total dt { font-weight: 700; color: var(--ink); }
.kv .kv-total dd { font-size: 1.3rem; }
.kv-tight > div { padding: 5px 0; }

/* ---------- Home ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 40px;
  align-items: start;
  padding: 56px 0 48px;
}
.hero h1 { max-width: 14ch; }
.quick { padding: 22px 22px 6px; margin-top: 26px; max-width: 560px; }
.quick .actions { margin: 0 0 16px; }
.hero-live { padding: 24px; position: sticky; top: 84px; }
.live-top { display: grid; gap: 14px; justify-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.live-name { font-size: 1.05rem; margin: 0; }
.live-name b { font-family: var(--f-display); font-size: 1.35rem; }
.live-stats { display: grid; grid-template-columns: auto 1fr; gap: 22px; width: 100%; align-items: end; }
.live-next { list-style: none; margin: 10px 0; padding: 0; }
.live-next li a {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}
.live-next-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-next-cost { color: var(--muted); font-size: .9rem; }

.band { background: var(--surface); border-block: 1px solid var(--line); padding: 40px 0 24px; }
.explain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.explain h2 { font-size: 1.45rem; border-top: 3px solid var(--signal); padding-top: 12px; }
.explain p { color: var(--ink-2); }
.facts { margin-top: 16px; font-size: .92rem; color: var(--muted); }

/* ---------- Wizard ---------- */

.wizard { padding: 28px 0 48px; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; overflow-x: auto; }
.steps a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.steps a span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  font: 700 .95rem var(--f-display);
}
.steps a.done span { background: var(--go-soft); color: var(--go); }
.steps a[aria-current='step'] { border-color: var(--ink); color: var(--ink); }
.steps a[aria-current='step'] span { background: var(--ink); color: var(--bg); }

.wiz-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.wiz-form { padding: 28px; }
.wiz-form h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.wiz-form .lede { margin-bottom: 26px; }
.wiz-nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); margin-top: 8px; }
.wiz-aside { position: sticky; top: 84px; }
.aside-card { padding: 22px; }
.aside-card hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.count-big { font: 800 2.6rem/1 var(--f-display); margin-bottom: 14px; }
.count-big span { font-size: 1.1rem; font-weight: 600; color: var(--muted); }
.aside-top { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center; }
.aside-top .plate { grid-column: 1 / -1; justify-self: start; }
.weights .weight { margin-bottom: 12px; }
.weight .label { display: flex; justify-content: space-between; max-width: 420px; }
.weight b { font-family: var(--f-display); font-size: 1.1rem; }
fieldset.field > legend { margin-bottom: 8px; }

/* ---------- Results ---------- */

.results { padding: 28px 0 48px; }
.res-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.res-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); margin-bottom: .2em; }
.res-head .actions { margin: 0; }

.best { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; padding: 28px; }
.best-id { display: grid; justify-items: start; align-content: start; }
.best-id h2 { margin: 16px 0 4px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.why { margin: 14px 0 0; padding-left: 20px; }
.why li { margin-bottom: 6px; }
.missing { margin: 10px 0 0; color: var(--signal-ink); background: var(--signal-soft); padding: 6px 10px; border-radius: 8px; font-size: .92rem; }
.gauges { display: flex; flex-wrap: wrap; gap: 28px; margin-bottom: 16px; }
.costbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); margin-top: 14px; }
.cb-emi { background: var(--blue); }
.cb-fuel { background: var(--signal); }
.cb-ins { background: var(--go); }
.cb-mnt { background: var(--ink-2); }
.costkey { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; margin: 8px 0 0; font-size: .85rem; color: var(--ink-2); }
.costkey i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.sec-h { margin: 32px 0 12px; font-size: 1.45rem; }
.runners { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 0; }
.runner-btn {
  display: grid;
  gap: 10px;
  justify-items: start;
  width: 100%;
  height: 100%;
  padding: 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
}
.runner:hover { border-color: var(--ink-2); }
.runner-name b { font-family: var(--f-display); font-size: 1.2rem; }
.runner-nums { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .92rem; }

.empty { padding: 28px; }

.tablesec { margin-top: 44px; }
.tbl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 10px 0 12px; }
.toolbar input[type='search'] { max-width: 300px; }
.toolbar-end { display: flex; gap: 10px; margin-left: auto; }
.filters { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filters summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.filters[open] summary { border-bottom: 1px solid var(--line); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 28px; padding: 16px 16px 0; }
.filter-grid .chip { min-height: 32px; padding: 0 11px; font-size: .86rem; }
.filter-grid .seg-btn { min-height: 32px; padding: 0 11px; font-size: .86rem; }
.tbl-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 10px; }
.tbl-meta .fine { margin: 0; }

.tbl-wrap {
  position: relative; /* contains the absolutely positioned .sr labels inside the scroller */
  overflow: auto;
  max-height: 78vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overscroll-behavior-x: contain;
}

table.cars { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .92rem; }
.cars th,
.cars td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; background: var(--surface); }
.cars thead th { position: sticky; z-index: 3; background: var(--surface-2); font-weight: 600; }
.cars .tr-groups th {
  top: 0;
  height: 32px;
  font: 700 .74rem/1 var(--f-body);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-left: 1px solid var(--line);
}
.cars .tr-cols th { top: 32px; vertical-align: bottom; border-left: 0; }
.cars thead th.col-car { left: 0; z-index: 5; vertical-align: bottom; font: 700 .74rem/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; }
.cars tbody th.col-car { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line), 6px 0 10px -8px rgb(0 0 0 / 25%); min-width: 230px; max-width: 260px; }
.cars tbody tr:hover > * { background: color-mix(in srgb, var(--blue-soft) 45%, var(--surface)); }
.cars td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cars td.td-feat { text-align: center; padding: 6px 4px; }
.cars .th-num { text-align: right; }
.cars .th-feat { width: 36px; padding: 6px 2px; vertical-align: bottom; }
.cars td.g-Safety, .cars td.g-Tech { background: color-mix(in srgb, var(--surface-2) 30%, var(--surface)); }

.sort {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 2px;
  cursor: pointer;
  text-align: inherit;
}
.th-feat .sort { flex-direction: column; align-items: center; margin: 0 auto; }
.th-feat .sort span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 120px; font-weight: 500; font-size: .84rem; }
.sort i { font-style: normal; font-size: .7rem; color: var(--blue); }

.cell-sub { display: block; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.cell-wrap { display: inline-block; white-space: normal; min-width: 150px; font-size: .86rem; }

.carcell { display: flex; align-items: center; gap: 10px; }
.carcell input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.rowlink {
  display: grid;
  gap: 4px;
  justify-items: start;
  border: 0;
  background: none;
  padding: 2px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.carname { font-weight: 600; line-height: 1.2; }
.carname small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; }
.rowlink:hover .carname { text-decoration: underline; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0 28px; }
.cars tr.is-ex > * { color: var(--muted); }
.cars tr.is-ex .plate { opacity: .55; }
.cars tr.is-ex .pill { filter: grayscale(1); opacity: .7; }

/* ---------- Detail sheet ---------- */

.sheet-backdrop { position: fixed; inset: 0; background: rgb(10 14 18 / 45%); z-index: 40; animation: fade .2s ease-out; }
.sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 100%);
  z-index: 41;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: -20px 0 40px -20px rgb(0 0 0 / 40%);
  animation: slide-in .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet-head { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sheet-head .plate { grid-column: 1; justify-self: start; font-size: 34px; }
.sheet-head .icon-btn { grid-column: 2; grid-row: 1; }
.sheet-head > div { grid-column: 1 / -1; }
.sheet-head h2 { margin-bottom: 2px; }
.sheet-head p { margin: 0; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px 22px 32px; overscroll-behavior: contain; }
.sheet-body section { margin-top: 24px; }
.sheet-foot { display: flex; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.sbar { margin-bottom: 14px; }
.sbar-top { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.sbar-top span:last-child { font-weight: 400; color: var(--muted); font-size: .9rem; }
.sbar-top b { font-family: var(--f-display); color: var(--ink); font-size: 1.1rem; }
.sbar-track { height: 8px; border-radius: 4px; background: var(--surface-2); margin: 6px 0 4px; overflow: hidden; }
.sbar-track i { display: block; height: 100%; background: var(--signal); border-radius: 4px; }
.checks { list-style: none; padding: 0; margin: 0 0 8px; }
.checks li { padding: 4px 0; }
.ok, .bad { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; margin-right: 8px; font-weight: 700; }
.ok { color: var(--go); background: var(--go-soft); }
.bad { color: var(--stop); background: var(--stop-soft); }
.featlist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 16px; }
.featlist li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.featlist li.is-must { font-weight: 700; }
table.mini { border-collapse: collapse; width: 100%; font-size: .92rem; margin-bottom: 8px; }
.variant-pick { font-size: 1.02rem; }
.variant-line { margin: 2px 0 0; color: var(--ink-2); }
.variant-line b { color: var(--ink); }
.vtable-wrap { overflow-x: auto; position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin: 10px 0 6px; }
table.vtable { border-collapse: collapse; width: 100%; min-width: 660px; font-size: .88rem; }
.vtable th, .vtable td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.vtable thead th { color: var(--muted); font-weight: 600; background: var(--surface-2); }
.vtable td.num, .vtable th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vtable tbody th { white-space: nowrap; font-family: var(--f-display); font-size: 1rem; }
.vtable td.musts { white-space: nowrap; }
.vtable td.adds { color: var(--ink-2); min-width: 240px; white-space: normal; }
.vtable .mark { width: 20px; height: 20px; font-size: .8rem; margin-left: 2px; }
.vtable tr.rec > * { background: color-mix(in srgb, var(--signal-soft) 70%, var(--surface)); }
.vtable tr.nofit > * { color: var(--muted); }
.rec-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: var(--signal); color: #1d2125; font: 700 .68rem/1.6 var(--f-body); text-transform: uppercase; letter-spacing: .06em; vertical-align: 2px; }
.mini th, .mini td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mini th { color: var(--muted); font-weight: 600; }

@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Compare ---------- */

.compare { padding: 28px 0 48px; }
.cmp-tools { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: end; margin-bottom: 14px; }
.adder { margin: 0; }
.cmp-wrap { max-height: none; }
table.cmp { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; font-size: .94rem; }
.cmp th, .cmp td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.cmp thead th { vertical-align: top; background: var(--surface); position: sticky; top: 0; z-index: 2; }
.cmp tbody th { color: var(--ink-2); font-weight: 500; width: 220px; }
.cmp-car { display: grid; gap: 6px; justify-items: start; }
.cmp-actions { display: flex; gap: 14px; font-size: .88rem; }
.cmp-sec th { background: var(--surface-2); font: 700 .76rem/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding: 10px 12px; }
.cmp tr.diff > * { background: color-mix(in srgb, var(--signal-soft) 55%, var(--surface)); }

/* ---------- Method ---------- */

.method { padding: 28px 0 48px; }
.method-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; margin-top: 12px; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.4em; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.settings { padding: 22px; position: sticky; top: 84px; }
.settings .unit { max-width: none; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--muted); font-size: .86rem; margin-top: 40px; }
.footer p { margin: 0 0 4px; }

/* ---------- Small screens ---------- */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; gap: 24px; }
  .hero-live { position: static; }
  .wiz-grid { grid-template-columns: 1fr; }
  .wiz-aside { position: static; }
  .best { grid-template-columns: 1fr; gap: 20px; }
  .method-grid { grid-template-columns: 1fr; }
  .settings { position: static; }
  .explain { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar-in { gap: 4px 12px; padding: 8px 0; }
  .nav { width: 100%; margin: 0 -4px; }
  .nav a { padding: 6px 10px; font-size: .9rem; }
  .nav-lg { display: none; }
  .nav-sm { display: inline; }
  .wiz-form, .best { padding: 20px 16px; }
  .quick { padding: 18px 16px 4px; }
  .live-stats { grid-template-columns: 1fr; gap: 12px; }
  .gauge-num { font-size: 2.6rem; }
  .toolbar input[type='search'] { max-width: none; }
  .toolbar-end { margin-left: 0; width: 100%; }
  .toolbar-end .btn { flex: 1; }
  .cars tbody th.col-car { min-width: 150px; max-width: 170px; }
  .cars tbody th.col-car .plate { display: none; }
  .tags { margin-left: 0; }
  .sheet { top: 8vh; width: 100%; border-radius: 16px 16px 0 0; animation-name: slide-up; }
  .sheet-head { border-radius: 16px 16px 0 0; }
  .filter-grid { grid-template-columns: 1fr; }
}

@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
