:root {
    --forecast-cyan: #38bdf8;
    --forecast-blue: #2563eb;
    --forecast-dark: #081522;
    --forecast-card: rgba(12, 31, 50, 0.94);
    --forecast-border: rgba(125, 211, 252, 0.18);
    --forecast-muted: #9fb3c8;
    --forecast-text: #f8fbff;
    --forecast-red: #fb7185;
    --forecast-yellow: #fbbf24;
}

.forecast-page {
    background:
        radial-gradient(
            circle at 12% 7%,
            rgba(14, 165, 233, 0.09),
            transparent 28rem
        ),
        radial-gradient(
            circle at 92% 34%,
            rgba(37, 99, 235, 0.08),
            transparent 32rem
        );
}

.forecast-main {
    padding-top: 24px;
    padding-bottom: 50px;
}


/* Cabecera principal */

.forecast-hero {
    position: relative;
    min-height: 285px;
    margin-bottom: 24px;
    padding: 42px 46px;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 24px;
    background:
        linear-gradient(
            118deg,
            rgba(7, 25, 42, 0.98) 0%,
            rgba(10, 48, 76, 0.95) 55%,
            rgba(17, 75, 112, 0.82) 100%
        );
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.28),
        inset 0 1px rgba(255, 255, 255, 0.04);
    isolation: isolate;
}

.forecast-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.28;
    background-image:
        linear-gradient(
            rgba(125, 211, 252, 0.06) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(125, 211, 252, 0.06) 1px,
            transparent 1px
        );
    background-size: 40px 40px;
    mask-image:
        linear-gradient(
            90deg,
            transparent,
            black 50%,
            black
        );
}

.forecast-hero-glow {
    position: absolute;
    width: 430px;
    height: 430px;
    top: -260px;
    right: 6%;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.27);
    filter: blur(60px);
    pointer-events: none;
}

.forecast-hero-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
}

.forecast-kicker {
    margin-bottom: 11px;
    color: #7dd3fc;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.19em;
}

.forecast-hero h1 {
    margin: 0;
    color: white;
    font-size: clamp(2.2rem, 6vw, 4.3rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.forecast-hero-content > p {
    max-width: 650px;
    margin: 17px 0 0;
    color: #c5d8e9;
    font-size: clamp(1rem, 2vw, 1.16rem);
    line-height: 1.65;
}

.forecast-model-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.forecast-model-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border: 1px solid rgba(125, 211, 252, 0.25);
    border-radius: 999px;
    background: rgba(2, 14, 25, 0.44);
    backdrop-filter: blur(12px);
}

.forecast-model-pill strong,
.forecast-model-pill span {
    display: block;
}

.forecast-model-pill strong {
    color: white;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}

.forecast-model-pill div > span {
    margin-top: 2px;
    color: #9fc2da;
    font-size: 0.73rem;
}

.forecast-model-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
    animation: forecast-pulse 2.2s infinite;
}

.forecast-updated {
    color: #9fbad0;
    font-size: 0.82rem;
}

.forecast-hero-symbol {
    position: absolute;
    right: 6%;
    bottom: 17px;
    z-index: 1;
    font-size: clamp(7rem, 16vw, 12rem);
    opacity: 0.78;
    filter:
        drop-shadow(0 20px 25px rgba(0, 0, 0, 0.25));
    transform: rotate(-5deg);
}


/* Bloques */

.forecast-panel {
    position: relative;
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid var(--forecast-border);
    border-radius: 22px;
    background:
        linear-gradient(
            145deg,
            rgba(13, 35, 56, 0.97),
            rgba(8, 25, 41, 0.98)
        );
    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.18),
        inset 0 1px rgba(255, 255, 255, 0.03);
}

.forecast-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.forecast-panel-heading {
    display: flex;
    align-items: flex-start;
    gap: 17px;
}

.forecast-number {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(56, 189, 248, 0.30);
    border-radius: 13px;
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.08);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.forecast-overline {
    display: block;
    margin-bottom: 5px;
    color: #38bdf8;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.17em;
}

.forecast-panel h2 {
    margin: 0;
    color: white;
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.15;
}

.forecast-panel-heading p {
    margin: 7px 0 0;
    color: var(--forecast-muted);
    font-size: 0.92rem;
}

.forecast-badge {
    flex: 0 0 auto;
    padding: 8px 13px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 999px;
    color: #a5e3ff;
    background: rgba(14, 165, 233, 0.08);
    font-size: 0.78rem;
    font-weight: 800;
}


/* Previsión semanal */

.forecast-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.forecast-day-card {
    position: relative;
    min-width: 0;
    min-height: 300px;
    padding: 18px 14px 15px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(
            180deg,
            rgba(20, 46, 70, 0.92),
            rgba(9, 28, 46, 0.97)
        );
    text-align: center;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.forecast-day-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    width: 60%;
    height: 3px;
    border-radius: 0 0 8px 8px;
    background: #64748b;
    box-shadow: 0 0 18px currentColor;
}

.forecast-day-card:hover {
    z-index: 2;
    transform: translateY(-5px);
    border-color: rgba(125, 211, 252, 0.38);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.24);
}

.forecast-day-card.is-today {
    border-color: rgba(56, 189, 248, 0.55);
    background:
        linear-gradient(
            180deg,
            rgba(10, 78, 116, 0.92),
            rgba(8, 34, 55, 0.98)
        );
    box-shadow:
        0 13px 32px rgba(14, 165, 233, 0.13);
}

.forecast-day-card.weather-clear::before {
    background: #fbbf24;
}

.forecast-day-card.weather-partly::before {
    background: #38bdf8;
}

.forecast-day-card.weather-cloudy::before {
    background: #94a3b8;
}

.forecast-day-card.weather-rain::before {
    background: #2563eb;
}

.forecast-day-card.weather-storm::before {
    background: #a78bfa;
}

.forecast-day-card.weather-snow::before {
    background: #e0f2fe;
}

.forecast-day-card.weather-fog::before {
    background: #cbd5e1;
}


/* AVISOS_AEMET_TARJETAS_CSS_INICIO */

.forecast-day-aemet-alert {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.90rem;
    line-height: 1;
    cursor: help;
    box-shadow:
        0 5px 12px rgba(0, 0, 0, 0.34),
        inset 0 1px rgba(255, 255, 255, 0.30);
}

.forecast-day-aemet-alert.is-amarillo {
    color: #172033;
    border-color: #fde68a;
    background: #facc15;
}

.forecast-day-aemet-alert.is-naranja {
    color: #ffffff;
    border-color: #fdba74;
    background: #f97316;
}

.forecast-day-aemet-alert.is-rojo {
    color: #ffffff;
    border-color: #fca5a5;
    background: #ef4444;
}

.forecast-day-card.is-aemet-amarillo {
    border-color: rgba(250, 204, 21, 0.48);
}

