/* ======================================== */
/* VARIABLES Y RESET */
/* ======================================== */
:root {
    --bg: #1e1e1e;
    --panel: #2a2a2a;
    --accent: #4aa3ff;
    --text: #e6e6e6;
    --muted: #a0a0a0;
    --gap-secciones: 12px; /* 🆕 ritmo vertical uniforme */
    --fs-cabecera: 16px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.55)), url("../img/fondo.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
}

/* ======================================== */
/* HEADER Y NAVEGACIÓN */
/* ======================================== */
header {
    background: #111;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    gap: 20px;
    flex-wrap: wrap;
}

    header img {
        height: 45px;
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

    .menu-toggle span {
        width: 100%;
        height: 3px;
        background: var(--text);
        border-radius: 3px;
        transition: all 0.3s ease;
        transform-origin: center;
    }

.nav-links {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--text);
    margin: 0 12px;
    text-decoration: none;
    font-weight: bold;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

    nav a:hover {
        color: var(--accent);
    }

    nav a.active {
        color: var(--accent);
    }

        nav a.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background: var(--accent);
            animation: slideIn 0.3s ease forwards;
        }

@keyframes slideIn {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* ======================================== */
/* SELECTOR DE IDIOMA EN HEADER */
/* ======================================== */
.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px 8px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    font-family: inherit;
    line-height: 1;
}

    .lang-btn:hover {
        color: var(--text);
        background: rgba(255, 255, 255, 0.08);
    }

    .lang-btn.active {
        background: var(--accent);
        color: white;
        box-shadow: 0 2px 6px rgba(74, 163, 255, 0.3);
    }

.lang-separator {
    color: var(--muted);
    font-size: 12px;
    opacity: 0.5;
    line-height: 1;
}

/* ======================================== */
/* SECCIONES GENERALES */
/* ======================================== */
.hero {
    padding: 80px 20px;
    text-align: center;
    background: radial-gradient(circle at top, #2b2b2b, #111);
}

    .hero h1 {
        font-size: 40px;
        margin-bottom: 10px;
    }

    .hero p {
        color: var(--muted);
        font-size: 18px;
    }

section {
    padding: 60px 15%;
}

.panel {
    background: var(--panel);
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
}

h2 {
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 15px;
}

.hashtag {
    color: var(--accent);
}

/* ======================================== */
/* GRID Y CARDS */
/* ======================================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: #222;
    padding: 15px;
    border-radius: 10px;
}

footer {
    text-align: center;
    padding: 30px;
    background: #111;
    color: var(--muted);
    border-top: 1px solid #333;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 10px;
}

.card-img {
    display: block;
    margin: 15px auto 0 auto;
    max-width: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #333;
    opacity: 0.95;
    transition: transform 0.3s ease, opacity 0.3s ease;
    height: auto;
}

    .card-img:hover {
        transform: scale(1.03);
        opacity: 1;
    }

.card-download {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.grid-que-es {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ======================================== */
/* VISOR DE IMÁGENES */
/* ======================================== */
.image-comparison-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    user-select: none;
    --position: 50%;
}

    .image-comparison-container img {
        width: 100%;
        height: auto;
        display: block;
        pointer-events: none;
    }

.img-background {
    position: relative;
    z-index: 1;
}

.img-foreground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    clip-path: inset(0 calc(100% - var(--position)) 0 0);
}

.slider-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--position);
    width: 4px;
    background: #ffffff;
    z-index: 3;
    cursor: ew-resize;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

    .slider-bar::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: -3px;
        width: 10px;
        background: rgba(255, 255, 255, 0.4);
        filter: blur(4px);
    }

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    color: #333;
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
}

.video {
    width: 100%;
    max-width: 900px;
    border-radius: 10px;
    display: block;
    margin: 20px auto;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .logo-group h1 {
        margin: 0;
    }

.logo-title {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
    color: var(--text);
}

.titulo-verde {
    color: #4caf50;
    font-weight: bold;
}

/* ======================================== */
/* TESTIMONIOS */
/* ======================================== */
.testimonios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.testimonio-card {
    background: #222;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

    .testimonio-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(74, 163, 255, 0.15);
    }

    .testimonio-card::before {
        content: '"';
        position: absolute;
        top: -10px;
        left: 15px;
        font-size: 80px;
        color: var(--accent);
        opacity: 0.3;
        font-family: Georgia, serif;
        line-height: 1;
    }

.testimonio-texto {
    font-style: italic;
    color: var(--text);
    margin: 15px 0 20px 0;
    line-height: 1.6;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.testimonio-autor {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.testimonio-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #2b7fd4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
}

.testimonio-info {
    display: flex;
    flex-direction: column;
}

.testimonio-nombre {
    font-weight: bold;
    color: var(--accent);
    font-size: 16px;
}

.testimonio-rol {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.testimonio-estrellas {
    color: #ffc107;
    margin-top: 5px;
    font-size: 14px;
}

/* ======================================== */
/* IFRAME RESPONSIVO */
/* ======================================== */
.iframe-container {
    position: relative;
    width: 100%;
    margin: 20px auto;
    padding-bottom: 62.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

    .iframe-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

/* ======================================== */
/* PREDICCIÓN ASTROFOTOGRÁFICA - SECCIÓN */
/* ======================================== */
.prediccion-section {
    padding: 20px;
    /*max-width: 1400px;*/
    margin: 0 auto;
}

.prediccion-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

.prediccion-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: var(--gap-secciones);
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.prediccion-header-icon {
    font-size: 42px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(74, 163, 255, 0.3));
}

.prediccion-title {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.prediccion-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.4;
}

.prediccion-controls-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 0px; 
}

/* Separación consistente entre la sección de controles y la de resultados */
#prediccion + #resultados {
    margin-top: var(--gap-secciones, 16px);
}

.control-group {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .control-group:hover {
        border-color: rgba(74, 163, 255, 0.3);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

.control-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.control-group-icon {
    font-size: 18px;
}

.control-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.control-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

    .control-input:hover {
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.06);
    }

    .control-input:focus {
        outline: none;
        border-color: var(--accent);
        background: rgba(255, 255, 255, 0.06);
        box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.15);
    }

select.control-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
}

/* ======================================== */
/* SELECTS CON TEMA OSCURO */
/* ======================================== */
select.control-input {
    color-scheme: dark;
}

    select.control-input option {
        background: #2a2a2a;
        color: var(--text);
        padding: 10px 12px;
        font-size: 14px;
    }

        select.control-input option:checked {
            background: linear-gradient(0deg, var(--accent) 0%, var(--accent) 100%);
            color: white;
            font-weight: 500;
        }

        select.control-input option:hover {
            background: rgba(74, 163, 255, 0.3);
            color: var(--text);
        }

        select.control-input option:disabled {
            color: #666;
            font-style: italic;
        }

