/**
 * ConvMaster - Weather module stylesheet
 *
 * Depends on core style.css tokens (--bg, --text, --card etc.).
 * All weather-specific styles are namespaced .weather-* to avoid collisions.
 */

/* ===== Root tokens (fallbacks if core doesn't define them) ===== */
.weather-app {
    --w-radius: 20px;
    --w-radius-sm: 12px;
    --w-glass-bg: rgba(255, 255, 255, 0.08);
    --w-glass-brd: rgba(255, 255, 255, 0.14);
    --w-glass-blur: 18px;
    --w-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25);
    --w-text: #fff;
    --w-text-dim: rgba(255, 255, 255, 0.72);
    --w-text-mute: rgba(255, 255, 255, 0.5);
    --w-accent: #FDE68A;
    color: var(--w-text);
    position: relative;
    isolation: isolate;
    min-height: 720px;
    padding: 28px 0 60px;
    overflow: hidden;
    border-radius: var(--w-radius);
}

/* Light-theme adjustments */
[data-theme="light"] .weather-app {
    --w-glass-bg: rgba(255, 255, 255, 0.55);
    --w-glass-brd: rgba(15, 23, 42, 0.12);
    --w-text: #0F172A;
    --w-text-dim: rgba(15, 23, 42, 0.72);
    --w-text-mute: rgba(15, 23, 42, 0.5);
    --w-shadow: 0 20px 60px rgba(15, 23, 42, 0.15), 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* ===== Background layers ===== */
.weather-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    display: block;
    border-radius: inherit;
}
.weather-bg-tint {
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0.55));
    transition: background 1.2s ease;
}

/* ===== Hero + search ===== */
.weather-hero {
    padding: 40px 32px 24px;
    text-align: center;
}
.weather-hero__inner { max-width: 720px; margin: 0 auto; }
.weather-hero__title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 8px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.weather-hero__sub {
    color: var(--w-text-dim);
    font-size: 0.98rem;
    margin: 0 0 24px;
}

.weather-search { position: relative; }
.weather-search__field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 16px;
    background: var(--w-glass-bg);
    border: 1px solid var(--w-glass-brd);
    border-radius: 999px;
    backdrop-filter: blur(var(--w-glass-blur));
    -webkit-backdrop-filter: blur(var(--w-glass-blur));
    box-shadow: var(--w-shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.weather-search__field:focus-within {
    border-color: rgba(253, 230, 138, 0.6);
    box-shadow: var(--w-shadow), 0 0 0 4px rgba(253, 230, 138, 0.15);
}
.weather-search__icon { color: var(--w-text-mute); flex-shrink: 0; }
.weather-search__input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--w-text);
    font-size: 1rem;
    font-family: inherit;
    padding: 10px 4px;
    min-width: 0;
}
.weather-search__input::placeholder { color: var(--w-text-mute); }
.weather-search__geo {
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    color: var(--w-text);
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.weather-search__geo:hover { background: rgba(255, 255, 255, 0.28); transform: scale(1.05); }

.weather-search__results {
    position: absolute;
    top: calc(100% + 8px);
    left: 8px;
    right: 8px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--w-glass-bg);
    border: 1px solid var(--w-glass-brd);
    border-radius: var(--w-radius-sm);
    backdrop-filter: blur(var(--w-glass-blur));
    -webkit-backdrop-filter: blur(var(--w-glass-blur));
    box-shadow: var(--w-shadow);
    max-height: 340px;
    overflow-y: auto;
    z-index: 20;
    text-align: left;
}
.weather-search__result {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--w-text);
    transition: background 0.1s;
}
.weather-search__result:hover,
.weather-search__result.is-active {
    background: rgba(255, 255, 255, 0.14);
}
.weather-search__result-name { font-weight: 500; }
.weather-search__result-region { font-size: 0.85rem; color: var(--w-text-mute); margin-left: 12px; }
.weather-search__empty { padding: 16px; text-align: center; color: var(--w-text-mute); font-size: 0.9rem; }

