/* ═══════════════════════════════════════════════════
   TRAMBAHÍA · CÁDIZ
   Rediseño — estilo apps nativas Apple (iOS/Maps/Wallet)
   Blanco puro · acento verde único · tipografía del sistema
   ═══════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  /* Brand TramBahía — un único acento, usado con disciplina */
  --tb-green:        #0C8A46;
  --tb-green-light:  #16A34A;
  --tb-green-bright: #1FB85C;
  --tb-green-glow:   #34D17A;
  --tb-yellow:       #E8A917;
  --tb-red:          #FF3B30;
  --tb-orange:       #FF9500;

  /* Superficies — blanco puro, estilo iOS */
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F5F5F7;
  --bg-tertiary:   #EFEFF2;
  --bg-card:       #FFFFFF;
  --bg-glass:      rgba(255,255,255,0.78);
  --bg-glass-dark: rgba(255,255,255,0.86);
  --border:        rgba(60,60,67,0.13);
  --border-bright: rgba(12,138,70,0.32);

  --text-primary:   #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary:  #AEAEB2;
  --text-accent:    var(--tb-green);

  --float-h: 108px;
  --nav-h:    64px;
  --dock-gap: 10px;
  --dock-side: 12px;
  --map-bg:   #EAEFEC;

  /* Sombras suaves, difusas — nunca duras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.06);
  --glow:      0 0 24px rgba(12,138,70,0.14);

  /* Esquinas continuas — "squircle" look */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 34px;

  --font-display: -apple-system, 'SF Pro Display', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    -apple-system, 'SF Pro Text', 'Atkinson Hyperlegible', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', 'Courier New', monospace;

  /* Curvas de Apple: easeOut estándar + spring para sheets */
  --transition: 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  --spring:     0.46s cubic-bezier(0.32, 0.72, 0, 1);
}

/* El modo oscuro queda definido pero no se activa desde la UI actual */
body.dark-mode {
  --bg-primary:    #000000;
  --bg-secondary:  #1C1C1E;
  --bg-tertiary:   #2C2C2E;
  --bg-card:       #1C1C1E;
  --bg-glass:      rgba(28,28,30,0.78);
  --bg-glass-dark: rgba(20,20,22,0.86);
  --border:        rgba(255,255,255,0.12);
  --border-bright: rgba(31,184,92,0.4);
  --text-primary:   #F5F5F7;
  --text-secondary: #98989D;
  --text-tertiary:  #636366;
  --text-accent:    var(--tb-green-bright);
  --map-bg:   #0D1410;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.7);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  letter-spacing: -0.01em;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
a { color: var(--tb-green); }
input { font-family: inherit; }

::-webkit-scrollbar { width: 0; height: 0; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; }

/* ═══════════════════════════════════════════════════
   DISCLAIMER MODAL — estilo alerta de iOS
   ═══════════════════════════════════════════════════ */
.disclaimer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.32);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.3s ease;
}
.disclaimer-overlay.hidden { display: none; }

.disclaimer-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px 26px 24px;
  max-width: 340px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slide-up 0.42s var(--spring);
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(28px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.disclaimer-icon {
  font-size: 38px;
  margin-bottom: 14px;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(160deg, rgba(12,138,70,0.12), rgba(12,138,70,0.04));
  border-radius: 22px;
}
.disclaimer-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  letter-spacing: -0.4px;
}
.disclaimer-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 500;
  letter-spacing: 0.1px;
}
.disclaimer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,59,48,0.09);
  border: none;
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tb-red);
  margin-bottom: 16px;
}
.disclaimer-text {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.disclaimer-text strong { color: var(--text-primary); font-weight: 600; }
.disclaimer-dev {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}
.disclaimer-dev a {
  color: var(--tb-green);
  font-weight: 600;
  text-decoration: none;
}
.disclaimer-btn {
  width: 100%;
  background: var(--tb-green);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: -0.2px;
}
.disclaimer-btn:active {
  transform: scale(0.97);
  background: var(--tb-green-light);
}

/* ═══════════════════════════════════════════════════
   INSTALL GATE — muro de instalación PWA obligatoria
   ═══════════════════════════════════════════════════ */
.install-gate-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-secondary);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.3s ease;
}

