﻿/* ===== BASE GLOBAL ===== */

.page, main, .content, article.content {
    margin: 0 !important;
    padding: 0 !important;
}
.btn-ghost.btn-icon {
    width: 35px;
    height: 35px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 1rem;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    background: #020617; /* mismo fondo oscuro que el mapa */
}

a, .btn-link {
    color: #006bb7;
}
/* El bloque del indicador en medio */
.leaflet-control-zoom.leaflet-bar {
    display: flex;
    align-items: stretch;
}

.leaflet-control-zoom a {
    float: none;
    display: grid;
    place-items: center;
    margin: 0 !important;
    border-radius: 0 !important;
}

.leaflet-control-zoom a.leaflet-control-zoom-in {
    border-top-left-radius: .4rem !important;
    border-bottom-left-radius: .4rem !important;
}

.leaflet-control-zoom a.leaflet-control-zoom-out {
    border-top-right-radius: .4rem !important;
    border-bottom-right-radius: .4rem !important;
    border-left: 0 !important;
}

.leaflet-control-zoom-indicator-inset {
    display: grid;
    place-items: center;
    width: 30px; /* Leaflet suele usar 30px en los botones */
    height: 30px;
    font-weight: 800;
    font-size: .78rem;
    color: #e5e7eb;
    background: rgba(15,23,42,.96);
    border-left: 1px solid rgba(148,163,184,.35);
    border-right: 1px solid rgba(148,163,184,.35);
    border-radius: 0;
    user-select: none;
    pointer-events: none;
}

.leaflet-control-zoom a.leaflet-control-zoom-in + .leaflet-control-zoom-indicator-inset {
    border-left: 0;
}


.search-icon {
    position: relative;
    display: inline-block;
}

    .search-icon.off::after {
        content: "";
        position: absolute;
        left: -2px;
        right: -2px;
        top: 50%;
        height: 2px;
        background: currentColor;
        transform: rotate(-35deg);
        color:darkred;
    }




.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ===== LAYOUT BLAZOR ===== */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
}

.content {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: none;
}

article.content {
    padding: 0;
    margin: 0;
    width: 100% !important;
    max-width: 100% !important;
}


.page, main, .full-page {
    width: 100%;
}



/* Contenedor de páginas que deben ocupar toda la altura disponible */
.full-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ===== VALIDACIONES / ERRORES ===== */

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDky. . .) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ===== HEADER SUPERIOR RUTAS ===== */

.rutas-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,.1);
    background: linear-gradient(90deg, #0f172a, #111827);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    /* justify-content: space-between;  ❌ quitar */
}


    .rutas-header h3 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .rutas-header small {
        display: block;
        font-size: 0.8rem;
        color: #9ca3af;
    }

.pill-live {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, .12);
    border: 1px solid rgba(16, 185, 129, .5);
    color: #a7f3d0;
    font-size: .75rem;
}

.pill-dot {
    width: .45rem;
    height: .45rem;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.35);
}

.btn-ghost {
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.6);
    background: #111827;
    color: #e5e7eb;
    font-size: .78rem;
    padding: .3rem .9rem;
    cursor: pointer;
}

    .btn-ghost:hover {
        background: #1d4ed8;
        color: #fff;
    }
.page, main, .full-page, .content, article.content {
    overflow: hidden;
}
html, body {
    overflow: hidden;
}

.map-container .leaflet-control-layers {
    display: none !important;
}


/* ===== MAPA + CONTENEDOR PRINCIPAL ===== */

.map-container {
    position: relative;
    z-index: 0 !important;
    overflow: hidden !important; /* ✅ clave */
    /* que rellene todo el espacio bajo el header */
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
}

    /* Estado normal: mapa sin opacidad */
    .map-container .leaflet-tile-pane {
        filter: opacity(1);
        transition: filter .25s ease;
    }

    /* Nivel 1: un poco más opaco */
    .map-container.opacidad-1 .leaflet-tile-pane {
        filter: opacity(0.75);
    }

    /* Nivel 2: más oscuro */
    .map-container.opacidad-2 .leaflet-tile-pane {
        filter: opacity(0.50);
    }

    /* Nivel 3: bastante oscuro */
    .map-container.opacidad-3 .leaflet-tile-pane {
        filter: opacity(0.25);
    }
    /* Nivel 4: bastante oscuro */
    .map-container.opacidad-4 .leaflet-tile-pane {
        filter: opacity(0.10);
    }

