/* Layout: one calm column on phones; photo left and wheel picker right on wide screens. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --line: #d9dde3;
  --ink: #161a20;
  --muted: #5b636e;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fde9dd;
  --accent-2: #c94a12;
  --good: #13703a;
  --good-soft: #dcf3e4;
  --warn: #875a06;
  --warn-soft: #fbf0d0;
  --bad: #b91c1c;
  --bad-soft: #fbe1e1;
  --stage: #e4e7eb;
  --stage-top: #ffffff;
  --stage-bottom: #dde1e7;
  --glass: rgba(255, 255, 255, .78);
  --shadow: 0 1px 2px rgba(20, 24, 32, .06), 0 6px 20px rgba(20, 24, 32, .06);
  --head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317; --surface: #1a1d22; --surface-2: #23272e; --line: #323740; --ink: #f1f3f6; --muted: #a4abb6;
    --accent: #fb7f3c; --accent-2: #e0712b; --accent-ink: #1a0d04; --accent-soft: #3a2316; --good: #4ade80; --good-soft: #15301f;
    --warn: #fbbf24; --warn-soft: #36290c; --bad: #f87171; --bad-soft: #3a1717; --stage: #1f2228; --stage-top: #2f333a; --stage-bottom: #121418; --glass: rgba(26, 29, 34, .78);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111317; --surface: #1a1d22; --surface-2: #23272e; --line: #323740; --ink: #f1f3f6; --muted: #a4abb6;
  --accent: #fb7f3c; --accent-2: #e0712b; --accent-ink: #1a0d04; --accent-soft: #3a2316; --good: #4ade80; --good-soft: #15301f;
  --warn: #fbbf24; --warn-soft: #36290c; --bad: #f87171; --bad-soft: #3a1717; --stage: #1f2228; --stage-top: #2f333a; --stage-bottom: #121418; --glass: rgba(26, 29, 34, .78);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
h1, h2, h3 { font-family: var(--head); line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); font-weight: 400; }
.tiny { font-size: .82rem; }
.sr-only, .file-input { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding-block: 20px 60px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; font: 800 1.15rem var(--head); min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { width: 28px; height: 28px; color: var(--accent); flex: none; }
.link-btn { background: none; border: 0; color: var(--muted); font: 600 .9rem var(--body); padding: 8px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.link-btn:hover { color: var(--ink); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 1rem var(--body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); padding: 10px 16px; border-radius: 12px; cursor: pointer; min-height: 48px; text-align: center; user-select: none; -webkit-user-select: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.huge { font-size: 1.2rem; padding: 18px 28px; min-height: 64px; border-radius: 16px; width: 100%; max-width: 420px; }
.btn.huge svg { width: 28px; height: 28px; }
.btn.plain { border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.btn.small { font-size: .9rem; padding: 6px 12px; min-height: 40px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label.btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, fieldset legend, .car-pick label, .fix-row label { font-weight: 600; font-size: .95rem; }
input, select, textarea { font: 17px var(--body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; min-height: 48px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="range"] { padding: 0; min-height: 40px; accent-color: var(--accent); border: 0; background: none; box-shadow: none; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--bad); font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 560px; }

/* Showroom hero: the car fills the width; controls float over it */
.hero { display: flex; flex-direction: column; gap: 12px; }
.stage-wrap .photo-empty .btn { position: relative; z-index: 1; }
/* --dock-h: room kept under the 3D car for the quick wheel picker (set by app.js) */
.stage-wrap { position: relative; height: calc(clamp(340px, 56vh, 700px) + var(--dock-h, 0px)); background: radial-gradient(120% 90% at 50% 35%, var(--stage-top), var(--stage-bottom)); overflow: hidden; }
.stage-wrap.photo-fit:not(.full) { height: auto; aspect-ratio: var(--ar, 1.6); max-height: 72vh; }
.stage3d { position: absolute; inset: 0 0 var(--dock-h, 0px); touch-action: none; }
.stage3d canvas { display: block; width: 100%; height: 100%; outline: none; -webkit-mask-image: linear-gradient(#000 84%, transparent); mask-image: linear-gradient(#000 84%, transparent); }
/* Label on the 3D car: "Building 3D design preview…" during the build animation, then a small tag */
.build-tag { position: absolute; left: 16px; top: 18px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .01em; pointer-events: none; box-shadow: var(--shadow); }
.build-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3b9bff; box-shadow: 0 0 0 4px rgba(59, 155, 255, .2); }
.loading { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-weight: 600; padding: 0 16px; text-align: center; }
.loading .spinner { border-color: var(--line); border-top-color: var(--accent); }

.stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--stage-bottom); touch-action: manipulation; }
.stage canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.stage.tapping { cursor: crosshair; }
.stage canvas { transition: transform .8s cubic-bezier(.65, 0, .35, 1); will-change: transform; }
@media (prefers-reduced-motion: reduce) { .stage canvas { transition: none; } }
.stage .handles { position: absolute; pointer-events: none; }
.busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; background: rgba(0,0,0,.45); color: #fff; font-weight: 600; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tap-hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: rgba(0,0,0,.72); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .95rem; pointer-events: none; text-align: center; max-width: calc(100% - 24px); }

