
/* ============================================================
   ESQUEMA DE COLOR OSCURO
   Le dice al navegador que la página es oscura, para que dibuje
   los controles nativos (selector de fecha/hora, barras de scroll,
   menús desplegables) en su variante oscura. Sin esto, el icono del
   calendario y el texto de <input type="date|datetime-local"> se
   pintan en negro y resultan invisibles sobre el fondo oscuro.
   ============================================================ */
:root { color-scheme: dark; }

/* Icono del calendario/reloj: por si el navegador lo deja oscuro */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
  opacity: 0.9;
}
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  color: var(--text);
}
/* ============================================================
   RODADA.APP — ESTILOS COMPARTIDOS
   Usado por index.html, historial.html y convertir.html
   ============================================================ */

:root{
  --bg: #0c1210;
  --bg-elevated: #131b18;
  --bg-card: #18221e;
  --border: #28342f;
  --text: #e8efec;
  --text-dim: #9bb0a8;
  --emerald: #18c97f;
  --emerald-dim: #0e7e51;
  --emerald-glow: rgba(24, 201, 127, 0.18);
  --danger: #e0594f;
  --radius: 10px;
  --font-display: 'Rajdhani', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ============================================================
   TEMAS DE COLOR
   El acento sigue llamándose --emerald en todo el CSS; cada tema
   redefine su valor (y los fondos/textos). El predeterminado
   (verde/oscuro) es el :root de arriba.
   ============================================================ */

/* Verde / Oscuro (igual que el predeterminado, por si se fija explícito) */
[data-theme="green-dark"] {
  --bg: #0c1210; --bg-elevated: #131b18; --bg-card: #18221e; --border: #28342f;
  --text: #e8efec; --text-dim: #9bb0a8;
  --emerald: #18c97f; --emerald-dim: #0e7e51; --emerald-glow: rgba(24,201,127,0.18);
}

/* Azul / Oscuro */
[data-theme="blue-dark"] {
  --bg: #0b1016; --bg-elevated: #121a24; --bg-card: #16202c; --border: #273748;
  --text: #e7eef6; --text-dim: #94a9bd;
  --emerald: #3897f0; --emerald-dim: #1c5d96; --emerald-glow: rgba(56,151,240,0.20);
}

/* Azul / Claro */
[data-theme="blue-light"] {
  --bg: #f3f6fa; --bg-elevated: #ffffff; --bg-card: #ffffff; --border: #d3deea;
  --text: #14222f; --text-dim: #5a6b7b;
  --emerald: #1d72d2; --emerald-dim: #155aa8; --emerald-glow: rgba(29,114,210,0.16);
}

/* Ámbar / Oscuro */
[data-theme="amber-dark"] {
  --bg: #14100a; --bg-elevated: #1d1810; --bg-card: #241d12; --border: #3a3020;
  --text: #f3ece0; --text-dim: #bdab92;
  --emerald: #f0a830; --emerald-dim: #a8741c; --emerald-glow: rgba(240,168,48,0.20);
}

/* Verde / Claro */
[data-theme="green-light"] {
  --bg: #f1f6f3; --bg-elevated: #ffffff; --bg-card: #ffffff; --border: #cfe0d7;
  --text: #102019; --text-dim: #56695f;
  --emerald: #0e9c63; --emerald-dim: #0b7d4f; --emerald-glow: rgba(14,156,99,0.16);
}

/* ============================================================
   TEMAS ESPECTACULARES (con degradados, glow y animaciones)
   Cada uno define sus variables + efectos propios más abajo.
   ============================================================ */

/* ✨ NEÓN — futurista, cian/magenta, brillos (animación marcada) */
[data-theme="neon"] {
  --bg: #080a16; --bg-elevated: #0f1226; --bg-card: #141834; --border: #2a2f5c;
  --text: #eaf0ff; --text-dim: #9aa3d8;
  --emerald: #00e5ff; --emerald-dim: #0091c2; --emerald-glow: rgba(0,229,255,0.35);
  --grad-1: #00e5ff; --grad-2: #b14bff; --grad-3: #ff2d95;
}

/* 💎 PREMIUM — oscuro joya, dorado, sofisticado (animación sutil) */
[data-theme="premium"] {
  --bg: #0c0a0f; --bg-elevated: #16121c; --bg-card: #1d1826; --border: #342c3f;
  --text: #f4eede; --text-dim: #b6a894;
  --emerald: #e8c479; --emerald-dim: #a6884a; --emerald-glow: rgba(232,196,121,0.22);
  --grad-1: #e8c479; --grad-2: #c9a86a; --grad-3: #8f6f3f;
}

/* 🏁 RACING — rojo/negro, deportivo, energía (animación marcada) */
[data-theme="racing"] {
  --bg: #0e0a0a; --bg-elevated: #1a1010; --bg-card: #221414; --border: #3d2222;
  --text: #f6ecec; --text-dim: #c19d9d;
  --emerald: #ff2e3f; --emerald-dim: #b01020; --emerald-glow: rgba(255,46,63,0.28);
  --grad-1: #ff2e3f; --grad-2: #ff6a00; --grad-3: #ffb800;
}

/* 🌄 AVENTURA — atardecer, tonos tierra/cálidos (animación sutil) */
[data-theme="sunset"] {
  --bg: #14100d; --bg-elevated: #1f1712; --bg-card: #281d16; --border: #3f2e22;
  --text: #f7ede2; --text-dim: #c4a98f;
  --emerald: #ff8c42; --emerald-dim: #c25e1f; --emerald-glow: rgba(255,140,66,0.24);
  --grad-1: #ff8c42; --grad-2: #ff5e62; --grad-3: #7b4397;
}

/* 🌌 STUDIO (GenArt) — negro puro, degradado cian/violeta/verde, halos */
[data-theme="genart"] {
  --bg: #000000; --bg-elevated: #0b0b0f; --bg-card: #101015; --border: #22222c;
  --text: #ffffff; --text-dim: #8a8a99;
  --emerald: #22d3ee; --emerald-dim: #0e8fa8; --emerald-glow: rgba(34,211,238,0.30);
  --grad-1: #22d3ee; --grad-2: #a855f7; --grad-3: #4ade80;
}

/* Tema "Deporte": cálido (naranja→rojo→magenta), para la sección de deporte.
   El acento (--emerald y derivados) se reutiliza para que los efectos de
   genart funcionen igual, pero con la gama cálida. */
[data-theme="deporte"] {
  --bg: #0a0506; --bg-elevated: #140a0c; --bg-card: #181013; --border: #2c2025;
  --text: #ffffff; --text-dim: #b09098;
  --emerald: #ff6b35; --emerald-dim: #c23e18; --emerald-glow: rgba(255,107,53,0.30);
  --grad-1: #ff6b35; --grad-2: #ff2e63; --grad-3: #c33aff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px var(--emerald-glow);
  flex-shrink: 0;
}

.brand-mark svg { width: 20px; height: 20px; }

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Header right area (nav + user) ---------- */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Pestañas de navegación ---------- */
.nav-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.nav-tab:hover { color: var(--text); }

.nav-tab.active {
  background: var(--emerald);
  color: #06140f;
}

/* ---------- Botón hamburguesa (solo móvil) ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { color: var(--emerald); }

@media (max-width: 1150px) {
  header { padding: 12px 16px; }

  /* Aparece el botón ☰ */
  .nav-toggle { display: inline-flex; }

  /* La barra de pestañas pasa a ser un panel desplegable vertical */
  .nav-tabs {
    display: none;
    position: absolute;
    top: 100%;
    right: 16px;
    left: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border-radius: 14px;
    padding: 8px;
    margin-top: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    z-index: 1200;
  }
  .nav-tabs.open { display: flex; }

  .nav-tab {
    justify-content: center;
    padding: 12px 14px;
    font-size: 0.9rem;
    border-radius: 10px;
  }
}