/* ===== CURSOR DEL MAPA ===== */

/* Cursor SIEMPRE flecha */
.leaflet-container {
    cursor: default !important;
}

/* Las capas interactivas NO deben cambiar el cursor */
.leaflet-interactive {
    cursor: default !important;
}

/* Evitar cursor de mano en puntos, polilíneas, polígonos de Leaflet */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-clickable {
    cursor: default !important;
}

/* ===== PANEL DE BÚSQUEDA TIPO GOOGLE MAPS ===== */

.gm-search-panel {
    position: absolute;
    top: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.96);
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    z-index: 1200;
    max-width: 800px;
    width: calc(100% - 2rem);
}

.gm-search-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gm-search-inputs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
}

.gm-input-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 0; /* ? para que Origen y Destino se estiren */
}


    .gm-input-group label {
        font-size: 0.65rem;
        color: #9ca3af;
        margin-left: 0.25rem;
    }

    .gm-input-group input {
        width: 100%; /* ? para que el input rellene el grupo */
        border-radius: 999px;
        border: 1px solid rgba(148, 163, 184, .6);
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
        background-color: rgba(15, 23, 42, 0.95);
        color: #e5e7eb;
        min-width: 0;
    }


        .gm-input-group input::placeholder {
            color: #6b7280;
        }

.gm-swap-btn {
    border-radius: 999px;
    border: none;
    padding: 0.25rem 0.45rem;
    background: rgba(30, 64, 175, .9);
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    transform: rotate(90deg);
}

    .gm-swap-btn:hover {
        background: rgba(37, 99, 235, 1);
    }

.gm-search-button {
    border-radius: 999px;
    border: none;
    padding: 0.4rem 0.9rem;
    background: #22c55e;
    color: #022c22;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

    .gm-search-button:hover {
        background: #4ade80;
    }

/* ===== PANEL LATERAL DE ESTADO / SELECCIÓN ===== */

.map-overlay-card {
    position: absolute;
    top: .75rem;
    left: .75rem;
    max-width: 320px;
    z-index: 1200;
    background: rgba(15,23,42,.96);
    color: #e5e7eb;
    border-radius: .75rem;
    padding: .75rem .9rem;
    box-shadow: 0 16px 40px rgba(15,23,42,.9);
    border: 1px solid rgba(148,163,184,.35);
    font-size: .82rem;
}

    .map-overlay-card strong {
        font-size: .78rem;
        text-transform: uppercase;
        letter-spacing: .12em;
        color: #9ca3af;
    }

    .map-overlay-card p {
        margin: .25rem 0;
        font-size: .82rem;
    }

    .map-overlay-card .mini {
        font-size: .75rem;
        color: #9ca3af;
    }

.titulo-app {
    display: flex;
    align-items: baseline;
    gap: .5rem;
}

.app-version-inline {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 400;
}

/* ===== POPUP PARADA ===== */

.popup-parada {
    position: absolute;
    top: 5.0rem;
    left: 8.5rem;
    max-width: 260px;
    background: rgba(15,23,42,.96);
    color: #e5e7eb;
    border-radius: .75rem;
    padding: .75rem .8rem .45rem .8rem; /* antes .6rem arriba */
    box-shadow: 0 16px 30px rgba(15,23,42,.9);
    border: 1px solid rgba(148,163,184,.4);
    font-size: .82rem;
    z-index: 999999999;
}

.popup-stack-left {
    position: absolute;
    top: 12rem; /* antes 5rem */
    left: 1rem;
    z-index: 999999999;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    pointer-events: none;
    max-width: calc(100vw - 2rem);
}

    /* Cada popup dentro del stack vuelve a "flujo normal" */
    .popup-stack-left .popup-parada {
        position: relative !important; /* 🔑 quita el absolute del CSS base */
        top: auto !important;
        left: auto !important;
        margin: 0 !important;
        pointer-events: auto; /* sí se puede clicar */
        width: auto;
        max-width: 380px;
    }

/* Slots opcionales (por claridad) */
.popup-slot {
    position: relative;
}

/* Anchos específicos */
.popup-stack-left .popup-itinerario {
    max-width: 380px;
}

.popup-stack-left .popup-inspector {
    max-width: 280px;
}

/* Itinerario: bajar texto para que no choque con la X */
.popup-stack-left .popup-itinerario-body {
    padding-right: 2.2rem;

}
.popup-parada-header {
    font-weight: 600;
    font-size: .86rem;
    margin-bottom: .25rem;
}

.popup-parada-body {
    font-size: .8rem;
}

    .popup-parada-body div {
        margin-bottom: .15rem;
    }

.popup-parada-cerrar {
    position: absolute;
    top: .3rem;
    right: .45rem;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: .9rem;
    cursor: pointer;
}

    .popup-parada-cerrar:hover {
        color: #e5e7eb;
    }

.draggable-popup-handle {
    cursor: grab;
    user-select: none;
}

.draggable-popup--dragging {
    box-shadow: 0 24px 55px rgba(0,0,0,.55);
    opacity: .98;
}

    .draggable-popup--dragging .draggable-popup-handle {
        cursor: grabbing;
    }

.popup-parada.draggable-popup--free,
.popup-stack-left .popup-parada.draggable-popup--free,
.popup-elev-topright.draggable-popup--free,
.route-panel-overlay.draggable-popup--free,
.config-panel.draggable-popup--free {
    position: fixed !important;
    left: var(--drag-left) !important;
    top: var(--drag-top) !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: none !important;
}

/* ===== PANEL LATERAL DE RUTAS ===== */

.route-panel-overlay {
    position: absolute;
    top: 4.5rem; /* debajo de la barra de búsqueda */
    right: 0.75rem;
    bottom: 1rem;
    width: 360px;
    max-width: 90vw;
    pointer-events: none !important;
    z-index: 1200;
}

.route-panel {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.96);
    border-radius: 1rem;
    padding: 0.75rem 0.85rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .6);
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #e5e7eb;
}

