    *, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

    :root {
        --bg-1: #DCEEFA;
        --bg-2: #EEF6FB;
        --surface: #FFFFFF;
        --surface-alt: #F2F8FC;
        --text: #12293D;
        --muted: #5E7C90;
        --border: #CDE3EF;
        --accent: #0E8FBF;
        --accent-soft: #DFF3FA;
        --warn: #E8873A;
        --warn-soft: #FDEAD8;
        --danger: #E14F4F;
        --shadow-hero: 0 18px 40px -18px rgba(14, 60, 90, .35);
        --shadow-soft: 0 2px 10px rgba(20, 50, 70, .06);
        --nav-bg: rgba(255, 255, 255, .78);
        --glass-bg: rgba(255, 255, 255, .7);
    }

    body.dark-mode {
        --bg-1: #061019;
        --bg-2: #0A1826;
        --surface: #102337;
        --surface-alt: #0C1D2E;
        --text: #E9F3FA;
        --muted: #85A2B6;
        --border: #1E3A50;
        --accent: #57D5F2;
        --accent-soft: #123246;
        --warn: #FFB067;
        --warn-soft: #3A2A17;
        --danger: #FF7A7A;
        --shadow-hero: 0 18px 44px -16px rgba(0, 0, 0, .55);
        --shadow-soft: 0 2px 12px rgba(0, 0, 0, .35);
        --nav-bg: rgba(10, 22, 35, .78);
        --glass-bg: rgba(12, 26, 41, .72);
    }

    html { -webkit-text-size-adjust: 100%; }

    body {
        margin: 0;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
        color: var(--text);
        background:
            radial-gradient(120% 60% at 15% -10%, var(--bg-1), transparent 60%),
            radial-gradient(140% 70% at 110% 0%, var(--bg-1), transparent 55%),
            var(--bg-2);
        background-attachment: fixed;
        min-height: 100vh;
        transition: background-color .3s, color .3s;
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    h1, h2, h3, .display {
        font-family: 'Space Grotesk', 'Inter', sans-serif;
        margin: 0;
    }

    a { color: inherit; }

    .container { max-width: 480px; margin: 0 auto; padding: 0 1rem; }
    @media (min-width: 640px) { .container { max-width: 560px; } }

    /* ---------- Header ---------- */
    header.topbar {
        position: sticky; top: 0; z-index: 40;
        backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        background: var(--glass-bg);
        border-bottom: 1px solid var(--border);
        padding: .6rem 1rem calc(.6rem + env(safe-area-inset-top)) 1rem;
        padding-top: max(.6rem, env(safe-area-inset-top));
    }
    .topbar-inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: .6rem; }
    @media (min-width: 640px) { .topbar-inner { max-width: 560px; } }

    .brand { display: flex; align-items: center; gap: .55rem; flex: 1; min-width: 0; }
    .brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
                 box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent-soft); flex-shrink: 0; }
    .brand-name { font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap;
                  overflow: hidden; text-overflow: ellipsis; }

    .icon-btn {
        display: inline-flex; align-items: center; justify-content: center;
        width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
        background: var(--surface-alt); color: var(--text); flex-shrink: 0;
        transition: background .15s, transform .1s;
    }
    .icon-btn:active { transform: scale(.92); }
    .icon-btn svg { width: 19px; height: 19px; }
    .icon-btn.accent { background: var(--accent); color: #fff; }
    .lang-btn { text-decoration: none; font-size: .74rem; font-weight: 700; letter-spacing: .02em; list-style: none; user-select: none; }
    .lang-menu { position: relative; flex-shrink: 0; }
    .lang-menu > summary::-webkit-details-marker { display: none; }
    .lang-list { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 70; margin: 0; padding: .3rem; list-style: none;
                 min-width: 8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-hero); }
    .lang-list a { display: block; padding: .5rem .8rem; border-radius: 10px; text-decoration: none; font-size: .88rem; font-weight: 600; }
    .lang-list a:hover, .lang-list a[aria-current] { background: var(--accent-soft); color: var(--accent); }

    /* ---------- Search pill ---------- */
    .search-wrap { padding: .85rem 0 0; }
    form.search-pill {
        display: flex; align-items: center; gap: .5rem;
        background: var(--surface); border: 1px solid var(--border);
        border-radius: 999px; padding: .35rem .35rem .35rem 1rem;
        box-shadow: var(--shadow-soft);
    }
    form.search-pill svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
    form.search-pill input {
        flex: 1; min-width: 0; border: none; outline: none; background: none;
        color: var(--text); font-size: .98rem; font-family: inherit; padding: .5rem 0;
    }
    form.search-pill input::placeholder { color: var(--muted); }
    .gps-btn {
        width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
        background: var(--accent-soft); color: var(--accent); display: flex; align-items: center;
        justify-content: center; flex-shrink: 0; transition: transform .1s;
    }
    .gps-btn:active { transform: scale(.9); }
    .gps-btn svg { width: 17px; height: 17px; }
    .gps-btn:disabled { opacity: .5; }
    .search-submit {
        height: 36px; padding: 0 1rem; border: none; border-radius: 999px; cursor: pointer; flex-shrink: 0;
        background: var(--accent); color: #fff; font: inherit; font-size: .85rem; font-weight: 700;
    }
    body.dark-mode .search-submit { color: #06202c; }
    .search-submit:active { transform: scale(.95); }
    .search-wrap { position: relative; }
    .suggest-list {
        position: absolute; left: 1rem; right: 1rem; top: calc(100% + .3rem); z-index: 60;
        margin: 0; padding: .3rem; list-style: none; max-height: 55vh; overflow-y: auto;
        background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
        box-shadow: var(--shadow-hero);
    }
    .suggest-list[hidden] { display: none; }
    .suggest-item { padding: .6rem .8rem; border-radius: 12px; cursor: pointer; }
    .suggest-item .s-name { font-weight: 600; font-size: .92rem; }
    .suggest-item .s-detail { font-size: .74rem; color: var(--muted); margin-top: .1rem; }
    .suggest-item[aria-selected="true"], .suggest-item:hover { background: var(--accent-soft); }
    .suggest-note { padding: .7rem .8rem; font-size: .84rem; color: var(--muted); }

    /* ---------- Alerts / errors ---------- */
    .banner { margin-top: .85rem; padding: .8rem 1rem; border-radius: 14px; font-size: .9rem;
              display: flex; gap: .6rem; align-items: flex-start; line-height: 1.4; }
    .banner.error { background: var(--warn-soft); color: var(--danger); }
    .banner.alert { background: var(--warn-soft); color: var(--warn); }
    .banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: .1rem; }
    .banner-lines > div + div { margin-top: .25rem; }

    .banner.stale { background: var(--accent-soft); color: var(--text); }
    .stale-note { font-size: .7rem; color: var(--muted); margin-top: .15rem; }

    /* ---------- City heading ---------- */
    .city-heading { margin-top: 1.1rem; font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }

    /* ---------- Hero ---------- */
    .hero {
        position: relative; overflow: hidden; margin-top: .9rem;
        background: linear-gradient(155deg, var(--accent) 0%, #0B6E93 100%);
        border-radius: 26px; padding: 1.5rem 1.4rem 1.3rem; color: #fff;
        box-shadow: var(--shadow-hero);
    }
    body.dark-mode .hero { background: linear-gradient(155deg, #124258 0%, #071822 100%); }
    .hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
    .hero-label { font-size: .82rem; opacity: .85; font-weight: 500; }
    .hero-temp { font-family: 'Space Grotesk', sans-serif; font-size: 4.1rem; font-weight: 600;
                 line-height: 1; margin-top: .3rem; letter-spacing: -.02em; }
    .hero-cond { display: flex; align-items: center; gap: .45rem; margin-top: .5rem; font-size: 1rem; }
    .hero-cond .emoji { font-size: 1.6rem; }
    .hero-feels { margin-top: .3rem; font-size: .88rem; opacity: .85; }
    .feels-chip { display: inline-flex; align-items: center; gap: .3rem; margin-top: .6rem;
                  padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
                  background: rgba(255,255,255,.16); color: #fff; }
    .feels-chip.colder { background: rgba(94, 189, 255, .28); }
    .feels-chip.warmer { background: rgba(255, 176, 96, .28); }
    .chip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.1rem;
                padding-right: 100px; }
    .history-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .75rem;
                    border-radius: 999px; font-size: .78rem; font-weight: 600;
                    background: rgba(255,255,255,.18); color: #fff; }
    .hero-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .75rem;
                 border-radius: 999px; font-size: .78rem; font-weight: 600;
                 background: rgba(255,255,255,.18); color: #fff; }
    .hero-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; flex-shrink: 0; }
    .hero-chip.tier-good .dot { background: #6EF0A8; }
    .hero-chip.tier-moderate .dot { background: #FFD873; }
    .hero-chip.tier-poor .dot, .hero-chip.tier-bad .dot { background: #FF8B8B; }
    .compass-arrow { width: 18px; height: 18px; color: var(--accent); transition: transform .3s ease; }
    .activity-card { display: flex; align-items: center; gap: .6rem; margin-top: .8rem;
                      background: var(--accent-soft); border-radius: 14px; padding: .8rem 1rem;
                      font-size: .88rem; font-weight: 500; }
    .activity-emoji { font-size: 1.3rem; flex-shrink: 0; }
    .hero-mascot {
        position: absolute; right: -8px; bottom: -10px; width: 118px; height: 118px;
        border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.35);
        box-shadow: 0 10px 24px rgba(0,0,0,.25);
        transform: rotate(4deg);
    }
    .confidence-chip {
        display: inline-flex; align-items: center; gap: .35rem; margin-top: 1rem;
        padding: .3rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
        background: rgba(255,255,255,.18); color: #fff;
    }
    .confidence-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
    .confidence-chip.high .dot { background: #6EF0A8; }
    .confidence-chip.medium .dot { background: #FFD873; }
    .confidence-chip.low .dot { background: #FF8B8B; }

    /* Compact hero: temperature + mascot on one row, detail chips left-aligned below */
    .hero { padding: 1.1rem 1.2rem; }
    .hero-main { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
    .hero-templine { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; }
    .hero-temp { font-size: 3.6rem; margin-top: 0; }
    .hero-icon { font-size: 2.2rem; line-height: 1; }
    .hero-mascot { position: static; flex-shrink: 0; width: 84px; height: 84px; border-width: 2px;
                   transform: rotate(4deg); box-shadow: 0 6px 16px rgba(0,0,0,.22); }
    .chip-row { justify-content: flex-start; gap: .4rem; margin-top: .9rem; padding-right: 0; }
    .chip-row > * { margin-top: 0; padding: .28rem .65rem; font-size: .74rem; }

    /* ---------- Stat row ---------- */
    .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .85rem; }
    .stat-pill {
        background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
        padding: .7rem .5rem; text-align: center; box-shadow: var(--shadow-soft);
    }
    .stat-pill svg { width: 18px; height: 18px; color: var(--accent); }
    .stat-pill .val { display: block; font-weight: 700; font-size: 1.05rem; margin-top: .3rem; }
    .stat-pill .lbl { display: block; font-size: .72rem; color: var(--muted); margin-top: .1rem; }

    /* ---------- Sun card ---------- */
    .sun-card {
        margin-top: .7rem; background: var(--surface); border: 1px solid var(--border);
        border-radius: 16px; padding: .85rem 1rem; display: flex; justify-content: space-between;
        box-shadow: var(--shadow-soft);
    }
    .sun-item { text-align: center; flex: 1; }
    .sun-item .e { font-size: 1.2rem; }
    .sun-item .v { display: block; font-weight: 700; font-size: .92rem; margin-top: .15rem; }
    .sun-item .l { display: block; font-size: .68rem; color: var(--muted); }

    /* ---------- Section titles ---------- */
    .section-title { margin: 1.4rem 0 .6rem; font-size: 1.02rem; font-weight: 600; }

    /* ---------- Horizontal scroll rows ---------- */
    .hscroll {
        display: flex; gap: .7rem; overflow-x: auto; scroll-snap-type: x mandatory;
        padding-bottom: .3rem; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem;
        -webkit-overflow-scrolling: touch;
    }
    .hscroll::-webkit-scrollbar { display: none; }
    .hscroll { scrollbar-width: none; }

    .commute-card, .hour-card {
        scroll-snap-align: start; flex: 0 0 auto; background: var(--surface);
        border: 1px solid var(--border); border-radius: 16px; text-align: center;
        box-shadow: var(--shadow-soft);
    }
    .commute-card { width: 148px; padding: 1rem .8rem; }
    .commute-card .title { font-weight: 600; font-size: .88rem; }
    .commute-card .time { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
    .commute-card .emoji { font-size: 2rem; margin: .4rem 0; }
    .commute-card .temp { font-weight: 700; font-size: 1.2rem; }
    .commute-card .sub { font-size: .74rem; color: var(--muted); margin-top: .25rem; }

    .hour-card { width: 78px; padding: .8rem .3rem; }
    .hour-card .time { font-size: .74rem; color: var(--muted); font-weight: 600; }
    .hour-card .emoji { font-size: 1.6rem; margin: .3rem 0; }
    .hour-card .temp { font-weight: 700; font-size: 1rem; }
    .hour-card .sub { font-size: .66rem; color: var(--muted); margin-top: .2rem; }

    /* ---------- Source cards ---------- */
    .source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
    .source-card {
        background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
        padding: 1rem .9rem; box-shadow: var(--shadow-soft);
    }
    .source-card .name { font-size: .82rem; font-weight: 600; color: var(--muted); }
    .source-card .emoji { font-size: 2rem; text-align: center; margin: .4rem 0 .1rem; }
    .source-card .temp { font-size: 1.3rem; font-weight: 700; text-align: center; }
    .source-card .feels { font-size: .74rem; color: var(--muted); text-align: center; margin-top: .1rem; }
    .source-card .meta { display: flex; justify-content: center; gap: .7rem; margin-top: .5rem;
                          font-size: .78rem; color: var(--muted); }
    .source-card .err { font-size: .8rem; color: var(--muted); text-align: center; padding: .6rem 0; }

    /* ---------- Forecast list ---------- */
    .forecast-list { background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
                      overflow: hidden; box-shadow: var(--shadow-soft); }
    .forecast-row { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem;
                     width: 100%; background: none; border: none; font: inherit; color: inherit;
                     text-align: left; cursor: default; -webkit-appearance: none; }
    button.forecast-row { cursor: pointer; }
    button.forecast-row:active { background: var(--surface-alt); }
    .forecast-row + .forecast-row,
    .forecast-row + .day-hours + .forecast-row { border-top: 1px solid var(--border); }
    .forecast-row .day { width: 64px; font-weight: 600; font-size: .88rem; }
    .forecast-row .date { display: block; font-size: .68rem; color: var(--muted); font-weight: 400; }
    .forecast-row .emoji { font-size: 1.5rem; width: 34px; text-align: center; }
    .forecast-row .rain { font-size: .78rem; color: var(--accent); width: 52px; text-align: right; }
    .moon-col { width: 20px; text-align: center; font-size: .95rem; opacity: .8; flex-shrink: 0; }
    .forecast-row .temps { flex: 1; text-align: right; font-size: .92rem; }
    .forecast-row .temps .lo { color: var(--muted); }
    .forecast-row .chevron { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0;
                              transition: transform .2s ease; margin-left: .1rem; }
    button.forecast-row[aria-expanded="true"] .chevron { transform: rotate(180deg); }

    .day-hours { display: none; gap: .6rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
                 background: var(--surface-alt); padding: 0 1rem; border-top: 1px solid var(--border); }
    .day-hours.expanded { display: flex; padding: .8rem 1rem 1rem; animation: fadeUp .2s ease; }
    .day-hours::-webkit-scrollbar { display: none; }
    .day-hours { scrollbar-width: none; }
    .day-hours .hour-card { flex: 0 0 auto; }

    /* ---------- Radar ---------- */
    .radar-wrap { position: relative; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-soft); }
    .radar-frame { width: 100%; height: 62vh; min-height: 380px; border: 0; display: block; }
    .radar-pin { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -100%);
                 width: 30px; height: 30px; color: #E14F4F; pointer-events: none; z-index: 5;
                 filter: drop-shadow(0 2px 5px rgba(0,0,0,.45)); }
    .radar-caption { font-size: .78rem; color: var(--muted); text-align: center; margin-top: .6rem; }

    /* ---------- Today's info card ---------- */
    .info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
                 padding: .3rem 1rem; box-shadow: var(--shadow-soft); }
    .info-row { display: flex; align-items: center; gap: .6rem; padding: .65rem 0; }
    .info-icon { font-size: 1.1rem; flex-shrink: 0; }
    .info-label { flex: 1; font-size: .88rem; color: var(--muted); }
    .info-value { font-size: .85rem; font-weight: 600; text-align: right; }
    .info-value a { color: var(--accent); text-decoration: none; }
    .info-value a:active { opacity: .7; }
    .info-value .link-sep { color: var(--muted); margin: 0 .2rem; font-weight: 400; }
    .info-chip { font-size: .74rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px; }
    .info-chip.uv-low { background: #DCFCE7; color: #166534; }
    .info-chip.uv-moderate { background: var(--warn-soft); color: var(--warn); }
    .info-chip.uv-high, .info-chip.uv-very_high, .info-chip.uv-extreme { background: #FEE2E2; color: var(--danger); }
    body.dark-mode .info-chip.uv-low { background: #123420; color: #6EE7A8; }
    .info-chip.tier-good { background: #DCFCE7; color: #166534; }
    .info-chip.tier-moderate { background: var(--warn-soft); color: var(--warn); }
    .info-chip.tier-poor, .info-chip.tier-bad { background: #FEE2E2; color: var(--danger); }
    body.dark-mode .info-chip.tier-good { background: #123420; color: #6EE7A8; }
    .info-row[hidden] { display: none; }
    .info-row.wrap { align-items: flex-start; }
    .info-row.wrap .info-body { flex: 1; min-width: 0; }
    .info-row-top { display: flex; justify-content: space-between; gap: .5rem; }
    .info-note { font-size: .76rem; color: var(--muted); margin-top: .15rem; line-height: 1.35; }

    .cocktail-toggle { width: 100%; background: none; border: none; font: inherit; color: inherit;
                        text-align: left; cursor: pointer; -webkit-appearance: none; }
    .cocktail-toggle:active { background: var(--surface-alt); }
    .info-row + .info-row,
    .info-row + .ingredients-panel + .info-row { border-top: 1px solid var(--border); }
    .chevron-sm { width: 14px; height: 14px; vertical-align: -2px; margin-left: .15rem;
                  color: var(--muted); transition: transform .2s ease; }
    .cocktail-toggle[aria-expanded="true"] .chevron-sm { transform: rotate(180deg); }
    .pick + .pick, .info-row + .pick { border-top: 1px solid var(--border); }
    .pick-right { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; min-width: 0; }
    .pick-right .pick-name { min-width: 0; text-align: right; }
    .pick-icons { display: inline-flex; gap: .25rem; flex-shrink: 0; }
    .pick-icon { width: 1.9rem; height: 1.9rem; border: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
                 font-size: .85rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
    .pick-icon:active { opacity: .7; }
    a.pick-icon { text-decoration: none; }
    .pick-icon.active { background: var(--accent); }
    .pick .info-row-top { align-items: center; gap: .5rem; }
    .pick-photo { padding: .1rem 1rem 1rem 2.35rem; }
    .pick-photo[hidden] { display: none; }
    .pick-photo img { display: block; width: 100%; max-width: 360px; height: auto; border-radius: 12px; border: 1px solid var(--border); }
    .pick-photo img[hidden] { display: none; }
    .pick-photo-msg { font-size: .8rem; color: var(--muted); }
    .pick-photo-msg:empty { display: none; }
    .pick-photo-cap { font-size: .68rem; color: var(--muted); margin-top: .3rem; }
    .pick-photo-cap a { color: var(--accent); text-decoration: none; }
    .ingredients-panel { display: none; padding: 0 1rem .8rem 2.35rem; }
    .ingredients-panel.expanded { display: block; animation: fadeUp .2s ease; }
    .ingredients-panel ul { margin: 0; padding-left: 1.1rem; }
    .ingredients-panel li { font-size: .82rem; color: var(--muted); padding: .15rem 0; }

    /* ---------- Empty state ---------- */
    .empty-state { text-align: center; padding: 4rem 1.5rem; color: var(--muted); }
    .empty-state svg { width: 42px; height: 42px; color: var(--accent); margin-bottom: .8rem; }
    .empty-state p { margin: 0; font-size: .95rem; line-height: 1.5; }

    /* ---------- Tabs (content panels) ---------- */
    .tab-content { display: none; padding-top: .2rem; padding-bottom: 1rem; }
    .tab-content.active { display: block; animation: fadeUp .25s ease; }
    @keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

    /* ---------- Bottom nav: floating pill, active tab shows its label ---------- */
    nav.bottom-nav {
        position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
        bottom: calc(.8rem + env(safe-area-inset-bottom));
        display: flex; align-items: center; gap: .2rem; padding: .3rem;
        max-width: calc(100% - 1.5rem);
        background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--border); border-radius: 999px;
        box-shadow: var(--shadow-hero);
    }
    .nav-btn {
        display: flex; align-items: center; justify-content: center; gap: .4rem;
        height: 44px; min-width: 44px; padding: 0 .75rem;
        background: none; border: none; color: var(--muted); font-family: inherit;
        font-size: .8rem; font-weight: 600; border-radius: 999px;
        cursor: pointer; transition: color .15s, background .2s, padding .2s;
    }
    .nav-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
    .nav-btn .nav-label { display: none; white-space: nowrap; }
    .nav-btn:active { transform: scale(.94); }
    .nav-btn.active { background: var(--accent); color: #fff; padding: 0 1rem 0 .85rem; }
    .nav-btn.active .nav-label { display: inline; }
    body.dark-mode .nav-btn.active { color: #06202c; }

    /* ---------- Comic ---------- */
    .comic-toggle { border: none; background: var(--accent-soft); color: var(--accent); font: inherit;
                    font-size: .78rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px; cursor: pointer; }
    .comic-buttons { display: inline-flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
    .comic-toggle.active { background: var(--accent); color: #fff; }
    .comic-panel { padding: .2rem 1rem 1rem; }
    .comic-panel[hidden] { display: none; }
    .comic-panel img { display: block; width: 100%; height: auto; border-radius: 10px; background: #fff;
                       border: 1px solid var(--border); }
    .comic-panel .comic-cap { font-size: .72rem; color: var(--muted); margin-top: .4rem; }
    .comic-panel .comic-cap a { color: var(--accent); text-decoration: none; margin-left: .2rem; }
    .comic-panel .comic-msg { font-size: .84rem; color: var(--muted); }

    /* ---------- Weather charts (collapsed by default) ---------- */
    :root { --c-temp: #eb6834; --c-rain: #2a78d6; --c-wind: #1baf7a; }
    body.dark-mode { --c-temp: #d95926; --c-rain: #3987e5; --c-wind: #199e70; }
    .wx-details { margin-top: .7rem; background: var(--surface); border: 1px solid var(--border);
                  border-radius: 16px; box-shadow: var(--shadow-soft); overflow: hidden; }
    .wx-details > summary { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; cursor: pointer;
                            font-size: .86rem; font-weight: 600; list-style: none; }
    .wx-details > summary::-webkit-details-marker { display: none; }
    .wx-details .wx-chev { width: 16px; height: 16px; margin-left: auto; color: var(--muted); transition: transform .2s ease; }
    .wx-details[open] .wx-chev { transform: rotate(180deg); }
    .wx-details .wx-lbl-open, .wx-details[open] .wx-lbl-closed { display: none; }
    .wx-details[open] .wx-lbl-open { display: inline; }
    .wx-chart { position: relative; margin: 0; padding: 0 .6rem .8rem; }
    .wx-svg { display: block; width: 100%; height: auto; touch-action: pan-y; overflow: visible; }
    .wx-svg [hidden] { display: none; }
    .wx-grid { stroke: var(--border); stroke-width: 1; }
    .wx-zero { stroke: var(--muted); stroke-opacity: .55; }
    .wx-sep { stroke: var(--border); stroke-width: 1; }
    .wx-key { stroke-width: 2; stroke-linecap: round; }
    .wx-title { fill: var(--text); font-size: 10px; font-weight: 600; }
    .wx-axis { fill: var(--muted); font-size: 9px; }
    .wx-day { fill: var(--text); font-size: 10px; font-weight: 600; }
    .wx-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
    .wx-area { fill-opacity: .1; stroke: none; }
    .wx-bar { fill-opacity: .9; }
    .wx-end, .wx-dot { stroke: var(--surface); stroke-width: 2; }
    .wx-single { stroke: none; }
    .wx-cross { stroke: var(--muted); stroke-width: 1; }
    .wx-hit { fill: transparent; outline: none; }
    .wx-hit:focus-visible { fill: var(--accent-soft); fill-opacity: .6; }
    .wx-tip { position: absolute; z-index: 5; min-width: 8.5rem; padding: .5rem .65rem; pointer-events: none;
              background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
              box-shadow: var(--shadow-hero); font-size: .78rem; line-height: 1.35; }
    .wx-tip[hidden] { display: none; }
    .wx-tip .tip-head { font-weight: 600; margin-bottom: .25rem; }
    .wx-tip .tip-row { display: flex; align-items: center; gap: .45rem; }
    .wx-tip .tip-key { width: 12px; height: 0; border-top: 2px solid; border-radius: 1px; flex-shrink: 0; }
    .wx-tip .tip-val { font-weight: 700; color: var(--text); }
    .wx-tip .tip-name { color: var(--muted); }

    /* ---------- Rain nowcast ---------- */
    .nowcast[hidden] { display: none; }
    .nc-details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-soft); margin-top: .75rem; }
    .nc-details > summary { cursor: pointer; padding: .6rem 1rem; font-size: .85rem; font-weight: 600; color: var(--muted); list-style-position: inside; }
    .nc-details[open] > summary { color: inherit; }
    .nc-details .nc-card { border: 0; box-shadow: none; border-radius: 0 0 16px 16px; padding-top: .2rem; }
    .nc-card { padding: .85rem 1rem .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-soft); }
    .nc-head { font-weight: 600; font-size: .92rem; margin-bottom: .55rem; }
    .nc-svg { display: block; width: 100%; height: auto; overflow: visible; }
    .nc-dry { fill: var(--border); }
    .nc-bar:hover { fill-opacity: .8; }
    .nc-src { margin-top: .35rem; font-size: .7rem; color: var(--muted); }

    /* ---------- Favorites + compare ---------- */
    .city-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1.1rem; }
    .city-row .city-heading { margin-top: 0; min-width: 0; }
    .fav-star { width: 36px; height: 36px; }
    .fav-star[aria-pressed="true"] { color: var(--warn); }
    .fav-star[aria-pressed="true"] svg { fill: currentColor; }
    .fav-wrap { display: flex; align-items: center; gap: .5rem; padding-top: .55rem; }
    .fav-wrap[hidden] { display: none; }
    .fav-chips { display: flex; gap: .4rem; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; padding-bottom: 2px; }
    .fav-chips::-webkit-scrollbar { display: none; }
    .fav-chip { display: inline-flex; align-items: center; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border);
                border-radius: 999px; font-size: .8rem; font-weight: 600; overflow: hidden; }
    .fav-chip a { padding: .3rem .4rem .3rem .75rem; text-decoration: none; white-space: nowrap; }
    .fav-chip button { border: none; background: none; color: var(--muted); font: inherit; font-size: 1rem; line-height: 1;
                       padding: .3rem .6rem .3rem .2rem; cursor: pointer; }
    .fav-chip.active { background: var(--accent-soft); border-color: var(--accent); }
    .fav-compare { flex-shrink: 0; border: 1px solid var(--border); background: var(--surface); color: var(--accent); font: inherit;
                   font-size: .78rem; font-weight: 700; padding: .35rem .7rem; border-radius: 999px; cursor: pointer; }
    .fav-compare[hidden] { display: none; }
    .cmp-picks { display: grid; gap: .4rem; margin: .4rem 0 .2rem; }
    .cmp-pick { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; background: var(--surface-alt);
                border: 1px solid var(--border); border-radius: 12px; font-size: .9rem; }
    .cmp-pick input { width: 18px; height: 18px; accent-color: var(--accent); }
    .cmp-result { margin-top: .9rem; }
    .cmp-table th[scope="row"] { font-weight: 600; color: var(--muted); font-size: .72rem; white-space: normal; }
    .acc-table.cmp-table td { text-align: center; }
    .cmp-table tr.acc-cons th { background: var(--accent-soft); }
    .cmp-table thead th { text-align: center; color: var(--text); font-size: .74rem; }
    .cmp-ico { font-size: 1.15rem; }

    /* ---------- Misc ---------- */
    .updated-at { font-size: .74rem; color: var(--muted); margin-top: .15rem; }
    .banner.offline { background: var(--warn-soft); color: var(--warn); }
    .banner[hidden] { display: none; }
    .field-section { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--border); font-size: .9rem; color: var(--text); }
    select.time-input { appearance: auto; }

    /* ---------- Credits ---------- */
    .credits { margin-top: 1.6rem; padding-bottom: .5rem; font-size: .72rem; color: var(--muted); line-height: 1.5; }
    .credits-title { font-weight: 700; margin-bottom: .25rem; }
    .credits-links { display: flex; flex-wrap: wrap; gap: .2rem .8rem; }
    .credits-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
    .credits-note { margin-top: .4rem; }

    /* ---------- Accuracy tab ---------- */
    .acc-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
    .acc-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text);
                font: inherit; font-size: .82rem; font-weight: 600; padding: .4rem .85rem;
                border-radius: 999px; cursor: pointer; }
    .acc-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
    body.dark-mode .acc-chip.active { color: #06202c; }
    .acc-table-wrap { overflow-x: auto; margin-top: .8rem; background: var(--surface);
                      border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-soft); }
    .acc-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
    .acc-table th { text-align: right; font-weight: 600; color: var(--muted); font-size: .66rem; line-height: 1.15;
                    padding: .55rem .35rem; border-bottom: 1px solid var(--border); vertical-align: bottom; }
    .acc-table td { text-align: right; padding: .6rem .35rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
    .acc-table th:first-child, .acc-table td:first-child { text-align: left; font-weight: 600; padding-left: .7rem; white-space: normal; }
    .acc-table th:last-child, .acc-table td:last-child { padding-right: .7rem; }
    .acc-table tr + tr td { border-top: 1px solid var(--border); }
    .acc-table tr.acc-cons td { background: var(--accent-soft); }
    .acc-table tr.acc-best td:first-child::after { content: ' ★'; color: var(--accent); }
    .acc-empty { margin-top: 1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border);
                 border-radius: 16px; font-size: .88rem; line-height: 1.5; color: var(--muted); }
    .acc-footer { font-size: .72rem; line-height: 1.45; margin-top: .7rem; }
    .acc-panel[hidden] { display: none; }
    .acc-note { padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
                font-size: .8rem; line-height: 1.5; color: var(--muted); }
    .acc-spark { margin-top: .8rem; padding: .7rem 1rem .6rem; background: var(--surface); border: 1px solid var(--border);
                 border-radius: 16px; box-shadow: var(--shadow-soft); }
    .acc-spark-svg { display: block; width: 100%; max-width: 300px; height: auto; overflow: visible; }
    .acc-spark-base { stroke: var(--border); stroke-width: 1; }
    .acc-spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
    .acc-spark-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
    .acc-spark-hit { fill: transparent; }
    .acc-spark-cap { margin-top: .35rem; font-size: .74rem; color: var(--muted); }
    .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

    /* ---------- Modal ---------- */
    .modal { display: none; position: fixed; inset: 0; background: rgba(6, 16, 25, .55);
             z-index: 100; align-items: flex-end; justify-content: center; }
    .modal.active { display: flex; }
    .modal-sheet {
        background: var(--surface); width: 100%; max-width: 480px;
        border-radius: 22px 22px 0 0; padding: 1.4rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom));
        animation: slideUp .25s ease;
    }
    @keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
    .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
    .modal-head h2 { font-size: 1.1rem; }
    .modal-sheet.scroll { max-height: 85vh; overflow-y: auto; overscroll-behavior: contain; }
    .help-list { list-style: none; margin: 0; padding: 0; }
    .help-list li { display: flex; gap: .75rem; padding: .7rem 0; }
    .help-list li + li { border-top: 1px solid var(--border); }
    .help-list .h-emoji { font-size: 1.35rem; flex-shrink: 0; width: 1.8rem; text-align: center; }
    .help-list .h-title { font-weight: 600; font-size: .92rem; }
    .help-list .h-text { font-size: .84rem; color: var(--muted); line-height: 1.45; margin-top: .15rem; }
    .field-label { font-size: .82rem; font-weight: 600; color: var(--muted); margin: .8rem 0 .35rem; }
    .time-input {
        width: 100%; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: 12px;
        background: var(--surface-alt); color: var(--text); font-size: 1rem; font-family: inherit;
    }
    .btn-primary, .btn-secondary {
        width: 100%; padding: .8rem; border: none; border-radius: 12px; font-size: .95rem;
        font-weight: 600; font-family: inherit; cursor: pointer; margin-top: .9rem;
    }
    .btn-primary { background: var(--accent); color: #fff; }
    .btn-secondary { background: var(--surface-alt); color: var(--text); margin-top: .55rem; }

    :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    @media (prefers-reduced-motion: reduce) {
        .tab-content.active, .modal-sheet { animation: none; }
    }

    /* ---------- Loading skeleton ---------- */
    .skeleton-overlay { display: none; position: fixed; inset: 0; z-index: 200;
                         background: var(--bg-2); overflow-y: auto; padding-top: 90px; }
    .skeleton-overlay.active { display: block; }
    .skeleton-block { background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 37%, var(--surface-alt) 63%);
                       background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
    .skeleton-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .6rem; }
    @keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
    @media (prefers-reduced-motion: reduce) { .skeleton-block { animation: none; opacity: .6; } }

    /* ---------- Pull to refresh ---------- */
    .ptr-indicator { position: fixed; top: -50px; left: 50%; transform: translateX(-50%);
                      width: 38px; height: 38px; border-radius: 50%; background: var(--surface);
                      box-shadow: var(--shadow-soft); display: flex; align-items: center; justify-content: center;
                      color: var(--accent); z-index: 60; transition: top .2s ease, transform .2s ease; }
    .ptr-indicator svg { width: 18px; height: 18px; }
    .ptr-indicator.spin svg { animation: spin .8s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ---------- Official warnings ---------- */
    .warnings[hidden] { display: none; }
    .warnings { margin-top: .85rem; display: grid; gap: .5rem; }
    .warn { border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-size: .9rem; overflow: hidden; }
    .warn > summary { cursor: pointer; padding: .7rem 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .4rem; }
    .warn-dot { width: .7rem; height: .7rem; border-radius: 50%; background: #E0A800; align-self: center; flex-shrink: 0; }
    .warn-orange .warn-dot { background: #E8710A; }
    .warn-red .warn-dot { background: #D93025; }
    .warn-lvl, .warn-ev { font-weight: 600; }
    .warn-when { color: var(--muted); font-size: .82rem; }
    .warn-body { padding: 0 1rem .8rem; }
    .warn-body p { margin: .35rem 0 0; line-height: 1.45; }
    .warn-src { font-size: .75rem; color: var(--muted); }
    .warn-orange { border-color: #E8710A; }
    .warn-red { border-color: #D93025; }
    .brand-season { margin-left: .3rem; }
    .acc-list { margin: .4rem 0; padding-left: 1.1rem; }
    .acc-list li { margin: .15rem 0; }
    .acc-table tr.acc-warn td { color: var(--warn); }
    .acc-table tr.acc-bad td { color: var(--danger); font-weight: 600; }

    /* ---------- Notifications ---------- */
    .push-box[hidden] { display: none; }
    .push-intro { font-size: .8rem; color: var(--muted); margin: .2rem 0 .6rem; }
    .push-rule { display: block; padding: .3rem 0; font-size: .9rem; }
    .push-actions { margin-top: .4rem; }
    .btn-secondary[hidden] { display: none; }
    .push-status { margin-top: .5rem; font-size: .8rem; color: var(--muted); min-height: 1.1em; }
