:root {
  --noche: #0a1220;
  --cristal: rgba(12, 20, 36, .78);
  --cristal-2: rgba(22, 33, 54, .86);
  --borde: rgba(255, 255, 255, .09);
  --texto: #eef2f7;
  --suave: #9aa8bd;
  --verde: #00a650;      /* bandera de Andalucía */
  --verde-2: #2ee68a;
  --albero: #f2b632;     /* albero sevillano */
  --azulejo: #3b82f6;
  --rojo: #ff5d5d;
  --ambar: #ffb547;
  --radio: 18px;
  --sombra: 0 18px 50px rgba(0, 0, 0, .45);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--noche); color: var(--texto); font: 15px/1.45 'Sora', system-ui, sans-serif; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--albero); outline-offset: 2px; }
#mapa { position: fixed; inset: 0; background: #06101c; }
.leaflet-container { font-family: inherit; background: #06101c; }
.leaflet-control-attribution { background: rgba(10, 18, 32, .7) !important; color: #9aa8bd !important; font-size: 10px; }
.leaflet-control-attribution a { color: #c9d4e3 !important; }
.leaflet-control-zoom { display: none; }

/* ---------- Barra superior ---------- */
.barra {
  position: fixed; top: 14px; left: 14px; right: 14px; z-index: 1000;
  display: flex; align-items: center; gap: 14px; pointer-events: none;
}
.barra > * { pointer-events: auto; }
.marca {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px; border-radius: 999px;
  background: var(--cristal); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--borde); color: var(--texto); text-decoration: none; box-shadow: var(--sombra); white-space: nowrap;
  font-size: 15px; letter-spacing: -.01em;
}
.marca b { color: var(--verde-2); font-weight: 800; }
.estrella { width: 28px; height: 28px; color: var(--verde); animation: girar 40s linear infinite; filter: drop-shadow(0 0 8px rgba(0, 166, 80, .6)); }
@keyframes girar { to { transform: rotate(360deg); } }
.buscador {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 999px;
  background: var(--cristal); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--borde);
  color: var(--suave); box-shadow: var(--sombra); text-align: left; transition: border-color .2s, transform .2s;
}
.buscador:hover { border-color: rgba(242, 182, 50, .5); transform: translateY(-1px); }
.buscador svg { width: 18px; height: 18px; flex: none; }
.buscador span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 600 11px var(--mono); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--borde); background: rgba(255, 255, 255, .06); color: var(--suave); }
.estado-red { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-radius: 999px; background: var(--cristal); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--borde); box-shadow: var(--sombra); }
.en-directo { display: flex; align-items: center; gap: 7px; font: 700 11px var(--mono); letter-spacing: .12em; color: var(--verde-2); }
.en-directo i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: latido 1.6s infinite; }
.en-directo.caido { color: var(--ambar); }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(46, 230, 138, .7); } 70% { box-shadow: 0 0 0 9px rgba(46, 230, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 230, 138, 0); } }
.reloj { font: 700 15px var(--mono); padding: 5px 11px; border-radius: 999px; background: rgba(0, 0, 0, .35); letter-spacing: .04em; }

