/* ==========================================================================
   OUTLANDER CONNECT — STANDALONE CLIENT APP STYLES
   Mobile-First, Dark Glassmorphism, Automotive Theme
   ========================================================================== */

:root {
  --app-bg: #0b0f17;
  --panel-bg: rgba(18, 26, 42, 0.72);
  --panel-border: rgba(148, 163, 184, 0.14);
  --panel-border-focus: rgba(56, 189, 248, 0.5);
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #0ea5e9;
  --accent-cyan: #38bdf8;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --card-radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Automotive Metallic Paint Palette Defaults (Titanium Grey) */
  --paint-base: #2b2f36;
  --paint-light: #515660;
  --paint-highlight: #6e7683;
  --paint-specular: #9ca4b0;
  --paint-mid: #24272d;
  --paint-dark: #1b1e22;
  --paint-deep: #101214;
  --paint-seam: rgba(4, 7, 12, 0.72);
  --paint-crease: rgba(255, 255, 255, 0.17);

  /* Traction Battery Fill & Horizon Glow Defaults */
  --batt-primary: #10b981;
  --batt-secondary: #059669;
  --batt-glow: rgba(16, 185, 129, 0.45);
  --batt-fill-opacity: 0.36;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--app-bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Background Atmosphere */
.app-viewport {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  padding: calc(var(--safe-top) + 12px) 14px calc(var(--safe-bottom) + 20px);
  background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.12) 0%, rgba(11, 15, 23, 0.98) 70%);
}

/* Header Bar */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 14px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mitsubishi-logo {
  width: 28px;
  height: 28px;
  color: #ef4444;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(239, 68, 68, 0.35));
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #ffffff;
}

.brand-text p {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(22, 33, 54, 0.75);
  border: 1px solid var(--panel-border);
  color: #cbd5e1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(30, 45, 75, 0.9);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Status Banner */
.conn-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--panel-border);
  margin-bottom: 14px;
  font-size: 0.75rem;
  cursor: pointer;
}

.conn-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.conn-status-bar.connected .conn-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.conn-status-bar.connecting .conn-dot {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: pulse 1s infinite alternate;
}

.conn-status-bar.error .conn-dot,
.conn-status-bar.disconnected .conn-dot {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

/* CAR STAGE */
.car-stage {
  position: relative;
  width: 100%;
  border-radius: var(--card-radius);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(9, 13, 22, 0.9) 100%);
  border: 1px solid var(--panel-border);
  padding: 16px 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.car-svg-container {
  width: 100%;
  max-width: 290px;
  height: auto;
  position: relative;
  display: grid;
  place-items: center;
}

.outlander-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
}

/* Steering wheel LHD */
.outlander-svg .svg-steering-wheel {
  transform: translate(160px, 314px);
  transition: transform 0.35s ease;
}

/* SVG Doors & Closures Pivot Points and Animations */
.outlander-svg .svg-door,
.outlander-svg .svg-closure {
  transform-box: view-box;
  transition: transform 0.68s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}

.outlander-svg .svg-door-fl { transform-origin: 105px 274px; }
.outlander-svg .svg-door-fr { transform-origin: 315px 274px; }
.outlander-svg .svg-door-rl { transform-origin: 105px 420px; }
.outlander-svg .svg-door-rr { transform-origin: 315px 420px; }
.outlander-svg .svg-bonnet  { transform-origin: 210px 265px; }
.outlander-svg .svg-boot    { transform-origin: 210px 588px; }

/* Open door states */
.car-stage.open-fl .svg-door-fl {
  transform: rotate(43deg);
  filter: drop-shadow(-6px 6px 6px rgba(0, 0, 0, 0.65));
}
.car-stage.open-fr .svg-door-fr {
  transform: rotate(-43deg);
  filter: drop-shadow(6px 6px 6px rgba(0, 0, 0, 0.65));
}
.car-stage.open-rl .svg-door-rl {
  transform: rotate(42deg);
  filter: drop-shadow(-6px 6px 6px rgba(0, 0, 0, 0.65));
}
.car-stage.open-rr .svg-door-rr {
  transform: rotate(-42deg);
  filter: drop-shadow(6px 6px 6px rgba(0, 0, 0, 0.65));
}
.car-stage.open-bonnet .svg-bonnet {
  transform: scaleY(0.58);
  filter: drop-shadow(0 -8px 8px rgba(0, 0, 0, 0.8));
}
.car-stage.open-boot .svg-boot {
  transform: scaleY(0.54);
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.8));
}
.car-stage.open-boot .cargo-open-light {
  opacity: 0.55;
  transition: opacity 0.4s ease;
}