.route-panel-title {
    margin: 0 0 .35rem;
    font-size: .9rem;
    font-weight: 600;
    color: #e5e7eb;
}

/* Lista de alternativas de ruta */

.route-alt-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.route-alt-card {
    border-radius: 0.8rem;
    border: 1px solid rgba(148, 163, 184, .55);
    background: rgba(15, 23, 42, 0.9);
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.78rem;
    color: #e5e7eb;
    pointer-events: auto;
}

    .route-alt-card:hover {
        border-color: #3b82f6;
        background: rgba(30, 64, 175, 0.85);
    }

.route-alt-card-selected {
    border-color: #22c55e;
    background: rgba(21, 128, 61, 0.85);
}

.route-alt-main {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.route-alt-time {
    font-weight: 600;
    font-size: 0.85rem;
}

.route-alt-label {
    font-size: 0.75rem;
    color: #d1d5db;
}

.route-alt-sub {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* Separador fino dentro del panel */

.route-panel-divider {
    border: none;
    border-top: 1px solid rgba(148, 163, 184, .4);
    margin: 0.45rem 0;
}

/* Cuerpo con scroll propio */

.route-panel-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.15rem;
}

/* TEXTO Y CHIPS DE LA RUTA */

.route-main-text {
    font-size: .86rem;
    margin-bottom: .4rem;
}

    .route-main-text span.highlight {
        color: #facc15;
        font-weight: 500;
    }

.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    font-size: .75rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.5);
    background: #020617;
}

.chip-dot {
    width: .5rem;
    height: .5rem;
    border-radius: 999px;
}

.chip-dot-start {
    background: #22c55e;
}

.chip-dot-end {
    background: #ef4444;
}

.chip-dot-line {
    background: #38bdf8;
}

.chip-dot-walk {
    background: #f97316;
}

.muted {
    color: #9ca3af;
}

/* LISTA DE TRAMOS TIPO “DIRECCIONES” CON NÚMEROS */

.lista-tramos-ruta {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    font-size: .8rem;
}

    .lista-tramos-ruta li {
        display: flex;
        align-items: flex-start;
        gap: 0.6rem;
        margin-bottom: 0.35rem;
    }

        .lista-tramos-ruta li .indice-tramo-ruta {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 1.25rem;
            width: 1.25rem;
            height: 1.25rem;
            border-radius: 999px;
            background: #1d4ed8;
            color: #e5e7eb;
            font-size: 0.75rem;
            font-weight: 700;
            line-height: 1;
            margin-top: 0.18rem;
        }

        .lista-tramos-ruta li .detalle-tramo-ruta-contenido {
            flex: 1 1 auto;
            min-width: 0;
        }