.install-gate-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px 26px 26px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slide-up 0.42s var(--spring);
}

.install-gate-icon {
  font-size: 40px;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  background: linear-gradient(160deg, rgba(12,138,70,0.14), rgba(12,138,70,0.05));
  border-radius: 22px;
}
.install-gate-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.4px;
}
.install-gate-subtitle {
  font-size: 13.5px;
  color: var(--tb-green);
  font-weight: 700;
  margin-bottom: 16px;
}
.install-gate-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 20px;
}
.install-gate-platform { margin-bottom: 6px; }

.install-gate-btn {
  width: 100%;
  background: var(--tb-green);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 12px;
}
.install-gate-btn:active { transform: scale(0.97); background: var(--tb-green-light); }

.install-gate-fallback {
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.install-gate-steps {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.install-gate-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.4;
}
.step-num {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tb-green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-gate-recheck {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════
   FLOATING TOP BAR
   ═══════════════════════════════════════════════════ */
.floating-top-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 450;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.floating-top-bar .search-container,
.floating-top-bar .direction-bar {
  pointer-events: all;
}

.floating-top-bar .search-container {
  background: var(--bg-glass-dark);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 8px 10px;
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
}

.floating-top-bar .direction-bar {
  background: var(--bg-glass-dark);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  height: auto;
  min-height: 46px;
  padding: 0 14px;
}

/* ═══════════════════════════════════════════════════
   SEARCH BAR — estilo iOS (cápsula gris)
   ═══════════════════════════════════════════════════ */

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 12px;
  padding: 0 12px;
  height: 40px;
  transition: var(--transition);
}
.search-bar:focus-within {
  background: var(--bg-tertiary);
  box-shadow: 0 0 0 3px rgba(12,138,70,0.16);
}

.search-icon { width: 16px; height: 16px; color: var(--text-secondary); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
}
.search-bar input::placeholder { color: var(--text-tertiary); }

.clear-search {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.clear-search svg { width: 14px; height: 14px; }

.service-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 99px;
  padding: 6px 11px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}
.badge-dot.active { background: var(--tb-green); box-shadow: 0 0 8px rgba(12,138,70,0.5); animation: none; }
.badge-dot.inactive { background: var(--tb-red); animation: none; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.badge-text { font-size: 11px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0; }

/* ═══════════════════════════════════════════════════
   SEARCH RESULTS
   ═══════════════════════════════════════════════════ */
.search-results {
  position: absolute;
  top: calc(var(--header-h) + var(--search-h) + 8px);
  left: 14px; right: 14px;
  background: var(--bg-glass-dark);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  z-index: 999;
  overflow: hidden;
  animation: slide-down 0.2s var(--transition);
  max-height: 260px;
  overflow-y: auto;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:active {
  background: var(--bg-tertiary);
}

.sri-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--tb-green);
  flex-shrink: 0;
}
.sri-name { font-size: 14.5px; font-weight: 500; }
.sri-id {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════
   DIRECTION BAR
   ═══════════════════════════════════════════════════ */
.direction-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px;
  min-height: 46px;
}

.direction-info {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  overflow: hidden;
}

.dir-from, .dir-to {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  letter-spacing: -0.1px;
}
.dir-from { color: var(--tb-green); }
.dir-to   { color: var(--text-primary); }
.dir-arrow { width: 13px; height: 13px; flex-shrink: 0; color: var(--text-tertiary); }

.invert-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--tb-green);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: white;
  transition: var(--transition);
  flex-shrink: 0;
  letter-spacing: -0.1px;
}
.invert-btn:active {
  transform: scale(0.95);
  background: var(--tb-green-light);
}
.invert-btn svg { width: 13px; height: 13px; transition: transform var(--spring); }
.invert-btn.spinning svg { transform: rotate(180deg); }

/* ═══════════════════════════════════════════════════
   MAP
   ═══════════════════════════════════════════════════ */
