:root {
  color-scheme: dark;
  --background: #101115;
  --panel: #191b22;
  --field: #13151b;
  --line: #333641;
  --text: #f6f5f3;
  --muted: #b0b2bf;
  --accent: #ff735b;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 66px; gap: 18px; }
.wordmark { font-size: 1.65rem; font-weight: 950; font-style: italic; letter-spacing: -.08em; text-decoration: none; }
.wordmark span, em { color: var(--accent); }
nav { display: flex; gap: 24px; font-size: .9rem; }
nav a { text-decoration: none; }
nav a:hover, .links a:hover { color: var(--accent); }
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 44px;
  margin-block: 30px 42px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(24px, 5vw, 64px);
  background: radial-gradient(ellipse at 9% 93%, #402322 0, transparent 58%), #171920;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(3.4rem, 8vw, 7rem); line-height: .89; letter-spacing: -.075em; margin-bottom: 24px; }
h1 em { font-style: normal; }
h2 { font-size: 1.4rem; line-height: 1.2; letter-spacing: -.03em; }
h3 { margin-bottom: 8px; line-height: 1.25; }
.hero-copy > p:last-child { max-width: 40ch; color: var(--muted); margin-bottom: 0; }
.eyebrow { font-size: .73rem; font-weight: 800; letter-spacing: .17em; color: var(--accent); margin-bottom: 20px; }
.garage, .planner, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; min-width: 0; }
.garage { background: #191b22; }
.fields, .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields { margin-top: 12px; }
.fields > * { min-width: 0; }
label { display: block; font-size: .82rem; color: var(--muted); font-weight: 650; margin-bottom: 5px; }
input, select { display: block; width: 100%; min-height: 44px; min-width: 0; border: 1px solid var(--line); background: var(--field); color: var(--text); border-radius: 8px; padding: 8px 10px; }
input:disabled, select:disabled { opacity: .62; }
.muted { color: var(--muted); font-size: .86rem; }
#specification { margin: 14px 0 5px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); align-items: start; gap: 24px; }
.section-title { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.filters { margin-bottom: 16px; }
.filters input, .filters select { margin-top: 5px; }
#cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.card p { margin: 0; font-size: .9rem; }
.card .type { color: var(--muted); font-size: .75rem; }
.card .description { flex: 1; }
.fitment { border-top: 1px solid var(--line); padding-top: 10px; width: 100%; }
.fitment strong { display: block; font-size: .83rem; color: #ffcb83; }
.fitment strong[data-status="listed"] { color: #a2e6b4; }
.fitment strong[data-status="incompatible"] { color: #ff9a8e; }
.links { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: .78rem; color: var(--muted); }
button { padding: 8px 14px; min-height: 44px; border-radius: 8px; border: 1px solid transparent; background: var(--accent); color: #171117; font-weight: 750; }
button:hover:not(:disabled) { background: #ff9583; }
button:disabled { background: var(--field); color: var(--muted); cursor: default; border-color: var(--line); }
.remove { background: transparent; color: var(--text); border-color: var(--line); padding-inline: 10px; }
.remove:hover:not(:disabled) { color: #171117; }
.build-item { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.build-item header, .totals div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.build-item h3 { font-size: 1rem; }
.build-item .status-label { margin-top: 9px; }
.totals { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 8px; }
.totals div { padding-block: 3px; }
dt { color: var(--muted); }
dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.footer { border-top: 1px solid var(--line); margin-top: 50px; padding-block: 20px 32px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .85rem; }
@media (max-width: 900px) {
  #cards { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 30px); }
  .hero, .workspace { grid-template-columns: 1fr; gap: 18px; }
  .hero { padding: 20px; margin-block: 16px 30px; }
  .hero-copy { padding: 10px 2px; }
  .garage, .planner, .card { padding: 16px; }
  .section-title h2 { margin-bottom: 5px; }
}

#brake-field { margin-top: 12px; }
.catalogue-scope { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.catalogue-scope input { width: 18px; min-height: 18px; accent-color: var(--accent); }
.card .price { font-weight: 720; }

.guide-panel {
  margin-block: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: clamp(16px, 4vw, 36px);
  scroll-margin-top: 16px;
}
.guide-panel h2 { font-size: clamp(1.8rem, 5vw, 3rem); margin-block: 16px; }
.guide-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.guide-sections section { border-top: 1px solid var(--line); padding-top: 12px; }
.guide-sections h3 { font-size: 1.05rem; }
.guide-link { color: var(--accent); font-weight: 650; }
.comparison th, .comparison td { padding: 8px 10px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
.comparison { border-collapse: collapse; width: 100%; margin-bottom: 18px; }
.wheel-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-block: 15px; }
.wheel-form fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 12px; }
.wheel-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wheel-form output { align-self: center; font-weight: 650; }
#build-checks { color: var(--muted); font-size: .9rem; }
#build-checks h3 { color: var(--text); font-size: 1rem; margin-top: 18px; }
#guide-content > h3 { margin-top: 18px; }
@media (max-width: 700px) {
  nav { gap: 12px; font-size: .8rem; }
  .guide-sections, .wheel-form { grid-template-columns: 1fr; }
}

/* Keep each tool on its own view, with the selected car above it. */
.workspace { display: block; margin-block: 30px; }
#build { max-width: 760px; }
#cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
nav { flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; }
nav a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding-inline: 8px; }
nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
.search-row, .selected-car, .selected-car > div { display: flex; align-items: center; gap: 12px; }
.selected-car { justify-content: space-between; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px 16px; margin-block: 18px; }
#selected-chassis { font-weight: 850; background: var(--field); color: var(--accent); border-radius: 6px; padding: 5px 8px; }
#car-action { flex-shrink: 0; color: var(--accent); font-weight: 700; font-size: .87rem; padding-block: 10px; }
#vehicle-results { display: grid; gap: 8px; }
#vehicle-results button { margin-top: 8px; text-align: left; background: var(--field); color: var(--text); border-color: var(--line); }
#vehicle-feedback { margin-block: 8px; }
.guide-sections .comparison { grid-column: 1 / -1; }
.comparison caption { text-align: left; font-weight: 800; padding-block: 12px; }
.guide-sections [data-topic="benefits"] { border-top-color: #7cb898; }
.guide-sections [data-topic="drawbacks"] { border-top-color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 520px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 0; padding-top: 8px; }
  nav { justify-content: flex-start; gap: 0 4px; }
  .hero { margin-bottom: 18px; }
  .selected-car > div { align-items: flex-start; flex-direction: column; gap: 4px; }
}
