/* Stitched multi-part 3D viewer */
.stitched-viewer {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: oklch(0.12 0.02 290 / 0.6);
  margin-bottom: 14px;
}
.stitched-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid oklch(1 0 0 / 0.06);
}
.stitched-viewer-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stitched-part-chip {
  border: 1px solid oklch(1 0 0 / 0.1);
  background: oklch(1 0 0 / 0.05);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: none;
}
.stitched-part-chip.on,
.stitched-part-chip:hover {
  color: var(--text);
  border-color: oklch(0.7 0.16 295 / 0.5);
  background: oklch(0.55 0.2 295 / 0.2);
}
.stitched-viewer-canvas {
  width: 100%;
  min-height: 480px;
}
.stitched-viewer-canvas .cb-three-viewer,
.stitched-viewer-canvas canvas {
  width: 100% !important;
  height: 480px !important;
  display: block;
}
.stitched-viewer-overlay {
  position: absolute;
  inset: 48px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.1 0.02 290 / 0.55);
  font-family: var(--font-labels, 'DM Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  pointer-events: none;
}
.stitched-viewer-overlay.err { color: var(--rose); }

.ar-parts-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid oklch(0.35 0.1 295 / 0.35);
  background: oklch(0.14 0.03 295 / 0.4);
}
.ar-parts-title {
  font-family: var(--font-labels, 'DM Mono', monospace);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 8px;
}
.ar-parts-help {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 14px;
}
.ar-part-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid oklch(1 0 0 / 0.06);
}
.ar-part-thumb {
  width: 72px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.ar-part-meta { min-width: 0; }
.ar-part-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.ar-part-role {
  font-family: var(--font-labels, 'DM Mono', monospace);
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}
.ar-parts-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.ar-parts-add select,
.ar-parts-add input[type="text"] {
  background: oklch(0 0 0 / 0.28);
  border: 1px solid oklch(1 0 0 / 0.1);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-ui);
}
@media (max-width: 600px) {
  .ar-part-row { grid-template-columns: 56px 1fr; }
  .ar-part-row > :last-child { grid-column: 1 / -1; }
}

/* ── Immersive walk-inside (WebXR AR / on-screen first person) ───────────── */
.cb-walk-cta { letter-spacing: .02em; }
.cb-walk-secondary {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}
.cb-walk-orbit-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: #000;
  overflow: hidden;
}

/* Environment scan HUD (floor / road / path) */
.cb-env-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent 70%);
}
.cb-env-chip {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.cb-env-chip.is-locked {
  border-color: rgba(48, 209, 88, 0.55);
  background: rgba(20, 40, 28, 0.55);
}
.cb-env-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64d2ff;
  box-shadow: 0 0 0 3px rgba(100, 210, 255, 0.22);
}
.cb-env-chip[data-type="road"] .cb-env-chip-dot { background: #8e8e93; box-shadow: 0 0 0 3px rgba(142, 142, 147, 0.25); }
.cb-env-chip[data-type="path"] .cb-env-chip-dot { background: #d4a574; box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.25); }
.cb-env-chip[data-type="grass"] .cb-env-chip-dot { background: #30d158; box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.25); }
.cb-env-chip[data-type="floor"] .cb-env-chip-dot { background: #0a84ff; box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25); }
.cb-env-lock {
  width: min(220px, 55vw);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.cb-env-lock.is-on { opacity: 1; }
.cb-env-lock-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.cb-env-lock-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #30d158);
  transition: width 0.12s linear;
}
.cb-env-place {
  pointer-events: auto;
  min-width: 180px;
  min-height: 44px;
  opacity: 0.45;
}
.cb-env-place.is-ready {
  opacity: 1;
}
.cb-env-reset {
  pointer-events: auto;
  min-width: 140px;
  min-height: 42px;
}
.cb-walk-overlay--360 {
  background: #000;
}
.cb-360-overlay--camera {
  background: #000;
}
.cb-360-stage {
  background: #000;
}
.cb-walk-hud-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  pointer-events: auto;
}
.cb-walk-mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.cb-walk-mode-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(220, 226, 240, 0.72);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: -0.01em;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.cb-walk-mode-tab.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.cb-walk-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #0d0d14;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.cb-walk-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  touch-action: none;
  cursor: grab;
}
.cb-walk-host:active { cursor: grabbing; }
.cb-walk-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  position: relative;
  z-index: 0;
}

.cb-walk-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 14px;
  z-index: 30;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
  /* Keep HUD above WebGL compositor layers in Android WebView */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.cb-walk-status {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #e9e9f2;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.cb-walk-exit { pointer-events: auto; font-size: 11px; padding: 8px 14px; }

.cb-walk-joystick {
  position: absolute;
  left: max(18px, env(safe-area-inset-left, 0px));
  /* Sit above Android gesture / nav bar — was drawing behind it */
  bottom: calc(28px + env(safe-area-inset-bottom, 0px) + 36px);
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.42), rgba(12,12,20,.72) 68%);
  border: 2px solid rgba(200, 180, 255, .75);
  box-shadow: 0 8px 28px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08) inset;
  z-index: 40;
  pointer-events: auto;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  isolation: isolate;
}
.cb-walk-knob {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(168,120,255,.95);
  box-shadow: 0 4px 18px rgba(139,92,246,.65);
  transition: transform .04s linear;
  pointer-events: none;
}
.cb-walk-err {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(190,40,60,.92);
  color: #fff;
  font-size: 12px;
  z-index: 4;
  text-align: center;
}

