/* Wetterwarte – kühles Instrumentenpapier, eine rote Thermometerlinie als einziger Akzent */
:root {
  --paper: #eef2f4;
  --panel: #f8fafb;
  --ink: #17242e;
  --muted: #5b6b76;
  --rule: #c9d3d9;
  --temp: #c2362b;
  --cold: #2c6e9b;
  --wind: #6b7f8e;
  --ok: #2f7d4f;
  --focus: #1f5fbf;
  --num: "Bahnschrift", "DIN Alternate", "Barlow Semi Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121a20; --panel: #18222a; --ink: #e3eaee; --muted: #93a3ae; --rule: #2c3a44;
    --temp: #f0614f; --cold: #6fa8d2; --wind: #9fb1bf; --ok: #5fbf86; --focus: #8ab4ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--body);
}
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Kopfzeile */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { font-family: var(--num); font-size: 1.15rem; letter-spacing: .02em; text-decoration: none; font-weight: 600; }
.brand::before { content: ""; display: inline-block; width: 4px; height: 1em; background: var(--temp); margin-right: 8px; vertical-align: -2px; }
.nav { display: flex; gap: 18px; margin-left: auto; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); text-decoration: underline; }
.stations { display: flex; gap: 6px; flex-wrap: wrap; }
.stations a { padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; font-size: .9rem; }
.stations a[aria-current="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* Kopf der Station */
.hero { padding: 36px 0 28px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.hero h1 { font-size: 1.05rem; font-weight: 600; margin: 0 0 2px; }
.stamp { font-size: .9rem; color: var(--muted); margin: 0; }
.stamp.stale { color: var(--temp); }
.bigtemp { font-family: var(--num); font-size: clamp(5rem, 15vw, 9.5rem); line-height: .9; margin: 18px 0 4px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bigtemp small { font-size: .35em; letter-spacing: 0; color: var(--muted); vertical-align: top; margin-left: 4px; }
.feels { color: var(--muted); margin: 0 0 22px; }

/* Spannweitenleiste: 30-Tage-Bereich, heutiger Bereich, aktueller Wert */
.range { position: relative; margin-top: 8px; }
.range .track { position: relative; height: 10px; background: var(--rule); border-radius: 5px; }
.range .band30 { position: absolute; inset: 0; border-radius: 5px; background: color-mix(in srgb, var(--cold) 22%, transparent); }
.range .band7 { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--cold) 45%, transparent); border-radius: 5px; }
.range .today { position: absolute; top: -3px; bottom: -3px; background: var(--temp); border-radius: 8px; opacity: .85; }
.range .now { position: absolute; top: -9px; width: 3px; height: 28px; background: var(--ink); border-radius: 2px; transform: translateX(-1px); }
.range .scale { display: flex; justify-content: space-between; font-size: .85rem; margin-top: 10px; }
.range .legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.range .legend i { display: inline-block; width: 18px; height: 8px; border-radius: 4px; margin-right: 6px; vertical-align: 0; }
.range .legend .l-today { background: var(--temp); }
.range .legend .l-7 { background: color-mix(in srgb, var(--cold) 45%, transparent); }
.range .legend .l-30 { background: color-mix(in srgb, var(--cold) 22%, transparent); }

/* Instrumente */
.readouts { margin: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--rule); }
.readouts > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.readouts dt { color: var(--muted); font-size: .95rem; }
.readouts dd { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.readouts .v { font-family: var(--num); font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.readouts .u { color: var(--muted); font-size: .95rem; }
.readouts .sub { color: var(--muted); font-size: .9rem; width: 100%; }
.compass { width: 44px; height: 44px; flex: none; }
.compass circle { fill: none; stroke: var(--rule); stroke-width: 2; }
.compass path { fill: var(--ink); transition: transform .6s ease; transform-origin: 22px 22px; }
.compass text { font: 600 7px var(--body); fill: var(--muted); text-anchor: middle; }
@media (prefers-reduced-motion: reduce) { .compass path { transition: none; } }

/* Abschnitte */
section { padding: 28px 0; border-top: 1px solid var(--rule); }
section > h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 14px; display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
section > h2 .tools { margin-left: auto; font-weight: 400; font-size: .9rem; display: flex; gap: 4px; }

/* Tabelle Heute / 7 / 30 */
.table-scroll { overflow-x: auto; }
table.stats { border-collapse: collapse; width: 100%; min-width: 640px; }
table.stats th, table.stats td { padding: 8px 12px 8px 0; text-align: right; border-bottom: 1px solid var(--rule); }
table.stats th:first-child, table.stats td:first-child { text-align: left; }
table.stats thead th { font-weight: 600; font-size: .9rem; color: var(--muted); }
table.stats thead tr:first-child th { color: var(--ink); font-size: 1rem; border-bottom: 2px solid var(--ink); }
table.stats td { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 1.05rem; }
table.stats td:first-child { font-family: var(--body); font-size: .95rem; }
table.stats td.hi { color: var(--temp); }
table.stats td.lo { color: var(--cold); }
table.stats .grp { border-left: 1px solid var(--rule); padding-left: 12px; }
.at { display: block; font-family: var(--body); font-size: .75rem; color: var(--muted); }

/* Diagramme */
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
.chart h3 { font-size: .95rem; font-weight: 600; margin: 0 0 6px; }
.chart .box { position: relative; height: 210px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 4px 10px; font: inherit; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

footer { padding: 26px 0 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--rule); }

/* Formulare (Anmeldung, Archiv, Verwaltung) */
.page { padding: 32px 0 60px; }
.page h1 { font-size: 1.5rem; margin: 0 0 6px; font-weight: 600; }
.lead { color: var(--muted); margin: 0 0 24px; max-width: 70ch; }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 20px; }
.form { display: grid; gap: 14px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; align-items: end; }
label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule);
  border-radius: 6px; padding: 8px 10px; min-width: 0;
}
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ink); }
.btn { font: inherit; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 6px; padding: 8px 16px; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.danger { background: transparent; color: var(--temp); border-color: var(--temp); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.msg { margin: 0; font-size: .95rem; }
.msg.error { color: var(--temp); }
.msg.ok { color: var(--ok); }
.login { max-width: 380px; margin: 9vh auto 0; }
.fieldset { border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.fieldset legend { color: var(--muted); font-size: .9rem; padding: 0 4px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
table.list { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.list th, table.list td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.list th { color: var(--muted); font-weight: 600; font-size: .85rem; }
table.list td.n { text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule); font-size: .8rem; }
.pill.on { border-color: var(--ok); color: var(--ok); }
.pill.off { border-color: var(--temp); color: var(--temp); }
.secret { white-space: pre-wrap; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--paper); border: 1px dashed var(--temp); padding: 10px 12px; border-radius: 6px; word-break: break-all; }
pre.params { font-size: .8rem; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; color: var(--muted); }
details summary { cursor: pointer; }
.records { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0; }
.records div { border-left: 3px solid var(--rule); padding-left: 10px; }
.records dt { font-size: .85rem; color: var(--muted); }
.records dd { margin: 0; font-family: var(--num); font-size: 1.4rem; }
.records dd small { display: block; font-family: var(--body); font-size: .8rem; color: var(--muted); }
.hidden { display: none !important; }
.empty { padding: 50px 0; max-width: 60ch; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 26px; }
  .charts { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .readouts > div { grid-template-columns: 7.5rem 1fr; }
}
