/* =========================================================
   HOW IT WORKS — LIVE INTERACTIVE STUDIO SHOWCASE
   ========================================================= */
.how-section {
  padding-block: clamp(56px, 6.8vw, 96px);
  scroll-margin-top: 84px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}
.section-heading > div {
  flex: 1 1 0;
  min-width: 0;
}
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.25rem, 4.1vw, 4rem);
  font-weight: 720;
  letter-spacing: -.035em;
  line-height: 1.03;
  text-wrap: wrap;
}
.section-lead-wrap,
.section-heading > .section-lead {
  flex: 0 1 42ch;
}
.section-lead-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  max-width: 42ch;
}
.section-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.54;
  text-align: right;
  text-wrap: balance;
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--rp-surface);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 600;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.motion-toggle:hover:not(:disabled) {
  border-color: var(--rp-control-line);
  background: var(--rp-raised);
}
.motion-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse-dot 2s ease-in-out infinite;
}
[data-demos-paused] .motion-dot {
  background: var(--muted);
  animation: none;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}

/* Quick anchor bar */
.step-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0 0 clamp(34px, 4vw, 56px);
  padding: 0;
}
.step-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-subtle);
  border-radius: 4px;
  background: var(--rp-surface);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 620;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease;
}
.step-nav a span {
  font-family: var(--rp-title);
  color: var(--rp-primary);
  font-weight: 760;
  letter-spacing: .04em;
}
.step-nav a:hover {
  border-color: var(--rp-control-line);
  background: var(--rp-raised);
}

/* Mode rows */
.how-row {
  display: grid;
  grid-template-columns: minmax(0, .76fr) minmax(0, 1.24fr);
  gap: clamp(26px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(32px, 4.4vw, 56px);
  border-top: 1px solid var(--line-subtle);
  scroll-margin-top: 86px;
}

.step-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 680;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.step-kicker span {
  display: inline-grid;
  place-items: center;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--rp-selected);
  border: 1px solid rgba(188, 51, 33, .5);
  color: #ffb8ab;
  font-family: var(--rp-title);
  letter-spacing: .05em;
}

.how-copy h3, .export-copy h3 {
  margin: 0;
  font-size: clamp(1.85rem, 2.8vw, 2.85rem);
  font-weight: 730;
  line-height: 1.05;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.how-copy > p:not(.step-kicker), .export-copy > p:not(.step-kicker) {
  margin: 14px 0 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.58;
}

.how-points {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.how-points li {
  position: relative;
  padding-inline-start: 18px;
  color: #e1dfda;
  font-size: .9rem;
  line-height: 1.45;
}
.how-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .56em;
  width: 8px;
  height: 2px;
  background: var(--rp-primary);
  transform: skewX(-24deg);
}

.demo-controls {
  margin-top: 18px;
}
.controls-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.pill-btn {
  min-height: 40px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--rp-surface);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.pill-btn:hover { color: var(--ink); border-color: var(--rp-control-line); background: var(--rp-raised); }
.pill-btn[aria-pressed="true"] {
  border-color: var(--rp-primary);
  background: var(--rp-selected);
  color: var(--ink);
}

/* Shared Studio Frame Chrome */
.studio-frame {
  position: relative;
  border: 1px solid #353532;
  border-radius: 6px;
  overflow: hidden;
  background: #161615;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .42);
}
.studio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 14px;
  border-bottom: 1px solid #2b2b28;
  background: #1b1b19;
  font-size: .78rem;
}
.studio-dots {
  display: flex;
  gap: 6px;
  flex: none;
}
.studio-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3d3d39;
}
.studio-title {
  color: #cfcdc6;
  font-weight: 600;
  margin-inline-end: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #383834;
  background: #232321;
  color: #e4e2dc;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
}

.stage-progress {
  height: 2px;
  background: #242421;
  overflow: hidden;
}
.stage-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--rp-primary);
  transform-origin: left center;
  transform: scaleX(0);
}

/* =========================================================
   01 · AI PAINT MULTI-ANGLE VERIFICATION STAGE
   ========================================================= */
