/* ─── Taxi Avatar — Design tokens (Málaga Mediterranean) ─── */

:root {
  /* Palette — soft Mediterranean. Sea, terracotta, sun, whitewash. */
  --sea-950: oklch(22% 0.04 232);
  --sea-900: oklch(28% 0.06 230);
  --sea-800: oklch(36% 0.09 228);
  --sea-700: oklch(46% 0.11 224);
  --sea-600: oklch(56% 0.12 220);
  --sea-500: oklch(66% 0.11 218);
  --sea-400: oklch(76% 0.08 216);
  --sea-300: oklch(86% 0.05 215);
  --sea-200: oklch(92% 0.03 213);
  --sea-100: oklch(96% 0.018 213);

  --terra-700: oklch(48% 0.12 38);
  --terra-600: oklch(58% 0.14 40);
  --terra-500: oklch(68% 0.13 42);
  --terra-400: oklch(78% 0.10 44);
  --terra-300: oklch(86% 0.07 46);

  --sun-600: oklch(72% 0.14 80);
  --sun-500: oklch(80% 0.13 82);
  --sun-400: oklch(86% 0.11 84);
  --sun-300: oklch(92% 0.08 86);

  --olive-600: oklch(55% 0.08 130);
  --olive-500: oklch(65% 0.09 128);

  --shell: oklch(97% 0.012 84);     /* warm whitewash */
  --shell-2: oklch(94% 0.018 80);
  --ink: oklch(22% 0.02 240);
  --ink-soft: oklch(36% 0.02 240);
  --ink-mute: oklch(56% 0.015 240);

  /* Semantic — light mode (default) */
  --bg: var(--shell);
  --bg-2: var(--shell-2);
  --surface: #ffffff;
  --surface-2: oklch(98% 0.008 80);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --fg-mute: var(--ink-mute);
  --line: oklch(88% 0.012 80);
  --line-2: oklch(82% 0.014 80);
  --accent: var(--sea-700);
  --accent-2: var(--terra-600);
  --accent-3: var(--sun-500);

  /* Type */
  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  --bg: oklch(18% 0.025 232);
  --bg-2: oklch(22% 0.032 232);
  --surface: oklch(24% 0.035 232);
  --surface-2: oklch(28% 0.04 230);
  --fg: oklch(96% 0.01 80);
  --fg-soft: oklch(82% 0.015 80);
  --fg-mute: oklch(66% 0.02 80);
  --line: oklch(32% 0.04 232);
  --line-2: oklch(40% 0.05 230);
  --accent: var(--sea-400);
  --accent-2: var(--terra-400);
  --accent-3: var(--sun-400);
}

[data-font="sans"]  { --font-display: 'Outfit', system-ui, sans-serif; }
[data-font="serif"] { --font-display: 'Instrument Serif', Georgia, serif; }
[data-font="grotesk"] { --font-display: 'Space Grotesk', system-ui, sans-serif; --font-body: 'Space Grotesk', system-ui, sans-serif; }

/* ─── Base ─── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--fg);
  background:
    radial-gradient(1200px 700px at 20% -10%, oklch(92% 0.03 80) 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 110%, oklch(88% 0.045 220) 0%, transparent 60%),
    oklch(95% 0.012 80);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── Page chrome ─── */
.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 22px 28px 28px;
  gap: 18px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--sea-700) 0%, var(--terra-600) 100%);
  display: grid; place-items: center;
  color: white;
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  box-shadow: 0 6px 20px -8px var(--sea-800), inset 0 1px 0 rgba(255,255,255,.3);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--fg);
}
.brand-sub {
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  font-family: var(--font-mono);
}

.head-meta {
  display: flex; gap: 14px; align-items: center;
  font-size: 12px; color: var(--fg-mute);
  font-family: var(--font-mono);
}
.head-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--olive-500); box-shadow: 0 0 0 4px oklch(65% 0.09 128 / .15); }

/* ─── Stage ─── */
.stage {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 1180px) {
  .stage { grid-template-columns: 1fr; }
}

/* ─── Tablet frame ─── */
.tablet-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tablet {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, oklch(28% 0.01 240) 0%, oklch(18% 0.01 240) 100%);
  border-radius: 28px;
  padding: 14px;
  box-shadow:
    0 30px 60px -25px rgba(0,0,0,.55),
    0 8px 20px -10px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 0 -1px 0 rgba(0,0,0,.4);
}
.tablet::before {
  /* camera lens */
  content: '';
  position: absolute;
  top: 50%; left: 6px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: oklch(35% 0.01 240);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,.1);
  transform: translateY(-50%);
}
.tablet-screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}

/* ─── Scene navigator ─── */
.scene-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 8px -4px rgba(0,0,0,.06);
}
.scene-chips {
  display: flex; gap: 4px;
  flex: 1; overflow-x: auto;
  scrollbar-width: none;
}
.scene-chips::-webkit-scrollbar { display: none; }
.scene-chip {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 7px 12px;
  border-radius: 999px;
  font: 500 12px/1 var(--font-body);
  color: var(--fg-mute);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: all .18s var(--ease);
  display: flex; align-items: center; gap: 7px;
}
.scene-chip:hover { color: var(--fg); background: var(--bg-2); }
.scene-chip[aria-current="true"] {
  background: var(--ink);
  color: var(--shell);
}
.scene-chip .idx {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: .55;
}
.scene-chip[aria-current="true"] .idx { opacity: .7; }

