/* ==========================================================================
   BYD EXECUTIVE GARAGE — v3
   Estúdio ultra-realista · Palanque giratório · Cabine em 1ª pessoa
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --header-h: 68px;
  --dock-h: 96px;
  --gutter: clamp(14px, 2.4vw, 36px);
  --glass: rgba(12, 17, 27, 0.72);
  --glass-strong: rgba(9, 13, 21, 0.9);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --podium-rot: 0deg;
}

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #04060a;
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--active-car-accent);
  outline-offset: 3px;
  border-radius: 10px;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 99px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ==========================================================================
   1. ESTÚDIO (FUNDO DA PÁGINA)
   ========================================================================== */
.app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.studio-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 50% 0%, rgba(190, 210, 255, 0.075) 0%, transparent 70%),
    radial-gradient(ellipse 60% 38% at 50% 72%, var(--active-car-glow) 0%, transparent 70%),
    linear-gradient(180deg, #05070c 0%, #070a11 55%, #030508 100%);
  transition: background 0.8s ease;
}

.studio-bg::after {
  /* textura sutil de concreto polido */
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 3px 3px;
  mask-image: linear-gradient(180deg, transparent 40%, #000 100%);
}

/* ==========================================================================
   2. CABEÇALHO
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(4, 6, 10, 0.94), rgba(4, 6, 10, 0.78));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }

.byd-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, rgba(225, 29, 42, 0.25), rgba(12, 17, 28, 0.9));
  box-shadow: 0 0 22px rgba(225, 29, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: #fff;
  flex-shrink: 0;
}

.brand-titles { display: flex; flex-direction: column; min-width: 0; }
.brand-title-main {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.brand-title-sub { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; }

.catalog-filter-pills {
  justify-self: center;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(11, 16, 27, 0.8);
  border: 1px solid var(--line);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.catalog-filter-pills::-webkit-scrollbar { display: none; }

.filter-pill {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 15px;
  min-height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.filter-pill:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.filter-pill.active {
  background: linear-gradient(135deg, var(--active-car-accent), var(--active-car-secondary));
  color: #030711;
  font-weight: 700;
}
.filter-dot { width: 7px; height: 7px; border-radius: 50%; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  min-width: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(14, 20, 33, 0.82);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.icon-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.icon-btn:hover, .icon-btn.active {
  color: #fff;
  border-color: var(--active-car-accent);
  box-shadow: 0 0 16px var(--active-car-glow);
}
.icon-btn.accent {
  color: #fff;
  border-color: color-mix(in srgb, var(--active-car-accent) 60%, transparent);
  background: linear-gradient(135deg, rgba(16, 28, 48, 0.95), rgba(8, 14, 26, 0.95));
}

.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primitive-dmi-emerald-400);
  box-shadow: 0 0 8px var(--primitive-dmi-emerald-400);
}

/* ==========================================================================
   3. GARAGEM — GRID PRINCIPAL
   ========================================================================== */
.garage-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(290px, 330px) minmax(0, 1fr) minmax(290px, 330px);
  gap: 20px;
  padding: 18px var(--gutter) 10px;
  align-items: center;
  min-height: calc(100dvh - var(--header-h) - var(--dock-h));
}

.panel {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(15, 21, 34, 0.86), rgba(7, 10, 17, 0.92));
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ---- Painel esquerdo: identidade ---- */
.powertrain-badge-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.powertrain-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--active-car-accent);
  border: 1px solid color-mix(in srgb, var(--active-car-accent) 55%, transparent);
  background: color-mix(in srgb, var(--active-car-accent) 12%, transparent);
}

.car-series-tag { font-size: 0.7rem; color: var(--text-muted); text-align: right; }

.active-car-name {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.8vw, 1.8rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #fff;
}

.active-car-tagline { font-size: 0.82rem; line-height: 1.45; color: var(--text-secondary); margin-top: 6px; }

.price-spotlight {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}
.price-label { font-size: 0.74rem; color: var(--text-muted); }
.price-value { font-family: var(--font-mono); font-size: 1.12rem; font-weight: 700; color: var(--primitive-gold-400); }

.quick-telemetry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.telemetry-stat-box {
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(6, 9, 16, 0.7);
  border: 1px solid var(--line);
}
.stat-label { display: block; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 3px; }
.stat-number { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; color: #fff; }
.stat-unit { font-family: var(--font-sans); font-size: 0.7rem; font-weight: 600; color: var(--active-car-accent); margin-left: 4px; }

.paint-selector-block { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.paint-header { display: flex; justify-content: space-between; gap: 8px; font-size: 0.76rem; }
.paint-label { color: var(--text-muted); }
.paint-current-name { font-weight: 600; text-align: right; }
.paint-swatches { display: flex; gap: 10px; flex-wrap: wrap; }

.paint-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.35), inset 0 4px 8px rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s ease;
}
.paint-swatch:hover { transform: scale(1.12); }
.paint-swatch.active { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 0 3px rgba(255,255,255,0.08), 0 0 14px var(--active-car-glow); }

.primary-cta-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }

.btn-primary, .btn-secondary {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  border: 0;
  color: #030711;
  background: linear-gradient(135deg, var(--active-car-accent), var(--active-car-secondary));
  box-shadow: 0 10px 26px var(--active-car-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px var(--active-car-glow); }
.btn-secondary {
  border: 1px solid var(--line-strong);
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}
.btn-secondary:hover { border-color: var(--active-car-accent); background: rgba(255, 255, 255, 0.07); }

/* ---- Painel direito: telemetria ---- */
.panel-section-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-section-title { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; font-weight: 700; }

.blade-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 7px;
  color: var(--active-car-accent);
  background: color-mix(in srgb, var(--active-car-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--active-car-accent) 30%, transparent);
  white-space: nowrap;
}

.battery-gauge-card, .range-breakdown-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(6, 9, 16, 0.72);
  border: 1px solid var(--line);
}

.battery-cells-bar {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  height: 20px;
  padding: 3px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
}
.blade-cell-segment {
  border-radius: 2px;
  background: linear-gradient(180deg, var(--active-car-accent), var(--active-car-secondary));
  transition: opacity 0.4s ease;
}

.battery-metrics-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.battery-kwh-big { font-family: var(--font-mono); font-size: 1.22rem; font-weight: 700; }
.battery-charge-time { font-size: 0.75rem; color: var(--primitive-dmi-emerald-400); font-weight: 600; line-height: 1.35; }

.link-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 34px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.link-btn:hover { color: #fff; border-color: var(--active-car-accent); }

.range-split-header { display: flex; justify-content: space-between; gap: 10px; font-size: 0.74rem; font-weight: 700; }
.range-progress-track { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; display: flex; }
.range-ev-fill { height: 100%; background: var(--primitive-blade-cyan-400); transition: width 0.5s var(--ease-smooth); }
.range-fuel-fill { height: 100%; background: var(--primitive-dmi-emerald-400); transition: width 0.5s var(--ease-smooth); }

.fuel-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.fuel-mini-item { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); min-width: 0; }
.fuel-mini-label { display: block; font-size: 0.67rem; color: var(--text-muted); }
.fuel-mini-val { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: #fff; }

.mini-commute-simulator {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--active-car-accent) 9%, transparent), rgba(0, 230, 153, 0.04));
  border: 1px solid color-mix(in srgb, var(--active-car-accent) 22%, transparent);
}
.commute-slider-header { display: flex; justify-content: space-between; gap: 8px; font-size: 0.76rem; font-weight: 600; }
.commute-km-badge { font-family: var(--font-mono); color: var(--active-car-accent); white-space: nowrap; }
.commute-result-text { font-size: 0.76rem; color: var(--text-secondary); line-height: 1.4; }
.commute-result-text strong { color: #fff; }

.byd-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  outline-offset: 6px;
  cursor: pointer;
}
.byd-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--active-car-accent);
  border: 2px solid #fff;
  box-shadow: 0 0 10px var(--active-car-glow);
}
.byd-range-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--active-car-accent); border: 2px solid #fff;
}

/* ==========================================================================
   4. PALCO — PALANQUE GIRATÓRIO ULTRA-REALISTA
   ========================================================================== */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 500px;
  min-width: 0;
}

.stage-top-hud {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 4px;
}

.stage-quick-flip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(11, 17, 30, 0.88);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.stage-quick-flip-btn:hover { border-color: var(--active-car-accent); }
.stage-quick-flip-btn.is-rear {
  color: #030711;
  border-color: transparent;
  background: linear-gradient(135deg, var(--active-car-accent), var(--active-car-secondary));
  box-shadow: 0 0 14px var(--active-car-glow);
}

.stage-scene {
  position: relative;
  flex: 1;
  min-height: 400px;
  /* carros ao fundo se dissolvem no escuro nas laterais — nada vaza para os painéis */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.scene-light {
  position: absolute;
  top: -8%;
  left: 50%;
  width: 78%;
  height: 92%;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(210, 228, 255, 0.11) 0%, rgba(210, 228, 255, 0.03) 55%, transparent 85%);
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
  filter: blur(18px);
}
.scene-light::before {
  content: '';
  position: absolute;
  top: 9%;
  left: 36%;
  right: 36%;
  height: 3px;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 0 24px 6px rgba(220, 235, 255, 0.55);
  filter: blur(0.5px);
}

.scene-horizon {
  position: absolute;
  left: 0; right: 0;
  bottom: 44%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07) 30%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.07) 70%, transparent);
  pointer-events: none;
}

.scene-floor {
  position: absolute;
  left: -10%; right: -10%;
  bottom: 0;
  height: 44%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 55% at 50% 22%, rgba(150, 175, 220, 0.09) 0%, transparent 70%),
    radial-gradient(ellipse 35% 40% at 50% 30%, var(--active-car-glow) 0%, transparent 75%);
  opacity: 0.9;
}

/* Âncora do palanque: tudo se posiciona em relação a ela */
.podium-anchor {
  position: absolute;
  left: 50%;
  bottom: 7%;
  width: min(90%, 640px);
  aspect-ratio: 100 / 26;
  transform: translateX(-50%);
}

