/* Full-viewport stage. Only the legend, tool rail and lower menus capture input. */
#view-garage:not([hidden]) { position:fixed; inset:0; height:100dvh; }
.showroom { --pad:clamp(14px,2.4vw,48px); position:relative; isolation:isolate; height:100%; overflow:hidden; background:#283033; color:var(--hud-text); }
.showroom .stage__canvas { position:absolute; inset:0; width:100%; height:100%; }
.showroom::before { content:""; position:absolute; z-index:1; inset:0; pointer-events:none; background:
  linear-gradient(180deg,#09090dcc,transparent 23%,transparent 56%,#09090cf0),
  linear-gradient(115deg,#19191d70,transparent 35%); }
.showroom :is(.topbar,.guide-heading,.option-dock,.hud-footer,.showroom-tools) { position:absolute; z-index:2; }
.showroom .guide-heading { left:var(--pad); top:var(--pad); max-width:50%; text-shadow:0 2px 6px #10181c; }
.showroom .garage__class,.vehicle-id small { color:#d9d9db; font:700 .73rem var(--f-text); text-transform:uppercase; letter-spacing:.14em; }
.guide-heading h1,.vehicle-id strong,.option-name,.paint-picker > small { font-family:var(--f-display); font-stretch:75%; font-weight:800; letter-spacing:-.03em; line-height:1.04; }
.showroom .guide-heading h1 { margin:4px 0 10px; text-transform:uppercase; font-size:clamp(28px,3.8vw,60px); }
.browse-trigger { display:inline-flex; align-items:center; gap:7px; background:#151518d9; color:white; padding:6px 10px; min-height:36px; border:0; border-left:2px solid white; }
.browse-trigger svg { width:16px; }
.part-browser { position:fixed; inset:auto; margin:0; width:min(340px,94vw); max-height:58dvh; overflow:auto; background:#18181bf7; color:white; border:1px solid #ffffff36; padding:10px 14px; box-shadow:var(--shadow-panel); }
.part-browser h2 { padding:10px 0 4px; color:#bdbdc4; font-size:.8rem; letter-spacing:.09em; text-transform:uppercase; }
.part-browser button { display:flex; justify-content:space-between; align-items:center; width:100%; min-height:40px; padding:6px; border:0; border-bottom:1px solid #ffffff24; background:transparent; color:white; text-align:left; }
.part-browser button[aria-current] { border-left:3px solid white; background:#323236; }
.part-browser button:is(:hover,:focus-visible) { background:white; color:#161616; }
.showroom .topbar { right:var(--pad); top:var(--pad); min-height:0; width:auto; padding:0; border:0; background:none; }
.showroom .topbar .brand { display:none; }
.showroom .topbar nav,.showroom-tools { display:flex; background:var(--hud); border:1px solid var(--hud-line); border-radius:var(--r-control); padding:2px; gap:0; }
.showroom .topbar .btn { background:none; color:var(--hud-text); border:0; font-size:.81rem; }
.camera-tool option { background:#19191b; color:white; }
.showroom .topbar nav .btn[aria-current="page"] { color:#171719; background:var(--selected); }
.showroom-tools { right:var(--pad); top:calc(var(--pad) + 56px); }
.showroom-tools .stagetools__text { display:none; }
.showroom-tools .stagetools__btn,.camera-tool,.info-drawer header button { position:relative; display:grid; place-items:center; flex:none; width:var(--control-h); height:var(--control-h); padding:0; border:0; border-radius:4px; background:none; color:var(--hud-text); box-shadow:none; }
.camera-tool svg,.info-drawer svg { width:20px; }
.camera-tool select { position:absolute; inset:0; width:100%; opacity:0; cursor:pointer; }
.camera-tool:focus-within { outline:2px solid var(--selected); outline-offset:-2px; }
.showroom-tools :is(button,label):hover,.showroom-tools button[aria-expanded=true] { background:#45454b; color:var(--selected); }
.showroom-tools button:disabled { opacity:.45; }
.showroom.hud-hidden > :not(.stage__canvas):not(.showroom-tools),.hud-hidden .showroom-tools > :not(.hud-toggle),.hud-hidden::before { display:none !important; }
.hud-hidden .showroom-tools { top:var(--pad); }

.option-dock { left:var(--pad); bottom:calc(var(--pad) + 64px); width:min(660px,55vw); max-height:46%; overflow:auto; scrollbar-width:none; }
.option-dock .preview { margin:0; padding:0; border:0; background:none; }
.preview > :is(h2,.muted), .advanced-info:empty { display:none; }
.category-strip,.stepper,.carousel-track { display:flex; overflow-x:auto; min-width:0; scrollbar-width:none; overscroll-behavior-x:contain; }
.category-strip,.stepper,.paint-families { gap:2px; }
.hud-chip,.stepper__link { flex:none; display:inline-flex; align-items:center; gap:4px; min-height:var(--control-h); padding:0 13px; border:0; border-bottom:2px solid transparent; background:var(--hud); color:var(--hud-muted); text-decoration:none; text-transform:uppercase; font:700 .94rem var(--f-display); font-stretch:89%; transition:background var(--dur),color var(--dur); }
.hud-chip[aria-pressed=true],.stepper__link[aria-current] { background:#f3f2ef; border-color:var(--selected); color:#171719; }
.hud-chip:hover:not([aria-pressed=true]),.stepper__link:hover:not([aria-current]),.rail-arrow:hover { background:#444449; color:white; }
.stepper__num { display:none; }
.hud-footer { bottom:var(--pad); left:var(--pad); right:var(--pad); display:flex; justify-content:space-between; align-items:end; gap:16px; pointer-events:none; }
.hud-footer > * { pointer-events:auto; }
.stepper { max-width:59%; border-top:1px solid var(--hud-line); }
.bar { display:flex; align-items:stretch; justify-content:end; gap:4px; flex-wrap:wrap; }
.vehicle-id { position:absolute; right:0; bottom:calc(100% + 10px); display:grid; gap:4px; max-width:35vw; text-align:right; padding:10px 16px; border-right:3px solid var(--selected); background:linear-gradient(90deg,transparent,#141418ed 35%); }
.vehicle-id strong { font-size:clamp(22px,2.5vw,36px); text-transform:uppercase; }
.bar__sum,.bar .btn { display:grid; align-content:center; min-height:var(--control-h); border:1px solid var(--hud-line); background:var(--hud); color:white; padding:4px 12px; border-radius:3px; font-size:.85rem; text-decoration:none; }
.bar .btn--primary { background:var(--selected); color:#171719; }
.bar__sum .gpanel__total { font-size:.75rem; color:var(--hud-muted); }
.bar__label { font-weight:700; }

.carousel { display:grid; grid-template-columns:26px minmax(0,1fr) 26px; align-items:stretch; gap:4px; }
.carousel-track { gap:3px; }
.rail-arrow { min-height:var(--control-h); padding:0; border:0; background:#ffffff12; color:white; font-size:22px; }
.fit-control,.showroom .paint-controls,.showroom .checkout,.showroom .panel__cats { margin:0; min-width:0; padding:10px 0 4px; background:linear-gradient(90deg,#111115d9,#151517a8 75%,transparent); color:white; border:0; }
.fit-control { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px; }
.option-name,.paint-picker > small { font-size:clamp(17px,1.8vw,27px); overflow-wrap:anywhere; }
.showroom .checkout .muted,.checkout small { color:var(--hud-muted); }
.option-price { font-size:.75rem; color:var(--hud-muted); }
.fit-control .carousel { grid-column:1/-1; width:fit-content; max-width:100%; }
.fit-tile { flex:0 0 clamp(114px,10vw,155px); height:76px; padding:8px 10px; display:grid; align-content:space-between; text-align:left; overflow-wrap:anywhere; border:1px solid var(--hud-line); border-radius:1px; background:#333338; color:white; font:700 .84rem/1.2 var(--f-text); transition:background var(--dur); }
.fit-tile > span,.fit-tile small { overflow:auto; scrollbar-width:none; }
.fit-tile small { font-size:.72rem; color:var(--hud-muted); }
.fit-tile:hover:not(:disabled),.fit-tile:focus-visible { background:#505056; }
.fit-tile[data-state=applied] { background:#f3f2ef; color:#18181a; border-color:var(--selected); }
.fit-tile[data-state=applied]:is(:focus-visible,:hover) { background:#dddddd; color:#18181a; }

.fit-tile[data-state=applied] small { color:#38383e; }
.fit-tile:is([data-state=checking],[data-state=queued],[data-state=generating],[data-state=loading]) { border-color:var(--amber); }
.fit-tile:is([data-state=checking],[data-state=queued],[data-state=generating],[data-state=loading]) small { color:var(--amber); }
.fit-tile[data-state=failed] { border-color:#ffa896; }
.fit-tile[data-state=incompatible] { background:#29292e; color:#b9b9be; border-style:dashed; }
.fit-control .fit-state { display:block; min-height:1em; font-size:.78rem; color:var(--hud-muted); }
.fit-control .fit-state[data-state=failed] { color:#ffc1ae; }
.fit-tile:is([data-state=checking],[data-state=queued],[data-state=generating],[data-state=loading]) small::before { content:""; display:inline-block; width:.75em; height:.75em; margin-right:4px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:fit-spin 1s linear infinite; }
@media (prefers-reduced-motion:reduce) { .fit-tile small::before { animation:none !important; } }
.fit-control .btn { min-height:26px; padding:2px 5px; font-size:.76rem; color:white; }
.showroom .paint-controls legend { display:none; }
.colour-caption { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
.paint-picker .hud-chip { font-size:.86rem; min-height:36px; text-transform:uppercase; }
.paint-picker { display:grid; gap:8px; }
.showroom .paint-swatches { display:flex; margin:0; max-height:none; gap:5px; }
.showroom .paint-swatches button { flex:0 0 clamp(66px,6vw,102px); height:clamp(60px,5.6vw,96px); border-radius:1px; }
.showroom .paint-swatches button[aria-pressed=true]::after { content:"✓"; display:grid; place-items:center; width:20px; height:20px; background:white; color:#111; font-weight:bold; }
.paint-settings { max-height:22vh; overflow:auto; margin-top:6px; }
.paint-settings[open] { background:var(--card); padding:8px; color:var(--ink); }
.showroom summary { list-style:none; cursor:pointer; padding:6px 0; }
.showroom summary::-webkit-details-marker { display:none; }
.showroom summary::before { content:"+"; display:inline-block; width:1.2em; font-weight:bold; }
.showroom details[open] > summary::before { content:"−"; }
.showroom :focus-visible { outline:2px solid #ffc96a; outline-offset:-2px; }
.receipt,.info-drawer { position:absolute; z-index:8; top:calc(var(--pad) + 110px); right:var(--pad); display:grid; align-content:start; gap:12px; width:min(360px,92vw); max-height:calc(100% - var(--pad) * 2 - 180px); overflow:auto; padding:16px; border:1px solid var(--rule-2); border-top:3px solid var(--go); border-radius:var(--r-control); background:var(--card); color:var(--ink); box-shadow:var(--shadow-panel); }
.receipt header,.info-drawer header { display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--rule); }
.info-drawer header button { color:var(--ink); }
.receipt h2,.info-drawer h2 { font-size:1.22rem; }
.info-drawer .garage__equipment,.info-drawer .potential { margin:0; padding:0; border:0; }
.info-drawer .potential p { font-size:.8rem; color:var(--ink-2); }
@media (max-width:980px) {
  .hud-footer { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; }
  .stepper { max-width:100%; }
  .bar { flex-wrap:nowrap; align-items:center; }
  .vehicle-id { position:static; margin-right:auto; text-align:left; border:none; padding:0; background:none; max-width:32%; }
  .vehicle-id strong { font-size:18px; }
  .option-dock { width:min(640px,85vw); bottom:calc(var(--pad) + 108px); }
}
@media (max-width:600px) {
  .showroom { --pad:max(10px,env(safe-area-inset-left)); }
  .showroom .guide-heading { max-width:48%; }
  .showroom .guide-heading h1 { font-size:27px; }
  .showroom .topbar .btn { padding-inline:6px; }
  .showroom-tools { display:grid; grid-template-columns:repeat(3,44px); }
  .option-dock { width:auto; right:var(--pad); max-height:36dvh; bottom:calc(108px + env(safe-area-inset-bottom)); }
  .hud-footer { bottom:max(6px,env(safe-area-inset-bottom)); }
  .hud-chip,.stepper__link { padding:0 10px; }
  .bar__sum .gpanel__total { display:none; }
  .vehicle-id strong { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .fit-tile { height:80px; }
  .info-drawer,.receipt { width:auto; left:var(--pad); top:calc(var(--pad) + 154px); }
}
@media (max-height:520px) and (orientation:landscape) {
  .showroom { --pad:8px; }
  .showroom .guide-heading h1 { font-size:24px; margin:0; }
  .option-dock { width:43%; bottom:58px; max-height:55dvh; }
  .showroom .paint-swatches button { height:44px; flex-basis:50px; }
  .fit-tile { height:74px; }
  .hud-footer { display:flex; }
  .stepper { max-width:62%; }
  .vehicle-id { display:none; }
  .receipt,.info-drawer { max-height:66%; top:66px; }
}
.recorded-list,.visual-summary { background:var(--hud); color:var(--hud-text); padding:12px; }
.build-row {display:flex;align-items:center;justify-content:space-between;gap:8px;}
.build-row button {flex:none;background:#efefed;color:#19191c;}
.paint-controls > .preview__field {display:flex;align-items:center;gap:12px;}
.paint-controls > .preview__field select {width:auto;}
.fit-control .fit-tile { flex-basis:clamp(124px,12vw,180px); }
.fit-image {display:block;width:100%;height:clamp(54px,7vh,86px);object-fit:contain;background:#50565c;order:-1;}
.fit-image[hidden] {display:none;}
.fit-tile:has(.fit-image:not([hidden])) {display:flex;flex-direction:column;align-items:stretch;justify-content:space-between;height:auto;min-height:110px;gap:4px;padding:4px 6px;}
.fit-tile:has(.fit-image:not([hidden])) > span {line-height:1.15;}
.fit-tile:has(.fit-image:not([hidden])) small {min-height:1em;}