.nav-btn {
  appearance: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--fg-soft);
  transition: all .15s var(--ease);
}
.nav-btn:hover { background: var(--bg-2); color: var(--fg); }
.nav-btn.primary {
  background: var(--ink); color: var(--shell); border-color: var(--ink);
}
.nav-btn.primary:hover { background: var(--sea-800); border-color: var(--sea-800); }

/* ─── Driver side panel ─── */
.driver-panel {
  position: sticky; top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 30px -18px rgba(0,0,0,.18);
}
.driver-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2) 0%, transparent 100%);
}
.driver-head-title {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.driver-head-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  margin-top: 4px;
}
.driver-body {
  padding: 14px 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}

.driver-status {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.driver-status .lang-flag {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  display: grid; place-items: center;
  font-size: 16px;
  flex: none;
}
.driver-status .lang-flag.empty {
  background: repeating-linear-gradient(45deg, var(--line) 0 2px, transparent 2px 6px);
}
.driver-status-text { line-height: 1.25; }
.driver-status-label {
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.driver-status-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
}

.driver-bubble {
  position: relative;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg);
}
.driver-bubble.incoming {
  background: linear-gradient(180deg, oklch(96% 0.03 220) 0%, oklch(94% 0.04 218) 100%);
  border-color: oklch(86% 0.05 215);
  color: var(--sea-900);
}
[data-theme="dark"] .driver-bubble.incoming {
  background: linear-gradient(180deg, oklch(32% 0.05 222) 0%, oklch(28% 0.06 222) 100%);
  border-color: var(--sea-700);
  color: var(--shell);
}
.bubble-meta {
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.bubble-meta .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--terra-600);
  box-shadow: 0 0 0 0 var(--terra-600);
  animation: pulse 1.6s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(58% 0.14 40 / .5); }
  100% { box-shadow: 0 0 0 8px oklch(58% 0.14 40 / 0); }
}

.driver-tip {
  font-size: 11.5px;
  color: var(--fg-mute);
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line-2);
}

/* ─── Notes / framing ─── */
.notes {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  max-width: 900px;
}
.notes h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--fg);
  font-weight: 400;
}
.notes p { margin: 6px 0; }
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 12px;
}
.notes-grid > div {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.notes-grid h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
  font-weight: 600;
}
.notes-grid p { font-size: 12px; color: var(--fg-soft); }

/* ─── Tablet scene base ─── */
.scene {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .45s var(--ease);
  pointer-events: none;
}
.scene[data-active="true"] {
  opacity: 1;
  pointer-events: auto;
}

/* gentle entrance for content blocks */
.fade-in {
  animation: fadeIn .55s var(--ease) both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.slide-up {
  animation: slideUp .55s var(--ease) both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Status bar (top of tablet UI) ─── */
.statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 36px;
  padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  z-index: 5;
}
.statusbar .left, .statusbar .right { display: flex; gap: 12px; align-items: center; }
.statusbar .brand-mini {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--fg-soft);
  letter-spacing: 0.01em;
}
.signal { display: inline-flex; gap: 2px; align-items: end; }
.signal i { display: block; width: 3px; background: var(--fg-mute); border-radius: 1px; }
.signal i:nth-child(1) { height: 4px; }
.signal i:nth-child(2) { height: 7px; }
.signal i:nth-child(3) { height: 10px; }
.signal i:nth-child(4) { height: 13px; opacity: .35; }

/* ─── Welcome scene ─── */
.welcome {
  position: absolute; inset: 36px 0 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 5% 4%;
}
.welcome.v2 {
  grid-template-columns: minmax(240px, 32%) 1fr;
  gap: 4%;
  padding: 2% 5% 3% 4%;
}
.welcome-portrait {
  min-width: 0;
  height: 100%;
  display: grid;
  place-items: center;
}
.welcome-portrait .portrait-hero {
  width: min(100%, 320px);
  height: auto;
  aspect-ratio: 4 / 5;
  max-height: 100%;
}
.welcome-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.welcome-actions { margin-top: 4px; }
.welcome-left {
  display: flex; flex-direction: column;
  gap: 18px;
  padding-left: 2%;
}
.welcome-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--fg);
  font-weight: 400;
  margin: 0;
}
.welcome-title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--sea-700), var(--terra-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.welcome-sub {
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg-soft);
  max-width: 38ch;
}
.welcome-sub.alt {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--fg-mute);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.welcome-right {
  display: grid;
  align-self: center;
  justify-self: center;
}

/* ─── Language grid ─── */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 480px;
}
.lang-btn {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all .18s var(--ease);
  color: var(--fg);
}
.lang-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 18px -10px var(--accent);
}
.lang-btn.active {
  background: var(--ink);
  color: var(--shell);
  border-color: var(--ink);
}
.lang-flag-lg {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  display: grid; place-items: center;
  font-size: 22px;
  line-height: 1;
}
.lang-name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-align: center;
}
.lang-native {
  font-size: 10.5px;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  line-height: 1;
}
.lang-btn.active .lang-native { color: oklch(72% 0.012 80); }

/* ─── Conversation / translation overlay ─── */
.convo {
  position: absolute; inset: 36px 0 0 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 16px 5%;
}
.convo-stack {
  display: flex; flex-direction: column; gap: 18px;
  align-items: center;
  width: 100%;
}

