.aemet-view {
    padding-top: 15px;
    margin-bottom: 8px;
    font-family: 'Open Sans', Arial, sans-serif;
}

.aemet-toolbar-row {
    margin: 0;
}

.aemet-toolbar-col:first-child {
    padding-left: 0;
}

.aemet-toolbar-col:last-child {
    padding-right: 0;
}

.aemet-well {
    min-height: 118px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid #dce6ea;
    border-radius: 10px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 2px 8px rgba(34,67,80,0.08);
}

.aemet-well--status {
    margin-left: -15px;
}

.aemet-kicker {
    margin-bottom: 3px;
    color: #6c8792;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.aemet-main-title {
    color: #294f60;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.aemet-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.aemet-mode-btn {
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid #c9d9df;
    border-radius: 7px;
    background: #fff;
    color: #456875;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.aemet-mode-btn:hover,
.aemet-mode-btn:focus {
    border-color: #8da8b2;
    outline: none;
}

.aemet-mode-btn.activo {
    border-color: #39758c;
    background: #39758c;
    color: #fff;
}

.aemet-radar-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid rgba(220,230,234,.9);
}

.aemet-radar-tools[hidden] {
    display: none !important;
}

.aemet-tool-label {
    color: #526d78;
    font-size: 11px;
    font-weight: 700;
}

.aemet-opacity-control {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #607985;
    font-size: 10.5px;
    font-weight: 600;
}

.aemet-opacity-control input {
    width: 115px;
}

.aemet-opacity-control strong {
    min-width: 31px;
    color: #294f60;
}

.aemet-status-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.aemet-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    min-height: 25px;
    padding: 4px 9px;
    border: 1px solid #cbdce2;
    border-radius: 999px;
    background: #f7fafb;
    color: #456875 !important;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-decoration: none !important;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.aemet-source-badge:hover,
.aemet-source-badge:focus {
    border-color: #8da8b2;
    background: #eef5f7;
    color: #294f60 !important;
    text-decoration: none !important;
    outline: none;
}

.aemet-status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
    color: #607985;
    font-size: 10.5px;
}

.aemet-stale-warning {
    margin-top: 7px;
    padding: 6px 8px;
    border: 1px solid #e9c980;
    border-radius: 6px;
    background: #fff8e8;
    color: #80651e;
    font-size: 10px;
    line-height: 1.35;
}

.aemet-stale-warning[hidden] {
    display: none !important;
}

.aemet-warning-days {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #e5edf0;
}

.aemet-warning-days[hidden] {
    display: none !important;
}

.aemet-warning-days__label {
    flex: 0 0 auto;
    color: #69818b;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.aemet-warning-days__buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.aemet-warning-day-btn {
    min-height: 25px;
    padding: 4px 9px;
    border: 1px solid #ccdce2;
    border-radius: 7px;
    background: #ffffff;
    color: #506f7b;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.aemet-warning-day-btn:hover,
.aemet-warning-day-btn:focus {
    border-color: #8eabb6;
    background: #f1f6f8;
    color: #294f60;
    outline: none;
}

.aemet-warning-day-btn.activo {
    border-color: #39758c;
    background: #39758c;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(41,79,96,.14);
}

.aemet-counts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 11px;
}

.aemet-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #526d78;
    font-size: 10.5px;
}

.aemet-count i,
.aemet-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.16);
}

.aemet-count--red i,
.aemet-legend-dot.red {
    background: #d52b2b;
}

.aemet-count--orange i,
.aemet-legend-dot.orange {
    background: #ed8b20;
}

.aemet-count--yellow i,
.aemet-legend-dot.yellow {
    background: #f2cf33;
}

.aemet-count b {
    color: #294f60;
}

.aemet-map-wrap {
    position: relative;
    margin-top: 2px;
}

.aemet-radar-player {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 750;
    width: 370px;
    max-width: calc(100% - 24px);
    padding: 10px 11px 9px;
    border: 1px solid rgba(201,217,223,.96);
    border-radius: 10px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 5px 18px rgba(34,67,80,.14);
    color: #526d78;
    backdrop-filter: blur(2px);
}

.aemet-radar-player[hidden] {
    display: none !important;
}

.aemet-radar-player.is-loading {
    cursor: progress;
}

.aemet-radar-player__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.aemet-radar-player__kicker {
    margin-bottom: 1px;
    color: #6c8792;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.aemet-radar-player__time {
    color: #294f60;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
}

