@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: light;
  --himmel: #e9eff2;       /* Seitenhintergrund, kühles Nebelgrau */
  --flaeche: #fbfcfc;      /* Diagrammfläche */
  --tinte: #17242b;
  --tinte-2: #4f5d65;
  --tinte-3: #7b878d;
  --linie: #d5dde1;
  --gitter: #e6ebee;
  --temp: #eb6834;
  --tau: #2a78d6;
  --wind: #2a78d6;
  --boe: #9ec5f4;
  --regen: #2a78d6;
  --pv: #eda100;
  --ref: #b9c3c8;
  --nacht: rgba(23, 36, 43, 0.045);
  --karte: #cfdce7;        /* Registrierkarte */
  --mond-dunkel: #c3ced5;
  --mond-hell: #fbf7e4;
  --mond-rand: #9aa8b0;
  --karte-linie: #8aa3b8;
  --brand: #4a2c14;        /* Brandspur */
  --warnung-grund: #fff4d6;
  --warnung-rand: #e0b030;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --himmel: #11191e;
    --flaeche: #172127;
    --tinte: #e8eef0;
    --tinte-2: #aab7bd;
    --tinte-3: #7f8d93;
    --linie: #2c3a42;
    --gitter: #223038;
    --temp: #f07a48;
    --tau: #5598e7;
    --wind: #5598e7;
    --boe: #256abf;
    --regen: #5598e7;
    --pv: #e0a21a;
    --ref: #4a5a62;
    --nacht: rgba(0, 0, 0, 0.22);
    --karte: #263a4a;
    --mond-dunkel: #26333a;
    --mond-hell: #ece6c8;
    --mond-rand: #4a5a62;
    --karte-linie: #4d6a80;
    --brand: #f2b45a;
    --warnung-grund: #3a3010;
    --warnung-rand: #a07a10;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --himmel: #11191e; --flaeche: #172127; --tinte: #e8eef0; --tinte-2: #aab7bd; --tinte-3: #7f8d93;
  --linie: #2c3a42; --gitter: #223038; --temp: #f07a48; --tau: #5598e7; --wind: #5598e7; --boe: #256abf;
  --regen: #5598e7; --pv: #e0a21a; --ref: #4a5a62; --nacht: rgba(0,0,0,.22); --karte: #263a4a;
  --mond-dunkel: #26333a; --mond-hell: #ece6c8; --mond-rand: #4a5a62; --karte-linie: #4d6a80; --brand: #f2b45a; --warnung-grund: #3a3010; --warnung-rand: #a07a10;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--himmel);
  color: var(--tinte);
  font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.seite {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}
@media (min-width: 48rem) { .seite { padding: 3.5rem 2rem 4rem; } }

h1, h2 { margin: 0; font-weight: 600; }

h1 {
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h2 {
  font-stretch: 112%;
  font-size: 1.25rem;
  line-height: 1.25;
}

.kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  border-bottom: 1px solid var(--linie);
  padding-bottom: 1rem;
}
.stand { margin: 0; color: var(--tinte-2); font-size: 0.95rem; }

.hinweis {
  margin: 1rem 0 0;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--warnung-rand);
  background: var(--warnung-grund);
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------- aktuelle Werte */

.jetzt {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem 3rem;
  padding: 2rem 0 2.5rem;
}
@media (min-width: 52rem) {
  .jetzt { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: end; }
}

.grosswert {
  margin: 0;
  font-stretch: 125%;
  font-weight: 250;
  font-size: clamp(5.5rem, 22vw, 10.5rem);
  line-height: 0.85;
  letter-spacing: -0.045em;
}
.grosswert .einheit {
  font-size: 0.32em;
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 0.15em;
  vertical-align: 0.95em;
  color: var(--tinte-2);
}
.nebenwert { margin: 0.6rem 0 0; color: var(--tinte-2); font-size: 1.05rem; }
.nebenwert + .nebenwert { margin-top: 0.15rem; }
.nebenwert strong { color: var(--tinte); font-weight: 600; }

.werte {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--linie);
}
.werte > div {
  padding: 0.8rem 0.5rem 0.8rem 0;
  border-bottom: 1px solid var(--linie);
}
.werte dt { color: var(--tinte-2); font-size: 0.9rem; }
.werte dd {
  margin: 0.1rem 0 0;
  font-stretch: 112%;
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.2;
}
.werte dd small { font-size: 0.6em; font-weight: 400; color: var(--tinte-2); margin-left: 0.15em; }
.werte .wind { grid-column: 1 / -1; }
.werte .wind dd { display: flex; align-items: center; gap: 0.9rem; }
.werte .wind dd span small { display: block; margin: 0.1rem 0 0; font-size: 0.6em; }