.speaker-card {
  width: min(620px, 80%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex; gap: 14px;
  align-items: center;
  box-shadow: 0 12px 30px -22px rgba(0,0,0,.2);
}
.speaker-card.passenger {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}
.speaker-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  font-family: var(--font-display);
  font-size: 18px;
  background: var(--bg-2);
  color: var(--fg-soft);
  border: 1px solid var(--line);
}
.speaker-avatar.driver {
  background: linear-gradient(135deg, var(--terra-500), var(--terra-700));
  color: white;
}
.speaker-avatar.guest {
  background: linear-gradient(135deg, var(--sea-500), var(--sea-800));
  color: white;
}
.speaker-meta { line-height: 1.3; flex: 1; min-width: 0; }
.speaker-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.speaker-line {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.15;
  color: var(--fg);
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.speaker-line-alt {
  font-size: 13px;
  color: var(--fg-mute);
  margin-top: 4px;
  font-style: italic;
}

.convo-arrow {
  display: grid; place-items: center;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.convo-arrow .line {
  width: 1px; height: 18px; background: var(--line); margin: 4px auto;
}

/* ─── Ride: main + map ─── */
.ride {
  position: absolute; inset: 36px 0 0 0;
}

/* avatar stage common */
.avatar-stage {
  position: absolute;
  display: grid; place-items: center;
  transition: all .65s var(--ease);
}
.avatar-stage.full {
  inset: 0 0 0 0;
}

/* Variation A: Companion (default) — avatar centered, map floating */
.ride[data-layout="companion"] .avatar-stage { inset: 0 0 0 0; }
.ride[data-layout="companion"] .ride-map {
  position: absolute;
  right: 4%;
  bottom: 5%;
  width: 30%;
  aspect-ratio: 4/3;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 18px 40px -14px rgba(0,0,0,.45);
  cursor: pointer;
  transition: all .35s var(--ease);
  background: var(--surface);
}
.ride[data-layout="companion"] .ride-map:hover { transform: translateY(-3px); }

/* Variation B: Split */
.ride[data-layout="split"] .avatar-stage {
  inset: 0 50% 0 0;
}
.ride[data-layout="split"] .ride-map {
  position: absolute;
  inset: 0 0 0 50%;
  cursor: pointer;
  border-left: 1px solid var(--line);
}

/* Variation C: Stage (avatar large, floating dock bottom with mini map) */
.ride[data-layout="stage"] .avatar-stage { inset: 0 0 110px 0; }
.ride[data-layout="stage"] .ride-dock {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -18px rgba(0,0,0,.25);
}
.ride[data-layout="stage"] .ride-map {
  width: 180px; aspect-ratio: 4/2.6;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
}

/* Swapped: map full, avatar small */
.ride[data-swap="true"] .avatar-stage {
  inset: auto 4% 5% auto;
  width: 22%; aspect-ratio: 1/1;
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 14px 30px -14px rgba(0,0,0,.5);
  overflow: hidden;
  display: grid; place-items: center;
  z-index: 4;
}
.ride[data-swap="true"] .ride-map {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 1;
}
.ride[data-swap="true"] .ride-dock { display: none !important; }

/* ─── Ride HUD ─── */
.ride-hud {
  position: absolute;
  top: 12px; left: 18px; right: 18px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 6;
  pointer-events: none;
}
.ride-hud > * { pointer-events: auto; }

.hud-pill {
  display: inline-flex;
  align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: oklch(98% 0.01 80 / .85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,.06);
  font-size: 12px;
  color: var(--fg);
  font-weight: 500;
  box-shadow: 0 6px 14px -8px rgba(0,0,0,.2);
}
[data-theme="dark"] .hud-pill {
  background: oklch(28% 0.04 232 / .7);
  border-color: rgba(255,255,255,.08);
  color: var(--shell);
}
.hud-pill .lang-flag-sm {
  width: 18px; height: 18px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  display: grid; place-items: center;
  font-size: 11px;
}
.hud-pill .meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  text-transform: uppercase;
}

.hud-right {
  display: flex; gap: 8px;
}

/* ─── Avatar (Portrait — live video frame) ─── */
.portrait {
  position: relative;
  display: grid;
  place-items: center;
}
.portrait-hero {
  width: 44%;
  max-width: 420px;
  aspect-ratio: 4 / 5;
}
.portrait-sm {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
.portrait-stage {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(160deg, oklch(86% 0.06 60), oklch(68% 0.09 40));
  box-shadow:
    0 30px 80px -28px rgba(0,0,0,.45),
    0 6px 14px -8px rgba(0,0,0,.25),
    inset 0 0 0 1px rgba(255,255,255,.1);
  isolation: isolate;
}
.portrait-sm .portrait-stage { border-radius: 20px; }

.portrait-stage .portrait-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  z-index: 1;
  display: block;
  user-select: none;
}

/* Warm key light + cool rim — sits above the image */
.portrait-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 70% at 22% 18%, oklch(96% 0.08 80 / .12) 0%, transparent 55%),
    radial-gradient(80% 60% at 100% 100%, oklch(46% 0.10 232 / .10) 0%, transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 2;
}
.portrait-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 110% at 50% 50%, transparent 60%, rgba(0,0,0,.22) 100%);
  pointer-events: none;
  z-index: 3;
}
.portrait-grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .08;
  mix-blend-mode: overlay;
  background-image:
    repeating-radial-gradient(circle at 33% 47%, rgba(255,255,255,.5) 0 .5px, transparent 1px 3px),
    repeating-radial-gradient(circle at 77% 21%, rgba(255,255,255,.4) 0 .5px, transparent 1px 4px);
  z-index: 4;
}