.forecast-day-card.is-aemet-naranja {
    border-color: rgba(249, 115, 22, 0.58);
}

.forecast-day-card.is-aemet-rojo {
    border-color: rgba(239, 68, 68, 0.68);
}

/* AVISOS_AEMET_TARJETAS_CSS_FIN */

.forecast-day-name {
    color: white;
    font-size: 0.94rem;
    font-weight: 900;
    text-transform: capitalize;
}

.forecast-day-date {
    margin-top: 3px;
    color: #8da8bd;
    font-size: 0.72rem;
}

.forecast-day-icon {
    display: block;
    margin: 16px 0 7px;
    font-size: 3.4rem;
    line-height: 1;
    filter: drop-shadow(0 9px 13px rgba(0, 0, 0, 0.28));
}

.forecast-day-description {
    min-height: 34px;
    color: #bed2e1;
    font-size: 0.78rem;
    line-height: 1.35;
}

.forecast-day-temps {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
    margin-top: 13px;
}

.forecast-temp-max {
    color: #ff8da0;
    font-size: 1.45rem;
    font-weight: 900;
}

.forecast-temp-min {
    color: #7dd3fc;
    font-size: 1rem;
    font-weight: 800;
}

.forecast-day-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.13);
    color: #9eb4c7;
    font-size: 0.7rem;
    text-align: left;
}

.forecast-day-metric {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.forecast-day-metric strong {
    color: #d8e8f3;
    font-weight: 800;
}


/* Selectores de hoy y mañana */

.forecast-day-controls {
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
    padding: 4px;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 13px;
    background: rgba(2, 15, 26, 0.48);
}

.forecast-day-button {
    appearance: none;
    padding: 9px 17px;
    border: 0;
    border-radius: 9px;
    color: #93abc0;
    background: transparent;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
    transition:
        color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.forecast-day-button:hover {
    color: white;
    background: rgba(56, 189, 248, 0.09);
}

.forecast-day-button.active {
    color: #04121e;
    background:
        linear-gradient(135deg, #7dd3fc, #38bdf8);
    box-shadow: 0 7px 18px rgba(14, 165, 233, 0.23);
}

.forecast-map-date {
    min-height: 21px;
    margin: -12px 0 13px;
    color: #9fc2d8;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: right;
    text-transform: capitalize;
}


/* Mapas */

.forecast-map-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.18);
    border-radius: 18px;
    background: #07131e;
    box-shadow:
        inset 0 0 45px rgba(0, 0, 0, 0.38);
}

.forecast-map {
    width: 100%;
    height: 570px;
    background:
        radial-gradient(
            circle at center,
            #12334b,
            #07131e 72%
        );
}

.forecast-map-spain {
    height: 620px;
}

.forecast-map-status {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 30px;
    color: #c9e8f8;
    background: rgba(5, 18, 30, 0.88);
    font-weight: 800;
    text-align: center;
    backdrop-filter: blur(8px);
}

.forecast-map-status[hidden] {
    display: none;
}

.forecast-map-hint {
    margin-top: 12px;
    color: #809caf;
    font-size: 0.76rem;
    text-align: center;
}


/* Marcadores meteorológicos */

.mv-weather-div-icon {
    border: 0;
    background: transparent;
}

.weather-marker {
    position: relative;
    width: 88px;
    padding: 5px 5px 6px;
    border: 1px solid rgba(186, 230, 253, 0.48);
    border-radius: 13px;
    color: white;
    background: rgba(5, 21, 34, 0.91);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.42),
        inset 0 1px rgba(255, 255, 255, 0.08);
    text-align: center;
    backdrop-filter: blur(8px);
    transform: translate(-3px, -3px);
}

.weather-marker::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 12px;
    height: 12px;
    border-right: 1px solid rgba(186, 230, 253, 0.48);
    border-bottom: 1px solid rgba(186, 230, 253, 0.48);
    background: rgba(5, 21, 34, 0.95);
    transform: translateX(-50%) rotate(45deg);
}

.weather-marker.weather-marker-spain {
    width: 76px;
    padding: 4px 4px 5px;
    border-radius: 11px;
}

.weather-marker-icon {
    display: block;
    height: 29px;
    font-size: 1.65rem;
    line-height: 29px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.weather-marker-spain .weather-marker-icon {
    height: 25px;
    font-size: 1.4rem;
    line-height: 25px;
}

.weather-marker-name {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: #f4faff;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-marker-temps {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 3px;
    font-size: 0.68rem;
    font-weight: 900;
}

.weather-marker-max {
    color: #fb8ca0;
}

.weather-marker-min {
    color: #76d2fb;
}


/* Ventanas emergentes de los mapas */

.forecast-page .leaflet-popup-content-wrapper,
.forecast-page .leaflet-popup-tip {
    color: #eaf7ff;
    background: #0b2133;
}

.forecast-page .leaflet-popup-content-wrapper {
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 15px;
    box-shadow: 0 17px 36px rgba(0, 0, 0, 0.38);
}

.forecast-page .leaflet-popup-content {
    min-width: 185px;
    margin: 14px 16px;
}

.forecast-page .leaflet-popup-close-button {
    color: #b8d8eb;
}

.forecast-popup-title {
    margin-right: 15px;
    color: white;
    font-size: 0.95rem;
    font-weight: 900;
}

.forecast-popup-condition {
    margin: 5px 0 11px;
    color: #9ec4da;
    font-size: 0.74rem;
}

.forecast-popup-temps {
    display: flex;
    gap: 9px;
    margin-bottom: 11px;
    font-size: 1.2rem;
    font-weight: 900;
}

.forecast-popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.forecast-popup-stat {
    padding: 7px;
    border-radius: 8px;
    color: #92adbf;
    background: rgba(125, 211, 252, 0.06);
    font-size: 0.66rem;
}

.forecast-popup-stat strong {
    display: block;
    margin-top: 2px;
    color: #e7f5fd;
    font-size: 0.75rem;
}

.forecast-page .leaflet-control-zoom a {
    color: #dff5ff;
    border-color: rgba(125, 211, 252, 0.18);
    background: rgba(7, 25, 40, 0.94);
}

.forecast-page .leaflet-control-zoom a:hover {
    color: white;
    background: #123b56;
}

.forecast-page .leaflet-control-attribution {
    color: #7892a5;
    background: rgba(4, 16, 27, 0.76);
}

.forecast-page .leaflet-control-attribution a {
    color: #76cbed;
}


/* Canarias */

.forecast-islands {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid rgba(125, 211, 252, 0.13);
    border-radius: 15px;
    background: rgba(3, 18, 30, 0.45);
}

.forecast-islands-title {
    margin-bottom: 10px;
    color: #91cbe4;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.forecast-islands-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.forecast-island-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 12px;
    background: rgba(15, 41, 62, 0.67);
}

.forecast-island-icon {
    font-size: 2rem;
}

.forecast-island-name {
    color: white;
    font-size: 0.82rem;
    font-weight: 900;
}

.forecast-island-condition {
    margin-top: 2px;
    color: #93adbf;
    font-size: 0.68rem;
}

.forecast-island-temps {
    margin-left: auto;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 900;
}


/* Fuente de datos */

.forecast-source {
    display: flex;
    gap: 15px;
    padding: 20px 22px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 17px;
    color: #98afc1;
    background: rgba(7, 25, 40, 0.65);
    font-size: 0.83rem;
    line-height: 1.55;
}

.forecast-source-icon {
    font-size: 1.35rem;
}

.forecast-source strong {
    color: #dcecf6;
}

.forecast-source p {
    margin: 5px 0 9px;
}

.forecast-source-links {
    display: flex;
    gap: 15px;
}

.forecast-source-links a {
    color: #63cdf7;
    font-weight: 800;
    text-decoration: none;
}

.forecast-source-links a:hover {
    text-decoration: underline;
}


/* Estados */

.forecast-loading,
.forecast-error {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-height: 160px;
    padding: 25px;
    border: 1px dashed rgba(125, 211, 252, 0.20);
    border-radius: 16px;
    color: #9fc1d5;
    text-align: center;
}

.forecast-error {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.25);
    background: rgba(127, 29, 29, 0.08);
}

