:root {
  --bg: #eef2f6;
  --card: #ffffff;
  --text: #16202b;
  --muted: #627080;
  --line: #d9e0e7;
  --wind: #1e88e5;
  --gust: #f4511e;
  --temp: #fb8c00;
  --rain: #3949ab;
  --ok: #2e7d32;
  --warn: #ef6c00;
  --bad: #c62828;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151c;
    --card: #18212b;
    --text: #e8eef4;
    --muted: #8d9aa8;
    --line: #2a3643;
    --wind: #42a5f5;
    --gust: #ff7043;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main, .top, footer { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 12px; flex-wrap: wrap; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1rem; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
h2.mt { margin-top: 16px; }

.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--card); font-size: .9rem; font-weight: 600; }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status--ok .dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.status--warn .dot { background: var(--warn); }
.status--bad .dot { background: var(--bad); }

.banner { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--bad) 14%, var(--card)); border: 1px solid var(--bad); }
.banner.warn { background: color-mix(in srgb, var(--warn) 14%, var(--card)); border-color: var(--warn); }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
.label { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

.hero { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 24px; align-items: center; }
.hero__compass svg { width: 100%; height: auto; display: block; }
.big { font-size: clamp(2.6rem, 9vw, 4rem); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--wind); }
.big--gust { color: var(--gust); }
.unit { font-size: .4em; font-weight: 600; margin-left: 6px; color: var(--muted); }
.sub { color: var(--muted); font-size: .9rem; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.from { font-size: 1.15rem; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { margin-bottom: 12px; }
.mid { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 8px; margin: 4px 0 12px; }
.tabs button { flex: 1; max-width: 140px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 8px 12px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
.tabs button.active { background: var(--wind); border-color: var(--wind); color: #fff; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chart { width: 100%; height: 220px; display: block; }
.chart--small { height: 110px; }
#rose { width: 100%; max-width: 360px; height: auto; display: block; margin: 0 auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: .85rem; margin-top: 8px; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sw--wind { background: var(--wind); }
.sw--gust { background: color-mix(in srgb, var(--gust) 45%, transparent); border: 1px solid var(--gust); }

svg text { fill: var(--muted); font: 12px system-ui, sans-serif; }
.grid line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.l-wind { fill: none; stroke: var(--wind); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.a-gust { fill: color-mix(in srgb, var(--gust) 30%, transparent); stroke: var(--gust); stroke-width: 1; vector-effect: non-scaling-stroke; }
.l-temp { fill: none; stroke: var(--temp); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.b-rain { fill: var(--rain); }
.ring { fill: none; stroke: var(--line); }
.tick { stroke: var(--muted); }
.cardinal { fill: var(--text); font-weight: 700; font-size: 16px; }
.arrow { fill: var(--gust); }
.from-dot { fill: var(--wind); }

footer { color: var(--muted); font-size: .85rem; padding-bottom: 32px; }
footer a { color: inherit; }
.disclaimer { background: var(--card); border-radius: var(--radius); padding: 12px 16px; color: var(--text); }

.is-stale .big, .is-stale .mid, .is-stale .from { opacity: .4; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero__compass { max-width: 240px; margin: 0 auto; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
}

/* Grid-Spalten dürfen schmaler werden als ihr Inhalt (sonst schieben SVGs die Seite breit) */
.hero > *, .tiles > *, .two > * { min-width: 0; }
html, body { overflow-x: hidden; }

/* Sprung-Ampel */
.ampel { display: flex; align-items: center; gap: 20px; border: 2px solid var(--line); }
.ampel__lights { display: flex; flex-direction: column; gap: 6px; background: #1d252e; padding: 8px; border-radius: 14px; }
.ampel__lights .l { width: 30px; height: 30px; border-radius: 50%; background: #3a4552; }
.ampel__title { font-size: clamp(1.25rem, 4.5vw, 1.7rem); font-weight: 800; line-height: 1.2; margin: 2px 0 4px; }
.ampel__vals { color: var(--muted); font-variant-numeric: tabular-nums; }
.ampel--gruen { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--card)); }
.ampel--gruen .l--gruen { background: #43a047; box-shadow: 0 0 14px #43a047; }
.ampel--gelb { border-color: #f9a825; background: color-mix(in srgb, #f9a825 14%, var(--card)); }
.ampel--gelb .l--gelb { background: #fdd835; box-shadow: 0 0 14px #fdd835; }
.ampel--rot { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--card)); }
.ampel--rot .l--rot { background: #e53935; box-shadow: 0 0 14px #e53935; }
