/* =========================
   HOME DAILY DASHBOARD
========================= */

.daily-dashboard {
    padding: 24px 0 14px;
}

.daily-dashboard-shell {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: clamp(22px, 4vw, 32px);
    position: relative;
}

.daily-dashboard-header {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    margin-bottom: 20px;
}

.daily-dashboard-header h2 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1;
    letter-spacing: -.03em;
}

.daily-dashboard-header p {
    margin: 8px 0 0;
    max-width: 760px;
    color: var(--muted);
    line-height: 1.6;
}

.daily-updated {
    justify-self: end;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.daily-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.daily-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.daily-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: #ffffff;
}

.daily-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.daily-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--paper-soft);
    border: 1px solid var(--line);
    font-size: 18px;
}

.daily-card strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.1;
    margin-bottom: 6px;
}

.daily-status-badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid #d7ddc7;
    color: var(--ink);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.daily-act-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 8px 0 6px;
}

.daily-tool-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 4px;
}

.daily-tool-links a {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}

.daily-tool-links a:hover {
    background: var(--accent);
    color: #fff;
}

.activity-mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    border: 1px solid var(--line);
    font-size: 11px;
    color: var(--ink);
}

.daily-value {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(24px, 2.6vw, 31px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.045em;
}

.daily-card p {
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.45;
    font-size: 13px;
}

.daily-source {
    width: fit-content;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid #d7ddc7;
    color: var(--ink);
    font-size: 11px;
    font-weight: 950;
}

.daily-link {
    margin-top: auto;
    padding-top: 14px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 950;
}

.daily-card.ok {
    border-color: rgba(63, 111, 87, .22);
    border-left-color: var(--green);
}

.daily-card.ok .daily-icon,
.daily-card.ok .daily-status-badge {
    background: #eef7f1;
    border-color: #d8eadf;
    color: var(--green);
}

.daily-card.warning {
    background: #fff8ed;
    border-color: #efd9b9;
    border-left-color: #c8912f;
}

.daily-card.warning .daily-icon,
.daily-card.warning .daily-status-badge {
    background: #fff1d8;
    border-color: #efd9b9;
    color: #8a5a19;
}

.daily-card.alert {
    background: var(--red-soft);
    border-color: rgba(143, 29, 29, .22);
    border-left-width: 6px;
    border-left-color: #8f1d1d;
    box-shadow: 0 0 0 1px rgba(143, 29, 29, .1);
}

.daily-card.alert .daily-icon {
    background: #ffe3dd;
    border-color: rgba(143, 29, 29, .22);
    color: #8f1d1d;
}

.daily-card.alert .daily-status-badge {
    background: #8f1d1d;
    border-color: #8f1d1d;
    color: #ffffff;
}

.daily-card.neutral {
    border-left-color: var(--ink);
}

.daily-card.neutral .daily-icon,
.daily-card.neutral .daily-status-badge {
    background: var(--accent-soft);
    border-color: #d7ddc7;
}

.daily-card-wide {
    grid-column: 1 / -1;
    min-height: auto;
}

/* =========================
   ANDALMET WIDGETS
========================= */

.weather-widget-section,
.weather-detail-section {
    padding: 28px 0;
}

.andalmet-widget-card {
    background:
        radial-gradient(circle at top right, rgba(69, 92, 54, .12), transparent 16rem),
        rgba(255, 255, 255, .92);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    padding: clamp(18px, 3vw, 26px);
    overflow: hidden;
}

.andalmet-home-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
}

.andalmet-widget-card h2,
.andalmet-widget-card h3 {
    margin: 10px 0 8px;
    color: var(--ink);
    letter-spacing: -.035em;
}