.forecast-spinner {
    width: 19px;
    height: 19px;
    border: 2px solid rgba(125, 211, 252, 0.22);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: forecast-spin 800ms linear infinite;
}

@keyframes forecast-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes forecast-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.10);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.02);
    }
}


/* Adaptación a tablet y móvil */

@media (max-width: 1180px) {
    .forecast-week {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .forecast-hero-symbol {
        right: 3%;
        opacity: 0.45;
    }
}

@media (max-width: 760px) {
    .forecast-main {
        padding-top: 14px;
    }

    .forecast-hero {
        min-height: auto;
        padding: 30px 22px;
        border-radius: 19px;
    }

    .forecast-hero-symbol {
        top: 18px;
        right: 12px;
        bottom: auto;
        font-size: 5rem;
        opacity: 0.20;
    }

    .forecast-model-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .forecast-model-pill {
        border-radius: 15px;
    }

    .forecast-panel {
        padding: 20px 14px;
        border-radius: 18px;
    }

    .forecast-panel-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 17px;
    }

    .forecast-panel-heading {
        gap: 12px;
    }

    .forecast-number {
        width: 38px;
        height: 38px;
    }

    .forecast-badge {
        position: absolute;
        top: 20px;
        right: 14px;
    }

    .forecast-week {
        display: flex;
        gap: 11px;
        margin-right: -14px;
        padding-right: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-color: #1d668c transparent;
        scrollbar-width: thin;
    }

    .forecast-day-card {
        width: 205px;
        min-width: 205px;
        scroll-snap-align: start;
    }

    .forecast-day-controls {
        width: 100%;
    }

    .forecast-day-button {
        flex: 1;
    }

    .forecast-map-date {
        margin-top: -6px;
        text-align: left;
    }

    .forecast-map {
        height: 500px;
    }

    .forecast-map-spain {
        height: 540px;
    }

    .weather-marker {
        width: 76px;
    }

    .weather-marker.weather-marker-spain {
        width: 66px;
    }

    .forecast-islands-grid {
        grid-template-columns: 1fr;
    }

    .forecast-source {
        padding: 17px;
    }
}

@media (max-width: 420px) {
    .forecast-hero h1 {
        max-width: 260px;
    }

    .forecast-map {
        height: 470px;
    }

    .forecast-map-spain {
        height: 510px;
    }

    .forecast-island-card {
        padding: 10px;
    }

    .forecast-island-icon {
        font-size: 1.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .forecast-model-dot,
    .forecast-spinner {
        animation: none;
    }

    .forecast-day-card {
        transition: none;
    }
}


/* Fondo cartográfico oscuro sin clave API */
#madrid-map .leaflet-tile-pane,
#espana-map .leaflet-tile-pane {
    filter:
        invert(100%)
        hue-rotate(180deg)
        brightness(72%)
        contrast(92%)
        saturate(65%);
}


/* Menú visible sobre el fondo claro de Previsión */
.forecast-page .mv-nav {
    position: sticky;
    top: 8px;
    z-index: 1200;
    padding: 10px 12px;
    border: 1px solid rgba(78, 166, 214, 0.28);
    border-radius: 14px;
    background:
        linear-gradient(145deg, #10283b, #091b2a);
    box-shadow:
        0 10px 28px rgba(5, 20, 32, 0.22);
}

.forecast-page .mv-nav a {
    color: #c7d8e5;
}

.forecast-page .mv-nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.forecast-page .mv-nav a.active {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.65);
}

@media (max-width: 700px) {
    .forecast-page .mv-nav {
        top: 4px;
        border-radius: 12px;
    }
}


/* PREVISION_HORARIA_INICIO */
.forecast-hourly {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.13), transparent 38%),
        linear-gradient(145deg, rgba(8, 27, 45, 0.96), rgba(10, 35, 57, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.forecast-hourly-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.forecast-hourly-header h3 {
    margin: 5px 0 4px;
    color: #f8fafc;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.forecast-hourly-header p {
    margin: 0;
    color: #9fb6c9;
}

.forecast-hourly-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.forecast-hourly-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, 0.17);
    border-radius: 999px;
    background: rgba(5, 20, 34, 0.6);
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 700;
}

.forecast-hourly-legend span::before {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    content: "";
}

