/* ============================================================
   VoyaAI 2.0 — Premium Travel Companion
   Refined Luxury · Warm Cream & Gold · Mobile-First

   Brand: Matches VoyaAI PDF corporate identity exactly
   Primary: #1B3A4B (dark teal)
   Gold: #C9A14A (warm gold)
   Cream: #EDE8DF (warm paper)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300&display=swap');

:root {
  /* ── Brand Palette (from PDF template) ── */
  --teal: #1B3A4B;
  --teal-mid: #385D73;
  --gold: #C9A14A;
  --gold-light: #D4B85C;
  --gold-dim: rgba(201, 161, 74, 0.12);
  --gold-glow: rgba(201, 161, 74, 0.25);
  --cream: #EDE8DF;
  --cream-dark: #E2DCD2;
  --warm-white: #F7F5F0;
  --paper: #FDFAF3;

  /* ── Functional Colors ── */
  --success: #1D9E75;
  --success-bg: #F0FAF5;
  --error: #C0392B;
  --error-bg: #FDF0F0;

  /* ── Dark Mode (Map view) ── */
  --dark-base: #0F1923;
  --dark-surface: #162230;
  --dark-card: rgba(22, 34, 48, 0.92);
  --dark-glass: rgba(15, 25, 35, 0.88);
  --dark-border: rgba(201, 161, 74, 0.12);
  --dark-text: #E8E6E1;
  --dark-text-dim: #7A8B96;

  /* ── Spacing & Shape ── */
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 5px;
  --blur: 20px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --transition: 0.35s var(--ease);

  /* ── Typography ── */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
  height: 100%; height: 100dvh;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--dark-base);
  color: var(--dark-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LAYOUT
   ============================================================ */

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: relative;
}

/* ============================================================
   MAP
   ============================================================ */

#map-container {
  flex: 1;
  position: relative;
  min-height: 0;
}

#map { width: 100%; height: 100%; }

/* Subtle vignette over map edges */
#map-container::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(15,25,35,0.3) 100%);
  z-index: 1;
}

#map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* ── POI Label (floating on map) ── */
#poi-label {
  position: absolute;
  top: max(env(safe-area-inset-top, 12px), 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--dark-glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--dark-border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 10px 24px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.3px;
  opacity: 0;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: auto;
  max-width: 85%;
  text-align: center;
}

#poi-label.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Map Buttons ── */
.map-btn {
  position: absolute;
  pointer-events: auto;
  background: var(--dark-glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  color: var(--dark-text-dim);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-btn:hover { border-color: var(--gold-glow); color: var(--gold); }
.map-btn:active { transform: scale(0.93); }

#gps-btn { top: 12px; left: 12px; width: 44px; height: 44px; z-index: 11; }
#back-btn { top: 12px; left: 64px; width: 44px; height: 44px; z-index: 11; }
#theme-btn { top: 12px; left: 116px; width: 44px; height: 44px; z-index: 11; }
#theme-btn.day { color: var(--gold); border-color: var(--gold-glow); }
#refresh-btn { top: 12px; left: 168px; width: 44px; height: 44px; z-index: 11; }
#gps-btn.active { color: var(--success); border-color: rgba(29,158,117,0.4); box-shadow: 0 0 12px rgba(29,158,117,0.15); }

/* Route-Info-Pille (goldene Kapsel, zentriert zwischen Karte und Controls) */
#route-info-banner {
  text-align: center;
  padding: 6px 0;
  background: transparent;
}
#route-info-banner span.rib-pill {
  display: inline-block;
  background: linear-gradient(135deg, #C9A14A, #A8853A);
  color: #fff;
  padding: 6px 22px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 12px rgba(201,161,74,0.35);
  max-width: 85vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#route-info-banner .rib-meta {
  font-weight: 500;
  opacity: 0.8;
  margin-left: 8px;
  font-size: 0.65rem;
}

/* Speed Controls — right side, compact on mobile */
#speed-controls {
  position: absolute;
  bottom: 12px; right: 12px;
  display: flex; gap: 3px;
  z-index: 11;
  pointer-events: auto;
}

.speed-btn {
  background: var(--dark-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-xs);
  color: var(--dark-text-dim);
  padding: 5px 9px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.speed-btn.active {
  color: var(--gold);
  border-color: var(--gold-glow);
  background: rgba(201,161,74,0.08);
}

@media (max-width: 600px) {
  #speed-controls { bottom: 6px; right: 6px; gap: 2px; }
  .speed-btn { padding: 3px 6px; font-size: 0.6rem; border-radius: 4px; }
}

/* Post-Route CTA pulse */
@keyframes ctaPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(201,161,74,0.4); } 50% { box-shadow: 0 0 0 8px rgba(201,161,74,0); } }
.cta-pulse { animation: ctaPulse 2s ease 3; }

