/* Schrift selbst gehostet (DSGVO): Dateien nach assets/fonts/ legen, siehe Anleitung.
   Fehlen sie, wird die Systemschrift verwendet. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 300; font-display: swap; src: url(../fonts/IBMPlexSans-Light.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(../fonts/IBMPlexSans-Regular.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(../fonts/IBMPlexSans-Medium.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(../fonts/IBMPlexSans-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(../fonts/IBMPlexMono-Regular.woff2) format("woff2"); }

/* Wetterstation – Design-Tokens laut Design-System „Wetterstation" */
:root {
  --surface: #f7f7f5; --surface-raised: #ffffff; --ink: #1c1f22; --ink-muted: #5b636b;
  --line: #dcdfe2; --line-strong: #8a949c; --accent: #1f5f8b; --on-accent: #ffffff;
  --sun: #b8670f; --moon: #6b7580; --ridge: #3d4a42; --terrain: #c9cec3;
  --temp-cold: #2f6fb0; --temp-warm: #c0392b; --warn: #b3261e; --on-warn: #ffffff;
  --space-1: 4px; --space-2: 8px; --space-4: 16px; --space-6: 24px; --space-12: 48px;
  --radius-sm: 4px; --radius-md: 8px; --radius-full: 9999px;
  --sans: "IBM Plex Sans", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #121416; --surface-raised: #1b1e21; --ink: #e8eaec; --ink-muted: #9aa3ab;
    --line: #2c3136; --line-strong: #6b757d; --accent: #74b6e3; --on-accent: #0e1a24;
    --sun: #e5a25a; --moon: #b8c0c8; --ridge: #39443d; --terrain: #7a857c;
    --temp-cold: #7ab0e6; --temp-warm: #ef8a7a; --warn: #ff8a80; --on-warn: #2a0b09;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #121416; --surface-raised: #1b1e21; --ink: #e8eaec; --ink-muted: #9aa3ab;
  --line: #2c3136; --line-strong: #6b757d; --accent: #74b6e3; --on-accent: #0e1a24;
  --sun: #e5a25a; --moon: #b8c0c8; --ridge: #39443d; --terrain: #7a857c;
  --temp-cold: #7ab0e6; --temp-warm: #ef8a7a; --warn: #ff8a80; --on-warn: #2a0b09;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font: 400 16px/24px var(--sans); font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Typografie */
.value-xl { font-size: 56px; line-height: 60px; font-weight: 300; }
.value-md { font-size: 28px; line-height: 32px; font-weight: 400; }
h1, .heading { font-size: 22px; line-height: 28px; font-weight: 600; margin: 0; }
h2 { font-size: 22px; line-height: 28px; font-weight: 600; margin: 0 0 var(--space-4); }
.small { font-size: 14px; line-height: 20px; }
.label { font-size: 12px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.data { font: 400 13px/18px var(--mono); }
.unit { color: var(--ink-muted); margin-left: var(--space-1); }

/* Seitenkopf und Reiter */
.kopf { max-width: 1200px; margin: 0 auto; padding: var(--space-4); display: flex; align-items: center; gap: var(--space-4); }
.kopf .titel { flex: 1; font-weight: 600; font-size: 18px; text-decoration: none; color: var(--ink); }
.reiter { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-4); display: flex; gap: var(--space-2);
  overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.reiter a { padding: 10px var(--space-2); min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap;
  text-decoration: none; color: var(--ink-muted); border-bottom: 2px solid transparent; }
.reiter a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: none;
  color: var(--ink); border-radius: var(--radius-sm); cursor: pointer; }
.icon-btn svg, .icon svg, svg.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }

main { max-width: 1200px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-12); }
section + section { margin-top: var(--space-12); }

/* Status */
.status { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 var(--space-6); }
.status .punkt { width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--accent); }
.status.offline .punkt { background: var(--warn); }
.status.offline { color: var(--warn); }
.offline-werte .wert { color: var(--ink-muted); }

/* Warnungen */
.banner { border: 2px solid var(--warn); border-radius: var(--radius-md); padding: var(--space-4);
  margin-bottom: var(--space-4); background: var(--surface-raised); }
.banner.stark { background: var(--warn); color: var(--on-warn); border-color: var(--warn); }
.banner.stark a, .banner.stark .muted { color: var(--on-warn); }
.banner .zeile { display: flex; gap: var(--space-2); align-items: center; font-weight: 500; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
@media (min-width: 720px) { .kacheln { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .kacheln { grid-template-columns: repeat(3, 1fr); } }
.kachel { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-4); text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%;
  display: flex; flex-direction: column; gap: var(--space-2); min-height: 44px; }
.kachel.breit { grid-column: 1 / -1; }
.kachel[aria-pressed="true"] { border-color: var(--accent); }
.kachel.warnung { border: 2px solid var(--warn); }
.kachel.stark { border: 4px double var(--warn); }
.kachel .zeilen { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.kachel .hinweis { color: var(--ink-muted); }

/* Bedienelemente */
.gruppe { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-2) 0; }
.gruppe .label { width: 100%; }
.btn { min-height: 44px; padding: 0 var(--space-4); border: 1px solid var(--line-strong); background: var(--surface-raised);
  color: var(--ink); border-radius: var(--radius-sm); font: inherit; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: var(--space-2); }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn input[type="date"] { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

input[type="range"] { width: 100%; height: 44px; accent-color: var(--accent); margin: 0; }
input[type="range"]::-webkit-slider-thumb { width: 28px; height: 28px; }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; }

/* Diagramme */
.diagramm { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); }
.diagramm svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.diagramm .kennzahlen { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); margin-top: var(--space-2); }
.tooltip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm); font-size: 14px; line-height: 20px; white-space: nowrap; transform: translate(-50%, -120%); }
.rel { position: relative; }

/* Panorama */
.panorama { overflow-x: auto; overflow-y: hidden; background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: var(--radius-md); -webkit-overflow-scrolling: touch; }
.panorama svg { display: block; }
.tagesbalken { display: grid; gap: var(--space-1); margin-top: var(--space-2); }
.tagesbalken svg { width: 100%; height: auto; display: block; cursor: pointer; }
.statuszeile { display: flex; justify-content: space-between; gap: var(--space-4); margin: var(--space-2) 0 var(--space-4); }
.statuszeile .rechts { text-align: right; }
.legende { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: 14px; color: var(--ink-muted); margin-bottom: var(--space-4); }
.legende i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: var(--space-1); vertical-align: middle; }
.werte-tabelle { display: grid; grid-template-columns: 1fr; gap: var(--space-2) var(--space-6); }
@media (min-width: 720px) { .werte-tabelle { grid-template-columns: repeat(2, 1fr); } }
.werte-tabelle div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: var(--space-1) 0; }

/* 3D */
.ansicht3d { position: relative; height: min(70vh, 640px); min-height: 320px; background: var(--surface-raised);
  border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; touch-action: none; }
.ansicht3d canvas { display: block; width: 100%; height: 100%; }
.ansicht3d .laden { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-muted); }
.gipfel3d { font-size: 12px; line-height: 16px; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; white-space: nowrap; pointer-events: none; }
.gipfel3d.verdeckt { opacity: .5; }

.fuss { max-width: 1200px; margin: 0 auto; padding: var(--space-6) var(--space-4); color: var(--ink-muted); font-size: 14px; border-top: 1px solid var(--line); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
