:root {
  --bg: #0b0b0d;
  --panel: #151518;
  --panel-2: #1d1d21;
  --line: #2a2a30;
  --text: #f2f2f4;
  --muted: #8d8d97;
  --gti-red: #d0021b;
  --ok: #3fb950;
  --warn: #e3a008;
  --bad: #f04848;
  --tabbar-h: 62px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between;
  align-items: center; padding: max(12px, env(safe-area-inset-top)) 16px 10px;
  background: rgba(11, 11, 13, .88); backdrop-filter: blur(12px); }
.brand { font-weight: 700; font-size: 20px; letter-spacing: .5px; }
.gti { color: var(--gti-red); font-style: italic; }
.nickname { color: var(--muted); font-size: 14px; }

/* ---------- 3D hero ---------- */
.hero { position: relative; height: 52vh; min-height: 300px; max-height: 560px; }
#car-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.status { position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--muted); padding: 24px; pointer-events: none; line-height: 1.5; }
.status.hidden { display: none; }
.hero-controls { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; }
.chip { background: rgba(20, 20, 24, .78); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; backdrop-filter: blur(8px); }
.chip.active { border-color: var(--gti-red); }

/* ---------- home content ---------- */
.home { padding: 16px; display: flex; flex-direction: column; gap: 22px; max-width: 760px; margin: 0 auto; }
.headline { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.plate-badge { display: inline-block; background: #f4c400; color: #111; font-weight: 800;
  letter-spacing: 2px; padding: 3px 10px; border-radius: 4px; font-size: 14px; margin-bottom: 8px; }
h1 { font-size: 24px; line-height: 1.15; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.odo { flex: none; text-align: right; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px; cursor: pointer; display: flex; flex-direction: column; }
.odo-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.odo-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.odo-date { color: var(--muted); font-size: 11px; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
h2 { font-size: 17px; }
.count { color: var(--muted); font-weight: 500; font-size: 14px; }
.link-btn { background: none; border: 0; color: #ff4a5c; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.link-btn.muted { color: var(--muted); font-weight: 500; }

/* status cards */
.cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr);
  gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px;
  margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.cards::-webkit-scrollbar { display: none; }
.card { scroll-snap-align: start; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; min-height: 96px; }
.card .k { color: var(--muted); font-size: 12px; }
.card .v { font-size: 18px; font-weight: 700; }
.card .s { color: var(--muted); font-size: 12px; }
.card.ok { border-left-color: var(--ok); }
.card.warn { border-left-color: var(--warn); }
.card.bad { border-left-color: var(--bad); }
.card.bad .v { color: var(--bad); }
.card.empty .v { color: var(--muted); font-weight: 500; font-size: 15px; }

/* details */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.group-title { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px;
  margin: 14px 0 4px; }
.group-title:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.kv dd.blank { color: #5a5a63; }
dl { margin: 0; }

/* mods */
.mods { list-style: none; margin: 0; padding: 0; }
.mods li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line);
  cursor: pointer; }
.mods li:last-child { border-bottom: 0; }
.mods .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gti-red); margin-top: 7px; flex: none; }
.mods .name { font-size: 14px; }
.mods .note { color: var(--muted); font-size: 12px; margin-top: 2px; }

.credit { color: #5d5d66; font-size: 11px; text-align: center; line-height: 1.5; }
.credit a { color: inherit; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid;
  grid-template-columns: repeat(4, 1fr); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgba(14, 14, 17, .94);
  border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
.tab { background: none; border: 0; color: var(--muted); font-size: 11px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.tab .ico { font-size: 18px; line-height: 1; }
.tab.active { color: var(--text); }
.tab.active .ico { color: var(--gti-red); }

/* ---------- sheets ---------- */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh;
  background: var(--panel); color: var(--text); border-radius: 18px 18px 0 0; }
.sheet::backdrop { background: rgba(0, 0, 0, .6); }
.sheet form { display: flex; flex-direction: column; max-height: 92vh; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-size: 16px; }
.sheet-body { padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.field input, .field textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gti-red); }
.field textarea { min-height: 90px; resize: vertical; }
.field .ph { font-size: 11px; color: #63636c; }
.hint { color: var(--muted); font-size: 13px; min-height: 1em; }
.hint.warn { color: var(--warn); }
.danger-btn { margin-top: 20px; width: 100%; background: none; border: 1px solid #5a2328; color: var(--bad);
  border-radius: 10px; padding: 10px; cursor: pointer; }
.form-group { color: var(--text); font-weight: 600; font-size: 14px; margin: 22px 0 0; }
.form-group:first-child { margin-top: 12px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: #26262c; color: var(--text);
  padding: 10px 16px; border-radius: 999px; font-size: 14px; pointer-events: none; z-index: 20;
  white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- wide screens: car on the left, details on the right ---------- */
@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr); }
  .hero { position: sticky; top: 52px; height: calc(100vh - 52px - var(--tabbar-h)); max-height: none; }
  .home { max-width: none; margin: 0; padding: 20px 24px; }
  .sheet { margin: auto; border-radius: 18px; }
}