/* ===== PANEL DE CONFIGURACIÓN ===== */

.config-panel {
    position: absolute;
    bottom: 2.4rem;
    left: .85rem;
    width: 292px;
    background: rgba(15,23,42,0.96);
    border: 1px solid rgba(148,163,184,.35);
    border-radius: .75rem;
    padding: .85rem 1rem .8rem 1rem;
    color: #e5e7eb;
    box-shadow: 0 16px 40px rgba(15,23,42,.9);
    backdrop-filter: blur(4px);
    z-index: 99999;
    font-size: .85rem;
}

    .config-panel h5 {
        margin: 0 0 .65rem 0;
        font-size: .92rem;
        font-weight: 600;
        letter-spacing: .03em;
        color: #9ca3af;
        text-transform: uppercase;
    }

.config-row {
    display: grid;
    grid-template-columns: 1fr 140px; /* label | campo */
    gap: .75rem;
    align-items: center;
    margin-bottom: .62rem;
}


    .config-row label {
        font-size: .8rem;
        color: #cbd5e1;
    }

.config-input {
    width: 90px;
    padding: .35rem .5rem;
    background: #0f172a;
    color: #e2e8f0;
    font-size: .8rem;
    border-radius: .5rem;
    border: 1px solid rgba(148,163,184,.5);
    text-align: left;
    outline: none;
    transition: border-color .15s, background .15s;
}

    .config-input:focus {
        border-color: #38bdf8;
        background: #1e293b;
    }

    .config-input:disabled,
    .config-input[readonly] {
        opacity: .48;
        cursor: not-allowed;
        color: #94a3b8;
        background: rgba(15,23,42,.45);
        border-color: rgba(100,116,139,.28);
        filter: saturate(.65) blur(.15px);
    }

.config-panel .btn-ghost {
    margin-top: .1rem;
    width: 100%;
    padding: .42rem .55rem;
    border-radius: .75rem;
    font-size: .82rem;
    background: #1d4ed8;
    border: 1px solid rgba(148,163,184,.4);
    color: #fff;
    text-align: center;
    transition: background .2s, box-shadow .2s;
}

    .config-panel .btn-ghost:hover {
        background: #2563eb;
        box-shadow: 0 0 10px rgba(37,99,235,.4);
    }

    .config-panel .btn-ghost.btn-ghost--secondary {
        background: #334155;
        border-color: rgba(148,163,184,.35);
        color: #e5e7eb;
    }

        .config-panel .btn-ghost.btn-ghost--secondary:hover {
            background: #475569;
            box-shadow: 0 0 10px rgba(71,85,105,.35);
        }

.config-actions-row {
    display: flex;
    align-items: center;
    gap: .44rem;
    margin-top: .1rem;
}

    .config-actions-row .btn-ghost {
        flex: 1 1 0;
        width: 0;
        margin-top: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

/* Botón flotante para abrir la configuración avanzada */
.config-toggle-btn {
    position: absolute;
    bottom: 2.4rem;
    left: .85rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.6);
    background: #111827;
    color: #e5e7eb;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(15,23,42,.8);
    z-index: 1300;
}

    .config-toggle-btn:hover {
        background: #1d4ed8;
        color: #fff;
    }

/* Cabecera del panel de configuración con botón de cierre */
.config-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}

    .config-panel-header h5 {
        margin: 0;
    }

.config-close-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

    .config-close-btn:hover {
        color: #e5e7eb;
    }


.coords-bar {
    position: absolute;
    bottom: 6px;
    left: 10px;
    padding: 4px 8px;
    background: #000000; /* negro total */
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    pointer-events: none; /* para no bloquear clics en el mapa */
    z-index: 500;
}

.rt-arrow-icon {
    background: transparent;
    border: none;
}