/* Speaking gives the frame a subtle warm glow */
.portrait.is-speaking .portrait-stage {
  box-shadow:
    0 30px 80px -28px oklch(58% 0.14 40 / .7),
    0 6px 14px -8px rgba(0,0,0,.3),
    inset 0 0 0 1px oklch(78% 0.12 60 / .35);
  animation: portraitGlow 3s var(--ease) infinite;
}
@keyframes portraitGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.04); }
}

/* Listening rings — soft pulses at portrait edges */
.portrait-rings {
  position: absolute; inset: -2%;
  border-radius: 32px;
  pointer-events: none;
  z-index: 5;
}
.portrait-rings i {
  position: absolute; inset: 0;
  border-radius: 32px;
  border: 1.5px solid oklch(72% 0.14 80 / .55);
  opacity: 0;
}
.portrait.is-listening .portrait-rings i {
  animation: pRing 2.2s var(--ease) infinite;
}
.portrait.is-listening .portrait-rings i:nth-child(2) { animation-delay: .55s; }
.portrait.is-listening .portrait-rings i:nth-child(3) { animation-delay: 1.1s; }
@keyframes pRing {
  0% { opacity: .8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}

/* LIVE badge */
.portrait-badge {
  position: absolute;
  top: 12px; left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: white;
  z-index: 6;
}
.portrait-sm .portrait-badge { padding: 3px 7px; font-size: 8px; gap: 4px; }
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: oklch(64% 0.18 28);
  box-shadow: 0 0 0 0 oklch(64% 0.18 28 / .8);
  animation: liveDot 1.4s var(--ease) infinite;
}
@keyframes liveDot {
  0% { box-shadow: 0 0 0 0 oklch(64% 0.18 28 / .8); }
  100% { box-shadow: 0 0 0 6px oklch(64% 0.18 28 / 0); }
}

/* Identity card (top-right) */
.portrait-identity {
  position: absolute;
  top: 12px; right: 12px;
  text-align: right;
  z-index: 6;
  color: white;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.ident-name {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.005em;
  font-style: italic;
}
.ident-role {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: .8;
  margin-top: 3px;
}

/* Audio waveform — at the bottom of the portrait, only animates when speaking */
.portrait-wave {
  position: absolute;
  left: 14px; right: 14px;
  bottom: 14px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  height: 26px;
  z-index: 6;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.portrait-sm .portrait-wave {
  left: 8px; right: 8px; bottom: 8px;
  height: 14px;
  gap: 2px;
}
.portrait.is-speaking .portrait-wave { opacity: 1; }
.portrait-wave i {
  display: block;
  flex: 1;
  height: 22%;
  max-width: 4px;
  background: oklch(96% 0.02 80);
  border-radius: 2px;
  opacity: .9;
  box-shadow: 0 0 8px oklch(96% 0.02 80 / .35);
}
.portrait.is-speaking .portrait-wave i {
  animation: wave 1.1s var(--ease) infinite;
}
@keyframes wave {
  0%, 100% { height: 18%; }
  20% { height: 75%; }
  40% { height: 38%; }
  60% { height: 90%; }
  80% { height: 28%; }
}

/* Placeholder (image-slot empty state) — match cinematic tone */
.portrait-stage image-slot {
  /* let the slot's shadow DOM handle empty-state, just ensure it looks ok */
}


/* Avatar caption (subtitle below) */
.avatar-caption {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  width: min(82%, 720px);
  text-align: center;
  pointer-events: none;
}
.ride[data-layout="stage"] .avatar-caption { bottom: 4%; }
.caption-line {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.005em;
  color: var(--fg);
  margin-bottom: 6px;
}
.caption-alt {
  font-size: 13px;
  color: var(--fg-mute);
  font-style: italic;
  font-family: var(--font-display);
}

/* ─── Stylized map ─── */
.map-canvas {
  position: relative;
  width: 100%; height: 100%;
  background:
    radial-gradient(120% 80% at 50% 110%, oklch(92% 0.04 220) 0%, oklch(88% 0.05 215) 60%, oklch(85% 0.06 215) 100%);
  overflow: hidden;
}
[data-theme="dark"] .map-canvas {
  background:
    radial-gradient(120% 80% at 50% 110%, oklch(32% 0.05 222) 0%, oklch(26% 0.04 230) 60%, oklch(22% 0.04 232) 100%);
}
.map-roads { position: absolute; inset: 0; }
.map-route {
  fill: none;
  stroke: var(--terra-600);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 oklch(48% 0.13 38));
  stroke-dasharray: 6 4;
  animation: routeDash 12s linear infinite;
}
@keyframes routeDash {
  to { stroke-dashoffset: -200; }
}
.map-pin {
  position: absolute;
  width: 22px; height: 22px;
  transform: translate(-50%, -100%);
}
.map-pin svg { display: block; }
.map-coast {
  fill: oklch(78% 0.10 220);
  opacity: .85;
}
[data-theme="dark"] .map-coast { fill: oklch(40% 0.10 222); }
.map-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ride[data-layout="companion"] .map-label { font-size: 9px; }
.ride[data-swap="true"] .map-label { font-size: 11px; }

.map-eta {
  position: absolute;
  top: 10px; left: 10px;
  display: flex; gap: 8px; align-items: center;
  background: oklch(98% 0.01 80 / .9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid rgba(0,0,0,.06);
}
[data-theme="dark"] .map-eta { background: oklch(28% 0.04 232 / .85); color: var(--shell); border-color: rgba(255,255,255,.08); }
.map-eta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--terra-600); }