.podium-disc, .podium-thickness {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
}
.podium-thickness {
  transform: translateY(calc(-50% + 12px)) scaleY(0.26);
  background: linear-gradient(180deg, #0b0f17, #020305);
  box-shadow: 0 40px 70px rgba(0, 0, 0, 0.85);
}
.podium-disc {
  transform: translateY(-50%) scaleY(0.26);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06) 0%, transparent 46%),
    conic-gradient(from 210deg, #161d29, #0c1119, #1a2230, #0b1018, #18202d, #0c1119, #161d29);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--active-car-accent) 70%, transparent),
    inset 0 0 40px color-mix(in srgb, var(--active-car-accent) 35%, transparent),
    0 0 50px var(--active-car-glow);
  transition: box-shadow 0.6s ease;
}
.podium-ticks {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.16) 0 0.5deg, transparent 0.5deg 7.5deg);
  -webkit-mask-image: radial-gradient(circle, transparent 88%, #000 89%, #000 100%);
  mask-image: radial-gradient(circle, transparent 88%, #000 89%, #000 100%);
  transform: rotate(var(--podium-rot));
  transition: transform 0.9s var(--ease-turntable);
}
.podium-inner {
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 70%);
  transform: rotate(var(--podium-rot));
  transition: transform 0.9s var(--ease-turntable);
}
.podium-inner::after {
  /* marca de referência que gira com o palanque */
  content: '';
  position: absolute;
  top: -1px; left: 50%;
  width: 34px; height: 4px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: var(--active-car-accent);
  box-shadow: 0 0 12px var(--active-car-accent);
}

/* Linha de chão dos carros */
.car-orbit {
  position: absolute;
  left: 0; right: 0;
  bottom: 40%;
  height: 0;
}

.car-node {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 84%;
  transform-origin: 50% 100%;
  transition:
    transform var(--duration-turntable) var(--ease-turntable),
    filter var(--duration-turntable) var(--ease-turntable),
    opacity var(--duration-turntable) var(--ease-turntable);
  will-change: transform;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.car-node:focus-visible { outline: none; }
.car-node:focus-visible .car-img { filter: drop-shadow(0 0 10px var(--active-car-accent)); }

.car-img {
  position: relative;
  z-index: 2;
  display: block;
  margin: 0 auto;
  width: auto;
  max-width: 100%;
  max-height: 320px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: filter 0.5s ease, opacity 0.4s ease;
}

.car-reflection {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 100%;
  width: auto;
  max-width: 100%;
  max-height: 320px;
  height: auto;
  object-fit: contain;
  transform: translateX(-50%) scaleY(-1);
  transform-origin: top;
  opacity: 0.2;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 38%);
  mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 38%);
  filter: blur(1.5px);
  transition: opacity 0.5s ease;
}

.car-shadow {
  position: absolute;
  z-index: 1;
  left: 6%; right: 6%;
  bottom: -5%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 45%, transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}

.car-node.is-back .car-reflection { opacity: 0; }
.car-node.is-back .car-shadow { opacity: 0.6; }

@keyframes flipCar180 {
  0% { transform: perspective(900px) rotateY(0deg) scale(1); filter: brightness(1); }
  45% { transform: perspective(900px) rotateY(88deg) scale(0.92); filter: brightness(0.65); }
  55% { transform: perspective(900px) rotateY(-88deg) scale(0.92); filter: brightness(0.65); }
  100% { transform: perspective(900px) rotateY(0deg) scale(1); filter: brightness(1); }
}
@keyframes flipCarRefl180 {
  0% { transform: translateX(-50%) scaleY(-1) perspective(900px) rotateY(0deg) scale(1); }
  45% { transform: translateX(-50%) scaleY(-1) perspective(900px) rotateY(88deg) scale(0.92); }
  55% { transform: translateX(-50%) scaleY(-1) perspective(900px) rotateY(-88deg) scale(0.92); }
  100% { transform: translateX(-50%) scaleY(-1) perspective(900px) rotateY(0deg) scale(1); }
}
.car-node.is-front.is-flipping-angle .car-img {
  animation: flipCar180 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}
.car-node.is-front.is-flipping-angle .car-reflection {
  animation: flipCarRefl180 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.car-tag {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: -12%;
  transform: translate(-50%, 6px);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.92);
  border: 1px solid var(--line-strong);
  font-size: 1.6rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.car-node.is-back:hover .car-tag { opacity: 1; transform: translate(-50%, 0); }

/* Raio-X da Bateria Blade */
.car-xray {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.car-xray svg { width: 92%; height: auto; margin-bottom: 4%; }
.app.xray-active .car-node.is-front .car-xray { opacity: 1; }
.app.xray-active .car-node.is-front .car-img { opacity: 0.38; filter: grayscale(0.7) contrast(1.2) !important; }

/* Controles do palanque */
.stage-controls {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.exterior-angle-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  max-width: 100%;
}

.angle-segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(9, 14, 24, 0.88);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.angle-toggle-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}
.angle-toggle-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.angle-toggle-btn.is-active {
  color: #030711;
  background: linear-gradient(135deg, var(--active-car-accent), var(--active-car-secondary));
  box-shadow: 0 0 14px var(--active-car-glow);
}

.stage-trunk-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--primitive-gold-400);
  background: rgba(229, 193, 88, 0.08);
  border: 1px solid rgba(229, 193, 88, 0.28);
  white-space: nowrap;
}

