/* ══════════════════════════════════════════════════════════════
   Weather page — Eh design system (token-based)
   Atmospheric hero personality + page chrome.
   Brand tokens come from ehlocal.css; atmospheric/condition palettes
   stay page-local here per skill §21.6 (page personality, not brand).
   ══════════════════════════════════════════════════════════════ */

/* Page rail: weather is a dashboard surface, not a full-bleed landing page. */
.wx-page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px 30px;
}
.wx-page > .wx-band > .container,
.wx-page > .wx-current-stack > .wx-band > .container,
.wx-page > .hourly-section > .container,
.wx-page > .wx-section > .container,
.wx-page > .forecast-section > .container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.wx-current-stack {
    margin: 0 0 16px;
    border-radius: 28px;
    overflow: hidden;
}

/* ── Atmospheric hero (proto-grounded rescue pass) ──
   CSS owns the per-bucket palette. Python/JS only change data-time and the
   sun geometry, which prevents the previous Python/JS palette drift. */
.wx-hero {
    --wx-sky-top: #9DC4E8;
    --wx-sky-bot: #DCE8F0;
    --wx-mount-back: #B5C3CF;
    --wx-mount-front: #7B858C;
    --wx-sun-core: #FFD466;
    --wx-sun-halo: rgba(255, 212, 102, 0.28);
    --wx-cloud: rgba(255, 255, 255, 0.54);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 28px;
    margin: 0 0 16px;
    height: 390px;
    min-height: 390px;
    color: #fff;
    background: linear-gradient(180deg, var(--wx-sky-top, #FFD8B5) 0%, var(--wx-sky-bot, #9C5A2E) 100%);
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}
.wx-current-stack > .wx-hero {
    border-radius: 28px 28px 0 0;
    margin-bottom: 0;
    box-shadow: none;
}
.wx-hero[data-time="day"] {
    --wx-sky-top: #9DC4E8;
    --wx-sky-bot: #DCE8F0;
    --wx-mount-back: #B5C3CF;
    --wx-mount-front: #7B858C;
    --wx-sun-core: #FFD466;
    --wx-sun-halo: rgba(255, 212, 102, 0.28);
    --wx-cloud: rgba(255, 255, 255, 0.58);
}
.wx-hero[data-time="dawn"] {
    --wx-sky-top: #F2B6A8;
    --wx-sky-bot: #D99568;
    --wx-mount-back: #D1A181;
    --wx-mount-front: #8F644B;
    --wx-sun-core: #FFE08A;
    --wx-sun-halo: rgba(255, 216, 120, 0.34);
    --wx-cloud: rgba(255, 242, 222, 0.56);
}
.wx-hero[data-time="dusk"] {
    --wx-sky-top: #FF8A4C;
    --wx-sky-bot: #5C2A4D;
    --wx-mount-back: #8F5A58;
    --wx-mount-front: #4D2A3D;
    --wx-sun-core: #FFC45D;
    --wx-sun-halo: rgba(255, 196, 93, 0.28);
    --wx-cloud: rgba(255, 221, 196, 0.36);
}
.wx-hero[data-time="night"] {
    --wx-sky-top: #0B0B22;
    --wx-sky-bot: #000010;
    --wx-mount-back: #17203A;
    --wx-mount-front: #070A18;
    --wx-sun-core: #F2EAD0;
    --wx-sun-halo: rgba(242, 234, 208, 0.2);
    --wx-cloud: rgba(180, 200, 240, 0.2);
}
.wx-hero[data-city="nanaimo"][data-time="day"] {
    --wx-mount-back: #B8C5D1;
    --wx-mount-front: #828B91;
}
.wx-hero[data-city="pqb"][data-time="day"] {
    --wx-mount-back: #B4C5D1;
    --wx-mount-front: #748088;
}
.wx-hero[data-city="summerland"][data-time="day"] {
    --wx-mount-back: #B9C4B4;
    --wx-mount-front: #7F8978;
}

.wx-hero__sky {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.wx-hero__star {
    fill: #fff;
    opacity: 0.82;
}
.wx-hero__clouds {
    opacity: 0.22;
}
.wx-hero[data-condition="rain"] .wx-hero__clouds,
.wx-hero[data-condition="snow"] .wx-hero__clouds,
.wx-hero[data-condition="storm"] .wx-hero__clouds {
    opacity: 0.44;
}
.wx-hero__cloud {
    fill: var(--wx-cloud);
}
.wx-hero__mount {
    shape-rendering: geometricPrecision;
    stroke: none;
}
.wx-hero__mount--back { fill: var(--wx-mount-back); opacity: 0.9; }
.wx-hero__mount--front { fill: var(--wx-mount-front); opacity: 0.92; }
.wx-hero__sun-halo {
    fill: var(--wx-sun-halo);
}
.wx-hero__sun-core {
    fill: var(--wx-sun-core);
}
.wx-hero__moon-core {
    fill: rgba(245, 240, 225, 0.95);
}
.wx-hero__moon-cut {
    fill: var(--wx-sky-top);
}
.wx-hero[data-time="day"] .wx-hero__moon,
.wx-hero[data-time="dawn"] .wx-hero__moon,
.wx-hero[data-time="dusk"] .wx-hero__moon { display: none; }
.wx-hero[data-time="night"] .wx-hero__sun { display: none; }

/* Optional precipitation overlay (rain/snow/storm). Reduced-motion guard at file bottom. */
.wx-hero__precip {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.55;
}
.wx-hero__precip--rain {
    background:
        repeating-linear-gradient(
            12deg,
            transparent 0 6px,
            rgba(255,255,255,0.55) 6px 7px,
            transparent 7px 14px
        );
    animation: wx-rain-drift 0.9s linear infinite;
}
.wx-hero__precip--snow {
    background:
        radial-gradient(circle at 12% 18%, rgba(255,255,255,0.85) 1.2px, transparent 2px) 0 0/40px 60px,
        radial-gradient(circle at 78% 62%, rgba(255,255,255,0.7) 1.4px, transparent 2px) 0 0/55px 80px;
    animation: wx-snow-drift 14s linear infinite;
}
.wx-hero__precip--storm {
    background: rgba(255,255,255,0);
    animation: wx-storm-flash 7s steps(1) infinite;
}

.wx-hero .container {
    position: relative;
    z-index: 3;
    height: 100%;
    min-height: 390px;
    display: flex;
    flex-direction: column;
    padding: 26px 32px;
}

.wx-hero__overlay {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    height: 100%;
    flex: 1;
}

.wx-hero__eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    line-height: 1.1;
    opacity: 0.92;
    margin-bottom: 0.25rem;
    color: rgba(255,255,255,0.86);
    text-shadow: 0 1px 10px rgba(0,0,0,0.16);
}

.wx-hero__body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    width: 100%;
    margin-top: auto;
}
.wx-hero__primary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 62%;
    min-width: 0;
}
.wx-hero__temp {
    font-family: var(--font-display);
    font-size: 280px;
    font-weight: 900;
    line-height: 0.82;
    letter-spacing: 0;
    margin: 0;
    color: #fff;
    text-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.wx-hero__temp sup {
    font-size: 0.2em;
    font-weight: 700;
    vertical-align: top;
    margin-left: 0.16em;
    letter-spacing: 0;
    opacity: 0.85;
}

.wx-hero__caption {
    margin-top: 0;
}
.wx-hero__summary {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    text-wrap: balance;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0,0,0,0.2);
}
.wx-hero__feels {
    font-size: 14px;
    font-weight: 500;
    margin-top: 6px;
    color: rgba(255,255,255,0.86);
    text-shadow: 0 1px 10px rgba(0,0,0,0.18);
}