@supports not (color-scheme: dark) {
    select.control-input {
        background-color: #2a2a2a;
        color: var(--text);
    }

        select.control-input option {
            background-color: #2a2a2a;
            color: var(--text);
        }
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

/* ======================================== */
/* BOTONES DE PREDICCIÓN */
/* ======================================== */
.prediccion-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    line-height: 1.3;
    min-height: 44px;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

    .prediccion-btn .btn-icon {
        font-size: 14px;
        flex-shrink: 0;
        line-height: 1;
    }

    .prediccion-btn .btn-text {
        display: inline;
        line-height: 1.3;
        word-break: break-word;
    }

    .prediccion-btn.btn-primary {
        background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
        color: white;
        box-shadow: 0 2px 6px rgba(74, 163, 255, 0.25);
    }

        .prediccion-btn.btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(74, 163, 255, 0.4);
        }

        .prediccion-btn.btn-primary:active {
            transform: translateY(0);
        }

    .prediccion-btn.btn-secondary {
        background: rgba(74, 163, 255, 0.15);
        color: var(--accent);
        border-color: rgba(74, 163, 255, 0.4);
    }

        .prediccion-btn.btn-secondary:hover {
            background: rgba(74, 163, 255, 0.25);
            border-color: var(--accent);
        }

    .prediccion-btn:disabled {
        background: #555;
        color: #888;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.btn-icon {
    font-size: 14px;
}

/* Estado */
.prediccion-estado {
    padding: 10px 0px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    min-height: 0;
    transition: all 0.3s ease;
}

    .prediccion-estado:empty {
        display: none;
    }

    .prediccion-estado.success {
        background: rgba(76, 175, 80, 0.12);
        color: #4caf50;
        border-left: 3px solid #4caf50;
    }

    .prediccion-estado.error {
        background: rgba(244, 67, 54, 0.12);
        color: #f44336;
        border-left: 3px solid #f44336;
    }

    .prediccion-estado.warning {
        background: rgba(255, 193, 7, 0.12);
        color: #ffc107;
        border-left: 3px solid #ffc107;
    }

/* ======================================== */
/* PREDICCIÓN - RESULTADOS */
/* ======================================== */
.prediccion-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gap-secciones);
    margin-top: var(--gap-secciones);
}

/* 🆕 Permite que las tarjetas encojan por debajo del min-content de su contenido
(crítico para la tabla horaria en pantallas muy estrechas) */
.prediccion-info-grid > * {
    min-width: 0;
}