/* ============================================================
   CONTROLS PANEL (Bottom Sheet — Dark with Gold accents)
   ============================================================ */

#controls {
  background: var(--dark-surface);
  border-top: 1px solid var(--dark-border);
  padding: 14px 16px max(env(safe-area-inset-bottom, 12px), 12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 44dvh;
  overflow-y: auto;
  transition: max-height 0.4s var(--ease);
  position: relative;
}

/* Gold accent line at top */
#controls::before {
  content: '';
  display: block;
  width: 32px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin: -2px auto 6px;
  opacity: 0.5;
}

#controls.collapsed { max-height: 120px; overflow: hidden; }

/* ── Now Playing ── */
#now-playing {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: none;
  animation: slideUp 0.4s var(--ease-out);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#now-playing.active { display: block; }

#now-playing-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

#now-playing-text {
  font-size: 0.82rem;
  color: var(--dark-text-dim);
  line-height: 1.55;
  max-height: 72px;
  overflow-y: auto;
  margin-bottom: 10px;
}

#progress-bar {
  width: 100%; height: 2px;
  background: rgba(201,161,74,0.1);
  border-radius: 1px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  width: 0%;
  transition: width 0.8s linear;
  border-radius: 1px;
}

/* ── Player Controls ── */
#player-controls {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  padding: 4px 0;
}

.player-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.player-btn-label {
  font-size: 0.62rem;
  color: var(--dark-text-dim);
  letter-spacing: 0.3px;
  text-align: center;
}

.player-btn {
  background: transparent;
  border: 1.5px solid var(--dark-border);
  border-radius: 50%;
  color: var(--dark-text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.player-btn:hover { border-color: var(--gold-glow); color: var(--gold); }
.player-btn:active { transform: scale(0.88); }

.player-btn.small { width: 38px; height: 38px; }

.player-btn.large {
  width: 54px; height: 54px;
  background: var(--gold);
  border: none;
  color: var(--teal);
  box-shadow: 0 4px 20px rgba(201,161,74,0.3);
}

.player-btn.large:hover {
  background: var(--gold-light);
  box-shadow: 0 6px 28px rgba(201,161,74,0.4);
  transform: scale(1.04);
}

.player-btn.large:active { transform: scale(0.95); }

/* ── Selectors ── */
#selectors {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

@media (max-width: 380px) {
  #selectors { grid-template-columns: 1fr 1fr; }
}

.selector-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dark-text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.selector-group select {
  width: 100%;
  padding: 11px 28px 11px 12px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  color: var(--dark-text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23C9A14A' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: border-color var(--transition);
}

.selector-group select:focus { outline: none; border-color: var(--gold); }

/* ── Credits (Elegant arc, not emojis) ── */
#credits-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

#credits-visual {
  display: flex;
  gap: 5px;
  align-items: center;
}

.credit-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  transition: all 0.4s var(--ease);
  opacity: 1;
}

.credit-dot.spent {
  background: rgba(201,161,74,0.15);
  opacity: 0.4;
}

#credits-bar.low .credit-dot:not(.spent) {
  animation: creditPulse 1.8s ease-in-out infinite;
  background: var(--error);
}

@keyframes creditPulse {
  0%, 100% { opacity: 1; box-shadow: none; }
  50% { opacity: 0.5; box-shadow: 0 0 6px rgba(192,57,43,0.4); }
}

#credits-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dark-text-dim);
  letter-spacing: 0.5px;
  margin-left: auto;
}

/* ── Status ── */
#status-bar {
  font-size: 0.78rem;
  color: var(--dark-text-dim);
  text-align: center;
  min-height: 1.1rem;
  transition: color 0.3s;
}

#status-bar.error { color: var(--error); }

/* Companion Status Indicator */
#companion-status {
  display: none;
  font-size: 0.7rem;
  color: var(--dark-text-dim);
  text-align: center;
  opacity: 0.6;
  transition: opacity 0.4s;
  padding-top: 2px;
}
#companion-status.active { display: block; }
#companion-status .cs-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
#companion-status .cs-dot.guiding { background: var(--gold); }
#companion-status .cs-dot.paused { background: var(--dark-text-dim); }
#companion-status .cs-dot.exploring { background: #5B8FA8; }
#companion-status .cs-dot.starting { background: var(--gold); animation: cs-pulse 1.2s ease infinite; }
#cs-progress { margin-left: 8px; opacity: 0.5; font-variant-numeric: tabular-nums; }
@keyframes cs-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Feedback Buttons */
.fb-rating-btn.selected { background: var(--gold) !important; border-color: var(--gold) !important; }
#fb-send:not(:disabled) { opacity: 1; }