.turntable-controls-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(9, 14, 24, 0.85);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.turntable-spin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(18, 26, 44, 0.9);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.turntable-spin-btn:hover { background: var(--active-car-accent); color: #030711; }

.turntable-dots { display: flex; align-items: center; gap: 6px; }
.turntable-dot {
  width: 9px; height: 9px;
  border-radius: 99px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}
.turntable-dot.active { width: 26px; background: var(--active-car-accent); }

.stage-caption { font-size: 0.74rem; color: var(--text-muted); text-align: center; }

/* ==========================================================================
   5. DOCK DE MODELOS (RODAPÉ)
   ========================================================================== */
.garage-roster-dock {
  position: relative;
  z-index: 5;
  padding: 8px var(--gutter) 16px;
}

.roster-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 1fr);
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 2px;
}
.roster-track::-webkit-scrollbar { display: none; }

.roster-card {
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(12, 17, 28, 0.78);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.roster-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.roster-card.active {
  border-color: var(--active-car-accent);
  background: linear-gradient(135deg, rgba(16, 25, 44, 0.96), rgba(8, 13, 24, 0.98));
  box-shadow: 0 0 16px var(--active-car-glow);
}
.roster-thumb { width: 72px; height: 40px; object-fit: contain; flex-shrink: 0; }
.roster-info { display: flex; flex-direction: column; min-width: 0; }
.roster-name { font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-sub { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }

/* Barra fixa mobile */
.mobile-sticky-action-bar { display: none; }

/* ==========================================================================
   6. TRANSIÇÃO DE ENTRADA (ZOOM NA PORTA + CORTINA)
   ========================================================================== */
.app.is-entering .car-node.is-front {
  transition: transform 0.75s cubic-bezier(0.7, 0, 0.84, 0), filter 0.75s ease !important;
  filter: brightness(1.15) blur(2px) !important;
}
.app.is-entering .car-node.is-back,
.app.is-entering .panel,
.app.is-entering .stage-controls,
.app.is-entering .garage-roster-dock,
.app.is-entering .podium-anchor {
  opacity: 0 !important;
  transition: opacity 0.4s ease !important;
}

.curtain {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}
.curtain.on { opacity: 1; visibility: visible; }
.curtain.slow { transition-duration: 0.8s; }
.curtain-ring {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--active-car-accent);
  animation: spin 0.9s linear infinite;
}
.curtain-text { font-size: 0.82rem; color: var(--text-secondary); letter-spacing: 0.02em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   7. CABINE EM 1ª PESSOA
   ========================================================================== */
.cabin {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: #000;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.cabin.open { opacity: 1; visibility: visible; pointer-events: auto; }

.cabin-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  transition: filter 0.5s ease;
}
.cabin-viewport.dragging { cursor: grabbing; }

.cabin-world {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 50%;
  will-change: transform;
}

.cabin-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  transition: filter 1.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cabin.is-arriving .cabin-photo { filter: brightness(0.25) blur(8px) saturate(0.6); transition: none; }
.cabin.is-leaving .cabin-photo { filter: brightness(0.3) blur(6px); transition-duration: 0.5s; }

/* Camadas de realismo dentro do mundo */
.cabin-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 1.2s ease, background 0.6s ease;
  background:
    radial-gradient(ellipse 34% 7% at 50% var(--dash-y, 56%), var(--cabin-ambient-color) 0%, transparent 100%),
    radial-gradient(ellipse 14% 22% at 10% 60%, var(--cabin-ambient-color) 0%, transparent 100%),
    radial-gradient(ellipse 14% 22% at 90% 60%, var(--cabin-ambient-color) 0%, transparent 100%);
}
.cabin.lights-on .cabin-ambient { opacity: 0.95; }

.cabin-glare {
  position: absolute;
  left: 18%; right: 18%;
  top: 22%;
  height: 30%;
  pointer-events: none;
  mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.07) 45%, rgba(255, 255, 255, 0.02) 52%, transparent 62%);
  background-size: 250% 100%;
  animation: glare 14s ease-in-out infinite alternate;
}
@keyframes glare { from { background-position: 100% 0; } to { background-position: 0% 0; } }

.cabin-sky {
  position: absolute;
  left: 15%; right: 15%;
  top: 0;
  height: 26%;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(150, 200, 255, 0.5) 0%, transparent 75%);
  opacity: 0;
  transition: opacity 1s ease;
}
.cabin.sunroof-open .cabin-sky { opacity: 1; }

/* W-HUD projetado no para-brisa */
.whud {
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--inv-s, 1));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  color: #7ff3ff;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.9);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.cabin.mode-drive .whud { opacity: 0.9; }
.whud small { display: block; font-size: 0.6rem; opacity: 0.8; }
.whud strong { font-size: 1.3rem; }