.andalmet-widget-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.andalmet-widget-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.andalmet-widget-frame {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.andalmet-widget-frame iframe {
    max-width: 100%;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
}

.weather-widget-layout {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: stretch;
}

.compact-widget-card {
    min-height: 100%;
}

@media (max-width: 1180px) {
    .daily-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .andalmet-home-card,
    .weather-widget-layout {
        grid-template-columns: 1fr;
    }

    .andalmet-widget-header {
        display: block;
    }
}

@media (max-width: 820px) {
    .daily-dashboard {
        padding-top: 18px;
    }

    .daily-dashboard-header {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .daily-updated {
        justify-self: start;
        white-space: normal;
    }

    .daily-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .daily-dashboard-shell {
        border-radius: 8px;
        padding: 18px;
    }

    .daily-grid {
        grid-template-columns: 1fr;
    }

    .daily-card {
        min-height: auto;
    }

    .andalmet-widget-card {
        border-radius: 8px;
    }
}

/* ==========================================
   PÁGINA DE TIEMPO SIMPLIFICADA Y PROMINENTE
   ========================================== */

.weather-page {
    padding: 16px 0 48px;
}

.weather-compact-header {
    padding: 12px 0 20px;
}

.weather-header-shell {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.weather-header-shell h1 {
    margin: 6px 0 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(26px, 4.5vw, 42px);
    line-height: 1.1;
    letter-spacing: -.03em;
}

.weather-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--paper-soft);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.weather-live-badge.is-stale {
    background: #fff8ed;
    border-color: #efd9b9;
    color: #8a5a19;
}

.weather-main-section {
    padding: 16px 0;
}

.weather-spotlight-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 3.5vw, 28px);
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.weather-spotlight-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.weather-huge-icon {
    font-size: clamp(48px, 6vw, 64px);
    line-height: 1;
}

.weather-huge-temp {
    font-family: var(--font-display);
    font-size: clamp(38px, 5.5vw, 56px);
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
}

.weather-sky-text {
    margin-top: 4px;
    font-size: 15px;
    color: var(--muted);
    font-weight: 600;
}

.weather-metrics-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--ink);
}

.metric-icon {
    font-size: 14px;
}

.andalmet-prominent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.andalmet-prominent-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(18px, 3vw, 24px);
    box-shadow: var(--shadow-soft);
}

.andalmet-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.andalmet-card-header h2 {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--ink);
}

.andalmet-prominent-frame {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-soft);
}

.andalmet-prominent-frame iframe {
    width: 100% !important;
    border: 0;
    display: block;
}

.weather-footer-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 12px;
}

/* PREVISIÓN NATIVA A 7 DÍAS AEMET */

.aemet-7days-section {
    margin-bottom: 32px;
}

.aemet-7days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.aemet-day-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.aemet-day-card.is-today {
    border-color: var(--accent);
    background: var(--paper-soft);
}

.aemet-day-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.aemet-day-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
}

.aemet-day-date {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 8px;
}

.aemet-day-icon {
    font-size: 28px;
    margin: 4px 0;
}

.aemet-day-desc {
    font-size: 12px;
    color: var(--muted);
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    margin-bottom: 8px;
}

.aemet-temp-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-bottom: 8px;

    .t-min {
        font-size: 13px;
        color: var(--muted);
        font-weight: 600;
    }

    .t-max {
        font-size: 14px;
        color: var(--ink);
        font-weight: 700;
    }

    .temp-track {
        flex: 1;
        height: 4px;
        background: #e0d8ca;
        border-radius: 999px;
        overflow: hidden;

        .temp-fill {
            height: 100%;
            background: linear-gradient(90deg, #4a7c59, #e06d53);
            border-radius: 999px;
        }
    }
}

.aemet-day-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: var(--muted);
}

@media (max-width: 768px) {
    .weather-spotlight-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .andalmet-prominent-grid {
        grid-template-columns: 1fr;
    }

    .aemet-7days-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   PÁGINA DE SEGUIMIENTO EN VIVO (ESTILO SEGUIMIENTO)
   ========================================== */

.seguimiento-page {
    padding: 16px 0 54px;
}

.seguimiento-header-section {
    padding: 12px 0 24px;
}

.seguimiento-header-shell {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.seguimiento-header-shell h1 {
    margin: 6px 0 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(28px, 4.5vw, 44px);
    line-height: 1.1;
    letter-spacing: -.03em;
}

.seguimiento-subtitle {
    margin: 10px 0 0;
    max-width: 780px;
    color: var(--muted);
    line-height: 1.6;
}

.seguimiento-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.tracking-tabs-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tab-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--ink);
    color: #ffffff;
    border-color: var(--ink);
}