/* ---------- Panel ---------- */
.panel {
  position: fixed; z-index: 900; top: 78px; left: 14px; bottom: 14px; width: 410px;
  display: flex; flex-direction: column; border-radius: var(--radio); overflow: hidden;
  background: var(--cristal); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--borde); box-shadow: var(--sombra);
}
.asa { display: none; }
.pestanas { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--borde); }
.pestanas button { flex: 1; padding: 9px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--suave); font-weight: 600; font-size: 13px; position: relative; transition: background .2s, color .2s; }
.pestanas button:hover { color: var(--texto); background: rgba(255, 255, 255, .04); }
.pestanas button.activa { background: rgba(0, 166, 80, .16); color: var(--verde-2); }
.pestanas .punto { position: absolute; top: 6px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--albero); animation: latido 1.6s infinite; }
.contenido { flex: 1; overflow-y: auto; padding: 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.contenido > * { animation: entrar .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } }
h2 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.02em; }
h3 { font-size: 12px; margin: 22px 0 10px; color: var(--suave); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.sub { color: var(--suave); font-size: 13px; margin: 0 0 14px; }
.volver { border: 0; background: none; color: var(--suave); padding: 0 0 10px; font-size: 13px; }
.volver:hover { color: var(--texto); }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--borde); position: relative; overflow: hidden; }
.kpi b { display: block; font: 700 28px var(--mono); letter-spacing: -.03em; }
.kpi span { font-size: 12px; color: var(--suave); }
.kpi.verde b { color: var(--verde-2); }
.kpi.albero b { color: var(--albero); }
.kpi svg.spark { position: absolute; right: 8px; bottom: 8px; width: 70px; height: 26px; opacity: .9; }
.medidor { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 8px; }
.medidor i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--verde), var(--verde-2)); transition: width .8s; }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fila {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 12px; border: 1px solid transparent;
  background: rgba(255, 255, 255, .035); cursor: pointer; transition: background .15s, border-color .15s, transform .15s; width: 100%; text-align: left;
}
.fila:hover { background: rgba(255, 255, 255, .07); border-color: var(--borde); transform: translateX(2px); }
.fila .info { flex: 1; min-width: 0; }
.fila .t1 { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .t2 { font-size: 12px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 26px; padding: 0 8px; border-radius: 8px; font: 700 12px var(--mono); color: #fff; background: var(--c, var(--verde)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.etiqueta { font: 700 10px var(--mono); padding: 2px 6px; border-radius: 6px; letter-spacing: .05em; text-transform: uppercase; }
.e-ok { background: rgba(46, 230, 138, .14); color: var(--verde-2); }
.e-warn { background: rgba(255, 181, 71, .15); color: var(--ambar); }
.e-mal { background: rgba(255, 93, 93, .15); color: var(--rojo); }
.e-info { background: rgba(255, 255, 255, .08); color: var(--suave); }
.e-gps { background: rgba(59, 130, 246, .18); color: #8db8ff; }

/* Panel de salidas (estilo panel de estación) */
.tablero { border-radius: 14px; overflow: hidden; border: 1px solid var(--borde); background: #05090f; }
.tablero-cab { display: grid; grid-template-columns: 58px 52px 1fr 70px; gap: 8px; padding: 9px 12px; font: 700 10px var(--mono); color: var(--albero); letter-spacing: .12em; background: #0b1424; }
.salida { display: grid; grid-template-columns: 58px 52px 1fr 70px; gap: 8px; align-items: center; padding: 9px 12px; border-top: 1px solid rgba(255, 255, 255, .05); cursor: pointer; }
.salida:hover { background: rgba(255, 255, 255, .04); }
.salida .hora { font: 700 15px var(--mono); color: var(--albero); }
.salida .hora s { display: block; color: var(--suave); font-size: 11px; font-weight: 500; }
.salida .dest { min-width: 0; }
.salida .dest b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salida .dest small { color: var(--suave); font-size: 11px; }
.salida .min { text-align: right; font: 700 14px var(--mono); }
.salida .min.ya { color: var(--verde-2); animation: parpadeo 1s steps(2) infinite; }
@keyframes parpadeo { 50% { opacity: .35; } }
.flap { display: inline-block; animation: flap .45s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: 50% 50%; }
@keyframes flap { 0% { transform: rotateX(90deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cancelado { text-decoration: line-through; opacity: .5; }
.vacio { padding: 26px 16px; text-align: center; color: var(--suave); font-size: 13px; }

/* Botones */
.acciones { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--borde); background: rgba(255, 255, 255, .05); font-weight: 600; font-size: 13px; transition: background .15s, transform .15s; }
.btn:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primario { background: var(--verde); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(0, 166, 80, .35); }
.btn.primario:hover { background: #00b85a; }
.btn.fav.on { color: var(--albero); border-color: rgba(242, 182, 50, .4); }

/* Línea de tiempo del vehículo */
.cabecera-veh { display: flex; gap: 12px; align-items: center; }
.cabecera-veh .icono { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--c); box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 45%, transparent); flex: none; }
.cabecera-veh .icono svg { width: 28px; height: 28px; color: #fff; }
.recorrido { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.recorrido li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; position: relative; cursor: pointer; border-radius: 8px; }
.recorrido li:hover .nom { color: var(--albero); }
.recorrido li::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--c); opacity: .5; }
.recorrido li:first-child::before { top: 50%; }
.recorrido li:last-child::before { bottom: 50%; }
.recorrido .nodo { width: 12px; height: 12px; border-radius: 50%; background: var(--noche); border: 2px solid var(--c); margin-left: 5px; z-index: 1; }
.recorrido li.pasada { opacity: .45; }
.recorrido li.pasada .nodo { background: var(--c); }
.recorrido li.proxima .nodo { width: 16px; height: 16px; margin-left: 3px; background: var(--albero); border-color: #fff; box-shadow: 0 0 0 5px rgba(242, 182, 50, .25); }
.recorrido li.destino .nom { color: var(--verde-2); font-weight: 700; }
.recorrido .nom { font-size: 13px; }
.recorrido .h { font: 600 12px var(--mono); color: var(--suave); text-align: right; }
.recorrido .h b { color: var(--texto); }
.recorrido .bolita { position: absolute; left: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px var(--c), 0 0 18px var(--c); z-index: 2; transition: top 1s; pointer-events: none; }

/* Mi viaje: anillo de cuenta atrás */
.viaje-hero { display: grid; place-items: center; text-align: center; padding: 6px 0 4px; }
.anillo { position: relative; width: 210px; height: 210px; }
.anillo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anillo .fondo { stroke: rgba(255, 255, 255, .08); }
.anillo .progreso { stroke: url(#grad); stroke-linecap: round; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 8px rgba(46, 230, 138, .5)); }
.anillo .centro { position: absolute; inset: 0; display: grid; place-content: center; }
.anillo .grande { font: 800 50px/1 var(--mono); letter-spacing: -.05em; }
.anillo .grande small { font-size: 18px; letter-spacing: 0; }
.anillo .peq { font-size: 12px; color: var(--suave); margin-top: 4px; }
.datos-viaje { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.datos-viaje div { padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); text-align: center; }
.datos-viaje b { display: block; font: 700 16px var(--mono); }
.datos-viaje span { font-size: 11px; color: var(--suave); }
.nota { font-size: 12px; color: var(--suave); padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px dashed var(--borde); margin-top: 12px; }

/* Radar */
.radar { position: relative; width: 100%; aspect-ratio: 1.8; border-radius: 16px; overflow: hidden; background: radial-gradient(circle at 50% 50%, rgba(0, 166, 80, .18), transparent 70%), #050b14; border: 1px solid var(--borde); margin-bottom: 12px; }
.radar::before { content: ''; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 50% 50%, transparent 0 34px, rgba(46, 230, 138, .14) 35px 36px); }
.radar .barrido { position: absolute; left: 50%; top: 50%; width: 140%; aspect-ratio: 1; transform: translate(-50%, -50%); background: conic-gradient(from 0deg, rgba(46, 230, 138, .45), transparent 22%); border-radius: 50%; animation: girar 3.2s linear infinite; }
.radar .yo { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px var(--azulejo), 0 0 20px var(--azulejo); }
.radar .eco { position: absolute; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--albero); box-shadow: 0 0 10px var(--albero); animation: eco 3.2s infinite; }
@keyframes eco { 0%, 100% { opacity: .35; transform: scale(.8); } 15% { opacity: 1; transform: scale(1.4); } }

/* ---------- Controles del mapa (columna derecha, sin solaparse con nada) ---------- */
.controles { position: fixed; z-index: 900; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; transition: top .35s, bottom .35s; }
.redondo { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--borde); background: var(--cristal); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: grid; place-items: center; box-shadow: var(--sombra); transition: transform .2s, background .2s; }
.redondo:hover { transform: scale(1.06); }
.redondo.activo { background: rgba(0, 166, 80, .35); border-color: rgba(46, 230, 138, .5); }
.redondo svg { width: 21px; height: 21px; }
.zoom { display: flex; flex-direction: column; border-radius: 23px; overflow: hidden; border: 1px solid var(--borde); background: var(--cristal); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--sombra); }
.zoom button { width: 46px; height: 42px; border: 0; background: none; font: 600 22px/1 'Sora', sans-serif; }
.zoom button + button { border-top: 1px solid var(--borde); }
.zoom button:hover { background: rgba(255, 255, 255, .08); }

/* Menú de capas */
.menu-capas { position: fixed; z-index: 1100; right: 72px; top: 50%; transform: translateY(-50%); width: 290px; max-height: calc(100vh - 120px); overflow-y: auto;
  padding: 14px; border-radius: 18px; background: var(--cristal-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--borde); box-shadow: var(--sombra); animation: entrar .2s both; }
.menu-capas[hidden] { display: none; }
.menu-capas h4 { margin: 4px 2px 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--suave); }
.menu-capas h4 + * { margin-bottom: 14px; }
.bases { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bases button { display: flex; align-items: center; gap: 8px; padding: 7px; border-radius: 11px; border: 1px solid var(--borde); background: rgba(255, 255, 255, .03); font-size: 12px; font-weight: 600; text-align: left; }
.bases button.on { border-color: var(--verde-2); background: rgba(0, 166, 80, .15); }
.bases i { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.mini-sat { background: linear-gradient(135deg, #5d6b3c, #a58e5d 50%, #2f5b7a); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
.mini-sat.puro { box-shadow: none; }
.mini-noche { background: linear-gradient(135deg, #2a2a2a, #4a4a4a); }
.mini-calle { background: linear-gradient(135deg, #f4efe1, #f7c9a1); }
.filtros { display: flex; flex-direction: column; gap: 5px; }
.chip { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 11px; border: 1px solid var(--borde); background: rgba(255, 255, 255, .03); font-size: 13px; font-weight: 600; color: var(--suave); text-align: left; transition: color .2s, background .2s; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); opacity: .3; transition: opacity .2s, box-shadow .2s; }
.chip.on { color: var(--texto); background: rgba(255, 255, 255, .06); }
.chip.on i { opacity: 1; box-shadow: 0 0 10px var(--c); }
.leyenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 12px; color: var(--suave); }
.leyenda li { display: flex; align-items: center; gap: 10px; }
.ley-veh { width: 16px; height: 16px; border-radius: 50%; background: #3b6fb6; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); flex: none; }
.ley-veh.gps { background: #78b4e1; box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(120, 180, 225, .35); }
.ley-veh.tarde { box-shadow: 0 0 0 2px var(--ambar); }
.ley-est { width: 12px; height: 12px; margin: 2px; background: #fff; border: 3px solid #c2185b; border-radius: 3px; transform: rotate(45deg); flex: none; }
.ley-par { width: 10px; height: 10px; margin: 3px; border-radius: 50%; background: var(--albero); border: 2px solid #0a1220; flex: none; }

/* Panel plegable (escritorio) */
.plegar { flex: 0 0 34px !important; font-size: 18px !important; color: var(--suave); }
.desplegar { display: none; position: fixed; z-index: 900; left: 14px; top: 78px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--borde); background: var(--cristal); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--sombra); font-weight: 600; font-size: 13px; }
body.panel-oculto .panel { transform: translateX(calc(-100% - 30px)); }
body.panel-oculto .desplegar { display: block; }
.panel { transition: transform .35s cubic-bezier(.2, .8, .2, 1), height .35s cubic-bezier(.2, .8, .2, 1); }

/* ---------- Marcadores ---------- */
.veh { position: relative; }
.veh .pin {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px 0 4px; border-radius: 999px; white-space: nowrap;
  background: var(--c); color: #fff; font: 700 10.5px/1 var(--mono); box-shadow: 0 2px 8px rgba(0, 0, 0, .5), 0 0 0 1.5px rgba(255, 255, 255, .9);
  transition: transform .2s;
}
.veh .pin span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
.veh .pin svg { width: 14px; height: 14px; flex: none; }
.veh.est .pin { box-shadow: 0 2px 8px rgba(0, 0, 0, .5), 0 0 0 1.5px rgba(255, 255, 255, .5); background: color-mix(in srgb, var(--c) 80%, #000); }
.veh.gps .pin::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--c); animation: onda 2s infinite; pointer-events: none; }
@keyframes onda { to { inset: -10px; opacity: 0; } }
.veh.retraso .pin { box-shadow: 0 2px 8px rgba(0, 0, 0, .5), 0 0 0 2px var(--ambar); }
/* Nivel icono: círculo sin texto */
.veh.n-icono .pin { width: 22px; padding: 0; justify-content: center; }
.veh.n-icono .pin span { display: none; }
/* Nivel punto: sólo un punto de color */
.veh.n-punto .pin { width: 10px; height: 10px; padding: 0; gap: 0; }
.veh.n-punto .pin span, .veh.n-punto .pin svg { display: none; }
.veh.n-punto.gps .pin::after { animation: none; display: none; }
.veh.sel .pin { transform: translate(-50%, -50%) scale(1.3); z-index: 5; box-shadow: 0 0 0 3px var(--albero), 0 0 26px var(--albero); }
.estacion-ico { width: 11px; height: 11px; margin: -5.5px; border-radius: 3px; background: #fff; border: 2.5px solid var(--c, #c2185b); box-shadow: 0 1px 5px rgba(0, 0, 0, .6); transform: rotate(45deg); }
.estacion-ico.grande { width: 15px; height: 15px; margin: -7.5px; border-width: 3px; }
.yo-mapa { width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: #fff; border: 4px solid var(--azulejo); box-shadow: 0 0 0 8px rgba(59, 130, 246, .25); }
.leaflet-tooltip.tt { max-width: 240px; white-space: normal; background: var(--cristal-2); color: var(--texto); border: 1px solid var(--borde); border-radius: 10px; box-shadow: var(--sombra); font: 600 12px 'Sora', sans-serif; padding: 6px 10px; backdrop-filter: blur(10px); }
.leaflet-tooltip.tt::before { display: none; }
.tt small { display: block; color: var(--suave); font-weight: 400; }

/* ---------- Paleta de búsqueda ---------- */
.paleta { position: fixed; inset: 0; z-index: 2000; background: rgba(3, 7, 14, .55); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.paleta[hidden] { display: none; }
.paleta-caja { width: 100%; max-width: 640px; border-radius: 20px; background: var(--cristal-2); border: 1px solid var(--borde); box-shadow: 0 30px 90px rgba(0, 0, 0, .6); overflow: hidden; animation: entrar .25s both; }
.paleta-entrada { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--borde); }
.paleta-entrada svg { width: 20px; height: 20px; color: var(--albero); }
.paleta-entrada input { flex: 1; border: 0; background: transparent; color: var(--texto); font: 500 17px 'Sora', sans-serif; outline: none; min-width: 0; }
.resultados { list-style: none; margin: 0; padding: 8px; max-height: 55vh; overflow-y: auto; }
.resultados li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.resultados li.sel, .resultados li:hover { background: rgba(255, 255, 255, .07); }
.resultados .tipo { width: 42px; font-size: 9px; overflow: hidden; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.06); }
.resultados .tipo svg { width: 18px; height: 18px; }
.resultados mark { background: none; color: var(--albero); font-weight: 700; }
.paleta-pie { margin: 0; padding: 10px 18px; font-size: 11px; color: var(--suave); border-top: 1px solid var(--borde); }

.aviso { position: fixed; z-index: 3000; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; padding: 11px 18px; border-radius: 999px; background: var(--cristal-2); border: 1px solid var(--borde); box-shadow: var(--sombra); font-size: 13px; transition: .3s; pointer-events: none; max-width: calc(100vw - 32px); }
.aviso.ver { opacity: 1; transform: translate(-50%, 0); }

.esqueleto { height: 46px; border-radius: 12px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: brillo 1.2s infinite; margin-bottom: 6px; }
@keyframes brillo { to { background-position: -200% 0; } }
.carga { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--suave); }
.carga .medidor { flex: 1; margin: 0; height: 5px; }
.fuentes { font-size: 11px; color: var(--suave); margin-top: 20px; line-height: 1.6; }
.fuentes a { color: #c9d4e3; }

/* ---------- Pantallas medianas ---------- */
@media (max-width: 1100px) and (min-width: 761px) {
  .panel { width: 360px; }
  .estado-red .en-directo { display: none; }
}

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  .barra { top: 10px; left: 10px; right: 10px; gap: 8px; }
  .marca span { display: none; }
  .marca { padding: 7px; }
  .estrella { width: 26px; height: 26px; }
  .buscador { padding: 10px 14px; min-width: 0; }
  .buscador kbd { display: none; }
  .estado-red { padding: 6px; gap: 0; }
  .estado-red .en-directo { font-size: 0; gap: 0; padding: 0 6px; }
  .reloj { font-size: 13px; padding: 4px 8px; }
  .plegar, .desplegar { display: none !important; }
  body.panel-oculto .panel { transform: none; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 46vh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .panel.alto { height: 86vh; }
  .panel.bajo { height: 112px; }
  .asa { display: block; width: 46px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .25); margin: 8px auto 0; cursor: grab; touch-action: none; }
  .pestanas button { font-size: 12px; padding: 8px 2px; }
  .controles { top: auto; transform: none; bottom: calc(46vh + 12px); right: 10px; gap: 8px; }
  .zoom { display: none; }
  .redondo { width: 42px; height: 42px; }
  body.panel-alto .controles { opacity: 0; pointer-events: none; }
  body.panel-bajo .controles { bottom: 126px; }
  .menu-capas { top: 64px; right: 10px; left: 10px; width: auto; transform: none; max-height: calc(54vh - 80px); }
  .anillo { width: 180px; height: 180px; }
  .anillo .grande { font-size: 42px; }
  .paleta { padding-top: 64px; }
  .leaflet-control-attribution { font-size: 9px; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
.quieto > * { animation: none !important; }
.quieto .salida, .quieto .flap { animation: none !important; }

/* Nombres largos: que nunca desborden */
.contenido h2 { overflow-wrap: anywhere; line-height: 1.2; }
.sub, .nota, .recorrido .nom, .salida .dest b { overflow-wrap: anywhere; }
.cabecera-veh > div:last-child { min-width: 0; }
.cabecera-veh h2 { font-size: 18px; }
.recorrido .nom { line-height: 1.25; }
.pestanas button[data-tab] { white-space: nowrap; font-size: 12.5px; }