.legend-temp::before { background: #fb7185; }
.legend-prob::before { background: #38bdf8; }
.legend-rain::before { background: #2563eb; }
.legend-snow::before {
    background: #eefaff;
    box-shadow: 0 0 7px rgba(224, 247, 255, 0.85);
}

.forecast-chart-wrap {
    position: relative;
    width: 100%;
    height: 370px;
    margin-top: 22px;
}

.forecast-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.forecast-hourly-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(115px, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.forecast-hourly-stat {
    padding: 13px 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(4, 18, 31, 0.68);
}

.forecast-hourly-stat span {
    display: block;
    margin-bottom: 5px;
    color: #91a9bd;
    font-size: 0.75rem;
}

.forecast-hourly-stat strong {
    color: #f8fafc;
    font-size: 1rem;
}

.forecast-hourly-stat.is-snow strong {
    color: #dff7ff;
}

.forecast-day-metric.has-snow {
    border-color: rgba(186, 230, 253, 0.26);
    background: rgba(186, 230, 253, 0.08);
}

@media (max-width: 760px) {
    .forecast-hourly {
        padding: 18px 12px;
        border-radius: 18px;
    }

    .forecast-hourly-header {
        display: block;
    }

    .forecast-hourly-legend {
        justify-content: flex-start;
        margin-top: 14px;
    }

    .forecast-chart-wrap {
        height: 330px;
    }

    .forecast-hourly-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* PREVISION_HORARIA_FIN */



/* TITULO_PREVISION_7_DIAS */
.forecast-week-heading {
    margin: 30px 0 16px;
    padding-top: 22px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.forecast-week-heading h3 {
    margin: 5px 0 0;
    color: #f8fafc;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}


/* AVISOS_AEMET_MAPA_INICIO */
.aemet-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.62);
}

.aemet-status-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    font-size: 1.05rem;
    font-weight: 900;
    background: rgba(148, 163, 184, 0.18);
}

.aemet-status > div:not(.aemet-legend) {
    min-width: 0;
}

.aemet-status strong,
.aemet-status span {
    display: block;
}

.aemet-status > div > span {
    margin-top: 3px;
    color: #a9bdd0;
    font-size: 0.84rem;
    line-height: 1.35;
}

.aemet-status-ok {
    border-color: rgba(16, 185, 129, 0.38);
    background: linear-gradient(
        135deg,
        rgba(6, 78, 59, 0.46),
        rgba(15, 23, 42, 0.72)
    );
}

.aemet-status-ok .aemet-status-icon {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.18);
}

.aemet-status-amarillo {
    border-color: rgba(250, 204, 21, 0.65);
    background: rgba(113, 63, 18, 0.38);
}

.aemet-status-naranja {
    border-color: rgba(249, 115, 22, 0.72);
    background: rgba(124, 45, 18, 0.42);
}

.aemet-status-rojo {
    border-color: rgba(239, 68, 68, 0.75);
    background: rgba(127, 29, 29, 0.45);
}

.aemet-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-left: auto;
    font-size: 0.76rem;
    color: #dbeafe;
}

.aemet-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.aemet-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.aemet-dot.amarillo {
    background: #facc15;
}

.aemet-dot.naranja {
    background: #f97316;
}

.aemet-dot.rojo {
    background: #ef4444;
}

.aemet-popup {
    color: #d9edf8;
    line-height: 1.45;
}

.aemet-popup h3 {
    margin: 8px 0;
    color: #ffffff;
    font-size: 1rem;
}

.aemet-popup p {
    margin: 7px 0;
    color: #c8deea;
}

.aemet-popup p strong {
    color: #ffffff;
}

.aemet-popup small {
    display: block;
    margin-top: 9px;
    color: #91afc1;
}

.aemet-popup-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    color: #111827;
    font-size: 0.72rem;
    font-weight: 900;
}

.aemet-level-amarillo {
    background: #facc15;
}

.aemet-level-naranja {
    color: white;
    background: #f97316;
}

.aemet-level-rojo {
    color: white;
    background: #ef4444;
}

@media (max-width: 700px) {
    .aemet-status {
        align-items: flex-start;
    }

    .aemet-legend {
        width: 100%;
        margin: 8px 0 0 46px;
    }

    .aemet-status-warning {
        flex-wrap: wrap;
    }
}
/* AVISOS_AEMET_MAPA_FIN */


/* MEJORA_VISUAL_MAPAS_INICIO */
.weather-marker {
    box-sizing: border-box;
    width: 88px;
    overflow: visible;
    --marker-accent: #7dd3fc;
}

.weather-marker::before {
    content: "";
    position: absolute;
    top: 0;
    right: 13px;
    left: 13px;
    height: 3px;
    border-radius: 0 0 6px 6px;
    background: var(--marker-accent);
    box-shadow: 0 0 12px var(--marker-accent);
}

.weather-marker.weather-clear {
    --marker-accent: #fbbf24;
    border-color: rgba(251, 191, 36, 0.62);
}

.weather-marker.weather-partly {
    --marker-accent: #7dd3fc;
    border-color: rgba(125, 211, 252, 0.60);
}

.weather-marker.weather-cloudy {
    --marker-accent: #cbd5e1;
    border-color: rgba(203, 213, 225, 0.52);
}

.weather-marker.weather-rain {
    --marker-accent: #38bdf8;
    border-color: rgba(56, 189, 248, 0.68);
}

.weather-marker.weather-snow {
    --marker-accent: #e0f2fe;
    border-color: rgba(224, 242, 254, 0.78);
}

.weather-marker.weather-fog {
    --marker-accent: #94a3b8;
    border-color: rgba(148, 163, 184, 0.62);
}

.weather-marker.weather-storm {
    --marker-accent: #c084fc;
    border-color: rgba(192, 132, 252, 0.72);
}

.weather-marker.weather-marker-spain {
    box-sizing: border-box;
    width: 66px;
    padding: 4px 3px 5px;
}

.weather-marker-spain .weather-marker-icon {
    height: 23px;
    font-size: 1.28rem;
    line-height: 23px;
}

.weather-marker-spain .weather-marker-name {
    margin-top: 1px;
    font-size: 0.56rem;
}

.weather-marker-spain .weather-marker-temps {
    gap: 4px;
    margin-top: 2px;
    font-size: 0.62rem;
}

.forecast-map-spain {
    height: 590px;
}

#madrid-map .leaflet-tile-pane,
#espana-map .leaflet-tile-pane {
    filter:
        invert(100%)
        hue-rotate(180deg)
        brightness(82%)
        contrast(94%)
        saturate(58%);
}

@media (max-width: 760px) {
    .forecast-map-spain {
        height: 420px;
    }

    .weather-marker.weather-marker-spain {
        width: 56px;
        padding: 3px 2px 4px;
        border-radius: 9px;
    }

    .weather-marker-spain .weather-marker-icon {
        height: 20px;
        font-size: 1.1rem;
        line-height: 20px;
    }

    .weather-marker-spain .weather-marker-name {
        font-size: 0.49rem;
    }

    .weather-marker-spain .weather-marker-temps {
        font-size: 0.55rem;
    }
}

@media (max-width: 420px) {
    .forecast-map-spain {
        height: 390px;
    }
}
/* MEJORA_VISUAL_MAPAS_FIN */

/* RESUMEN_SEMANAL_INICIO */
.forecast-week-summary {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 17px;
    align-items: center;
    margin: 24px 0 28px;
    padding: 20px 22px;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 17px;
    background:
        linear-gradient(135deg,
            rgba(14, 116, 144, 0.18),
            rgba(15, 41, 62, 0.72));
    box-shadow:
        inset 0 1px rgba(255, 255, 255, 0.05),
        0 12px 30px rgba(0, 0, 0, 0.15);
}

.forecast-week-summary::after {
    content: "";
    position: absolute;
    top: -55px;
    right: -35px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.10);
    filter: blur(5px);
    pointer-events: none;
}

.forecast-week-summary-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-radius: 15px;
    background: rgba(3, 18, 30, 0.55);
    font-size: 1.75rem;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
}