.rt-arrow {
    position: relative;
    transform-origin: 50% 50%;
}

    .rt-arrow::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -75%);
        width: 0;
        height: 0;
        /* tu punta */
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 18px solid var(--arrow-color, rgba(239, 68, 68, 0.95));
        /* ✅ borde negro (simulado) */
        filter: drop-shadow( 2px 0 0 #000) drop-shadow(-2px 0 0 #000) drop-shadow( 0 1px 0 #000) drop-shadow( 0 -1px 0 #000);
    }


    .rt-arrow::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 60%;
        transform: translateX(-50%);
        /* Cuerpo un poco más largo */
        width: 4px;
        height: 10px;
        background: var(--arrow-color, rgba(239, 68, 68, 0.95));
        border-radius: 1px;
    }

    .rt-arrow--dashed::before {
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 18px solid var(--arrow-color, rgba(239, 68, 68, 0.95));
        filter: drop-shadow( 2px 0 0 #000) drop-shadow(-2px 0 0 #000) drop-shadow( 0 1px 0 #000) drop-shadow( 0 -1px 0 #000);
    }

    .rt-arrow--dashed .rt-arrow-dash-head {
        display: none;
    }

    .rt-arrow--dashed::after {
        background: repeating-linear-gradient(180deg, var(--arrow-color, rgba(239, 68, 68, 0.95)) 0 4px, #fff 4px 8px);
        box-shadow: 0 0 0 1px #000;
    }






/* Ocultar spinners nativos */
.config-input::-webkit-outer-spin-button,
.config-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.config-input[type="number"] {
    -moz-appearance: textfield;
}

.num-field {
    position: relative;
    width: 140px; /* igual que la 2ª columna */
    min-width: 140px;
}

    .num-field .config-input {
        width: 100% !important; /* pisa el width:90px anterior */
        box-sizing: border-box;
        padding-right: 2.4rem; /* espacio para ?? */
    }
.num-inline {
    display: grid;
    grid-template-columns: 1fr 1.6rem 1.6rem; /* input | ? | ? */
    gap: .25rem;
    align-items: center;
    min-width: 0;
}
.num-inline .config-input {
        width: 100% !important; /* pisa width:90px anterior */
        min-width: 0;
        box-sizing: border-box;
    }

.config-dual-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    align-items: center;
    min-width: 0;
}

    .config-dual-inline .config-input {
        width: 100% !important;
        min-width: 0;
        box-sizing: border-box;
        text-align: center;
    }

.config-dual-field {
    display: grid;
    grid-template-columns: auto minmax(0, 4.5rem);
    gap: .3rem;
    align-items: center;
    min-width: 0;
}

    .config-dual-field span {
        font-size: .7rem;
        color: #94a3b8;
        line-height: 1;
        text-align: right;
        white-space: nowrap;
    }

    .config-dual-field .config-input {
        max-width: 4.5rem;
        justify-self: end;
    }

.config-dual-inline--bare {
    grid-template-columns: repeat(2, minmax(0, 4.2rem));
    justify-content: end;
    gap: .35rem;
}

    .config-dual-inline--bare .config-input {
        max-width: none;
        text-align: center;
        padding-left: .35rem;
        padding-right: .35rem;
    }

    .config-dual-inline--bare .config-input::placeholder {
        color: #94a3b8;
        opacity: 1;
        font-size: .72rem;
    }



.num-stepper {
    position: absolute;
    right: .25rem; /* un pelín más metido */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: .2rem;
}


.step-btn {
    width: 1.5rem;
    height: 1.05rem;
    border-radius: .3rem;
    border: 1px solid rgba(148,163,184,.45);
    background: rgba(30,41,59,.85);
    color: #e5e7eb;
    font-size: .6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

    .step-btn:hover {
        background: rgba(37,99,235, .9);
        border-color: rgba(59,130,246,.9);
    }

    .step-btn:disabled {
        opacity: .42;
        cursor: not-allowed;
        color: #94a3b8;
        background: rgba(30,41,59,.45);
        border-color: rgba(100,116,139,.25);
        filter: saturate(.6) blur(.15px);
    }

        .step-btn:disabled:hover {
            background: rgba(30,41,59,.45);
            border-color: rgba(100,116,139,.25);
        }



/* ✅ Solo esta fila: label arriba + control abajo, ancho completo */
.config-row.config-row-full {
    grid-template-columns: 1fr !important;
}

.config-row-map-opacity {
    margin-top: .7rem !important;
    margin-bottom: 0;
}

/* Asegura que el contenedor derecho pueda encoger y no desborde */
.config-row > * {
    min-width: 0;
}

/* Ajuste del range: ahora sí, columnas estables */
.line-filter {
    max-width: 100%;
    min-width: 0;
}

.line-filter__range {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr; /* Rango | min | a | max */
    gap: 8px;
    align-items: center;
    max-width: 100%;
    min-width: 0;
}

    .line-filter__range .config-input {
        width: 100% !important; /* pisa el 90px */
        min-width: 0;
    }

.line-filter__range--segundos-parada {
    grid-template-columns: auto minmax(120px, 150px);
    margin-top: .5rem;
}

/* En muy estrecho, que pase a 2 columnas */
@media (max-width: 520px) {
    .line-filter__range {
        grid-template-columns: 1fr 1fr;
    }
}




.rt-elev-label {
  background: none;              /* 🔑 sin tarjeta */
  color: #facc15;                /* amarillo suave */
  font-size: .6rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.85); /* legible sobre mapa */
  padding: 0;
  border: none;
  box-shadow: none;
  user-select: none;
  pointer-events: none;
}
.rt-elev-label:before { display:none; }


/* Tooltip Leaflet sin tarjeta */
.leaflet-tooltip.rt-elev-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

    .leaflet-tooltip.rt-elev-label:before {
        display: none !important;
    }

/* Número negro con contorno blanco */
.rt-elev-label {
    color: #020617 !important; /* negro azulado */
    font-size: .6rem !important;
    font-weight: 700 !important;
    /* contorno blanco */
    text-shadow: -1px -1px 0 rgba(255,255,255,.95), 1px -1px 0 rgba(255,255,255,.95), -1px 1px 0 rgba(255,255,255,.95), 1px 1px 0 rgba(255,255,255,.95);
    user-select: none;
    pointer-events: none;
}




.leaflet-control-zoom-indicator {
    background: rgba(15,23,42,.96);
    color: #e5e7eb;
    border: 1px solid rgba(148,163,184,.55);
    border-radius: .4rem;
    padding: .15rem .45rem;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0; /* se alinea con los botones */
    box-shadow: 0 10px 25px rgba(15,23,42,.6);
}




.elev-bubble {
    position: fixed;
    left: 14px;
    bottom: 50px; /* MISMA referencia que el popup */
    top: auto; /* anulamos el top antiguo */
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .75rem;
    border-radius: 999px;
    background: rgba(20,20,20,.92);
    border: 1px solid rgba(255,255,255,.12);
    color: #fff;
    font-size: .85rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,.35);
}

    .elev-bubble:hover {
        transform: translateY(-1px);
    }