.aemet-radar-latest {
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid #c9d9df;
    border-radius: 999px;
    background: #fff;
    color: #607985;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.aemet-radar-latest:hover,
.aemet-radar-latest:focus {
    border-color: #8da8b2;
    outline: none;
}

.aemet-radar-latest.activo,
.aemet-radar-latest:disabled {
    border-color: #b9d0d8;
    background: #eef5f7;
    color: #39758c;
    cursor: default;
    opacity: 1;
}

.aemet-radar-player__controls {
    display: grid;
    grid-template-columns: 28px 32px 28px minmax(90px, 1fr);
    align-items: center;
    gap: 6px;
}

.aemet-radar-control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #c9d9df;
    border-radius: 7px;
    background: #fff;
    color: #456875;
    cursor: pointer;
}

.aemet-radar-control-btn--play {
    width: 32px;
    height: 32px;
    border-color: #39758c;
    background: #39758c;
    color: #fff;
}

.aemet-radar-control-btn--play.activo {
    background: #2f6579;
}

.aemet-radar-control-btn:hover:not(:disabled),
.aemet-radar-control-btn:focus:not(:disabled) {
    border-color: #8da8b2;
    outline: none;
}

.aemet-radar-control-btn:disabled {
    cursor: default;
    opacity: .38;
}

.aemet-radar-timeline {
    width: 100%;
    margin: 0;
    cursor: pointer;
    accent-color: #39758c;
}

.aemet-radar-player__scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 5px;
    padding-left: 100px;
    color: #8399a1;
    font-size: 8px;
    line-height: 1;
}

.aemet-radar-player__interval {
    color: #9aabb2;
    font-size: 7.5px;
}

#mapa-aemet {
    width: 100%;
    height: 610px;
    border: 1px solid #dce6ea;
    border-radius: 10px;
    background: #edf3f5;
    box-shadow: 0 2px 10px rgba(34,67,80,.08);
}

.aemet-map-source {
    position: absolute;
    right: 10px;
    bottom: 7px;
    z-index: 700;
    padding: 4px 7px;
    border: 1px solid rgba(220,230,234,.92);
    border-radius: 5px;
    background: rgba(255,255,255,.88);
    color: #607985;
    font-size: 9px;
    pointer-events: none;
}

.aemet-map-message {
    position: absolute;
    top: 12px;
    left: 50%;
    z-index: 1000;
    max-width: min(560px, calc(100% - 40px));
    padding: 8px 12px;
    border-radius: 8px;
    transform: translateX(-50%);
    box-shadow: 0 6px 18px rgba(34,67,80,.15);
    font-size: 11px;
    line-height: 1.35;
}

.aemet-map-message[hidden] {
    display: none !important;
}

.aemet-map-message--warning {
    border: 1px solid #e6c46d;
    background: rgba(255,248,228,.97);
    color: #735d22;
}

.aemet-map-message--error {
    border: 1px solid #d7a0a0;
    background: rgba(255,240,240,.97);
    color: #884646;
}

.aemet-map-message--info {
    border: 1px solid #b9d2dc;
    background: rgba(245,250,252,.97);
    color: #456875;
}

.aemet-legend {
    width: 158px;
    padding: 8px 9px 7px;
    border: 1px solid #dce6ea;
    border-radius: 9px;
    background: rgba(255,255,255,.90);
    color: #526d78;
    box-shadow: 0 4px 14px rgba(34,67,80,.11);
    font-family: 'Open Sans', Arial, sans-serif;
}

.aemet-legend__radar-title {
    display: block;
    margin-bottom: 5px;
    color: #456875;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
}

.aemet-radar-gradient {
    height: 8px;
    margin-top: 3px;
    border-radius: 99px;
    background: linear-gradient(
        90deg,
        rgb(0,0,252),
        rgb(0,148,252),
        rgb(0,252,252),
        rgb(0,255,0),
        rgb(255,255,0),
        rgb(255,187,0),
        rgb(255,127,0),
        rgb(255,0,0),
        rgb(200,0,90)
    );
}

.aemet-radar-scale {
    display: flex !important;
    justify-content: space-between;
    margin-top: 3px;
    color: #8399a1;
    font-size: 8px;
}

.aemet-warning-icon-marker {
    background: transparent !important;
    border: 0 !important;
    pointer-events: none !important;
}