.seguimiento-viewport-section {
    padding: 20px 0;
}

.tracking-pane {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 3.5vw, 30px);
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

.tracking-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tracking-pane-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(20px, 3vw, 26px);
    color: var(--ink);
}

.tracking-pane-header p {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 720px;
}

.tracking-frame-container {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-soft);
    border: 1px solid var(--line);
}

.tracking-frame-container iframe {
    width: 100%;
    display: block;
}

.tracking-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.sat-card {
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.sat-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--ink);
}

.sat-img-wrapper img {
    width: 100%;
    border-radius: var(--radius-md);
    display: block;
}

.aqi-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.aqi-stat {
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aqi-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.aqi-stat strong {
    font-size: 16px;
    color: var(--ink);
}

.aqi-stat strong.good {
    color: var(--accent);
}

.seguimiento-footer-box {
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.seguimiento-footer-box h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--ink);
}

.seguimiento-footer-box p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* ACTIVIDADES, SOL Y LUNA, Y EMBALSES */

.weather-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.weather-extra-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(18px, 3vw, 24px);
    box-shadow: var(--shadow-soft);
}

.extra-card-header h2 {
    margin: 4px 0 16px;
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--ink);
}

.activities-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
}

.activity-icon {
    font-size: 24px;
    line-height: 1;
}

.activity-title {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.activity-status {
    font-size: 15px;
    color: var(--ink);
}

.activity-detail {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.sun-moon-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sun-arc-box {
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sun-times {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--ink);
}

.daylight-badge {
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    font-size: 13px;
    color: var(--ink);
}

.moon-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.moon-icon {
    font-size: 32px;
}

.moon-title {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.embalses-section {
    margin-bottom: 28px;
}

.embalses-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(18px, 3vw, 24px);
    box-shadow: var(--shadow-soft);
}

.embalses-summary {
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--muted);
}

.embalses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.embalse-item {
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
}

.embalse-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    gap: 10px;
}

.embalse-name {
    font-weight: 700;
    color: var(--ink);
}

.embalse-val {
    color: var(--muted);
    font-size: 12px;
}

.embalse-track {
    width: 100%;
    height: 6px;
    background: #e0d8ca;
    border-radius: 999px;
    overflow: hidden;
}

.embalse-fill {
    height: 100%;
    background: #4a7c59;
    border-radius: 999px;
}

/* ==========================================
   RADAR SOCIAL, MI ALHAURÍN Y BANNER GOOGLE
   ========================================== */

.radar-social-page,
.mi-alhaurin-page {
    padding: 16px 0 54px;
}

.radar-header-shell {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.radar-header-shell h1,
.mi-header-shell h1 {
    margin: 6px 0 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(28px, 4.5vw, 44px);
    line-height: 1.1;
    letter-spacing: -.03em;
}

.radar-subtitle,
.mi-subtitle {
    margin: 10px 0 0;
    max-width: 780px;
    color: var(--muted);
    line-height: 1.6;
}

.radar-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.radar-filter-btn {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.radar-filter-btn:hover {
    border-color: var(--accent);
}

.radar-filter-btn.active {
    background: var(--ink);
    color: #ffffff;
    border-color: var(--ink);
}

.radar-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
    gap: 20px;
    margin-bottom: 24px;
}

.radar-map-card {
    /* Aísla el contexto de apilamiento del mapa: Leaflet asigna z-index de
       hasta 1000 a sus controles internos, muy por encima del header fijo
       del sitio (z-index: 30) — sin esto, el mapa se pinta por encima de la
       barra de navegación al hacer scroll. */
    position: relative;
    isolation: isolate;
}

.radar-map-card,
.radar-feed-card,
.mi-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.radar-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.radar-feed-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--ink);
}