/* Hotspots */
.cabin-hotspot {
  position: absolute;
  z-index: 5;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: scale(var(--inv-s, 1));
  transition: opacity 0.3s ease;
}
.cabin-hotspot::before {
  content: '';
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22), 0 0 16px rgba(255, 255, 255, 0.6);
}
.cabin-hotspot::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  animation: ping 2.2s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.5); opacity: 0; } }

.cabin-hotspot span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translate(-50%, 4px);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(6, 10, 18, 0.9);
  border: 1px solid var(--line-strong);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cabin-hotspot:hover span, .cabin-hotspot:focus-visible span { opacity: 1; transform: translate(-50%, 0); }
.cabin.mode-drive .cabin-hotspot, .cabin.mode-screen .cabin-hotspot, .cabin.mode-rear .cabin-hotspot, .cabin.is-arriving .cabin-hotspot { opacity: 0; pointer-events: none; }
.cabin.mode-rear .cabin-hint { opacity: 0; }

/* Vinheta de lente */
.cabin-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* UI da cabine */
.cabin-topbar {
  position: absolute;
  z-index: 10;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 30px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
  pointer-events: none;
}
.cabin-topbar > * { pointer-events: auto; }

.cabin-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cabin-title .byd-emblem { font-size: 0.8rem; padding: 4px 11px; }
.cabin-title-text { display: flex; flex-direction: column; min-width: 0; }
.cabin-title-text strong { font-family: var(--font-display); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cabin-title-text small { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(10, 14, 22, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-exit:hover { background: var(--primitive-byd-red-500); border-color: var(--primitive-byd-red-500); }

.cabin-hint {
  position: absolute;
  z-index: 10;
  top: calc(max(14px, env(safe-area-inset-top)) + 58px);
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(6, 10, 18, 0.66);
  border: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.cabin-hint.hidden { opacity: 0; }

.cabin-dock {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 2 * var(--gutter));
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(8, 12, 20, 0.72);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  overflow-x: auto;
  scrollbar-width: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.cabin-dock::-webkit-scrollbar { display: none; }
.cabin.is-arriving .cabin-dock, .cabin.is-arriving .cabin-topbar { opacity: 0; }
.cabin.mode-screen .cabin-dock { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }

.dock-sep { width: 1px; height: 26px; background: var(--line-strong); margin: 0 4px; flex-shrink: 0; }

.view-btn {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 78px;
  min-height: 52px;
  padding: 6px 10px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.view-btn svg { width: 18px; height: 18px; }
.view-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.view-btn.active { color: #030711; background: var(--active-car-accent); }
.view-btn.power.active { background: var(--primitive-dmi-emerald-400); }

/* Painel de condução (cluster) — sempre acima do dock, nunca sobreposto */
.drive-panel {
  position: absolute;
  z-index: 9;
  left: var(--gutter);
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 86px);
  width: min(330px, calc(100% - 2 * var(--gutter)));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(7, 11, 19, 0.78);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}
.cabin.mode-drive .drive-panel { opacity: 1; visibility: visible; transform: none; }

.cluster-top-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; color: var(--text-muted); }
.gear-selector-row { display: flex; gap: 4px; }
.gear-letter {
  min-width: 30px; min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-subtle);
  cursor: pointer;
}
.gear-letter.active { background: var(--active-car-accent); color: #030711; }

.cluster-speed-center { text-align: center; }
.cluster-speed-value { font-family: var(--font-display); font-size: 2.8rem; font-weight: 800; line-height: 1; }
.cluster-speed-unit { font-size: 0.7rem; color: var(--active-car-accent); }

.cluster-power-labels { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-secondary); margin-bottom: 4px; }
.cluster-power-track { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.cluster-power-fill { height: 100%; width: 6%; background: linear-gradient(90deg, var(--primitive-dmi-emerald-400), var(--primitive-blade-cyan-400), var(--primitive-byd-red-500)); transition: width 0.12s linear; }

.cluster-bottom-gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 0.74rem; }
.cluster-bottom-gauges small { display: block; font-size: 0.64rem; color: var(--text-muted); }

.drive-modes-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.drive-mode-btn {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
}
.drive-mode-btn.active { border-color: var(--active-car-accent); color: #fff; background: color-mix(in srgb, var(--active-car-accent) 18%, transparent); }

.btn-accelerate-test {
  min-height: 50px;
  border-radius: 13px;
  border: 1px solid var(--primitive-byd-red-400);
  background: linear-gradient(135deg, rgba(225, 29, 42, 0.38), rgba(225, 29, 42, 0.14));
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.btn-accelerate-test:active, .btn-accelerate-test.pressed { background: var(--primitive-byd-red-500); box-shadow: 0 0 24px var(--primitive-byd-red-glow); }

/* Popover de iluminação */
.ambient-popover {
  position: absolute;
  z-index: 11;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 86px);
  transform: translate(-50%, 10px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.ambient-popover.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.ambient-popover span { font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap; }

/* Card de visão traseira interna (2ª fileira & porta-malas) */
.rear-cabin-card {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 86px);
  width: min(580px, calc(100% - 2 * var(--gutter)));
  transform: translateX(-50%) translateY(14px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(7, 11, 19, 0.84);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.68);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.35s var(--ease-smooth), visibility 0.32s ease;
}
.cabin.mode-rear .rear-cabin-card,
.cabin[data-view-mode="rear"] .rear-cabin-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.rear-cabin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}
.rear-cabin-title-wrap {
  min-width: 0;
  flex: 1;
}
.rear-cabin-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.rear-cabin-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--active-car-accent);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rear-cabin-card-head h3 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-ext-rear-shortcut {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--active-car-accent), var(--active-car-secondary));
  color: #030711;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--active-car-glow);
  transition: transform 0.2s var(--ease-spring), filter 0.2s ease;
}
.btn-ext-rear-shortcut:hover { transform: translateY(-1px); filter: brightness(1.06); }

.btn-toggle-rear-card {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.2s ease;
}
.btn-toggle-rear-card:hover { border-color: var(--active-car-accent); }
.rear-cabin-card.is-collapsed .btn-toggle-rear-card svg { transform: rotate(180deg); }
.rear-cabin-card.is-collapsed .rear-cabin-desc,
.rear-cabin-card.is-collapsed .rear-cabin-specs-row {
  display: none;
}

.rear-cabin-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.rear-cabin-specs-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
}
.rear-cabin-metric {
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  min-width: 0;
}
.rear-cabin-metric small {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.rear-cabin-metric strong {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

/* Modo tela: a câmera "encosta" na central e a interface aparece */
.cabin.mode-screen .cabin-viewport { filter: blur(5px) brightness(0.45); }

.screen-mode {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: calc(max(14px, env(safe-area-inset-top)) + 64px) var(--gutter) max(20px, env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  transform: scale(0.94);
  transition: opacity 0.4s ease, transform 0.5s var(--ease-smooth), visibility 0.4s ease;
}
.cabin.mode-screen .screen-mode.ready { opacity: 1; visibility: visible; transform: none; }

.screen-toolbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ==========================================================================
   8. CENTRAL MULTIMÍDIA DiLINK (GIRATÓRIA)
   ========================================================================== */
.dilink-tablet-frame {
  position: relative;
  width: 100%;
  max-width: 820px;
  height: min(500px, 62vh);
  padding: 11px;
  border-radius: 24px;
  background: linear-gradient(145deg, #222c40, #06090e);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 40px color-mix(in srgb, var(--cabin-ambient-color) 25%, transparent), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  transition: max-width 0.7s var(--ease-turntable), height 0.7s var(--ease-turntable);
}
.dilink-tablet-frame.portrait-mode { max-width: min(440px, 100%); height: min(660px, 74vh); }

.dilink-screen-inner {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 80% 10%, rgba(0, 229, 255, 0.12), transparent 50%), linear-gradient(180deg, #0d1526, #070b14);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.dilink-screen-inner::after {
  /* reflexo do vidro */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.06) 0%, transparent 28%);
}

.dilink-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: rgba(4, 7, 13, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.dilink-status-left, .dilink-status-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.pm25-pill { padding: 2px 8px; border-radius: 99px; background: rgba(0, 230, 153, 0.15); color: var(--primitive-dmi-emerald-400); font-size: 0.64rem; }

.dilink-app-viewport { flex: 1; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }

.dilink-bottom-dock {
  display: flex;
  justify-content: space-around;
  padding: 6px;
  background: rgba(5, 8, 15, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.dilink-dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 48px;
  padding: 5px 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
}
.dilink-dock-btn:hover { color: #fff; }
.dilink-dock-btn.active { color: var(--active-car-accent); background: color-mix(in srgb, var(--active-car-accent) 14%, transparent); }

.dilink-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dilink-widget-card { display: flex; flex-direction: column; gap: 10px; padding: 13px; border-radius: 14px; background: rgba(15, 23, 40, 0.82); border: 1px solid rgba(255, 255, 255, 0.08); }
.dilink-widget-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 700; }

/* Botões genéricos usados em modais e na DiLink */
.specs-tab-btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.specs-tab-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.specs-tab-btn.active { background: var(--active-car-accent); border-color: var(--active-car-accent); color: #030711; font-weight: 700; }

/* ==========================================================================
   9. MODAL DE ESPECIFICAÇÕES
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vw, 28px);
  background: rgba(2, 4, 8, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }

.specs-modal-shell {
  width: min(1180px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(165deg, #0c1220, #060911);
  border: 1px solid var(--line-strong);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.85);
  transform: translateY(14px);
  transition: transform 0.4s var(--ease-smooth);
}
.modal-backdrop.open .specs-modal-shell { transform: none; }

.specs-modal-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 19, 0.92);
}
.specs-modal-header .eyebrow { font-size: 0.72rem; color: var(--active-car-accent); }
.specs-modal-header h2 { font-family: var(--font-display); font-size: 1.12rem; }
.specs-tabs-bar { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.specs-tabs-bar::-webkit-scrollbar { display: none; }
.specs-tabs-bar .specs-tab-btn { white-space: nowrap; }

.btn-close-modal {
  align-self: start;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-close-modal:hover { background: var(--primitive-byd-red-500); border-color: var(--primitive-byd-red-500); }

.specs-modal-body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }

.simulator-two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.sim-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 18px; background: rgba(13, 19, 33, 0.82); border: 1px solid var(--line); min-width: 0; }
.sim-big-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sim-result-box { padding: 13px; border-radius: 14px; background: rgba(6, 9, 16, 0.85); border: 1px solid var(--line); min-width: 0; }
.sim-result-num { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--active-car-accent); }

.tech-specs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tech-spec-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: rgba(12, 18, 31, 0.75); border: 1px solid var(--line); }
.tech-spec-key { font-size: 0.74rem; color: var(--text-muted); }
.tech-spec-val { font-family: var(--font-mono); font-size: 0.92rem; font-weight: 700; }

.compare-table { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 8px 12px; font-size: 0.78rem; border-top: 1px solid var(--line); padding-top: 12px; }

/* ==========================================================================
   10. CHATBOT HI BYD
   ========================================================================== */
.hi-byd-chatbot-drawer {
  position: fixed;
  z-index: 130;
  top: calc(var(--header-h) + 12px);
  right: var(--gutter);
  bottom: 18px;
  width: min(400px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(11, 17, 30, 0.98), rgba(5, 8, 15, 0.99));
  border: 1px solid color-mix(in srgb, var(--active-car-accent) 30%, transparent);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.88);
  opacity: 0;
  visibility: hidden;
  transform: translateX(16px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s var(--ease-smooth), visibility 0.28s ease;
}
.hi-byd-chatbot-drawer.open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }

.chatbot-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, color-mix(in srgb, var(--active-car-accent) 12%, transparent), transparent); }
.chatbot-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chatbot-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--active-car-accent), var(--active-car-secondary)); color: #030711; font-family: var(--font-display); font-size: 0.66rem; font-weight: 800; }
.chatbot-title { font-size: 0.84rem; font-weight: 700; }
.chatbot-sub { font-size: 0.7rem; color: var(--primitive-dmi-emerald-400); }
.chatbot-header-actions { display: flex; gap: 6px; }
.chatbot-header-actions button { min-height: 34px; padding: 0 11px; font-size: 0.72rem; }