.aemet-warning-symbols {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(34,67,80,.16));
}

.aemet-warning-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    box-sizing: border-box;
    border: 2px solid var(--aemet-warning-color, #7f98a2);
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: #294f60;
}

.aemet-warning-symbol svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.aemet-warning-symbol--more {
    color: #526d78;
    font-size: 9px;
    font-weight: 800;
}

.aemet-popup-shell .leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(34,67,80,.18);
}

.aemet-popup-shell .leaflet-popup-content {
    margin: 0;
    min-width: 255px;
}

.aemet-popup {
    overflow: hidden;
    border-radius: 9px;
    background: #fff;
    font-family: 'Open Sans', Arial, sans-serif;
}

.aemet-popup__kicker {
    padding: 10px 12px 2px;
    color: #6c8792;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .07em;
}

.aemet-popup__title {
    padding: 0 12px 8px;
    color: #294f60;
    font-size: 14px;
    font-weight: 700;
}

.aemet-popup__level {
    margin: 0 12px 9px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
}

.aemet-popup__level--red {
    background: #fde8e8;
    color: #a32323;
}

.aemet-popup__level--orange {
    background: #fff0df;
    color: #a85e0d;
}

.aemet-popup__level--yellow {
    background: #fff9d8;
    color: #806b06;
}

.aemet-popup__level--unknown {
    background: #eef4f6;
    color: #526d78;
}

.aemet-popup__grid {
    border-top: 1px solid #edf2f4;
}

.aemet-popup__row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px;
    padding: 7px 12px;
    border-bottom: 1px solid #edf2f4;
    font-size: 10px;
}

.aemet-popup__row span {
    color: #8399a1;
}

.aemet-popup__row strong {
    color: #456875;
    font-weight: 700;
}

.aemet-popup__comment {
    padding: 8px 12px;
    color: #526d78;
    font-size: 10px;
    line-height: 1.4;
}

.aemet-popup__source {
    padding: 7px 12px 9px;
    border-top: 1px solid #edf2f4;
    background: #f8fafb;
    color: #8399a1;
    font-size: 8.5px;
    font-weight: 700;
}

@media (max-width: 991px) {
    .aemet-well--status {
        margin-left: 0;
    }

    .aemet-toolbar-col {
        padding-left: 0;
        padding-right: 0;
    }
}

@media (max-width: 767px) {
    .aemet-view {
        padding-top: 10px;
    }

    .aemet-well {
        min-height: 0;
    }

    #mapa-aemet {
        height: 540px;
        border-radius: 8px;
    }

    .aemet-mode-tabs {
        gap: 6px;
    }

    .aemet-mode-btn {
        flex: 1 1 auto;
        min-width: 88px;
    }

    .aemet-warning-days {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .aemet-warning-days__buttons {
        width: 100%;
    }

    .aemet-warning-day-btn {
        flex: 1 1 auto;
    }

    .aemet-counts {
        gap: 6px 12px;
    }

    .aemet-warning-symbol {
        width: 24px;
        height: 24px;
    }

    .aemet-warning-symbol svg {
        width: 14px;
        height: 14px;
    }

    .aemet-map-source {
        right: 6px;
        bottom: 5px;
        max-width: calc(100% - 12px);
    }

    .aemet-radar-player {
        left: 7px;
        bottom: 7px;
        width: 335px;
        max-width: calc(100% - 14px);
    }

    .aemet-legend {
        width: 145px;
        padding: 7px 8px 6px;
    }
}

@media (max-width: 430px) {
    #mapa-aemet {
        height: 500px;
    }

    .aemet-status-head {
        align-items: center;
    }

    .aemet-radar-tools {
        align-items: flex-start;
        flex-direction: column;
    }

    .aemet-opacity-control {
        width: 100%;
    }

    .aemet-opacity-control input {
        flex: 1 1 auto;
        width: auto;
    }

    .aemet-radar-player {
        width: auto;
        right: 7px;
    }

    .aemet-radar-player__controls {
        grid-template-columns: 26px 30px 26px minmax(70px, 1fr);
        gap: 5px;
    }

    .aemet-radar-player__scale {
        padding-left: 92px;
    }

    .aemet-legend {
        width: 136px;
    }

    .aemet-legend__radar-title {
        font-size: 8.5px;
    }
}