/* ===== Main city card ===== */
.weather-main { padding: 8px 24px 24px; }
.weather-card {
    background: var(--w-glass-bg);
    border: 1px solid var(--w-glass-brd);
    border-radius: var(--w-radius);
    backdrop-filter: blur(var(--w-glass-blur));
    -webkit-backdrop-filter: blur(var(--w-glass-blur));
    box-shadow: var(--w-shadow);
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "identity actions"
        "hero hero"
        "scene scene"
        "details details";
    gap: 24px;
    animation: weatherIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Scene sits INSIDE the main card, between temp block and details */
.weather-card__scene {
    grid-area: scene;
    border-radius: var(--w-radius-sm);
    overflow: hidden;
    background: #0a1628;
    border: 1px solid var(--w-glass-brd);
    aspect-ratio: 1200 / 800;
    max-height: 650px;
    min-height: 350px;
}
.weather-card__scene:empty { display: none; }
.weather-card__scene .weather-scene__svg {
    display: block;
    width: 100%;
    height: 100%;
}
/* Realistic scene: enable container queries for responsive cloud/bird animations */
.weather-card__scene .wsr {
    container-type: inline-size;
}
@keyframes weatherIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.weather-card__identity { grid-area: identity; min-width: 0; }
.weather-card__city {
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    font-weight: 700;
    margin: 0 0 4px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.weather-card__meta { color: var(--w-text-dim); font-size: 0.95rem; }
.weather-card__meta > * { display: inline-block; }
.weather-card__meta > * + *::before { content: "·"; margin: 0 8px; opacity: 0.5; }

.weather-card__actions { grid-area: actions; display: flex; gap: 8px; flex-shrink: 0; }
.weather-card__btn {
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    color: var(--w-text);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.15s, transform 0.15s;
}
.weather-card__btn:hover { background: rgba(255, 255, 255, 0.28); transform: scale(1.05); }
.weather-card__btn.is-active { background: rgba(253, 230, 138, 0.3); color: #FDE68A; }

.weather-card__hero {
    grid-area: hero;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
}
.weather-card__icon { width: 128px; height: 128px; flex-shrink: 0; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35)); }
.weather-card__icon svg { width: 100%; height: 100%; }
.weather-card__temp-block { min-width: 0; }
.weather-card__temp {
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 300;
    line-height: 0.9;
    letter-spacing: -0.03em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.weather-card__temp-unit { font-size: 0.5em; vertical-align: top; margin-left: 4px; font-weight: 400; }
.weather-card__cond {
    font-size: 1.25rem;
    margin: 8px 0 4px;
    color: var(--w-text);
    font-weight: 500;
}
.weather-card__feels { font-size: 0.95rem; color: var(--w-text-dim); }
.weather-card__high-low { font-size: 0.95rem; color: var(--w-text-dim); margin-top: 4px; }

.weather-card__details {
    grid-area: details;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--w-glass-brd);
}
.weather-detail {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--w-radius-sm);
    transition: background 0.15s, transform 0.15s;
}
.weather-detail:hover { background: rgba(255, 255, 255, 0.11); transform: translateY(-2px); }
.weather-detail__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--w-text-mute);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.weather-detail__value { font-size: 1.15rem; font-weight: 500; }
.weather-detail__extra { font-size: 0.8rem; color: var(--w-text-mute); margin-top: 2px; }

