/* ============================================================
   Skymeo — schlicht & kantig
   Klare Linien, scharfe Kanten, reduzierte Farben, 2 Themes.
   ============================================================ */

:root {
    --radius: 4px;
    --maxw: 1600px;
    --border-w: 1px;
    --gap: 18px;
    --ff: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "SF Mono", ui-monospace, "Roboto Mono", Menlo, monospace;
}

/* ---- Light (Standard) ---- */
[data-theme="light"] {
    --bg: #f4f4f5;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --ink: #0a0a0a;
    --ink-2: #52525b;
    --ink-3: #68686f; /* war #a1a1aa -- nur 2.3:1 Kontrast, unter WCAG-AA-Minimum von 4.5:1 */
    --line: #e4e4e7;
    --line-2: #d4d4d8;
    --accent: #0a0a0a;
    --accent-soft: #f4f4f5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04);
    --warm: #e11d48;
    --cool: #2563eb;
    /* AQI-Bänder (luftqualitaet.php aqi_band_color()) -- Bänder 0-3 gegenüber den
       ursprünglichen, kräftigeren Tönen abgedunkelt: #16a34a/#84cc16/#eab308/#f97316
       lagen im Hellmodus nur bei 1,9-3,3:1 Kontrast gegen --surface (#fff), deutlich
       unter dem WCAG-AA-Minimum von 4,5:1 (Audit 2026-07-10). Bänder 4/5 waren schon
       konform, unverändert übernommen. */
    --aqi-0: #12883e; --aqi-1: #54820e; --aqi-2: #916f05; --aqi-3: #c35305;
    --aqi-4: #dc2626; --aqi-5: #7e22ce;
}
/* ---- Dark ---- */
[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg-2: #101012;
    --surface: #131315;
    --ink: #fafafa;
    --ink-2: #a1a1aa;
    --ink-3: #8b8b95; /* war #71717a -- nur 3.8-4.1:1 Kontrast, unter WCAG-AA-Minimum von 4.5:1 */
    --line: #262629;
    --line-2: #34343a;
    --accent: #fafafa;
    --accent-soft: #1c1c20;
    --shadow: none;
    /* heller als im Light-Theme -- gegen die dunkle Panel-Fläche sonst unter 4,5:1 Kontrast */
    --warm: #fb7185;
    --cool: #60a5fa;
    /* AQI-Bänder: 0-3 wie im Hellmodus (dort schon hell genug für --surface #131315),
       4/5 dagegen aufgehellt -- #dc2626/#7e22ce lagen im Dunkelmodus nur bei 2,7-3,8:1
       (Audit 2026-07-10). */
    --aqi-0: #16a34a; --aqi-1: #84cc16; --aqi-2: #eab308; --aqi-3: #f97316;
    --aqi-4: #e14545; --aqi-5: #a359e4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Sichtbarer Fokusrahmen für Tastatur-Navigation -- kantig, in Akzentfarbe. */
:focus-visible,
button:focus-visible, a:focus-visible, [role="button"]:focus-visible,
.chip:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}

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

body {
    font-family: var(--ff);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "tnum" 1, "cv05" 1;
    min-height: 100vh;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

/* Für Suchmaschinen/Screenreader real vorhandener, aber optisch ausgeblendeter
   Text (z. B. das Seiten-H1) -- kein display:none, das würden Crawler ignorieren. */
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Topbar ---------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    background: var(--bg);
    border-bottom: var(--border-w) solid var(--line);
}
.topbar-inner {
    display: flex; align-items: center; gap: 16px;
    height: 60px;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { height: 34px; width: auto; display: block; }
[data-theme="light"] .brand-mark--dark { display: none; }
[data-theme="dark"] .brand-mark--light { display: none; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -.3px; }
.brand-tld { color: var(--ink-3); font-weight: 600; }

.search { position: relative; flex: 1; max-width: 460px; margin-inline: auto; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); }
#searchInput {
    width: 100%; height: 40px;
    padding: 0 14px 0 36px;
    background: var(--surface);
    border: var(--border-w) solid var(--line-2);
    border-radius: var(--radius);
    color: var(--ink); font-size: .95rem; font-family: inherit;
    outline: none; transition: border-color .15s;
}
#searchInput:focus { border-color: var(--accent); }
#searchInput::placeholder { color: var(--ink-3); }
.search-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--surface);
    border: var(--border-w) solid var(--line-2);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    overflow: hidden; z-index: 40;
}
.search-results button {
    display: block; width: 100%; text-align: left;
    padding: 10px 14px; border: 0; border-top: var(--border-w) solid var(--line);
    background: transparent; color: var(--ink); cursor: pointer; font-family: inherit; font-size: .92rem;
}
.search-results button:first-child { border-top: 0; }
.search-results button:hover, .search-results button.hl { background: var(--accent-soft); }
.search-results .sr-sub { color: var(--ink-3); font-size: .8rem; margin-left: 6px; }
.search-results .sr-empty { padding: 12px 14px; color: var(--ink-3); font-size: .88rem; }

.top-actions { display: flex; gap: 8px; flex-shrink: 0; }
.iconbtn {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    background: var(--surface);
    border: var(--border-w) solid var(--line-2);
    border-radius: var(--radius);
    color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s;
}
.iconbtn svg { width: 19px; height: 19px; }
.iconbtn:hover { background: var(--accent-soft); border-color: var(--accent); }
.spin-wrap { display: grid; place-items: center; }
/* Rotation auf einem eigenen <span> statt direkt auf dem <svg> -- Chrome kann eine
   CSS-Transform-Animation auf einem SVG-Wurzelelement oft nicht compositen (bleibt
   layoutwirksam -> zählt als Cumulative Layout Shift), auf einem HTML-Element schon. */