.chatbot-messages-feed { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { max-width: 90%; padding: 10px 13px; border-radius: 14px; font-size: 0.8rem; line-height: 1.45; overflow-wrap: anywhere; }
.chat-bubble.bot { align-self: flex-start; background: rgba(20, 30, 50, 0.92); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-bubble.user { align-self: flex-end; background: linear-gradient(135deg, var(--active-car-accent), var(--active-car-secondary)); color: #030711; font-weight: 700; border-bottom-right-radius: 4px; }
.chat-action-card { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }

.chatbot-quick-chips { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
.chatbot-quick-chips::-webkit-scrollbar { display: none; }
.chat-chip-btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--active-car-accent) 35%, transparent);
  background: color-mix(in srgb, var(--active-car-accent) 9%, transparent);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.chat-chip-btn:hover { background: var(--active-car-accent); color: #030711; }

.chatbot-input-bar { display: flex; gap: 8px; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chatbot-text-input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(15, 23, 40, 0.85); color: #fff; font: inherit; font-size: 16px; outline: none; }
.chatbot-text-input:focus { border-color: var(--active-car-accent); }
.chatbot-send-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--active-car-accent); color: #030711; font-weight: 800; font-size: 0.76rem; cursor: pointer; }

/* ==========================================================================
   11. RESPONSIVO
   ========================================================================== */
@media (max-width: 1280px) {
  .header-actions .label { display: none; }
  .header-actions .icon-btn { padding: 0 11px; }
}

@media (max-width: 1100px) {
  .garage-main {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'stage stage' 'info tele';
    align-items: start;
    min-height: 0;
  }
  .stage { grid-area: stage; min-height: 460px; }
  .car-identity-panel { grid-area: info; }
  .telemetry-right-panel { grid-area: tele; }
  .simulator-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --header-h: 108px; }

  .hide-mobile { display: none; }

  .top-nav {
    height: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'brand actions' 'filters filters';
    gap: 10px;
    padding: 10px 12px;
  }
  .brand-identity { grid-area: brand; gap: 10px; min-width: 0; overflow: hidden; }
  .brand-titles { overflow: hidden; min-width: 0; }
  .brand-title-sub { display: none; }
  .brand-title-main { font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .byd-emblem { font-size: 0.88rem; padding: 5px 11px; }
  .header-actions { grid-area: actions; gap: 6px; flex-shrink: 0; }
  .header-actions .label { display: none; }
  .header-actions .icon-btn { padding: 0; width: 38px; min-width: 38px; min-height: 38px; }
  #chatbot-launcher-btn { display: none; }
  .catalog-filter-pills { grid-area: filters; justify-self: stretch; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .filter-pill { justify-content: center; padding: 6px 6px; font-size: 0.72rem; gap: 5px; }

  .garage-main {
    grid-template-columns: 1fr;
    grid-template-areas: 'stage' 'info' 'tele';
    gap: 14px;
    padding: 6px 12px 12px;
  }
  .stage { min-height: 0; }
  .stage-top-hud { padding: 0 0 2px; gap: 6px; }
  .stage-trunk-pill { font-size: 0.64rem; padding: 5px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 58%; text-align: left; }
  .stage-quick-flip-btn { min-height: 30px; padding: 0 10px; font-size: 0.68rem; }
  .stage-scene { min-height: 260px; height: 66vw; max-height: 300px; }
  .car-img, .car-reflection { max-height: 202px; }
  .podium-anchor { width: 96%; bottom: 6%; }
  .car-tag { display: none; }
  .exterior-angle-bar { width: 100%; gap: 6px; }
  .angle-segmented { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .angle-toggle-btn { min-height: 40px; padding: 0 10px; font-size: 0.74rem; width: 100%; }
  .turntable-controls-bar { width: 100%; justify-content: space-between; gap: 8px; }
  .turntable-spin-btn { padding: 0 11px; font-size: 0.72rem; }
  .stage-caption { font-size: 0.68rem; }

  .garage-roster-dock { padding: 4px 12px calc(84px + env(safe-area-inset-bottom)); }
  .roster-track { grid-auto-columns: 150px; }

  .mobile-sticky-action-bar {
    position: fixed;
    z-index: 60;
    left: 0; right: 0; bottom: 0;
    display: grid;
    grid-template-columns: 1.4fr 1fr auto;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(4, 7, 14, 0.96);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
  }
  .mobile-action-btn {
    min-height: 48px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(15, 23, 40, 0.92);
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
  }
  .mobile-action-btn.primary { border: 0; color: #030711; background: linear-gradient(135deg, var(--active-car-accent), var(--active-car-secondary)); }

  /* Cabine mobile */
  .cabin-title-text small { display: none; }
  .btn-exit .label { display: none; }
  .btn-exit { width: 42px; padding: 0; justify-content: center; }
  .cabin-hint { font-size: 0.68rem; max-width: calc(100% - 24px); white-space: normal; text-align: center; }
  .cabin-dock { left: 10px; right: 10px; max-width: none; transform: none; justify-content: space-between; gap: 2px; padding: 4px; }
  .cabin-dock .dock-sep { display: none; }
  .cabin.mode-screen .cabin-dock { transform: translateY(20px); }
  .view-btn { min-width: 0; flex: 1; padding: 5px 2px; font-size: 0.56rem; line-height: 1.12; white-space: normal; text-align: center; }
  .drive-panel { left: 12px; right: 12px; width: auto; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px); padding: 12px; gap: 8px; }
  .rear-cabin-card { left: 12px; right: 12px; width: auto; transform: translateY(14px); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px); padding: 9px 11px; gap: 5px; border-radius: 16px; }
  .cabin.mode-rear .rear-cabin-card,
  .cabin[data-view-mode="rear"] .rear-cabin-card { transform: translateY(0); }
  .rear-cabin-eyebrow { font-size: 0.56rem; }
  .rear-cabin-card-head h3 { font-size: 0.82rem; }
  .btn-ext-rear-shortcut { min-height: 28px; padding: 0 9px; font-size: 0.65rem; }
  .btn-toggle-rear-card { width: 28px; height: 28px; }
  .rear-cabin-desc { font-size: 0.67rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rear-cabin-specs-row { grid-template-columns: 1fr 1fr; gap: 6px; }
  .rear-cabin-metric { padding: 6px 8px; border-radius: 10px; }
  .rear-cabin-metric small { font-size: 0.56rem; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rear-cabin-metric strong { font-size: 0.68rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cluster-speed-value { font-size: 2.2rem; }
  .ambient-popover { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px); }
  .whud strong { font-size: 1rem; }

  .dilink-tablet-frame { height: min(520px, 66vh); padding: 7px; border-radius: 18px; }
  .dilink-tablet-frame.portrait-mode { height: min(620px, 74vh); }
  .dilink-dock-btn span:last-child { font-size: 0.6rem; }
  .dilink-statusbar .pm25-pill { display: none; }

  /* Modal vira folha em tela cheia */
  .modal-backdrop { padding: 0; align-items: stretch; }
  .specs-modal-shell { max-height: none; height: 100%; border-radius: 0; }
  .specs-modal-header { padding: 12px 14px; }
  .specs-modal-body { padding: 14px; }
  .sim-big-result-grid { grid-template-columns: 1fr 1fr; }
  .sim-result-num { font-size: 1.12rem; }
  .compare-table { font-size: 0.72rem; }

  /* Chatbot vira bottom sheet */
  .hi-byd-chatbot-drawer {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 84vh;
    height: 84dvh;
    border-radius: 22px 22px 0 0;
    transform: translateY(24px);
  }
}

@media (max-width: 380px) {
  .brand-titles { display: none; }
  .sim-big-result-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