/* Open-door warning arcs (MUST BE HIDDEN BY DEFAULT!) */
.outlander-svg .door-warn-arc {
  fill: rgba(239, 68, 68, 0.15);
  stroke: rgba(248, 113, 113, 0.62);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.car-stage.open-fl .arc-fl,
.car-stage.open-fr .arc-fr,
.car-stage.open-rl .arc-rl,
.car-stage.open-rr .arc-rr,
.car-stage.open-bonnet .arc-bonnet,
.car-stage.open-boot .arc-boot {
  opacity: 1;
  animation: warnArcPulse 1.8s ease-in-out infinite;
}

@keyframes warnArcPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

/* Lights: Headlights, Parklights, Tail, Interior */
.outlander-svg .svg-fx-headlights,
.outlander-svg .svg-lamp-head,
.outlander-svg .svg-fx-parklights,
.outlander-svg .svg-lamp-park,
.outlander-svg .svg-fx-interior {
  opacity: 0;
  transition: opacity 0.42s ease;
  pointer-events: none;
}

.car-stage.lights-head .svg-fx-headlights,
.car-stage.lights-head .svg-lamp-head {
  opacity: 1;
  animation: beamShimmer 3.2s ease-in-out infinite;
}

.car-stage.lights-park .svg-fx-parklights,
.car-stage.lights-park .svg-lamp-park,
.car-stage.lights-head .svg-fx-parklights,
.car-stage.lights-head .svg-lamp-park {
  opacity: 1;
}

@keyframes beamShimmer {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 1; filter: brightness(1.09); }
}

/* Hazard Lights */
.outlander-svg .svg-hazard-blinker {
  opacity: 0;
  pointer-events: none;
}
.car-stage.lights-hazard .svg-hazard-blinker {
  animation: hazardBlink 1.05s steps(1, end) infinite;
}
@keyframes hazardBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.06; }
}