/* ---------- Layout (mapa, con sidebar) ---------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 0;
}

@media (max-width: 860px) {
  /* En móvil dividimos en dos: arriba la info (con scroll propio),
     abajo el mapa en un cuadro estático. El conjunto ocupa exactamente
     el alto de la pantalla bajo la cabecera, así nada se descuadra. */
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 45vh;   /* info flexible arriba, mapa fijo abajo */
    height: calc(100vh - 64px);     /* alto de pantalla menos la cabecera */
    height: calc(100dvh - 64px);    /* dvh: tiene en cuenta la barra del navegador móvil */
    min-height: 0;
  }
  /* La info de arriba scrollea por su cuenta; el mapa de abajo se queda fijo */
  .layout .sidebar {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  .layout #map {
    height: 100%;
    min-height: 0;
  }
}

/* ---------- Layout de una sola columna (historial, convertir) ---------- */
.layout-single {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.single-column {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: -8px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 860px) {
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.panel h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel h2 .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  flex-shrink: 0;
}

/* ---------- Dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--emerald);
  background: rgba(24, 201, 127, 0.06);
}

.dropzone svg {
  width: 30px; height: 30px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.dropzone.dragover svg, .dropzone:hover svg { color: var(--emerald); }

.dropzone p { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }
.dropzone strong { color: var(--emerald); font-weight: 600; }

input[type="file"] { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius);
  border: none;
  background: var(--emerald);
  color: #06140f;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.btn:hover { background: #2ee699; }
.btn:active { transform: scale(0.98); }
.btn:disabled { background: var(--border); color: var(--text-dim); cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--bg-elevated); color: var(--text); border-color: var(--emerald-dim); }

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.stat .label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.stat .value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--emerald);
}

.stat .value small { font-size: 0.65rem; color: var(--text-dim); font-weight: 400; margin-left: 2px; }

/* ---------- Route list ---------- */
.route-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.route-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s;
}