.ai-viewport {
  position: relative;
  aspect-ratio: 2.86 / 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0;
}
.ai-car-stack {
  position: relative;
  width: 100%;
  height: 100%;
}
.ai-car-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  opacity: 0;
  transition: opacity .22s ease;
}
.stage-ai[data-cam="side"] .ai-car-base { opacity: 1; }

.ai-cam-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.ai-side-img {
  object-fit: cover;
  object-position: center 52%;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.05s cubic-bezier(.32, 0, .18, 1), opacity .22s ease;
}
.ai-angle-img {
  object-fit: contain;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 8%, #000 90%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 8%, #000 90%, transparent 100%);
  mask-composite: intersect;
}
.stage-ai:not([data-cam="side"]) .ai-viewport {
  background: linear-gradient(180deg, #eff1f5 0%, #f8fafd 44%, #eef0f7 80%, #e4e5ec 100%);
}

/* Show active preset + camera image */
.stage-ai[data-preset="0"][data-cam="side"] [data-ai-img="0:side"],
.stage-ai[data-preset="0"][data-cam="front"] [data-ai-img="0:front"],
.stage-ai[data-preset="0"][data-cam="top"] [data-ai-img="0:top"],
.stage-ai[data-preset="0"][data-cam="rear"] [data-ai-img="0:rear"],
.stage-ai[data-preset="1"][data-cam="side"] [data-ai-img="1:side"],
.stage-ai[data-preset="1"][data-cam="front"] [data-ai-img="1:front"],
.stage-ai[data-preset="1"][data-cam="top"] [data-ai-img="1:top"],
.stage-ai[data-preset="1"][data-cam="rear"] [data-ai-img="1:rear"],
.stage-ai[data-preset="2"][data-cam="side"] [data-ai-img="2:side"],
.stage-ai[data-preset="2"][data-cam="front"] [data-ai-img="2:front"],
.stage-ai[data-preset="2"][data-cam="top"] [data-ai-img="2:top"],
.stage-ai[data-preset="2"][data-cam="rear"] [data-ai-img="2:rear"] {
  opacity: 1;
}

.stage-ai[data-phase="typing"] .ai-side-img {
  clip-path: inset(0 100% 0 0);
  transition: opacity .22s ease;
}
.stage-ai[data-phase="painting"] .ai-side-img,
.stage-ai[data-phase="verifying"] .ai-side-img,
.stage-ai[data-phase="ready"] .ai-side-img {
  clip-path: inset(0 0% 0 0);
}

/* Sweeping crimson scan beam during painting */
.ai-scan-beam {
  position: absolute;
  inset-block: 0;
  left: -4%;
  width: 44px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(188, 51, 33, .45) 68%, #ff6c54 96%, #fff 100%);
  box-shadow: 4px 0 22px rgba(188, 51, 33, .55);
}
.stage-ai[data-phase="painting"] .ai-scan-beam {
  animation: ai-sweep 1.05s cubic-bezier(.32, 0, .18, 1) forwards;
}
@keyframes ai-sweep {
  0% { left: -4%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.ai-layer-chips {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .3s ease, transform .3s ease;
}
.stage-ai[data-phase="verifying"] .ai-layer-chips,
.stage-ai[data-phase="ready"] .ai-layer-chips {
  opacity: 1;
  transform: none;
}
.ai-layer-chips span {
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(17, 17, 16, .88);
  color: #f4f2ec;
  font-size: .72rem;
  font-weight: 640;
  backdrop-filter: blur(6px);
}
.ai-layer-chips .chip-verify {
  color: var(--ok);
  border: 1px solid rgba(141, 212, 178, .35);
}
.ai-layer-chips .chip-accent {
  background: rgba(188, 51, 33, .94);
  color: #fff;
}

.ai-prompt-dock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid #2b2b28;
  background: #141413;
}
.prompt-tag {
  flex: none;
  padding: 4px 8px;
  border-radius: 2px;
  background: #252522;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 680;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.prompt-readout {
  margin: 0;
  flex: 1;
  min-width: 0;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-size: .86rem;
  line-height: 1.38;
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-inline-start: 2px;
  background: var(--rp-primary);
  vertical-align: text-bottom;
  animation: blink-caret .85s steps(1) infinite;
}
.stage-ai[data-phase="ready"] .caret,
[data-demos-paused] .caret {
  opacity: 0;
  animation: none;
}
@keyframes blink-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.prompt-action {
  flex: none;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(188, 51, 33, .55);
  border-radius: 3px;
  background: var(--rp-selected);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 660;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .15s ease;
}
.prompt-action:hover {
  background: var(--rp-primary);
  border-color: var(--rp-primary);
  color: #fff;
}
.stage-ai[data-phase="painting"] .prompt-action,
.stage-ai[data-phase="verifying"] .prompt-action {
  background: var(--rp-primary);
  border-color: var(--rp-primary);
  color: #fff;
}
.stage-ai[data-phase="ready"] .studio-badge {
  border-color: rgba(141, 212, 178, .4);
  background: var(--ok-bg);
  color: var(--ok);
}
.stage-ai[data-phase="painting"] .stage-progress-fill {
  transform: scaleX(.72);
  transition: transform 1.05s linear;
}
.stage-ai[data-phase="verifying"] .stage-progress-fill,
.stage-ai[data-phase="ready"] .stage-progress-fill {
  transform: scaleX(1);
  transition: transform .45s ease;
}

/* =========================================================
   02 · QUICK BUILD HANDS-ON CUSTOMISER
   ========================================================= */
.qb-viewport {
  position: relative;
  aspect-ratio: 1200 / 404;
  overflow: hidden;
  padding: 0;
  user-select: none;
}
.qb-car-stack {
  position: relative;
  width: 100%;
  height: 100%;
}
.qb-car-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 50%;
  opacity: 0;
  pointer-events: none;
}

/* Mode 1: Patterns & Colours (single crisp authentic buildQuickLivery image) */
.qb-pat-img {
  z-index: 2;
  transition: opacity .22s ease;
}
.stage-quick[data-mode="patterns"] .qb-pat-img {
  opacity: 1;
}

/* Mode 2: Artwork Basepaint extracted-palette livery underneath full artwork */
.qb-art-base { transition: opacity .22s ease; z-index: 1; }
.qb-art-top { transition: opacity .12s linear; z-index: 2; }
.stage-quick[data-mode="artwork"] .qb-art-base { opacity: 1; }

/* Pure CSP-safe opacity ramp driven by data-photo-opacity (0..100 step 5) */
.stage-quick[data-mode="artwork"][data-photo-opacity="5"] .qb-art-top { opacity: .05; }
.stage-quick[data-mode="artwork"][data-photo-opacity="10"] .qb-art-top { opacity: .1; }
.stage-quick[data-mode="artwork"][data-photo-opacity="15"] .qb-art-top { opacity: .15; }
.stage-quick[data-mode="artwork"][data-photo-opacity="20"] .qb-art-top { opacity: .2; }
.stage-quick[data-mode="artwork"][data-photo-opacity="25"] .qb-art-top { opacity: .25; }
.stage-quick[data-mode="artwork"][data-photo-opacity="30"] .qb-art-top { opacity: .3; }
.stage-quick[data-mode="artwork"][data-photo-opacity="35"] .qb-art-top { opacity: .35; }
.stage-quick[data-mode="artwork"][data-photo-opacity="40"] .qb-art-top { opacity: .4; }
.stage-quick[data-mode="artwork"][data-photo-opacity="45"] .qb-art-top { opacity: .45; }
.stage-quick[data-mode="artwork"][data-photo-opacity="50"] .qb-art-top { opacity: .5; }
.stage-quick[data-mode="artwork"][data-photo-opacity="55"] .qb-art-top { opacity: .55; }
.stage-quick[data-mode="artwork"][data-photo-opacity="60"] .qb-art-top { opacity: .6; }
.stage-quick[data-mode="artwork"][data-photo-opacity="65"] .qb-art-top { opacity: .65; }
.stage-quick[data-mode="artwork"][data-photo-opacity="70"] .qb-art-top { opacity: .7; }
.stage-quick[data-mode="artwork"][data-photo-opacity="75"] .qb-art-top { opacity: .75; }
.stage-quick[data-mode="artwork"][data-photo-opacity="80"] .qb-art-top { opacity: .8; }
.stage-quick[data-mode="artwork"][data-photo-opacity="85"] .qb-art-top { opacity: .85; }
.stage-quick[data-mode="artwork"][data-photo-opacity="90"] .qb-art-top { opacity: .9; }
.stage-quick[data-mode="artwork"][data-photo-opacity="95"] .qb-art-top { opacity: .95; }
.stage-quick[data-mode="artwork"][data-photo-opacity="100"] .qb-art-top { opacity: 1; }

/* Quick Build interactive dock */
.qb-dock {
  padding: 12px 14px;
  border-top: 1px solid #2b2b28;
  background: #141413;
}
.qb-dock-panel {
  display: grid;
  gap: 10px;
}
.qb-panel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}
.qb-dock-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.qb-chip, .qb-action-btn, .qb-art-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 11px;
  border: 1px solid #343430;
  border-radius: 3px;
  background: #1d1d1b;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.qb-chip:hover, .qb-action-btn:hover, .qb-art-btn:hover {
  color: var(--ink);
  border-color: var(--rp-control-line);
}
.qb-chip[aria-pressed="true"], .qb-art-btn[aria-pressed="true"] {
  border-color: var(--rp-primary);
  background: var(--rp-selected);
  color: #fff;
}
.qb-action-btn {
  border-style: dashed;
  border-color: rgba(188, 51, 33, .6);
  background: rgba(188, 51, 33, .1);
  color: #f4ebe8;
}
.qb-action-btn:hover {
  border-style: solid;
  border-color: var(--rp-primary);
  background: var(--rp-primary);
  color: #fff;
}