/* Climate FX (Airflow streams & defrost) */
.outlander-svg .svg-fx-climate,
.outlander-svg .svg-fx-windscreen {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.car-stage.climate-cool .svg-fx-climate { opacity: 1; }
.car-stage.climate-cool .climate-tint { fill: #0ea5e9; }
.car-stage.climate-cool .climate-stream {
  stroke: #7dd3fc;
  stroke-dasharray: 18 14;
  animation: airflowFlow 1.6s linear infinite;
}
.car-stage.climate-heat .svg-fx-climate { opacity: 1; }
.car-stage.climate-heat .climate-tint { fill: #f97316; }
.car-stage.climate-heat .climate-stream {
  stroke: #fdba74;
  stroke-dasharray: 18 14;
  animation: airflowFlow 1.8s linear infinite reverse;
}
.car-stage.climate-windscreen .svg-fx-windscreen { opacity: 1; }
.car-stage.climate-windscreen .defrost-wave {
  stroke-dasharray: 12 10;
  animation: defrostRise 1.4s linear infinite;
}
@keyframes airflowFlow { from { stroke-dashoffset: 64; } to { stroke-dashoffset: 0; } }
@keyframes defrostRise { from { stroke-dashoffset: 44; } to { stroke-dashoffset: 0; } }

/* Battery Fill, Wave Horizon & X-Ray */
.outlander-svg .svg-batt-clip-rect {
  transition: y 0.85s cubic-bezier(0.22, 1, 0.36, 1), height 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.outlander-svg .svg-batt-horizon-group,
.outlander-svg .svg-batt-marker {
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}
.outlander-svg .svg-fx-xray {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.outlander-svg .svg-batt-charge-ripples {
  opacity: 0;
}
.car-stage.is-charging .svg-batt-charge-ripples {
  opacity: 1;
}
.car-stage.is-charging .charge-scan.s1 {
  animation: chargeScanUp 2.4s ease-out infinite;
}
.car-stage.is-charging .charge-scan.s2 {
  animation: chargeScanUp 2.4s ease-out 1.2s infinite;
}
@keyframes chargeScanUp {
  0% { transform: translateY(0); opacity: 0.55; }
  100% { transform: translateY(-480px); opacity: 0; }
}

/* Charger Assembly & Port */
.outlander-svg .svg-charger-assembly {
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.car-stage.is-plugged .svg-charger-assembly {
  opacity: 1;
  transform: translateX(0);
}
.car-stage.is-plugged .charge-flap-closed {
  opacity: 0;
}
.outlander-svg .charge-cable-energy {
  opacity: 0;
}
.car-stage.is-charging .charge-cable-energy {
  opacity: 1;
  animation: cablePulse 0.85s linear infinite;
}
@keyframes cablePulse {
  from { stroke-dashoffset: 44; }
  to { stroke-dashoffset: 0; }
}

/* Central Lock Badge on Car Roof */
.car-stage.is-locked .lock-icon-open { display: none; }
.car-stage.is-locked .lock-icon-closed { display: block; }
.car-stage:not(.is-locked) .lock-icon-closed { display: none; }
.car-stage:not(.is-locked) .lock-icon-open { display: block; }

.svg-lock-badge {
  cursor: pointer;
  pointer-events: all;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.svg-lock-badge:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.6));
}
.svg-lock-badge:active {
  transform: scale(0.95);
}

/* Interactive Car Hit Zones */
.outlander-svg .car-hit-zone {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1.5;
  cursor: pointer;
  pointer-events: all;
  transition: fill 0.2s ease, stroke 0.2s ease;
}
.car-stage .car-hit-zone:hover {
  fill: rgba(56, 189, 248, 0.12);
  stroke: rgba(56, 189, 248, 0.45);
}

/* Door chips under car */
.door-chips-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  width: 100%;
}

.door-chip {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--panel-border);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.door-chip.open {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* CAR SVG ANIMATIONS & EFFECTS */
.car-stage.lights-head .svg-fx-headlights,
.car-stage.lights-head .svg-lamp-head {
  opacity: 1 !important;
}

.car-stage.lights-park .svg-fx-parklights,
.car-stage.lights-park .svg-lamp-park {
  opacity: 1 !important;
}

.car-stage.lights-hazard .svg-hazard-blinker {
  animation: hazardBlink 1s steps(1, end) infinite;
}

@keyframes hazardBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.car-stage.climate-cool .svg-fx-climate {
  opacity: 1 !important;
}

.car-stage.climate-cool .climate-tint {
  fill: #0ea5e9 !important;
  opacity: 0.28 !important;
}

.car-stage.climate-heat .svg-fx-climate {
  opacity: 1 !important;
}

.car-stage.climate-heat .climate-tint {
  fill: #f97316 !important;
  opacity: 0.28 !important;
}

.car-stage.climate-windscreen .svg-fx-windscreen {
  opacity: 1 !important;
}

/* HUD Panels */
.hud-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--card-radius);
  padding: 14px;
  margin-bottom: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.panel-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  border: 1px solid var(--panel-border);
}

.panel-badge.cool {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
}

.panel-badge.heat {
  color: #fdba74;
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.5);
}

.panel-badge.windscreen {
  color: #fde047;
  background: rgba(234, 179, 8, 0.2);
  border-color: rgba(250, 204, 21, 0.5);
}

/* Battery SOC Readout */
.soc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.soc-hero {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1;
}

.soc-hero span {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ev-range-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
}

.soc-track {
  height: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.soc-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.soc-fill.charging {
  animation: chargingGlow 1.8s ease-in-out infinite alternate;
}

@keyframes chargingGlow {
  from { filter: brightness(1); }
  to { filter: brightness(1.3) drop-shadow(0 0 8px #10b981); }
}

/* Charge Banner */
.charge-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
}

.charge-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.charge-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(30, 41, 59, 0.85);
  color: var(--text-muted);
}

.charge-banner.active .charge-icon-box {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.charge-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.charge-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* 3-Button Action Grid */
.btn-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ctrl-btn {
  appearance: none;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--panel-border);
  color: #e2e8f0;
  border-radius: 14px;
  padding: 11px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.76rem;
  transition: all 0.2s ease;
}

.ctrl-btn:hover {
  background: rgba(22, 33, 54, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.ctrl-btn svg {
  width: 20px;
  height: 20px;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.ctrl-btn.active-cool {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(56, 189, 248, 0.65);
  color: #bae6fd;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.25);
}
.ctrl-btn.active-cool svg { color: #38bdf8; }

.ctrl-btn.active-heat {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(251, 146, 60, 0.65);
  color: #fed7aa;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.25);
}
.ctrl-btn.active-heat svg { color: #fb923c; }

.ctrl-btn.active-windscreen {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(251, 191, 36, 0.65);
  color: #fef08a;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}
.ctrl-btn.active-windscreen svg { color: #fbbf24; }

/* Climate Telemetry Row (Remaining & Stop Time) */
.climate-telemetry-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.climate-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  min-width: 0;
}

.climate-tile-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--panel-border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.climate-tile-icon svg {
  width: 15px;
  height: 15px;
}

.climate-tile-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.climate-tile-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.climate-tile-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

/* Climate Parameters Grid (Duration & Delay) */
.climate-params-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.param-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--panel-border);
}

.param-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.param-header svg {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.param-select-box {
  position: relative;
  display: flex;
  align-items: center;
}

.param-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(9, 13, 22, 0.85);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9px;
  padding: 6px 24px 6px 9px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.param-chevron {
  position: absolute;
  right: 8px;
  pointer-events: none;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Quick Actions Grid */
.actions-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.action-card-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  min-height: 58px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.75) 0%, rgba(13, 19, 33, 0.85) 100%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  box-sizing: border-box;
  width: 100%;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.action-card-btn:hover {
  background: linear-gradient(145deg, rgba(22, 33, 54, 0.9) 0%, rgba(17, 26, 44, 0.95) 100%);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.action-card-btn:active {
  transform: scale(0.98);
}

.action-card-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #94a3b8;
  transition: color 0.2s ease, transform 0.2s ease;
}

.action-btn-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.action-btn-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-btn-sub {
  font-size: 0.68rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.2;
}

/* Active and Locked States */
.action-card-btn.active {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.2) 0%, rgba(2, 132, 199, 0.12) 100%);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.18);
}

.action-card-btn.active svg {
  color: #38bdf8;
}

.action-card-btn.active .action-btn-title {
  color: #38bdf8;
}

.action-card-btn.active .action-btn-sub {
  color: #7dd3fc;
}

.action-card-btn.status-card-indicator.locked {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.8) 0%, rgba(10, 16, 28, 0.9) 100%);
  border-color: rgba(56, 189, 248, 0.35);
}

.action-card-btn.status-card-indicator.locked svg {
  color: #38bdf8;
}

.action-card-btn.status-card-indicator.locked .action-btn-sub {
  color: #38bdf8;
  font-weight: 600;
}

.action-card-btn.status-card-indicator.unlocked {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.15) 0%, rgba(180, 83, 9, 0.1) 100%);
  border-color: rgba(245, 158, 11, 0.55);
}