.route-item:hover { border-color: var(--emerald-dim); }
.route-item.active { border-color: var(--emerald); box-shadow: 0 0 0 1px var(--emerald) inset; }

.route-item .name {
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-item .meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.route-item .remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.route-item .remove:hover { color: var(--danger); }

.empty-msg {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  padding: 8px 0;
}

/* ---------- Map ---------- */
#map {
  width: 100%;
  height: 100%;
  background: var(--bg);
}

/* Leaflet dark theming */
.leaflet-container {
  background: #0c1210;
  font-family: var(--font-body);
}

/* Realce de las teselas: sube el contraste y un poco el brillo para que
   las vías y el texto se vean más blancos, manteniendo el fondo casi negro.
   Solo se aplica cuando el contenedor tiene la clase .map-enhanced (estilo oscuro). */
.map-enhanced .leaflet-tile {
  filter: brightness(1.35) contrast(1.35);
}

.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

.leaflet-control-zoom a:hover { background: var(--bg-elevated) !important; }

.leaflet-control-attribution {
  background: rgba(12,18,16,0.7) !important;
  color: var(--text-dim) !important;
}
.leaflet-control-attribution a { color: var(--emerald) !important; }

.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.leaflet-popup-tip { background: var(--bg-card); }
.leaflet-popup-content { font-size: 0.82rem; font-family: var(--font-body); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--emerald-dim); }

/* Toast */
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--emerald);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 2000;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-left-color: var(--danger); }

/* ---------- Auth ---------- */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  font-size: 0.8rem;
}

.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dim));
  display: flex; align-items: center; justify-content: center;
  color: #06140f; font-weight: 700; font-size: 0.75rem;
  flex-shrink: 0;
}

.user-email {
  color: var(--text-dim);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-small {
  width: auto;
  padding: 8px 14px;
  font-size: 0.8rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--emerald);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Modal de login/registro y otros modales */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 10, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
.modal-backdrop.hidden { display: none; }

/* Utilidad genérica: ocultar cualquier elemento con la clase .hidden */
.hidden { display: none !important; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.modal .subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-body);
}

.field input:focus {
  outline: none;
  border-color: var(--emerald);
}

.field-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-body);
  line-height: 1.5;
  resize: vertical;
  min-height: 72px;
}
.field-textarea:focus {
  outline: none;
  border-color: var(--emerald);
}

.modal-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-bottom: 12px;
  min-height: 1em;
}