/* Wind rose (SVG compass) */
.weather-windrose {
    display: inline-block;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    vertical-align: middle;
}
.weather-windrose__arrow { transform-origin: center; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

/* UV meter */
.weather-uv-bar {
    height: 6px;
    border-radius: 3px;
    margin-top: 6px;
    background: linear-gradient(to right, #22C55E 0%, #EAB308 40%, #F97316 60%, #EF4444 80%, #A855F7 100%);
    position: relative;
}
.weather-uv-cursor {
    position: absolute;
    top: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transform: translateX(-50%);
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sun arc */
.weather-sun-arc { position: relative; height: 60px; margin-top: 8px; }
.weather-sun-arc svg { display: block; overflow: visible; }
.weather-sun-arc__ball { fill: url(#wg-sun); filter: drop-shadow(0 0 8px rgba(253, 224, 71, 0.6)); }

/* ===== Season badge ===== */
.weather-card__season {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid var(--w-glass-brd);
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Scene shared SVG styling (legacy standalone kept for backward compat) */
.weather-scene__svg {
    display: block;
    width: 100%;
    height: 100%;
}
/* On tablet */
@media (max-width: 900px) {
    .weather-card__scene {
        aspect-ratio: 1200 / 700;
        max-height: 450px;
        min-height: 260px;
    }
}
/* On phone landscape / small tablet portrait */
@media (max-width: 600px) {
    .weather-card__scene {
        aspect-ratio: 1200 / 800;
        max-height: 320px;
        min-height: 200px;
    }
}
/* On phone portrait */
@media (max-width: 420px) {
    .weather-card__scene {
        aspect-ratio: 1200 / 900;
        max-height: 270px;
        min-height: 170px;
    }
}

/* ===== Hourly strip ===== */
.weather-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 24px 32px 12px;
}
.weather-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.weather-drag-hint { font-size: 0.8rem; color: var(--w-text-mute); }

.weather-hourly {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 32px 24px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.weather-hourly::-webkit-scrollbar { height: 6px; }
.weather-hourly::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 3px; }

.weather-hour {
    scroll-snap-align: start;
    flex: 0 0 82px;
    padding: 14px 8px;
    background: var(--w-glass-bg);
    border: 1px solid var(--w-glass-brd);
    border-radius: var(--w-radius-sm);
    backdrop-filter: blur(var(--w-glass-blur));
    -webkit-backdrop-filter: blur(var(--w-glass-blur));
    text-align: center;
    transition: transform 0.15s, background 0.15s;
    cursor: default;
}
.weather-hour:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.15); }
.weather-hour__time { font-size: 0.85rem; color: var(--w-text-dim); margin-bottom: 6px; }
.weather-hour__icon { width: 40px; height: 40px; margin: 0 auto 6px; }
.weather-hour__temp { font-size: 1.1rem; font-weight: 600; }
.weather-hour__precip {
    font-size: 0.75rem;
    color: #7DD3FC;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 16px;
}
.weather-hour--now { background: rgba(253, 230, 138, 0.22); border-color: rgba(253, 230, 138, 0.5); }
.weather-hour--active { background: rgba(56, 189, 248, 0.28); border-color: rgba(56, 189, 248, 0.7); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4); }
.weather-hour {
    /* button reset */
    font: inherit; color: inherit; border: 1px solid var(--w-glass-brd); cursor: pointer;
}
.weather-hour__feels {
    font-size: 0.72rem;
    color: var(--w-text-mute);
    min-height: 14px;
    margin-top: 2px;
}

/* Time-of-slot badge in main card + back-to-now pill */
.weather-card__time-badge {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--w-text-dim);
}
.weather-card__time-label { font-weight: 500; }
.weather-card__nowbtn {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #fff;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    line-height: 1.4;
}
.weather-card__nowbtn:hover { background: rgba(56, 189, 248, 0.4); transform: translateY(-1px); }

/* Expandable daily rows */
.weather-day-wrap { display: contents; }
.weather-day {
    /* button reset */
    width: 100%;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.weather-day__chevron {
    margin-left: 8px;
    transition: transform 0.2s ease;
    opacity: 0.6;
    flex-shrink: 0;
}
.weather-day[aria-expanded="true"] .weather-day__chevron { transform: rotate(180deg); opacity: 1; }
.weather-day[aria-expanded="true"] { background: rgba(255, 255, 255, 0.15); }
.weather-day__slots {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 4px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    animation: weatherIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.weather-day__slots::-webkit-scrollbar { height: 6px; }
.weather-day__slots::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 3px; }
.weather-day__slots .weather-hour {
    flex: 0 0 76px;
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.05);
}
.weather-day__empty { padding: 16px; color: var(--w-text-mute); text-align: center; }

/* ===== Daily forecast ===== */
.weather-daily {
    padding: 0 32px 24px;
    display: grid;
    gap: 8px;
}
.weather-day {
    background: var(--w-glass-bg);
    border: 1px solid var(--w-glass-brd);
    border-radius: var(--w-radius-sm);
    backdrop-filter: blur(var(--w-glass-blur));
    -webkit-backdrop-filter: blur(var(--w-glass-blur));
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 100px 48px 1fr auto;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: background 0.15s;
}
.weather-day:hover { background: rgba(255, 255, 255, 0.12); }
.weather-day__label { font-weight: 500; }
.weather-day__date { font-size: 0.8rem; color: var(--w-text-mute); }
.weather-day__icon { width: 48px; height: 48px; }
.weather-day__cond { color: var(--w-text-dim); font-size: 0.9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.weather-day__range {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    justify-content: flex-end;
}
.weather-day__min { color: var(--w-text-mute); font-size: 0.95rem; min-width: 34px; text-align: right; }
.weather-day__max { font-weight: 600; font-size: 1.05rem; min-width: 34px; text-align: right; }
.weather-day__bar {
    flex: 1;
    max-width: 100px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}
.weather-day__bar-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(to right, #0EA5E9, #EAB308, #EF4444);
    border-radius: inherit;
}

/* ===== Favorites strip ===== */
.weather-favs {
    padding: 8px 32px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    min-height: 100px;
}
.weather-fav {
    position: relative;
    background: var(--w-glass-bg);
    border: 1px solid var(--w-glass-brd);
    border-radius: var(--w-radius-sm);
    backdrop-filter: blur(var(--w-glass-blur));
    -webkit-backdrop-filter: blur(var(--w-glass-blur));
    padding: 16px;
    cursor: pointer;
    transition: transform 0.2s, background 0.15s;
    user-select: none;
}
.weather-fav:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.14); }
.weather-fav.is-dragging { opacity: 0.6; transform: scale(0.98); }
.weather-fav.is-current { border-color: rgba(253, 230, 138, 0.5); }

