:root {
  --bg: #070d18;
  --ink: #e9f1ff; --muted: #9db0cf; --accent: #4f8bff;
  --glass: rgba(14, 26, 44, .52); --glass-line: rgba(170, 200, 250, .14);
  --shadow: 0 18px 50px rgba(0, 0, 0, .38);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); background: var(--bg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
a { color: inherit; }

/* Hintergrund: Wolkenhimmel (Ausschnitt aus dem Referenzbild "Download (1)", weichgezeichnet) unter einem dunklen Verlauf */
.sky {
  position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 13, 24, .05) 0%, rgba(7, 13, 24, .3) 50%, rgba(7, 13, 24, .72) 100%),
    url("sky.jpg") center top / cover no-repeat,
    #0a1424;
}
.sky i { display: none; }

.shell { max-width: 1680px; margin: 0 auto; padding: 22px clamp(16px, 2.4vw, 40px) 40px; display: grid; gap: 18px; }

.top { display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd58a, #f08a3c 55%, transparent 56%), radial-gradient(circle at 65% 68%, #cfe0ff 0 42%, transparent 43%);
  box-shadow: 0 0 0 1px var(--glass-line); }
.search { display: flex; gap: 8px; width: min(440px, 100%); }
.search input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px; font: inherit; color: var(--ink);
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 12px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.search input::placeholder { color: var(--muted); }
.search input:focus-visible, .search button:focus-visible, .alt-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.search button {
  height: 44px; padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 600; color: #fff; background: var(--accent);
}
.search button:hover { filter: brightness(1.1); }
.alt-link { color: var(--muted); font-size: .9rem; text-decoration: none; padding: 8px 4px; }
.alt-link:hover { color: var(--ink); text-decoration: underline; }

.status { margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-line); }
.status.err { border-color: #e5484d; }

/* Aufbau: Radar groß links, Wetter rechts, darunter Stunden und Regentage */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.radar-panel { grid-column: 1; grid-row: 1; }
.side { grid-column: 2; grid-row: 1; display: grid; gap: 18px; align-self: stretch; }
.hours-panel, .heat-panel { grid-column: 1 / -1; }

.panel {
  padding: 20px; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-line);
  box-shadow: var(--shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); min-width: 0;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 1.1rem; }
.panel-sub { margin: 0; color: var(--muted); font-size: .85rem; }

/* Radar: das Wichtigste, deshalb so hoch wie der Bildschirm es zulässt */
.radar-panel .wr { --wr-map-h: clamp(460px, calc(100dvh - 290px), 780px); }

.now { display: flex; flex-direction: column; }
.place { margin: 0; color: var(--muted); font-weight: 600; font-size: 1.05rem; }
.now-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.temp { margin: 4px 0 0; font-size: clamp(72px, 6.4vw, 104px); font-weight: 700; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.deg { font-size: .4em; font-weight: 600; color: var(--muted); margin-left: 4px; vertical-align: top; }
.now-icon { font-size: clamp(64px, 5.2vw, 88px); line-height: 1; }
.cond { margin: 6px 0 0; font-size: 1.25rem; text-transform: capitalize; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 0; }
.facts div { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(255,255,255,.03); }
.facts dt { font-size: .76rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.text { margin: 18px 0 0; color: var(--muted); }

/* Tagesvorschau */
.side { grid-template-rows: auto 1fr; }
.days-panel { display: flex; flex-direction: column; }
.days-panel h2 { margin-bottom: 10px; }
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.days li { display: grid; grid-template-columns: 62px 30px 44px 34px 1fr 34px; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--glass-line); font-variant-numeric: tabular-nums; }
.days li:last-child { border-bottom: 0; }
.days .n { font-weight: 600; }
.days .i { font-size: 1.2rem; text-align: center; }
.days .r { font-size: .75rem; color: #7fb0ff; text-align: right; }
.days .t { text-align: right; font-weight: 600; }
.days li > :nth-child(4) { color: var(--muted); font-weight: 500; }
.days .rng { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); }
.days .rng i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #6ea6f0, #ffc46b); }
.sun { margin: 12px 0 0; color: var(--muted); font-size: .85rem; }

/* Stundenverlauf mit Kurve */
.hours { position: relative; }
.hours-cols { display: grid; grid-template-columns: repeat(var(--n, 24), minmax(0, 1fr)); text-align: center; }
.hours-cols > div { padding: 4px 0; }
.hours-cols .h { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hours-cols .i { font-size: 1.5rem; line-height: 1.3; }
.hours-cols .r { font-size: .72rem; color: #7fb0ff; min-height: 1.1em; font-variant-numeric: tabular-nums; }
.hours svg { display: block; width: 100%; height: 130px; overflow: visible; touch-action: none; }
.hours .curve { fill: none; stroke: #cfe0ff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hours .area { fill: url(#hoursFill); stroke: none; }
.hours .dot { fill: #0a1424; stroke: #cfe0ff; stroke-width: 2; }
.hours .lbl { fill: var(--ink); font-size: 12px; font-weight: 600; text-anchor: middle; font-variant-numeric: tabular-nums; }
.hours .cross { stroke: rgba(207,224,255,.45); stroke-width: 1; stroke-dasharray: 3 4; }
.hours .hot { fill: #ffd58a; stroke: #0a1424; stroke-width: 2; }

.foot { color: var(--muted); font-size: .8rem; }
.foot p { margin: 0 0 6px; }

/* Schmalere Laptops: Wetter-Karte unter das Radar */
@media (max-width: 1180px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .radar-panel, .side { grid-column: 1; }
  .side { grid-row: 2; }
}
@media (prefers-reduced-motion: no-preference) {
  .panel { animation: rise .4s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
}