.modal-footer {
  margin-top: 14px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* Botón guardar en panel de estadísticas */
.save-row {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.save-row .btn[disabled] { opacity: 0.6; }

.route-item.saved .name::after {
  content: " ☁";
  color: var(--emerald);
  font-size: 0.75em;
}

/* ---------- Botones mini (garaje / mantenimiento) ---------- */
.btn-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  line-height: 1;
}
.btn-mini:hover { border-color: var(--emerald-dim); color: var(--text); }
.btn-mini.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- Garaje ---------- */
.veh-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.veh-card.active { border-color: var(--emerald-dim); }
.veh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.veh-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.veh-badge {
  font-size: 0.62rem;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 6px;
}
.veh-actions { display: flex; gap: 4px; flex-shrink: 0; }
.veh-odo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--emerald);
  margin-bottom: 10px;
}
.veh-odo small { font-size: 0.62rem; color: var(--text-dim); }

.mtask { margin-bottom: 10px; }
.mtask:last-child { margin-bottom: 0; }
.mtask-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.mtask-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtask-km { font-family: var(--font-mono); font-size: 0.68rem; flex-shrink: 0; }
.mtask-km.ok   { color: var(--emerald); }
.mtask-km.warn { color: #ffb454; }
.mtask-km.bad  { color: var(--danger); }
.mbar {
  height: 5px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.mbar > i { display: block; height: 100%; border-radius: 3px; }
.mbar > i.ok   { background: var(--emerald); }
.mbar > i.warn { background: #ffb454; }
.mbar > i.bad  { background: var(--danger); }
.mtask-actions { display: flex; gap: 4px; }

.veh-empty-maint { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 8px; }

/* ============================================================
   HISTORIAL — tarjetas de rutas con scroll infinito
   ============================================================ */
.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.history-card:hover { border-color: var(--emerald-dim); }
.history-card:active { transform: scale(0.99); }

.history-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.history-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* En móvil, el nombre va en su propia línea (encima de los botones) para
   que se vea completo y no quede aplastado junto a compartir/editar/borrar. */
@media (max-width: 640px) {
  .history-card-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .history-card-name { white-space: normal; }
  .history-card-actions { justify-content: flex-start; flex-wrap: wrap; }
}

.history-card-date {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  flex-shrink: 0;
  white-space: nowrap;
}

.history-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 480px) {
  .history-card-stats { grid-template-columns: repeat(2, 1fr); }
}

.history-card-stats .stat { padding: 8px 10px; }
.history-card-stats .stat .value { font-size: 1rem; }

.history-loader {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 16px 0;
}

/* ============================================================
   CONVERTIR FIT → GPX — lista de resultados
   ============================================================ */
.convert-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.convert-result .name {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.convert-result .name.error { color: var(--danger); }

/* ============================================================
   PERFIL DE ELEVACIÓN
   ============================================================ */
.elev-profile {
  margin-top: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.elev-profile-title {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.elev-profile svg { overflow: visible; }

/* ============================================================
   SENTIDO DE LA RUTA — flujo animado (puntos que avanzan)
   ============================================================ */
/* Polilínea con guiones (puntos) que se desplazan = sensación de avance.
   Se aplica al <path> SVG que dibuja Leaflet (clase via className).
   Puntos negros con un halo claro para que destaquen sobre la línea verde. */
@keyframes routeFlow {
  to { stroke-dashoffset: -24; }
}
.route-flow {
  stroke-dasharray: 1 11;
  stroke-linecap: round;
  filter: drop-shadow(0 0 1.4px #e8efec) drop-shadow(0 0 1.4px #e8efec);
  animation: routeFlow 1s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .route-flow { animation: none; }
}

/* ============================================================
   CAMBIOS (changelog) — tarjetas tipo versión
   ============================================================ */
.changelog { display: flex; flex-direction: column; gap: 16px; }

.change-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
}
.change-card.latest { border-color: var(--emerald-dim); }

.change-card-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.change-version {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #06140f;
  background: var(--emerald);
  border-radius: 999px;
  padding: 2px 10px;
}
.change-card:not(.latest) .change-version {
  background: var(--bg-elevated);
  color: var(--emerald);
  border: 1px solid var(--border);
}
.change-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.change-date {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-left: auto;
}
.change-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald);
  border: 1px solid var(--emerald-dim);
  border-radius: 4px;
  padding: 1px 6px;
}
.change-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.change-list li {
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.45;
  padding-left: 20px;
  position: relative;
}
.change-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}
.change-list li.fix::before   { background: #ffb454; }
.change-list li.tweak::before { background: var(--text-dim); }

/* ============================================================
   SELECTOR DE CAPAS DEL MAPA (control de Leaflet) — tema oscuro
   ============================================================ */
.leaflet-control-layers {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
.leaflet-control-layers-toggle {
  background-color: var(--bg-card) !important;
  border-radius: 8px !important;
}
.leaflet-control-layers-expanded { padding: 10px 12px !important; }
.leaflet-control-layers-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text);
  margin: 3px 0;
  cursor: pointer;
}
.leaflet-control-layers-selector { accent-color: var(--emerald); cursor: pointer; }

/* ============================================================
   ENLACE LEGAL (discreto)
   ============================================================ */
.legal-link {
  display: block;
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-dim);
  opacity: 0.55;
  text-decoration: none;
  margin-top: 4px;
  padding: 6px;
  letter-spacing: 0.04em;
  transition: opacity .15s, color .15s;
}
.legal-link:hover { opacity: 1; color: var(--emerald); }

/* ============================================================
   HISTORIAL — búsqueda y acciones de tarjeta
   ============================================================ */
.search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-body);
}
.search-input:focus { outline: none; border-color: var(--emerald); }
.search-input::placeholder { color: var(--text-dim); }