.wx-hero__sunarc {
    position: absolute;
    right: 28px;
    bottom: 26px;
    width: 320px;
    max-width: 34%;
    padding: 12px 0 0;
}
.wx-hero__sunarc svg {
    width: 100%;
    height: 100px;
    display: block;
}
.wx-hero__sunarc-path {
    stroke: rgba(255,255,255,0.7);
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-dasharray: 4 4;
}
.wx-hero__sunarc-base {
    stroke: rgba(255,255,255,0.45);
    stroke-width: 1;
}
.wx-hero__sunarc-dot {
    fill: #FFD466;
    stroke: #fff;
    stroke-width: 1.5;
}
.wx-hero__sunarc-label {
    fill: rgba(255,255,255,0.86);
    font: 700 10px/1 var(--font-body, system-ui, sans-serif);
}
.wx-hero__sunarc-label--mid {
    text-anchor: middle;
    font-size: 9px;
    font-weight: 600;
}
.wx-hero__sunarc-label--end { text-anchor: end; }

/* Live badge — shared primitive used elsewhere on site (news/home).
   Wx-hero variant uses an explicit child <span class="wx-hero__live-dot">
   (recipe R1.4) so the dot is a real DOM node we can target precisely. */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--red);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    animation: pulse-live 2s ease infinite;
}
.live-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* Wx-hero LIVE pill — explicit dot child, isolated keyframe (recipe R1.4). */
.wx-hero__live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    background: var(--red);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font: 700 10px/1 var(--font-mono, ui-monospace, "SF Mono", monospace);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.wx-hero__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: wx-pulse 1.5s ease-in-out infinite;
}
@keyframes wx-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

@keyframes wx-rain-drift {
    from { background-position: 0 0; }
    to   { background-position: 0 28px; }
}
@keyframes wx-snow-drift {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 60px 120px, -55px 160px; }
}
@keyframes wx-storm-flash {
    0%, 92%   { background: rgba(255,255,255,0); }
    93%, 95%  { background: rgba(255,255,255,0.45); }
    96%, 100% { background: rgba(255,255,255,0); }
}

@media (max-width: 1080px) {
    .wx-hero__temp { font-size: 210px; }
    .wx-hero__primary { max-width: 68%; }
    .wx-hero__sunarc { width: 280px; max-width: 36%; }
}

/* ≤768px: keep current condition first, then tuck the arc under it. */
@media (max-width: 768px) {
    .wx-page { padding: 14px 16px 24px; }
    .wx-hero {
        height: 340px;
        min-height: 340px;
        border-radius: 22px;
    }
    .wx-hero .container {
        min-height: 340px;
        padding: 20px 22px;
    }
    .wx-hero__body { align-items: flex-start; }
    .wx-hero__primary { max-width: 100%; }
    .wx-hero__temp { font-size: 140px; }
    .wx-hero__summary { font-size: 24px; }
    .wx-hero__sunarc {
        position: relative;
        right: auto;
        bottom: auto;
        width: 260px;
        max-width: 100%;
        margin-top: 8px;
    }
}
@media (max-width: 640px) {
    .wx-page { padding: 12px 14px 22px; }
    .wx-hero {
        height: 306px;
        min-height: 306px;
        margin: 0 0 14px;
        border-radius: 18px;
    }
    .wx-hero .container {
        height: 306px;
        min-height: 306px;
        padding: 18px 20px 16px;
    }
    .wx-hero__body { gap: 10px; }
    .wx-hero__temp { font-size: 88px; }
    .wx-hero__summary { font-size: 18px; }
    .wx-hero__feels { font-size: 11px; }
    .wx-hero__sunarc {
        width: 230px;
        margin-top: 4px;
    }
}