.photo-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.photo-empty svg { width: 56px; height: 56px; color: var(--accent); }
.pe-title { font: 800 clamp(1.4rem, 4vw, 2rem) var(--head); }
.pe-sub { color: var(--muted); max-width: 36ch; }
.btn.big { font-size: 1.1rem; padding: 14px 26px; min-height: 56px; }

/* Controls sit under the car so nothing covers it */
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 12px; padding-block: 4px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.mode { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.mode-btn { font: 700 .92rem var(--body); color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 9px 14px; cursor: pointer; min-height: 40px; white-space: nowrap; }
.mode-btn[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 .88rem var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; white-space: nowrap; user-select: none; -webkit-user-select: none; }
.chip:hover { border-color: var(--muted); }
.chip.ai { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.ai-badge { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; pointer-events: none; }
.chip.strong { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip svg { width: 16px; height: 16px; }
.views, .photo-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.paints { display: flex; gap: 8px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; max-width: 100%; overflow-x: auto; }
.swatch { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 0 0 1px rgba(0,0,0,.25); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent); }
.swatch.custom { background: conic-gradient(#e33, #ec3, #3c5, #3ae, #73e, #e33); position: relative; overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; }
/* Car picker in the showroom controls: one compact pill */
.car-select { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; min-height: 40px; max-width: 100%; }
.car-select label { font: 600 .88rem var(--body); color: var(--muted); }
/* 16px text stops phones zooming in when the list opens */
.car-select select { width: auto; min-width: 0; max-width: 60vw; min-height: 38px; border: 0; background: transparent; padding: 4px 6px; font: 600 16px var(--body); border-radius: 999px; text-overflow: ellipsis; }
.car-select .spinner { width: 16px; height: 16px; flex: none; border-width: 2px; border-color: var(--line); border-top-color: var(--accent); }
.car-note { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }

/* Full screen: the car only */
.stage-wrap.full { position: fixed; inset: 0; height: 100%; z-index: 100; }
body.no-scroll { overflow: hidden; }
.full-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 1.1rem; cursor: pointer; opacity: 0; transition: opacity .3s; z-index: 3; }
.full-close.show, .full-close:focus-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .full-close { transition: none; } }

.handles .handle { position: absolute; border: 3px solid var(--accent); border-radius: 50%; pointer-events: auto; cursor: move; touch-action: none; background: rgba(255,255,255,.08); }
.handle .num { position: absolute; left: 50%; top: -34px; transform: translateX(-50%) scaleX(var(--isx, 1)); background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .8rem; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
/* Resize dot on the circle's lower-right edge; the bigger invisible ring makes it easy to grab on a phone */
.handle .grip { position: absolute; left: 85.36%; top: 85.36%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.45); cursor: nwse-resize; transform: scaleX(var(--isx, 1)); }
.handle .grip::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
.handle .dot { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); }

.fix { margin: 0 auto; width: min(720px, calc(100% - 32px)); background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.fix-title { font-size: 1.05rem; }
.fix-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; }
.fix-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.fix-actions .btn { flex: 1 1 140px; }

/* Wheel rail and the chosen wheel */
.shop { display: flex; flex-direction: column; gap: 18px; padding-block: 16px 60px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.wheel { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 12px; border-radius: 18px; border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font: inherit; cursor: pointer; scroll-snap-align: start; text-align: center; }
.wheel:hover { border-color: var(--line); }
.wheel[aria-pressed="true"] { border-color: var(--accent); }
.wheel img { width: 124px; height: 124px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--surface), var(--surface-2)); }
.wheel .nm { font-weight: 700; font-size: .92rem; line-height: 1.2; margin-top: 4px; }
.wheel .fin { font-size: .8rem; color: var(--muted); }
.wheel .pr { font-weight: 700; font-size: .92rem; margin-top: 2px; }
.wheel .tag { position: absolute; top: 8px; left: 8px; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }

.tag.good, .badge.good { background: var(--good-soft); color: var(--good); }
.tag.pick { background: var(--accent); color: var(--accent-ink); }
.badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