.history-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.history-card-actions .btn-mini { font-size: 0.8rem; padding: 3px 7px; }
.btn-mini.btn-seguir-ruta { background: var(--emerald-glow); border-color: var(--emerald); color: var(--emerald); font-weight: 600; }

/* ============================================================
   PAGINADOR (historial)
   ============================================================ */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 4px;
}
.pager-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.pager-btn:hover:not(:disabled):not(.active) { border-color: var(--emerald-dim); color: var(--text); }
.pager-btn.active { background: var(--emerald); color: #06140f; border-color: var(--emerald); cursor: default; }
.pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pager-dots { color: var(--text-dim); padding: 0 2px; }

/* ============================================================
   SOCIAL — botón de me gusta y contadores
   ============================================================ */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.like-btn:hover { border-color: var(--danger); }
.like-btn.liked { border-color: var(--danger); color: var(--danger); }
.like-heart { font-size: 1.1rem; line-height: 1; }
.like-btn.liked .like-heart { color: var(--danger); }

/* Me gusta y visitas en las tarjetas de la galería */
.route-pub-social {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 0.72rem; color: var(--text-dim);
}
.route-pub-social .rp-like { display: inline-flex; align-items: center; gap: 4px; }
.route-pub-social .rp-like .h { color: var(--danger); }

/* ============================================================
   PERFIL — acciones (editar / compartir)
   ============================================================ */
.profile-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-icon {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-icon:hover { border-color: var(--emerald); color: var(--emerald); }

/* Pestaña con solo icono (engranaje de Ajustes) */
.nav-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
}
.nav-tab-icon svg { display: block; }
@media (max-width: 640px) {
  /* En el menú desplegable, el engranaje va centrado con algo de aire */
  .nav-tab-icon { padding: 12px 14px; }
}

/* ============================================================
   CONTROL DE SESIÓN EN LA CABECERA (compartido)
   ============================================================ */
.auth-slot { display: flex; align-items: center; flex-shrink: 0; }
.ubicacion-slot { display: inline-block; align-items: center; color: var(--text-dim); font-size: 0.8rem; white-space: nowrap; margin-right: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
@media (max-width: 1150px) { .ubicacion-slot { display: none; } }
.auth-user {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  transition: border-color .15s;
  max-width: 180px;
}
.auth-user:hover { border-color: var(--emerald); }
.auth-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--emerald); color: #06140f;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.auth-name {
  font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Enlaces del pie (Novedades · Legal) */
.footer-links {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap; margin-top: 4px;
}
.legal-sep { color: var(--text-dim); opacity: 0.5; font-size: 0.68rem; }

/* ============================================================
   INTERRUPTOR DE COMPARTIR (tarjetas del historial)
   ============================================================ */
.btn-mini.share-toggle {
  position: relative;
  white-space: nowrap;
  font-weight: 600;
  transition: border-color .15s, background .15s, color .15s, opacity .15s;
}
/* Estado privado (apagado): neutro */
.btn-mini.share-toggle {
  border-color: var(--border);
  color: var(--text-dim);
}
/* Estado compartido (encendido): verde */
.btn-mini.share-toggle.on {
  border-color: var(--emerald);
  background: var(--emerald-glow);
  color: var(--emerald);
}
.btn-mini.share-toggle:hover { border-color: var(--emerald); }
/* Mientras hace la operación */
.btn-mini.share-toggle.loading { opacity: 0.6; cursor: progress; }

/* ============================================================
   COMENTARIOS (página de ruta pública)
   ============================================================ */
.comments-count { color: var(--text-dim); font-weight: 400; font-size: 0.85rem; }

.comment-form { margin-bottom: 16px; }
.comment-form textarea {
  width: 100%; resize: vertical; min-height: 44px;
  padding: 10px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: var(--font-body); font-size: 0.9rem; line-height: 1.4;
  box-sizing: border-box;
}
.comment-form textarea:focus { outline: none; border-color: var(--emerald); }
.comment-form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.comment-chars { font-size: 0.72rem; color: var(--text-dim); font-family: var(--font-mono); }

.comments-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--emerald); color: #06140f;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.comment-date { font-size: 0.72rem; color: var(--text-dim); }
.comment-text { font-size: 0.88rem; color: var(--text); line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.comment-del {
  background: none; border: none; cursor: pointer;
  font-size: 0.85rem; opacity: 0.5; padding: 2px 4px; flex-shrink: 0;
  transition: opacity .15s;
}
.comment-del:hover { opacity: 1; }

/* ============================================================
   SEGUIR A OTROS MOTEROS
   ============================================================ */
.follow-btn.following {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.follow-btn.following:hover { border-color: var(--danger); color: var(--danger); }

.follow-counts { display: flex; gap: 16px; margin-top: 8px; }
.follow-count {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--text-dim); font-size: 0.82rem; font-family: var(--font-body);
}
.follow-count b { color: var(--text); font-weight: 700; }
.follow-count:hover { color: var(--emerald); }
.follow-count:hover b { color: var(--emerald); }

/* Filas de la lista de seguidores/seguidos (en el modal) */
.follow-list { display: flex; flex-direction: column; gap: 4px; }
.follow-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  text-decoration: none; color: var(--text);
  transition: background .15s;
}
.follow-row:hover { background: var(--bg-elevated); }
.follow-row-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #06140f; font-weight: 700; font-size: 0.9rem;
}
.follow-row-name { font-size: 0.9rem; font-weight: 600; }