/* Region Context Label */
#region-label {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(27,58,75,0.88);
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.6s ease;
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
#region-label .rl-sub {
  font-weight: 400;
  opacity: 0.7;
  margin-left: 6px;
  font-size: 0.68rem;
}
#region-label.visible { opacity: 1; }
#region-label.fading { opacity: 0; }

/* ============================================================
   ROUTE INPUT OVERLAY (Warm cream — like a luxury travel book)
   ============================================================ */

#route-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 0 24px max(env(safe-area-inset-bottom, 24px), 24px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

/* Decorative circles (matching PDF cover) */
#route-overlay::before {
  content: '';
  position: fixed;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  top: -70px; right: -70px;
  pointer-events: none;
}

#route-overlay::after {
  content: '';
  position: fixed;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  top: 150px; right: 60px;
  pointer-events: none;
}

#route-overlay.hidden {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

/* ── Route Header ── */
.route-header {
  padding: 48px 0 24px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.route-header h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.route-header h1 .gold { color: var(--gold); }

.route-header p {
  font-size: 0.95rem;
  color: #5a5a5a;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Gold divider under header */
.route-header::after {
  content: '';
  display: block;
  width: 36px; height: 3px;
  background: var(--gold);
  margin: 16px auto 0;
}

/* ── Route Input Card ── */
.route-input-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid #E8E4DC;
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 24px rgba(27,58,75,0.06);
}

.input-group { margin-bottom: 14px; }

.input-group label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 13px 14px;
  background: var(--warm-white);
  border: 1px solid #E0DDD6;
  border-radius: var(--radius-sm);
  color: #2a2a2a;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,161,74,0.1);
}

.input-group input::placeholder { color: #999; font-weight: 400; }

/* ── Buttons ── */
.btn-gold {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(201,161,74,0.25);
}

.btn-gold:hover { background: var(--gold-light); box-shadow: 0 6px 24px rgba(201,161,74,0.35); transform: translateY(-1px); }
.btn-gold:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(201,161,74,0.2); }
.btn-gold:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1.5px solid #D3D1C7;
  border-radius: var(--radius-sm);
  color: var(--teal-mid);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 10px;
  letter-spacing: 0.3px;
}

.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

.btn-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  margin: -4px auto 10px;
  background: var(--warm-white);
  border: 1.5px solid #D3D1C7;
  border-radius: 50%;
  color: var(--teal-mid);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-swap:hover { border-color: var(--gold); color: var(--gold); transform: rotate(180deg); }

/* GPS Marker */
.gps-marker {
  width: 16px; height: 16px;
  background: #3b82f6;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(59,130,246,0.5);
  animation: gpsPulse 2s ease-in-out infinite;
}

@keyframes gpsPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(59,130,246,0.5); }
  50% { box-shadow: 0 0 24px rgba(59,130,246,0.8), 0 0 48px rgba(59,130,246,0.3); }
}

/* Regional commentary variant */
#now-playing.regional { border-left-color: var(--success); }
#now-playing.regional #now-playing-title { color: var(--success); }

/* Pre-Generation button */
.btn-pregen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, rgba(201,161,74,0.1), rgba(201,161,74,0.05));
  border: 1px solid var(--gold-glow);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-pregen:hover { background: rgba(201,161,74,0.15); border-color: var(--gold); }
.btn-pregen.generating {
  pointer-events: none;
  background: linear-gradient(135deg, rgba(201,161,74,0.15), rgba(201,161,74,0.05));
  animation: pregenPulse 1.5s ease-in-out infinite;
}

@keyframes pregenPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,161,74,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(201,161,74,0); }
}

.btn-pregen.done {
  border-color: rgba(29,158,117,0.4);
  color: var(--success);
  background: rgba(29,158,117,0.08);
  animation: none;
}

/* Voice button */
.btn-voice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  color: var(--dark-text-dim);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-voice:hover { border-color: var(--gold-glow); color: var(--gold); }
.btn-voice.listening {
  border-color: var(--error);
  color: var(--error);
  animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(192,57,43,0); }
}

/* Direction badge */
.direction-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--gold-dim);
  color: var(--gold);
  border-radius: 10px;
  margin-left: 8px;
}

/* ── Popular Routes ── */
.routes-section {
  width: 100%;
  max-width: 440px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.routes-section h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--gold);
}

.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.route-tab {
  padding: 6px 14px;
  background: transparent;
  border: 1.5px solid #D3D1C7;
  border-radius: 20px;
  color: #666;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.route-tab:hover { border-color: var(--teal); color: var(--teal); }

.route-tab.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.route-list { display: flex; flex-direction: column; gap: 5px; }

.route-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid #E8E4DC;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.route-item:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(201,161,74,0.1);
  transform: translateX(3px);
}

.route-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1B3A4B;
}

.route-item-dist {
  font-size: 0.72rem;
  color: #777;
  font-weight: 600;
}