/* Reduced-motion: disable all hero motion */
@media (prefers-reduced-motion: reduce) {
    .wx-hero__precip,
    .live-badge,
    .live-badge::before,
    .wx-hero__live,
    .wx-hero__live-dot {
        animation: none !important;
    }
}

/* ── Stat band (proto compact single-row desktop, mobile collapse) ──
   The band is one rounded card with a hairline grid drawn via 1px gaps that
   show the parent's hairline color through. Each tile shows a tiny uppercase
   label, a huge Druk value, and a small sub. AQI keeps its pink-tint static
   treatment with an inline DAILY tag. */
.wx-band {
    --wx-band-cols: 7;
    margin: 0 0 16px;
}
.wx-current-stack > .wx-band {
    margin: 0;
}
.wx-band--7 { --wx-band-cols: 7; }
.wx-band--6 { --wx-band-cols: 6; }
.wx-band--5 { --wx-band-cols: 5; }
.wx-band__grid {
    display: grid;
    grid-template-columns: repeat(var(--wx-band-cols), minmax(0, 1fr));
    gap: 1px;
    background: #E3DED6;
    border: 1px solid #D8D2CA;
    border-radius: 22px;
    overflow: hidden;
}
.wx-current-stack .wx-band__grid {
    border-top: 1px solid #D8D2CA;
    border-right: 1px solid #D8D2CA;
    border-bottom: 1px solid #D8D2CA;
    border-left: 1px solid #D8D2CA;
    border-radius: 0 0 28px 28px;
}

.wx-band__tile {
    min-width: 0;
    background: #FFFFFF;
    padding: 10px 13px 9px;
    min-height: 82px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: background 0.15s ease;
}
.wx-band__tile.is-static {
    background: #FFF5F5;
}
[data-theme="dark"] .wx-band__tile.is-static {
    background: rgba(220, 38, 38, 0.08);
    color: #fff;
}

.wx-band__head {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    min-width: 0;
}
.wx-band__label {
    font: 800 0.68rem/1 var(--font-mono, ui-monospace, "SF Mono", monospace);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    overflow-wrap: anywhere;
}
.wx-band__tag {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--red);
    background: color-mix(in srgb, var(--red) 10%, transparent);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
}
.wx-band__static-tag {
    font: 800 9px/1 var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace);
    color: rgba(220, 38, 38, 0.92);
    background: rgba(220, 38, 38, 0.12);
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0.08em;
    margin-left: auto;
    text-transform: uppercase;
    align-self: center;
}
[data-theme="dark"] .wx-band__static-tag {
    color: #ff8a8a;
    background: rgba(220, 38, 38, 0.18);
}
.wx-band__arrow {
    display: inline-block;
    margin-right: 4px;
    vertical-align: -1px;
    color: currentColor;
}

.wx-band__value {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    line-height: 0.95;
    min-width: 0;
}
.wx-band__num {
    font-family: var(--font-display);
    font-size: clamp(2rem, 2.65vw, 2.65rem);
    font-weight: 900;
    color: var(--text);
    letter-spacing: 0;
    line-height: 0.9;
}
.wx-band__unit {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0;
    text-transform: lowercase;
}
.wx-band__sub {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.22;
    margin-top: auto;
}