/* Pestañas de feed en Explorar (Todas / Siguiendo) */
.explore-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.explore-tab {
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-dim); font-family: var(--font-body); font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: all .15s;
}
.explore-tab:hover { border-color: var(--emerald-dim); color: var(--text); }
.explore-tab.active { background: var(--emerald); border-color: var(--emerald); color: #06140f; }

/* Foto de perfil dentro del avatar (rellena el círculo) */
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* ============================================================
   HISTORIAL/PERFIL — selector Rutas/Roadbooks y distintivo
   ============================================================ */
.hist-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.hist-tab {
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-dim); font-family: var(--font-body); font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: all .15s;
}
.hist-tab:hover { border-color: var(--emerald-dim); color: var(--text); }
.hist-tab.active { background: var(--emerald); border-color: var(--emerald); color: #06140f; }

/* Distintivo "Roadbook" (rojo) en listas */
.rb-badge-hist {
  display: inline-block; background: var(--danger); color: #fff;
  font-size: 0.58rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.03em; vertical-align: middle; margin-left: 4px;
}

/* Tarjetas de roadbook en el perfil */
.rb-prof-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-card); text-decoration: none; color: inherit; transition: border-color .15s;
}
.rb-prof-card:hover { border-color: var(--emerald); }
.rb-prof-name { font-weight: 600; color: var(--text); }
.rb-prof-meta { font-size: 0.76rem; color: var(--text-dim); font-family: var(--font-mono); flex-shrink: 0; }

/* ============================================================
   EFECTOS DE LOS TEMAS ESPECTACULARES
   Se activan solo cuando el <html> tiene el data-theme correspondiente.
   ============================================================ */