.forecast-week-summary p {
    max-width: 920px;
    margin: 7px 0 0;
    color: #d3eaf6;
    font-size: 0.91rem;
    line-height: 1.6;
}

.forecast-week-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.forecast-summary-pill {
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    color: #d9edf8;
    background: rgba(3, 18, 30, 0.48);
    font-size: 0.72rem;
    font-weight: 800;
}

.forecast-summary-pill.is-rain {
    color: #bae6fd;
    border-color: rgba(56, 189, 248, 0.28);
}

.forecast-summary-pill.is-snow {
    color: #e0f2fe;
    border-color: rgba(186, 230, 253, 0.34);
}

.forecast-summary-pill.is-wind {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.27);
}

@media (max-width: 600px) {
    .forecast-week-summary {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .forecast-week-summary-icon {
        width: 48px;
        height: 48px;
    }
}

/* RESUMEN_SEMANAL_IMPACTOS_CSS_INICIO */
.forecast-week-summary-headline {
    display: block;
    margin: 4px 0 7px;
    color: #ffffff;
    font-size: clamp(1.02rem, 2vw, 1.22rem);
    font-weight: 900;
    line-height: 1.25;
}

.forecast-week-summary.is-impact {
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow:
        inset 4px 0 #38bdf8,
        inset 0 1px rgba(255, 255, 255, 0.06),
        0 16px 34px rgba(0, 0, 0, 0.20);
}

.forecast-week-summary.is-impact
.forecast-week-summary-icon {
    border-color: rgba(56, 189, 248, 0.40);
    background: rgba(14, 116, 144, 0.20);
}

.forecast-summary-pill.is-peak {
    color: #fef3c7;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(146, 64, 14, 0.12);
}

@media (max-width: 600px) {
    .forecast-week-summary-headline {
        font-size: 1.02rem;
    }
}
/* RESUMEN_SEMANAL_IMPACTOS_CSS_FIN */

/* RESUMEN_SEMANAL_FIN */

/* DETALLE_DIARIO_INICIO */
.forecast-day-card {
    cursor: pointer;
}

.forecast-day-card.is-selected {
    border-color: rgba(56, 189, 248, 0.78);
    box-shadow:
        0 0 0 2px rgba(56, 189, 248, 0.15),
        0 18px 38px rgba(0, 0, 0, 0.28);
    transform: translateY(-4px);
}

.forecast-day-detail {
    margin-top: 22px;
    padding: 22px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 18px;
    background:
        linear-gradient(135deg,
            rgba(12, 45, 68, 0.92),
            rgba(5, 24, 39, 0.96));
    box-shadow:
        inset 0 1px rgba(255, 255, 255, 0.05),
        0 15px 34px rgba(0, 0, 0, 0.18);
}

.forecast-day-detail[hidden] {
    display: none;
}

.forecast-detail-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 17px;
    align-items: center;
    margin-bottom: 18px;
}

.forecast-detail-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 17px;
    background: rgba(3, 18, 30, 0.54);
    font-size: 2.35rem;
}

.forecast-detail-title h3 {
    margin: 4px 0 2px;
    color: #ffffff;
    font-size: 1.25rem;
    text-transform: capitalize;
}

.forecast-detail-condition {
    color: #9ec4da;
    font-size: 0.82rem;
}

.forecast-detail-temps {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 1.7rem;
    font-weight: 900;
}

.forecast-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.forecast-detail-stat {
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 11px;
    color: #8eafc3;
    background: rgba(3, 18, 30, 0.45);
    font-size: 0.72rem;
}

.forecast-detail-stat strong {
    display: block;
    margin-top: 4px;
    color: #edf8ff;
    font-size: 0.88rem;
}

.forecast-detail-stat.has-snow {
    border-color: rgba(186, 230, 253, 0.35);
    background: rgba(14, 116, 144, 0.15);
}