.iconbtn.spin .spin-wrap { animation: spin .8s linear infinite; will-change: transform; }
.iconbtn.busy { opacity: .5; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chips (Schnellauswahl) */
.chips {
    display: flex; gap: 8px; overflow-x: auto;
    padding-block: 10px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    padding: 6px 14px;
    background: transparent;
    border: var(--border-w) solid var(--line-2);
    border-radius: var(--radius);
    color: var(--ink-2); font-family: inherit; font-size: .85rem; cursor: pointer;
    transition: all .15s;
}
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ---------- Layout ---------------------------------------- */
.layout {
    display: grid; grid-template-columns: 1fr 360px; gap: var(--gap);
    margin-top: var(--gap); align-items: start;
}
.col-main, .col-side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.col-main > *, .col-side > * { min-width: 0; }

/* ---------- Panels ---------------------------------------- */
.panel {
    background: var(--surface);
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; row-gap: 6px; /* Kopf (Titel + Tabs/Icons/Status) bricht bei Platzmangel um statt überzulaufen */
    padding: 14px 18px; border-bottom: var(--border-w) solid var(--line);
}
.eyebrow {
    font-size: .72rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
    color: var(--ink); white-space: nowrap;
}
.eyebrow.muted { color: var(--ink-3); font-weight: 500; }

/* ---------- Hero ------------------------------------------ */
/* Dezente wetterreaktive Tönung, von JS via --hero-tint (renderCurrent) gesetzt */
.hero { background: linear-gradient(160deg, var(--hero-tint, transparent), transparent 55%), var(--surface); }
.hero-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.hero-main { display: flex; align-items: center; gap: 20px; padding: 24px 18px; }
.hero-icon { width: 74px; height: 74px; color: var(--ink); flex-shrink: 0; }
.hero-icon svg { width: 100%; height: 100%; stroke-width: 1.4; }
.hero-temp { font-size: 4.6rem; font-weight: 300; line-height: .95; letter-spacing: -.04em; }
.hero-temp .deg { color: var(--ink-3); font-weight: 300; }
.hero-cond { font-size: 1.05rem; font-weight: 500; margin-top: 6px; }
.hero-feels { color: var(--ink-2); font-size: .9rem; margin-top: 2px; }

.statgrid {
    list-style: none;
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    border-left: var(--border-w) solid var(--line);
}
.statgrid li {
    padding: 12px 16px;
    border-bottom: var(--border-w) solid var(--line);
    border-right: var(--border-w) solid var(--line);
}
.statgrid li:nth-child(3n) { border-right: 0; }
.statgrid li:nth-last-child(-n+3) { border-bottom: 0; }
/* 5 Zellen (Wind+Böen zusammengelegt): letzte Reihe = Zellen 4+5. Zelle 3 behält
   ihre untere Kante, Zelle 5 (Rand der unvollständigen Reihe) verliert die rechte. */
.statgrid:has(li:nth-child(5)):not(:has(li:nth-child(6))) li:nth-child(3) { border-bottom: var(--border-w) solid var(--line); }
.statgrid:has(li:nth-child(5)):not(:has(li:nth-child(6))) li:nth-last-child(-n+2) { border-bottom: 0; }
.statgrid:has(li:nth-child(5)):not(:has(li:nth-child(6))) li:nth-child(5) { border-right: 0; }
/* 4 Zellen (z. B. Luftqualität: PM2.5/PM10/Ozon/NO2) -- als 2×2 statt 3+1 mit
   zwei leeren Lücken in der zweiten Reihe, s. luftqualitaet.php. */
.statgrid:has(li:nth-child(4)):not(:has(li:nth-child(5))) { grid-template-columns: 1fr 1fr; }
.statgrid:has(li:nth-child(4)):not(:has(li:nth-child(5))) li:nth-child(2n) { border-right: 0; }
.statgrid:has(li:nth-child(4)):not(:has(li:nth-child(5))) li:nth-last-child(-n+2) { border-bottom: 0; }
.stat-label { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.stat-value { font-size: 1.15rem; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .72rem; font-weight: 500; color: var(--ink-2); }

/* ---------- 7-Tage ---------------------------------------- */
.daily { display: flex; flex-direction: column; }
.d-row {
    display: grid;
    grid-template-columns: 46px 26px 52px 1fr 84px;
    align-items: center; gap: 12px;
    padding: 11px 18px;
    border-bottom: var(--border-w) solid var(--line);
}
.d-row:last-child { border-bottom: 0; }
.d-row.today .d-day { color: var(--ink); font-weight: 700; }
.d-day { font-size: .85rem; font-weight: 600; color: var(--ink); }
.d-day small { display: block; font-size: .68rem; font-weight: 400; color: var(--ink-3); }
/* Dezentes Merkmal für Stunden/Tage, deren Prognose per Premium-Vorhersage
   (tomorrow.io) überschrieben wurde -- eckig statt Pille, passend zu .w-tag. */
.premium-badge {
    display: inline-block; margin-left: 5px; padding: 0 3px;
    font-size: .56rem; font-weight: 700; line-height: 1.4; letter-spacing: .02em;
    color: var(--ink-3); border: var(--border-w) solid var(--line-2); border-radius: 2px;
    vertical-align: middle; cursor: help;
}
.d-ico { width: 24px; height: 24px; color: var(--ink-2); }
.d-rain { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.d-rain.wet { color: #3b82f6; }
.d-bar { position: relative; height: 6px; background: var(--line); border-radius: 3px; }
.d-bar span { position: absolute; height: 100%; border-radius: 3px; }
.d-temps { text-align: right; font-variant-numeric: tabular-nums; font-size: .9rem; }
.d-temps .mx { font-weight: 600; }
.d-temps .mn { color: var(--ink-3); margin-left: 8px; }

/* ---------- Chart ----------------------------------------- */
.chart-wrap { position: relative; height: 300px; padding: 14px 12px 6px; }
.legend { display: flex; gap: 14px; font-size: .72rem; color: var(--ink-2); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 14px; height: 2px; background: currentColor; }
.lg-hist { color: var(--ink); }
.lg-fc { color: #3b82f6; }
.lg-band { color: var(--ink-3); }
.lg-fc::before { border-top: 2px dashed #3b82f6; background: transparent; height: 0; }

/* ---------- Stündlich ------------------------------------- */
.hourly { display: flex; overflow-x: auto; scrollbar-width: thin; }
.hourly::-webkit-scrollbar { height: 6px; }
.hourly::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.h-item {
    flex: 0 0 auto; width: 78px; text-align: center;
    padding: 14px 6px;
    border-right: var(--border-w) solid var(--line);
}
.h-item:last-child { border-right: 0; }
.h-time { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.h-ico { width: 26px; height: 26px; margin: 8px auto; color: var(--ink-2); }
.h-temp { font-size: 1.02rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.h-rain { font-size: .72rem; color: var(--ink-3); margin-top: 4px; }
.h-rain.wet { color: #3b82f6; }
/* Feine Regen-Silhouette je Stunde (Höhe = Regenwahrscheinlichkeit) */
.h-pbar { height: 18px; margin-top: 6px; display: flex; align-items: flex-end; justify-content: center; }
.h-pbar span { width: 60%; min-height: 1px; background: var(--line-2); border-radius: 1px 1px 0 0; }
.h-pbar span.wet { background: color-mix(in srgb, #3b82f6 45%, transparent); }

/* ---------- Erklärbereich --------------------------------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); }
.steps li { display: flex; gap: 12px; padding: 18px; border-right: var(--border-w) solid var(--line); }
.steps li:last-child { border-right: 0; }
.step-no { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); padding-top: 2px; }
.steps b { font-size: .95rem; }
.steps p { font-size: .84rem; color: var(--ink-2); margin-top: 4px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } .steps li { border-right: 0; border-bottom: var(--border-w) solid var(--line); } .steps li:last-child { border-bottom: 0; } }

/* ---------- Seitenspalte ---------------------------------- */
.side-note { padding: 14px 18px 0; color: var(--ink-2); font-size: .85rem; }
.side-note--detail { padding: 8px 18px 14px; font-size: .78rem; }
.astro { padding: 6px 0; }
.astro-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 18px; border-bottom: var(--border-w) solid var(--line);
    font-size: .88rem;
}
.astro-row:last-child { border-bottom: 0; }
.astro-row span { color: var(--ink-2); }
.astro-row b { font-variant-numeric: tabular-nums; }
/* UV-Schutz-Fenster kann länger werden: Wert darf umbrechen, rechtsbündig */
.astro-row--wrap { align-items: flex-start; gap: 12px; }
.astro-row--wrap span { flex-shrink: 0; }
.astro-row--wrap b { text-align: right; }

/* ---------- Mehrtages-Trend mit Balken (Wind/AQI-Vorhersage etc.) --------
   Gemeinsame Alternative zu .astro-row für Listen, bei denen der Wert auch
   relativ zu den anderen Tagen sichtbar sein soll (wie die 7-Tage-Liste auf
   der Startseite/.d-bar es für Temperatur schon tut) -- eine reine Zahlenliste
   ohne visuelle Einordnung wirkt sonst kahl (s. uv.php/.uv-t-* als Vorbild,
   hier verallgemeinert, damit wind.php/luftqualitaet.php es mitnutzen können,
   statt es je Seite zu duplizieren). */
.trend-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 18px; border-bottom: var(--border-w) solid var(--line);
    font-size: .88rem;
}
.trend-row:last-child { border-bottom: 0; }
.trend-row.today .trend-day { color: var(--ink); font-weight: 700; }
.trend-day { width: 58px; flex-shrink: 0; font-size: .85rem; font-weight: 600; color: var(--ink); }
.trend-day small { display: block; font-size: .68rem; font-weight: 400; color: var(--ink-3); }
.trend-bar { flex: 1; position: relative; height: 6px; background: var(--line); border-radius: 3px; }
.trend-bar span { position: absolute; height: 100%; border-radius: 3px; left: 0; }
.trend-val { width: 54px; flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- AQI-Skala mit Positionsmarker (luftqualitaet.php, Hero-Karte) --
   Analog zu uv.php's .uv-bar, aber mit den europäischen-AQI-Bändern aus
   WeatherService::airQuality() (0/20/40/60/80/100 -> 6 gleich breite
   Sechstel bis Skalenende 120). */
.aqi-scale {
    position: relative; height: 8px; border-radius: 4px; margin: 18px 18px 4px; overflow: hidden;
    background: linear-gradient(90deg,
        #16a34a 0%,#16a34a 16.67%, #84cc16 16.67%,#84cc16 33.33%,
        #eab308 33.33%,#eab308 50%, #f97316 50%,#f97316 66.67%,
        #dc2626 66.67%,#dc2626 83.33%, #7e22ce 83.33%,#7e22ce 100%);
}
.aqi-scale-marker { position: absolute; top: -3px; width: 3px; height: 14px; background: var(--ink); border-radius: 2px; transform: translateX(-1.5px); }
.aqi-scale-labels { display: flex; justify-content: space-between; padding: 0 18px 18px; font-size: .68rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Werbeflächen ---------------------------------- */
.ad {
    position: relative; display: grid; place-items: center;
    border: var(--border-w) dashed var(--line-2);
    border-radius: var(--radius);
    background: var(--bg-2);
    color: var(--ink-3);
    overflow: hidden;
}
.ad-label {
    position: absolute; top: 6px; left: 8px;
    font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.ad-fake { font-family: var(--mono); font-size: .82rem; letter-spacing: .05em; }
.ad-leaderboard { height: 90px; margin-top: var(--gap); }
.ad-inline { height: 90px; }
.ad-warning { height: 90px; }
.ad-rectangle { height: 250px; }
.ad-skyscraper { height: 600px; position: sticky; top: 130px; }
.ad-frame { width: 100%; height: 100%; border: 0; display: block; }

.sponsor {
    position: relative; display: grid; place-items: center; overflow: hidden;
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.sponsor-link {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 100%; padding: 10px 14px;
    color: var(--ink); text-decoration: none;
}
.sponsor-link img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Sticky Seiten-Werbung – nur auf sehr breiten Screens (sonst Kollision mit dem 1160px-Inhalt) */
.side-rail { display: none; }
@media (min-width: 1500px) {
    .side-rail {
        position: fixed; top: 50%; transform: translateY(-50%);
        width: 150px; height: 600px; z-index: 90; margin: 0;
        display: grid;
    }
    .side-rail--left { left: 14px; }
    .side-rail--right { right: 14px; }
}

/* ---------- Footer ---------------------------------------- */
.footer { border-top: var(--border-w) solid var(--line); margin-top: 28px; }
.footer-inner {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    padding-block: 22px 34px; color: var(--ink-2); font-size: .85rem;
}
.footer a { color: var(--ink); text-decoration: none; border-bottom: var(--border-w) solid var(--line-2); }
.footer a:hover { border-color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.footer-note { flex: 1 0 100%; color: var(--ink-3); font-size: .78rem; }
.footer-app { flex: 1 0 100%; color: var(--ink-3); font-size: .78rem; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.footer-app a { color: var(--ink-2); }

/* ---------- Toast ----------------------------------------- */
.toast {
    position: fixed; bottom: 20px; left: 50%;
    transform: translateX(-50%) translateY(70px);
    background: var(--accent); color: var(--bg);
    padding: 10px 18px; border-radius: var(--radius);
    font-size: .88rem; opacity: 0; transition: all .3s; z-index: 50;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.err { background: #dc2626; color: #fff; }

/* ---------- Skeleton -------------------------------------- */
.sk { color: transparent !important; position: relative; }
.sk::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--line) 25%, var(--line-2) 37%, var(--line) 63%);
    background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 3px;
}
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Einheiten-Button ------------------------------ */
.iconbtn.unit { width: auto; padding: 0 12px; font-weight: 700; font-size: .9rem; font-family: var(--ff); font-variant-numeric: tabular-nums; }

/* ---------- Favorit-Stern + Kopf-rechts -------------------- */
.head-right { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-left: auto; }
.star, .icon-plain { background: none; border: 0; padding: 8px; min-width: 40px; min-height: 40px; display: grid; place-items: center; color: var(--ink-3); cursor: pointer; }
.star svg, .icon-plain svg { width: 18px; height: 18px; }
.star:hover, .icon-plain:hover { color: var(--ink); }
.star.on { color: #f59e0b; }
.star.on svg { fill: #f59e0b; stroke: #f59e0b; }
.icon-plain.on { color: #f59e0b; }

/* ---------- Favoriten-Leiste ------------------------------- */
.favbar { display: flex; gap: 8px; overflow-x: auto; padding-top: 12px; scrollbar-width: none; }
.favbar::-webkit-scrollbar { display: none; }
.fav {
    flex: 0 0 auto; display: flex; align-items: center; gap: 9px;
    padding: 8px 10px 8px 12px;
    background: var(--surface); border: var(--border-w) solid var(--line-2);
    border-radius: var(--radius); cursor: pointer; transition: border-color .15s;
}
.fav:hover { border-color: var(--accent); }
.fav.active { border-color: var(--accent); }
.fav .fv-ico { width: 20px; height: 20px; color: var(--ink-2); }
.fav .fv-name { font-size: .84rem; font-weight: 600; }
.fav .fv-temp { font-size: .88rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.fav .fv-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; }
.fav .fv-x:hover { color: #dc2626; }

/* ---------- Warnungen ------------------------------------- */
.warnings { display: flex; flex-direction: column; gap: 8px; }
.warn {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 14px; border: var(--border-w) solid var(--line-2);
    border-left-width: 3px; border-radius: var(--radius); background: var(--surface);
}
.warn .w-ico { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.warn .w-body { flex: 1; min-width: 0; }
.warn .w-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.warn b { font-size: .92rem; }
.warn p { font-size: .82rem; color: var(--ink-2); margin-top: 2px; }
.warn .w-tag {
    font-size: .58rem; letter-spacing: .08em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 3px; border: var(--border-w) solid var(--line-2);
    color: var(--ink-3); white-space: nowrap;
}
.warn .w-tag.amtlich { color: var(--ink); border-color: var(--ink); font-weight: 700; }
.warn .w-meta { font-size: .74rem; color: var(--ink-3); margin-top: 5px; font-variant-numeric: tabular-nums; }
.warn .w-instruction { font-size: .82rem; color: var(--ink-2); margin-top: 4px; }
.warn .w-instruction b { font-size: inherit; font-weight: 600; color: var(--ink); }
.warn.severe { border-color: #dc2626; background: color-mix(in srgb, #dc2626 8%, var(--surface)); }
.warn.severe .w-ico { color: #dc2626; }
.warn.warn { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 9%, var(--surface)); }
.warn.warn .w-ico { color: #d97706; }
/* Amtliche DWD-4-Stufen-Skala (Vorinfo/gelb/orange/rot, Feld "level" 1-4) --
   feinere Einfärbung zusätzlich zur severity-Klasse (warn/severe bleibt für
   Nicht-DWD-Elemente maßgeblich). Skala angelehnt an die DWD-Ampelfarben. */
.warn.level-1 { border-color: #16a34a; background: color-mix(in srgb, #16a34a 7%, var(--surface)); }
.warn.level-1 .w-ico { color: #16a34a; }
.warn.level-2 { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 9%, var(--surface)); }
.warn.level-2 .w-ico { color: #d97706; }
.warn.level-3 { border-color: #f97316; background: color-mix(in srgb, #f97316 10%, var(--surface)); }
.warn.level-3 .w-ico { color: #ea580c; }
.warn.level-4 { border-color: #dc2626; background: color-mix(in srgb, #dc2626 10%, var(--surface)); }
.warn.level-4 .w-ico { color: #dc2626; }
.push-nudge {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; border: var(--border-w) solid var(--line-2);
    border-radius: var(--radius); background: var(--surface); font-size: .84rem; color: var(--ink-2);
}
.push-nudge span { flex: 1; min-width: 160px; }
.push-nudge .btn-ghost, .push-nudge .btn-solid { padding: 6px 12px; font-size: .8rem; }

/* ---------- Chart-Tabs ------------------------------------ */
.tabs { display: flex; gap: 4px; }
.tab {
    padding: 5px 10px; border: var(--border-w) solid var(--line-2);
    background: transparent; color: var(--ink-2);
    border-radius: var(--radius); font-family: inherit; font-size: .76rem; cursor: pointer;
}
.tab:hover:not(.active) { border-color: var(--accent); color: var(--ink); }
.tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ---------- Luftqualität ---------------------------------- */
.aqi-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px 12px; }
.aqi-dot { width: 12px; height: 12px; border-radius: 2px; background: var(--ink-3); align-self: center; }
.aqi-val { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.aqi-level { font-size: .9rem; color: var(--ink-2); }

/* ---------- Kompakte Vorschau-Karten (UV, Wind, Regen, Luftqualität) ------
   Verlinken auf die jeweilige Detailseite (/wetter/<slug>/…). Gleiche
   Panel-Optik wie überall sonst, nur der ganze Kartenkörper ist ein <a>. */
.panel-preview { display: block; color: inherit; text-decoration: none; }
.panel-preview:hover .preview-body,
.panel-preview:focus-visible .preview-body { background: var(--accent-soft); }
.panel-preview:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.preview-body {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; transition: background .12s;
}
.preview-ico { width: 30px; height: 30px; flex-shrink: 0; color: var(--ink-2); }
.preview-ico svg { width: 100%; height: 100%; stroke-width: 1.5; }
.preview-main { flex: 1; min-width: 0; }
.preview-val { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.preview-val .preview-unit { font-size: .95rem; font-weight: 500; color: var(--ink-2); margin-left: 2px; }
.preview-sub { font-size: .84rem; color: var(--ink-2); margin-top: 2px; }
.preview-chev { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; }
.panel-preview:hover .preview-chev { color: var(--ink); }

/* Zurück-Link auf den Detailseiten (uv.php/wind.php/regen.php/luftqualitaet.php) --
   gemeinsam definiert statt pro Seite dupliziert, damit alle vier gleich aussehen. */
.backlink {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .85rem; color: var(--ink-2); text-decoration: none; margin-bottom: 4px;
}
.backlink:hover { color: var(--ink); }
.backlink svg { width: 16px; height: 16px; }

/* ---------- Windpfeil ------------------------------------- */
.wind-arrow { display: inline-block; width: 13px; height: 13px; vertical-align: -1px; margin-right: 3px; color: var(--ink-2); }
.wind-arrow svg { width: 13px; height: 13px; }

/* ---------- Abweichungs-Badge (Anomalie) ------------------ */
.hero-anom { margin-top: 8px; font-size: .82rem; font-weight: 600; display: none; align-items: center; gap: 5px; }
.hero-anom.show { display: inline-flex; }
.hero-anom::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }

/* ---------- Heute auf einen Blick ------------------------- */
.glance {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: var(--surface);
    border: var(--border-w) solid var(--line);
    border-radius: var(--radius);
}
.gl {
    padding: 11px 14px; min-width: 0;
    border-right: var(--border-w) solid var(--line);
}
.gl:last-child { border-right: 0; }
.gl-label { font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.gl-value { font-size: .86rem; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) {
    .glance { grid-auto-flow: row; grid-auto-columns: auto; }
    .gl { border-right: 0; border-bottom: var(--border-w) solid var(--line); }
    .gl:last-child { border-bottom: 0; }
}

/* ---------- Regenradar ------------------------------------ */
.nowcast { display: flex; gap: 6px; padding: 16px 18px 12px; }
.nc { flex: 1; text-align: center; min-width: 0; }
.nc-v { font-size: .62rem; color: var(--ink-2); height: 13px; font-variant-numeric: tabular-nums; }
.nc-track { height: 66px; display: flex; align-items: flex-end; }
.nc-bar { width: 100%; background: #3b82f6; min-height: 3px; border-radius: 2px 2px 0 0; transition: height .3s; }
.nc-bar.dry { background: var(--line-2); }
.nc-t { font-size: .66rem; color: var(--ink-3); margin-top: 7px; font-variant-numeric: tabular-nums; }

/* ---------- Prognose-Güte --------------------------------- */
.verify-cap { padding: 12px 18px; font-size: .8rem; color: var(--ink-2); border-bottom: var(--border-w) solid var(--line); }
.verify-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: var(--border-w) solid var(--line); }
.verify-stats .vs { padding: 12px 16px; border-right: var(--border-w) solid var(--line); }
.verify-stats .vs:last-child { border-right: 0; }
.vs-label { font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.vs-value { font-size: 1.2rem; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.chart-wrap.chart-sm { height: 220px; }

/* ---------- Alltags-Tipps --------------------------------- */
.tips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; }
.tip {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border: var(--border-w) solid var(--line);
    border-radius: var(--radius); background: var(--bg-2); font-size: .85rem;
}
.tip svg { width: 17px; height: 17px; color: var(--ink-2); flex-shrink: 0; }
.tip-aff { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.tip-aff-tag {
    display: inline-block; margin-left: 6px;
    font-size: .58rem; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-3); font-weight: 400; text-decoration: none;
}

/* ---------- Pollenflug ------------------------------------ */
.pollen { padding: 4px 0; }
.pollen-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 18px; border-bottom: var(--border-w) solid var(--line); font-size: .85rem;
}
.pollen-row:last-child { border-bottom: 0; }
.pollen-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; background: var(--ink-3); }
.pollen-name { flex: 1; }
.pollen-label { color: var(--ink-3); font-size: .78rem; }

/* ---------- Biowetter --------------------------------------- */
.biowetter-effect { padding: 8px 18px 16px; font-size: .92rem; font-weight: 600; }

/* ---------- 7-Tage: anklickbar ---------------------------- */
.daily .d-row { cursor: pointer; transition: background .12s; }
.daily .d-row:hover { background: var(--accent-soft); }
.d-row.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.daybtn {
    background: none; border: var(--border-w) solid var(--line-2); border-radius: var(--radius);
    color: var(--ink-2); font-family: inherit; font-size: .74rem; padding: 4px 9px; cursor: pointer;
}
.daybtn:hover { border-color: var(--accent); color: var(--ink); }

/* ---------- Werbe-Hinweis (ohne Einwilligung) ------------- */
.ad-note { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); }

/* ---------- Cookie-/Consent-Banner ------------------------ */
.consent {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: var(--border-w) solid var(--line-2);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
}
.consent-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 14px 20px; flex-wrap: wrap;
}
.consent-text { font-size: .85rem; color: var(--ink-2); max-width: 72ch; }
.consent-text a { color: var(--ink); }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-ghost, .btn-solid {
    font-family: inherit; font-size: .85rem; padding: 9px 16px;
    border-radius: var(--radius); cursor: pointer; border: var(--border-w) solid var(--line-2);
}
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn-solid { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ---------- Consent-or-Pay Overlay ------------------------ */
/* Blockierende Wand: entweder Werbung akzeptieren oder werbefrei abonnieren.
   :not([hidden]) wie beim report-sheet, damit das [hidden]-Attribut greift. */
.cop:not([hidden]) {
    display: grid; place-items: center; position: fixed; inset: 0;
    z-index: 120; padding: 20px;
}
.cop-backdrop {
    position: absolute; inset: 0;
    background: rgba(10, 10, 10, .5);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.cop-card {
    position: relative; width: 100%; max-width: 440px;
    background: var(--surface); border: var(--border-w) solid var(--line-2);
    border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
    padding: 26px 24px; display: flex; flex-direction: column; gap: 12px;
    max-height: calc(100vh - 40px); overflow-y: auto;
}
.cop-brand { font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.cop-title { font-size: 1.35rem; line-height: 1.2; font-weight: 700; color: var(--ink); }
.cop-lead { font-size: .9rem; color: var(--ink-2); }

/* Freie Option zuerst und optisch klar (kein Nudging Richtung Bezahlung). */
.cop-primary {
    margin-top: 6px; width: 100%; cursor: pointer; font-family: inherit; text-align: center;
    background: var(--accent); color: var(--bg); border: var(--border-w) solid var(--accent);
    border-radius: var(--radius); padding: 13px 16px;
    display: flex; flex-direction: column; gap: 2px;
}
.cop-primary:hover { opacity: .9; }
.cop-primary-title { font-size: 1rem; font-weight: 600; }
.cop-primary-sub { font-size: .76rem; opacity: .8; }

.cop-sep {
    display: flex; align-items: center; gap: 12px;
    font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em;
    margin: 2px 0;
}
.cop-sep::before, .cop-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.cop-pay {
    border: var(--border-w) solid var(--line-2); border-radius: var(--radius);
    padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--bg);
}
.cop-pay-head { display: flex; flex-direction: column; gap: 3px; }
.cop-pay-title { font-size: .98rem; font-weight: 600; color: var(--ink); }
.cop-pay-sub { font-size: .78rem; color: var(--ink-3); }
.cop-plans { display: flex; gap: 10px; }
.cop-plan-form { flex: 1; display: flex; margin: 0; }
.cop-plan {
    position: relative; flex: 1; width: 100%; text-decoration: none; color: var(--ink);
    font-family: inherit; cursor: pointer;
    border: var(--border-w) solid var(--line-2); border-radius: var(--radius);
    background: var(--surface); padding: 14px 10px 11px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    transition: border-color .15s, background .15s;
}
.cop-plan:hover { border-color: var(--accent); background: var(--accent-soft); }
.cop-plan-best { border-color: var(--line); }
.cop-plan-price { font-size: 1.2rem; font-weight: 700; }
.cop-plan-per { font-size: .74rem; color: var(--ink-3); }
.cop-plan-badge {
    position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
    font-size: .64rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
    background: var(--accent); color: var(--bg); padding: 2px 8px; border-radius: 999px;
}
.cop-restore { text-align: center; margin-top: 4px; }
.cop-restore a { font-size: .82rem; color: var(--ink-2); text-decoration: underline; }
.cop-restore a:hover { color: var(--ink); }
.cop-fine { font-size: .75rem; color: var(--ink-3); text-align: center; margin-top: 2px; }
.cop-fine a { color: var(--ink-2); }
.cop-immediate {
    display: flex; align-items: flex-start; gap: 10px; margin: 10px 0 12px;
    font-size: .78rem; color: var(--ink-2); line-height: 1.5; cursor: pointer;
}
.cop-immediate input { width: 17px; height: 17px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.cop-immediate a { color: var(--ink); }
.cop-immediate.shake { animation: cop-shake .4s; }
@keyframes cop-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

body.cop-open { overflow: hidden; }

@media (max-width: 420px) {
    .cop-card { padding: 22px 18px; }
    /* Gestapelte Pläne: mehr Abstand, damit das "−44 %"-Badge (top:-9px) nicht an die Karte darüber stößt. */
    .cop-plans { flex-direction: column; gap: 20px; }
    /* 7-Tage-Zeile: feste Spalten für sehr schmale Phones verkleinern (Balken sonst unlesbar dünn). */
    .d-row { grid-template-columns: 40px 22px 44px 1fr 62px; gap: 8px; padding: 11px 12px; }
    .d-ico { width: 20px; height: 20px; }
    .d-temps { font-size: .84rem; }
    /* Prognose-Güte (3 Spalten) enger, damit Labels/Werte nicht abschneiden. */
    .verify-stats .vs { padding: 10px 10px; }
    .vs-value { font-size: 1.05rem; }
    .vs-label { letter-spacing: .02em; }
    /* Regenradar: Säulen enger, damit 8 Balken + Zeitlabels nicht kollidieren. */
    .nowcast { padding: 14px 10px 10px; gap: 4px; }
    .nc-v { font-size: .56rem; }
    .nc-t { font-size: .6rem; }
}

/* ---------- Installations-Hinweis (PWA) -------------------- */
.install-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: var(--surface); border-top: var(--border-w) solid var(--line-2);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
}
.install-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 14px 20px; flex-wrap: wrap;
}
.install-text { display: flex; flex-direction: column; gap: 2px; max-width: 56ch; }
.install-text strong { font-size: .92rem; }
.install-text span { font-size: .82rem; color: var(--ink-2); }
.install-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- "Wetter melden"-Sheet -------------------------- */
/* :not([hidden]) statt display direkt auf .report-sheet -- sonst würde die
   Klassenregel die [hidden]-UA-Regel (gleiche Spezifität, aber Autor-CSS
   kommt später) aushebeln und das Sheet bliebe trotz hidden sichtbar. */
.report-sheet:not([hidden]) { display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; padding: 20px; }
.report-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.report-card {
    position: relative; width: 100%; max-width: 380px;
    background: var(--surface); border: var(--border-w) solid var(--line-2);
    border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    padding: 18px; display: flex; flex-direction: column; gap: 12px;
    /* Lange Sheets (v. a. Push-Sheet mit Kategorien + Ortsliste) im Viewport scrollen
       lassen statt oben/unten abzuschneiden -- analog zur .cop-card. */
    max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
    overflow-y: auto; overflow-x: hidden;
}
.report-card .panel-head { padding: 0 0 4px; border-bottom: 0; }
.report-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.report-chip svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.report-note {
    width: 100%; min-height: 60px; resize: vertical;
    background: var(--bg); border: var(--border-w) solid var(--line-2); border-radius: var(--radius);
    color: var(--ink); font-family: inherit; font-size: .88rem; padding: 8px 10px; outline: none;
}
.report-note:focus { border-color: var(--accent); }
#reportSubmit:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Push-Kategorien (Benachrichtigungs-Einstellungen) --- */
.push-cats { display: flex; flex-direction: column; margin: 2px 0 12px; }
.push-cat {
    display: flex; align-items: center; gap: 11px; padding: 9px 2px;
    font-size: .9rem; color: var(--ink); cursor: pointer;
    border-bottom: var(--border-w) solid var(--line);
}
.push-cat:last-child { border-bottom: 0; }
.push-cat input {
    width: 17px; height: 17px; margin: 0; flex-shrink: 0;
    accent-color: var(--accent); cursor: pointer;
}
#pushSave { margin-bottom: 8px; }

/* Übersicht der abonnierten Orte */
.push-list-wrap { border-top: var(--border-w) solid var(--line); margin-top: 14px; padding-top: 12px; }
.push-list-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 8px; }
.push-list { display: flex; flex-direction: column; gap: 6px; }
.push-place { display: flex; align-items: center; gap: 8px; }
.push-place-name {
    flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-family: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; text-align: left;
    background: var(--bg); border: var(--border-w) solid var(--line-2); border-radius: var(--radius); padding: 9px 12px;
}
.push-place.current .push-place-name,
.push-place-name:hover { border-color: var(--accent); }
.push-place-cnt { font-size: .72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.push-place-del {
    flex-shrink: 0; width: 40px; height: 40px; font-size: 1.2rem; line-height: 1; cursor: pointer;
    background: transparent; color: var(--ink-3);
    border: var(--border-w) solid var(--line-2); border-radius: var(--radius);
}
.push-place-del:hover { color: var(--warm); border-color: var(--warm); }

/* ---------- Karte (Leaflet) ------------------------------- */
.map { height: 340px; width: 100%; }
.leaflet-container { background: var(--bg-2); font-family: var(--ff); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, .7); }
[data-theme="dark"] .leaflet-control-attribution { background: rgba(0, 0, 0, .5); color: var(--ink-2); }
[data-theme="dark"] .leaflet-control-attribution a { color: var(--ink); }
.leaflet-bar a {
    background: var(--surface); color: var(--ink);
    border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: var(--accent-soft); }
.map-ctrls { display: flex; align-items: center; gap: 8px; }
.map-time { font-size: .74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
#radarToggle.active, #radarPlay.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
#radarPlay { min-width: 30px; }
/* Weiche Überblendung zwischen Radar-Bildern -> flüssiger Zeitraffer */
.radar-layer { transition: opacity .38s linear; will-change: opacity; }

/* ---------- Ortsvergleich --------------------------------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; }
.cmp-col { padding: 18px; min-width: 0; }
.cmp-col:first-child { border-right: var(--border-w) solid var(--line); }
.cmp-b { display: flex; flex-direction: column; justify-content: center; }
.cmp-place {
    font-size: .74rem; font-weight: 600; color: var(--ink-2); letter-spacing: .05em;
    text-transform: uppercase; margin-bottom: 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmp-main { display: flex; align-items: center; gap: 10px; }
.cmp-main svg { width: 34px; height: 34px; color: var(--ink-2); }
.cmp-temp { font-size: 2.3rem; font-weight: 300; letter-spacing: -.03em; }
.cmp-cond { font-size: .9rem; margin: 2px 0 10px; }
.cmp-row {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 7px 0; border-top: var(--border-w) solid var(--line); font-size: .84rem;
}
.cmp-row span { color: var(--ink-2); }
.cmp-row b { font-variant-numeric: tabular-nums; }
.cmp-change { margin-top: 12px; align-self: flex-start; }
.cmp-search { position: relative; }
.cmp-search input {
    width: 100%; height: 40px; padding: 0 14px;
    background: var(--surface); border: var(--border-w) solid var(--line-2);
    border-radius: var(--radius); color: var(--ink); font-size: .92rem; font-family: inherit; outline: none;
}
.cmp-search input:focus { border-color: var(--accent); }

/* ---------- Responsive ------------------------------------ */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .col-side { flex-direction: row; flex-wrap: wrap; }
    .col-side > .panel { flex: 1 1 240px; }
    .ad-skyscraper { display: none; }
    .ad-rectangle { flex: 1 1 100%; }
    .hero-body { grid-template-columns: 1fr; }
    .statgrid { border-left: 0; border-top: var(--border-w) solid var(--line); }
    .statgrid li:nth-last-child(-n+3) { border-bottom: var(--border-w) solid var(--line); }
    .statgrid li:nth-last-child(-n+1) { border-bottom: 0; }
}
@media (max-width: 620px) {
    .brand-mark { height: 30px; }
    .brand-name { font-size: 1.05rem; }
    .hero-temp { font-size: 3.8rem; }
    /* Topbar bricht um: Marke + Aktionen bleiben in Zeile 1, Suche nimmt Zeile 2 voll ein. */
    .topbar-inner { flex-wrap: wrap; height: auto; padding-block: 10px; row-gap: 10px; }
    .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
    /* Marke + Aktionen sollen in Zeile 1 passen (statt 3-zeiliger Topbar): enger + Aktionen nach rechts. */
    .topbar-inner { gap: 10px; }
    .brand { margin-right: auto; }
    .top-actions { gap: 6px; }
    .iconbtn.unit { padding: 0 9px; }
    .statgrid { grid-template-columns: 1fr 1fr; }
    .statgrid li:nth-child(3n) { border-right: var(--border-w) solid var(--line); }
    .statgrid li:nth-child(2n) { border-right: 0; }
    /* 5 Zellen im 2-Spalten-Raster: Reihen 1+2 (Zellen 1–4) behalten die untere
       Kante, nur die allein stehende Zelle 5 (Reihe 3) verliert Boden + rechte Kante. */
    .statgrid:has(li:nth-child(5)):not(:has(li:nth-child(6))) li:nth-child(-n+4) { border-bottom: var(--border-w) solid var(--line); }
    .statgrid:has(li:nth-child(5)):not(:has(li:nth-child(6))) li:nth-child(5) { border-bottom: 0; border-right: 0; }
    .compare { grid-template-columns: 1fr; }
    .cmp-col:first-child { border-right: 0; border-bottom: var(--border-w) solid var(--line); }
    /* Sicherheitsnetz gegen versehentliches Seitwärts-Scrollen (clip bricht sticky nicht). */
    body { overflow-x: clip; }
    /* Zeitstempel im Wetter-Karten-Kopf darf umbrechen/kleiner werden statt den Kopf zu sprengen. */
    #heroTime { white-space: normal; font-size: .66rem; }
    /* Fingertaugliche Tap-Ziele: Städte-Chips und Chart-Tabs auf >=40 bzw. ~38px. */
    .chip { min-height: 40px; display: inline-flex; align-items: center; }
    .tab { padding: 8px 12px; }
    /* Letzter Chip klebt sonst am rechten Rand -> End-Abstand erzwingen. */
    .chips::after { content: ""; flex: 0 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .iconbtn.spin .spin-wrap { animation: none; }
    .radar-layer { transition: none; }
    * { scroll-behavior: auto !important; }
}