.prediccion-info-card {
    background: #2a2a2a;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

    .prediccion-info-card h4 {
        margin: 0 0 10px 0;
    }

.prediccion-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

    .prediccion-stat:last-child {
        border-bottom: none;
    }

.prediccion-stat-label {
    color: var(--muted);
    font-size: 14px;
}

.prediccion-stat-value {
    font-weight: bold;
    font-size: 18px;
}

.prediccion-tabla-container {
    overflow-x: auto;
    margin-top: var(--gap-secciones);
}

.prediccion-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .prediccion-tabla thead {
        background: #2a2a2a;
        position: sticky;
        top: 0;
    }

    .prediccion-tabla th {
        padding: 12px 8px;
        text-align: center;
        color: var(--accent);
        font-weight: bold;
        border-bottom: 2px solid var(--accent);
    }

    .prediccion-tabla td {
        padding: 10px 8px;
        text-align: center;
        border-bottom: 1px solid #333;
    }

    .prediccion-tabla tbody tr {
        transition: background 0.2s ease;
    }

        .prediccion-tabla tbody tr:hover {
            background: rgba(74, 163, 255, 0.1);
        }

        .prediccion-tabla tbody tr.noche {
            background: rgba(74, 163, 255, 0.05);
        }

.nube-bar {
    display: inline-block;
    width: 60px;
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    vertical-align: middle;
}

.nube-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.fase-lunar {
    text-align: center;
    padding: 15px;
}

.fase-lunar-icono {
    font-size: 48px;
    margin: 10px 0;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #333;
    border: 1px solid #555;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #444;
    transition: background 0.2s ease;
}

    .autocomplete-item:hover {
        background: rgba(74, 163, 255, 0.2);
    }

    .autocomplete-item:last-child {
        border-bottom: none;
    }

.btn-luz {
    display: inline-block;
    padding: 8px 16px;
    background: #2b7fd4;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 10px;
    font-size: 13px;
    font-weight: bold;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
}

    .btn-luz:hover {
        background: #1e6bb8;
    }

/* ======================================== */
/* DIAGRAMA TEMPORAL */
/* ======================================== */
.timeline-container {
    position: relative;
    width: 100%;
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.timeline-period {
    position: absolute;
    border-radius: 3px;
    opacity: 0.9;
    cursor: pointer;
    transition: opacity 0.2s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

    .timeline-period:hover {
        opacity: 1;
    }

.period-day {
    background: #ffd93d;
}

.period-golden-hour {
    background: #ff8c42;
}

.period-civil-twilight {
    background: #6b5b95;
}

.period-astronomical-night {
    background: #003b5c;
}

.period-galaxy-visible {
    background: #8a2be2;
}

.period-moon-up {
    background: #e0e0e0;
    border: 1px solid #a0a0a0;
}

/* ======================================== */
/* TARJETAS COLAPSABLES */
/* ======================================== */
.collapsible-card {
    transition: all 0.3s ease;
}

.collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 16px;
    font-weight: 600;
    padding: 4px 0;
    letter-spacing: 0.2px;
    transition: color 0.2s ease;
    min-height: 22px;
}

    .collapse-header .collapse-icon {
        font-size: 11px;
        color: var(--muted);
        margin-left: 8px;
        flex-shrink: 0;
    }

    .collapse-header:hover {
        color: var(--accent);
    }

        .collapse-header:hover .collapse-icon {
            color: var(--accent);
            transform: scale(1.2);
        }


.collapsible-card.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.collapsible-card.collapsed .collapse-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease, padding 0.3s ease;
}

.collapsible-card .collapse-content {
    max-height: 2000px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease 0.1s, margin 0.3s ease, padding 0.3s ease;
}

.btn-collapse-all {
    background: rgba(74, 163, 255, 0.15);
    color: var(--accent);
    border: 1px solid rgba(74, 163, 255, 0.4);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .btn-collapse-all:hover {
        background: rgba(74, 163, 255, 0.25);
        border-color: var(--accent);
        transform: translateY(-1px);
    }

    .btn-collapse-all:active {
        transform: translateY(0);
    }

    .btn-collapse-all .btn-icon {
        transition: transform 0.3s ease;
        display: inline-block;
    }

    .btn-collapse-all.all-collapsed .btn-icon {
        transform: rotate(180deg);
    }

/* ======================================== */
/* BANNER DE INSTALACIÓN PWA */
/* ======================================== */
.install-banner {
    background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
    padding: 12px 16px;
    text-align: center;
    border-radius: 0;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

    .install-banner p {
        margin: 0 0 8px 0;
        font-size: 14px;
        color: white;
    }

.install-btn {
    background: white;
    color: var(--accent);
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.install-btn-text {
    white-space: wrap;
}

.install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.install-btn:active {
    transform: translateY(0);
}

/* ======================================== */
/* CONDICIONES ACTUALES - CLASES */
/* ======================================== */
.condiciones-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.condiciones-header-item {
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 13px;
    font-weight: bold;
}

.condiciones-label-sm {
    color: var(--muted);
    font-size: 11px;
}

.condiciones-value-md {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}

.condiciones-metricas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
}

.condicion-metrica {
    text-align: center;
}

.metrica-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.metrica-valor {
    font-size: 24px;
    font-weight: 600;
}

/* ======================================== */
/* MARCADORES DE UBICACIONES FOTOGRAFIADAS */
/* ======================================== */
.icono-foto-marker {
    background: linear-gradient(135deg, #8a2be2 0%, #b84dff 100%);
    border: 2px solid white;
    border-radius: 50% 50% 50% 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
}

    .icono-foto-marker:hover {
        transform: rotate(-45deg) scale(1.15);
    }

    .icono-foto-marker .emoji {
        transform: rotate(45deg);
        font-size: 14px;
    }

.popup-foto {
    min-width: 240px;
    max-width: 280px;
}

.popup-foto-contenido {
    font-family: inherit;
    color: var(--text);
}

.popup-foto-imagen {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    display: block;
}

.popup-foto-titulo {
    font-size: 14px;
    font-weight: bold;
    color: var(--text);
    margin: 0 0 4px 0;
}

.popup-foto-descripcion {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.popup-foto-etiqueta {
    display: inline-block;
    background: rgba(138, 43, 226, 0.2);
    color: #b84dff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 8px;
}

.popup-foto-fecha {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 10px;
}

.popup-foto-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    justify-content: center;
}

    .popup-foto-link:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(131, 58, 180, 0.4);
    }

.popup-foto-coords {
    font-size: 10px;
    color: var(--muted);
    margin-top: 8px;
    text-align: center;
    font-family: monospace;
}

.leaflet-popup-content-wrapper {
    background: var(--panel);
    color: var(--text);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.leaflet-popup-tip {
    background: var(--panel);
}

.leaflet-popup-close-button {
    color: var(--muted) !important;
}

    .leaflet-popup-close-button:hover {
        color: var(--text) !important;
    }

.popup-foto-coords-link {
    display: block;
    text-decoration: none;
    color: var(--accent);
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

    .popup-foto-coords-link:hover {
        background: rgba(74, 163, 255, 0.1);
        color: #6bb6ff;
        text-decoration: underline;
    }

    .popup-foto-coords-link:active {
        transform: translateY(0);
    }

.popup-foto-btn-usar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
    color: white;
    padding: 9px 14px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 8px;
}

    .popup-foto-btn-usar:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(74, 163, 255, 0.4);
    }

    .popup-foto-btn-usar:active {
        transform: translateY(0);
    }

/* ======================================== */
/* FOOTER CON BOTÓN DE INSTALACIÓN */
/* ======================================== */
footer {
    text-align: center;
    padding: 20px 25px;
    background: #111;
    color: var(--muted);
    border-top: 1px solid #333;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    /*max-width: 1400px;*/
    margin: 0 auto;
    flex-wrap: nowrap;
}

.footer-copyright {
    font-size: 14px;
    color: var(--muted);
}

.install-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
    color: white;
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .install-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(74, 163, 255, 0.4);
    }

    .install-btn:active {
        transform: translateY(0);
    }

    .install-btn.installed {
        background: rgba(76, 175, 80, 0.2);
        color: #4caf50;
        cursor: default;
        pointer-events: none;
    }

    .install-btn.hidden {
        display: none;
    }

/* ======================================== */
/* MODAL DE INSTRUCCIONES iOS */
/* ======================================== */
.modal-instalar-ios {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
}

.modal-instalar-ios-content {
    background: var(--panel);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 30px 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
    box-sizing: border-box;
    position: relative;
    text-align: center;
}

.modal-instalar-ios-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .modal-instalar-ios-close:hover {
        background: rgba(255, 255, 255, 0.2);
        color: var(--text);
    }

.modal-instalar-ios-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.modal-instalar-ios-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--text);
    font-weight: 700;
}

.modal-instalar-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
    text-align: left;
}