/* ─── Curiosity card ─── */
.poi-card {
  position: absolute;
  left: 4%; bottom: 7%;
  width: 38%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.4);
  z-index: 7;
}
.poi-img {
  height: 110px;
  background:
    repeating-linear-gradient(45deg, oklch(82% 0.06 220) 0 12px, oklch(78% 0.07 220) 12px 24px);
  position: relative;
}
.poi-img::after {
  content: 'IMAGEN DEL LUGAR';
  position: absolute;
  bottom: 8px; left: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: oklch(40% 0.06 220);
}
.poi-content { padding: 12px 14px 14px; }
.poi-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.poi-title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 3px 0 6px;
  color: var(--fg);
}
.poi-blurb {
  font-size: 12.5px;
  color: var(--fg-soft);
  line-height: 1.4;
}

/* ─── Promo card with QR ─── */
.promo-card {
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  width: 38%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -22px rgba(0,0,0,.4);
  z-index: 7;
}
.promo-head {
  padding: 14px 16px 10px;
  background: linear-gradient(135deg, var(--terra-500), var(--terra-700));
  color: white;
}
.promo-head .promo-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: .8;
}
.promo-head .promo-title {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-top: 2px;
}
.promo-body {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.promo-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg-soft);
}
.promo-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--terra-700);
  text-transform: uppercase;
  margin-top: 8px;
  font-weight: 600;
}
[data-theme="dark"] .promo-cta { color: var(--terra-400); }

.qr {
  width: 96px; height: 96px;
  background: var(--ink);
  padding: 8px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(11, 1fr);
  gap: 1px;
}
.qr i {
  background: transparent;
  border-radius: 1px;
}
.qr i.on { background: var(--shell); }
.qr.animating i { opacity: 0; animation: qrIn .6s var(--ease) both; }

@keyframes qrIn {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: scale(1); }
}

.promo-foot {
  padding: 8px 14px 14px;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin: 0 14px;
}

/* ─── Mic / control bar ─── */
.mic-bar {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  background: oklch(98% 0.01 80 / .9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 999px;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.4);
  z-index: 6;
}
[data-theme="dark"] .mic-bar {
  background: oklch(28% 0.04 232 / .85); border-color: rgba(255,255,255,.08);
}
.mic-label {
  font-size: 12px; color: var(--fg-soft);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mic-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--shell);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.live {
  background: var(--terra-600);
  box-shadow: 0 0 0 0 var(--terra-600), 0 8px 18px -8px var(--terra-700);
  animation: micPulse 1.3s var(--ease) infinite;
}
@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 oklch(58% 0.14 40 / .55); }
  100% { box-shadow: 0 0 0 16px oklch(58% 0.14 40 / 0); }
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg-soft);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.icon-btn:hover { background: var(--bg-2); color: var(--fg); }
.icon-btn.active {
  background: var(--ink); color: var(--shell); border-color: var(--ink);
}

/* ─── Caption styles for ride scene ─── */
.subtitle-pair {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  width: min(80%, 720px);
  text-align: center;
}
.ride[data-layout="stage"] .subtitle-pair { bottom: 18%; }
.subtitle-primary {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--fg);
}
.subtitle-secondary {
  font-size: 13px;
  color: var(--fg-mute);
  font-style: italic;
  font-family: var(--font-display);
  margin-top: 6px;
}

/* ─── helper utilities ─── */
.muted { color: var(--fg-mute); }
.muted-line { opacity: .45; font-style: italic; }
.row { display: flex; gap: 10px; align-items: center; }

/* ─── Floating controls panel (mute + volume + brightness) ─── */
.ctrl-panel {
  position: absolute;
  top: 44px;
  left: 14px;
  z-index: 60;
  display: flex;
  gap: 6px;
}
.ctrl-btn {
  appearance: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.06);
  background: oklch(98% 0.01 80 / .92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--fg);
  box-shadow: 0 6px 14px -8px rgba(0,0,0,.2);
  transition: all .15s var(--ease);
}
[data-theme="dark"] .ctrl-btn {
  background: oklch(28% 0.04 232 / .85);
  border-color: rgba(255,255,255,.08);
  color: var(--shell);
}
.ctrl-btn:hover { background: var(--surface); }
.ctrl-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 60px -22px rgba(0,0,0,.4);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ctrl-sect {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ctrl-lbl {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.ctrl-val {
  color: var(--accent);
  font-weight: 600;
}
.ctrl-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-mute);
}
.ctrl-slider-row input[type="range"] {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.ctrl-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px -2px rgba(0,0,0,.3);
}
.ctrl-slider-row input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px -2px rgba(0,0,0,.3);
}