.map-wrapper {
  flex: 1;
  position: relative;
  background: var(--map-bg);
  overflow: hidden;
  min-height: 0;
}

.map-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(12,138,70,0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.real-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #E4ECE7;
}

.real-map:empty::before {
  content: 'Cargando mapa…';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
}

.map-wrapper.leaflet-ready::before,
.map-wrapper.leaflet-ready .map-scroll-container,
.map-wrapper.leaflet-ready .map-fade-left,
.map-wrapper.leaflet-ready .map-fade-right,
.map-wrapper.leaflet-ready .map-scroll-hint {
  display: none;
}

.map-wrapper:not(.leaflet-ready) .real-map,
.map-wrapper:not(.leaflet-ready) .map-toolbar {
  display: none;
}

.map-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 450;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.map-chip,
.map-fit-btn {
  height: 36px;
  border-radius: 11px;
  border: 0.5px solid var(--border);
  background: var(--bg-glass-dark);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
}

.map-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.map-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tb-green);
  box-shadow: 0 0 8px rgba(12,138,70,0.5);
}

.map-fit-btn {
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 600;
  pointer-events: all;
  transition: var(--transition);
  color: var(--tb-green);
}

.map-fit-btn:active {
  transform: scale(0.95);
  background: var(--bg-tertiary);
}

.map-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: all;
}

.map-locate-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 0.5px solid var(--border);
  background: var(--bg-glass-dark);
  color: var(--tb-green);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.map-locate-btn:active { transform: scale(0.92); background: var(--bg-tertiary); }

.map-locate-btn.locating {
  color: var(--text-secondary);
  animation: locate-pulse 1s ease-in-out infinite;
}
.map-locate-btn.locating svg { animation: locate-spin 1.1s linear infinite; }

@keyframes locate-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes locate-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.map-locate-btn.error { color: var(--tb-red); }

/* ── Marcador de "tú estás aquí" en el mapa Leaflet ── */
.tb-user-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4285F4;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(66,133,244,0.25), 0 4px 12px rgba(0,0,0,0.3);
}
.tb-user-marker::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: rgba(66,133,244,0.18);
  animation: user-pulse 2s ease-out infinite;
}
@keyframes user-pulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ── Estación más cercana al usuario (resaltado) ── */
.tb-station-pin.nearest-station-pin {
  border-color: #4285F4;
  box-shadow: 0 0 0 5px rgba(66,133,244,0.22), 0 4px 12px rgba(0,0,0,0.22);
  animation: nearest-pulse 1.8s ease-in-out infinite;
}
@keyframes nearest-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(66,133,244,0.22), 0 4px 12px rgba(0,0,0,0.22); }
  50%      { box-shadow: 0 0 0 8px rgba(66,133,244,0.12), 0 4px 12px rgba(0,0,0,0.22); }
}

/* ── Toast de aviso (permiso denegado, sin soporte, etc.) ── */
.geo-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--dock-gap) * 2 + 56px + var(--dock-side) * 2 + 14px);
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-glass-dark);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 280px;
  text-align: center;
  z-index: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.geo-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  .geo-toast { left: 50%; }
}

.leaflet-container {
  font-family: var(--font-body);
  background: #E4ECE7;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.leaflet-bottom.leaflet-right {
  margin-bottom: calc(var(--nav-h) + var(--dock-gap) + 56px + var(--dock-side) * 2 - 10px) !important;
}

.leaflet-control-zoom {
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
  box-shadow: var(--shadow-md) !important;
  border: none !important;
}
.leaflet-control-zoom a {
  background: var(--bg-glass-dark) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

.tb-station-pin {
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--tb-green);
  box-shadow: 0 0 0 1px rgba(12,138,70,0.18), 0 4px 12px rgba(0,0,0,0.22);
}

.tb-station-pin.terminal {
  width: 22px;
  height: 22px;
  background: #0A3D1E;
}

.tb-station-pin.active,
.tb-station-pin.current,
.tb-station-pin.next {
  transform: scale(1.2);
}

