/* weather.nrakers: dunkel, ruhig, Richtung Liquid Glass (durchscheinende Flächen, feine Lichtkante, große Radien).
   Der Hintergrund ist ein ruhiger Verlauf passend zu Wetter und Tageszeit des Ortes (html[data-sky]).
   Farbe nur mit Bedeutung: Blau = Regen/Auswahl, Bernstein = Warnung/Sonne, Korall = schlecht. Keine Inline-Styles (CSP). */

@property --s1 { syntax: "<color>"; inherits: true; initial-value: #0B1D3D; }
@property --s2 { syntax: "<color>"; inherits: true; initial-value: #0B1D3D; }
@property --s3 { syntax: "<color>"; inherits: true; initial-value: #0B1D3D; }

:root {
  --bg: #0B1D3D;
  --ink: #fff;
  --ink-2: rgba(255, 255, 255, 0.78);
  --ink-3: rgba(255, 255, 255, 0.56);
  --glass: rgba(255, 255, 255, 0.09);
  --glass-2: rgba(255, 255, 255, 0.16);
  --edge: rgba(255, 255, 255, 0.16);
  --edge-lit: rgba(255, 255, 255, 0.34);
  --ok: #86DB9A;
  --warn: #FFC978;
  --bad: #FF8A7A;
  --info: #8FC7FF;
  --sun: #FFD27A;
  --radius: 26px;
  --gap: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --s1: #0E2447; --s2: #14305E; --s3: #1B3F78;
  color-scheme: dark;
}

/* Himmelsverläufe: oben dunkler, nach unten etwas heller; bewusst gedämpft, damit weißer Text lesbar bleibt */
html[data-sky="clear-day"] { --s1: #123F73; --s2: #1E639F; --s3: #3C87BF; }
html[data-sky="clear-night"] { --s1: #050A1D; --s2: #0B1840; --s3: #162B5E; }
html[data-sky="cloudy-day"] { --s1: #263244; --s2: #3A4A60; --s3: #566880; }
html[data-sky="cloudy-night"] { --s1: #0B1019; --s2: #161E2C; --s3: #232E40; }
html[data-sky="rain"] { --s1: #17212E; --s2: #243445; --s3: #35495E; }
html[data-sky="snow"] { --s1: #2D3947; --s2: #46586B; --s3: #6A8095; }
html[data-sky="storm"] { --s1: #101219; --s2: #211F2F; --s3: #363044; }
html[data-sky="fog"] { --s1: #33393F; --s2: #484F58; --s3: #626C77; }
html[data-sky="dusk"] { --s1: #161F48; --s2: #4A3F72; --s3: #B07068; }

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { transition: --s1 1.4s ease, --s2 1.4s ease, --s3 1.4s ease; }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font: 16px/1.4 var(--font);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(28px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}

.sky {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--s1) 0%, var(--s2) 52%, var(--s3) 100%);
}
.sky::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.10), transparent 60%);
}

button, input { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }
[hidden] { display: none !important; }

/* ---------- Kopf und Ortsleiste ---------- */
.top, .places, .wrap, .sources { max-width: 1180px; margin-left: auto; margin-right: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 4px; }
.brand { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.stamp { margin: 0; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stamp.warn { color: var(--warn); }
.top-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 44px; height: 44px; flex: none; padding: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600;
  background: var(--glass); border: 1px solid var(--edge); color: var(--ink);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.icon-btn:active { background: var(--glass-2); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn.danger.armed { width: auto; min-width: 84px; padding: 0 12px; border-radius: 999px; background: rgba(255, 138, 122, 0.22); border-color: var(--bad); color: var(--bad); font-size: 14px; }
#refresh.busy .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.place-bar {
  display: flex; gap: 8px; margin: 0; padding: 8px 16px 12px; list-style: none; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.place-bar::-webkit-scrollbar { display: none; }
.place-bar li { flex: none; scroll-snap-align: center; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; color: var(--ink);
  background: var(--glass); border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.chip:active { background: var(--glass-2); }
.chip[aria-pressed="true"] { background: rgba(255, 255, 255, 0.92); border-color: #fff; color: #0B1D3D; font-weight: 600; box-shadow: none; }
.chip.temp { border-style: dashed; }
.chip.ghost { color: var(--ink-2); }

/* ---------- Raster und Karten ---------- */
.wrap { padding: 0 16px; }
.grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
#hero { grid-area: hero; } #cloth { grid-area: cloth; } #rain { grid-area: rain; } #hours { grid-area: hours; }
#days { grid-area: days; } #radar { grid-area: radar; } #sun { grid-area: sun; } #uv { grid-area: uv; } #air { grid-area: air; }
.grid { grid-template-areas: "hero" "cloth" "rain" "hours" "days" "radar" "sun" "uv" "air"; }

.card {
  position: relative; min-width: 0; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.065));
  border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: inset 0 1px 0 var(--edge-lit), inset 0 -1px 0 rgba(255, 255, 255, 0.04), 0 12px 32px rgba(0, 0, 0, 0.18);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .chip, .icon-btn { background: rgba(20, 32, 56, 0.78); }
}
.card h2, .card-head h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.sub { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); }
.meta { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.state { margin: 4px 0; color: var(--ink-2); }
.sub-h { margin: 16px 0 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }

.status {
  margin-bottom: var(--gap); padding: 10px 14px; border-radius: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  background: rgba(255, 201, 120, 0.14); border: 1px solid rgba(255, 201, 120, 0.4); color: var(--warn); font-size: 14px;
}
.link-btn { min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ---------- Warnungen ---------- */
.alerts { display: grid; gap: 10px; margin-bottom: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.alert {
  --lv: var(--warn);
  padding: 14px 16px 14px 18px; border-radius: 22px; border: 1px solid var(--edge); border-left: 5px solid var(--lv);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07));
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 var(--edge-lit), 0 10px 28px rgba(0, 0, 0, 0.18);
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .alert { background: linear-gradient(90deg, color-mix(in srgb, var(--lv) 20%, transparent), rgba(255, 255, 255, 0.07) 70%); }
}
.alert.lv2 { --lv: #FFA05A; }
.alert.lv3 { --lv: #FF6B5B; }
.alert.lv4 { --lv: #C58BFF; }
.alert-head { display: flex; align-items: flex-start; gap: 10px; color: var(--lv); }
.alert-title { color: var(--ink); min-width: 0; }
.alert-kind { margin: 0; font-size: 13px; font-weight: 600; color: var(--lv); }
.alert h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.alert-when { margin: 6px 0 0; font-size: 15px; color: var(--ink); }
.alert-more { margin-top: 6px; }
.alert-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.alert-more p { margin: 0 0 8px; color: var(--ink-2); font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.alert-headline { font-weight: 600; color: var(--ink) !important; }
.alert-source { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--ink-3); padding: 0 6px; }

/* ---------- Jetzt ---------- */
.hero { padding: 18px 18px 16px; }
.hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.hero-detail { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); text-align: right; max-width: 40%; }
.hero-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.hero-temp { margin: 0; font-size: 104px; line-height: 1; font-weight: 200; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; padding-left: 2px; }
.hero-icon { flex: none; display: flex; }
.hero-cond { margin: 4px 0 14px; font-size: 18px; color: var(--ink-2); }
.hero-cond strong { color: var(--ink); font-weight: 600; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.facts li { padding: 9px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.08); }
.fact-label { display: block; font-size: 12px; color: var(--ink-3); }
.fact-value { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts.small { margin-top: 12px; }
.wind-dir { display: inline-flex; transform: rotate(var(--rot, 0deg)); color: var(--ink-2); }

/* Wettersymbole */
.wi { display: block; overflow: visible; }
.wi-sun { fill: var(--sun); }
.wi-ray { stroke: var(--sun); stroke-linecap: round; }
.wi-moon { fill: #DCE4F5; }
.wi-cloud { fill: #EEF3F9; }
.wi-cloud.wi-dark { fill: #B9C5D6; }
.wi-drop { stroke: var(--info); stroke-linecap: round; }
.wi-snow { fill: #fff; }
.wi-bolt { fill: var(--sun); stroke: var(--sun); stroke-linejoin: round; stroke-width: 1; }
.wi-fog { stroke: rgba(255, 255, 255, 0.72); stroke-linecap: round; }

/* ---------- Anziehen ---------- */
.card.cloth { display: flex; flex-direction: column; }
#cloth-body { flex: 1; display: flex; }
.cloth-grid { flex: 1; display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 14px 18px; align-items: center; }
.cloth-fig { display: flex; align-items: center; justify-content: center; }
.fig { width: 100%; height: auto; max-height: 170px; display: block; }
.fig .on { fill: rgba(255, 255, 255, 0.97); }
.fig .on2 { fill: rgba(255, 255, 255, 0.7); }
.fig .off { fill: rgba(255, 255, 255, 0.07); }
.fig .body { fill: rgba(255, 255, 255, 0.34); }
.fig .stroke-on { stroke: rgba(255, 255, 255, 0.97); }
.fig .stroke-off { stroke: rgba(255, 255, 255, 0.07); }
.cloth-window { margin: 0 0 6px; font-size: 13px; color: var(--ink-3); }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reasons li { font-size: 16px; line-height: 1.3; color: var(--ink-2); }
.reasons b { color: var(--ink); font-weight: 600; }
.plain { margin: 0; color: var(--ink-2); }

/* ---------- Regen ---------- */
.rain-title { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; }
.rain-title.now { color: var(--info); }
.rain-detail { margin: 4px 0 0; color: var(--ink-2); }
.chart { margin-top: 16px; }
.chart-cap { margin: 0 0 6px; font-size: 13px; color: var(--ink-3); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 78px; touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.bar { flex: 1; min-width: 0; height: max(var(--h, 0%), 3px); border-radius: 4px; background: rgba(255, 255, 255, 0.22); }
.bar.light { background: rgba(143, 199, 255, 0.75); }
.bar.moderate { background: rgba(143, 199, 255, 0.92); }
.bar.heavy { background: #8FC7FF; box-shadow: 0 0 10px rgba(143, 199, 255, 0.6); }
.bar.trace { background: rgba(143, 199, 255, 0.38); }
.bar.snow { background: rgba(255, 255, 255, 0.9); }
.bar.sel { outline: 2px solid #fff; outline-offset: 1px; }
.axis { position: relative; height: 20px; margin-top: 4px; }
.axis span { position: absolute; left: var(--x); transform: translateX(-50%); font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-detail { margin: 2px 0 0; min-height: 20px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Stunden ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--edge); }
.seg button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.92); color: #0B1D3D; font-weight: 600; }

.hscroll { overflow-x: auto; margin: 0; padding: 0 0 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
.hinner { display: flex; width: max-content; }
.hdata { position: relative; display: flex; }
.hcol {
  width: 58px; flex: none; display: grid; grid-template-rows: 22px 36px 46px 28px 22px 42px 24px; justify-items: center; align-items: center; text-align: center;
  font-variant-numeric: tabular-nums;
}
.hcol.past { opacity: 0.45; }
.hcol.now { background: rgba(255, 255, 255, 0.09); border-radius: 16px; }
/* Beschriftung links bleibt beim Scrollen stehen; deckend, damit die Spalten darunter nicht durchscheinen */
.hlabels {
  position: sticky; left: 0; z-index: 2; width: 72px; justify-items: start; padding-left: 8px; white-space: nowrap;
  font-size: 12px; color: var(--ink-3);
  background: rgba(16, 28, 52, 0.96);
  border-radius: 12px; box-shadow: 8px 0 12px -6px rgba(0, 0, 0, 0.35);
}
@supports (background: color-mix(in srgb, red 10%, black)) {
  .hlabels { background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)), color-mix(in srgb, var(--s2) 88%, black); }
}
.h-time { font-size: 13px; color: var(--ink-2); }
.h-temp { font-size: 19px; font-weight: 600; }
.h-feels { font-size: 14px; color: var(--ink-3); }
.h-rain { display: grid; justify-items: center; align-content: center; line-height: 1.15; }
.chance { font-size: 13px; color: var(--ink-3); }
.chance.hi { color: var(--info); font-weight: 600; }
.mm { font-size: 12px; color: var(--ink-3); }
.h-wind { font-size: 13px; color: var(--ink-2); }
.hcurve { position: absolute; left: 0; top: 58px; pointer-events: none; overflow: visible; }
.c-temp { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.c-feels { stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.6; stroke-dasharray: 3 4; stroke-linecap: round; }
.c-dot { fill: #fff; }

/* ---------- 7 Tage ---------- */
.days-card { display: flex; flex-direction: column; }
#days-body { flex: 1; display: flex; }
.days { flex: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-auto-rows: minmax(54px, 1fr); }
.day {
  display: grid; grid-template-columns: 54px 32px minmax(38px, 62px) 36px minmax(40px, 1fr) 36px; align-items: center; gap: 6px 8px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-variant-numeric: tabular-nums;
}
.day:first-child { border-top: 0; }
.d-name { font-weight: 600; }
.d-icon { display: flex; }
.d-rain { display: grid; line-height: 1.15; justify-items: start; }
.d-lo { text-align: right; color: var(--ink-3); }
.d-hi { font-weight: 600; }
.range { position: relative; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.fill { position: absolute; top: 0; bottom: 0; left: var(--l); width: var(--w); min-width: 6px; border-radius: 3px; background: linear-gradient(90deg, #8FC7FF, #FFD27A); }
.now-dot { position: absolute; top: -2px; left: var(--x); width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; border: 2px solid rgba(11, 29, 61, 0.6); }

/* ---------- Radar ---------- */
.map { position: relative; height: 300px; border-radius: 20px; overflow: hidden; background: #131c2a; border: 1px solid var(--edge); isolation: isolate; }
.map-stage { position: absolute; inset: 0; }
.map-base, .map-radar, .map-layer { position: absolute; inset: 0; }
.map-base { filter: invert(1) hue-rotate(180deg) brightness(0.82) saturate(0.55) contrast(0.95); }
.tile { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.map-layer { opacity: 0; transition: opacity 0.18s linear; }
.map-layer.on { opacity: 0.9; }
.map-marker { position: absolute; width: 0; height: 0; z-index: 2; }
.map-marker i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: #0B1D3D; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.5); }
.map-credit { position: absolute; right: 6px; bottom: 5px; z-index: 3; margin: 0; padding: 2px 7px; border-radius: 8px; font-size: 11px; background: rgba(8, 14, 28, 0.62); color: rgba(255, 255, 255, 0.85); }
.radar-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.radar-scrub { flex: 1; min-width: 0; }
input[type="range"] { width: 100%; min-height: 32px; padding: 0; margin: 0; background: none; border: 0; accent-color: #8FC7FF; }
.radar-time { margin: 0; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.radar-time strong { color: var(--ink); }
.badge { margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(143, 199, 255, 0.2); color: var(--info); }

/* ---------- Sonne, UV, Luft ---------- */
.sun-arc { display: block; width: 100%; height: auto; max-height: 170px; overflow: visible; }
.horizon { stroke: rgba(255, 255, 255, 0.3); stroke-width: 1.5; }
.arc-bg { stroke: rgba(255, 255, 255, 0.22); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.arc-on { stroke: var(--sun); stroke-width: 3.5; stroke-linecap: round; }
.sun-dot { fill: var(--sun); }
.sun-glow { fill: rgba(255, 210, 122, 0.28); }
.sun-caption { margin: 6px 0 10px; text-align: center; color: var(--ink-2); }
.sun-times { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sun-times li { display: grid; justify-items: center; align-content: start; gap: 2px; padding: 8px 4px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); text-align: center; }
.sun-times strong { font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sun-times .ic { color: var(--sun); }

.big-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.big { margin: 0; font-size: 56px; line-height: 1.05; font-weight: 200; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.lvl { margin: 0; font-size: 19px; font-weight: 600; }
.scale { position: relative; height: 8px; margin: 12px 0 4px; border-radius: 4px; }
.scale i { position: absolute; top: 50%; left: var(--x); width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid rgba(11, 29, 61, 0.65); }
.uv-scale { background: linear-gradient(90deg, #86DB9A 0%, #D8E36B 28%, #FFC978 52%, #FF8A7A 76%, #C58BFF 100%); }
.aqi-scale { background: linear-gradient(90deg, #86DB9A 0%, #C8E36B 22%, #FFC978 40%, #FF8A7A 62%, #D6577A 82%, #A45CC8 100%); }
.uv-low, .aqi-good { color: var(--ok); }
.uv-moderate, .aqi-fair { color: #D8E36B; }
.uv-high, .aqi-moderate { color: var(--warn); }
.uv-very-high, .aqi-poor { color: var(--bad); }
.uv-extreme, .aqi-very-poor, .aqi-extreme { color: #E58BFF; }
.air-grid { display: grid; gap: 4px 28px; }
.pollen-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pollen { display: inline-flex; gap: 8px; align-items: baseline; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); border: 1px solid var(--edge); font-size: 14px; }
.pollen b { font-weight: 600; color: var(--ok); }
.pollen.lvl2 b { color: #D8E36B; } .pollen.lvl3 b { color: var(--warn); } .pollen.lvl4 b { color: var(--bad); }

/* ---------- Fuß ---------- */
.sources { padding: 18px 16px 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.sources p { margin: 0; }

/* ---------- Formulare, Sheets ---------- */
input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: rgba(255, 255, 255, 0.09); border: 1px solid var(--edge);
}
input::placeholder { color: var(--ink-3); }
.primary { min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; cursor: pointer; background: #fff; color: #0B1D3D; font: inherit; font-weight: 600; }
.primary:active { opacity: 0.85; }
.text-btn {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--glass); border: 1px solid var(--edge); color: var(--ink); font: inherit; font-weight: 500;
}
.text-btn.wide { width: 100%; margin-top: 10px; }
.text-btn:disabled { color: var(--ink-3); cursor: default; }

dialog.sheet {
  width: min(560px, 100%); max-width: 100%; max-height: 90vh; max-height: 90dvh; margin: auto auto 0; padding: 0; border: 1px solid var(--edge); border-bottom: 0;
  border-radius: 28px 28px 0 0; color: var(--ink); background: rgba(24, 36, 62, 0.86);
  -webkit-backdrop-filter: blur(34px) saturate(1.6); backdrop-filter: blur(34px) saturate(1.6);
  box-shadow: inset 0 1px 0 var(--edge-lit), 0 -12px 48px rgba(0, 0, 0, 0.45);
}
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet::backdrop { background: rgba(3, 8, 20, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 6px 20px; }
.sheet-head h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); }
.sheet-body { overflow-y: auto; padding: 4px 20px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; border-radius: 28px; border-bottom: 1px solid var(--edge); }
}

.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 4px; }
.rows { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border-radius: 18px; background: var(--glass); border: 1px solid var(--edge); }
.row-main { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; display: grid; align-content: center; }
.row-name { font-weight: 600; overflow-wrap: anywhere; }
.row-detail { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.row-tag { margin-right: 10px; padding: 2px 10px; border-radius: 999px; font-size: 12px; color: var(--ink-3); border: 1px solid var(--edge); }
#search-state { min-height: 20px; }
#rules-state.bad { color: var(--bad); }

.rule-group { margin: 12px 0 0; padding: 4px 14px 12px; border: 1px solid var(--edge); border-radius: 20px; background: rgba(255, 255, 255, 0.05); min-width: 0; }
.rule-group legend { padding: 0 8px; font-weight: 600; }
.rule { display: grid; gap: 4px; padding: 6px 0; }
.rule label { font-size: 14px; color: var(--ink-2); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper input { width: 84px; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit { min-width: 48px; font-size: 14px; color: var(--ink-3); }

@media (hover: hover) {
  .chip:hover, .icon-btn:not(:disabled):hover, .text-btn:not(:disabled):hover, .row:hover { background: var(--glass-2); }
  .chip[aria-pressed="true"]:hover { background: #fff; }
}

/* ---------- Breite Ansicht ---------- */
@media (min-width: 640px) {
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .map { height: 340px; }
}

@media (min-width: 960px) {
  .top { padding-top: 22px; }
  .place-bar { padding-left: 16px; }
  .grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "hero cloth" "rain radar" "hours hours" "days sun" "days uv" "air air";
    align-items: stretch;
  }
  .hero-temp { font-size: 120px; }
  .air-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .bars { height: 92px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cloth-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .fig { max-height: 230px; }
  .map { height: 340px; }
  .hcol { width: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