/* ─── Side-by-side layout: avatar half + content card half ─── */
.ride[data-half="right"] .avatar-stage {
  inset: 0 0 0 50% !important;
}
/* In POI/Promo scenes, hide the map entirely — the focus is the content card. */
.ride[data-half="right"] .ride-map {
  display: none !important;
}
/* Content cards on left when avatar is on right */
.ride[data-half="right"] .poi-card,
.ride[data-half="right"] .promo-card {
  left: 4% !important;
  right: auto !important;
  top: auto !important;
  bottom: 8% !important;
  transform: none !important;
  width: 42% !important;
  max-width: 420px;
}

/* ─── Floating language switcher (overlay on every scene from #2 onwards) ─── */
.lang-switcher {
  position: absolute;
  top: 44px; right: 14px;
  z-index: 60;
}
.lang-switch-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: oklch(98% 0.01 80 / .92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,.06);
  cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(0,0,0,.25);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
[data-theme="dark"] .lang-switch-btn {
  background: oklch(28% 0.04 232 / .85);
  border-color: rgba(255,255,255,.08);
  color: var(--shell);
}
.lang-switch-btn:hover { background: var(--surface); border-color: var(--line-2); }
.lang-switch-label { font-weight: 600; }
.lang-flag-circle {
  width: 22px; height: 22px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-block;
  flex: none;
  background: var(--bg-2);
}
.lang-flag-circle > img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.lang-switch-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 60px -22px rgba(0,0,0,.4);
}
.lsp-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 10px;
}
.lsp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.lang-switch-item {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--fg);
  transition: all .15s var(--ease);
}
.lang-switch-item:hover { background: var(--bg-2); border-color: var(--line-2); }
.lang-switch-item.active { background: var(--ink); color: var(--shell); border-color: var(--ink); }

/* ─── Conversation scene additions ─── */
.convo-header {
  margin-bottom: 4px;
}
.convo-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.convo-title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-top: 4px;
}
.convo-turn {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.turn-translation {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding-left: 56px;
  font-size: 12px;
  color: var(--fg-mute);
  line-height: 1.35;
  font-family: var(--font-body);
}
.tt-arrow { color: var(--accent-2); font-size: 13px; }
.tt-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  flex: none;
}
.tt-text { color: var(--fg-soft); font-style: italic; }
.convo-mic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px dashed var(--line-2);
  margin-top: 6px;
}
.convo-mic-row .mic-btn {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--shell);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.convo-mic-row .mic-btn:hover { transform: scale(1.05); }
.convo-mic-row .mic-btn.live {
  background: var(--terra-600);
  animation: micPulse 1.3s var(--ease) infinite;
}
.convo-mic-text { line-height: 1.4; }
.mic-strong { font-size: 13px; color: var(--fg); font-weight: 500; }
.mic-sub { font-size: 11.5px; color: var(--fg-mute); margin-top: 2px; }

/* ─── POI next button + progress dots ─── */
.poi-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.poi-next {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all .15s var(--ease);
}
.poi-next:hover { background: var(--ink); color: var(--shell); border-color: var(--ink); }
.poi-progress {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.pp-dot {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  transition: all .25s var(--ease);
}
.pp-dot.on { background: var(--accent); width: 28px; }

/* ─── Flag rendering — circular crop around flagcdn SVG ─── */
.flag,
.lang-flag,
.lang-flag-lg,
.lang-flag-sm,
.driver-status .lang-flag,
.hud-pill .lang-flag-sm {
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  display: inline-block;
  flex: none;
  position: relative;
}
.flag > img,
.lang-flag > img,
.lang-flag-lg > img,
.lang-flag-sm > img,
.driver-status .lang-flag > img,
.hud-pill .lang-flag-sm > img,
.speaker-avatar.guest > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.flag {
  width: 24px;
  height: 24px;
}
.speaker-avatar.guest {
  overflow: hidden;
  padding: 0;
}
.speaker-avatar.guest .flag {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: transparent;
}

/* ─── Play (greeting) button ─── */
.play-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.play-btn:hover {
  background: var(--ink);
  color: var(--shell);
  border-color: var(--ink);
}
.play-btn .pb-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--shell);
  display: grid; place-items: center;
}
.play-btn:hover .pb-icon {
  background: var(--terra-600);
}
.play-btn.live {
  background: var(--terra-600);
  color: white;
  border-color: var(--terra-600);
}
.play-btn.live .pb-icon {
  background: white;
  color: var(--terra-700);
}

/* ─── Conversation v2 (driver↔passenger with portrait on side) ─── */
.convo.v2 {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 30%);
  gap: 4%;
  padding: 2% 4% 3%;
  align-items: center;
}
.convo-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.convo-portrait {
  min-width: 0;
  height: 100%;
  display: grid;
  place-items: center;
}
.convo-portrait .portrait-hero {
  width: min(100%, 300px);
  height: auto;
  aspect-ratio: 4 / 5;
  max-height: 100%;
}
.convo-actions { padding-top: 6px; }
.convo .speaker-card { width: 100%; max-width: 100%; }
.convo .convo-arrow {
  flex-direction: row;
  justify-self: start;
  display: flex; align-items: center;
  gap: 10px;
  padding-left: 4px;
}
.convo .convo-arrow .line {
  width: 32px; height: 1px; margin: 0;
}