/* ---- Fondo con degradado ambiental (común a los 4) ---- */
[data-theme="neon"] body,
[data-theme="premium"] body,
[data-theme="racing"] body,
[data-theme="sunset"] body,
[data-theme="genart"] body,
[data-theme="deporte"] body {
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--emerald-glow), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, color-mix(in srgb, var(--grad-2) 22%, transparent), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* ---- Acento con degradado en el título de cabecera de marca ---- */
[data-theme="neon"] .brand-text h1,
[data-theme="premium"] .brand-text h1,
[data-theme="racing"] .brand-text h1,
[data-theme="sunset"] .brand-text h1,
[data-theme="deporte"] .brand-text h1,
[data-theme="genart"] .brand-text h1 {
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2), var(--grad-3));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Neón y racing: el degradado del título se ANIMA (efecto marcado) */
[data-theme="neon"] .brand-text h1,
[data-theme="racing"] .brand-text h1,
[data-theme="deporte"] .brand-text h1,
[data-theme="genart"] .brand-text h1 {
  animation: gradShift 6s linear infinite;
}
@keyframes gradShift { to { background-position: 200% center; } }

/* ---- Botones principales con degradado ---- */
[data-theme="neon"] .btn,
[data-theme="premium"] .btn,
[data-theme="racing"] .btn,
[data-theme="sunset"] .btn,
[data-theme="deporte"] .btn,
[data-theme="genart"] .btn {
  background: linear-gradient(120deg, var(--grad-1), var(--grad-2));
  border: none; color: #0a0a0a; font-weight: 700;
  box-shadow: 0 4px 18px var(--emerald-glow);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
[data-theme="neon"] .btn:hover,
[data-theme="premium"] .btn:hover,
[data-theme="racing"] .btn:hover,
[data-theme="sunset"] .btn:hover,
[data-theme="deporte"] .btn:hover,
[data-theme="genart"] .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--emerald-glow);
  filter: brightness(1.08);
}

/* ---- Tarjetas y paneles con brillo sutil en el borde al pasar el ratón ---- */
[data-theme="neon"] .panel, [data-theme="neon"] .change-card,
[data-theme="premium"] .panel, [data-theme="premium"] .change-card,
[data-theme="racing"] .panel, [data-theme="racing"] .change-card,
[data-theme="sunset"] .panel, [data-theme="sunset"] .change-card,
[data-theme="deporte"] .panel, [data-theme="deporte"] .change-card,
[data-theme="genart"] .panel, [data-theme="genart"] .change-card {
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
[data-theme="neon"] .panel:hover,
[data-theme="premium"] .panel:hover,
[data-theme="racing"] .panel:hover,
[data-theme="sunset"] .panel:hover,
[data-theme="deporte"] .panel:hover,
[data-theme="genart"] .panel:hover {
  border-color: var(--emerald);
  box-shadow: 0 6px 30px var(--emerald-glow);
}

/* ---- Tabs de navegación activas con degradado ---- */
[data-theme="neon"] .nav-tab.active,
[data-theme="premium"] .nav-tab.active,
[data-theme="racing"] .nav-tab.active,
[data-theme="sunset"] .nav-tab.active,
[data-theme="deporte"] .nav-tab.active,
[data-theme="genart"] .nav-tab.active {
  background: linear-gradient(120deg, var(--grad-1), var(--grad-2));
  color: #0a0a0a; font-weight: 700;
}

/* ---- El "punto" de los títulos de sección brilla (efecto sutil) ---- */
[data-theme="neon"] .dot,
[data-theme="premium"] .dot,
[data-theme="racing"] .dot,
[data-theme="sunset"] .dot,
[data-theme="deporte"] .dot,
[data-theme="genart"] .dot {
  box-shadow: 0 0 8px var(--emerald), 0 0 16px var(--emerald-glow);
}

/* Neón: el punto PULSA (efecto marcado) */
[data-theme="neon"] .dot,
[data-theme="racing"] .dot {
  animation: dotPulse 1.8s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 6px var(--emerald), 0 0 12px var(--emerald-glow); }
  50%      { box-shadow: 0 0 12px var(--emerald), 0 0 26px var(--emerald-glow); }
}