.action-card-btn.status-card-indicator.unlocked svg {
  color: #fbbf24;
}

.action-card-btn.status-card-indicator.unlocked .action-btn-sub {
  color: #fbbf24;
  font-weight: 600;
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: max(16px, env(safe-area-inset-top, 16px)) 16px max(16px, env(safe-area-inset-bottom, 16px));
  box-sizing: border-box;
}

.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - max(32px, env(safe-area-inset-top, 16px) + env(safe-area-inset-bottom, 16px) + 24px));
  display: flex;
  flex-direction: column;
  background: #101623;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.modal-head h3 {
  font-size: 1rem;
  font-weight: 800;
}

.modal-head-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-body {
  padding: 18px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  color: #ffffff;
  font-size: 0.85rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-cyan);
}

.form-hint {
  font-size: 0.68rem;
  color: #64748b;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--panel-border);
  flex-shrink: 0;
  background: #0d121d;
}

.btn-primary {
  padding: 9px 18px;
  border-radius: 10px;
  background: #0ea5e9;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #0284c7;
  transform: translateY(-1px);
}

.btn-secondary {
  padding: 9px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

/* Modal Controls & Search */
.modal-controls-bar {
  padding: 10px 18px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(9, 13, 22, 0.6);
}

.modal-search-input {
  width: 100%;
  padding: 9px 13px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--panel-border);
  color: #f8fafc;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.modal-search-input:focus {
  border-color: var(--accent-cyan);
}

/* Category Filter Chips Bar */
.cat-chips-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-chips-bar::-webkit-scrollbar { display: none; }

.cat-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.cat-chip:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #f1f5f9;
}

.cat-chip.active {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(56, 189, 248, 0.65);
  color: #e0f2fe;
  box-shadow: 0 0 10px -2px rgba(14, 165, 233, 0.35);
}

/* Settings Items */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--panel-border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.setting-item:hover {
  background: rgba(22, 33, 54, 0.75);
  border-color: rgba(56, 189, 248, 0.35);
}

.setting-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.setting-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
}

.setting-cat-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