/* ─── Monologue (seatbelt-style scenes) ─── */
.monologue {
  position: absolute; inset: 36px 0 0 0;
  display: grid;
  grid-template-columns: minmax(240px, 34%) 1fr;
  gap: 4%;
  padding: 2% 5% 3% 4%;
  align-items: center;
}
.monologue-portrait {
  min-width: 0;
  height: 100%;
  display: grid;
  place-items: center;
}
.monologue-portrait .portrait-hero {
  width: min(100%, 320px);
  height: auto;
  aspect-ratio: 4 / 5;
  max-height: 100%;
}
.monologue-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.mono-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.mono-line {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--fg);
}
.mono-line-alt {
  font-size: 14px;
  color: var(--fg-mute);
  font-style: italic;
  font-family: var(--font-display);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  max-width: 50ch;
}
.mono-actions { margin-top: 4px; }

/* ─── Ride caption (bottom subtitle area, between mic-bar and content) ─── */
.ride-caption {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  width: min(70%, 720px);
  text-align: center;
  z-index: 5;
  pointer-events: none;
}
.ride[data-layout="stage"] .ride-caption { bottom: 165px; }
.ride-caption .cap-line {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--fg);
  text-shadow: 0 1px 12px var(--bg);
  margin-bottom: 4px;
}
.ride-caption .cap-line-alt {
  font-size: 12px;
  color: var(--fg-mute);
  font-style: italic;
  font-family: var(--font-display);
}
.ride-caption .cap-actions {
  margin-top: 8px;
  pointer-events: auto;
  display: inline-flex;
}

/* POI play button row */
.poi-actions { margin-top: 8px; display: flex; }

/* ─── Sleek dark-friendly portrait override ─── */
[data-theme="dark"] .portrait-stage {
  background:
    radial-gradient(120% 70% at 50% 0%, oklch(64% 0.08 60) 0%, transparent 55%),
    radial-gradient(140% 90% at 50% 100%, oklch(28% 0.06 28) 0%, oklch(20% 0.04 28) 60%, oklch(16% 0.03 28) 100%);
}

/* ─── Welcome / convo small refinements ─── */
.welcome-portrait, .convo-portrait, .monologue-portrait {
  min-width: 0;
  min-height: 0;
}
.welcome-content, .convo-side, .monologue-body { min-width: 0; }

/* ─── D-ID connecting overlay ─── */
.did-connecting {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 8;
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.did-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: var(--terra-400);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.live-dot--pending {
  background: oklch(72% 0.10 80);
  box-shadow: 0 0 0 0 oklch(72% 0.10 80 / .8);
  animation: pulsePending 1.8s ease infinite;
}
@keyframes pulsePending {
  0%   { box-shadow: 0 0 0 0 oklch(72% 0.10 80 / .6); }
  100% { box-shadow: 0 0 0 8px oklch(72% 0.10 80 / 0); }
}

/* ─── Avatar CSS animations (no D-ID required) ─────────────────────────────

   Three states:
   • idle     → breathing pulse + slow eye-blink
   • speaking → head sway + scale breathe + waveform + mouth glow
   • listening → tilt + ring pulses (already defined above)
*/

/* 1. Idle breathing — very subtle, shows Leo is "alive" */
.portrait-photo {
  transform-origin: 50% 40%;   /* pivot near eyes, not center */
  animation: avatarBreathe 4.2s ease-in-out infinite;
}
@keyframes avatarBreathe {
  0%, 100% { transform: scale(1)    translateY(0);    }
  40%       { transform: scale(1.009) translateY(-1px); }
  70%       { transform: scale(1.005) translateY(-0.5px); }
}

/* ─── Kiosk mode — passenger-only fullscreen view ─── */
body.kiosk-mode {
  overflow: hidden;
  background: var(--bg);
}
body.kiosk-mode .page-head,
body.kiosk-mode .scene-nav,
body.kiosk-mode .notes,
body.kiosk-mode .driver-panel,
body.kiosk-mode .brand-sub { display: none !important; }

body.kiosk-mode .stage {
  display: block !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}
body.kiosk-mode .tablet-wrap {
  display: block !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
}
body.kiosk-mode .tablet {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}
body.kiosk-mode .tablet-screen {
  border-radius: 0 !important;
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  inset: 0 !important;
}

/* 2. Speaking — head sway + scale pulse (lip-sync illusion) */
.portrait.is-speaking .portrait-photo {
  animation:
    avatarSpeak  0.38s ease-in-out infinite alternate,
    avatarScalePulse 0.76s ease-in-out infinite;
}
@keyframes avatarSpeak {
  0%   { transform: translateX(-1.5px) translateY(-1px) rotate(-0.4deg) scale(1.01); }
  100% { transform: translateX(1.5px)  translateY(-2px) rotate( 0.4deg) scale(1.018); }
}
@keyframes avatarScalePulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.06); }
}

/* 3. Mouth-area glow when speaking (warm light at lower-face zone) */
.portrait-mouth-glow {
  position: absolute;
  left: 20%; right: 20%;
  bottom: 28%; height: 14%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    oklch(80% 0.18 50 / .45) 0%,
    transparent 70%);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.portrait.is-speaking .portrait-mouth-glow { opacity: 1; }

/* 4. Listening — slight head tilt toward driver */
.portrait.is-listening .portrait-photo {
  animation: avatarListen 0.4s var(--ease-spring) forwards;
}
@keyframes avatarListen {
  to { transform: rotate(-1.5deg) translateX(-3px) scale(1.01); }
}