.modal-instalar-ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 14px;
    border-radius: 10px;
    border-left: 3px solid var(--accent);
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

    .modal-instalar-ios-step .step-number {
        background: var(--accent);
        color: white;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 700;
        flex-shrink: 0;
    }

    .modal-instalar-ios-step .step-icon {
        font-size: 20px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .modal-instalar-ios-step strong {
        color: var(--accent);
    }

.modal-instalar-ios-button {
    background: linear-gradient(135deg, var(--accent) 0%, #2b7fd4 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .modal-instalar-ios-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(74, 163, 255, 0.4);
    }

/* ======================================== */
/* RESPONSIVE - TABLET */
/* ======================================== */
@media (max-width: 1024px) {
    .grid-2,
    .grid-que-es {
        grid-template-columns: 1fr;
    }

    html {
        scroll-padding-top: 90px;
    }

    section#que-es,
    section#prediccion {
        padding-top: 90px !important;
    }

    header {
        position: absolute;
        width: 100%;
        left: 0;
        box-sizing: border-box;
        padding: 15px;
    }

        header p {
            font-size: 1px;
            display: none;
        }

        header img {
            height: 35px;
        }

    .logo-title {
        font-size: 24px;
    }

    .header-actions {
        gap: 10px;
    }

    .language-selector {
        gap: 6px;
        padding: 3px 6px;
        border-radius: 16px;
    }

    .lang-btn {
        font-size: 12px;
        padding: 4px 8px;
    }

    .lang-separator {
        font-size: 11px;
    }

    section {
        padding: 40px 15px;
    }

    .panel, .card {
        padding: 15px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: #111;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
        border-top: 2px solid var(--accent);
        box-sizing: border-box;
    }

        .nav-links.active {
            display: flex;
        }

        .nav-links a {
            padding: 12px 20px;
            margin: 0;
            text-align: center;
            border-bottom: 1px solid #333;
            font-size: 14px;
        }

            .nav-links a:last-child {
                border-bottom: none;
            }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* ======================================== */
/* RESPONSIVE - PREDICCIÓN TABLET */
/* ======================================== */
@media (max-width: 900px) {
    .prediccion-section {
        padding: 16px;
    }

    .prediccion-card {
        padding: 20px;
    }

    .prediccion-header-icon {
        font-size: 36px;
    }

    .prediccion-title {
        font-size: 20px;
    }
}

/* ======================================== */
/* RESPONSIVE - MÓVIL */
/* ======================================== */
@media (max-width: 768px) {
    .prediccion-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ======================================== */
/* RESPONSIVE - MÓVIL PREDICCIÓN */
/* ======================================== */
@media (max-width: 600px) {
    :root {
        --fs-cabecera: 14px;
    }

    .prediccion-section {
        padding: 12px;
    }

    .prediccion-card {
        padding: 16px;
        border-radius: 10px;
    }

    .prediccion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .prediccion-header-icon {
        font-size: 30px;
    }

    .prediccion-title {
        font-size: 17px;
    }

    .prediccion-subtitle {
        font-size: 12px;
    }

    .prediccion-controls-v2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .control-group {
        padding: 12px;
    }

    .control-group-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .control-group-content {
        gap: 10px;
    }

    .control-field {
        gap: 4px;
    }

    .control-label {
        font-size: 11px;
    }

    .control-input {
        padding: 9px 10px;
        font-size: 13px;
    }

    .button-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .prediccion-btn {
        width: 100%;
        padding: 8px 8px;
        min-height: 22px;
        font-size: 12px;
    }

    .btn-collapse-all {
        width: 100%;
        justify-content: center;
    }

    .prediccion-info-card {
        padding: 6px 8px;
        border-radius: 8px;
    }

        .prediccion-info-card h4 {
            margin: 0 0 6px 0;
            font-size: 14px;
        }

    .prediccion-stat {
        padding: 5px 0;
        gap: 8px;
    }

    .prediccion-stat-label {
        font-size: 12px;
        line-height: 1.3;
    }

    .prediccion-stat-value {
        font-size: 14px;
        line-height: 1.3;
    }

    .collapse-header {
        padding: 2px 0;
    }

    .collapse-icon {
        font-size: 10px;
    }

    /* 🆕 Acotado al timeline: NO debe alcanzar a los divs internos de Leaflet,
       que usan margin-top/margin-left inline para el anclaje de los iconos */
    #diagrama-temporal div[style*="margin-top"] {
        margin-top: 8px !important;
    }

    #diagrama-temporal div[style*="padding"] {
        padding: 6px !important;
    }

    .prediccion-tabla {
        font-size: 11px;
    }

        .prediccion-tabla th {
            padding: 8px 4px;
            font-size: 11px;
        }

        .prediccion-tabla td {
            padding: 6px 4px;
        }

    .nube-bar {
        width: 40px;
        height: 8px;
    }

    #prediccion-resultados {
        padding: 0;
    }

    #card-condiciones-actuales,
    #card-prediccion-tabla {
        padding: 12px !important;
    }

    .prediccion-info-grid {
        gap: 10px;
        margin-top: 12px;
    }

    #diagrama-temporal div[style*="font-size: 12px"],
    #diagrama-temporal div[style*="font-size: 13px"] {
        font-size: 11px !important;
    }

    .header-actions {
        gap: 6px;
    }

    .language-selector {
        gap: 2px;
        padding: 1px 3px;
        border-radius: 12px;
    }

    .lang-btn {
        font-size: 10px;
        padding: 2px 5px;
        border-radius: 8px;
    }

    .lang-separator {
        font-size: 9px;
    }

    .menu-toggle {
        padding: 4px;
        gap: 3px;
    }

        .menu-toggle span {
            width: 18px;
            height: 2px;
        }

    .footer-content {
        flex-direction: column;
        gap: 12px;
    }

    .modal-instalar-ios-content {
        padding: 25px 20px;
    }

    .modal-instalar-ios-title {
        font-size: 18px;
    }

    .modal-instalar-ios-step {
        font-size: 13px;
        padding: 10px 12px;
    }

    .condiciones-header-grid {
        gap: 8px;
    }

    .condiciones-header-item {
        margin-bottom: 6px;
    }

    .condiciones-label-sm {
        font-size: 8px;
    }

    .condiciones-value-md {
        font-size: 8px;
    }

    .condiciones-metricas-grid {
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    }

    .metrica-label {
        font-size: 11px;
    }

    .metrica-valor {
        font-size: 18px;
    }

    .btn-collapse-all {
        width: 100%;
        justify-content: center;
    }

    .logo-title {
        font-size: 18px;
    }
}

/* ======================================== */
/* RESPONSIVE - MÓVIL MUY PEQUEÑO */
/* ======================================== */
@media (max-width: 400px) {
    .button-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 380px) {
    :root {
        --fs-cabecera: 13px;
    }

    .prediccion-title {
        font-size: 15px;
    }

    .control-group-title {
        font-size: 11px;
    }

    .control-input {
        font-size: 12px;
        padding: 8px 9px;
    }

    .prediccion-info-card {
        padding: 2px 4px;
    }

        .prediccion-info-card h4 {
            font-size: 13px;
            margin: 0 0 4px 0;
        }

    .prediccion-stat {
        padding: 4px 0;
    }

    .prediccion-stat-label {
        font-size: 11px;
    }

    .prediccion-stat-value {
        font-size: 13px;
    }

    .prediccion-tabla {
        font-size: 10px;
    }

        .prediccion-tabla th,
        .prediccion-tabla td {
            padding: 5px 3px;
        }

    .nube-bar {
        width: 32px;
    }

    .header-actions {
        gap: 4px;
    }

    .language-selector {
        gap: 1px;
        padding: 1px 2px;
    }

    .lang-btn {
        font-size: 9px;
        padding: 2px 4px;
    }

    .lang-separator {
        font-size: 8px;
    }

    .menu-toggle span {
        width: 16px;
    }

    .condiciones-metricas-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 6px;
    }

    .metrica-label {
        font-size: 10px;
    }

    .metrica-valor {
        font-size: 16px;
    }
}

