/* Recorrido histórico */
.rh-filtros { margin-bottom: 14px; }
.rh-fila { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rh-fila label { display: grid; gap: 4px; font-size: 12px; color: var(--muted, #6b7a89); flex: 1 1 160px; min-width: 150px; }
.rh-fila input, .rh-fila select { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--borde, #cfd8df); background: var(--panel, #fff); color: inherit; }
.rh-atajos { margin-top: 10px; align-items: center; }
.rh-atajos .st-chip { cursor: pointer; }
.rh-color { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted, #6b7a89); }
.rh-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.rh-mapa-caja { padding: 0; overflow: hidden; position: relative; }
.rh-mapa { height: clamp(520px, 72vh, 900px); width: 100%; }
.rh-play { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--borde, #d5dde3); }
.rh-play button { font-size: 16px; width: 34px; height: 34px; border-radius: 50%; border: none; background: #1e88d8; color: #fff; cursor: pointer; }
.rh-play input[type=range] { flex: 1; }
.rh-play span { font-size: 13px; white-space: nowrap; }
.rh-paradas { max-height: 600px; overflow: auto; }
.rh-pista { font-size: 12px; color: var(--muted, #6b7a89); margin: 0 0 8px; }
.rh-serv { font-size: 13px; margin: 0 0 8px; }
.rh-parada { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: start; width: 100%; text-align: left; font: inherit; padding: 8px 6px; border: none; border-bottom: 1px solid var(--borde, #e3e9ee); background: transparent; color: inherit; cursor: pointer; }
.rh-parada:hover, .rh-parada.on { background: rgba(30, 136, 216, .1); }
.rh-hr { font-size: 12px; font-weight: 600; }
.rh-nom b { display: block; font-size: 13px; }
.rh-nom small { display: block; font-size: 12px; color: var(--muted, #6b7a89); }
.rh-nom small.ok { color: #1f9d6b; } .rh-nom small.rj { color: #d6455a; }
.rh-pin { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.rh-pin.p { width: 22px; height: 22px; cursor: pointer; }
.rh-mov { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid #1e88d8; box-shadow: 0 0 0 4px rgba(30,136,216,.3); }
@media (max-width: 1000px) { .rh-cuerpo { grid-template-columns: 1fr; } .rh-mapa { height: 380px; } .rh-color { margin-left: 0; } }

.rh-b2 { width: auto !important; height: 30px !important; border-radius: 8px !important; padding: 0 10px; font-size: 13px !important; background: transparent !important; color: inherit !important; border: 1px solid var(--borde, #cfd8df) !important; }
.rh-b2:hover { border-color: #1e88d8 !important; }
.rh-seguir { font-size: 13px; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.rh-mov { width: 22px !important; height: 22px !important; z-index: 5; animation: rh-pulso 1.6s infinite; }
@keyframes rh-pulso { 0% { box-shadow: 0 0 0 0 rgba(30,136,216,.6); } 100% { box-shadow: 0 0 0 16px rgba(30,136,216,0); } }
.rh-play { flex-wrap: wrap; }

.rh-pop h4 { margin: 0 0 6px; font-size: 14px; color: #0b1a2b; }
.rh-pop table { width: 100%; font-size: 12px; border-collapse: collapse; margin: 6px 0; color: #0b1a2b; }
.rh-pop th { text-align: left; font-weight: 500; color: #5b6b7a; padding: 2px 8px 2px 0; white-space: nowrap; vertical-align: top; }
.rh-pop td { padding: 2px 0; }
.rh-pop-v { margin: 0; font-size: 13px; color: #0b1a2b; display: flex; align-items: center; gap: 6px; }
.rh-pop-v i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }
.rh-pop-ir { width: 100%; margin-top: 4px; padding: 6px; border-radius: 8px; border: none; background: #1e88d8; color: #fff; font-size: 12px; cursor: pointer; }

/* Mapa ampliado: ocupa toda la pantalla */
.rh-mapa-caja:fullscreen, .rh-mapa-caja.rh-ampliado { position: fixed; inset: 0; z-index: 3000; width: 100%; height: 100%; border-radius: 0; display: flex; flex-direction: column; background: #0b1a2b; }
.rh-mapa-caja:fullscreen .rh-mapa, .rh-mapa-caja.rh-ampliado .rh-mapa { flex: 1; height: auto; min-height: 0; }
body.rh-sin-scroll { overflow: hidden; }

.rh-esq { position: absolute; top: 10px; right: 10px; z-index: 5; width: 34px; height: 34px; border-radius: 8px; border: none; background: rgba(11,26,43,.85); color: #fff; font-size: 18px; cursor: pointer; }
.rh-esq:hover { background: #1e88d8; }

/* El detalle del punto no hereda el estilo de las tablas de la app: etiquetas grises y valores oscuros sobre fondo blanco */
.maplibregl-popup-content .rh-pop { color: #0b1a2b; min-width: 230px; }
.maplibregl-popup-content .rh-pop table { background: transparent; border: 0; margin: 6px 0; }
.maplibregl-popup-content .rh-pop table tr { background: transparent; border: 0; }
.maplibregl-popup-content .rh-pop table th, .maplibregl-popup-content .rh-pop table td { background: transparent !important; border: 0; border-bottom: 1px solid #e6ecf1; padding: 4px 0; font-size: 12px; letter-spacing: 0; text-transform: none; }
.maplibregl-popup-content .rh-pop table th { color: #5b6b7a; font-weight: 500; width: 78px; padding-right: 8px; }
.maplibregl-popup-content .rh-pop table td { color: #0b1a2b !important; font-weight: 500; }
.maplibregl-popup-content .rh-pop table tr:last-child th, .maplibregl-popup-content .rh-pop table tr:last-child td { border-bottom: 0; }

/* Detalle del punto: filas en rejilla; todo el texto queda dentro del cuadro y se parte en varias líneas si es largo */
.maplibregl-popup-content .rh-pop { width: 250px; max-width: 100%; box-sizing: border-box; overflow: hidden; }
.rh-datos { margin: 8px 0; }
.rh-f { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px solid #e6ecf1; font-size: 12px; align-items: start; }
.rh-f:last-child { border-bottom: 0; }
.rh-f span { color: #5b6b7a; }
.rh-f b { color: #0b1a2b; font-weight: 500; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