.forecast-detail-uv {
    transition:
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.forecast-detail-uv.uv-bajo {
    border-color: rgba(74, 222, 128, 0.30);
    background: rgba(34, 197, 94, 0.10);
}

.forecast-detail-uv.uv-bajo strong {
    color: #86efac;
}

.forecast-detail-uv.uv-moderado {
    border-color: rgba(250, 204, 21, 0.34);
    background: rgba(234, 179, 8, 0.11);
}

.forecast-detail-uv.uv-moderado strong {
    color: #fde047;
}

.forecast-detail-uv.uv-alto {
    border-color: rgba(251, 146, 60, 0.48);
    background: rgba(249, 115, 22, 0.14);
    box-shadow: inset 3px 0 #fb923c;
}

.forecast-detail-uv.uv-alto strong {
    color: #fdba74;
}

.forecast-detail-uv.uv-muy-alto {
    border-color: rgba(248, 113, 113, 0.52);
    background: rgba(220, 38, 38, 0.15);
    box-shadow: inset 3px 0 #ef4444;
}

.forecast-detail-uv.uv-muy-alto strong {
    color: #fca5a5;
}

.forecast-detail-uv.uv-extremo {
    border-color: rgba(216, 180, 254, 0.55);
    background: rgba(126, 34, 206, 0.17);
    box-shadow: inset 3px 0 #c084fc;
}

.forecast-detail-uv.uv-extremo strong {
    color: #e9d5ff;
}

@media (max-width: 760px) {
    .forecast-day-detail {
        padding: 17px;
    }

    .forecast-detail-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .forecast-detail-temps {
        grid-column: 1 / -1;
    }

    .forecast-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* GRAFICA_LLUVIA_DIA_CSS_INICIO */
.forecast-detail-rain {
    margin-top: 19px;
    padding-top: 18px;
    border-top: 1px solid rgba(125, 211, 252, 0.15);
}

.forecast-detail-rain-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.forecast-detail-rain-header h4 {
    margin: 4px 0 0;
    color: #ffffff;
    font-size: 1rem;
}

.forecast-detail-rain-legend {
    display: flex;
    gap: 13px;
    color: #9db9ca;
    font-size: 0.68rem;
}

.forecast-detail-rain-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.forecast-detail-rain-legend i {
    width: 9px;
    height: 9px;
    border-radius: 3px;
}

.forecast-detail-rain-legend i.is-rain {
    background: #38bdf8;
}

.forecast-detail-rain-legend i.is-probability {
    border-radius: 50%;
    background: #67e8f9;
    box-shadow: 0 0 7px rgba(103, 232, 249, 0.38);
}

.forecast-detail-rain-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(56, 189, 248, 0.20);
    border-radius: 10px;
    background: rgba(14, 116, 144, 0.11);
}

.forecast-detail-rain-summary strong {
    color: #e0f2fe;
    font-size: 0.76rem;
}

.forecast-detail-rain-summary span {
    color: #93c5dd;
    font-size: 0.68rem;
    text-align: right;
}

.forecast-detail-rain-summary.is-dry {
    border-color: rgba(74, 222, 128, 0.20);
    background: rgba(34, 197, 94, 0.08);
}

.forecast-detail-rain-summary.is-dry strong {
    color: #bbf7d0;
}

.forecast-detail-rain-summary.is-empty {
    flex-direction: column;
    align-items: flex-start;
}

.forecast-detail-rain-summary.is-empty span {
    text-align: left;
}

.forecast-detail-rain-chart-wrap {
    position: relative;
    height: 275px;
    padding: 10px 8px 3px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-radius: 12px;
    background: rgba(3, 18, 30, 0.38);
}

.forecast-detail-rain-chart-wrap[hidden] {
    display: none;
}

@media (max-width: 760px) {
    .forecast-detail-rain-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .forecast-detail-rain-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .forecast-detail-rain-summary span {
        text-align: left;
    }

    .forecast-detail-rain-chart-wrap {
        height: 250px;
        margin: 0 -4px;
        padding: 8px 3px 2px;
    }
}


/* AVISOS_AEMET_GRAFICA_DIA_CSS_INICIO */
.forecast-detail-aemet-hours {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
    padding: 9px 11px;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: 9px;
}

.forecast-detail-aemet-hours[hidden] {
    display: none;
}

.forecast-detail-aemet-hours strong {
    flex: 0 0 auto;
    color: #ffffff;
    font-size: 0.72rem;
}

.forecast-detail-aemet-hours span {
    color: #dbeafe;
    font-size: 0.66rem;
    line-height: 1.4;
    text-align: right;
}

.forecast-detail-aemet-hours.is-amarillo {
    border-color: rgba(250, 204, 21, 0.50);
    background: rgba(161, 98, 7, 0.17);
}

.forecast-detail-aemet-hours.is-amarillo strong {
    color: #fde047;
}

.forecast-detail-aemet-hours.is-naranja {
    border-color: rgba(249, 115, 22, 0.58);
    background: rgba(154, 52, 18, 0.19);
}

.forecast-detail-aemet-hours.is-naranja strong {
    color: #fdba74;
}

.forecast-detail-aemet-hours.is-rojo {
    border-color: rgba(239, 68, 68, 0.64);
    background: rgba(153, 27, 27, 0.21);
}

.forecast-detail-aemet-hours.is-rojo strong {
    color: #fca5a5;
}

@media (max-width: 760px) {
    .forecast-detail-aemet-hours {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .forecast-detail-aemet-hours span {
        text-align: left;
    }
}
/* AVISOS_AEMET_GRAFICA_DIA_CSS_FIN */

/* GRAFICA_LLUVIA_DIA_CSS_FIN */

/* DETALLE_DIARIO_FIN */

/* FRANJAS_DIARIAS_CSS_INICIO */
.forecast-periods {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(125, 211, 252, 0.14);
}

.forecast-periods-title {
    margin-bottom: 12px;
}

.forecast-periods-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.forecast-period-card {
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 13px;
    background:
        linear-gradient(145deg,
            rgba(15, 48, 70, 0.72),
            rgba(3, 18, 30, 0.70));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.forecast-period-heading {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.11);
}

.forecast-period-heading strong {
    color: #ffffff;
    font-size: 0.82rem;
}

.forecast-period-heading span {
    color: #789bad;
    font-size: 0.66rem;
}

.forecast-period-weather {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 61px;
    padding: 9px 0;
}

.forecast-period-icon {
    font-size: 1.9rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.30));
}

.forecast-period-condition {
    color: #cfe9f6;
    font-size: 0.72rem;
    font-weight: 800;
}

.forecast-period-temperature {
    margin-top: 3px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
}

.forecast-period-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #91b5c8;
    font-size: 0.67rem;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .forecast-periods-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .forecast-period-card {
        padding: 11px;
    }

    .forecast-period-weather {
        gap: 7px;
    }

    .forecast-period-icon {
        font-size: 1.55rem;
    }
}
/* FRANJAS_DIARIAS_CSS_FIN */

/* VARIABLES_MAPA_INICIO */
.forecast-variable-controls {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin: 0 0 15px;
    padding: 5px;
    border: 1px solid rgba(125, 211, 252, 0.13);
    border-radius: 13px;
    background: rgba(3, 18, 30, 0.48);
}

.forecast-variable-button {
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #91adbf;
    background: transparent;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 850;
    cursor: pointer;
    transition:
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease,
        transform 150ms ease;
}

.forecast-variable-button:hover {
    color: #ffffff;
    background: rgba(125, 211, 252, 0.08);
}

.forecast-variable-button.active {
    color: #04121e;
    border-color: rgba(186, 230, 253, 0.38);
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    box-shadow: 0 6px 15px rgba(14, 165, 233, 0.20);
}

.forecast-variable-button[data-layer="lluvia"].active {
    color: #e8f8ff;
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
}

.forecast-variable-button[data-layer="viento"].active {
    color: #2a1800;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
}

.weather-marker.weather-marker-rain {
    border-color: rgba(56, 189, 248, 0.72);
    background: rgba(3, 48, 76, 0.93);
}

.weather-marker.weather-marker-rain::after {
    border-color: rgba(56, 189, 248, 0.72);
    background: rgba(3, 48, 76, 0.96);
}

.weather-marker.weather-marker-wind {
    border-color: rgba(251, 191, 36, 0.72);
    background: rgba(55, 38, 8, 0.93);
}

.weather-marker.weather-marker-wind::after {
    border-color: rgba(251, 191, 36, 0.72);
    background: rgba(55, 38, 8, 0.96);
}

.weather-marker-primary {
    display: block;
    margin-top: 3px;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 950;
    line-height: 1.1;
}

.weather-marker-secondary {
    display: block;
    margin-top: 2px;
    color: #b9d9e9;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1.1;
}

.weather-marker-wind .weather-marker-secondary {
    color: #fde68a;
}

@media (max-width: 560px) {
    .forecast-variable-controls {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .forecast-variable-button {
        padding: 8px 4px;
        font-size: 0.66rem;
    }
}
/* VARIABLES_MAPA_FIN */

/* BANNER_AEMET_INICIO */
.forecast-aemet-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin: 0 0 24px;
    padding: 17px 19px;
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-radius: 16px;
    background:
        linear-gradient(135deg,
            rgba(14, 116, 144, 0.16),
            rgba(5, 24, 39, 0.92));
    box-shadow:
        inset 0 1px rgba(255, 255, 255, 0.05),
        0 12px 28px rgba(0, 0, 0, 0.15);
}

.forecast-aemet-banner-icon {
    display: grid;
    place-items: center;
    width: 47px;
    height: 47px;
    border-radius: 13px;
    background: rgba(3, 18, 30, 0.48);
    font-size: 1.55rem;
}