/* Tone variants for tiles whose values carry meaning — UV, AQI. */
.wx-band__tile--good .wx-band__num   { color: var(--good, #2EA043); }
.wx-band__tile--mid  .wx-band__num   { color: var(--mid, #C58B00); }
.wx-band__tile--bad  .wx-band__num   { color: var(--red); }
.wx-band__tile--good .wx-band__sub   { color: color-mix(in srgb, var(--good, #2EA043) 80%, var(--muted)); }
.wx-band__tile--mid  .wx-band__sub   { color: color-mix(in srgb, var(--mid, #C58B00) 80%, var(--muted)); }
.wx-band__tile--bad  .wx-band__sub   { color: color-mix(in srgb, var(--red) 80%, var(--muted)); }

html[data-theme="dark"] .wx-band__grid {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.14);
}
html[data-theme="dark"] .wx-band__tile {
    background: rgba(255,255,255,0.045);
}

/* Responsive collapse: desktop/tablet tries one row; phones compress into
   balanced multi-column grids instead of a tall two-up stack. */
@media (max-width: 860px) {
    .wx-band__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        border-radius: 18px;
    }
    .wx-current-stack {
        border-radius: 22px;
    }
    .wx-current-stack > .wx-hero {
        border-radius: 22px 22px 0 0;
    }
    .wx-current-stack .wx-band__grid {
        border-radius: 0 0 22px 22px;
    }
    .wx-band--7 .wx-band__tile:nth-child(5),
    .wx-band--6 .wx-band__tile:nth-child(5),
    .wx-band--6 .wx-band__tile:nth-child(6),
    .wx-band--5 .wx-band__tile:nth-child(5) {
        grid-column: span 2;
    }
}
@media (max-width: 520px) {
    .wx-band__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        border-radius: 18px;
    }
    .wx-current-stack {
        border-radius: 18px;
        margin-bottom: 12px;
    }
    .wx-current-stack > .wx-hero {
        border-radius: 18px 18px 0 0;
    }
    .wx-current-stack .wx-band__grid {
        border-radius: 0 0 18px 18px;
    }
    .wx-band__tile {
        padding: 8px 7px 7px;
        min-height: 58px;
        gap: 3px;
    }
    .wx-band__head { gap: 0.25rem; }
    .wx-band__label {
        font-size: 0.48rem;
        line-height: 1.05;
        letter-spacing: 0.07em;
    }
    .wx-band__static-tag { font-size: 7px; padding: 2px 3px; letter-spacing: 0.04em; }
    .wx-band__num { font-size: 1.45rem; }
    .wx-band__unit { font-size: 0.58rem; }
    .wx-band__sub { display: none; }
}
@media (max-width: 640px) and (min-width: 521px) {
    .wx-current-stack {
        border-radius: 18px;
        margin-bottom: 12px;
    }
    .wx-current-stack > .wx-hero {
        border-radius: 18px 18px 0 0;
    }
    .wx-current-stack .wx-band__grid {
        border-radius: 0 0 18px 18px;
    }
}
@media (max-width: 350px) {
    .wx-band__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .wx-band--7 .wx-band__tile:nth-child(5),
    .wx-band--6 .wx-band__tile:nth-child(5),
    .wx-band--6 .wx-band__tile:nth-child(6),
    .wx-band--5 .wx-band__tile:nth-child(5) {
        grid-column: auto;
    }
    .wx-band--7 .wx-band__tile:nth-child(7),
    .wx-band--5 .wx-band__tile:nth-child(4),
    .wx-band--5 .wx-band__tile:nth-child(5) {
        grid-column: span 3;
    }
}

/* ── Hourly forecast — white, legible scrubber with a red active card ── */
.hourly-section {
    padding: 12px 0 14px;
    border: 0;
    overflow: hidden;
}
.hourly-section__header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 0 8px;
}
.hourly-section__title,
.wx-section__title {
    font-family: var(--font-display);
    font-size: clamp(1.32rem, 1.85vw, 1.68rem);
    font-weight: 900;
    line-height: 0.98;
    color: var(--red);
    margin: 0;
    letter-spacing: 0;
    text-transform: uppercase;
}
.hourly-section__hint {
    font: 600 0.84rem/1.2 var(--font-body, system-ui);
    color: var(--muted);
    margin-left: auto;
}

/* Hourly panel — rounded white card containing the curve + cells. */
.hourly-panel {
    background: #FFFFFF;
    border: 1px solid #E4E0D8;
    border-radius: 22px;
    padding: 9px 10px 3px;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
[data-theme="dark"] .hourly-panel {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255,255,255,0.12);
}

.hourly-scroll {
    position: relative;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    max-width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--muted) transparent;
    padding: 50px 0 0.12rem;
}
.hourly-scroll::-webkit-scrollbar { height: 4px; }
.hourly-scroll::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: var(--radius-sm);
}

/* Temperature curve SVG sits above the cells inside the rounded panel. */
.hourly-curve {
    position: absolute;
    top: 9px;
    left: 0;
    width: 100%;
    min-width: max-content;
    height: 40px;
    pointer-events: none;
    z-index: 1;
}
.hourly-curve__area {
    fill: rgba(220, 38, 38, 0.08);
    stroke: none;
}
.hourly-curve__line {
    fill: none;
    stroke: var(--red);
    stroke-width: 1.5;
}
.hourly-curve__marker { transition: cx 0.15s ease, cy 0.15s ease; }
@media (prefers-reduced-motion: reduce) {
    .hourly-curve__marker { transition: none; }
    .hourly-scroll { scroll-behavior: auto; }
}

.hourly-item {
    flex: 1 0 auto;
    min-width: 54px;
    width: calc((100% - 23 * 5px) / 24);   /* 24 cells fit at desktop */
    text-align: center;
    padding: 7px 4px 5px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    position: relative;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.18rem;
    z-index: 2;
    transition: background 0.15s, color 0.15s;
}
.hourly-item:hover { background: rgba(0,0,0,0.035); }
[data-theme="dark"] .hourly-item:hover { background: rgba(255,255,255,0.05); }
.hourly-item:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: -2px;
}

/* `--now` = the real current hour (immutable). The active card outline, not a
   vertical rail, carries the current scrubber focus in the proto. */
.hourly-item--now::before {
    content: none;
}
.hourly-item--now .hourly-item__time,
.hourly-item--now .hourly-item__temp {
    color: var(--red);
}

/* `--selected` is the scrubber's active cell — red outline on white. */
.hourly-item--selected {
    background: #fff;
    border-color: var(--red);
    box-shadow: 0 7px 18px rgba(220,38,38,0.16);
}
.hourly-item--selected .hourly-item__time,
.hourly-item--selected .hourly-item__temp {
    color: var(--red);
}
[data-theme="dark"] .hourly-item--selected {
    background: rgba(255, 255, 255, 0.08);
}

.hourly-item__time {
    font: 800 0.8rem/1 var(--font-body, system-ui, sans-serif);
    color: var(--muted);
    text-transform: lowercase;
    letter-spacing: 0;
}
.hourly-item__icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.hourly-item__icon img { width: 100%; height: 100%; display: block; }
.hourly-item__temp {
    font-family: var(--font-display);
    font-size: 1.42rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 0;
    line-height: 0.92;
    margin-top: -0.12rem;
}
.hourly-item__precip {
    min-height: 13px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--tide-blue, #207BF1);
    margin-top: -0.24rem;
    line-height: 1;
}
.uv-badge { font-weight: 700; }

/* ── Forecast section ── */
/* Compact dashboard sections: module cards provide enough visual grouping, so
   weather sections avoid divider rules and keep title chrome short. */
.wx-section,
.forecast-section {
    padding: 14px 0;
    border-bottom: 0;
    overflow: hidden;
}
.wx-section:last-child { border-bottom: none; }
/* Adjacent-section pair collapse keeps consecutive modules from doubling gaps. */
.wx-section + .wx-section,
.wx-section + .hourly-section,
.hourly-section + .wx-section,
.wx-section + .forecast-section,
.forecast-section + .wx-section {
    padding-top: 10px;
}
.wx-section__title { margin: 0 0 8px; }
.wx-section__header {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.wx-section__header .wx-section__title { margin-bottom: 0; }
.wx-section__header + .wx-section__subtitle { margin-top: -0.45rem; }
.wx-section__updated {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 400;
    white-space: nowrap;
}

/* Forecast cards grid (iter-4 — DAY+DATE pair, druk high temp) */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.forecast-card {
    appearance: none;
    -webkit-appearance: none;
    background: #F7F7F6;
    color: inherit;
    font: inherit;
    width: 100%;
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 12px 14px 11px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.forecast-card:hover {
    background: #FFFFFF;
    border-color: #DDD8D1;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.forecast-card:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}
.forecast-card--today,
.forecast-card.is-open {
    background: #FFFFFF;
    border-color: var(--red);
    box-shadow: 0 4px 14px rgba(220,38,38,0.08);
}
html[data-theme="dark"] .forecast-card {
    background: rgba(255,255,255,0.045);
    border-color: transparent;
}
html[data-theme="dark"] .forecast-card:hover,
html[data-theme="dark"] .forecast-card--today,
html[data-theme="dark"] .forecast-card.is-open {
    background: rgba(255,255,255,0.075);
    border-color: var(--red);
}
.forecast-card__head {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    line-height: 1;
    padding-top: 2px;
}
.forecast-card__day {
    font-family: var(--font-display);
    font-size: 1.24rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--red);
}
.forecast-card__date {
    font: 800 0.68rem/1 var(--font-mono, ui-monospace, "SF Mono", monospace);
    letter-spacing: 0.08em;
    color: var(--muted);
    text-transform: uppercase;
}
.forecast-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.1rem 0;
}
.forecast-card__icon img { width: 100%; height: 100%; display: block; }
.forecast-card__temps {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    line-height: 1;
}
.forecast-card__high {
    font-family: var(--font-display);
    font-size: 1.82rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 0;
}
.forecast-card--today .forecast-card__high,
.forecast-card.is-open .forecast-card__high { color: var(--red); }
.forecast-card__low {
    font-size: 1rem;
    font-weight: 800;
    color: var(--muted);
}
.forecast-card__desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.3;
    text-wrap: balance;
}
.forecast-card__precip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.82rem;
    color: var(--tide-blue, #207BF1);
    font-weight: 600;
    margin-top: -0.15rem;
}

/* ── 5-Day expand-on-click detail panel (R4.1) ──
   The detail-host sits below the card row. Exactly one .forecast-detail
   is visible at a time (tracked via [hidden] + section[data-open-idx]).
   The visual is a subtle-bg panel with three label/value pairs. */
.forecast-detail-host {
    margin-top: 10px;
}
.forecast-detail {
    padding: 14px 16px;
    background: #FFFFFF;
    border: 1px solid #E1DDD7;
    border-radius: 14px;
}
.forecast-detail[hidden] { display: none; }
.forecast-detail__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 24px;
}
.forecast-detail__cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.forecast-detail__label {
    font: 800 11px/1.2 var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.forecast-detail__val {
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--text);
}
[data-theme="dark"] .forecast-detail,
.theme-dark .forecast-detail {
    background: rgba(255, 255, 255, 0.04);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .forecast-detail {
        background: rgba(255, 255, 255, 0.04);
    }
}
@media (max-width: 640px) {
    .forecast-detail__grid {
        grid-template-columns: 1fr 1fr;
    }
    .forecast-detail__cell:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1080px) {
    .forecast-grid { grid-template-columns: repeat(3, 1fr); }
    .forecast-card:nth-child(4) { grid-column: 1 / span 2; }
    .forecast-card:nth-child(5) { grid-column: 3; }
}
@media (max-width: 640px) {
    /* Wrap the scrollable forecast row so we can layer a fade mask on the
       trailing edge as a scroll affordance. */
    .forecast-grid {
        display: flex;
        gap: 0.45rem;
        overflow-x: auto;
        padding: 0 0 0.5rem;
        scrollbar-width: thin;
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
                mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    }
    .forecast-card {
        flex: 0 0 110px;
    }
    .forecast-card:nth-child(4),
    .forecast-card:nth-child(5) { grid-column: auto; }
}

/* ── Compact tide summary ── */
.tides-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--card-shadow);
}
.tides-summary__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.tides-summary__header .wx-section__title {
    margin: 0;
    padding: 0;
    border: none;
}
.tides-summary__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--red);
    text-decoration: none;
    white-space: nowrap;
}
.tides-summary__link:hover {
    text-decoration: underline;
}
.tides-summary__entries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.tides-summary__entry {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--text);
}
.tides-summary__entry--next {
    font-weight: 700;
}
.tides-summary__type {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.12rem 0.35rem;
    border-radius: var(--radius-sm);
    line-height: 1.4;
}
.tides-summary__entry--high .tides-summary__type {
    background-color: var(--surface-hover);
    color: var(--red);
}
.tides-summary__entry--low .tides-summary__type {
    background-color: var(--surface-hover);
    color: var(--muted);
}
.tides-summary__time {
    font-weight: 600;
    color: var(--text);
}
.tides-summary__height {
    font-size: 0.84rem;
    color: var(--muted);
}
.tides-summary__station {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0.75rem 0 0;
}

