.weather-scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    mask-image: linear-gradient(#000 12%, rgb(0 0 0 / 60%) 42%, transparent 92%);
}

.weather-image,
.weather-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.weather-video {
    opacity: 0;
}

.weather-video.is-playing {
    opacity: 1;
}

/* Desktop sunshine uses continuous compositor motion instead of held WebP frames. */
@media (min-width: 768px) and (pointer: fine) {
    [data-weather="sun"] .weather-image {
        animation: weather-sun-drift 18s ease-in-out infinite alternate;
        animation-play-state: paused;
    }

    [data-weather="sun"] .weather-scene::after {
        content: "";
        position: absolute;
        inset: -5%;
        pointer-events: none;
        background: radial-gradient(ellipse at 88% 12%, rgb(255 245 212 / 24%), transparent 50%);
        animation: weather-sun-light 9s ease-in-out infinite alternate;
        animation-play-state: paused;
    }

    [data-weather-playback="sun-motion"] .weather-image,
    [data-weather-playback="sun-motion"] .weather-scene::after {
        animation-play-state: running;
    }
}

@keyframes weather-sun-drift {
    from { transform: translate3d(-1.5%, -0.4%, 0) scale(1.07); }
    to { transform: translate3d(1.5%, 0.4%, 0) scale(1.07); }
}

@keyframes weather-sun-light {
    from { opacity: 0.3; transform: translate3d(-1%, 0, 0); }
    to { opacity: 0.85; transform: translate3d(1%, 0.5%, 0); }
}

.weather-particles {
    position: absolute;
    inset: 0;
}

.weather-particles i {
    position: absolute;
    top: 0;
    left: var(--left);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 3px #728cb7;
    opacity: 0;
    animation: weather-flurry var(--duration) linear var(--delay) infinite;
}

.weather-particles.is-paused i {
    animation-play-state: paused;
}

.weather-bar {
    position: relative;
    display: flex;
    flex: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px 0;
}

.chat-stage .weather-bar:not([hidden]) + .chat-messages {
    padding-top: 8px;
}

.weather-bar[hidden] {
    display: none;
}

.weather-summary {
    margin: 0;
    padding: 5px 10px;
    border: 1px solid rgb(121 166 202 / 25%);
    border-radius: 999px;
    background: rgb(251 253 255 / 74%);
    color: #2a4b65;
    font-size: 0.76rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

@keyframes weather-flurry {
    0% { opacity: 0; transform: translate(8px, -4vh); }
    20%, 72% { opacity: 0.9; }
    58% { transform: translate(27px, 35vh); }
    100% { opacity: 0; transform: translate(3px, 68vh); }
}

@media (prefers-reduced-motion: reduce) {
    .weather-particles { display: none !important; }
    [data-weather="sun"] .weather-image,
    [data-weather="sun"] .weather-scene::after { animation: none !important; }
}

[data-weather] .message.assistant .message-content > :is(p, .streaming-text) {
    background: linear-gradient(180deg, rgb(251 253 255 / 84%), rgb(251 253 255 / 48%) 220px, rgb(251 253 255 / 34%) 410px);
}