.kompass { width: 3.6rem; height: 3.6rem; flex: none; }
.kompass-ring { fill: var(--flaeche); stroke: var(--linie); stroke-width: 2; }
.kompass-marken text {
  font-family: inherit; font-size: 11px; fill: var(--tinte-3);
  text-anchor: middle; font-weight: 500;
}
.kompass-pfeil { fill: var(--tinte); transition: transform 0.6s ease; transform-origin: 0 0; }
.kompass-pfeil.still { fill: var(--tinte-3); opacity: 0.35; }
@media (prefers-reduced-motion: reduce) { .kompass-pfeil { transition: none; } }

/* ---------------------------------------------------------------- Sonnenscheinstreifen */

.sonne, .verlauf, .tage { padding: 2rem 0; border-top: 1px solid var(--linie); }

.erklaerung { margin: 0.4rem 0 1.25rem; max-width: 42rem; color: var(--tinte-2); font-size: 0.95rem; }

.streifen { display: grid; gap: 1rem; }
.streifen-zeile {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  align-items: center;
}
@media (max-width: 34rem) {
  .streifen-zeile { grid-template-columns: 1fr; }
}
.streifen-zeile .tag { line-height: 1.25; }
.streifen-zeile .tag b { display: block; font-weight: 600; }
.streifen-zeile .tag span { color: var(--tinte-2); font-size: 0.95rem; }
.streifen svg { display: block; width: 100%; height: auto; overflow: visible; }
.karte { fill: var(--karte); }
.karte-stunde { stroke: var(--karte-linie); stroke-width: 1; }
.karte-text { fill: var(--tinte-2); font-family: inherit; font-size: 11px; text-anchor: middle; }
.brand { fill: var(--brand); }
.karte-luecke { fill: var(--flaeche); opacity: 0.55; }

.himmel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 2.5rem;
  margin-top: 1.75rem;
  align-items: center;
}
@media (min-width: 52rem) { .himmel { grid-template-columns: minmax(0, 1fr) auto; } }
.sonnenzeiten {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--linie);
}
@media (min-width: 40rem) { .sonnenzeiten { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sonnenzeiten > div { padding: 0.6rem 0.5rem 0.6rem 0; border-bottom: 1px solid var(--linie); }
.sonnenzeiten dt { color: var(--tinte-2); font-size: 0.9rem; }
.sonnenzeiten dd { margin: 0.1rem 0 0; font-stretch: 112%; font-size: 1.35rem; font-weight: 500; }
.mond { display: flex; align-items: center; gap: 0.9rem; }
.mond-bild { width: 3.6rem; height: 3.6rem; flex: none; }
.mond b { display: block; font-weight: 600; }
.mond span { color: var(--tinte-2); font-size: 0.95rem; }

/* ---------------------------------------------------------------- Diagramme */

.verlauf h2 { margin-bottom: 1rem; }
.diagramm { margin: 0 0 1.25rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px; padding: 0.8rem 0.6rem 0.2rem; }
.diagramm figcaption {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.25rem 1rem; padding: 0 0.4rem; font-weight: 600; font-size: 0.98rem;
}
.legende { font-weight: 400; font-size: 0.88rem; color: var(--tinte-2); }
.legende i {
  display: inline-block; width: 1rem; height: 2px; vertical-align: middle;
  margin: 0 0.35rem 0 0.8rem; border-radius: 1px;
}
.legende i:first-child { margin-left: 0; }
.l-temp { background: var(--temp); }
.l-tau { background: var(--tau); }
.l-wind { background: var(--wind); }
.l-boe { background: var(--boe); height: 6px !important; }
.l-pv { background: var(--pv); height: 6px !important; }
.l-ref { background: var(--ref); }
.chart { width: 100%; height: 15rem; }
.chart-klein { height: 11rem; }

/* ---------------------------------------------------------------- Tabelle */

.tage-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.umschalter { display: inline-flex; border: 1px solid var(--linie); border-radius: 6px; overflow: hidden; }
.umschalter button {
  font: inherit; font-size: 0.9rem; color: var(--tinte-2); background: transparent;
  border: 0; padding: 0.4rem 0.8rem; cursor: pointer;
}
.umschalter button + button { border-left: 1px solid var(--linie); }
.umschalter button[aria-pressed="true"] { background: var(--tinte); color: var(--himmel); }
.umschalter button:focus-visible { outline: 2px solid var(--tau); outline-offset: -2px; }

.tabelle-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 40rem; }
th, td { padding: 0.45rem 0.6rem; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
thead th { font-weight: 500; color: var(--tinte-2); font-size: 0.85rem; border-bottom: 1px solid var(--tinte-3); }
tbody tr + tr td { border-top: 1px solid var(--gitter); }
tbody tr.wochenende td:first-child { color: var(--tinte-2); }
td.unsicher { color: var(--tinte-3); }
.fussnote { margin: 0.75rem 0 0; color: var(--tinte-3); font-size: 0.85rem; }

.fuss { border-top: 1px solid var(--linie); padding-top: 1.5rem; color: var(--tinte-2); font-size: 0.9rem; max-width: 46rem; }
.fuss p { margin: 0 0 0.6rem; }
