.w2-home-weather-map {
    margin-bottom: var(--w2-g7);
}

.w2-home-weather-map .w2-content-title {
    margin-bottom: var(--w2-g4);
}

.w2-live-weather-heading {
    font-size: var(--w2-fxl);
}

@media (min-width: 768px) {
    .w2-live-weather-heading {
        font-size: var(--w2-f2xl);
    }
}

.w2-home-weather-map-stage {
    position: relative;
    width: 100%;
    height: min(480px, 58vh);
    min-width: 280px;
    min-height: 200px;
    max-width: 100%;
    border-radius: var(--w2-rlg);
    overflow: hidden;
    border: 1px solid var(--w2-b);
    background: var(--w2-900);
}

.w2-home-weather-map-stage:not(.is-user-sized) {
    max-height: 72vh;
}

.w2-live-weather-map-page-map .w2-home-weather-map-stage:not(.is-user-sized) {
    height: min(480px, 62vh);
    max-height: 78vh;
}

.w2-home-weather-map-stage.is-user-sized {
    max-height: none;
}

@media (max-width: 767px) {
    .w2-home-weather-map-stage:not(.is-user-sized) {
        height: min(38vh, 88vw);
        max-height: min(44vh, 92vw);
    }

    .w2-live-weather-map-page-map .w2-home-weather-map-stage:not(.is-user-sized) {
        height: min(42vh, 92vw);
        max-height: min(48vh, 96vw);
    }
}

@supports (height: 1dvh) {
    .w2-home-weather-map-stage:not(.is-user-sized) {
        height: min(480px, 58dvh);
        max-height: 72dvh;
    }

    .w2-live-weather-map-page-map .w2-home-weather-map-stage:not(.is-user-sized) {
        height: min(480px, 62dvh);
        max-height: 78dvh;
    }

    @media (max-width: 767px) {
        .w2-home-weather-map-stage:not(.is-user-sized) {
            height: min(38dvh, 88vw);
            max-height: min(44dvh, 92vw);
        }

        .w2-live-weather-map-page-map .w2-home-weather-map-stage:not(.is-user-sized) {
            height: min(42dvh, 92vw);
            max-height: min(48dvh, 96vw);
        }
    }
}

.w2-home-weather-map-inner {
    position: absolute;
    inset: 0;
}

.w2-home-weather-map-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1000;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: linear-gradient(135deg, transparent 50%, #0ea5e9 50%);
    cursor: nwse-resize;
    border-radius: 0 0 var(--w2-rlg) 0;
    opacity: 0.9;
    touch-action: none;
}

@media (max-width: 767px) {
    .w2-home-weather-map-resize-handle {
        width: 32px;
        height: 32px;
        opacity: 1;
        cursor: ns-resize;
    }
}

.w2-home-weather-map-resize-handle:hover,
.w2-home-weather-map-resize-handle:focus-visible {
    opacity: 1;
    outline: none;
    box-shadow: inset 0 0 0 2px #fff;
}

.w2-home-weather-map-resize-handle:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: -2px;
}

.w2-home-weather-map-stage--resizing {
    user-select: none;
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.w2-home-weather-map-stage--resizing .w2-home-weather-map-resize-handle {
    opacity: 1;
}

#home-weather-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.w2-home-weather-map-popups {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.w2-home-weather-map-popups--pending {
    visibility: hidden;
}

.w2-home-weather-map-logo {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.w2-home-weather-map-controls-box {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(15, 23, 42, 0.94);
    box-shadow: rgba(0, 0, 0, 0.35) 0 4px 12px;
}

.w2-home-weather-map-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.w2-home-weather-map-icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 5px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.w2-home-weather-map-icon-btn-label {
    display: none;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.w2-home-weather-map-unit-value {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

/* Expanded panel: show text labels next to each icon */
.w2-home-weather-map-controls-box.is-labels-open .w2-home-weather-map-icon-btn {
    width: auto;
    min-width: 32px;
    align-self: stretch;
    justify-content: flex-start;
    padding: 0 10px 0 7px;
    gap: 8px;
}

.w2-home-weather-map-controls-box.is-labels-open .w2-home-weather-map-icon-btn-label {
    display: inline-block;
}

.w2-home-weather-map-icon-btn:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.5);
    color: #38bdf8;
}

.w2-home-weather-map-icon-btn:not(.is-off) {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.55);
    color: #38bdf8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.w2-home-weather-map-icon-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.w2-home-weather-map-icon-btn .w2-label-style-icon-sun-moon {
    display: none;
}

.w2-home-weather-map-icon-btn.is-v2 .w2-label-style-icon-sun {
    display: none;
}

.w2-home-weather-map-icon-btn.is-v2 .w2-label-style-icon-sun-moon {
    display: block;
}

/* Mode toggle: always looks active when city labels are enabled */
.w2-home-weather-map-label-style-btn:not(:disabled) {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.55);
    color: #38bdf8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.w2-home-weather-map-icon-btn:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.w2-home-weather-map-icon-btn.is-off {
    background: rgba(0, 0, 0, 0.22);
    border-color: rgba(100, 116, 139, 0.35);
    color: #94a3b8;
    box-shadow: none;
}

/* Map labels: v2 icon+name | low | high; v3 icon+name | current */
.w2-weather-map-label-wrap {
    position: absolute;
    pointer-events: none;
    width: max-content;
    max-width: 220px;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.w2-weather-map-label {
    display: flex;
    align-items: stretch;
    height: 24px;
    font-family: Figtree, system-ui, -apple-system, sans-serif;
}

.w2-weather-map-label-name {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 5px 0 3px;
    background: #1a1a1a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0;
}

.w2-weather-map-label-name-text {
    line-height: 1;
}

.w2-weather-map-label-low,
.w2-weather-map-label-high {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 0;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.w2-weather-map-label-low {
    background: #fff;
    color: #111;
}

.w2-weather-map-label-high {
    background: #e53935;
    color: #fff;
}

.w2-weather-map-label-current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 0;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    background: #fff;
    color: #111;
}

.w2-weather-map-label-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    object-fit: contain;
}

.w2-weather-map-label-marker {
    background: transparent !important;
    border: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
}

.w2-weather-map-label-marker-inner {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, calc(-100% - 6px));
    width: max-content;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
    pointer-events: auto;
}

.w2-weather-map-label-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.w2-weather-map-label-link:hover .w2-weather-map-label-name {
    background: #2a2a2a;
}

@keyframes w2WeatherMapFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.w2-weather-map-fade-in {
    animation: w2WeatherMapFadeIn 0.35s ease forwards;
}