.weather-fav__row { display: flex; align-items: center; gap: 12px; }
.weather-fav__icon { width: 44px; height: 44px; flex-shrink: 0; }
.weather-fav__body { min-width: 0; flex: 1; }
.weather-fav__name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-fav__cond { font-size: 0.78rem; color: var(--w-text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-fav__temp { font-size: 1.4rem; font-weight: 500; flex-shrink: 0; }
.weather-fav__time { font-size: 0.75rem; color: var(--w-text-mute); margin-top: 6px; }

.weather-fav__remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
}
.weather-fav:hover .weather-fav__remove { opacity: 1; }
.weather-fav__remove:hover { background: rgba(239, 68, 68, 0.7); }

.weather-favs__empty {
    grid-column: 1 / -1;
    padding: 30px;
    text-align: center;
    color: var(--w-text-mute);
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--w-glass-brd);
    border-radius: var(--w-radius-sm);
}

/* ===== Attribution ===== */
.weather-attribution {
    text-align: center;
    padding: 20px 24px 8px;
    font-size: 0.78rem;
    color: var(--w-text-mute);
}
.weather-attribution a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); }
.weather-attribution a:hover { color: var(--w-text); }

/* ===== Skeleton ===== */
.weather-card-skeleton {
    background: var(--w-glass-bg);
    border: 1px solid var(--w-glass-brd);
    border-radius: var(--w-radius);
    padding: 40px;
    min-height: 320px;
    backdrop-filter: blur(var(--w-glass-blur));
    -webkit-backdrop-filter: blur(var(--w-glass-blur));
}
.skel {
    height: 20px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    background-size: 200% 100%;
    animation: skel 1.4s ease-in-out infinite;
    border-radius: 8px;
    margin-bottom: 12px;
}
.skel--big { height: 80px; width: 60%; margin-bottom: 20px; }
.skel--line { width: 80%; }
.skel--short { width: 40%; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ===== Header pill (widget next to theme toggle) ===== */
.header-weather-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    transition: background 0.15s, transform 0.15s;
    white-space: nowrap;
}
[data-theme="light"] .header-weather-pill {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.12);
}
.header-weather-pill:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
[data-theme="light"] .header-weather-pill:hover { background: rgba(15, 23, 42, 0.1); }
.header-weather-pill__icon { width: 22px; height: 22px; flex-shrink: 0; }
.header-weather-pill__temp { font-weight: 600; }
.header-weather-pill__city { color: var(--w-text-dim, rgba(255, 255, 255, 0.75)); font-weight: 500; }
.header-weather-pill__cond {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
    font-size: 0.85em;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[data-theme="light"] .header-weather-pill__city { color: rgba(15, 23, 42, 0.72); }
[data-theme="light"] .header-weather-pill__cond { color: rgba(15, 23, 42, 0.55); }
.header-weather-pill.is-loading .header-weather-pill__temp::after {
    content: "…";
    animation: dots 1s steps(3, end) infinite;
}
@keyframes dots {
    0%, 20%   { content: ""; }
    40%       { content: "."; }
    60%       { content: ".."; }
    80%, 100% { content: "..."; }
}
@media (max-width: 1100px) { .header-weather-pill__cond { display: none; } }
@media (max-width: 900px)  { .header-weather-pill__city { display: none; } }
@media (max-width: 640px)  { .header-weather-pill { display: none; } }

/* ===== Alert banner ===== */
.weather-alert {
    margin: 8px 32px 16px;
    padding: 12px 18px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--w-radius-sm);
    color: #FECACA;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
}
[data-theme="light"] .weather-alert { color: #7F1D1D; }

/* ===== Detached floating popup widget ===== */
.weather-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    min-width: 240px;
    max-width: 300px;
    padding: 14px 16px;
    background: rgba(20, 28, 46, 0.94);
    color: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: popupIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: grab;
    user-select: none;
}
.weather-popup:active { cursor: grabbing; }
.weather-popup.is-dragging { transition: none; }
@keyframes popupIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.weather-popup__row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.weather-popup__icon { width: 44px; height: 44px; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4)); }
.weather-popup__body { flex: 1; min-width: 0; }
.weather-popup__city {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.weather-popup__temp {
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
}
.weather-popup__cond {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.weather-popup__close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s;
}
.weather-popup__close:hover { background: rgba(239, 68, 68, 0.7); }
.weather-popup__link {
    display: block;
    margin-top: 8px;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.weather-popup__link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
@media (max-width: 640px) {
    .weather-popup { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

/* ===== SEO content section ===== */
.weather-seo {
    padding: 32px 32px 16px;
    color: var(--w-text-dim);
    line-height: 1.65;
}
.weather-seo h2 {
    font-size: 1.15rem;
    color: var(--w-text);
    margin: 24px 0 10px;
    font-weight: 600;
}
.weather-seo h2:first-child { margin-top: 0; }
.weather-seo p { margin: 0 0 12px; }
.weather-seo ul { padding-left: 22px; margin: 0 0 16px; }
.weather-seo li { margin-bottom: 6px; }
@media (max-width: 780px) {
    .weather-seo { padding: 20px 16px 8px; }
}

/* ===== Toast ===== */
.weather-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
.weather-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ===== Responsive ===== */
@media (max-width: 780px) {
    .weather-app { border-radius: 16px; padding-top: 16px; }
    .weather-hero { padding: 20px 16px 12px; }
    .weather-main, .weather-section-head, .weather-hourly, .weather-daily, .weather-favs { padding-left: 16px; padding-right: 16px; }
    .weather-card { padding: 20px; grid-template-columns: 1fr; grid-template-areas: "identity" "actions" "hero" "scene" "details"; }
    .weather-card__actions { justify-content: flex-start; }
    .weather-card__hero { grid-template-columns: 1fr; text-align: center; }
    .weather-card__icon { margin: 0 auto; width: 108px; height: 108px; }
    .weather-day { grid-template-columns: 80px 36px 1fr; gap: 10px; }
    .weather-day__range { grid-column: 1 / -1; justify-content: space-between; min-width: 0; }
    .weather-day__cond { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .weather-bg-tint, .weather-fav, .weather-hour, .weather-detail, .weather-card,
    .weather-card__btn, .weather-search__geo, .weather-uv-cursor, .weather-day,
    .header-weather-pill { transition: none; }
    .skel { animation: none; }
    .weather-card { animation: none; }
    .weather-bg { display: none; }
}