/* ================= shared ================= */
[hidden] { display: none !important; }
.primary-btn { background: var(--gti-red); border: 0; color: #fff; font-weight: 600; border-radius: 999px;
  padding: 9px 16px; cursor: pointer; white-space: nowrap; }
.ghost-btn { display: inline-flex; align-items: center; justify-content: center; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-size: 14px; color: var(--text); }
.field select { font: inherit; font-size: 16px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; appearance: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .field { min-width: 0; }

/* ================= service screen ================= */
.service { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
.svc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.search input { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; }
.search input:focus { outline: none; border-color: var(--gti-red); }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { white-space: nowrap; background: var(--panel); }

.year { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 600;
  margin: 10px 2px 6px; }
.records { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; }
.records li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.records li:last-child { border-bottom: 0; }
.records li:hover { background: var(--panel-2); }
.rdate { width: 38px; flex: none; text-align: center; display: flex; flex-direction: column; line-height: 1.1; }
.rdate b { font-size: 18px; }
.rdate span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.rmain { flex: 1; min-width: 0; }
.rtitle { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rmeta { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rside { flex: none; text-align: right; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.clip { color: var(--muted); font-size: 11px; }

.empty { text-align: center; padding: 40px 20px; background: var(--panel); border: 1px dashed var(--line); border-radius: 16px; }
.empty-ico { font-size: 34px; color: var(--gti-red); }
.empty p { margin: 6px 0; }
.empty-search { text-align: center; padding: 20px; }

.backup { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.backup-actions { display: flex; gap: 8px; }

/* record sheets */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); padding: 0; background: var(--panel-2); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb [data-rm] { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .7); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.thumbs.big .thumb { width: 96px; height: 96px; }
.add-photo { align-self: flex-start; margin-top: 4px; }
.view-title { font-size: 20px; margin: 10px 0 6px; }
.parts { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.partno { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.notes { white-space: pre-wrap; font-size: 14px; line-height: 1.5; margin: 0; }
.photo-viewer { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
.photo-viewer::backdrop { background: rgba(0, 0, 0, .9); }
.photo-viewer img { max-width: 96vw; max-height: 92vh; display: block; border-radius: 8px; }

/* ================= diagnose ================= */
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 3px; gap: 3px; }
.segmented button { background: none; border: 0; border-radius: 9px; padding: 8px 4px; font-size: 13px; color: var(--muted);
  cursor: pointer; white-space: nowrap; }
.segmented button.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--gti-red); }
.diagnose section { display: flex; flex-direction: column; gap: 12px; }
.sub.small { font-size: 12px; margin: 0; }
.pill { flex: none; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 9px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted); }
.pill.bad { color: #ff7676; border-color: #5a2328; background: #2a1416; }
.pill.warn { color: #f0b429; border-color: #5a4417; background: #2a2210; }
.pill.ok { color: #5fd27a; border-color: #1f4a2b; background: #112217; }
.records li.sub { cursor: default; }
.rtitle.wrap { white-space: normal; }

.banner { border-radius: 12px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.45; margin-top: 8px; }
.banner.bad { background: #2a1416; border-color: #5a2328; }
.banner.bad b { color: #ff7676; }
.banner.warn { background: #2a2210; border-color: #5a4417; }
.banner.warn b { color: #f0b429; }
.banner.ok { background: #112217; border-color: #1f4a2b; }
.banner.ok b { color: #5fd27a; }
.legend { text-transform: none; letter-spacing: 0; font-weight: 400; }
.causes details { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--panel-2); }
.causes summary { display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; list-style: none; }
.causes summary::-webkit-details-marker { display: none; }
.cname { flex: 1; font-size: 14px; font-weight: 600; }
.dots { color: var(--gti-red); font-size: 9px; letter-spacing: 1px; }
.dots i { color: #3a3a42; font-style: normal; }
.diy { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.cbody { padding: 0 12px 12px; font-size: 14px; line-height: 1.5; }
.cbody p { margin: 6px 0 0; }
.cbody b { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.code-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.code-chips .chip { font-family: ui-monospace, Menlo, monospace; }
.primary-btn.wide { width: 100%; margin-top: 18px; padding: 12px; }

.code-form { display: flex; gap: 8px; }
.code-form input { flex: 1; min-width: 0; font: 600 18px ui-monospace, Menlo, monospace; letter-spacing: 1px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; text-transform: uppercase; }
.code-form input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; color: #5d5d66; }
.code-form input:focus { outline: none; border-color: var(--gti-red); }
.code-card { background: var(--panel); border: 1px solid var(--gti-red); border-radius: 14px; padding: 14px 16px; }
.code-card h3 code, .records.codes code { font-family: ui-monospace, Menlo, monospace; }
.code-top { display: flex; justify-content: space-between; align-items: center; }
.code-title { font-size: 16px; font-weight: 600; margin: 6px 0 4px; }
.decode { margin-top: 10px; }
.code-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.records.codes li { padding: 10px 14px; }
.records.codes code { flex: none; width: 54px; font-size: 13px; font-weight: 700; color: #ff6b7a; }
.records.codes .rtitle { font-weight: 500; font-size: 13px; }
.sev { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sev.bad { background: var(--bad); } .sev.warn { background: var(--warn); } .sev.ok { background: var(--ok); }

.light-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.light-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; text-align: center; line-height: 1.25; }
.light-tile:hover { background: var(--panel-2); }
.licon { width: 40px; height: 40px; display: grid; place-items: center; }
.licon svg { width: 100%; height: 100%; }
.licon.red { color: #ff3b3b; filter: drop-shadow(0 0 6px rgba(255, 59, 59, .45)); }
.licon.yellow { color: #ffb300; filter: drop-shadow(0 0 6px rgba(255, 179, 0, .4)); }
.licon.green { color: #35d05a; filter: drop-shadow(0 0 6px rgba(53, 208, 90, .4)); }
.licon.blue { color: #3b8bff; filter: drop-shadow(0 0 6px rgba(59, 139, 255, .45)); }
.licon.big { width: 72px; height: 72px; }
.light-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0 4px; }

.istatus { font-size: 12px; margin-top: 3px; color: var(--muted); white-space: normal; }
.istatus.ok { color: #5fd27a; } .istatus.warn { color: #f0b429; }
#dx-issue-list .rtitle { white-space: normal; }
.disclaimer { color: #6a6a73; font-size: 11px; line-height: 1.5; text-align: center; margin: 8px 0 0; }
.sheet-spacer { width: 44px; }
#dx-sym-list .rtitle { white-space: normal; }
@media (max-width: 400px) { .segmented button { font-size: 12px; padding: 8px 2px; } }

/* ================= parts ================= */
.xray-only { display: none; }
.hero.xray .xray-only { display: inline-block; }
.hero.xray { background: radial-gradient(ellipse at 50% 60%, #1b1d24 0%, #0b0b0d 75%); }
.hotspots { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hotspot { position: absolute; left: 0; top: 0; pointer-events: auto; background: none; border: 0; padding: 0;
  display: flex; align-items: center; gap: 6px; cursor: pointer; margin: -9px 0 0 -9px; }
.hs-dot { width: 18px; height: 18px; border-radius: 50%; background: rgba(208, 2, 27, .9); border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(208, 2, 27, .25); flex: none; }
.hs-label { font-size: 12px; font-weight: 600; color: #fff; background: rgba(12, 12, 16, .82); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 999px; white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: .15s; }
.hotspot:hover .hs-label, .hotspot.active .hs-label { opacity: 1; transform: none; }
.hotspot.active .hs-dot { background: #fff; border-color: var(--gti-red); box-shadow: 0 0 0 6px rgba(208, 2, 27, .45); }
@media (hover: none) { .hotspot .hs-label { display: none; } .hotspot.active .hs-label { display: block; opacity: 1; } }

.zone-bar { display: flex; justify-content: space-between; align-items: center; font-size: 14px; min-height: 24px; }
.records .rmeta code, .shop code { font-family: ui-monospace, Menlo, monospace; color: #ff8a96; font-size: 12px; }
.part-zone { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; margin-top: 8px; }
.pn-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.pn-box .k { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.pn { font: 700 20px ui-monospace, Menlo, monospace; letter-spacing: 1px; }
.pn-box + .sub.small { margin-top: 8px; }
.part-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.part-actions a { text-decoration: none; }
.shop { list-style: none; margin: 0; padding: 0; }
.shop li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.shop li:last-child { border-bottom: 0; }
.shop li.done .name { text-decoration: line-through; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gti-red); }

/* ================= install card ================= */
.install { display: flex; gap: 14px; align-items: flex-start; position: relative; }
.install img { border-radius: 11px; flex: none; }
.install-main { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.install-main .sub { margin: 0; }
.install-main .primary-btn { align-self: flex-start; }
.install-x { position: absolute; top: 8px; right: 10px; }
.share-ico { display: inline-block; border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; font-size: 12px; }

/* ================= electrical ================= */
.segmented { grid-template-columns: repeat(5, 1fr); }
.mini-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--panel-2); border-radius: 10px; padding: 3px; }
.mini-seg button { background: none; border: 0; border-radius: 8px; padding: 7px 2px; font-size: 12px; color: var(--muted); cursor: pointer; }
.mini-seg button.active { background: var(--panel); color: var(--text); box-shadow: inset 0 -2px 0 var(--gti-red); }
.volt-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.volt-row input { flex: 1; min-width: 0; font: 700 26px ui-monospace, Menlo, monospace; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.volt-row input:focus { outline: none; border-color: var(--gti-red); }
.volt-unit { font-size: 20px; color: var(--muted); width: 36px; }
.banner .link-btn { align-self: flex-start; padding: 4px 0 0; }
.howto { margin-top: 12px; font-size: 14px; }
.howto summary { cursor: pointer; color: #ff6b7a; font-weight: 600; }
.howto ol { margin-top: 8px; }
.chev { color: var(--muted); font-size: 22px; }
.rmeta.wrap { white-space: normal; }
.kv-block { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv-block p { margin: 4px 0 0; line-height: 1.45; }
.fuse-colours, .wire-colours { display: flex; flex-wrap: wrap; gap: 6px; }
.fuse-chip, .wire-colours span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; }
.fuse-chip i, .wire-colours i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,.25); }
.fuse-map { list-style: none; margin: 0 0 10px; padding: 0; }
.fuse-map li { display: grid; grid-template-columns: 12px auto auto 1fr auto; gap: 8px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.fuse-map li.sub { display: block; }
.fuse-dot { width: 12px; height: 12px; border-radius: 3px; }
.fuse-id b { font-family: ui-monospace, Menlo, monospace; }
.fuse-amp { color: var(--muted); font-size: 12px; }
.fuse-what { overflow-wrap: anywhere; }
.fuse-add { display: grid; grid-template-columns: 1fr 64px 80px; gap: 6px; }
.fuse-add input, .fuse-add select { font: inherit; font-size: 16px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; min-width: 0; }
.fuse-add [name=circuit] { grid-column: 1 / 3; }
.modules { list-style: none; margin: 0; padding: 0; }
.modules li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.modules li:last-child { border-bottom: 0; }
.modules code { flex: none; width: 30px; font: 700 14px ui-monospace, Menlo, monospace; color: #ff8a96; }
.modules span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.kv dt code, .wire-colours code, .sub code { font-family: ui-monospace, Menlo, monospace; color: #ff8a96; }

.circuit-wrap { background: #0f1014; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-top: 12px; }
.circuit { width: 100%; height: auto; display: block; }
.circuit .part rect { fill: #1d1e24; stroke: #5d5f6a; stroke-width: 1.2; }
.circuit .part.switch rect { stroke-dasharray: 4 3; }
.circuit .part.fuse rect { fill: #24201a; stroke: #b9862a; }
.circuit .fuse-s { fill: none; stroke: #f0b429; stroke-width: 1.5; }
.circuit .part text { fill: #e9e9ee; font: 600 10px -apple-system, Segoe UI, sans-serif; }
.circuit polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.circuit .w-pos { stroke: #e5484d; stroke-width: 2; }
.circuit .w-heavy { stroke: #e5484d; stroke-width: 4.5; }
.circuit .w-sig { stroke: #f0b429; stroke-width: 2; stroke-dasharray: 6 4; }
.circuit .w-gnd { stroke: #8d8d97; stroke-width: 2; }
.circuit .w-gnd-sym line { stroke: #8d8d97; stroke-width: 2; }
.circuit .w-label { fill: #9a9aa5; font: 9px -apple-system, Segoe UI, sans-serif; }
.circuit .tp { cursor: pointer; }
.circuit .tp circle { fill: #fff; stroke: var(--gti-red); stroke-width: 2.5; }
.circuit .tp text { fill: #111; font: 800 10px -apple-system, Segoe UI, sans-serif; pointer-events: none; }
.circuit .tp.on circle { fill: var(--gti-red); stroke: #fff; }
.circuit .tp.on text { fill: #fff; }
.legend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.lg { display: inline-block; width: 18px; height: 0; border-top: 2px solid; margin-right: -4px; }
.lg.pos { border-color: #e5484d; } .lg.heavy { border-top-width: 4px; border-color: #e5484d; }
.lg.sig { border-color: #f0b429; border-top-style: dashed; } .lg.gnd { border-color: #8d8d97; }
.tp-list { list-style: none; margin: 0; padding: 0; }
.tp-list li { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 14px; line-height: 1.45; }
.tp-list li.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--gti-red); }
.tp-list p { margin: 2px 0 0; color: #c9c9d1; }
.tp-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #111; font-weight: 800; font-size: 12px;
  display: grid; place-items: center; }
@media (max-width: 400px) { .segmented button { font-size: 11.5px; } }

/* ================= guides ================= */
.tabbar { grid-template-columns: repeat(5, 1fr); }
.segmented.two { grid-template-columns: 1fr 1fr; }
.guides section { display: flex; flex-direction: column; gap: 12px; }
.guide-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 8px 0; }
#guide-progress { margin-left: auto; color: #5fd27a; font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; padding: 11px 10px; border-radius: 10px; cursor: pointer; font-size: 15px; line-height: 1.45;
  border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .stepn { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #4a4a52; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--muted); }
.steps li.done { color: var(--muted); }
.steps li.done > div { text-decoration: line-through; text-decoration-color: #555; }
.steps li.done .stepn { background: #2f9e57; border-color: #2f9e57; color: #fff; font-size: 0; }
.steps li.done .stepn::after { content: '✓'; font-size: 13px; }
.torque { display: inline-block; margin-left: 8px; font: 700 12px ui-monospace, Menlo, monospace; color: #ffb3bb;
  background: #2a1416; border: 1px solid #5a2328; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.spec-list { list-style: none; margin: 0; padding: 0; }
.spec-list li { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec-list li:last-child { border-bottom: 0; }
.spec-list p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.spec-val { flex: none; text-align: right; font-weight: 700; max-width: 45%; }
.spec-val small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.verify { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: #f0b429; border: 1px solid #5a4417; border-radius: 4px; padding: 0 4px; vertical-align: 2px; }
.notes.small { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ================= explore (3D interaction) ================= */
.hero.xray .home-only { display: none !important; }
.explore-panel { position: absolute; left: 10px; right: 10px; bottom: 54px; background: rgba(14, 14, 18, .86);
  backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex;
  flex-direction: column; gap: 8px; }
.ex-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ex-row::-webkit-scrollbar { display: none; }
.ex-row .chip { white-space: nowrap; flex: none; }
.ex-k { flex: none; width: 40px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.ex-note, .ex-tip { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.ex-note { color: #f0b429; }
@media (max-width: 959px) { .hero.exploring { height: 72vh; max-height: 640px; } }
.plate-badge { font-family: "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", sans-serif; font-weight: 700;
  letter-spacing: 1.5px; font-size: 15px; }

/* ================= 3D view icon bar (right side) ================= */
.hero-tools { position: absolute; right: 10px; top: 10px; bottom: 10px; display: flex; flex-direction: column;
  flex-wrap: wrap-reverse; align-content: flex-start; justify-content: center; gap: 6px; pointer-events: none; z-index: 2; }
.tool { pointer-events: auto; width: 38px; height: 38px; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center; color: #e6e6ec; background: rgba(14, 14, 18, .66);
  border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .15s, color .15s, box-shadow .15s, background .15s; }
.tool svg { width: 20px; height: 20px; }
.tool:hover { background: rgba(28, 28, 34, .8); }
.tool.active { color: #fff; border-color: var(--gti-red); box-shadow: 0 0 0 2px rgba(208, 2, 27, .3); }
.tool-sep { pointer-events: none; width: 22px; height: 1px; background: rgba(255, 255, 255, .22); margin: 2px 8px; }
/* dashboard-style colours for the lamps */
.tool.lamp.active { color: #3ddc68; border-color: #2f9e57; box-shadow: 0 0 10px rgba(61, 220, 104, .45); }
.tool.lamp.blink.active { animation: gti-blink .706s steps(1) infinite; }
.tool.lamp.hazard.active { color: #ff4a4a; border-color: #b3262b; box-shadow: 0 0 10px rgba(255, 74, 74, .45);
  animation: gti-blink .706s steps(1) infinite; }
@keyframes gti-blink { 50% { color: #6a6a72; box-shadow: none; } }
/* day / night icon */
.tool .i-moon { display: none; }
.tool[hidden] { display: none; }
/* engine: red ring while running; the rev button is held down like a pedal */
.tool.engine.active { color: #ff5a5a; border-color: var(--gti-red); box-shadow: 0 0 10px rgba(208, 2, 27, .5); }
.tool.rev { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tool.rev.pressed { color: #fff; background: var(--gti-red); border-color: var(--gti-red); transform: scale(.94); }
/* the rev "pedal" sits bottom-left of the 3D view while the engine runs — big enough to hold with a thumb */
.rev-pedal { position: absolute; left: 12px; bottom: 12px; z-index: 2; width: 60px !important; height: 60px !important;
  grid-template-rows: auto auto; align-content: center; gap: 1px; border-color: rgba(208, 2, 27, .55); }
.rev-pedal svg { width: 24px !important; height: 24px !important; }
.rev-pedal span { font: 700 9.5px/1 system-ui, sans-serif; letter-spacing: .08em; }
/* wiper mode letter: F, R or F+R in the corner of the wiper button */
.tool#tool-wipers { position: relative; }
.wiper-mode { position: absolute; right: -3px; bottom: -3px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px;
  background: #2f9e57; color: #fff; font: 700 9px/14px system-ui, sans-serif; display: none; }
#tool-wipers[data-mode="front"] .wiper-mode, #tool-wipers[data-mode="rear"] .wiper-mode, #tool-wipers[data-mode="both"] .wiper-mode { display: block; }
#tool-wipers[data-mode="front"] .wiper-mode::after { content: 'F'; }
#tool-wipers[data-mode="rear"] .wiper-mode::after { content: 'R'; }
#tool-wipers[data-mode="both"] .wiper-mode::after { content: 'F+R'; }
.tool.night .i-moon { display: inline; }
.tool.night .i-sun { display: none; }
/* sound on / off */
.tool.snd .i-on { display: none; }
.tool.snd.active .i-on { display: inline; }
.tool.snd.active .i-off { display: none; }
.tool.snd:not(.active) { color: #9a9aa4; }
.tool.snd.active { border-color: rgba(255, 255, 255, .45); box-shadow: none; }
/* Parts tab (X-ray) shows only the shared tools + Overview */
.hero.xray .home-only { display: none !important; }
.hero .xray-only { display: none; }
.hero.xray .xray-only { display: grid; }
/* small labels over the car */
.view-label, .tap-hint { position: absolute; left: 12px; top: 12px; max-width: calc(100% - 80px); font-size: 12.5px;
  color: #fff; background: rgba(14, 14, 18, .74); border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px;
  padding: 6px 12px; pointer-events: none; transition: opacity .6s; backdrop-filter: blur(8px); line-height: 1.35; }
.view-label.fade, .tap-hint.fade { opacity: 0; }
.tap-hint { top: auto; bottom: 12px; }
/* the old bottom chips are gone; give the car the full panel */
.hero-controls, .explore-panel { display: none !important; }
@media (max-width: 959px) {
  .hero { height: 58vh; max-height: 620px; }
  .hero-tools { gap: 4px; right: 8px; top: 8px; bottom: 8px; }
  .tool { width: 34px; height: 34px; }
  .tool svg { width: 18px; height: 18px; }
  .tool-sep { margin: 1px 6px; }
}
/* Phones: size the buttons from the view's height so the bar always stays a single column. */
@media (max-width: 959px) {
  .hero-tools { gap: 3px; }
  .tool { width: clamp(26px, calc(4.3vh - 5px), 34px); height: clamp(26px, calc(4.3vh - 5px), 34px); }
  .tool svg { width: 55%; height: 55%; }
  .tool-sep { margin: 0 5px; }
}