/* 5. Waveform — taller bars + color shift when speaking */
.portrait.is-speaking .portrait-wave i {
  animation: wave 0.55s ease-in-out infinite;   /* faster than default */
  background: oklch(90% 0.12 55);               /* warm gold */
  box-shadow: 0 0 6px oklch(80% 0.14 50 / .5);
}
@keyframes wave {
  0%, 100% { transform: scaleY(.18); opacity: .5; }
  50%       { transform: scaleY(1);   opacity: 1;  }
}

/* 6. Speaking glow on frame — more expressive than before */
.portrait.is-speaking .portrait-stage {
  box-shadow:
    0 0 0 2px oklch(78% 0.14 50 / .3),
    0 24px 60px -20px oklch(58% 0.16 40 / .8),
    0 6px 14px -8px rgba(0,0,0,.3);
  animation: speakFrame 0.76s ease-in-out infinite;
}
@keyframes speakFrame {
  0%, 100% { box-shadow:
    0 0 0 2px oklch(78% 0.14 50 / .2),
    0 24px 60px -20px oklch(58% 0.16 40 / .6),
    0 6px 14px -8px rgba(0,0,0,.3); }
  50% { box-shadow:
    0 0 0 2px oklch(78% 0.14 50 / .45),
    0 30px 80px -20px oklch(58% 0.16 40 / .9),
    0 6px 14px -8px rgba(0,0,0,.3); }
}

/* ══════════════════════════════════════════════════════════
   REDESIGNED POI (Curiosidades) — full-panel split layout
   ══════════════════════════════════════════════════════════ */
.poi-full {
  position: absolute;
  inset: 36px 0 0 0;
  display: grid;
  grid-template-columns: 1fr 34%;
  align-items: stretch;
}
.poi-content-side {
  padding: 14px 0 14px 14px;
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.poi-avatar-side {
  min-width: 0;
  display: grid;
  place-items: center;
}

.poi-card-v2 {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 60px -24px rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
}

/* Hero image area — 45% of card height */
.poi-hero {
  position: relative;
  height: 46%;
  flex-shrink: 0;
  overflow: hidden;
}
.poi-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.poi-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.72) 0%,
    rgba(0,0,0,.28) 45%,
    rgba(0,0,0,.08) 100%
  );
}
.poi-hero-icon {
  position: absolute;
  top: 16px; left: 18px;
  font-size: 32px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
  z-index: 2;
}
.poi-hero-text {
  position: absolute;
  bottom: 16px; left: 20px; right: 20px;
  z-index: 2;
  color: white;
}
.poi-hero-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: 5px;
}
.poi-hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
}

/* Body — blurb + controls */
.poi-body-v2 {
  padding: 18px 22px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
  min-height: 0;
}
.poi-blurb-v2 {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-soft);
  flex: 1;
  margin: 0;
}
.poi-footer-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 8px;
}
.poi-progress-v2 {
  display: flex;
  gap: 6px;
  align-items: center;
}
.poi-controls-v2 {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ══════════════════════════════════════════════════════════
   REDESIGNED PROMO / QR — full-panel split layout
   ══════════════════════════════════════════════════════════ */
.promo-full {
  position: absolute;
  inset: 36px 0 0 0;
  display: grid;
  grid-template-columns: 1fr 34%;
  align-items: stretch;
}
.promo-content-side {
  padding: 14px 0 14px 14px;
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.promo-avatar-side {
  min-width: 0;
  display: grid;
  place-items: center;
}

.promo-card-v2 {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 60px -24px rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
}

/* Hero banner — merchant branding */
.promo-hero-v2 {
  position: relative;
  height: 40%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--terra-500) 0%, var(--terra-700) 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 24px 18px;
}
.promo-hero-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 90% 10%,  oklch(80% 0.10 70 / .30) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 10% 90%,  oklch(40% 0.14 20 / .45) 0%, transparent 50%),
    repeating-linear-gradient(
      -45deg,
      transparent 0, transparent 18px,
      rgba(255,255,255,.03) 18px, rgba(255,255,255,.03) 19px
    );
}
.promo-merchant-badge {
  position: absolute;
  top: 16px; right: 18px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  color: white;
  text-transform: uppercase;
  z-index: 2;
}
.promo-hero-kind-v2 {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
  margin-bottom: 6px;
}
.promo-hero-title-v2 {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 46px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: white;
  text-shadow: 0 2px 16px rgba(0,0,0,.2);
}

/* Body — text column + QR column */
.promo-body-v2 {
  padding: 20px 22px 16px;
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 22px;
  align-items: start;
  flex: 1;
}
.promo-text-col { display: flex; flex-direction: column; gap: 10px; }
.promo-text-v2 {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-soft);
  margin: 0;
}
.promo-cta-v2 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--terra-700);
  text-transform: uppercase;
  font-weight: 700;
}
[data-theme="dark"] .promo-cta-v2 { color: var(--terra-400); }

/* QR panel */
.promo-qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}
.qr-v2 {
  width: 148px;
  height: 148px;
  background: var(--ink);
  padding: 11px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(11, 1fr);
  gap: 2px;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.35);
}
.qr-v2 i { background: transparent; border-radius: 2px; }
.qr-v2 i.on { background: var(--shell); }
.qr-v2.animating i { opacity: 0; animation: qrIn .5s var(--ease) both; }
.qr-hint {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  text-align: center;
  line-height: 1.4;
}

/* Footer */
.promo-foot-v2 {
  margin: 0 22px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