.tb-station-pin.current {
  background: var(--tb-orange);
}

.tb-station-pin.next {
  background: var(--tb-yellow);
}

.tb-station-label {
  border: 0;
  background: var(--bg-glass-dark);
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  color: var(--text-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  white-space: nowrap;
}

.tb-tram-marker {
  width: 28px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--tb-green);
  border: 2px solid #fff;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  font-size: 14px;
  line-height: 1;
}

.map-scroll-container {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
}

.map-inner {
  position: relative;
  height: 100%;
  min-width: 100%;
}

.track-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}

.track-line {
  fill: none;
  stroke: var(--tb-green);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(12,138,70,0.45));
  transition: stroke var(--transition);
}

.track-glow {
  fill: none;
  stroke: var(--tb-green-bright);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.06;
  filter: blur(6px);
}

.tram-dot {
  fill: white;
  filter: drop-shadow(0 0 6px rgba(12,138,70,0.7));
}
.tram-body {
  fill: var(--tb-green);
}

.stations-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.station-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  pointer-events: all;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.station-marker {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2.5px solid var(--tb-green);
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.station-node:active .station-marker,
.station-node.active .station-marker {
  background: var(--tb-green);
  transform: scale(1.35);
  box-shadow: 0 0 0 6px rgba(12,138,70,0.14);
}

.station-node.terminal .station-marker {
  width: 21px; height: 21px;
  border-width: 3px;
  background: var(--tb-green);
}

.station-label {
  margin-top: 7px;
  background: var(--bg-glass-dark);
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  transition: var(--transition);
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0;
}

.station-node.active .station-label {
  background: rgba(12,138,70,0.12);
  border-color: var(--border-bright);
  color: var(--tb-green);
}

.station-fav-indicator {
  position: absolute;
  top: -5px; right: -5px;
  width: 9px; height: 9px;
  background: var(--tb-yellow);
  border-radius: 50%;
  border: 1.5px solid var(--bg-primary);
  animation: fav-pop 0.4s var(--spring);
}

/* ── Estación más cercana al usuario (línea horizontal) ── */
.station-node.nearest .station-marker {
  border-color: #4285F4;
  box-shadow: 0 0 0 5px rgba(66,133,244,0.18);
  animation: nearest-pulse-node 1.8s ease-in-out infinite;
}
.station-node.nearest .station-label {
  background: rgba(66,133,244,0.12);
  border-color: #4285F4;
  color: #4285F4;
}
@keyframes nearest-pulse-node {
  0%, 100% { box-shadow: 0 0 0 4px rgba(66,133,244,0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(66,133,244,0.10); }
}

@keyframes fav-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.map-fade-left, .map-fade-right {
  position: absolute;
  top: 0; bottom: 0;
  width: 50px;
  pointer-events: none;
  z-index: 5;
}
.map-fade-left  { left: 0;  background: linear-gradient(to right, var(--map-bg), transparent); }
.map-fade-right { right: 0; background: linear-gradient(to left,  var(--map-bg), transparent); }

.map-scroll-hint {
  position: absolute;
  bottom: calc(var(--nav-h) + var(--dock-gap) + 56px + var(--dock-side) * 2);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-glass-dark);
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  padding: 5px 11px;
  border-radius: 99px;
  border: 0.5px solid var(--border);
  pointer-events: none;
  white-space: nowrap;
  z-index: 6;
  letter-spacing: 0;
}

/* ═══════════════════════════════════════════════════
   REALTIME STATION STATES
   ═══════════════════════════════════════════════════ */
.station-node.passed .station-marker {
  background: var(--text-tertiary);
  border-color: var(--text-tertiary);
  box-shadow: none;
  opacity: 0.5;
}
.station-node.passed .station-label {
  color: var(--text-tertiary);
  border-color: transparent;
  background: transparent;
  opacity: 0.8;
}

.station-node.current .station-marker {
  background: var(--tb-orange);
  border-color: var(--tb-orange);
  box-shadow: 0 0 0 5px rgba(255, 149, 0, 0.16);
  animation: pulse-orange 1.6s infinite;
}

.station-node.next .station-marker {
  background: var(--tb-yellow);
  border-color: var(--tb-yellow);
  box-shadow: 0 0 0 5px rgba(232, 169, 23, 0.16);
  animation: pulse-yellow 1.6s infinite;
}


/* ═══════════════════════════════════════════════════
   BOTTOM SHEET — estilo iOS Maps
   ═══════════════════════════════════════════════════ */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.18);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.bottom-sheet-overlay.visible { opacity: 1; pointer-events: all; }