.setting-select {
  background: rgba(9, 13, 22, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  color: #f8fafc;
  padding: 7px 11px;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  max-width: 180px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.setting-select:focus {
  border-color: var(--accent-cyan);
}

.modal-btn-reset {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-btn-reset:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.65);
}

/* =========================================================
   DIAGNOSTICS & TELEMETRY
   ========================================================= */
.diag-actions-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.diag-actions-bar::-webkit-scrollbar { display: none; }

.diag-action-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.12);
  color: #bae6fd;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.diag-action-btn svg {
  width: 14px;
  height: 14px;
  color: #38bdf8;
}

.diag-action-btn:hover {
  background: rgba(14, 165, 233, 0.24);
  border-color: rgba(56, 189, 248, 0.6);
  color: #f0f9ff;
  transform: translateY(-1px);
}

.diag-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diag-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.diag-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.diag-card-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.diag-card-title svg {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.ignition-badge {
  padding: 3px 9px;
  border-radius: 7px;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ignition-badge.ready {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.65);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.ignition-badge.on {
  background: rgba(14, 165, 233, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.65);
  color: #38bdf8;
}

.ignition-badge.acc {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #fbbf24;
}

.ignition-badge.off {
  background: rgba(100, 116, 139, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

.alarm-banner {
  padding: 8px 11px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
}

.alarm-banner.triggered {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.6);
  color: #fca5a5;
  animation: hazardBlink 1s infinite;
}

.alarm-banner.armed {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}

.alarm-banner.disarmed {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
}

.diag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.77rem;
}

.diag-row-lbl {
  color: var(--text-muted);
}

.diag-row-val {
  font-weight: 700;
  color: #f8fafc;
  text-align: right;
}

/* TPMS Tire Pressure Grid */
.tpms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.tpms-tile {
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tpms-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.tpms-val {
  font-size: 0.78rem;
  font-weight: 800;
  color: #38bdf8;
}

/* =========================================================
   TIMERS & SCHEDULES
   ========================================================= */
.subtabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(9, 13, 22, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  padding: 3px;
}

.subtab-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.subtab-btn svg {
  width: 14px;
  height: 14px;
}

.subtab-btn.active {
  background: rgba(14, 165, 233, 0.22);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

.timer-master-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.6));
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.timer-master-left {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 700;
}

.timer-master-left svg {
  width: 18px;
  height: 18px;
  color: var(--accent-cyan);
}

.slots-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.slots-bar::-webkit-scrollbar { display: none; }

.slot-pill {
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  white-space: nowrap;
}

.slot-pill:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #f1f5f9;
}

.slot-pill.active {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(56, 189, 248, 0.65);
  color: #f0f9ff;
  box-shadow: 0 0 10px -2px rgba(14, 165, 233, 0.35);
}

.slot-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.slot-pill.enabled .slot-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.timer-editor-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.timer-row-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timer-input {
  background: rgba(9, 13, 22, 0.88);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: #f8fafc;
  padding: 6px 11px;
  font-size: 0.84rem;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.timer-input:focus {
  border-color: var(--accent-cyan);
}

.days-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.days-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.day-chip {
  min-width: 34px;
  height: 32px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(9, 13, 22, 0.75);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  font-family: inherit;
}

.day-chip:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #f1f5f9;
}

.day-chip.active {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(52, 211, 153, 0.65);
  color: #a7f3d0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.22);
}

.presets-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
  width: 100%;
}

.preset-chip {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(9, 13, 22, 0.65);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.preset-chip:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #f1f5f9;
}

/* =========================================================
   SETTINGS MODAL SUBTABS & APPEARANCE CONTROLS
   ========================================================= */
.settings-subtabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--panel-border);
  overflow-x: auto;
  flex-shrink: 0;
}

.settings-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.settings-subtab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.settings-subtab-btn.active {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(56, 189, 248, 0.4);
}

.settings-subtab-pane {
  display: none;
}

.settings-subtab-pane.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Appearance Form Layout */
.settings-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 480px) {
  .settings-grid-2 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.settings-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.settings-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
}

.settings-input,
.settings-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-input:focus,
.settings-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.25);
}

/* Factory Paint Swatches & Native Color Picker */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  padding: 0;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  outline: none;
}

.swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.65);
  z-index: 2;
}

.swatch.selected {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: scale(1.08);
}

.color-custom-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  background: rgba(15, 23, 42, 0.6);
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
}

.color-picker-native {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
}

#lbl-car-hex {
  font-size: 0.76rem;
  font-family: monospace;
  color: #94a3b8;
}

/* Settings Toggle Rows */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(22, 33, 54, 0.45);
  border: 1px solid var(--panel-border);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.settings-toggle-row:hover {
  background: rgba(30, 45, 75, 0.6);
  border-color: rgba(56, 189, 248, 0.3);
}