.live-badge {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--paper-soft);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.radar-feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
}

.radar-feed-item {
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
}

.radar-feed-top {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
}

.radar-feed-type {
    color: var(--accent);
}

.radar-feed-time {
    color: var(--muted);
}

.radar-feed-item h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--ink);
}

.radar-feed-item p {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--muted);
}

.radar-feed-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.radar-feed-user {
    color: var(--muted);
}

.vote-btn {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* GOOGLE STAR BANNER */

.google-star-banner {
    background: var(--ink);
    color: #ffffff;
    border-radius: 8px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: none;
}

.google-star-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.google-star-icon {
    font-size: 32px;
    line-height: 1;
}

.google-star-banner h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.google-star-banner p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    max-width: 680px;
}

.btn-google {
    background: #f59e0b;
    color: var(--ink);
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap;
    border: 0;
    box-shadow: none;
    font-size: 13px;
}

.btn-google:hover {
    background: #fbbf24;
}

/* MODAL OVERLAY */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.open {
    display: flex !important;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
}

.modal-close {
    background: none;
    border: 0;
    font-size: 28px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    font-family: var(--font-body);
    font-size: 14px;
    box-sizing: border-box;
    color: var(--ink);
    background: var(--paper);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.mi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.pref-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pref-check {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 820px) {
    .radar-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .radar-header-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .radar-header-shell .btn {
        width: 100%;
        text-align: center;
    }

    .radar-filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 10px;
    }

    .radar-filter-bar::-webkit-scrollbar {
        display: none;
    }

    .radar-filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 6px 12px;
        font-size: 12px;
    }

    #radar-map {
        height: 300px !important;
    }

    .radar-map-card,
    .radar-feed-card {
        padding: 12px;
    }

    .radar-feed-list {
        max-height: 360px;
    }

    .radar-feed-header h2 {
        font-size: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Modal: centered overlay, not bottom-sheet —
       matches desktop behavior on mobile too */
    .modal-overlay {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    .modal-card {
        padding: 20px;
        max-height: 88vh;
        border-radius: 14px;
        width: calc(100% - 32px);
        max-width: 420px;
    }

    .modal-header {
        margin-bottom: 16px;
    }

    .modal-header h2 {
        font-size: 17px;
    }

    .modal-close {
        font-size: 24px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--paper-soft, #f5f5f5);
        flex-shrink: 0;
    }

    /* Unified form fields: identical sizing for all controls */
    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 12px;
        margin-bottom: 4px;
        letter-spacing: 0.02em;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 15px;
        border-radius: 8px;
        border: 1.5px solid var(--line);
        height: auto;
        min-height: 42px;
        line-height: 1.4;
        -webkit-appearance: none;
        appearance: none;
    }

    .form-group select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 32px;
    }

    .form-group textarea {
        min-height: 72px;
        resize: vertical;
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: none;
        border-color: var(--accent, #2563eb);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

    .form-group small {
        font-size: 11px !important;
    }

    /* Footer buttons */
    .modal-footer {
        margin-top: 16px;
        gap: 8px;
    }

    .modal-footer .btn {
        flex: 1;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 42px;
    }

    /* Admin login error message */
    #admin-login-error {
        font-size: 12px !important;
    }
}

.radar-home-section {
    padding: 32px 0 16px;
}

.radar-home-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(22px, 4vw, 32px);
    box-shadow: var(--shadow-soft);
}

.radar-home-badge {
    display: inline-flex;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--paper-soft);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

.radar-home-main h2 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: clamp(24px, 3.5vw, 32px);
    color: var(--ink);
}

.radar-home-main p {
    margin: 0 0 18px;
    color: var(--muted);
    max-width: 760px;
    font-size: 16px;
    line-height: 1.6;
}

.radar-home-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================
   COMPARADOR METEOROLÓGICO Y ENTRE MUNICIPIOS
   ========================================== */

.comparador-page {
    padding: 20px 0 60px;
}