/* ======================================== */
/* PICKER DE OBJETOS CELESTES */
/* ======================================== */
.btn-picker-objeto {
    background: rgba(138, 43, 226, 0.15);
    border: 1px solid rgba(138, 43, 226, 0.4);
    color: #b84dff;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

    .btn-picker-objeto:hover {
        background: rgba(138, 43, 226, 0.3);
        border-color: #b84dff;
        transform: scale(1.05);
    }

    .btn-picker-objeto:active {
        transform: scale(0.95);
    }

.picker-objeto-dropdown {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10002 !important;
    min-width: 260px;
    max-width: 320px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: pickerFadeIn 0.15s ease;
}

@keyframes pickerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.picker-objeto-header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(74, 163, 255, 0.05);
}

.picker-objeto-lista {
    overflow-y: auto;
    flex: 1;
}

.picker-objeto-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

    .picker-objeto-item:last-child {
        border-bottom: none;
    }

    .picker-objeto-item:hover {
        background: rgba(138, 43, 226, 0.15);
    }

    .picker-objeto-item.activo {
        background: rgba(138, 43, 226, 0.2);
    }

.picker-objeto-icono {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.picker-objeto-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.picker-objeto-nombre {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-objeto-tipo {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.picker-objeto-check {
    color: #4caf50;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .picker-objeto-dropdown {
        min-width: 220px;
        max-width: 280px;
    }

    .picker-objeto-item {
        padding: 8px 12px;
    }

    .picker-objeto-nombre {
        font-size: 12px;
    }
}

/* ======================================== */
/* PICKER DE MODELO METEOROLÓGICO */
/* ======================================== */
.btn-picker-modelo {
    background: rgba(74, 163, 255, 0.15);
    border: 1px solid rgba(74, 163, 255, 0.4);
    color: var(--accent);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

    .btn-picker-modelo:hover {
        background: rgba(74, 163, 255, 0.3);
        border-color: var(--accent);
        transform: scale(1.05);
    }

    .btn-picker-modelo:active {
        transform: scale(0.95);
    }

.control-input-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.picker-modelo-dropdown {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10002 !important;
    min-width: 280px;
    max-width: 340px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: pickerFadeIn 0.15s ease;
}

.picker-modelo-header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(74, 163, 255, 0.05);
}

.picker-modelo-lista {
    overflow-y: auto;
    flex: 1;
}

.picker-modelo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

    .picker-modelo-item:last-child {
        border-bottom: none;
    }

    .picker-modelo-item:hover {
        background: rgba(74, 163, 255, 0.15);
    }

    .picker-modelo-item.activo {
        background: rgba(74, 163, 255, 0.2);
    }

.picker-modelo-icono {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.picker-modelo-info {
    flex: 1;
    min-width: 0;
}

.picker-modelo-nombre {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-modelo-check {
    color: #4caf50;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .picker-modelo-dropdown {
        min-width: 240px;
        max-width: 300px;
    }

    .picker-modelo-item {
        padding: 8px 12px;
    }

    .picker-modelo-nombre {
        font-size: 11px;
    }
}

/* ======================================== */
/* SLIDER FOV - ALINEACIÓN CORRECTA */
/* ======================================== */
.fov-slider-wrapper {
    position: relative;
    padding: 0 8px;
}

    .fov-slider-wrapper input[type="range"] {
        display: block;
        width: 100%;
        margin: 0;
    }

.fov-etiquetas-container {
    position: relative;
    height: 16px;
    margin-top: 2px;
    user-select: none;
    pointer-events: none;
}

.fov-etiqueta {
    position: absolute;
    transform: translateX(-50%);
    font-size: 9px;
    white-space: nowrap;
    transition: opacity 0.2s ease, color 0.2s ease;
}

@media (max-width: 480px) {
    .fov-etiqueta {
        font-size: 7px !important;
    }

        .fov-etiqueta[data-min-ancho="280"] {
            display: none !important;
        }
}

@media (max-width: 360px) {
    .fov-etiqueta[data-min-ancho="280"] {
        display: none !important;
    }
}

/* =============================================
   🖐️ GESTOS TÁCTILES - CONTENEDOR BASE
   ============================================= */
#diagrama-horizonte-container {
    touch-action: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    overflow: hidden;
    position: relative;
}

    #diagrama-horizonte-container svg {
        touch-action: none !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
        display: block;
        pointer-events: none;
    }

    #diagrama-horizonte-container.pantalla-completa {
        display: flex;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        background: #000;
    }

        #diagrama-horizonte-container.pantalla-completa.modo-horizontal {
            flex-direction: row;
        }

            #diagrama-horizonte-container.pantalla-completa.modo-horizontal #diagrama-horizonte-svg {
                flex: 1;
                height: 100%;
                width: 70%;
                aspect-ratio: 300 / 200;
            }

            #diagrama-horizonte-container.pantalla-completa.modo-horizontal #panel-info-lateral {
                width: 30%;
                height: 100%;
                overflow-y: auto;
                background: rgba(10, 10, 20, 0.95);
                border-left: 1px solid rgba(255, 255, 255, 0.1);
            }

        #diagrama-horizonte-container.pantalla-completa.modo-vertical {
            flex-direction: column;
        }

            #diagrama-horizonte-container.pantalla-completa.modo-vertical #diagrama-horizonte-svg {
                flex: 1;
                width: 100%;
                height: 65%;
                aspect-ratio: 200 / 300;
            }

            #diagrama-horizonte-container.pantalla-completa.modo-vertical #panel-info-lateral {
                width: 100%;
                height: 35%;
                overflow-y: auto;
                background: rgba(10, 10, 20, 0.95);
                border-top: 1px solid rgba(255, 255, 255, 0.1);
            }

/* =============================================
   📊 PANEL LATERAL IZQUIERDO (CONDENSADO)
   ============================================= */
#panel-info-lateral {
    width: 320px;
    min-width: 280px;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-right: 2px solid rgba(74, 163, 255, 0.3);
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
    color: white;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.panel-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.panel-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid #4aa3ff;
    gap: 6px;
    min-width: 0;
}

    .panel-info-row .panel-info-label {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
        letter-spacing: 0.2px;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .panel-info-row .panel-info-value {
        font-size: 11px;
        font-weight: bold;
        color: white;
        text-align: right;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .panel-info-row.destacado {
        border-left-color: #b84dff;
        background: rgba(138, 43, 226, 0.1);
    }

        .panel-info-row.destacado .panel-info-value {
            color: #b84dff;
        }

    .panel-info-row.luna {
        border-left-color: #ffc107;
        background: rgba(255, 193, 7, 0.08);
    }

        .panel-info-row.luna .panel-info-value {
            color: #ffc107;
        }

.panel-control-row {
    margin-bottom: 0px;
}

.panel-control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0px;
}

.panel-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
}