/* ── Alerts section ── */
.wx-alert {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}
.wx-alert--warning { border-left: 4px solid #e65100; }
.wx-alert--emergency { border-left: 4px solid var(--red); }
.wx-alert--watch { border-left: 4px solid #f9a825; }
.wx-alert--info, .wx-alert--advisory { border-left: 4px solid var(--muted); }
.wx-alert__headline {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin: 0 0 0.35rem;
}
.wx-alert__desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
.wx-clear {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ── Sun strip ── */
.sun-strip {
    display: flex;
    gap: 2rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
    box-shadow: var(--card-shadow);
}
.sun-strip__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sun-strip__icon { font-size: 1.5rem; }
.sun-strip__label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.sun-strip__time {
    font-family: var(--font-headline);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Beach Conditions (marine tile) ── */
.beach-hero {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.beach-hero__status {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--card-shadow);
}
.beach-hero__status--calm,
.beach-hero__status--gentle,
.beach-hero__status--moderate,
.beach-hero__status--choppy,
.beach-hero__status--rough {
    background: var(--surface);
    border-color: var(--border);
}
.beach-hero__icon {
    font-size: 2.15rem;
    line-height: 1;
    flex-shrink: 0;
}
.beach-hero__info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.beach-hero__label {
    font-family: var(--font-headline);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}
.beach-hero__desc {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.beach-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.beach-detail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.9rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}
.beach-detail__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.4rem;
}
.beach-detail__value {
    font-family: var(--font-headline);
    font-size: 1.32rem;
    font-weight: 700;
    color: var(--text);
}
.beach-detail__sub {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

/* Wave forecast bar chart */
.wave-forecast {
    margin-top: 1rem;
    overflow: hidden;
}
.wave-forecast__title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
}
.wave-scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--muted) transparent;
    padding-bottom: 0.25rem;
}
.wave-scroll::-webkit-scrollbar { height: 4px; }
.wave-scroll::-webkit-scrollbar-thumb { background: var(--muted); border-radius: var(--radius-sm); }
.wave-item {
    flex: 0 0 auto;
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0;
    border-right: 1px solid var(--border);
}
.wave-item:last-child { border-right: none; }
.wave-item__time {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: lowercase;
}
.wave-item__bar-wrap {
    width: 20px;
    height: 64px;                  /* R5.2 — was 48; bars were unreadable */
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.wave-item__bar {
    width: 100%;
    min-height: 8px;               /* R5.2 — avoid sub-pixel disappearance */
    border-radius: 3px 3px 0 0;
}
.wave-item--calm .wave-item__bar { background: #81c784; }
.wave-item--gentle .wave-item__bar { background: #64b5f6; }
.wave-item--moderate .wave-item__bar { background: #ffd54f; }
.wave-item--choppy .wave-item__bar { background: #ff8a65; }
.wave-item--rough .wave-item__bar { background: #e57373; }
.wave-item__height {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Events teaser ── */
.wx-section__link {
    position: relative;
    font-size: 0.88rem;
    color: var(--red);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.wx-section__link::before { content: ''; position: absolute; top: 50%; left: -0.5rem; right: -0.5rem; transform: translateY(-50%); min-height: 44px; }
.wx-section__link:hover { text-decoration: underline; }

.wx-events-teaser__list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.wx-events-teaser__item {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s;
}
.wx-events-teaser__item:first-child { border-top: 1px solid var(--border); }
.wx-events-teaser__item:hover { background-color: var(--surface-hover); }
.wx-events-teaser__time {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--red);
    min-width: 5rem;
    flex-shrink: 0;
}
.wx-events-teaser__title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}
.wx-events-teaser__location {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wx-events-teaser__more {
    display: inline-block;
    font-size: 0.88rem;
    color: var(--red);
    text-decoration: none;
    padding-top: 0.5rem;
}
.wx-events-teaser__more:hover { text-decoration: underline; }

/* ── Power Outages ── */
.outage-section--active { border-left: 4px solid #e65100; }
.outage-section__summary { font-size: 0.9rem; color: var(--red); font-weight: 600; margin: -0.25rem 0 1rem; }
.outage-list { display: flex; flex-direction: column; gap: 0.75rem; }
.outage-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    box-shadow: var(--card-shadow);
}
.outage-card__header { margin-bottom: 0.5rem; }
.outage-card__area {
    font-family: var(--font-headline);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}
.outage-card__details { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1rem; }
.outage-card__detail { display: flex; flex-direction: column; gap: 0.1rem; }
.outage-card__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.outage-card__value { font-size: 0.88rem; color: var(--text); }
.outage-section__source { font-size: 0.78rem; color: var(--muted); margin-top: 0.75rem; }
.outage-section__source a { color: var(--red); }
.outage-clear { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.outage-clear .wx-section__title { margin-bottom: 0; }
.outage-clear__status { font-size: 0.88rem; color: var(--text-secondary); font-weight: 500; }
.outage-clear__source { font-size: 0.78rem; color: var(--muted); }
.outage-clear__source a { color: var(--red); }

/* ── Ferry Status (tile pattern) ── */
.ferry-routes { display: flex; flex-direction: column; gap: 1rem; }
.ferry-route {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}
.ferry-route__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--surface-hover);
    border-bottom: 1px solid var(--border);
}
.ferry-route__name {
    font-family: var(--font-headline);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}
.ferry-route__duration { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.ferry-route__empty { padding: 0.75rem 1rem; font-size: 0.82rem; color: var(--muted); font-style: italic; }
.ferry-route__more { padding: 0.55rem 1rem; font-size: 0.8rem; color: var(--muted); background: var(--surface-hover); border-top: 1px solid var(--border); }
.ferry-sailings { display: flex; flex-direction: column; }
.ferry-sailing { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1rem; border-bottom: 1px solid var(--border); }
.ferry-sailing:last-child { border-bottom: none; }
.ferry-sailing--next { background: var(--surface-hover); }
.ferry-sailing__badge { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #fff; background: var(--red); padding: 0.2rem 0.45rem; border-radius: var(--radius-sm); flex-shrink: 0; }
.ferry-sailing__time { font-size: 0.82rem; font-weight: 700; color: var(--text); min-width: 5rem; flex-shrink: 0; }
.ferry-sailing__vessel { font-size: 0.8rem; color: var(--muted); min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ferry-sailing__fill-bar { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; min-width: 100px; }
.ferry-sailing__fill-track { flex: 1; height: 6px; background: var(--border); border-radius: var(--radius-sm); overflow: hidden; min-width: 60px; }
.ferry-sailing__fill-level { height: 100%; border-radius: var(--radius-sm); transition: width 0.3s ease; }
.ferry-sailing__fill-pct { font-size: 0.76rem; font-weight: 700; min-width: 2.5rem; text-align: right; }
.ferry-sailing--full .ferry-sailing__time { color: var(--red); }
.ferry-footer { text-align: center; margin-top: 0.75rem; font-size: 0.82rem; }
.ferry-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--red); text-decoration: none; font-weight: 600; }
.ferry-footer a:hover { text-decoration: underline; }
.wx-section__subtitle { font-size: 0.82rem; color: var(--muted); margin: -0.5rem 0 1rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .wx-hero__inner {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .wx-hero__details { grid-template-columns: repeat(2, 1fr); min-width: 0; }
    .wx-hero__glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .forecast-grid { grid-template-columns: repeat(3, 1fr); }
    .hourly-item { width: 66px; min-width: 56px; padding: 10px 8px; }
    .hourly-item__icon { font-size: 1.1rem; }
    .beach-details { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .wx-events-teaser__item {
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
    }
    .wx-events-teaser__time { min-width: auto; }
    .wx-events-teaser__location {
        width: 100%;
        padding-left: 0;
    }
    .ferry-route__header { padding: 0.6rem 0.75rem; }
    .ferry-route__name { font-size: 0.93rem; }
    .ferry-sailing { padding: 0.45rem 0.75rem; gap: 0.5rem; }
    .ferry-sailing__time { font-size: 0.93rem; min-width: 4.5rem; }
    .ferry-sailing__vessel { display: none; }
    .ferry-sailing__fill-bar { min-width: 80px; }
    .ferry-sailing__fill-track { min-width: 45px; }
    .ferry-route__more { padding: 0.5rem 0.75rem; }
    .ferry-sailing__badge { font-size: 0.93rem; }
    .ferry-sailing__fill-pct { font-size: 0.93rem; }
    .ferry-route__duration { font-size: 0.93rem; }
    .wx-section__updated { font-size: 0.93rem; }
    .wave-forecast__title { font-size: 0.93rem; }
    .beach-detail__sub { font-size: 0.93rem; }
    .outage-clear__source { font-size: 0.93rem; }
    .tides-summary__type { font-size: 0.93rem; }
    .tides-summary__station { font-size: 0.93rem; }
    .forecast-card__desc { font-size: 0.93rem; }
    .tides-entry { font-size: 0.93rem; }
    .tides-summary__amount { font-size: 0.93rem; }
    .tides-summary__height { font-size: 0.93rem; }
    .wx-alert__desc { font-size: 0.93rem; }
    .sun-strip__label { font-size: 0.93rem; }
    .wx-section__link { font-size: 0.93rem; }
    .wx-events-teaser__time { font-size: 0.93rem; }
    .wx-events-teaser__location { font-size: 0.93rem; }
    .wx-events-teaser__more { font-size: 0.93rem; }
    .outage-card__area { font-size: 0.93rem; }
    .outage-section__source { font-size: 0.93rem; }
    .outage-clear__status { font-size: 0.93rem; }
    .wx-section__subtitle { font-size: 0.93rem; }
    .ferry-route__empty { font-size: 0.93rem; }
    .ferry-route__more { font-size: 0.93rem; }
    .ferry-footer { font-size: 0.93rem; }
    .tides-summary__link { font-size: 0.93rem; }
}

@media (max-width: 480px) {
    /* Hero atmospheric responsive sizing handled in the hero block above. */
    .forecast-card__day,
    .forecast-card__precip { font-size: 0.78rem; }
    .forecast-grid { grid-template-columns: repeat(2, 1fr); }
    .forecast-card:nth-child(5) { grid-column: 1 / -1; }
    .forecast-grid { gap: 0.35rem; padding-bottom: 0.35rem; }
    .forecast-card {
        flex-basis: 104px;
        padding: 10px 10px 8px;
        border-radius: 12px;
        gap: 4px;
    }
    .forecast-card__head { gap: 2px; padding-top: 1px; }
    .forecast-card__day { font-size: 0.98rem; }
    .forecast-card__date { font-size: 0.54rem; }
    .forecast-card__icon { width: 38px; height: 38px; margin: 0; }
    .forecast-card__high { font-size: 1.48rem; }
    .forecast-card__low { font-size: 0.82rem; }
    .forecast-card__desc { font-size: 0.74rem; line-height: 1.15; }
    .hourly-scroll { padding: 50px 0.2rem 0.12rem; }
    .hourly-item { width: 70px; min-width: 58px; padding: 7px 7px 5px; }
    .hourly-item__time { font-size: 0.82rem; margin-bottom: 0.05rem; }
    .hourly-item__icon { width: 30px; height: 30px; margin-bottom: 0; }
    .hourly-item__temp { font-size: 1.24rem; margin-top: -0.1rem; }
    .hourly-item__feels,
    .hourly-item__precip { font-size: 0.93rem; }
    .tides-summary { padding: 1rem; }
    .tides-summary__header { flex-direction: column; gap: 0.25rem; }
    .tides-summary__entries { gap: 0.4rem 0.75rem; }
    .tides-summary__entry { font-size: 0.93rem; }
    .beach-hero__icon { font-size: 2rem; }
    .beach-hero__label { font-size: 1.15rem; }
    .beach-hero__desc { font-size: 0.93rem; }
    .beach-details { grid-template-columns: repeat(2, 1fr); }
    .beach-detail { padding: 1rem 0.75rem; }
    .beach-detail__label { font-size: 0.93rem; }
    .beach-detail__value { font-size: 1.25rem; }
    .wave-item { width: 64px; }
    .wave-item__time,
    .wave-item__height { font-size: 0.93rem; }

    /* ── Mobile compaction (recipe R5.3 / 4f scope) ──
       At ≤480px (which covers the 470 audit target), tighten the page so the
       overall column reads as compressed-but-readable rather than the desktop
       420/40/40 rhythm pulled onto a phone. Both `.wx-hero` and its inner
       `.container` carry a 420px min-height on desktop — must override BOTH
       or the inner stretches the outer back. */
    .wx-hero,
    .wx-hero .container {
        height: 292px;
        min-height: 292px;
    }
    .wx-hero .container { padding: 17px 19px 15px; }
    .wx-hero__eyebrow { font-size: 0.64rem; gap: 0.45rem; }
    .wx-hero__temp { font-size: 82px; }
    .wx-hero__sunarc { width: 218px; margin-top: 2px; }
    .wx-hero__sunarc svg { height: 86px; }
    /* Section padding 16/0 instead of 24/0 on mobile. Adjacent-pair collapse
       still applies via the desktop selector but the base value is tighter. */
    .wx-section,
    .hourly-section,
    .forecast-section {
        padding: 8px 0;
    }
    .wx-section + .wx-section,
    .wx-section + .hourly-section,
    .hourly-section + .wx-section,
    .wx-section + .forecast-section,
    .forecast-section + .wx-section {
        padding-top: 8px;              /* tighter still on mobile */
    }
    .wx-section__title,
    .hourly-section__title {
        font-size: 1.14rem;
    }
    .hourly-section__header,
    .wx-section__header {
        margin-bottom: 6px;
    }
    .hourly-section__hint {
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .outage-card__details { grid-template-columns: 1fr 1fr; gap: 0.35rem 0.75rem; }
    .outage-card__label { font-size: 0.93rem; }
    .outage-card__value { font-size: 0.93rem; }
    .outage-clear { gap: 0.4rem 0.75rem; }
}

/* ── Density plumbing (recipe R5.4 / 4f scope) ──
   No UI toggle yet; this block future-proofs the page for a per-user density
   preference. Activate by adding `dens-compact` to <body> (or any ancestor)
   — every selector below is scoped under `body.dens-compact`. The pairing
   `.wx-hero` + `.wx-hero .container` defeats the inner 420px floor that
   would otherwise stretch the hero back open. Tokens stay declarative; no
   JS, no markup change. */
body.dens-compact .wx-hero,
body.dens-compact .wx-hero .container {
    min-height: 320px;
}
body.dens-compact .wx-hero__temp {
    font-size: 112px;
}
body.dens-compact .hourly-item {
    min-width: 48px;
}
body.dens-compact .wx-band__tile {
    padding: 10px 12px;
    min-height: 76px;
}