.comparador-header-shell h1 {
    margin: 6px 0 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(28px, 4.5vw, 44px);
    line-height: 1.1;
}

.comparador-subtitle {
    margin: 10px 0 20px;
    max-width: 820px;
    color: var(--muted);
    line-height: 1.6;
}

.comparador-controls-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.comparador-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.comp-tab-btn {
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: var(--paper-soft);
    border: 1px solid var(--line);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.comp-tab-btn.active {
    background: var(--ink);
    color: #ffffff;
    border-color: var(--ink);
}

.comparador-selectors {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.selector-box {
    flex: 1;
    min-width: 240px;

    label {
        display: block;
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 6px;
        color: var(--ink);
    }

    select {
        width: 100%;
        padding: 12px 16px;
        border-radius: var(--radius);
        border: 1px solid var(--line);
        font-family: var(--font-body);
        font-size: 15px;
        font-weight: 600;
        background: #ffffff;
    }
}

.vs-badge {
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
    color: var(--muted);
    margin-top: 22px;
}

.comparador-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.comp-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.comp-card-header {
    margin-bottom: 16px;

    h2 {
        margin: 6px 0 4px;
        font-family: var(--font-display);
        font-size: 22px;
    }
}

.comp-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--paper-soft);
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
}

.comp-tag.secondary {
    color: #2b5c8f;
}

.comp-weather-state {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

.comp-main-temp {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}

.comp-temp-val {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
}

.comp-hi-lo {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 2px;
    color: var(--muted);
}

.comp-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comp-metric-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);

    span {
        color: var(--muted);
    }

    strong {
        color: var(--ink);
    }
}

.comp-summary-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);

    h3 {
        margin: 0 0 16px;
        font-family: var(--font-display);
        font-size: 18px;
    }
}

.comp-diff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.diff-box {
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;

    span {
        display: block;
        font-size: 12px;
        font-weight: 700;
        color: var(--muted);
        margin-bottom: 4px;
    }

    strong {
        font-size: 14px;
        color: var(--ink);
    }
}

@media (max-width: 768px) {
    .comparador-grid {
        grid-template-columns: 1fr;
    }
}

/* 6 MODELOS METEOROLÓGICOS Y TABLA COMPARATIVA */

.consensus-banner {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;

    .consensus-status {
        display: flex;
        align-items: center;
        gap: 16px;

        h3 {
            margin: 0;
            font-family: var(--font-display);
            font-size: 20px;
            color: var(--ink);
        }

        p {
            margin: 4px 0 0;
            font-size: 14px;
            color: var(--muted);
            max-width: 620px;
        }
    }
}

.consensus-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;

    &.green {
        background: var(--accent);
        box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.2);
    }
}

.consensus-models-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.model-pill {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: var(--paper-soft);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);

    &.active {
        background: #e8f5e9;
        border-color: #a5d6a7;
        color: var(--accent-dark);
    }
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.model-card small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.comp-table-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.comp-table-sub {
    margin: 4px 0 16px;
    font-size: 14px;
    color: var(--muted);
}

.table-scroll {
    overflow-x: auto;
}

.comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;

    th, td {
        padding: 12px 14px;
        border-bottom: 1px solid var(--line);
    }

    th {
        background: var(--paper-soft);
        font-weight: 800;
        color: var(--ink);
    }

    tbody tr:hover {
        background: rgba(0, 0, 0, 0.02);
    }
}

.tag-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;

    &.green {
        background: #e8f5e9;
        color: var(--accent-dark);
    }

    &.yellow {
        background: #fff8e1;
        color: #f57f17;
    }
}

.comp-guide-box {
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;

    h3 {
        margin: 0 0 16px;
        font-family: var(--font-display);
        font-size: 20px;
    }
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.guide-item {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;

    strong {
        display: block;
        font-size: 14px;
        color: var(--ink);
        margin-bottom: 6px;
    }

    p {
        margin: 0;
        font-size: 13px;
        color: var(--muted);
        line-height: 1.5;
    }
}
