/* =========================================================
   ACCESSIBILITY UTILITIES
   ========================================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================
   MAP LAYOUT + JS-GENERATED FILTER BUTTON
   ========================================================= */

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 1.25rem;
    align-items: stretch;
}

.live-map-box {
    min-width: 0;
}

.map-side-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.map-side-card {
    min-width: 0;
}

.map-section-header {
    display: block;
}

/* If JS appends a wrapper for controls, pin it to the bottom */
.map-side-panel>.map-filter-wrap,
.map-side-panel>.filter-controls,
.map-side-panel>.filter-container,
.map-side-panel>.filter-wrap {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
}

/* If JS appends the button directly into the side panel */
.map-side-panel>.filter-button,
.map-side-panel>button.filter-button {
    margin-top: auto;
}

/* Button sizing + appearance */
.filter-button,
button.filter-button,
.map-filter-wrap .filter-button,
.filter-controls .filter-button,
.filter-container .filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    align-self: flex-start;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(11, 95, 255, 0.2);
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.map-filter-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: auto;
}

.filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    flex: 0 0 auto;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(11, 95, 255, 0.24);
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.map-filter-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.6rem);
    z-index: 30;
    width: min(320px, 80vw);
    padding: 0.8rem;
    border: 1px solid rgba(11, 95, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 28px rgba(8, 27, 70, 0.14);
    backdrop-filter: blur(10px);
    transform: translateY(6px) scale(0.98);
    transform-origin: bottom left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0s linear 0.22s;
}

.map-filter-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0s linear 0s;
}

.filter-button:hover,
button.filter-button:hover {
    transform: translateY(-1px);
    border-color: rgba(11, 95, 255, 0.35);
    box-shadow:
        0 12px 24px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.filter-button:active,
button.filter-button:active {
    transform: translateY(0);
}

.filter-button:focus-visible,
button.filter-button:focus-visible {
    outline: 3px solid rgba(11, 95, 255, 0.35);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-side-panel {
        height: auto;
    }

    .map-side-panel>.map-filter-wrap,
    .map-side-panel>.filter-controls,
    .map-side-panel>.filter-container,
    .map-side-panel>.filter-wrap,
    .map-side-panel>.filter-button,
    .map-side-panel>button.filter-button {
        margin-top: 0;
        padding-top: 0;
    }
}

/* =========================================================
   FLOATING WEATHER DOCK
   ========================================================= */

.weather-dock {
    position: fixed;
    top: 5.5rem;
    right: max(0.75rem, calc((100vw - 1200px) / 2 + 0.75rem));
    z-index: 1200;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    width: auto;
    max-width: none;
}

.weather-dock__panel {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(92vw, 360px);
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    box-sizing: border-box;
    z-index: 1201;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transform-origin: top right;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s linear 0s;
    will-change: opacity, transform;
}

.weather-dock.is-collapsed .weather-dock__panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s linear 0.3s;
}

/* =========================================================
   WEATHER DOCK TOGGLE BUTTON — BASE
   ========================================================= */

.weather-dock__toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(11, 95, 255, 0.24);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.weather-dock__toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(11, 95, 255, 0.35);
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 14px 28px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.weather-dock__toggle:active {
    transform: translateY(0);
    box-shadow:
        0 7px 16px rgba(15, 23, 42, 0.14),
        inset 0 2px 5px rgba(15, 23, 42, 0.08);
}

.weather-dock__toggle:focus-visible {
    outline: 3px solid rgba(11, 95, 255, 0.45);
    outline-offset: 4px;
}

/* =========================================================
   WEATHER DOCK TOGGLE BUTTON — ICONS / LABEL
   ========================================================= */

.weather-widget__heat-tip {
    margin-top: 0.5rem;
    width: 100%;
    grid-column: 1 / -1;
    min-width: 0;
}

.weather-widget__condition-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.weather-dock__icon-wrap {
    position: relative;
    width: 1.1rem;
    height: 1.1rem;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

.weather-dock__icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1rem;
    transition:
        transform 0.28s ease,
        opacity 0.22s ease,
        color 0.2s ease;
}

.weather-dock__icon--weather {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #0b5fff;
}