/* ── Geo-placed City Map (3D whole-city view) ────────────────────────────── */
.city-map-page { padding: 24px clamp(16px, 4vw, 40px) 60px; max-width: 1280px; margin: 0 auto; }
.city-map-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 18px;
}
.city-map-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--violet); margin-bottom: 8px;
}
.city-map-title {
  font-family: 'Bebas Neue', sans-serif; font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem); letter-spacing: 0.02em; text-transform: uppercase;
  line-height: 1; margin: 0;
}
.city-map-sub { color: var(--text-dim); font-size: 0.95rem; max-width: 52ch; margin: 8px 0 0; }
.city-map-stats { display: flex; gap: 14px; }
.city-stat {
  border: 1px solid var(--border, rgba(140,140,180,0.2)); border-radius: 12px;
  padding: 12px 18px; text-align: center; background: var(--bg-raised, rgba(255,255,255,0.03));
}
.city-stat-n { font-family: 'Bebas Neue', sans-serif; font-size: 1.9rem; line-height: 1; color: var(--violet); }
.city-stat-l { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-top: 4px; }

.city-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.city-legend-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-dim);
  border: 1px solid var(--border, rgba(140,140,180,0.18)); border-radius: 100px; padding: 5px 12px;
}
.city-legend-dot { width: 9px; height: 9px; border-radius: 2px; }

.city-stage {
  position: relative; width: 100%; height: min(68vh, 620px);
  border-radius: 18px; overflow: hidden; border: 1px solid var(--border, rgba(140,140,180,0.2));
  background: #0a0812;
}
.city-stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.city-stage-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.city-stage-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: rgba(10,8,18,0.72); z-index: 2; color: var(--text);
}
.city-stage-overlay.err { color: #ffb4c4; }

.city-tooltip {
  position: fixed; z-index: 30; pointer-events: none;
  background: rgba(16,12,26,0.94); border: 1px solid rgba(139,92,246,0.5);
  border-radius: 10px; padding: 8px 12px; max-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); backdrop-filter: blur(8px);
}
.city-tooltip-title { font-family: 'Instrument Sans', sans-serif; font-weight: 600; font-size: 0.9rem; color: #fff; }
.city-tooltip-meta { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet); margin-top: 3px; }

.city-map-foot { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--text-faint); margin-top: 14px; letter-spacing: 0.03em; line-height: 1.6; }

@media (max-width: 600px) {
  .city-map-head { flex-direction: column; align-items: flex-start; }
  .city-stage { height: 60vh; }
}