.popup-elev-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .25rem;
}

.popup-elev-title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popup-elev-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}

    .popup-elev-actions .btn-ghost {
        padding: .15rem .45rem;
        font-size: .85rem;
        line-height: 1;
    }

/* Burbuja de elevación arriba derecha */
.elev-bubble-topright {
    position: fixed;
    top: 70px; /* ajusta según altura real del header */
    right: 14px;
    z-index: 1200;
}



/* Si tu header es más alto/bajo, sube/baja estos top */
@media (max-width: 720px) {
    .popup-elev-topright {
        width: calc(100vw - 28px);
        top: 110px;
    }
}


.rutas-header-linea {
    display: grid;
    grid-template-columns: minmax(240px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
}

.header-left {
    justify-self: start;
    min-width: 0;
}

.header-left .titulo-app,
.header-left small {
    white-space: nowrap;
}

.header-center {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}

.header-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.header-center-input {
    width: clamp(148px, 15vw, 220px) !important;
    min-width: 0;
}

.header-center .btn-ghost,
.header-center .line-filter__toggle,
.header-center .nowrap,
.header-right .btn-ghost,
.header-right .pill-live {
    flex: 0 0 auto;
}


.nowrap {
    white-space: nowrap;
}

/* Estado Punto Z (amarillo) */
.pill-warn {
    background: rgba(250,204,21,.12);
    border-color: rgba(250,204,21,.5);
    color: #fde68a;
}

    .pill-warn .pill-dot {
        background: #facc15; /* AMARILLO */
        box-shadow: 0 0 0 3px rgba(250,204,21,.35);
    }


.popup-elev-topright {
    position: fixed;
    left: 14px;
    bottom:40px; /* mismo “offset” pero abajo */
    right: auto;
    top: auto;
    transform: none;
    width: 520px;
    max-width: calc(100vw - 28px);
    z-index: 1200;
}
/* ===== SLIDER (range) limpio para el panel ===== */
.config-range {
    width: 100%;
    margin: 0;
    padding: 0; /* 🔑 evita que “no llegue” */
    background: transparent;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    height: 18px; /* área cómoda de click */
}

    /* TRACK (Chrome/Edge/Safari) */
    .config-range::-webkit-slider-runnable-track {
        height: 6px;
        border-radius: 999px;
        background: rgba(148,163,184,.35);
        border: 1px solid rgba(148,163,184,.35);
    }

    /* THUMB (Chrome/Edge/Safari) */
    .config-range::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 14px;
        height: 14px;
        border-radius: 999px;
        background: #38bdf8;
        border: 2px solid #0f172a;
        margin-top: -4px; /* centra sobre track de 6px */
    }

    /* TRACK (Firefox) */
    .config-range::-moz-range-track {
        height: 6px;
        border-radius: 999px;
        background: rgba(148,163,184,.35);
        border: 1px solid rgba(148,163,184,.35);
    }

    /* THUMB (Firefox) */
    .config-range::-moz-range-thumb {
        width: 14px;
        height: 14px;
        border-radius: 999px;
        background: #38bdf8;
        border: 2px solid #0f172a;
    }

    /* evita borde raro en firefox */
    .config-range::-moz-focus-outer {
        border: 0;
    }