/* Saved route items (richer display) */
.saved-route-item {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-left: 3px solid var(--gold);
}

.route-item-details {
  font-size: 0.78rem;
  color: #666;
  margin-top: 4px;
  letter-spacing: 0.2px;
}

.route-delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.route-delete-btn:hover { color: var(--error); background: rgba(192,57,43,0.08); }

/* ============================================================
   LOADING OVERLAY
   ============================================================ */

#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--cream);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

#loading-overlay.active { display: flex; }

.loading-globe {
  position: relative;
  width: 80px; height: 80px;
}

.loading-ring {
  width: 80px; height: 80px;
  border: 2px solid #E0DDD6;
  border-top-color: var(--gold);
  border-right-color: var(--gold);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.loading-ring-orbit {
  position: absolute;
  top: -8px; left: -8px;
  width: 96px; height: 96px;
  border: 1px solid rgba(201,161,74,0.15);
  border-top-color: rgba(201,161,74,0.4);
  border-radius: 50%;
  animation: spin 2.5s linear infinite reverse;
}

.loading-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--gold);
  border-radius: 50%;
  animation: dotGlow 1.5s ease-in-out infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dotGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(201,161,74,0.3); transform: scale(1); }
  50% { box-shadow: 0 0 16px rgba(201,161,74,0.6); transform: scale(1.2); }
}

.loading-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--teal);
  text-align: center;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.loading-step {
  font-size: 0.82rem;
  font-weight: 500;
  color: #bbb;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.4s var(--ease);
}

.loading-step::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ddd;
  transition: background 0.4s var(--ease);
  flex-shrink: 0;
}

.loading-step.done { color: var(--success); }
.loading-step.done::before { background: var(--success); }
.loading-step.active { color: var(--gold); }
.loading-step.active::before { background: var(--gold); animation: dotPulse 1s ease-in-out infinite; }

@keyframes dotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.6); }
}

/* ============================================================
   HELP PANEL (Slide-in from right)
   ============================================================ */

#help-fab {
  position: fixed;
  bottom: max(env(safe-area-inset-bottom, 16px), 16px);
  right: 16px;
  z-index: 101;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(201,161,74,0.35);
  transition: all 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

#help-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(201,161,74,0.45); }
#help-fab:active { transform: scale(0.95); }

#help-overlay {
  position: fixed;
  inset: 0;
  z-index: 102;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

#help-overlay.visible { opacity: 1; pointer-events: auto; }

#help-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 300px;
  max-width: 85vw;
  z-index: 103;
  background: var(--cream);
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#help-panel.open { transform: translateX(0); }

#help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1.5px solid #E0DDD6;
}

#help-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--teal);
}

#help-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

#help-close:hover { color: var(--teal); }

#help-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
}

.help-item {
  display: flex;
  gap: 10px;
  padding: 10px 0 10px 12px;
  border-left: 3px solid var(--gold);
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: #444;
  line-height: 1.5;
}

.help-item strong {
  color: var(--teal);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 2px;
}

.help-item em { color: var(--gold); font-style: normal; font-weight: 600; }

.help-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  padding-top: 1px;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,161,74,0.2); border-radius: 2px; }

/* ============================================================
   RESPONSIVE — Desktop: Side-by-side
   ============================================================ */

@media (min-width: 768px) {
  #app { flex-direction: row; }
  #map-container { flex: 6; }
  #controls {
    flex: 4;
    max-height: 100dvh;
    border-top: none;
    border-left: 1px solid var(--dark-border);
  }
  #controls.collapsed { max-height: 100dvh; }
  #controls::before { display: none; }
}

/* ============================================================
   MICRO-ANIMATIONS
   ============================================================ */

/* ============================================================
   AUTOCOMPLETE
   ============================================================ */

.autocomplete-wrap { position: relative; }

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #E0DDD6;
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: 0 8px 24px rgba(27,58,75,0.1);
}

.autocomplete-dropdown.visible { display: block; }

.ac-item {
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #2a2a2a;
  cursor: pointer;
  border-bottom: 1px solid #F2F0EB;
  transition: background 0.15s;
}

.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: var(--paper); }

.ac-country {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold);
  margin-left: 4px;
  letter-spacing: 0.5px;
}

/* Dark mode autocomplete (for map view) */
#controls .autocomplete-dropdown {
  background: var(--dark-surface);
  border-color: var(--dark-border);
}
#controls .ac-item { color: var(--dark-text); border-color: var(--dark-border); }
#controls .ac-item:hover, #controls .ac-item.active { background: var(--dark-card); }

@media (prefers-reduced-motion: no-preference) {
  .route-item { transition: all 0.25s var(--ease), transform 0.25s var(--ease); }
  .route-tab { transition: all 0.2s var(--ease); }
  .player-btn { transition: all 0.2s var(--ease); }
}