.panel-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(74, 163, 255, 0.2);
    flex-shrink: 0;
}

.panel-logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-logo-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.panel-logo-text {
    font-size: 10px;
    font-weight: bold;
    color: #4aa3ff;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#diagrama-horizonte-container.pantalla-completa svg {
    flex: 1;
    width: auto;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#diagrama-horizonte-container.pantalla-completa .horizonte-controles {
    display: none !important;
}

#diagrama-horizonte-container {
    cursor: grab;
}

    #diagrama-horizonte-container:active {
        cursor: grabbing;
    }

    #diagrama-horizonte-container.pantalla-completa {
        cursor: default;
    }

/* =============================================
   📍 MARCADOR DE CACHÉ (azul)
   ============================================= */
.custom-cache-marker {
    background: transparent !important;
    border: none !important;
}

.icono-cache-marker {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #4aa3ff 0%, #2b7fd4 100%);
    border: 2px solid white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .icono-cache-marker .emoji {
        transform: rotate(45deg);
        font-size: 11px;
    }

    .icono-cache-marker.icono-rojo {
        background: linear-gradient(135deg, #ff6b6b 0%, #d42b2b 100%);
        border-color: #ffd4d4;
        box-shadow: 0 2px 6px rgba(220, 53, 69, 0.5);
    }

/* =============================================
   📋 POPUP DE CACHÉ (con mejor contraste)
   ============================================= */
/* ═══ POPUP DE CACHÉ COMPACTO ═══ */
.popup-cache-contenido {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 11px; /* antes 12px */
    color: #1a1a1a;
    min-width: 260px; /* antes 280px */
    width: 260px;
    padding: 0;
    line-height: 1.2; /* 🆕 interlineado base */
}

.popup-cache-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 5px; /* antes 10px */
    margin-bottom: 5px; /* antes 10px */
    border-bottom: 2px solid #4aa3ff;
}

/* 🆕 Iconos de acción: juntos y pegados a la derecha */
.popup-cache-header-texto .popup-cache-fila {
    justify-content: flex-end; /* agrupa a la derecha en vez de repartir */
    gap: 4px; /* más pegados entre sí */
}

.popup-cache-icono {
    font-size: 17px; /* antes 22px */
    flex-shrink: 0;
    line-height: 1;
}

.popup-cache-header-texto {
    flex: 1;
    min-width: 0;
}

.popup-cache-nombre {
    font-size: 13px; /* antes 15px */
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2; /* antes 1.3 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.popup-cache-subtitulo {
    font-size: 9px;
    color: #888;
    font-style: italic;
    margin-top: 1px;
    line-height: 1.2;
}

.popup-cache-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0; /* antes 5px 0 → ahorra 6px por fila */
    gap: 8px;
    line-height: 1.25;
}

.popup-cache-label {
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
    font-size: 11px;
}

.popup-cache-valor {
    text-align: right;
    color: #1a1a1a;
    font-size: 10px;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.25;
}

.popup-cache-separador {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 5px 0; /* antes 10px 0 */
}

.popup-cache .leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    background: #ffffff;
}

.popup-cache .leaflet-popup-tip {
    background: #ffffff;
}

/* 🆕 Clave: pisa el line-height 1.4 que Leaflet impone por defecto */
.popup-cache .leaflet-popup-content {
    margin: 8px 10px; /* antes 12px 14px */
    line-height: 1.25;
}

.popup-cache .popup-foto-btn-usar {
    width: 100%;
    margin-top: 6px; /* antes 12px */
    padding: 7px 12px; /* antes 10px 14px */
    background: linear-gradient(135deg, #4aa3ff 0%, #2b7fd4 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(74, 163, 255, 0.3);
}

    .popup-cache .popup-foto-btn-usar:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(74, 163, 255, 0.4);
        filter: brightness(1.1);
    }

.popup-cache-nombre-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.popup-cache-action-btn {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 12px; /* antes 14px */
    padding: 1px 4px; /* antes 2px 6px */
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

    .popup-cache-action-btn:hover {
        background: rgba(0, 0, 0, 0.08);
        border-color: rgba(0, 0, 0, 0.1);
        transform: scale(1.1);
    }

.btn-editar:hover {
    color: #4aa3ff;
}

.btn-favorito:hover {
    color: #ffc107;
}

.btn-borrar:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.btn-compartir {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

    .btn-compartir svg {
        width: 14px;
        height: 14px;
        stroke: currentColor;
        transition: all 0.2s ease;
    }

    .btn-compartir:hover {
        color: #2196f3;
        background: rgba(33, 150, 243, 0.1);
    }

        .btn-compartir:hover svg {
            transform: scale(1.1);
        }

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 6px;
        padding: 8px 10px;
    }

    .install-btn {
        font-size: 11px;
        padding: 6px 10px;
        min-height: auto;
    }

    .install-btn-text {
        font-size: 11px;
    }

    .footer-copyright {
        font-size: 10px;
    }
}

@media (max-width: 400px) {
    .install-btn {
        font-size: 10px;
        padding: 5px 8px;
    }

    .install-btn-text {
        font-size: 10px;
    }
}

.btn-editar-medidas:hover {
    color: #4aa3ff;
    background: rgba(74, 163, 255, 0.1);
}

/* =============================================
   🎯 MARCADOR DE PRECISIÓN (CROSSHAIR)
   ============================================= */
.custom-precision-marker {
    background: transparent !important;
    border: none !important;
}

.crosshair-marker {
    position: relative;
    width: 40px;
    height: 40px;
}

.crosshair-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    border: 2px solid #ff4444;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    transform: translate(-50%, -50%);
    background: #ff4444;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(255, 68, 68, 0.8);
}

.crosshair-line.crosshair-h {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 68, 68, 0.6);
    transform: translateY(-50%);
}

.crosshair-line.crosshair-v {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: rgba(255, 68, 68, 0.6);
    transform: translateX(-50%);
}