.forecast-aemet-banner-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.forecast-aemet-banner-content strong {
    color: #ffffff;
    font-size: 0.94rem;
}

.forecast-aemet-banner-content > span:last-child {
    color: #9db9ca;
    font-size: 0.75rem;
    line-height: 1.4;
}

.forecast-aemet-banner.is-green {
    border-color: rgba(74, 222, 128, 0.35);
    background:
        linear-gradient(135deg,
            rgba(22, 101, 52, 0.20),
            rgba(5, 24, 39, 0.94));
}

.forecast-aemet-banner.is-yellow {
    border-color: rgba(250, 204, 21, 0.65);
    background:
        linear-gradient(135deg,
            rgba(161, 98, 7, 0.30),
            rgba(45, 31, 4, 0.95));
}

.forecast-aemet-banner.is-orange {
    border-color: rgba(251, 146, 60, 0.72);
    background:
        linear-gradient(135deg,
            rgba(154, 52, 18, 0.34),
            rgba(48, 24, 6, 0.96));
}

.forecast-aemet-banner.is-red {
    border-color: rgba(248, 113, 113, 0.75);
    background:
        linear-gradient(135deg,
            rgba(153, 27, 27, 0.40),
            rgba(50, 10, 15, 0.96));
    box-shadow:
        0 0 0 2px rgba(248, 113, 113, 0.08),
        0 14px 32px rgba(0, 0, 0, 0.22);
}

.forecast-aemet-banner-button {
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 850;
    cursor: pointer;
}

.forecast-aemet-banner-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.forecast-aemet-banner-button[hidden] {
    display: none;
}

@media (max-width: 650px) {
    .forecast-aemet-banner {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 15px;
    }

    .forecast-aemet-banner-button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* BANNER_AEMET_NIVELES_ES_INICIO */
.forecast-aemet-banner.is-amarillo {
    border-color: rgba(250, 204, 21, 0.90);
    border-left: 6px solid #facc15;
    background:
        linear-gradient(135deg,
            rgba(161, 98, 7, 0.72),
            rgba(45, 31, 4, 0.97));
    box-shadow:
        0 0 0 2px rgba(250, 204, 21, 0.10),
        0 14px 30px rgba(0, 0, 0, 0.22);
}

.forecast-aemet-banner.is-naranja {
    border-color: rgba(251, 146, 60, 0.92);
    border-left: 6px solid #f97316;
    background:
        linear-gradient(135deg,
            rgba(154, 52, 18, 0.76),
            rgba(48, 24, 6, 0.97));
    box-shadow:
        0 0 0 2px rgba(249, 115, 22, 0.11),
        0 14px 30px rgba(0, 0, 0, 0.24);
}

.forecast-aemet-banner.is-rojo {
    border-color: rgba(248, 113, 113, 0.94);
    border-left: 6px solid #ef4444;
    background:
        linear-gradient(135deg,
            rgba(153, 27, 27, 0.82),
            rgba(50, 10, 15, 0.98));
    box-shadow:
        0 0 0 2px rgba(239, 68, 68, 0.13),
        0 14px 32px rgba(0, 0, 0, 0.26);
}

.forecast-aemet-banner.is-amarillo .forecast-aemet-banner-icon,
.forecast-aemet-banner.is-naranja .forecast-aemet-banner-icon,
.forecast-aemet-banner.is-rojo .forecast-aemet-banner-icon {
    border: 1px solid currentColor;
    background: rgba(3, 18, 30, 0.38);
}

.forecast-aemet-banner.is-amarillo .forecast-aemet-banner-icon,
.forecast-aemet-banner.is-amarillo .forecast-overline {
    color: #fde047;
}

.forecast-aemet-banner.is-naranja .forecast-aemet-banner-icon,
.forecast-aemet-banner.is-naranja .forecast-overline {
    color: #fb923c;
}

.forecast-aemet-banner.is-rojo .forecast-aemet-banner-icon,
.forecast-aemet-banner.is-rojo .forecast-overline {
    color: #fca5a5;
}

.forecast-aemet-banner.is-amarillo
.forecast-aemet-banner-content > span:last-child {
    color: #fef3c7;
}

.forecast-aemet-banner.is-naranja
.forecast-aemet-banner-content > span:last-child {
    color: #ffedd5;
}

.forecast-aemet-banner.is-rojo
.forecast-aemet-banner-content > span:last-child {
    color: #fee2e2;
}
/* BANNER_AEMET_NIVELES_ES_FIN */

/* BANNER_AEMET_FIN */

/* BANNER_AEMET_VERDE_INICIO */
.forecast-aemet-banner.is-green {
    border-color: rgba(74, 222, 128, 0.75);
    background:
        linear-gradient(135deg,
            rgba(20, 83, 45, 0.96),
            rgba(5, 46, 22, 0.97));
    box-shadow:
        0 0 0 2px rgba(34, 197, 94, 0.08),
        0 14px 30px rgba(0, 0, 0, 0.18);
}

.forecast-aemet-banner.is-green
.forecast-aemet-banner-icon {
    color: #dcfce7;
    border: 1px solid rgba(134, 239, 172, 0.42);
    background: rgba(34, 197, 94, 0.20);
}

.forecast-aemet-banner.is-green .forecast-overline {
    color: #86efac;
}

.forecast-aemet-banner.is-green
.forecast-aemet-banner-content > span:last-child {
    color: #bbf7d0;
}
/* BANNER_AEMET_VERDE_FIN */

/* ESTADO_ACTUALIZACION_CSS_INICIO */
.forecast-updated {
    position: relative;
    padding: 8px 11px 8px 29px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: rgba(3, 18, 30, 0.42);
    font-size: 0.73rem;
    font-weight: 800;
    transition:
        color 180ms ease,
        border-color 180ms ease,
        background 180ms ease;
}

.forecast-updated::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 11px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    transform: translateY(-50%);
}

.forecast-updated.is-fresh {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.32);
    background: rgba(22, 101, 52, 0.18);
}

.forecast-updated.is-fresh::before {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.forecast-updated.is-delayed {
    color: #fde68a;
    border-color: rgba(250, 204, 21, 0.38);
    background: rgba(161, 98, 7, 0.17);
}

.forecast-updated.is-delayed::before {
    background: #facc15;
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.11);
}

.forecast-updated.is-stale {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.42);
    background: rgba(153, 27, 27, 0.19);
}

.forecast-updated.is-stale::before {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}
/* ESTADO_ACTUALIZACION_CSS_FIN */