.bottom-sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  background: var(--bg-glass-dark);
  backdrop-filter: blur(36px) saturate(1.9);
  -webkit-backdrop-filter: blur(36px) saturate(1.9);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 0.5px solid var(--border);
  z-index: 501;
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.bottom-sheet.open { transform: translateY(0); }

.bs-handle-area {
  padding: 10px 0 4px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.bs-handle {
  width: 36px; height: 5px;
  background: var(--text-tertiary);
  border-radius: 99px;
  opacity: 0.55;
}

.bs-content {
  padding: 0 16px 20px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.bs-station-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-top: 4px;
}

.bs-station-info { flex: 1; }

.bs-station-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.bs-station-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}
.bs-station-meta strong { color: var(--tb-green); font-weight: 600; }

.bs-actions { display: flex; gap: 6px; flex-shrink: 0; }

.bs-fav-btn, .bs-close-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  transition: var(--transition);
  color: var(--text-secondary);
}
.bs-fav-btn.active { background: rgba(232,169,23,0.14); color: var(--tb-yellow); }
.bs-fav-btn:active, .bs-close-btn:active {
  transform: scale(0.92);
}
.bs-fav-btn svg, .bs-close-btn svg { width: 16px; height: 16px; }

.bs-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.1px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.departure-list { display: flex; flex-direction: column; gap: 8px; }

.departure-card {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  gap: 12px;
}

.departure-card.next {
  background: rgba(12,138,70,0.08);
}
.departure-card.next::after {
  content: 'PRÓXIMO';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--tb-green);
  opacity: 0.85;
}

.departure-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--dep-color, transparent);
}

.dep-time {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.5px;
  min-width: 60px;
  color: var(--dep-color, var(--text-primary));
  font-variant-numeric: tabular-nums;
}

.dep-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dep-bar {
  height: 4px;
  background: rgba(0,0,0,0.06);
  border-radius: 99px;
  overflow: hidden;
}
body.dark-mode .dep-bar { background: rgba(255,255,255,0.08); }

.dep-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--dep-color, var(--text-tertiary));
  transition: width 1s linear;
}

.dep-destination {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.dep-countdown {
  text-align: right;
  flex-shrink: 0;
  min-width: 54px;
}
.dep-min {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  display: block;
  text-align: right;
  color: var(--dep-color, var(--text-primary));
  font-variant-numeric: tabular-nums;
}
.dep-label { font-size: 10px; color: var(--text-secondary); display: block; text-align: right; margin-top: 1px; font-weight: 500; }

.dep-green  { --dep-color: var(--tb-green); }
.dep-yellow { --dep-color: var(--tb-yellow); }
.dep-red    { --dep-color: var(--tb-red); }

.dep-red .dep-bar-fill { animation: pulse-red 1s infinite; }

.no-service-msg {
  text-align: center;
  padding: 30px 0;
}
.no-service-msg .ns-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.7; }
.no-service-msg p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.no-service-msg strong { color: var(--text-primary); }

/* ═══════════════════════════════════════════════════
   FLOATING DOCK (próximo tren + nav flotante)
   ═══════════════════════════════════════════════════ */
.floating-dock {
  position: fixed;
  left: var(--dock-side);
  right: var(--dock-side);
  bottom: calc(var(--dock-side) + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--dock-gap);
  pointer-events: none;
}
.floating-dock > * { pointer-events: all; }

@media (min-width: 768px) {
  .floating-dock {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - var(--dock-side) * 2);
  }
}