button[onpointerdown*="iniciarAccionContinua"],
button[onpointerdown*="iniciarMovimientoContinuo"] {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

.poi-clickeable:hover rect:not(.poi-hitarea) {
    filter: brightness(1.4) drop-shadow(0 0 4px rgba(74, 222, 128, 0.6));
    transition: filter 0.2s ease;
}

.poi-clickeable:active rect:not(.poi-hitarea) {
    filter: brightness(0.8);
}

.poi-hitarea {
    fill: transparent !important;
    stroke: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   🗺️ MAPA INTEGRADO EN EL FORMULARIO
/* ═══ MAPA: siempre visible, 640px de alto ═══ */
.mapa-container {
    margin-top: var(--gap-secciones, 16px);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: block;
}

.mapa-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    box-sizing: border-box;
}

#google-map {
    width: 100%;
    height: 500px; /* base: aplica en TODAS las pantallas */
    min-height: 500px;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
    background: #1a1a1a;
}


#panel-sombra-controles {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 8px;
    box-sizing: border-box;
}

.leaflet-container {
    width: 100% !important;
    height: 100% !important;
    background: #1a1a1a !important;
    box-sizing: border-box !important;
}

/* ═══ FILA SUPERIOR: localidad + botones a la derecha ═══ */
.ubicacion-fila-superior {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

    .ubicacion-fila-superior .autocomplete-container {
        flex: 1 1 auto;
        min-width: 120px;
    }

#btn-ubicacion,
#btn-buscar {
    flex: 0 0 auto;
}

/* 🆕 El bloque extra se mueve como una sola unidad */
.ubicacion-botones-extra {
    display: flex;
    gap: 6px;
    flex: 0 0 auto; /* no se parte: baja entero */
    margin-left: auto;
}


/* ═══ FILA INFERIOR: lat/lon izq + botones der ═══ */
.mapa-fila-inferior {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

    .mapa-fila-inferior .coordenadas-display {
        flex: 0 0 90px; /* fijo: no crece ni se encoge */
        width: 90px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

        .mapa-fila-inferior .coordenadas-display label {
            font-size: 11px;
            color: var(--muted);
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .mapa-fila-inferior .coordenadas-display input {
            width: 100%;
            min-width: 0;
            padding: 10px 12px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 6px;
            color: var(--text);
            font-size: 14px;
            font-family: monospace;
            box-sizing: border-box;
        }

.mapa-botones-derecha {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
}

/* ═══ BOTONES DE SOLO ICONO (cuadrados) ═══ */
.prediccion-btn.btn-icono {
    flex: 0 0 auto;
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px; /* 🆕 altura propia */
    min-height: 36px; /* 🆕 gana al min-height: 22px de .prediccion-btn en móvil */
    padding: 0;
    font-size: 18px;
    line-height: 1;
    justify-content: center;
    align-items: center;
}

/* ═══ BOTONES CON TEXTO FIJO (sin salto de línea) ═══ */
.prediccion-btn.btn-texto-fijo {
    flex: 0 0 auto;
    white-space: nowrap;
    width: auto; /* 🆕 gana al width:100% de la media query */
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
}

    .prediccion-btn.btn-texto-fijo .btn-text {
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
        hyphens: none;
    }

/* ═══ RESPONSIVE: pantallas estrechas ═══ */
@media (max-width: 680px) {
    /* 🆕 Sin márgenes laterales */
    .prediccion-section {
        padding: 8px 0;
        max-width: 100%;
    }

    /* 🆕 Marco de secciones reducido */
    .control-group {
        padding: 10px 8px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .mapa-container {
        margin-top: 8px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .mapa-body {
        padding: 8px;
        gap: 8px;
    }

    .mapa-fila-inferior .coordenadas-display input {
        padding: 8px 6px;
        font-size: 11px;
    }

    /* 🆕 Cuadros de lat/lon más estrechos en pantalla estrecha */
    .mapa-fila-inferior .coordenadas-display {
        flex: 0 0 70px;
        width: 70px;
    }

    .prediccion-btn.btn-icono {
        width: 38px;
        min-width: 38px;
        max-width: 38px;
        font-size: 16px;
    }

    /* 🆕 Resultados a ancho completo, sin márgenes laterales */
    #resultados {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }

    /* 🆕 Tarjetas sin marco lateral, más compactas */
    /* 🆕 Tarjetas sin marco lateral, más compactas */
    .prediccion-info-card,
    #card-prediccion-tabla {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 8px;
    }

    .prediccion-info-grid {
        gap: 10px;
        margin-top: 10px;
    }

    /* 🆕 La tabla pega a los bordes y gana ancho útil */
    .prediccion-tabla-container {
        padding: 0;
    }

    .prediccion-tabla th,
    .prediccion-tabla td {
        padding: 6px 4px;
    }

    /* Cabeceras de tarjeta más ajustadas */
    .prediccion-info-card h4,
    #card-prediccion-tabla h4 {
        margin: 0 0 8px 0;
    }

}

/* 🆕 Punto de mira rojo en el botón Usar */
#btn-usar-coordenadas {
    color: #ff4444;
}

    #btn-usar-coordenadas:hover {
        color: #ff6666; /* un poco más claro al pasar el ratón */
    }

#btn-get-sombra {
    color: #f59e0b;
}


#panel-sombra-controles {
    overflow-x: hidden; /* 🆕 nunca scroll horizontal */
}

/* ═══ SELECTOR DE HORA EN EL DIAGRAMA TEMPORAL ═══ */
.timeline-linea-hora {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 5;
}

.timeline-selector {
    margin-top: 8px;
    padding: 0 2px;
}

    .timeline-selector input[type="range"] {
        display: block;
        width: 100%;
        cursor: pointer;
        accent-color: #4aa3ff;
    }


/* ========================================
   TIMELINE ASTRONÓMICO AISLADO
   ======================================== */

.timeline-card {
    background: #2a2a2a;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    padding: 6px 8px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 0 0 4px 0;
    padding: 2px 0;
    color: inherit; /* 🆕 mismo color que el resto de cabeceras (heredado de --text) */
    line-height: 1.25;
    transition: color 0.2s ease;
}

    .timeline-header:hover {
        color: var(--accent);
    }

.tl-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 0 2px;
    flex-wrap: wrap;
    gap: 6px;
}