/* ---- Respeto por quien prefiere menos movimiento ---- */
@media (prefers-reduced-motion: reduce) {
  [data-theme] .brand-text h1,
  [data-theme] .dot { animation: none !important; }
}

/* Botón destacado "Seguir esta ruta" (mapa y ficha de ruta pública) */
.btn-seguir-grande {
  width: 100%;
  margin: 12px 0 10px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--grad-1), var(--grad-2));
  color: #fff;
  border: none;
}
.btn-seguir-grande:hover { opacity: 0.92; transform: translateY(-1px); }

/* ============================================================
   AYUDA / INFORMACIÓN (desplegable, compacto)
   Usa <details>: el texto vive en el HTML aunque se vea cerrado,
   así los buscadores lo indexan sin ocupar espacio en pantalla.
   Dos variantes:
     .info-seo            -> debajo del contenido (fila horizontal)
     .info-seo.en-sidebar -> dentro de la barra lateral (apilado)
   ============================================================ */
.info-seo {
  margin: 14px auto 0;
  padding: 0 16px 18px;
  max-width: 1100px;
}
.info-seo .info-titulo {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  opacity: 0.7;
  margin-bottom: 6px;
}
/* Los desplegables van en fila; si no caben, pasan abajo */
.info-seo .info-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.info-seo details {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
}
/* Al abrirse ocupa toda la fila, para que el texto se lea bien */
.info-seo details[open] { flex-basis: 100%; }

.info-seo summary {
  cursor: pointer;
  padding: 6px 10px;
  font-weight: 500;
  color: var(--text-dim);
  font-size: 0.72rem;
  line-height: 1.3;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info-seo summary::-webkit-details-marker { display: none; }
.info-seo summary::before {
  content: '?';
  flex-shrink: 0;
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.58rem;
  line-height: 11px;
  text-align: center;
  opacity: 0.6;
}
.info-seo details[open] summary::before { content: '−'; border: none; font-size: 0.9rem; line-height: 13px; }
.info-seo summary:hover { color: var(--emerald); }

.info-seo .info-cuerpo {
  padding: 2px 10px 10px;
  color: var(--text-dim);
  font-size: 0.76rem;
  line-height: 1.5;
}
.info-seo .info-cuerpo h3 { color: var(--text); font-size: 0.78rem; margin: 8px 0 3px; }
.info-seo .info-cuerpo p { margin-bottom: 6px; }
.info-seo .info-cuerpo ul { margin: 4px 0 6px 16px; }
.info-seo .info-cuerpo li { margin-bottom: 3px; }
.info-seo .info-cuerpo strong { color: var(--text); }
.info-seo .info-cuerpo a { color: var(--emerald); }

/* Móvil: dos por fila para ocupar la mitad de alto */
@media (max-width: 700px) {
  .info-seo { padding: 0 12px 14px; }
  .info-seo .info-lista { gap: 4px; }
  .info-seo details { flex: 1 1 calc(50% - 4px); }
  .info-seo details[open] { flex-basis: 100%; }
  .info-seo summary { font-size: 0.68rem; padding: 5px 8px; }
  .info-seo summary::before { width: 12px; height: 12px; line-height: 10px; font-size: 0.55rem; }
  .info-seo .info-cuerpo { font-size: 0.73rem; }
}

/* Variante dentro de la barra lateral: siempre apilado y estrecho */
.info-seo.en-sidebar {
  margin: 10px 0 0;
  padding: 0;
  max-width: none;
}
.info-seo.en-sidebar .info-lista { flex-direction: column; gap: 4px; }
.info-seo.en-sidebar details { flex-basis: auto; }
.info-seo.en-sidebar summary { white-space: normal; }


/* Marcador de parada / punto de interés en el mapa (index, ruta, seguir) */
.parada-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--emerald);
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
}

/* Aviso de parada cercana en el modo Seguir */
.aviso-parada {
  background: var(--emerald-glow);
  border: 1px solid var(--emerald);
  color: var(--emerald);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.4;
}
.aviso-parada .aviso-dist { color: var(--text-dim); font-size: 0.78rem; white-space: nowrap; }