/* RANGO_TERMICO_INICIO */
.forecast-temp-range {
    position: relative;
    width: 100%;
    height: 7px;
    margin: 10px 0 16px;
    overflow: visible;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

.forecast-temp-range-fill {
    position: absolute;
    top: 0;
    height: 7px;
    min-width: 7px;
    border-radius: 999px;
    background:
        linear-gradient(90deg,
            #38bdf8 0%,
            #a78bfa 48%,
            #fb7185 100%);
    box-shadow:
        0 0 8px rgba(56, 189, 248, 0.20),
        0 0 8px rgba(251, 113, 133, 0.16);
}

.forecast-temp-range-fill::before,
.forecast-temp-range-fill::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 7px;
    height: 7px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 50%;
    transform: translateY(-50%);
}

.forecast-temp-range-fill::before {
    left: 0;
    background: #38bdf8;
}

.forecast-temp-range-fill::after {
    right: 0;
    background: #fb7185;
}

.forecast-day-card.is-selected
.forecast-temp-range-fill {
    box-shadow:
        0 0 10px rgba(56, 189, 248, 0.42),
        0 0 10px rgba(251, 113, 133, 0.30);
}
/* RANGO_TERMICO_FIN */

/* COMPARTIR_PREVISION_INICIO */
.forecast-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 13px;
    padding: 8px 13px;
    border: 1px solid rgba(125, 211, 252, 0.34);
    border-radius: 9px;
    color: #dff6ff;
    background: rgba(14, 116, 144, 0.18);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 850;
    cursor: pointer;
    transition:
        transform 150ms ease,
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease;
}

.forecast-share-button:hover {
    color: #ffffff;
    border-color: rgba(125, 211, 252, 0.62);
    background: rgba(14, 165, 233, 0.27);
    transform: translateY(-1px);
}

.forecast-share-button.is-copied {
    color: #dcfce7;
    border-color: rgba(74, 222, 128, 0.48);
    background: rgba(22, 163, 74, 0.22);
}

@media (max-width: 500px) {
    .forecast-share-button {
        width: 100%;
    }
}
/* COMPARTIR_PREVISION_FIN */

/* VERIFICACION_ECMWF_INICIO */
.forecast-verification {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid rgba(167, 139, 250, 0.24);
    border-radius: 17px;
    background:
        linear-gradient(135deg,
            rgba(76, 29, 149, 0.13),
            rgba(5, 24, 39, 0.91));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.forecast-verification-header {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 15px;
}

.forecast-verification-icon {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    flex: 0 0 auto;
    border: 1px solid rgba(167, 139, 250, 0.24);
    border-radius: 12px;
    background: rgba(76, 29, 149, 0.16);
    font-size: 1.45rem;
}

.forecast-verification h3 {
    margin: 3px 0 0;
    color: #ffffff;
    font-size: 1rem;
}

.forecast-verification-content {
    color: #a9c2d1;
    font-size: 0.79rem;
    line-height: 1.5;
}

.forecast-verification.is-waiting
.forecast-verification-content {
    padding: 13px 15px;
    border: 1px dashed rgba(167, 139, 250, 0.24);
    border-radius: 11px;
    background: rgba(3, 18, 30, 0.34);
}

.forecast-verification-date {
    margin-bottom: 12px;
    color: #c4b5fd;
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: capitalize;
}

.forecast-verification-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.forecast-verification-card {
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 12px;
    background: rgba(3, 18, 30, 0.48);
}

.forecast-verification-card > strong {
    display: block;
    margin-bottom: 10px;
    color: #eff8ff;
    font-size: 0.78rem;
}

.forecast-verification-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.forecast-verification-value {
    min-width: 0;
}

.forecast-verification-value span {
    display: block;
    margin-bottom: 3px;
    color: #7898aa;
    font-size: 0.56rem;
    text-transform: uppercase;
}

.forecast-verification-value b {
    display: block;
    overflow: hidden;
    color: #e6f2f8;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forecast-verification-value.error b {
    color: #fde68a;
}

.forecast-verification-value.error.is-good b {
    color: #86efac;
}

.forecast-verification-value.error.is-poor b {
    color: #fca5a5;
}

.forecast-verification-note {
    margin-top: 11px;
    color: #7693a5;
    font-size: 0.66rem;
}

@media (max-width: 850px) {
    .forecast-verification-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 450px) {
    .forecast-verification {
        padding: 16px;
    }

    .forecast-verification-grid {
        grid-template-columns: 1fr;
    }
}
/* VERIFICACION_ECMWF_FIN */

/* RESUMEN_REGIONAL_MADRID_CSS_INICIO */
.forecast-regional-summary {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 15px;
    background:
        linear-gradient(145deg,
            rgba(10, 38, 57, 0.78),
            rgba(3, 18, 30, 0.72));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.forecast-regional-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
}

.forecast-regional-heading span {
    color: #38bdf8;
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.forecast-regional-heading strong {
    color: #eaf7ff;
    font-size: 0.78rem;
}

.forecast-regional-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.forecast-regional-card {
    --regional-accent: #7dd3fc;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    padding: 11px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 12px;
    background: rgba(3, 18, 30, 0.48);
}

.forecast-regional-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--regional-accent);
    box-shadow: 0 0 10px var(--regional-accent);
}

.forecast-regional-card.is-warm {
    --regional-accent: #fb7185;
}

.forecast-regional-card.is-cold {
    --regional-accent: #60a5fa;
}

.forecast-regional-card.is-rain {
    --regional-accent: #38bdf8;
}

.forecast-regional-card.is-wind {
    --regional-accent: #c084fc;
}

.forecast-regional-icon {
    font-size: 1.35rem;
}

.forecast-regional-card div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.forecast-regional-card div > span {
    color: #8eacbd;
    font-size: 0.64rem;
}

.forecast-regional-card strong {
    margin-top: 2px;
    color: #ffffff;
    font-size: 0.92rem;
}

.forecast-regional-card small {
    margin-top: 2px;
    overflow: hidden;
    color: #9fc1d4;
    font-size: 0.65rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .forecast-regional-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* RESUMEN_REGIONAL_INTERACTIVO_INICIO */
.forecast-regional-card {
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.forecast-regional-card:hover {
    border-color: var(--regional-accent);
    background: rgba(12, 43, 63, 0.78);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.20);
    transform: translateY(-2px);
}

.forecast-regional-card:focus-visible {
    outline: 2px solid var(--regional-accent);
    outline-offset: 2px;
}

.forecast-regional-heading > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.forecast-map-reset {
    padding: 7px 10px;
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 8px;
    color: #dff6ff;
    background: rgba(14, 116, 144, 0.15);
    font: inherit;
    font-size: 0.67rem;
    font-weight: 850;
    cursor: pointer;
}

.forecast-map-reset:hover {
    border-color: rgba(125, 211, 252, 0.58);
    background: rgba(14, 165, 233, 0.24);
}

@media (max-width: 430px) {
    .forecast-map-reset {
        padding: 7px 8px;
        font-size: 0.62rem;
    }
}
/* RESUMEN_REGIONAL_INTERACTIVO_FIN */

/* RESUMEN_REGIONAL_MADRID_CSS_FIN */