/* ── Tarjeta "Próximo tren" ── */
.next-train-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-glass-dark);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px 16px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px) saturate(1.9);
  -webkit-backdrop-filter: blur(28px) saturate(1.9);
  text-align: left;
  transition: var(--transition);
  width: 100%;
}
.next-train-card:active { transform: scale(0.98); }

.ntc-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
  flex-shrink: 0;
}
.ntc-route {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.ntc-eta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--tb-green);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
.ntc-eta.urgent { color: var(--tb-red); }
.ntc-eta.soon   { color: var(--tb-yellow); }

.next-train-card.no-service .ntc-eta { color: var(--text-secondary); font-size: 13px; font-weight: 600; }

/* ═══════════════════════════════════════════════════
   BOTTOM NAV (flotante) — Tab bar estilo iOS
   ═══════════════════════════════════════════════════ */
.bottom-nav {
  height: var(--nav-h);
  background: var(--bg-glass-dark);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px) saturate(1.9);
  -webkit-backdrop-filter: blur(28px) saturate(1.9);
  display: flex;
  align-items: stretch;
  padding: 6px;
  gap: 2px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 6px 4px;
  letter-spacing: 0;
  border-radius: calc(var(--radius-lg) - 8px);
}
.nav-item svg { width: 22px; height: 22px; transition: var(--transition); }
.nav-item:active { transform: scale(0.93); }

.nav-item.active { color: var(--tb-green); }
.nav-item.active svg { transform: translateY(-1px); }

/* Mobile comfort pass */
.search-container { padding: 10px 14px; }
.search-bar {
  height: 44px;
  padding: 0 13px;
}
.search-icon { width: 18px; height: 18px; }
.search-bar input { font-size: 16px; }
.service-badge { padding: 7px 12px; }
.badge-dot { width: 8px; height: 8px; }
.badge-text {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
}

.direction-bar {
  min-height: var(--dir-h);
  padding: 8px 16px;
}
.direction-info {
  font-size: 15px;
  font-weight: 700;
}
.invert-btn {
  min-height: 38px;
  padding: 9px 14px;
  font-size: 13px;
}

.bottom-nav {
  min-height: var(--nav-h);
}
.nav-item {
  min-height: 54px;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 4px;
}
.nav-item svg {
  width: 24px;
  height: 24px;
}

.bs-content {
  padding-left: 18px;
  padding-right: 18px;
}
.bs-station-name {
  font-size: 25px;
  letter-spacing: -0.5px;
}
.bs-station-meta {
  font-size: 13.5px;
  line-height: 1.35;
}
.bs-fav-btn,
.bs-close-btn {
  width: 42px;
  height: 42px;
}
.bs-fav-btn svg,
.bs-close-btn svg {
  width: 19px;
  height: 19px;
}
.bs-section-title {
  font-size: 12.5px;
  letter-spacing: -0.1px;
}
.departure-list { gap: 10px; }
.departure-card {
  min-height: 76px;
  padding: 15px 15px;
  gap: 14px;
}
.departure-card.next::after {
  content: 'PRÓXIMO';
  font-size: 8.5px;
}
.dep-time {
  min-width: 68px;
  font-size: 26px;
  letter-spacing: -0.5px;
}
.dep-destination {
  font-size: 12px;
  line-height: 1.25;
}
.dep-min {
  font-size: 23px;
}
.dep-label {
  font-size: 11px;
}

.panel-header h2 { font-size: 22px; }
.panel-close {
  width: 36px;
  height: 36px;
}
.panel-close svg {
  width: 16px;
  height: 16px;
}
.day-btn {
  min-height: 42px;
  font-size: 13.5px;
}
.sched-dir-btn {
  min-height: 40px;
  font-size: 12.5px;
}
.sched-station-name {
  font-size: 12.5px;
  letter-spacing: 0.3px;
}
.sched-time-pill {
  min-height: 32px;
  padding: 7px 12px;
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════
   PANELS — pantallas modales estilo iOS (sheet grande)
   ═══════════════════════════════════════════════════ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.22);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.panel-overlay.visible { opacity: 1; pointer-events: all; }

.panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: none;
  z-index: 601;
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  padding-bottom: env(safe-area-inset-bottom);
}
.panel.open { transform: translateY(0); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 14px;
  flex-shrink: 0;
}
.panel-header h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.panel-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-secondary);
  transition: var(--transition);
}
.panel-close:active { transform: scale(0.9); }
.panel-close svg { width: 14px; height: 14px; }

.schedule-day-toggle {
  display: flex;
  gap: 4px;
  padding: 4px 14px 10px;
  flex-shrink: 0;
}
.day-btn {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.day-btn.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.schedule-directions {
  display: flex;
  gap: 6px;
  padding: 6px 14px 10px;
  flex-shrink: 0;
}
.sched-dir-btn {
  flex: 1;
  padding: 7px 6px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.sched-dir-btn.active {
  background: rgba(12,138,70,0.1);
  color: var(--tb-green);
}

.schedule-table-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 20px;
  -webkit-overflow-scrolling: touch;
}

.sched-station-row { margin-bottom: 16px; }
.sched-station-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sched-station-name::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--border);
}
.sched-times-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sched-time-pill {
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--bg-primary);
  border: none;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
  font-variant-numeric: tabular-nums;
}
.sched-time-pill.past {
  opacity: 0.35;
  text-decoration: line-through;
}
.sched-time-pill.next-up {
  background: var(--tb-green);
  color: #fff;
}

.favorites-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 14px 20px;
}
.fav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.fav-item:active { transform: scale(0.98); }
.fav-item-icon {
  width: 38px; height: 38px;
  background: rgba(12,138,70,0.1);
  border: none;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.fav-item-info { flex: 1; }
.fav-item-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.1px; }
.fav-item-next { font-size: 12px; color: var(--tb-green); margin-top: 2px; font-weight: 500; }
.fav-remove {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
  transition: var(--transition);
  flex-shrink: 0;
}
.fav-remove:active { color: var(--tb-red); transform: scale(0.9); }
.fav-remove svg { width: 14px; height: 14px; }

.no-favs {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}
.no-favs .nf-icon { font-size: 50px; margin-bottom: 16px; opacity: 0.4; }
.no-favs p { font-size: 14px; line-height: 1.7; }

.info-content {
  flex: 1;
  overflow-y: auto;
  padding: 6px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
}
.info-card h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.1px; }
.info-card p  { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }
.info-card a  { color: var(--tb-green); text-decoration: none; font-weight: 600; }

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-orange {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 5px rgba(255, 149, 0, 0.16); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(255, 149, 0, 0.22); }
}
@keyframes pulse-yellow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 5px rgba(232, 169, 23, 0.16); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(232, 169, 23, 0.22); }
}
@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.departure-card {
  animation: fade-in 0.22s ease both;
}
.departure-card:nth-child(1) { animation-delay: 0.03s; }
.departure-card:nth-child(2) { animation-delay: 0.07s; }
.departure-card:nth-child(3) { animation-delay: 0.11s; }
.departure-card:nth-child(4) { animation-delay: 0.15s; }

.station-node {
  animation: node-appear 0.4s var(--spring) both;
}
@keyframes node-appear {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (min-width: 768px) {
  body { max-width: 480px; margin: 0 auto; height: 100vh; }
  .bottom-sheet {
    max-width: 480px; left: 50%;
    transform: translateX(-50%) translateY(100%); right: auto; width: 100%;
  }
  .bottom-sheet.open { transform: translateX(-50%) translateY(0); }
  .panel {
    max-width: 480px; left: 50%;
    transform: translateX(-50%) translateY(100%); right: auto; width: 100%;
  }
  .panel.open { transform: translateX(-50%) translateY(0); }
  .search-results { max-width: 452px; }
}

/* ── Foco visible accesible ── */
button:focus-visible,
input:focus-visible,
.station-node:focus-visible .station-marker {
  outline: 2px solid var(--tb-green);
  outline-offset: 2px;
}

/* ── Movimiento reducido ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}