/* ── Guided AR onboarding (dom-overlay coach marks) ──────────────────────── */
.cb-ar-coach {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  max-width: min(320px, 84vw);
  padding: 22px 24px;
  border-radius: 18px;
  background: rgba(13, 11, 24, 0.78);
  border: 1px solid rgba(139, 92, 246, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  color: #f1eefc;
  pointer-events: none;
  animation: cb-coach-in .35s ease both;
}
.cb-ar-coach--compact {
  top: auto; bottom: 96px;
  transform: translateX(-50%);
  padding: 14px 20px;
}
@keyframes cb-coach-in {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
.cb-ar-coach--compact { animation: cb-coach-in-b .3s ease both; }
@keyframes cb-coach-in-b {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.cb-ar-coach-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
  display: inline-block;
  animation: cb-phone-sweep 2.2s ease-in-out infinite;
}
@keyframes cb-phone-sweep {
  0%, 100% { transform: rotate(-14deg) translateX(-10px); }
  50%      { transform: rotate(14deg)  translateX(10px); }
}
.cb-ar-coach-title {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}
.cb-ar-coach-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(233, 228, 250, 0.8);
}
.cb-ar-coach-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.cb-ar-coach-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #8b5cf6;
  animation: cb-dot-pulse 1.2s ease-in-out infinite;
}
.cb-ar-coach-dots span:nth-child(2) { animation-delay: .2s; }
.cb-ar-coach-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes cb-dot-pulse {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
.cb-ar-tapdot {
  width: 34px; height: 34px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px solid #a3e635;
  position: relative;
  animation: cb-tap-pulse 1.3s ease-out infinite;
}
.cb-ar-tapdot::after {
  content: '';
  position: absolute; inset: 9px;
  border-radius: 50%;
  background: #a3e635;
}
@keyframes cb-tap-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.45); }
  100% { box-shadow: 0 0 0 16px rgba(163, 230, 53, 0); }
}
.cb-ar-placed-toast {
  position: absolute;
  left: 50%; top: 84px;
  transform: translateX(-50%);
  z-index: 6;
  padding: 10px 18px;
  border-radius: 100px;
  background: rgba(20, 34, 12, 0.88);
  border: 1px solid rgba(163, 230, 53, 0.55);
  color: #d8f7ae;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  pointer-events: none;
  animation: cb-toast-in .3s ease both, cb-toast-out .5s ease 4s both;
}
@keyframes cb-toast-in  { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes cb-toast-out { to { opacity: 0; } }
.cb-ar-loadchip {
  position: absolute;
  right: 14px; bottom: 20px;
  z-index: 5;
  padding: 6px 13px;
  border-radius: 100px;
  background: rgba(13, 11, 24, 0.75);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #cfc4f5;
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: .05em;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .cb-ar-coach-icon, .cb-ar-coach-dots span, .cb-ar-tapdot { animation: none; }
}

/* VR walkthrough HUD action group */
.cb-walk-hud-actions { display: flex; gap: 8px; pointer-events: auto; }

/* ── Immersive Showroom (Ferrari Roma–style 360°) ─────────── */
.cb-showroom-cta {
  width: 100%;
  margin-top: 12px;
  min-height: 46px;
}
.cb-showroom-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--c-tertiary, var(--text-faint));
  letter-spacing: -0.01em;
  line-height: 1.4;
}
html.cb-360-open,
body.cb-360-open {
  overflow: hidden !important;
  touch-action: none;
  overscroll-behavior: none;
}
.cb-360-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: #0b0d12;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.cb-360-stage,
.cb-360-three-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.cb-360-mv {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
  --progress-bar-color: #0a84ff;
  outline: none;
}
.cb-360-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.cb-three-viewer--fill,
.cb-three-viewer--fill .cb-three-viewer-canvas {
  width: 100%;
  height: 100%;
  min-height: 100%;
}
.cb-360-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 12px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.78), transparent 85%);
}
.cb-360-brand,
.cb-showroom-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 550;
  color: rgba(220, 226, 240, 0.85);
  letter-spacing: -0.01em;
}
.cb-showroom-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.25);
}
.cb-360-title,
.cb-showroom-title {
  margin-top: 6px;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.15;
  max-width: 92%;
}
.cb-360-status,
.cb-showroom-status {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(180, 190, 210, 0.85);
}
.cb-360-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(8, 10, 16, 0.88), transparent);
  pointer-events: none;
}
.cb-360-actions > * {
  pointer-events: auto;
}
.cb-360-engine {
  font-size: 11px;
  font-weight: 600;
  color: rgba(180, 190, 210, 0.7);
  margin-right: 4px;
}
.cb-showroom-load {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translateX(-50%);
  z-index: 3;
  width: min(280px, 70vw);
}
.cb-showroom-load-track {
  height: 4px;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.12);
  overflow: hidden;
}
.cb-showroom-load-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #30d158);
  transition: width 0.2s ease;
}
.cb-showroom-err {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  max-width: 320px;
  padding: 16px 18px;
  border-radius: 16px;
  background: oklch(0.18 0.04 25 / 0.9);
  border: 1px solid oklch(0.6 0.18 25 / 0.45);
  color: #ffb4a8;
  font-size: 14px;
  text-align: center;
}