.pill-clickable {
    cursor: pointer;
    border: 0;
}

/* Visible => verde */
.pill-ok .pill-dot {
    background: #22c55e;
}
/* verde */
.pill-ok {
    border-color: rgba(34,197,94,.6);
}

/* Oculto => rojo */
.pill-bad .pill-dot {
    background: #ef4444;
}
/* rojo */
.pill-bad {
    border-color: rgba(239,68,68,.6);
}
.pill-ok {
    background: rgba(34,197,94,.12);
}

.pill-bad {
    background: rgba(239,68,68,.12);
}



.gm-search-panel {
    position: absolute; /* si ya lo tienes, deja tu estilo actual */
    /* mantén tus estilos actuales */
}

.gm-search-panel-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .35rem;
}

.gm-search-hide-btn {
    padding: .2rem .45rem;
    line-height: 1;
    font-size: .95rem;
}

/* botón flotante cuando el buscador está oculto */
.gm-search-fab {
    position: absolute;
    top: 14px;
    right: 14px; /* ✅ derecha */
    left: auto; /* ✅ anulamos izquierda si estaba */
    z-index: 1000;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(15, 23, 42, .92);
    color: #fff;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
}

    .gm-search-fab:hover {
        transform: translateY(-1px);
    }



/* 3 columnas: "Fecha:" | date | time  (igual idea que Rango: min/max) */
.line-filter__range--fecha {
    grid-template-columns: auto minmax(0, 1.18fr) minmax(0, 0.82fr) !important;
    gap: 6px;
    align-items: center;
}

/* Igualar inputs date/time al look de .config-input */
.config-input[type="date"],
.config-input[type="time"] {
    width: 100% !important; /* como los selects dentro de line-filter__range */
    min-width: 0;
    box-sizing: border-box;
    height: 32px; /* ajusta a tu “alto estándar” */
    padding: .35rem .5rem; /* igual que .config-input */
    font-size: .8rem;
    line-height: 1.1;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid rgba(148,163,184,.5);
    border-radius: .5rem;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
}

    /* En iOS/Safari a veces mete padding raro: lo neutralizamos */
    .config-input[type="date"]::-webkit-datetime-edit,
    .config-input[type="time"]::-webkit-datetime-edit {
        padding: 0;
    }

    .config-input[type="date"]::-webkit-calendar-picker-indicator,
    .config-input[type="time"]::-webkit-calendar-picker-indicator,
    .config-input[type="time"]::-webkit-time-picker-indicator {
        filter: brightness(0) invert(1);
        opacity: 1;
        cursor: pointer;
    }

.config-input-date {
    min-width: 0 !important;
}

.config-input-time {
    min-width: 0 !important;
}