.weather-dock__icon--close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.7);
    color: currentColor;
}

.weather-dock__label {
    display: inline-block;
    min-width: 0;
    max-width: 70px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
    opacity: 0.88;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.weather-dock__toggle:hover .weather-dock__label,
.weather-dock__toggle:focus-visible .weather-dock__label {
    opacity: 1;
    transform: translateX(2px);
}

.weather-dock__toggle::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    position: relative;
    top: -10px;
    right: -3px;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: weather-live-pulse 2s infinite;
}

@keyframes weather-live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* =========================================================
   WEATHER DOCK TOGGLE BUTTON — STATE
   ========================================================= */

.weather-dock__toggle[aria-expanded="true"] {
    background: linear-gradient(135deg, #0b5fff, #2563eb);
    color: #ffffff;
    border-color: transparent;
    box-shadow:
        0 14px 30px rgba(11, 95, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.weather-dock__toggle[aria-expanded="true"] .weather-dock__icon--weather {
    opacity: 0;
    transform: rotate(90deg) scale(0.7);
    color: currentColor;
}

.weather-dock__toggle[aria-expanded="true"] .weather-dock__icon--close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    margin-left: -20px;
    font-size: 1.3rem;
}

.weather-dock__toggle[aria-expanded="true"]::after {
    background: rgba(255, 255, 255, 0.95);
    animation: none;
    opacity: 0;
    transform: scale(0);
}

.weather-dock__toggle--compact {
    min-height: 44px;
    padding: 0.55rem 0.7rem;
}

.weather-dock__toggle--compact[aria-expanded="true"] {
    padding: 0.55rem 0.55rem;
    width: 46px;
}

/* =========================================================
   WEATHER WIDGET CONTAINER
   ========================================================= */

#weather-body {
    position: relative;
}

.weather-widget {
    position: relative;
}

.weather-widget--assistant .weather-widget__body {
    display: grid;
    gap: 1rem;
    padding: 0.25rem;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        0 20px 48px rgba(15, 23, 42, 0.14),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
    overflow: visible;
    position: relative;
    box-sizing: border-box;
}

/* =========================================================
   TIMESTAMP BADGE
   ========================================================= */

.weather-widget__updated {
    position: absolute;
    bottom: 0.1rem;
    right: 0.6rem;
    z-index: 2;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.weather-widget__updated.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   HEADER + HERO
   ========================================================= */

.weather-widget__header,
.weather-widget__hero {
    padding: 0.75rem 0.85rem;
}

.weather-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: #061c60;
    color: #ffffff;
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.weather-widget__hero {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 1rem 0.75rem;
    margin-top: -1rem;
    align-items: start;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-radius: 0 0 8px 8px;
    border: 1px solid #dddee1;
}

.weather-widget__location,
.weather-widget__status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 32px;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.weather-widget__header .weather-widget__location {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.weather-widget__header .weather-widget__status-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-widget__status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #22c55e;
    position: relative;
    flex-shrink: 0;
}

.weather-widget__status-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.6);
    animation: weather-pulse 1.8s ease-out infinite;
}

@keyframes weather-pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    70% {
        transform: scale(2.4);
        opacity: 0;
    }

    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

.weather-widget__hero-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.25)),
        linear-gradient(135deg, rgba(255, 183, 3, 0.22), rgba(11, 95, 255, 0.12));
    color: #0b5fff;
    font-size: 1.45rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 10px 22px rgba(15, 23, 42, 0.08);
}

.weather-widget__hero-main {
    min-width: 0;
    display: grid;
    gap: 0.75rem;
    position: relative;
    /*padding-bottom: 1.6rem;*/
}

/* =========================================================
   CURRENT CONDITIONS CONTENT
   ========================================================= */