.tl-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tl-nav-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tl-day-label {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.tl-day-btn {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.tl-date-picker {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: var(--text);
    font-size: 11px;
    padding: 3px 6px;
    cursor: pointer;
    height: 24px;
    color-scheme: dark;
    box-sizing: border-box;
}

.tl-slider-block {
    margin-top: 4px;
    padding: 0;
}

.tl-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.tl-slider-title {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
}

.tl-slider-label {
    font-size: 11px;
    color: #4aa3ff;
    font-weight: bold;
}

.tl-slider {
    width: 100%;
    cursor: pointer;
    accent-color: #4aa3ff;
    height: 14px;
    margin: 0;
    display: block;
}

.tl-bars {
    position: relative;
    min-height: 48px;
    overflow: hidden;
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
}

.tl-track-label {
    position: absolute;
    left: 4px;
    font-size: 9px;
    color: var(--muted);
    z-index: 6;
}

.tl-event-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    white-space: nowrap;
    z-index: 10;
}

.tl-legend {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    font-size: 9px;
}

.tl-legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.tl-legend-color {
    width: 10px;
    height: 5px;
    border-radius: 2px;
}

/* Responsive propio del timeline, sin depender de prediccion-info-card */
@media (max-width: 680px) {
    .timeline-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 6px 8px;
    }

}

@media (max-width: 600px) {
    .timeline-card {
        padding: 6px 8px;
    }

    .tl-nav {
        gap: 4px;
        padding: 0 2px;
    }

    .tl-nav-group {
        gap: 6px;
    }

    .tl-day-btn {
        padding: 3px 7px;
        font-size: 11px;
    }

    .tl-day-label {
        font-size: 11px;
    }

    .tl-date-picker {
        font-size: 11px;
        height: 24px;
        padding: 3px 5px;
    }

    .tl-bars {
        min-height: 48px;
        padding: 10px;
    }

    .tl-legend {
        margin-top: 8px;
        gap: 6px;
        font-size: 9px;
    }
}

/* ======================================== */
/* 🆕 TAMAÑO UNIFICADO DE CABECERAS DE FICHA */
/* ======================================== */
.prediccion-info-card .collapse-header,
#card-prediccion-tabla .collapse-header,
.timeline-card .timeline-header {
    font-size: var(--fs-cabecera);
    line-height: 1.25; /* mismo interlineado que la Línea Temporal */
    padding: 2px 0; /* mismo padding vertical compacto */
    margin: 0 0 4px 0; /* mismo margen inferior */
}

/* ======================================== */
/* 🆕 ICONO DE COLAPSO (▼) UNIFICADO         */
/* ======================================== */
.collapse-header .collapse-icon,
.timeline-header .collapse-icon {
    font-size: inherit; /* mismo tamaño que el título de su cabecera */
    color: inherit; /* mismo color que el título de su cabecera */
    line-height: 1;
}


/* ================================================================
   🔴 MODO VISIÓN NOCTURNA — DBP Forecast
   Activación: document.documentElement.classList.add('modo-nocturno')
   Requiere el <filter id="filtro-vision-nocturna"> en el HTML.
   ================================================================ */

/* ---------- 1. Filtro global ---------- */
html.modo-nocturno {
    filter: url(#filtro-vision-nocturna);
    background: #1a0000;
    color-scheme: dark; /* date pickers y controles nativos oscuros */
}

    /* ---------- 2. Pantalla completa ----------
   El elemento en fullscreen se pinta en la "top layer" y NO hereda
   el filtro del <html>: hay que aplicárselo directamente.        */
    html.modo-nocturno :fullscreen {
        filter: url(#filtro-vision-nocturna);
        background: #1a0000;
    }

        html.modo-nocturno :fullscreen::backdrop {
            background: #1a0000;
        }
    /* Cobertura explícita para el diagrama (por si :fullscreen no aplica) */
    html.modo-nocturno #diagrama-horizonte-container.pantalla-completa {
        filter: url(#filtro-vision-nocturna);
    }

    /* ---------- 3. Atenuar elementos brillantes ----------
   No se pueden "desteñir" (el filtro del ancestro siempre gana),
   pero sí bajar su brillo para que no deslumbren.               */
    html.modo-nocturno img,
    html.modo-nocturno .leaflet-tile,
    html.modo-nocturno .leaflet-marker-icon {
        filter: brightness(0.55);
    }

    html.modo-nocturno input[type="range"] {
        filter: brightness(0.7);
    }

    html.modo-nocturno .leaflet-popup-content-wrapper {
        filter: brightness(0.8);
    }

    /* ---------- 4. Capa ámbar de refuerzo ---------- */
    html.modo-nocturno body::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(180, 40, 20, 0.08);
        mix-blend-mode: multiply;
        pointer-events: none;
        z-index: 2147483000; /* por debajo solo del indicador */
    }

    /* ---------- 5. Scrollbars en rojo (WebKit) ---------- */
    html.modo-nocturno ::-webkit-scrollbar {
        background: #1a0000;
    }

    html.modo-nocturno ::-webkit-scrollbar-thumb {
        background: #6b1a10;
        border-radius: 4px;
    }

/* ---------- 6. Botón de activación ---------- */
.btn-modo-nocturno {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--accent, #4aa3ff);
    color: var(--accent, #4aa3ff);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    transition: background 0.2s ease;
}

    .btn-modo-nocturno:hover {
        background: rgba(255, 255, 255, 0.15);
    }
/* Estado activo (lo añade toggleModoNocturno) */
html.modo-nocturno .btn-modo-nocturno {
    background: rgba(180, 30, 20, 0.35);
}

/* ---------- 7. Indicador flotante ----------
   Colores pensados para QUEDAR BIEN tras pasar por el filtro:
   fondo rojo oscuro y texto claro → salen ámbar legible.        */
.indicador-modo-nocturno {
    position: fixed;
    bottom: 12px;
    right: 12px;
    background: rgba(60, 10, 5, 0.92);
    color: #ffe0d0;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 120, 90, 0.4);
    font-size: 11px;
    font-weight: bold;
    z-index: 2147483647; /* siempre encima, incluso en fullscreen */
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    animation: fadeInNocturno 0.3s ease;
}

/* Pre-iluminar el mapa en modo nocturno para que siga siendo usable.
   El filtro del hijo se aplica ANTES que el filtro rojo del padre,
   así el mapa recupera brillo pero sigue teñido de rojo. */
html.modo-nocturno #mapa-container {
    filter: brightness(1.7);
}

@keyframes fadeInNocturno {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 8. Transición suave al activar/desactivar ---------- */
html {
    transition: filter 0.3s ease, background 0.3s ease;
}


#btn-nueva-version {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
    animation: pulso-version 2s ease-in-out infinite;
    transition: transform 0.2s, box-shadow 0.2s;
}

    #btn-nueva-version:hover {
        transform: scale(1.05);
        animation-play-state: paused;
    }

@keyframes pulso-version {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
        opacity: 1;
    }

    50% {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.7);
        opacity: 0.75;
    }
}