.qb-art-btn {
  padding: 4px 10px 4px 5px;
  gap: 8px;
}
.qb-art-thumb {
  display: block;
  width: 44px;
  height: 26px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, .16);
  flex: none;
}

.pal-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
}
.pal-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
}
.pal-crimson i:nth-child(1) { background: #b72430; }
.pal-crimson i:nth-child(2) { background: #fff1ce; }
.pal-crimson i:nth-child(3) { background: #efa84e; }
.pal-midnight i:nth-child(1) { background: #172a45; }
.pal-midnight i:nth-child(2) { background: #e4edf0; }
.pal-midnight i:nth-child(3) { background: #fb6b32; }
.pal-emerald i:nth-child(1) { background: #12382f; }
.pal-emerald i:nth-child(2) { background: #eabd62; }
.pal-emerald i:nth-child(3) { background: #f9eed8; }
.pal-stealth i:nth-child(1) { background: #1c2328; }
.pal-stealth i:nth-child(2) { background: #52d1a0; }
.pal-stealth i:nth-child(3) { background: #f6edce; }

/* Extracted palette swatches (zero inline styles) */
.qb-palette-readout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.qb-palette-caption, .qb-panel-hint {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 560;
}
.qb-palette-swatches {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.qb-palette-swatches i {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .28);
}
[data-preset="crimson"] .sw-1 { background: #b72430; }
[data-preset="crimson"] .sw-2 { background: #fff1ce; }
[data-preset="crimson"] .sw-3 { background: #efa84e; }
[data-preset="midnight"] .sw-1 { background: #172a45; }
[data-preset="midnight"] .sw-2 { background: #e4edf0; }
[data-preset="midnight"] .sw-3 { background: #fb6b32; }
[data-preset="emerald"] .sw-1 { background: #12382f; }
[data-preset="emerald"] .sw-2 { background: #eabd62; }
[data-preset="emerald"] .sw-3 { background: #f9eed8; }
[data-preset="stealth"] .sw-1 { background: #1c2328; }
[data-preset="stealth"] .sw-2 { background: #52d1a0; }
[data-preset="stealth"] .sw-3 { background: #f6edce; }

[data-preset="dolomite"] .sw-1 { background: #1e6496; }
[data-preset="dolomite"] .sw-2 { background: #eb7a34; }
[data-preset="dolomite"] .sw-3 { background: #f7dfa8; }
[data-preset="riptide"] .sw-1 { background: #122e42; }
[data-preset="riptide"] .sw-2 { background: #28827a; }
[data-preset="riptide"] .sw-3 { background: #f2e8bc; }
[data-preset="damascus"] .sw-1 { background: #1e2a34; }
[data-preset="damascus"] .sw-2 { background: #cfa476; }
[data-preset="damascus"] .sw-3 { background: #e6ecee; }
[data-preset="tartan"] .sw-1 { background: #234a3c; }
[data-preset="tartan"] .sw-2 { background: #8c303c; }
[data-preset="tartan"] .sw-3 { background: #ece1be; }

.qb-slider-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #dcdad3;
  font-size: .78rem;
  font-weight: 600;
}
.qb-slider-control output {
  min-width: 3.4ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.qb-slider {
  width: clamp(110px, 14vw, 168px);
  height: 28px;
  min-height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  accent-color: var(--rp-primary);
  cursor: pointer;
}
.qb-slider:focus {
  background: transparent;
}
.qb-slider:focus-visible {
  outline: 2px solid var(--rp-focus);
  outline-offset: 4px;
  border-radius: 999px;
}

/* =========================================================
   03 · ADVANCED EDITOR SPLIT-SCREEN STUDIO
   ========================================================= */
.ed-split {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  min-height: 336px;
}
.ed-sheet-pane {
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid #2b2b28;
  background: #131312;
}
.ed-preview-pane {
  display: flex;
  flex-direction: column;
  background: #161615;
}
.ed-pane-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid #262623;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 620;
}
.ed-guide-pill {
  padding: 2px 7px;
  border-radius: 2px;
  background: #232320;
  color: var(--muted);
  font-size: .68rem;
  transition: background .25s ease, color .25s ease;
}
.stage-editor[data-guides="on"] .ed-guide-pill {
  background: var(--ok-bg);
  color: var(--ok);
}

.ed-sheet-stage {
  position: relative;
  display: block;
  flex: 1;
  aspect-ratio: 1 / 1;
  max-height: 296px;
  margin: 10px auto;
  padding: 0;
  width: calc(100% - 20px);
  overflow: hidden;
  border: 1px solid #2e2e2a;
  border-radius: 3px;
  background: #281b15;
  text-align: left;
}
.ed-sheet-stage:hover { border-color: var(--rp-control-line); }
.ed-sheet-base, .ed-sheet-guides {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ed-sheet-guides {
  clip-path: inset(0 100% 0 0);
  transition: clip-path .68s cubic-bezier(.32, 0, .18, 1);
}
.stage-editor[data-guides="on"] .ed-sheet-guides {
  clip-path: inset(0 0% 0 0);
}

.ed-sheet-cue {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(17, 17, 16, .82);
  color: #e6e4de;
  font-size: .66rem;
  font-weight: 600;
  opacity: .86;
  transition: opacity .2s ease;
  pointer-events: none;
}
.ed-sheet-stage:hover .ed-sheet-cue { opacity: 1; }

/* Vector transform selection boxes synced to real SIMUCUBE coordinates */
.ed-select-box {
  position: absolute;
  left: 48.5%;
  width: 19%;
  height: 10%;
  border: 1.5px solid #ff6347;
  background: rgba(188, 51, 33, .16);
  opacity: 0;
  transition: opacity .3s ease, transform .55s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.ed-box-left { top: 75.8%; }
.ed-box-right { top: 14.5%; border-style: dashed; }

.ed-select-box i {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #fff;
  border: 1px solid #bc3321;
}
.ed-select-box i:nth-of-type(1) { top: -3px; left: -3px; }
.ed-select-box i:nth-of-type(2) { top: -3px; right: -3px; }
.ed-select-box i:nth-of-type(3) { bottom: -3px; left: -3px; }
.ed-select-box i:nth-of-type(4) { bottom: -3px; right: -3px; }

.ed-tag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 2px;
  background: #bc3321;
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  white-space: nowrap;
}
.ed-box-left .ed-tag { bottom: calc(100% + 4px); }
.ed-box-right .ed-tag { top: calc(100% + 4px); background: #1c1c1a; border: 1px solid #bc3321; }

.stage-editor[data-mirror="active"] .ed-select-box,
.stage-editor[data-mirror="nudge"] .ed-select-box {
  opacity: 1;
}
.stage-editor[data-mirror="nudge"] .ed-box-left { transform: translate(6px, -3px); }
.stage-editor[data-mirror="nudge"] .ed-box-right { transform: translate(6px, 3px); }

.ed-controls-grid {
  display: grid;
  gap: 8px;
}
.ed-toggles-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ed-cam-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ed-cam-stage {
  position: relative;
  flex: 1;
  min-height: 235px;
  overflow: hidden;
  background: linear-gradient(180deg, #dcdce0 0%, #f5f7fb 36%, #eef0f6 76%, #e5e5ec 100%);
}
.ed-cam-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(.985);
  transition: opacity .32s ease, transform .42s cubic-bezier(.22, 1, .36, 1);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}
.ed-cam-img[data-ed-img="front"],
.ed-cam-img[data-ed-img="rear"],
.ed-cam-img[data-ed-img="top"] {
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 8%, #000 90%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 8%, #000 90%, transparent 100%);
  mask-composite: intersect;
}
.stage-editor:not([data-cam="side"]) .ed-cam-stage {
  background: linear-gradient(180deg, #eff1f5 0%, #f8fafd 44%, #eef0f7 80%, #e4e5ec 100%);
}
.stage-editor[data-cam="side"] [data-ed-img="side"],
.stage-editor[data-cam="front"] [data-ed-img="front"],
.stage-editor[data-cam="top"] [data-ed-img="top"],
.stage-editor[data-cam="rear"] [data-ed-img="rear"] {
  opacity: 1;
  transform: scale(1);
}
.ed-cam-label { color: var(--ink); }

.ed-telemetry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 8px 12px;
  border-top: 1px solid #262623;
  background: #141413;
  color: var(--muted);
  font-size: .73rem;
}
.ed-telemetry strong { color: var(--ink); font-weight: 620; }
.ed-coords {
  font-variant-numeric: tabular-nums;
  color: #e6c0b7;
  white-space: nowrap;
}

/* =========================================================
   04 · EXPORT TO IRACING STRIP (Interactive ID & Vehicle)
   ========================================================= */
.export-strip {
  display: grid;
  grid-template-columns: minmax(0, .76fr) minmax(0, 1.24fr);
  gap: clamp(26px, 4vw, 56px);
  align-items: center;
  padding-top: clamp(32px, 4.4vw, 56px);
  border-top: 1px solid var(--line-subtle);
  scroll-margin-top: 86px;
}
.export-specs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
}
.export-specs li {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--rp-surface);
  color: #e5e3dd;
  font-size: .78rem;
  font-weight: 600;
}

.export-body {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 20px;
  padding: 20px;
  align-items: center;
  min-width: 0;
}
.export-control-col,
.export-files-col {
  min-width: 0;
  max-width: 100%;
}
.export-vehicle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.export-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
}
.export-id-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--rp-control-line);
  border-radius: 3px;
  background: #10100f;
  color: var(--ink);
  font-size: .96rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.export-id-input:focus { border-color: var(--ink); background: #191917; }

.export-cta-btn {
  position: relative;
  width: 100%;
  margin-top: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rp-primary);
  color: #fff;
  font-size: .85rem;
  font-weight: 670;
  transition: background .18s ease, transform .15s ease;
}
.export-cta-btn:hover { background: var(--rp-primary-hover); }
.export-cta-text { position: relative; z-index: 1; }
.export-cta-bar {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .22);
  transform-origin: left center;
  transform: scaleX(0);
}
.stage-export[data-step="1"] .export-cta-btn { transform: scale(.98); }
.stage-export[data-step="1"] .export-cta-bar {
  transform: scaleX(1);
  transition: transform .52s cubic-bezier(.32, 0, .18, 1);
}

.export-files-col {
  display: grid;
  gap: 9px;
}
.export-file {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #2e2e2a;
  border-radius: 4px;
  background: #1d1d1b;
  opacity: .28;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .35s cubic-bezier(.22, 1, .36, 1), border-color .3s ease;
}
.export-file > div {
  min-width: 0;
  flex: 1;
}
.export-file strong { display: block; font-size: .84rem; color: var(--ink); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.export-file small { display: block; font-size: .74rem; color: var(--muted); }
.file-ext {
  flex: none;
  padding: 4px 7px;
  border-radius: 3px;
  background: var(--rp-selected);
  border: 1px solid rgba(188, 51, 33, .45);
  color: #ffb8ab;
  font-size: .68rem;
  font-weight: 760;
  letter-spacing: .05em;
}
.file-ext-spec {
  background: #232833;
  border-color: rgba(125, 162, 232, .38);
  color: #b7cef7;
}
.file-ok {
  margin-inline-start: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: .75rem;
  font-weight: 700;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .22s ease .08s, transform .22s ease .08s;
}

.stage-export[data-step="2"] .file-1,
.stage-export[data-step="3"] .file-1,
.stage-export[data-step="3"] .file-2 {
  opacity: 1;
  transform: none;
  border-color: #42423d;
}
.stage-export[data-step="2"] .file-1 .file-ok,
.stage-export[data-step="3"] .export-file .file-ok {
  opacity: 1;
  transform: scale(1);
}

.export-dest {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 3px;
  background: #111110;
  border: 1px solid #262623;
  opacity: .4;
  transition: opacity .3s ease, border-color .3s ease;
}
.export-dest code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dest-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555550;
  flex: none;
  transition: background .25s ease;
}
.stage-export[data-step="3"] .export-dest {
  opacity: 1;
  border-color: rgba(141, 212, 178, .35);
}
.stage-export[data-step="3"] .dest-dot { background: var(--ok); }
.stage-export[data-step="3"] .export-dest code { color: var(--ok); }

/* Responsive */
@media (max-width: 1020px) {
  .how-row, .export-strip {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }
  .section-lead-wrap { align-items: flex-start; max-width: 56ch; }
  .section-lead { text-align: left; }
}
@media (max-width: 740px) {
  .step-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-dots { display: none; }
  .studio-bar { padding: 8px 12px; gap: 8px; }
  .studio-title { font-size: .74rem; }
  .studio-badge { font-size: .7rem; padding: 3px 8px; }
  .ai-viewport { aspect-ratio: 2.55 / 1; }
  .qb-viewport { aspect-ratio: 1200 / 404; }
  .ai-layer-chips .chip-verify { display: none; }
  .ai-prompt-dock { flex-wrap: wrap; gap: 8px; }
  .prompt-action { width: 100%; }
  .qb-slider-control { width: 100%; justify-content: space-between; }
  .qb-slider { flex: 1; max-width: 190px; }
  .ed-cam-group { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .ed-split { grid-template-columns: 1fr; }
  .ed-sheet-pane { border-inline-end: 0; border-bottom: 1px solid #2b2b28; }
  .ed-sheet-stage { max-height: 230px; width: min(230px, calc(100% - 20px)); }
  .ed-cam-stage { min-height: 195px; }
  .export-body { grid-template-columns: 1fr; padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-cam-img, .ai-side-img, .qb-car-layer, .ed-sheet-guides, .ed-cam-img, .ed-select-box, .export-file, .export-dest {
    transition: none;
  }
  .ai-scan-beam, .motion-dot, .caret { animation: none; }
  .ai-scan-beam { display: none; }
}