.weather-widget__label {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.weather-widget__temp-group {
    display: grid;
    gap: 0.18rem;
}

.weather-widget__temp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.weather-widget__temp {
    font-size: clamp(2.2rem, 3vw, 2.8rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.05em;
    color: #0f172a;
}

.weather-widget__mini-meta {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.35rem 0.75rem;
    justify-content: end;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
}

.weather-widget__mini-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.weather-widget__mini-meta i {
    font-size: 0.75rem;
    color: #0b5fff;
}

.weather-widget__condition {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0b5fff;
}

.weather-widget__feels {
    margin-top: 0.1rem;
    font-size: 0.74rem;
    color: #64748b;
}

/* =========================================================
   KEY FACTS
   ========================================================= */

.weather-widget__key-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.weather-widget__fact {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-width: 0;
    padding: 0.65rem 0.7rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 4px 14px rgba(15, 23, 42, 0.04);
    color: #475569;
}

.weather-widget__fact i {
    color: #0b5fff;
    font-size: 0.84rem;
}

.weather-widget__fact strong {
    font-size: 0.77rem;
    font-weight: 800;
    color: #475569;
}

.weather-widget__fact>span:last-child {
    font-size: 0.88rem;
    font-weight: 900;
    color: #0f172a;
}

/* =========================================================
   STATS SECTION
   ========================================================= */

.weather-widget__stats {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.9rem;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.weather-widget__stats::before {
    content: "Heat and sun indicators";
    grid-column: 1 / -1;
    margin-bottom: 0.25rem;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.05em;
    color: #64748b;
}

.weather-widget__stat {
    display: grid;
    gap: 0.45rem;
    padding: 0.45rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        0 4px 12px rgba(15, 23, 42, 0.04);
}

.weather-widget__stat-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.05em;
    color: #64748b;
}

.weather-widget__stat-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.weather-widget__stat-icon {
    width: 1.9rem;
    height: 1.9rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(11, 95, 255, 0.08);
    color: #0b5fff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.weather-widget__stat-value {
    font-size: 1rem;
    font-weight: 900;
    color: #0f172a;
}

.weather-widget__stat--uv .weather-widget__stat-icon {
    background: rgba(255, 183, 3, 0.14);
    color: #a16207;
}

.weather-widget__stat--uv-low .weather-widget__stat-icon {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.weather-widget__stat--uv-moderate .weather-widget__stat-icon {
    background: rgba(255, 183, 3, 0.16);
    color: #a16207;
}

.weather-widget__stat--uv-high .weather-widget__stat-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

/* =========================================================
   ADVISORY
   ========================================================= */

.weather-widget__advisory {
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.45rem;
    border-radius: 8px;
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.weather-widget__advisory-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
}

.weather-widget__advisory strong {
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.95rem;
}

.weather-widget__advisory p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    min-width: 0;
    overflow-wrap: anywhere;
}

.weather-widget__advisory--low {
    background: rgba(0, 184, 148, 0.08);
    border-color: rgba(0, 184, 148, 0.16);
    color: #0b5b4a;
}

.weather-widget__advisory--low .weather-widget__advisory-icon {
    background: rgba(0, 184, 148, 0.14);
}

.weather-widget__advisory--moderate {
    background: rgba(255, 183, 3, 0.12);
    border-color: rgba(217, 119, 6, 0.22);
    color: #7c5200;
}

.weather-widget__advisory--moderate .weather-widget__advisory-icon {
    background: rgba(255, 183, 3, 0.18);
}

.weather-widget__advisory--high {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(220, 38, 38, 0.18);
    color: #8b1e1e;
}

.weather-widget__advisory--high .weather-widget__advisory-icon {
    background: rgba(239, 68, 68, 0.16);
}

/* =========================================================
   DOCK TEMP STATES (adaptive)
   ========================================================= */

.weather-dock__toggle[aria-expanded="true"] .weather-dock__main {
    justify-content: center;
}

.weather-dock__toggle[aria-expanded="true"] .weather-dock__temp {
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
}

.weather-dock__main {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.weather-dock__temp {
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    min-width: 36px;
    text-align: center;
    transition:
        color 0.25s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.weather-dock__temp.is-hot {
    color: #f97316;
}

.weather-dock__temp.is-warm {
    color: #eab308;
}

.weather-dock__temp.is-cold {
    color: #0ea5e9;
}

.weather-dock__temp.is-rain {
    color: #0ea5e9;
    transform: translateY(-1px);
}

.weather-dock__temp.is-alert {
    color: #dc2626;
    animation: weather-alert-pulse 1.2s ease-in-out infinite;
}

@keyframes weather-alert-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.weather-widget__stat--low {
    border-color: rgba(0, 184, 148, 0.18);
    background: linear-gradient(180deg, #fff, rgba(240, 253, 250, 0.95));
}

.weather-widget__stat--low .weather-widget__stat-icon {
    background: rgba(0, 184, 148, 0.12);
    color: #0b5b4a;
}

.weather-widget__stat--moderate {
    border-color: rgba(217, 119, 6, 0.18);
    background: linear-gradient(180deg, #fff, rgba(255, 251, 235, 0.95));
}

.weather-widget__stat--moderate .weather-widget__stat-icon {
    background: rgba(255, 183, 3, 0.16);
    color: #a16207;
}

.weather-widget__stat--high {
    border-color: rgba(220, 38, 38, 0.18);
    background: linear-gradient(180deg, #fff, rgba(254, 242, 242, 0.95));
}

.weather-widget__stat--high .weather-widget__stat-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.weather-widget__body {
    position: relative;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
    .weather-dock {
        top: 2.8rem;
    }

    .map-section-header {
        flex-direction: row !important;
    }
}

@media (max-width: 640px) {
    .weather-dock__toggle[aria-expanded="true"] .weather-dock__icon--close {
        margin-left: -36px;
    }

    .weather-dock {
        right: 0.75rem;
        top: 2.75rem;
    }

    .weather-dock__toggle {
        justify-content: center;
        box-shadow:
            0 18px 38px rgba(15, 23, 42, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.95);
    }

    .weather-dock__label {
        display: none;
    }

    .weather-dock__toggle::after {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .weather-dock__panel {
        max-height: calc(100vh - 6.5rem);
    }
}

@media (max-width: 600px) {
    :root {
        --mobile-weather-dock-height: 46px;
    }

    /* Push navigation down so dock does not cover it */
    #dph-header {
        margin-top: var(--mobile-weather-dock-height);
    }

    .weather-dock {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        max-width: none;
        display: block;
        z-index: 9999;
        box-sizing: border-box;
        pointer-events: none;

        transform: translateY(0);
        transition: transform 0.25s ease;
    }

    .weather-dock.is-scrolled {
        transform: translateY(0);
    }

    .weather-dock__toggle,
    .weather-dock__panel {
        pointer-events: auto;
    }

    .weather-dock__panel {
        position: absolute;
        left: 50%;
        right: auto;
        top: calc(100% + 0.75rem);
        bottom: auto;
        width: min(420px, calc(100vw - 2.5rem));
        max-height: min(70vh, 520px);
        transform: translateX(-50%);
        transform-origin: top center;
        z-index: 10000;
    }

    .weather-dock.is-collapsed .weather-dock__panel {
        transform: translateX(-50%) translateY(-8px) scale(0.98);
    }

    .weather-dock.is-collapsed .weather-dock__toggle {
        width: 100%;
        display: flex;
        justify-content: center;
        border-radius: 0;
    }

    .weather-dock__main {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .weather-dock__heat-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        min-height: 28px;
        padding: 0.28rem 0.55rem;
        border-radius: 999px;
        font-size: 0.72rem;
        font-weight: 800;
        line-height: 1;
        white-space: nowrap;
        border: 1px solid transparent;
    }

    .weather-dock__heat-badge i {
        font-size: 0.72rem;
        flex-shrink: 0;
    }

    .weather-dock:not(.is-collapsed) .weather-dock__toggle {
        position: absolute;
        top: calc(100% + 0.85rem);
        right: calc(50% - min(210px, calc((100vw - 1.5rem) / 2)) + 0.65rem);
        width: 2.25rem !important;
        height: 2.25rem;
        min-height: 2.25rem;
        padding: 0 !important;
        border-radius: 999px;
        border: 0 !important;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18) !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        z-index: 12003;
        color: #ffffff !important;
    }

    .weather-dock:not(.is-collapsed) .weather-dock__toggle::after,
    .weather-dock:not(.is-collapsed) .weather-dock__temp,
    .weather-dock:not(.is-collapsed) .weather-dock__heat-badge,
    .weather-dock:not(.is-collapsed) .weather-dock__icon--weather {
        display: none !important;
    }

    .weather-dock:not(.is-collapsed) .weather-dock__icon-wrap {
        display: inline-grid !important;
        width: 1rem;
        height: 1rem;
    }

    .weather-dock:not(.is-collapsed) .weather-dock__icon--close {
        opacity: 1 !important;
        transform: none !important;
        margin-left: 0 !important;
        font-size: 1rem !important;
        color: #fff !important;
    }

    .weather-dock__advisory--low {
        background: rgba(0, 184, 148, 0.1);
        border-color: rgba(0, 184, 148, 0.18);
        color: #0b5b4a;
    }

    .weather-dock__advisory--moderate {
        background: rgba(255, 183, 3, 0.14);
        border-color: rgba(217, 119, 6, 0.22);
        color: #7c5200;
    }

    .weather-dock__advisory--high {
        background: rgba(239, 68, 68, 0.12);
        border-color: rgba(220, 38, 38, 0.2);
        color: #8b1e1e;
    }
}

@media (max-width: 520px) {
    .weather-dock__icon {
        font-size: 0.65rem;
        margin-left: -15px;
    }

    .weather-dock__toggle[aria-expanded="true"] .weather-dock__icon--close {
        margin-left: -39px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 0;
    }

    /*.weather-dock {
        right: 1rem;
        top: 4.75rem;
    }*/

    .weather-dock__panel {
        right: 0;
        width: min(92vw, 320px);
        max-height: calc(100vh - 5.5rem);
    }

    .map-filter-wrap {
        width: 100%;
        align-items: stretch;
    }

    .filter-button {
        width: 100%;
        justify-content: center;
    }

    .map-filter-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        padding: 1rem;
        transform: translateY(100%);
        opacity: 0;
    }

    .map-filter-panel.is-open {
        transform: translateY(0);
        opacity: 1;
    }

    .weather-widget__hero-main {
        margin-left: -20px;
    }

    .weather-widget__hero-icon {
        width: 50px;
        height: 50px;
    }

    .weather-widget__stat-value {
        font-size: 0.75rem;
    }
}

/* =========================================================
   EXTRA SMALL SCREENS — 420px AND BELOW
   ========================================================= */

@media (max-width: 420px) {
    .weather-widget__hero {
        position: relative;
        display: block;
    }

    .weather-widget__hero-icon {
        position: absolute;
        top: 2.2rem;
        left: calc(50% - 70px);
        width: auto;
        height: auto;
        font-size: 1rem;
        background: none;
        box-shadow: none;
    }

    .weather-widget__hero-icon i {
        font-size: 1rem;
    }

    .weather-widget__temp-row {
        position: relative;
        justify-content: center;
    }

    .weather-widget__temp {
        padding-left: 1.4rem;
    }

    .weather-dock__toggle {
        gap: 0.35rem;
        padding: 0.5rem 0.65rem;
    }

    .weather-dock__toggle::after {
        position: absolute;
        top: 7px;
        right: 7px;
    }

    .weather-dock__main {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        flex-wrap: nowrap;
    }

    .weather-dock__temp {
        min-width: auto;
        font-size: 0.95rem;
        line-height: 1;
        text-align: center;
    }

    .weather-dock__icon-wrap {
        width: 0.95rem;
        height: 0.95rem;
        flex-shrink: 0;
    }

    .weather-dock__icon {
        font-size: 0.78rem;
        margin-left: 0;
    }

    .weather-dock__toggle[aria-expanded="true"] .weather-dock__icon--close {
        margin-left: -32px;
        font-size: 1.1rem;
    }

    .weather-widget__label {
        text-align: center;
    }

    .weather-widget__hero {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.8rem 0.7rem 0.9rem;
        margin-top: -0.8rem;
        justify-items: center;
    }

    .weather-widget__hero-icon {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
        border-radius: 14px;
        margin: 0 auto;
        display: none;
    }

    .weather-widget__hero-main {
        width: 100%;
        display: grid;
        gap: 0.55rem;
        text-align: center;
    }

    .weather-widget__temp-group {
        gap: 0.45rem;
    }

    .weather-widget__temp-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.65rem;
    }

    .weather-widget__temp {
        font-size: clamp(2.2rem, 9vw, 2.7rem);
        line-height: 1;
        text-align: center;
    }

    .weather-widget__mini-meta {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem 0.6rem;
        justify-content: stretch;
        font-size: 0.9rem;
        text-align: center;
    }

    .weather-widget__mini-meta span {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.45rem 0.5rem;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.72);
        border: 1px solid rgba(148, 163, 184, 0.15);
    }

    .weather-widget__mini-meta i {
        font-size: 0.85rem;
    }

    .weather-widget__condition {
        text-align: center;
        font-size: 0.95rem;
    }

    .weather-widget__feels {
        text-align: center;
        font-size: 0.84rem;
    }

    .weather-widget__stats {
        gap: 0.55rem;
        padding: 0.75rem;
        border-radius: 16px;
    }

    .weather-widget__stats::before {
        margin-bottom: 0.15rem;
        font-size: 0.68rem;
    }

    .weather-widget__stat {
        gap: 0.35rem;
        padding: 0.42rem;
        border-radius: 12px;
    }

    .weather-widget__stat-label {
        font-size: 0.66rem;
    }

    .weather-widget__stat-content {
        gap: 0.35rem;
    }

    .weather-widget__stat-icon {
        width: 1.7rem;
        height: 1.7rem;
        font-size: 0.8rem;
    }

    .weather-widget__stat-value {
        font-size: 0.92rem;
    }

    .weather-widget__hero-main {
        width: 100%;
        display: grid;
        gap: 0.55rem;
        text-align: center;
        margin-left: 0;
        min-width: 0;
    }

    .weather-widget__temp-group {
        width: 100%;
        min-width: 0;
    }

    .weather-widget__temp-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.65rem;
        width: 100%;
        min-width: 0;
    }

    .weather-widget__mini-meta {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem 0.6rem;
        justify-content: stretch;
        box-sizing: border-box;
        overflow: hidden;
    }

    .weather-widget__mini-meta span {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.45rem 0.5rem;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.72);
        border: 1px solid rgba(148, 163, 184, 0.15);
        box-sizing: border-box;
    }

    .weather-widget__mini-meta i {
        flex-shrink: 0;
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {

    .weather-widget__location,
    .weather-widget__status-badge {
        font-size: 0.65rem;
    }

    /*.weather-dock {
        left: auto;
        width: auto;
        max-width: min(88vw, 320px);
        align-items: flex-end;
    }*/

    .weather-dock__panel {
        width: min(88vw, 320px);
    }

    .weather-widget__hero {
        grid-template-columns: 1fr;
        justify-items: stretch;
        padding: 0.75rem 0.6rem 0.8rem;
    }

    .weather-widget__hero-main {
        width: 100%;
    }

    .weather-widget__condition-row {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
    }

    .weather-widget__advisory {
        grid-template-columns: 1.75rem minmax(0, 1fr);
        gap: 0.55rem;
        padding: 0.45rem;
    }

    .weather-widget__advisory-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .weather-widget__advisory strong {
        font-size: 0.82rem;
    }

    .weather-widget__advisory p {
        font-size: 0.8rem;
        line-height: 1.35;
    }
}

@media (max-width: 360px) {
    .weather-widget__stats {
        gap: 0.45rem;
        padding: 0.65rem;
    }

    .weather-widget__stat {
        padding: 0.38rem;
    }

    .weather-widget__stat-label {
        font-size: 0.6rem;
    }

    .weather-widget__stat-content {
        gap: 0.28rem;
    }

    .weather-widget__stat-icon {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.72rem;
    }

    .weather-widget__stat-value {
        font-size: 0.82rem;
        line-height: 1;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .weather-dock__toggle,
    .weather-dock__icon,
    .weather-dock__label,
    .weather-dock__panel,
    .weather-widget__updated,
    .filter-button,
    button.filter-button {
        transition: none;
    }

    .weather-dock__toggle:hover,
    .weather-dock__toggle:active,
    .filter-button:hover,
    button.filter-button:hover {
        transform: none;
    }

    .weather-dock__toggle::after,
    .weather-widget__status-dot::after {
        animation: none;
    }

    .weather-dock__panel,
    .weather-widget__updated {
        transform: none;
    }
}