.settings-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0ea5e9;
  cursor: pointer;
}

/* Car Stage Modifiers */
.car-stage.rhd .outlander-svg .svg-steering-wheel {
  transform: translate(260px, 314px);
}

.car-stage.hide-sunroof .svg-sunroof {
  display: none;
}

.car-stage.fill-hidden .layer-battery-overlay {
  opacity: 0;
  pointer-events: none;
}

.car-stage.show-xray .svg-fx-xray {
  opacity: 1;
}

.car-stage.offline-dimmed {
  filter: grayscale(0.65) brightness(0.68);
  opacity: 0.65;
  transition: filter 0.4s ease, opacity 0.4s ease;
}

.car-stage:not(.interactive) .car-hit-zone {
  pointer-events: none !important;
  cursor: default !important;
}

/* Viewport Layout Modes */
.app-viewport.layout-wide {
  max-width: 860px;
}

.app-viewport.layout-compact {
  max-width: 420px;
}

/* =========================================================
   ONBOARDING WIZARD MODAL & STEPS
   ========================================================= */
.onboarding-overlay {
  z-index: 9999;
  backdrop-filter: blur(14px);
  background: rgba(5, 8, 14, 0.88);
}

.onboarding-dialog {
  background: linear-gradient(165deg, rgba(17, 24, 39, 0.98) 0%, rgba(10, 15, 26, 0.99) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(14, 165, 233, 0.15);
  border-radius: 20px;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - max(32px, env(safe-area-inset-top, 16px) + env(safe-area-inset-bottom, 16px) + 24px));
}

.onboarding-header {
  padding: 22px 24px 14px;
  text-align: center;
  border-bottom: 1px solid var(--panel-border);
  background: radial-gradient(ellipse at 50% 0%, rgba(14, 165, 233, 0.12) 0%, transparent 75%);
  flex-shrink: 0;
}

.onboarding-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
}

.onboarding-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
  max-width: 440px;
  margin: 0 auto;
}

.onboarding-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  transition: all 0.25s ease;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  font-size: 0.7rem;
}

.step-pill.active .step-num {
  background: #0ea5e9;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.45);
}

.step-pill.active {
  color: #38bdf8;
}

.step-pill.completed .step-num {
  background: #10b981;
  border-color: #34d399;
  color: #ffffff;
}

.step-pill.completed {
  color: #34d399;
}

.step-line {
  width: 28px;
  height: 2px;
  background: rgba(148, 163, 184, 0.18);
  transition: background 0.25s ease;
}

.step-line.completed {
  background: #10b981;
}

.onboarding-body {
  padding: 20px 24px 28px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.vin-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.onboarding-vin-input {
  width: 100%;
  padding: 12px 42px 12px 16px;
  border-radius: 12px;
  border: 2px solid rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 1.15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.onboarding-vin-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.28), 0 4px 16px rgba(0, 0, 0, 0.45);
}

.vin-counter {
  font-size: 0.75rem;
  font-family: monospace;
  color: #94a3b8;
}

.vin-counter.valid {
  color: #34d399;
  font-weight: 700;
}

.vin-check-icon {
  position: absolute;
  right: 14px;
  color: #34d399;
  font-weight: bold;
  font-size: 1.1rem;
}

.btn-sample-vin {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sample-vin:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
}

.onboarding-info-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}

.onboarding-error-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 12px;
  color: #fca5a5;
  font-size: 0.8rem;
  line-height: 1.4;
}

.btn-toggle-advanced {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-toggle-advanced:hover {
  color: #e2e8f0;
}

.onboarding-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.onboarding-submit-btn {
  width: 100%;
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.onboarding-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* Step 2: Searching animation */
.searching-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 10px;
  text-align: center;
}

.searching-spinner-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.searching-spinner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.15);
  border-top-color: #0ea5e9;
  border-right-color: #38bdf8;
  animation: obSpin 1s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

@keyframes obSpin {
  to { transform: rotate(360deg); }
}

.searching-mitsu-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.searching-mitsu-center svg {
  width: 24px;
  height: 24px;
  fill: #f1f5f9;
}

/* Step 3: Success Card */
.onboarding-vehicle-card {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.12) 0%, rgba(14, 165, 233, 0.1) 100%);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 14px;
  padding: 16px;
}

.veh-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #34d399;
  margin-bottom: 12px;
}

.veh-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.veh-card-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.veh-card-lbl {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.veh-card-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
}

.finish-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #34d399;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.finish-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