.picked { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; gap: 14px; }
@media (min-width: 860px) { .picked { grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); align-items: start; column-gap: 32px; } .picked .buy { grid-column: 2; grid-row: 1 / span 3; } }
.picked h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.picked .sub { color: var(--muted); margin-top: 4px; }
.sizes-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn { font: 700 1rem var(--body); min-width: 64px; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.size-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.size-btn.nofit { color: var(--muted); text-decoration: line-through; }
.buy { display: grid; gap: 10px; background: var(--surface-2); border-radius: 14px; padding: 16px; }
.price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price strong { font: 800 2.2rem var(--head); font-variant-numeric: tabular-nums; }
.fitline { font-size: .95rem; }
.fitline.good { color: var(--good); }
.fitline.warn { color: var(--warn); }
.fitline.bad { color: var(--bad); }
details.info summary { cursor: pointer; color: var(--muted); font-size: .92rem; font-weight: 600; }
details.info ul { margin: 8px 0 0; padding-left: 20px; font-size: .92rem; color: var(--muted); display: grid; gap: 4px; }
.buy .btn.primary { width: 100%; font-size: 1.1rem; min-height: 56px; }
.car-pick { display: grid; gap: 6px; max-width: 460px; }
.car-pick label { font-weight: 600; font-size: .95rem; }
.credit { font-size: .78rem; color: var(--muted); }
.credit a { color: inherit; }

/* Staff */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { font: 600 1rem var(--body); color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 10px; cursor: pointer; white-space: nowrap; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.pill { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .78rem; font-weight: 700; text-align: center; }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 240px; max-width: 420px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font: 800 1.5rem var(--head); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .88rem; }
.stat.wide { grid-column: 1 / -1; }
.stat ol { margin: 4px 0 0; padding-left: 20px; font-size: .92rem; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.row img { width: 64px; height: 64px; }
.row .meta { font-size: .88rem; color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .row { grid-template-columns: 56px minmax(0, 1fr); } .row-actions { grid-column: 1 / -1; justify-content: flex-start; } }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chips .chip { font-size: .78rem; padding: 2px 8px; min-height: 0; border-radius: 999px; background: var(--surface-2); font-variant-numeric: tabular-nums; cursor: default; }
.chips .chip.out { color: var(--bad); }
.chips .chip.low { color: var(--warn); }
.quote { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.quote img { width: 100%; border-radius: 8px; display: block; }
.quote h3 { font-size: 1.1rem; }
.quote dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin: 6px 0; font-size: .95rem; }
.quote dt { color: var(--muted); }
.quote dd { margin: 0; overflow-wrap: anywhere; }
.q-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.q-actions select { width: auto; }
@media (max-width: 640px) { .quote { grid-template-columns: 1fr; } }
.empty-list { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--surface); border: 1.5px dashed var(--line); border-radius: 12px; }
details.more { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
details.more summary { cursor: pointer; font-weight: 600; }
.more-body { display: grid; gap: 10px; margin-top: 10px; }
.note { color: var(--muted); margin-top: 20px; }

/* Dialogs */
.dialog { border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); padding: 20px; width: min(500px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dialog.wide { width: min(900px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(10, 12, 16, .55); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dialog-actions .btn { flex: 1 1 120px; }
.quote-summary { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 10px; }
.quote-summary img { width: 120px; border-radius: 8px; flex: none; }
.quote-summary div { min-width: 0; font-size: .95rem; }
#copy-text { font: 13px ui-monospace, Menlo, Consolas, monospace; }

.editor { display: grid; gap: 16px; }
@media (min-width: 720px) { .editor { grid-template-columns: 240px minmax(0, 1fr); } }
.editor-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.editor-preview { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.editor-preview canvas { width: 200px; height: 200px; background: var(--surface-2); border-radius: 50%; }
.sizes { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; min-width: 0; }
.size-head, .size-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr 1fr 44px; gap: 6px; align-items: center; }
.size-head { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.size-row { margin-bottom: 6px; }
.size-row input { padding: 8px; min-height: 44px; font-size: 16px; }
.size-row .rm { min-height: 44px; padding: 0; }
@media (max-width: 560px) {
  .two { grid-template-columns: 1fr; }
  .size-head { display: none; }
  .size-row { grid-template-columns: 1fr 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
}

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(200%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); transition: transform .25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .toast { transition: none; } }

/* Keyboard focus on controls whose real input is invisible */
.swatch.custom:focus-within, label.chip:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Configurator look: the car, its controls and the photo try-on sit on one dark
   studio panel; everything below stays light. Local colour tokens turn the chips into glass. ---------- */
.hero {
  --surface: rgba(255, 255, 255, .07); --surface-2: rgba(255, 255, 255, .12); --line: rgba(255, 255, 255, .16);
  --ink: #f4f5f7; --muted: #aeb5c0; --bg: #101216; --glass: rgba(20, 22, 27, .62);
  --stage-top: #3a3f48; --stage-bottom: #0f1114;
  /* Brighter accent on the dark panel so keyboard focus rings stand out (3:1 or better) */
  --accent: #fb7f3c; --accent-soft: rgba(251, 127, 60, .35);
  background: radial-gradient(140% 80% at 50% 18%, #363b44 0%, #1a1d22 52%, #0e1013 100%);
  color: var(--ink); padding-bottom: 18px; border-radius: 0 0 28px 28px; gap: 14px;
}
.hero .stage-wrap { background: transparent; }
.hero .stage { background: #0f1114; }
.hero .chip, .hero .mode, .hero .paints, .hero .car-select { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero .chip:hover { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .12); }
.hero .chip.strong { background: #f4f5f7; color: #101216; border-color: #f4f5f7; }
.hero .car-select select { color: var(--ink); }
.hero .car-select option { color: #161a20; background: #fff; }
.hero .views .chip[aria-pressed="true"], .hero .views .chip.on { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5); }
.hero .loading { color: #c7ccd4; }
.hero .fix { background: #1d2026; }
.build-tag { color: #eef0f3; background: rgba(20, 22, 27, .6); border: 1px solid rgba(255, 255, 255, .12); }

/* "Try these on my car" over the 3D car */
.try-cta { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: 18px; z-index: 2; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border: 0; border-radius: 16px; cursor: pointer; color: #fff; text-align: left; font: inherit;
  /* Deep enough orange for white text to read easily (contrast 5:1 or better) */
  background: linear-gradient(135deg, #c2410c, #9a3412); box-shadow: 0 8px 24px rgba(194, 65, 12, .45), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .2s, box-shadow .2s; }
.try-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(194, 65, 12, .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.try-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.try-cta svg { width: 26px; height: 26px; flex: none; }
.try-cta span { display: flex; flex-direction: column; line-height: 1.2; }
.try-cta b { font-size: .98rem; }
.try-cta small { font-size: .74rem; opacity: .9; }
.stage-wrap.full .try-cta { display: none; }
/* Phones: a slim button in its own strip above the car, so neither it nor the build label covers the car */
@media (max-width: 520px) {
  .try-cta small { display: none; }
  .try-cta { top: 10px; padding: 7px 12px 7px 10px; border-radius: 12px; }
  .try-cta svg { width: 22px; height: 22px; }
  .stage-wrap:not(.full):not(.photo-fit) { height: calc(clamp(340px, 56vh, 700px) + var(--dock-h, 0px) + 46px); }
  .stage-wrap:not(.full):not(.photo-fit) .stage3d { top: 46px; }
  .build-tag { top: 8px; left: 12px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .try-cta { transition: none; } }

/* Wheel cards: lift on hover, clear ring when chosen */
.wheel { transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.wheel:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20, 24, 32, .06), 0 12px 28px rgba(20, 24, 32, .1); }
.wheel[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
@media (prefers-reduced-motion: reduce) { .wheel { transition: none; } .wheel:hover { transform: none; } }

/* The chosen car's wheel specs */
.car-spec { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px; margin: 0; }
.spec-grid div { min-width: 0; }
.spec-grid dt { font-size: .76rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.spec-grid dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.spec-note { margin: 10px 0 0; font-size: .9rem; color: var(--warn); }
.nz-rules { margin-top: 10px; font-size: .9rem; }
.nz-rules summary { cursor: pointer; font-weight: 600; }
.nz-rules ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.spec-src { margin: 8px 0 0; font-size: .78rem; color: var(--muted); }

/* Photo tips on the empty "My car photo" screen */
.pe-tips { list-style: none; margin: 2px 0 8px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; max-width: 520px; }
.pe-tips li { font-size: .82rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.pe-tips li::before { content: "✓ "; color: var(--good); font-weight: 700; }

/* "Which car is this?" beside the customer's photo; glows until a car is chosen */
.photo-tools { align-items: center; max-width: 100%; }
.photo-car { flex: 1 1 100%; width: 100%; max-width: min(420px, 100%); margin: 0 auto 2px; }
.photo-car label { white-space: nowrap; }
.photo-car select { flex: 1; min-width: 0; max-width: none; }
.photo-car.ask { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(251, 127, 60, .25); }

/* Before / after line over the customer's photo */
.compare { position: absolute; touch-action: none; }
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.compare-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 12px rgba(0,0,0,.35); pointer-events: none; }
.compare-line .knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #14161a; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; letter-spacing: -1px; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.compare input:focus-visible ~ .compare-line, .compare:focus-within .compare-line .knob { outline: 3px solid var(--accent); outline-offset: 2px; }
.cmp-tag { position: absolute; top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: .78rem; font-weight: 700; pointer-events: none; }
.cmp-tag.left { left: 10px; } .cmp-tag.right { right: 10px; }
.photo-empty .pe-guide { width: min(320px, 82%); height: auto; color: var(--ink); margin-bottom: 4px; }

/* Rim sizes and matching tyres, in the car spec card */
.upgrades { margin-top: 12px; font-size: .9rem; }
.upgrades summary { cursor: pointer; font-weight: 600; }
.upgrades table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.upgrades th { text-align: left; font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.upgrades td { padding: 6px; border-bottom: 1px solid var(--line); }
.upgrades tr.factory td { font-weight: 700; }
.upgrades td.ok { color: var(--good); }
.upgrades td.chk { color: var(--warn); }
.upgrades .muted { margin: 6px 0 0; font-size: .8rem; }
.upgrades tr[data-dia] { cursor: pointer; }
.upgrades tr[data-dia]:hover td { background: var(--surface-2); }
.upgrades tr.on td { background: var(--accent-soft); }
.upgrades tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.upgrades .up-hint { margin: 4px 0 0; font-size: .8rem; }
.upgrades td.cnt { color: var(--muted); white-space: nowrap; }
@media (max-width: 420px) { .upgrades th, .upgrades td { padding: 5px 3px; font-size: .82rem; } .upgrades th:nth-child(3), .upgrades td:nth-child(3) { display: none; } }

/* Shop logo: header and settings */
.brand .shop-logo { height: 32px; width: auto; max-width: 120px; object-fit: contain; }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-row img { height: 48px; width: auto; max-width: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; }

/* Quick wheel picker over the car (all screens). Choosing a wheel never scrolls the
   car away. With a photo it sits just under the photo (moved there by placeDock in app.js). */
.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: block; padding: 6px 0 max(10px, env(safe-area-inset-bottom, 0px)); }
.stage-wrap.full .dock { padding-top: 26px; background: linear-gradient(to top, rgba(10, 11, 14, .88) 30%, rgba(10, 11, 14, 0)); }
.dock[hidden] { display: none !important; }
.hero > .dock { position: static; padding: 2px 0 0; background: none; margin-top: -4px; }
.dock-name { margin: 0 16px 6px; font-size: .84rem; color: #eef0f3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.dock-name span { color: #b9c0ca; }
.dock-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 4px; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
.dock-row::-webkit-scrollbar { display: none; }
.dock-w { flex: none; width: 56px; height: 56px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); cursor: pointer; scroll-snap-align: center; transition: transform .15s ease, border-color .15s; }
.dock-w img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.dock-w[aria-pressed="true"] { border-color: var(--accent); transform: scale(1.1); box-shadow: 0 0 0 3px rgba(251, 127, 60, .35); }
.dock-w:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .dock-w { transition: none; } }

/* Design view switch: lights up blue like the design mesh */
.hero .views .design-btn[aria-pressed="true"] { background: rgba(59, 155, 255, .22); border-color: rgba(95, 180, 255, .75); color: #dcefff; }
.paints.dim { opacity: .4; }
.dock-bar { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; }
.dock-sizes { display: flex; gap: 6px; flex: none; }
.dock-size { min-width: 44px; min-height: 34px; padding: 0 8px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #eef0f3; font: 700 .84rem var(--body); cursor: pointer; }
.dock-size[aria-pressed="true"] { background: #f4f5f7; color: #101216; border-color: #f4f5f7; }
.dock-size.nofit { opacity: .45; text-decoration: line-through; }
.dock-size:focus-visible, .dock-quote:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.dock-price { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-size: .72rem; color: #b9c0ca; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dock-price b { color: #fff; font-size: .95rem; }
.dock-quote { flex: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #c2410c, #9a3412); color: #fff; font: 700 .84rem var(--body); cursor: pointer; }
.dock-quote:disabled { opacity: .45; cursor: not-allowed; }
/* Wide screens: the picker's rows sit centred under the car rather than stretched edge to edge */
@media (min-width: 761px) { .dock-name, .dock-bar, .dock-row { max-width: 760px; margin-left: auto; margin-right: auto; } .dock-row { padding-left: 16px; padding-right: 16px; } .dock-name, .dock-bar { padding: 0 16px; } .dock-w { width: 62px; height: 62px; } }
/* Phones: a narrow screen fits the car's length, not its height, so a shorter stage keeps the car big */
@media (max-width: 760px) { .stage-wrap { height: calc(clamp(260px, 40vh, 440px) + var(--dock-h, 0px)); } }
/* Tyre kinds in the quick picker: one swipeable row of chips */
.dock-tyres { display: flex; align-items: center; gap: 6px; overflow-x: auto; margin: 0 0 8px; padding: 0 16px; scrollbar-width: none; }
.dock-tyres::-webkit-scrollbar { display: none; }
.dock-lbl { flex: none; font-size: .78rem; font-weight: 700; color: #b9c0ca; text-transform: uppercase; letter-spacing: .04em; margin-right: 2px; }
.dock-kind { flex: none; white-space: nowrap; font-weight: 600; }
@media (min-width: 761px) { .dock-tyres { max-width: 760px; margin-left: auto; margin-right: auto; } }
/* Tyre choice in the wheel details */
.tyre-pick { display: grid; gap: 6px; margin: 4px 0 2px; }
.tyre-pick label { font-weight: 700; }
.tyre-pick select { min-height: 44px; }
.tyre-note { margin: 0; font-size: .86rem; }

/* One car button everywhere a car is chosen (it opens the car picker) */
.car-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 .92rem var(--body); cursor: pointer; max-width: 100%; }
.car-btn svg { width: 22px; height: 22px; flex: none; opacity: .85; }
.car-btn .car-btn-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.car-btn .chev { opacity: .6; font-size: .8rem; }
.car-btn:hover { border-color: rgba(255, 255, 255, .45); }
.car-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.car-btn.light { width: 100%; justify-content: flex-start; border-radius: 12px; min-height: 48px; box-shadow: var(--shadow); }
.car-btn.light:hover { border-color: var(--accent); }
.car-btn.light .chev { margin-left: auto; }
.car-pick-lbl { margin: 0 0 6px; font-weight: 700; }
.hero .car-select { padding: 0; background: none; border: 0; }
.photo-car.ask .car-btn { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(251, 127, 60, .3); }

/* The car picker sheet */
.car-dialog { padding: 0; }
.car-dialog > * { margin-left: 20px; margin-right: 20px; }
.cd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 1; margin: 0; padding: 16px 20px 8px; background: var(--surface); }
.cd-head h2 { margin: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.icon-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cd-search { width: calc(100% - 40px); box-sizing: border-box; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 500 1rem var(--body); }
.cd-search:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.cd-sub { margin-top: 16px; margin-bottom: 8px; font-weight: 700; }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cd-card { display: flex; flex-direction: column; gap: 6px; padding: 0 0 10px; border-radius: 14px; border: 2px solid transparent; background: #1b1d22; color: #f4f5f7; font: 700 .9rem var(--body); cursor: pointer; overflow: hidden; text-align: center; }
.cd-card img { width: 100%; height: auto; display: block; aspect-ratio: 440 / 182; }
.cd-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(251, 127, 60, .3); }
.cd-card:hover { border-color: rgba(251, 127, 60, .6); }
.cd-card:focus-visible, .cd-v:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cd-card[hidden], .cd-v[hidden], .cd-make[hidden], .cd-sub[hidden] { display: none; }
.cd-list { display: grid; gap: 12px; padding-bottom: 20px; }
.cd-make h3 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cd-make > div { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-v { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .88rem var(--body); cursor: pointer; }
.cd-v[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cd-3d { font-size: .68rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #fff; margin-left: 2px; }
.cd-empty { padding-bottom: 20px; }
@media (max-width: 560px) { .cd-grid { grid-template-columns: 1fr 1fr; } .cd-card { font-size: .8rem; } .car-dialog { width: 100vw; max-height: 92dvh; border-radius: 18px 18px 0 0; margin-bottom: 0; } }
/* The AI photo button under the customer's photo: the main call to action. Deep charcoal with a
   slow light sweep across it, like a premium product button. */
.ai-cta { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); max-width: 760px; margin: 2px auto 0; padding: 13px 16px 13px 18px; border: 1px solid #2b3038; border-radius: 14px; cursor: pointer; color: #fff; text-align: left; font: inherit;
  background: linear-gradient(180deg, #23272e, #121418); box-shadow: 0 10px 24px rgba(16, 18, 22, .28), inset 0 1px 0 rgba(255, 255, 255, .1); transition: transform .2s, box-shadow .2s; }
.ai-cta::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .14), transparent); transform: skewX(-18deg); animation: ai-sheen 4.5s ease-in-out infinite; }
.ai-cta[hidden] { display: none; }
.ai-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(16, 18, 22, .35), inset 0 1px 0 rgba(255, 255, 255, .12); }
.ai-cta:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.ai-cta svg { width: 26px; height: 26px; flex: none; color: #fb7f3c; }
.ai-cta span { display: flex; flex-direction: column; line-height: 1.25; }
.ai-cta b { font-size: 1rem; letter-spacing: .01em; }
.ai-cta small { font-size: .78rem; color: #aeb5c0; }
.ai-cta .ai-cta-go { margin-left: auto; width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fb7f3c; color: #1a0d04; font-weight: 800; }
@keyframes ai-sheen { 0%, 55% { left: -40%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .ai-cta { transition: none; } .ai-cta::after { animation: none; display: none; } }
/* Undo / redo beside the wheel name, and the before / after slider under the photo */
.dock-head { display: flex; align-items: center; gap: 8px; margin: 0 16px 6px; }
.dock-head .dock-name { flex: 1; min-width: 0; margin: 0; }
.hist { display: flex; gap: 6px; flex: none; }
.hist-btn { width: 40px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #eef0f3; cursor: pointer; }
.hist-btn svg { width: 18px; height: 18px; }
.hist-btn:disabled { opacity: .35; cursor: default; }
.hist-btn:not(:disabled):hover { background: rgba(255, 255, 255, .16); }
.hist-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ba { display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; font-size: .78rem; font-weight: 700; color: #b9c0ca; text-transform: uppercase; letter-spacing: .04em; }
.ba[hidden] { display: none; }
.ba input { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }
@media (min-width: 761px) { .dock-head, .ba { max-width: 760px; margin-left: auto; margin-right: auto; padding: 0 16px; } .dock-head { margin-bottom: 6px; } }

/* Magnifier while a wheel circle is dragged */
.loupe { position: absolute; z-index: 6; width: 150px; height: 150px; border-radius: 50%; overflow: hidden; pointer-events: none; border: 3px solid #fff; box-shadow: 0 8px 24px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.4); }
.loupe[hidden] { display: none; }
.loupe canvas { width: 100%; height: 100%; display: block; }

/* Fine-tune buttons in the wheel-placing panel */
.tune { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; }
.tune-pick { display: flex; gap: 6px; flex-basis: 100%; justify-content: center; }
.tune-w { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 .86rem var(--body); cursor: pointer; }
.tune-w[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tune-pad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 40px); gap: 4px; }
.tune-pad [data-tune="up"] { grid-column: 2; grid-row: 1; }
.tune-pad [data-tune="left"] { grid-column: 1; grid-row: 2; }
.tune-pad [data-tune="down"] { grid-column: 2; grid-row: 2; }
.tune-pad [data-tune="right"] { grid-column: 3; grid-row: 2; }
.tune-size, .tune-hist { display: flex; align-items: center; gap: 6px; }
.tune-size span { font-size: .8rem; font-weight: 700; color: var(--muted); min-width: 38px; text-align: center; }
.tune-btn { width: 44px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: 800 1.05rem var(--body); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tune-btn svg { width: 20px; height: 20px; }
.tune-btn:active { background: var(--accent); color: #fff; }
.tune-btn:disabled { opacity: .35; }
.tune-btn:focus-visible, .tune-w:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Full screen: the panel floats over the bottom of the photo */
.stage-wrap.full > .fix { position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 7; width: min(720px, calc(100% - 20px)); max-height: 55%; overflow: auto; background: rgba(22, 24, 29, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); gap: 8px; padding: 12px; }

/* AI at work: a calm, technical "rebuild" over the photo */
.ai-magic { position: absolute; z-index: 5; overflow: hidden; pointer-events: none; background: linear-gradient(180deg, rgba(8, 12, 20, .35), rgba(8, 12, 20, .55)); }
.ai-magic[hidden] { display: none; }
.ai-edges { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 3px rgba(125, 211, 252, .9)); animation: ai-reveal 3.2s cubic-bezier(.5, 0, .3, 1) infinite; }
.ai-beam { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: #e0f2fe; box-shadow: 0 0 12px 3px rgba(125, 211, 252, .9), 0 0 60px 18px rgba(56, 189, 248, .25); animation: ai-beam 3.2s cubic-bezier(.5, 0, .3, 1) infinite; }
.ai-lock { position: absolute; transform: translate(-50%, -50%) scale(1.25); opacity: 0; animation: ai-lock .7s cubic-bezier(.2, .8, .2, 1) forwards; }
.ai-ring { position: absolute; inset: 0; border-radius: 50%; }
.ai-ring.a { border: 2px dashed rgba(186, 230, 253, .95); animation: ai-spin 6s linear infinite; }
.ai-ring.b { inset: 12%; border: 1.5px solid rgba(251, 127, 60, .9); border-left-color: transparent; border-right-color: transparent; animation: ai-spin 2.4s linear infinite reverse; }
.ai-ticks { position: absolute; inset: -8%; background:
  linear-gradient(#e0f2fe, #e0f2fe) top center / 2px 10% no-repeat, linear-gradient(#e0f2fe, #e0f2fe) bottom center / 2px 10% no-repeat,
  linear-gradient(#e0f2fe, #e0f2fe) center left / 10% 2px no-repeat, linear-gradient(#e0f2fe, #e0f2fe) center right / 10% 2px no-repeat; }
.ai-new { position: absolute; inset: 14%; width: 72%; height: 72%; border-radius: 50%; opacity: 0; mix-blend-mode: screen; animation: ai-new 2.4s ease-in-out infinite; }
.ai-tag { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font: 700 10px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .14em; color: #e0f2fe; background: rgba(8, 12, 20, .7); padding: 4px 7px; border-radius: 4px; white-space: nowrap; }
.ai-panel { position: absolute; left: 12px; bottom: 12px; width: min(260px, calc(100% - 24px)); padding: 12px 14px 12px; border-radius: 12px; background: rgba(10, 14, 22, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(186, 230, 253, .18); color: #e5edf5; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.ai-title { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font: 700 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .16em; text-transform: uppercase; color: #bae6fd; }
.ai-pulse { width: 8px; height: 8px; border-radius: 50%; background: #38bdf8; box-shadow: 0 0 0 0 rgba(56, 189, 248, .7); animation: ai-pulse 1.4s ease-out infinite; }
.ai-steps { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 5px; font-size: .8rem; }
.ai-steps li { display: flex; align-items: center; gap: 8px; color: rgba(229, 237, 245, .4); transition: color .3s; }
.ai-steps li::before { content: ""; width: 12px; height: 12px; flex: none; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
.ai-steps li.on { color: #fff; font-weight: 700; }
.ai-steps li.on::before { border-color: #38bdf8; border-top-color: transparent; animation: ai-spin .8s linear infinite; }
.ai-steps li.done { color: rgba(229, 237, 245, .75); }
.ai-steps li.done::before { background: #38bdf8; border-color: #38bdf8; box-shadow: inset 0 0 0 2px rgba(10, 14, 22, .9); }
.ai-bar { height: 3px; border-radius: 3px; background: rgba(186, 230, 253, .15); overflow: hidden; }
.ai-bar span { display: block; width: 35%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, transparent, #38bdf8, #fb7f3c); animation: ai-bar 1.6s ease-in-out infinite; }
@keyframes ai-reveal { 0% { clip-path: inset(0 100% 0 0); opacity: 1; } 55% { clip-path: inset(0 0 0 0); opacity: 1; } 100% { clip-path: inset(0 0 0 0); opacity: .15; } }
@keyframes ai-beam { 0% { transform: translateX(0); opacity: 1; } 55% { transform: translateX(var(--bw, 100vw)); opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes ai-lock { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes ai-new { 0%, 100% { opacity: .15; transform: rotate(0deg) scale(.96); } 50% { opacity: .85; transform: rotate(40deg) scale(1); } }
@keyframes ai-pulse { to { box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); } }
@keyframes ai-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .ai-edges, .ai-beam, .ai-ring, .ai-new, .ai-pulse, .ai-bar span, .ai-steps li.on::before { animation: none; } .ai-lock { animation: none; opacity: 1; transform: translate(-50%, -50%); } .ai-new { opacity: .6; } }
.hero .stage-wrap.full { background: #0f1114; }

/* ---------- Phones: a calm, uncluttered layout ----------
   One full-width switch (3D / photo), the car with two small icon buttons beside it, the colours,
   then the camera angles as one slim segmented row. Duplicates of the quick picker are hidden:
   the big wheel cards, the size and tyre choosers in the details, Compare (the slider does it)
   and "See it in 3D" (the switch does it). */
@media (max-width: 760px) {
  .controls { gap: 10px 8px; }
  .controls > .mode { order: 1; width: 100%; }
  .controls > .mode .mode-btn { flex: 1; }
  .controls > #car-select { order: 2; flex: 1 1 0; min-width: 0; }
  .controls > #car-select .car-btn { width: 100%; justify-content: flex-start; }
  .controls > #car-select .chev { margin-left: auto; }
  /* Photo tools join the main row: the car on its own line, then the tools and the two icons */
  .controls > #photo-tools:not([hidden]) { display: contents; }
  #photo-tools > #photo-car-wrap { order: 2; flex: 1 1 calc(100% - 112px); min-width: 0; }
  #photo-tools > #photo-car-wrap .car-btn { width: 100%; justify-content: flex-start; }
  #photo-tools > #photo-car-wrap .chev { margin-left: auto; }
  #photo-tools > .chip, #photo-tools > label.chip { order: 5; }
  .controls > #save-btn { order: 3; }
  .controls > #full-btn { order: 4; }
  .controls > #save-btn, .controls > #full-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
  .controls > #save-btn .lbl, .controls > #full-btn .lbl, .design-btn .lbl { display: none; }
  .controls > #paints { order: 5; flex-basis: 100%; justify-content: flex-start; scrollbar-width: none; }
  .controls > #paints::-webkit-scrollbar { display: none; }
  .controls > #views { order: 6; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
  .controls > #views .chip { border: 0; background: none; min-height: 36px; padding: 6px 13px; }
  .controls > #views .design-btn { width: 36px; padding: 0; }
  .hero .views .chip[aria-pressed="true"], .hero .views .chip.on { background: rgba(255, 255, 255, .16); }
  #before-btn, #to3d-btn { display: none; }
  .shop > .strip { display: none; }
  .picked .sizes-pick, .picked .tyre-pick { display: none; }
}

/* ---------- White studio: the car and its controls on a bright, light-grey stage ----------
   (overrides the earlier dark panel; the page's own light/dark theme is unchanged) */
.hero {
  --surface: #ffffff; --surface-2: #eef0f3; --line: #dfe3e8; --ink: #14171c; --muted: #5f6772; --bg: #f4f5f7;
  --glass: rgba(255, 255, 255, .86); --stage-top: #ffffff; --stage-bottom: #e7eaee;
  --accent: #c2410c; --accent-soft: rgba(194, 65, 12, .2); --accent-ink: #ffffff;
  background: radial-gradient(120% 70% at 50% 20%, #ffffff 0%, #f3f5f7 55%, #e9ecf0 100%);
  color: var(--ink); color-scheme: light; box-shadow: 0 1px 0 #e2e5ea, 0 12px 30px rgba(20, 24, 32, .06);
}
.hero .chip:hover { border-color: #b9c0c9; background: #f6f7f9; }
.hero .chip.strong { background: #14171c; color: #fff; border-color: #14171c; }
.hero .views .chip[aria-pressed="true"], .hero .views .chip.on { background: #e8ebef; border-color: #c9cfd7; }
.hero .loading { color: var(--muted); }
.hero .fix { background: #fff; }
.hero .stage { background: #e9ecf0; }
.hero .stage-wrap.full { background: #f2f4f6; }
.hero .spinner { border-color: rgba(20, 23, 28, .15); border-top-color: var(--accent); }
.build-tag { color: #14171c; background: rgba(255, 255, 255, .88); border: 1px solid #dfe3e8; }
.hero .swatch { box-shadow: 0 0 0 1px #cfd4db; }
.car-btn:hover { border-color: #b9c0c9; }
.dock-name { color: #14171c; text-shadow: none; }
.dock-name span { color: #5f6772; }
.dock-w { border-color: #dfe3e8; background: #f3f4f6; }
.dock-size { border-color: #d3d8de; background: #fff; color: #14171c; }
.dock-size[aria-pressed="true"] { background: #14171c; color: #fff; border-color: #14171c; }
.dock-price { color: #5f6772; }
.dock-price b { color: #14171c; }
.dock-lbl { color: #5f6772; }
.stage-wrap.full .dock { background: linear-gradient(to top, rgba(246, 247, 249, .96) 35%, rgba(246, 247, 249, 0)); }
.hist-btn { border-color: #d3d8de; background: #fff; color: #14171c; }
.hist-btn:not(:disabled):hover { background: #f1f3f6; }
.ba { color: #5f6772; }
.stage-wrap.full > .fix { background: rgba(255, 255, 255, .95); }
.hero .views .design-btn[aria-pressed="true"] { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
@media (max-width: 760px) { .hero .views .chip[aria-pressed="true"], .hero .views .chip.on { background: #e8ebef; } }
/* Small photos (phones): the AI panel shrinks to one slim line with the current step */
@media (max-width: 760px) {
  .ai-panel { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; }
  .ai-title { margin: 0; font-size: 10px; }
  .ai-steps { margin: 0; }
  .ai-steps li:not(.on) { display: none; }
  .ai-bar { grid-column: 1 / -1; }
  .ai-tag { font-size: 9px; top: -18px; }
}
