/* VINORUM METEO – CI V2. Markenfarben: Deep Navy / Meteo-Blau / Vine Gold. */
:root {
  --brand: #2563eb;           /* Meteo Blue */
  --accent: #d4b88c;          /* Vine Gold */
  --accent-soft: #e6d4b6;
  --bg: #f2f4f7;              /* Light Gray */
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --text: #0f1b2e;           /* Deep Navy */
  --muted: #5b6b82;
  --line: #e4e8ef;
  --line-strong: #cfd6e2;
  --danger: #e63946;         /* Risk Red */
  --ok: #22c55e;             /* Vine Green */
  --shadow-sm: 0 1px 2px rgba(15,27,46,.05);
  --shadow: 0 2px 6px rgba(15,27,46,.07), 0 10px 30px rgba(15,27,46,.08);
  --r-lg: 20px;
  --r: 14px;
  --r-sm: 10px;
  color-scheme: light dark;
}
/* Dunkle Palette: automatisch nach System (außer explizit „light") ODER explizit „dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #3b82f6; --accent: #d4b88c; --accent-soft: #d4b88c;
    --bg: #0f1b2e; --surface: #17233b; --surface-2: #1d2c48; --text: #f2f4f7; --muted: #93a1b5;
    --line: #2a3a54; --line-strong: #37496b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 2px 8px rgba(0,0,0,.35), 0 12px 34px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --brand: #3b82f6; --accent: #d4b88c; --accent-soft: #d4b88c;
  --bg: #0f1b2e; --surface: #17233b; --surface-2: #1d2c48; --text: #f2f4f7; --muted: #93a1b5;
  --line: #2a3a54; --line-strong: #37496b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 2px 8px rgba(0,0,0,.35), 0 12px 34px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  /* Das DOKUMENT scrollt nie – gescrollt wird ausschliesslich in .view bzw.
     .screen-auth. Sonst schiebt sich auf dem Handy beim Scrollen in den
     Stationen die ganze Seite mit (Gummiband/Adressleiste) und Kopf- sowie
     Fussleiste wandern ein Stueck aus dem Bild. `overscroll-behavior: none`
     unterbindet zusaetzlich Gummiband-Effekt und Pull-to-Refresh. */
  overflow: hidden;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
h1, h2 { margin: 0; }

/* Icons (Material inline-SVG) */
svg { display: block; }
.icon-btn svg, .mi svg, button svg { width: 22px; height: 22px; fill: currentColor; }
.mi { display: inline-flex; }

/* Screens */
/* Feste Buehne in Viewport-Hoehe: Kopf und Fussleiste sind Flex-Kinder und
   bleiben dadurch strukturell stehen; scrollbar ist nur der Bereich dazwischen. */
.screen { display: flex; flex-direction: column; height: 100dvh; }

/* Buttons */
.icon-btn {
  border: 0; background: transparent; color: var(--text);
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.icon-btn:disabled { opacity: .32; cursor: default; }
.icon-btn:disabled:hover { background: transparent; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm svg { width: 19px; height: 19px; }
.icon-btn.danger { color: var(--danger); }
/* Abmelden: klar als Aktion erkennbar (statt eines missverständlichen Zurück-Pfeils) */
.icon-btn.logout-btn { color: var(--brand); border: 1px solid var(--line-strong); border-radius: 999px; }
.icon-btn.logout-btn:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: var(--brand); }
.btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 11px 16px; font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); border-color: var(--brand); }
.btn-ghost { border: 0; background: transparent; color: var(--muted); }

/* Logo – eigene Variante je Modus (statt Monochrom-Filter): hell = farbig,
   dunkel = weiße Schrift mit erhaltener goldener Schale (CI V3). */
.head-logo, .auth-logo { width: auto; object-fit: contain; }
.head-logo { height: 42px; }
/* Sprachwahl oben rechts in der Anmeldekarte (negative Ränder = bündig in die Ecke) */
.auth-top { display: flex; justify-content: flex-end; margin: -14px -10px -4px 0; }
/* „Über" am Fuß der Anmeldekarte (dort gibt es noch keine Fuß-Toolbar) */
.auth-foot { display: flex; justify-content: center; margin-top: 2px; font-size: 12px; }
/* Sichtbarkeit AUSSCHLIESSLICH über diese beiden Klassen steuern – niemals
   zusätzlich über .head-logo/.auth-logo ein `display` setzen. Genau das war der
   Fehler: Ein späteres `.auth-logo { display:block }` gewann bei gleicher
   Spezifität und zeigte auf der Anmeldeseite BEIDE Logos untereinander. */
.logo-light { display: block; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
:root[data-theme="light"] .logo-light { display: block; }
:root[data-theme="light"] .logo-dark { display: none; }

/* ---------- Auth ---------- */
/* Anmelden/Registrieren scrollt in sich – das Registrierformular ist laenger als
   der Bildschirm. Zentriert wird ueber `margin:auto` der Karte und NICHT ueber
   justify-content:center: bei Ueberlaenge waere sonst der obere Rand des
   Formulars abgeschnitten und nicht mehr erreichbar. */
.screen-auth { align-items: center; padding: 24px 16px; overflow-y: auto; overscroll-behavior: contain; }
.auth-card {
  width: 100%; max-width: 400px; margin: auto 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 30px 24px;
}
/* KEIN `display` hier – das regeln .logo-light/.logo-dark (siehe oben). */
.auth-logo { height: 40px; margin: 4px auto 0; }
.auth-lead { color: var(--muted); font-size: 13.5px; text-align: center; margin: 16px 0 22px; line-height: 1.55; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.auth-tab { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 9px; cursor: pointer; font: inherit; }
.auth-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.auth-err { color: var(--danger); font-size: 13px; }
/* Registrierung: breiteres Formular, Abschnitte, Mehrfachauswahl, Gast-Einstieg */
.auth-card.is-wide { max-width: 560px; }
.auth-sec { margin: 8px 0 -2px; font-size: 13px; font-weight: 700; color: var(--text); border-top: 1px solid var(--line); padding-top: 14px; }
.auth-sec span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.chk-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.chk-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface-2);
  border-radius: 999px; padding: 7px 12px 7px 10px; font-size: 12.5px; font-weight: 500; color: var(--text); cursor: pointer; }
.chk-chip:hover { border-color: var(--muted); }
.chk-chip:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); font-weight: 600; }
.auth-gast { border-top: 1px solid var(--line); padding-top: 14px; text-align: center; }
.auth-gast-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.link-btn { border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.link-btn:hover { filter: brightness(1.1); }

/* Form fields */
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.fld input, .fld select {
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  border-radius: 11px; padding: 12px 13px; font: inherit; font-weight: 400;
}
.fld input:focus, .fld select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); }
/* Passwortfeld mit „Auge": der Knopf liegt IM Feld, der Text bekommt rechts Platz. */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; min-width: 0; padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  color: var(--muted); cursor: pointer; padding: 8px; border-radius: 9px; display: inline-flex; }
.pw-eye:hover { color: var(--text); }
.pw-eye svg { width: 20px; height: 20px; fill: currentColor; }
.chk { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--muted); }
.chk a { color: var(--brand); }

/* ---------- Kopf ---------- */
.app-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 8px 10px 16px; }
.head-actions { display: flex; align-items: center; gap: 1px; flex: 0 0 auto; }
.lang-select { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 10px; }
.lang-btn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.lang-btn .lang-caret { display: inline-flex; transition: transform .15s; }
.lang-btn .lang-caret svg { width: 18px; height: 18px; fill: currentColor; }
.lang-select.open .lang-caret { transform: rotate(180deg); }
.lang-flag { width: 24px; height: 17px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 15%, transparent); flex: 0 0 auto; display: block; }
.lang-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; z-index: 30; min-width: 165px; }
.lang-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--text); border-radius: 8px; padding: 10px; font: inherit; cursor: pointer; text-align: left; }
.lang-item:hover { background: var(--surface-2); }
.lang-item.is-active { font-weight: 700; }
.lang-item .li-name { flex: 1; }
.lang-item .si-check { color: var(--brand); display: inline-flex; }
.lang-item .si-check svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Fuß-Toolbar ---------- */
.app-toolbar { position: sticky; bottom: 0; z-index: 15; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tb-btn { flex: 1; display: inline-flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; padding: 7px 4px; border-radius: 12px; }
.tb-btn svg { width: 24px; height: 24px; fill: currentColor; }
.tb-btn.is-active { color: var(--brand); }
/* Sechster Knopf („Auswertungen“, nur Admins): Gemessen bei 11px/600 sind
   „Befallsrisiko“ 59px, „Auswertungen“ 60px und „Einstellungen“ 67px breit. Bei
   sechs Spalten bleiben auf einem 360px-Handy nur 49px je Knopf – die Wörter
   würden sich überlappen. Sechs Beschriftungen passen erst ab ~470px. Darunter
   zeigen wir Admins deshalb nur die Symbole; normale Nutzer sind nicht betroffen. */
@media (max-width: 469px) {
  .app-toolbar.is-admin .tb-btn span { display: none; }
  .app-toolbar.is-admin .tb-btn { padding: 9px 4px; }
}
.tb-btn:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }

/* Stationsauswahl-Zeile: Dropdown links, Verlauf/Live-Toggle rechts */
.station-bar { background: var(--bg); padding: 14px 14px 6px; display: flex; align-items: center; gap: 10px; }
.station-select { position: relative; display: flex; }
.ss-btn { height: 36px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 0 12px 0 5px; font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); max-width: 82vw; }
.ss-btn .ss-ic { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--brand); }
.ss-btn .ss-ic svg { width: 15px; height: 15px; }
.ss-btn .ss-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-btn .ss-chev { color: var(--muted); margin-left: 2px; transition: transform .15s; display: inline-flex; flex: 0 0 auto; }
.ss-btn .ss-chev svg { width: 20px; height: 20px; }
.station-select.open .ss-chev { transform: rotate(180deg); }
.ss-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 250px; max-width: min(340px, 86vw); max-height: 62vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.ss-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--text); border-radius: 11px; padding: 10px; font: inherit; cursor: pointer; text-align: left; }
.ss-item:hover { background: var(--surface-2); }
.ss-item.is-active { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.ss-item .si-ic { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--brand); flex: 0 0 auto; }
.ss-item .si-ic svg { width: 18px; height: 18px; }
.ss-item .si-main { flex: 1; min-width: 0; }
.ss-item .si-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item .si-sub { font-size: 11.5px; color: var(--muted); }
.ss-item .si-check { color: var(--brand); flex: 0 0 auto; }
.ss-sep { height: 1px; background: var(--line); margin: 5px 6px; }

/* Kachel-Übersicht */
.view-home { padding-top: 8px; }
.home-grid { display: flex; flex-direction: column; gap: 12px; }

/* Übersicht: je Zeile eine Station (links) + DWD-Vorhersage (rechts) */
/* Die ganze Zeile ist klickbar (öffnet die Station) – daher cursor auf .srow. */
.srow { display: flex; gap: 0; align-items: stretch; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; cursor: pointer; }
.srow:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
/* Sortieren per Halten & Ziehen */
.srow.is-drag { border-color: var(--brand); box-shadow: var(--shadow); transform: scale(1.015); position: relative; z-index: 5; }
body.is-reordering { user-select: none; -webkit-user-select: none; }
body.is-reordering .srow-main { cursor: grabbing; }
.srow-main { flex: 0 0 clamp(150px, 44%, 320px); min-width: 0; overflow: hidden; text-align: left; color: var(--text); background: transparent; border: 0; cursor: pointer; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
/* Alle Stations-Spalten gleich breit = breiteste Station (geteilte Grid-Spalte).
   Werte-Spalte auf max. 46 % begrenzt, damit die Vorhersage auch auf dem Handy
   danebenpasst – jede Station bleibt EINE Zeile (kein Umbruch). */
@supports (grid-template-columns: subgrid) {
  .home-grid { display: grid; grid-template-columns: fit-content(54%) 1fr; }
  .srow { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
  .srow-main { flex: initial; }
  .srow-fc { flex: initial; }
}
.srow-head { display: flex; align-items: center; gap: 9px; }
.srow-ic { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--brand); flex: 0 0 auto; }
.srow-ic svg { width: 20px; height: 20px; }
.srow-id { min-width: 0; display: flex; flex-direction: column; }
.srow-name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-sub { display: flex; align-items: baseline; min-width: 0; }
.srow-src { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.srow-stand { font-size: 11px; color: var(--muted); white-space: nowrap; flex: 0 0 auto; }
.srow-stand:not(:empty)::before { content: "·"; margin: 0 5px; }
.srow-now { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.srow-fc { flex: 1; min-width: 0; border-left: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
/* Auf schmalen Handys enger, damit Werte + Vorhersage nebeneinander passen. */
@media (max-width: 430px) {
  .srow-main { padding: 12px 10px; gap: 8px; }
  .srow-fc { padding: 10px 8px; }
  .fc-day { padding: 3px 1px; }
  .srow-head { gap: 7px; }
  .srow-ic { width: 28px; height: 28px; border-radius: 9px; }
  .srow-ic svg { width: 17px; height: 17px; }
  .srow-src { font-size: 9.5px; letter-spacing: .03em; }
  .srow-stand { font-size: 10px; }
  .srow-stand:not(:empty)::before { margin: 0 4px; }
}
.tile { position: relative; text-align: left; color: var(--text); border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg);
  padding: 16px; cursor: pointer; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; min-height: 138px;
  transition: transform .12s, box-shadow .15s, border-color .15s; }
.tile:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.tile:active { transform: scale(.99); }
.tile-top { display: flex; align-items: center; gap: 9px; }
.tile-ic { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--brand); flex: 0 0 auto; }
.tile-ic svg { width: 20px; height: 20px; }
.tile-src { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tile-stand { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.tile-name { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.tile-body { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.tile-main { display: flex; align-items: baseline; gap: 4px; }
.tile-temp { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.tile-temp .u { font-size: 15px; color: var(--muted); font-weight: 500; }
.tile-mm { align-self: center; display: inline-flex; flex-direction: column; gap: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.tile-mm span { display: inline-flex; align-items: center; gap: 1px; }
.tile-mm svg { width: 12px; height: 12px; fill: currentColor; }
.tile-mini { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12.5px; }
.tile-mini span { display: inline-flex; align-items: center; gap: 4px; }
.tile-mini svg { width: 15px; height: 15px; fill: currentColor; }
/* Drei Nebenwerte (Wetterstation MIT Blattnässe): enger setzen, damit die Zeile
   auf dem Handy auch bei breiten Werten („100 %", „12,3 m/s") nicht umbricht.
   Bewusst nur hier – die Spaltenbreite bleibt unangetastet, sonst verliert die
   Vorhersage daneben Platz. */
.tile-mini.is-eng { column-gap: 8px; font-size: 11.5px; }
.tile-mini.is-eng svg { width: 14px; height: 14px; }
.tile-note { color: var(--muted); font-size: 12.5px; margin-top: auto; }
.tile.add { align-items: center; justify-content: center; text-align: center; border-style: dashed; color: var(--brand); gap: 6px; }
.tile.add .tile-ic { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.tile.add .tile-name { color: var(--brand); font-size: 15px; }
.home-hint { color: var(--muted); font-size: 13.5px; text-align: center; padding: 34px 14px; line-height: 1.55; }
.live-back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.live-back svg { width: 17px; height: 17px; fill: currentColor; }

/* DWD-Vorhersage-Streifen */
.fc-strip { display: flex; flex-wrap: nowrap; width: 100%; }
.fc-day { flex: 1 1 0; min-width: 0; overflow: hidden; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 1px; }
.fc-day + .fc-day { border-left: 1px solid var(--line); }
.fc-name { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.fc-sym { font-size: 18px; line-height: 1.15; }
.fc-temp { font-size: 11.5px; color: var(--muted); white-space: nowrap; letter-spacing: -.02em; }
.fc-temp b { color: var(--text); font-weight: 700; }
.fc-sub { font-size: 10px; color: var(--muted); white-space: nowrap; }
.fc-src { font-size: 10.5px; color: var(--muted); text-align: right; line-height: 1.35; }
.fc-src > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-src-station { font-size: 10px; opacity: .85; }
.fc-hint { display: inline-flex; align-items: center; gap: 6px; align-self: center; border: 1px dashed var(--line-strong); background: transparent; color: var(--brand); font: inherit; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.fc-hint svg { width: 16px; height: 16px; fill: currentColor; }
/* Anzahl der Vorhersagetage nach Platz: 3 → 5 → 7 (Forecast steht neben den Werten,
   daher später mehr Tage, damit sie nicht gequetscht werden). */
.fc-day:nth-child(n+4) { display: none; }
@media (min-width: 760px) { .fc-day:nth-child(n+4) { display: flex; } .fc-day:nth-child(n+6) { display: none; } }
@media (min-width: 1040px) { .fc-day:nth-child(n+6) { display: flex; } }

/* Version klein am Ende der Einstellungen (über der Fuß-Toolbar) */
/* Fußzeile der Einstellungen: „Über" · „Version x.y.z" */
.set-foot { display: flex; justify-content: center; align-items: center; gap: 0; margin-top: 4px; }
.set-foot-sep { color: var(--muted); font-size: 11.5px; }
.set-version { align-self: center; margin-top: 4px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; padding: 4px 8px; white-space: nowrap; }
.set-version:hover { color: var(--text); }

/* ---------- Hauptbereich ---------- */
.app-main { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
/* Einziger scrollender Bereich der App. `overscroll-behavior: contain` haelt das
   Scrollen hier drin (kein Weiterreichen ans Dokument am oberen/unteren Ende). */
.view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px 14px 20px; }

.live-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 14px; padding: 0 2px; }
.meta-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.meta-src { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
.meta-time { font-size: 12.5px; color: var(--muted); }

/* Sensor-Kacheln */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card {
  position: relative; color: var(--text); border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r); padding: 14px; text-align: left; cursor: pointer;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.card:not(:disabled):hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.card:not(:disabled):active { transform: scale(.985); }
.card:disabled { cursor: default; }
.card-ic { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c, var(--brand)) 14%, transparent); color: var(--c, var(--brand)); }
.card-ic svg { width: 22px; height: 22px; }
.card-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.card-val { font-size: 27px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.card-unit { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.card-valrow { display: flex; align-items: baseline; gap: 8px; }
.card-mm { align-self: center; display: inline-flex; flex-direction: column; gap: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.card-mm span { display: inline-flex; align-items: center; gap: 1px; }
.card-mm svg { width: 12px; height: 12px; flex: 0 0 auto; fill: currentColor; }
.empty-note { grid-column: 1 / -1; color: var(--muted); font-size: 14px; padding: 26px 10px; text-align: center; line-height: 1.5; }
.empty-note.small { font-size: 12.5px; padding: 10px; text-align: left; }

/* ---------- Verlauf ---------- */
.hist-head { margin-bottom: 12px; }
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.seg::-webkit-scrollbar { height: 0; }
.seg-btn {
  flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.seg-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chart-shell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 12px 12px 8px; }
.chart-ctrl { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; min-height: 34px; }
.chart-range { font-size: 13px; font-weight: 600; }
.chart-lade { font-size: 12px; color: var(--muted); }
.chart-btns { margin-left: auto; display: flex; gap: 4px; }
.chart-svg-wrap { touch-action: pan-y; cursor: grab; user-select: none; }
.chart-svg-wrap.is-dragging { cursor: grabbing; }
.chart-hint { font-size: 11.5px; color: var(--muted); text-align: center; margin: 8px 0 2px; }
.pt-svg { width: 100%; height: auto; display: block; overflow: visible; }
.pt-grid-l { stroke: var(--line); stroke-width: 1; }
.pt-ax { fill: var(--muted); font-size: 11px; font-family: system-ui, sans-serif; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin-top: 4px; font-size: 12.5px; color: var(--muted); padding: 4px 2px 0; }
.chart-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 40px 10px; }

/* Verlauf/Live-Toggle (in der Stationszeile, rechtsbündig) */
.mode-toggle { margin-left: auto; flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
  border-radius: 999px; height: 36px; box-sizing: border-box; padding: 0 14px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; box-shadow: var(--shadow-sm); }
.mode-toggle svg { width: 16px; height: 16px; fill: currentColor; flex: 0 0 auto; }
.mode-toggle #modeHint { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mode-toggle:hover { border-color: var(--muted); }
/* Refresh-Button (rechts oben in der Stationsleiste) */
.refresh-btn { margin-left: auto; flex: 0 0 auto; width: 36px; height: 36px; box-sizing: border-box; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.refresh-btn:hover { border-color: var(--muted); color: var(--text); }
.refresh-btn svg { width: 18px; height: 18px; fill: currentColor; }
.refresh-btn.spinning { color: var(--brand); }
.refresh-btn.spinning svg { animation: meteo-spin .8s linear infinite; }
@keyframes meteo-spin { to { transform: rotate(360deg); } }

/* Update-Leiste (direkt unter dem Kopf) */
.update-bar { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--brand); color: #fff; }
.update-bar #updateText { flex: 1; font-size: 13.5px; font-weight: 600; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.update-bar .btn { background: #fff; color: var(--brand); border-color: #fff; }
/* Warn-Variante (E-Mail nicht bestätigt): gleiche Form wie der Update-Balken, rot. */
.update-bar.is-warn { background: var(--danger); }
.update-bar.is-warn #optinText { flex: 1; font-size: 13.5px; font-weight: 600; }
.update-bar.is-warn .btn { background: #fff; color: var(--danger); border-color: #fff; }

/* Installations-Hinweis (Zum Startbildschirm hinzufügen) */
.install-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: color-mix(in srgb, var(--brand) 9%, var(--surface)); border-bottom: 1px solid var(--line); }
.install-text { flex: 1; display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--text); min-width: 0; }
.install-text > svg { width: 20px; height: 20px; fill: var(--brand); flex: 0 0 auto; }
.install-actions { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.install-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 5px; border-radius: 8px; }
.install-close svg { width: 18px; height: 18px; fill: currentColor; }
.install-close:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }

/* ---------- Einstellungen ---------- */
.screen-settings { background: var(--bg); }
.set-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 10px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.set-head h1 { font-size: 18px; font-weight: 700; }
.view-settings, .view-help { padding: 0; }
.set-body { padding: 8px 2px 24px; max-width: 760px; margin-inline: auto; width: 100%; display: flex; flex-direction: column; gap: 14px; }

/* Onlinehilfe */
.help-body { padding: 8px 2px 28px; max-width: 760px; margin-inline: auto; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.help-intro { font-size: 14px; line-height: 1.55; color: var(--text); padding: 2px 6px 4px; }
.help-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.help-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 8px; color: var(--brand); }
.help-p { font-size: 13.5px; line-height: 1.55; color: var(--text); margin: 0 0 8px; }
.help-p:last-child { margin-bottom: 0; }
.help-sub { font-size: 13px; font-weight: 700; color: var(--text); margin: 10px 0 4px; }
.help-ul { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.help-ul:last-child { margin-bottom: 0; }
.help-ul li { font-size: 13.5px; line-height: 1.5; color: var(--text); }
.help-note { font-size: 13px; line-height: 1.5; color: var(--text); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); border-left: 3px solid var(--brand); border-radius: 8px; padding: 9px 12px; margin: 8px 0 0; }
.help-body b { font-weight: 700; }
.help-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0 2px; }
.set-group-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 4px 2px; }
.set-group-title:first-child { margin-top: 2px; }
.set-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.set-block-head { display: flex; align-items: center; gap: 12px; padding: 15px 12px 15px 16px; }
.set-block-head .sb-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--brand); }
.set-block-head .sb-ic svg { width: 20px; height: 20px; }
.set-block-head h2 { font-size: 15.5px; font-weight: 700; flex: 1; }
.set-block-head .sb-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-top: 1px solid var(--line); }
.set-row .sr-ic { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); flex: 0 0 auto; }
.set-row .sr-ic svg { width: 19px; height: 19px; }
.set-row .sr-main { flex: 1; min-width: 0; }
.set-row .sr-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row .sr-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.set-row .sr-sub.err { color: var(--danger); }
.set-row .sr-act { display: flex; gap: 2px; flex: 0 0 auto; }
.set-empty { padding: 16px; color: var(--muted); font-size: 13px; text-align: center; }
/* Für Gäste gesperrte Quellen (nur registriert nutzbar) */
.set-block.is-locked { opacity: .72; }
.set-block.is-locked .set-block-head h2, .set-block.is-locked .sb-ic { filter: grayscale(1); }
.set-block-head .sb-lock { margin-left: auto; color: var(--muted); display: inline-flex; }
.set-block-head .sb-lock svg { width: 18px; height: 18px; fill: currentColor; }
/* Konto: E-Mail-Adresse noch nicht bestätigt */
.set-block-head .sb-warn { margin-left: auto; color: var(--danger); display: inline-flex; }
.set-block-head .sb-warn svg { width: 19px; height: 19px; fill: currentColor; }
.konto-optin { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 12px 10px 16px; padding: 9px 11px; border-radius: 10px; font-size: 12.5px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.konto-optin .ko-text { flex: 1; color: var(--text); font-weight: 600; min-width: 0; }
.konto-optin .link-btn { color: var(--danger); flex: 0 0 auto; }
/* Unwiderrufliche Aktion (Konto löschen): rot, damit sie sich klar vom Speichern abhebt */
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(1.07); }
.btn-danger:disabled { opacity: .6; cursor: default; }
.dlg-warn { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.dlg-warn svg { width: 20px; height: 20px; fill: var(--danger); flex: 0 0 auto; }
/* Gesperrter Verlauf */
.chart-empty.gast-sperre { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.chart-empty.gast-sperre svg { width: 30px; height: 30px; fill: var(--muted); }

/* ---------- Dialog ---------- */
.dlg { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow); width: min(440px, calc(100vw - 28px)); max-height: 88dvh; }
.dlg::backdrop { background: rgba(20,17,16,.55); backdrop-filter: blur(2px); }
/* Breiter Dialog für lange Fließtexte (Datenschutzerklärung). */
.dlg.is-wide { width: min(760px, calc(100vw - 28px)); }
.dlg-form { display: flex; flex-direction: column; max-height: 88dvh; }
.dlg-head { display: flex; align-items: center; padding: 16px 10px 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { flex: 1; font-size: 17px; font-weight: 700; }
.dlg-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.dlg-foot .btn { flex: 0 0 auto; }
.dlg-results { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.dlg-hit { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 11px; padding: 11px 12px; cursor: pointer; font: inherit; }
.dlg-hit:hover { border-color: var(--accent); }
.dlg-hit .h-main { flex: 1; min-width: 0; }
.dlg-hit .h-name { font-weight: 600; font-size: 14px; }
.dlg-hit .h-sub { font-size: 12px; color: var(--muted); }
.dlg-hit.is-picked { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.dlg-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.dlg-seg { display: flex; gap: 6px; }
.dlg-seg .seg-btn { flex: 1; justify-content: center; display: inline-flex; }
.inline-row { display: flex; gap: 8px; }
.inline-row .fld { flex: 1; }
.cl-entry { margin-bottom: 16px; }
.cl-ver { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; display: flex; align-items: baseline; gap: 8px; }
.cl-ver span { font-weight: 400; font-size: 12px; color: var(--muted); }
.cl-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.cl-list li { font-size: 13.5px; color: var(--text); line-height: 1.45; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #141110; color: #f1ece5; padding: 11px 18px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow); z-index: 60; max-width: 90vw; }

@media (min-width: 760px) {
  .app-head, .update-bar, #installBanner, .station-bar, .app-main, .app-toolbar { max-width: 1040px; margin-inline: auto; width: 100%; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .head-logo { height: 24px; }
  .view { padding: 10px 14px; }
}

/* „Passwort vergessen?" unter dem Anmelde-Formular */
.auth-vergessen { display: flex; justify-content: center; margin-top: -4px; font-size: 12.5px; }

/* ---------- Handy im Querformat: Verlauf im Vollbild ----------
   Beim Drehen wechselt die App in den Verlauf – dann sollen Kopf- und Fußleiste
   weichen, damit die Grafik die volle Höhe bekommt. Die Abfrage trifft BEWUSST
   nur Telefone:
     orientation: landscape  – quer
     max-height: 520px       – Desktop-Fenster sind höher (Handy quer: 320–430 px)
     pointer: coarse         – Touch-Gerät, kein Mauszeiger
   Dieselbe Abfrage steht in app.js (QUER_VOLLBILD) für die Höhenberechnung der
   Grafik – beide müssen zusammenpassen.
   Die Stationsleiste BLEIBT sichtbar: Sie ist im Vollbild der einzige Weg zurück
   zur Übersicht bzw. zu einer anderen Station. */
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  body.in-history .app-head,
  body.in-history .app-toolbar { display: none; }
  body.in-history .view-history { padding: 6px 10px 4px; }
  body.in-history .hist-head { margin-bottom: 6px; }
  body.in-history .station-bar { padding: 6px 10px 2px; }
  body.in-history .chart-shell { padding: 8px 10px 4px; }
  body.in-history .chart-ctrl { margin-bottom: 2px; min-height: 28px; }
  /* Der Bedienhinweis kostet hier nur Höhe – die Gesten kennt man im Vollbild. */
  body.in-history .chart-hint { display: none; }
}

/* ---------- Gesundheit: Krankheits-Risikoampel ---------- */
.gesund-body { display: flex; flex-direction: column; gap: 14px; }
.gesund-intro { font-size: 13px; color: var(--muted); padding: 0 4px; }
.gesund-karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 14px; }
.gk-head { display: flex; align-items: baseline; gap: 8px; }
.gk-name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk-quelle { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.gk-guete { font-size: 11.5px; color: var(--muted); margin: 2px 0 10px; }
/* Modelldaten statt Messung: das MUSS auffallen, sonst wirkt die Ampel belastbarer als sie ist */
.gk-guete.is-schwach { color: var(--danger); font-weight: 600; }
.gk-ampeln { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gk-ampel { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; font: inherit; text-align: left;
  background: var(--surface-2); color: var(--text); min-width: 0; }
.gk-ampel:hover { border-color: var(--muted); }
.gka-name { font-size: 11.5px; font-weight: 700; }
.gka-wert { font-size: 14px; font-weight: 700; }
.gka-konf { font-size: 10.5px; color: var(--muted); }
/* Ampelfarben – bewusst über die Randfarbe + Wert, nicht flächig (Lesbarkeit) */
.gk-ampel.is-ok       { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.gk-ampel.is-ok .gka-wert { color: var(--ok); }
.gk-ampel.is-warn     { border-color: color-mix(in srgb, #d9a406 60%, transparent); }
.gk-ampel.is-warn .gka-wert { color: #b98a05; }
.gk-ampel.is-hoch     { border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface-2)); }
.gk-ampel.is-hoch .gka-wert { color: var(--danger); }
.gk-ampel.is-sehrhoch { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--surface-2)); }
.gk-ampel.is-sehrhoch .gka-wert { color: var(--danger); }
.gk-ampel.is-unbekannt .gka-wert { color: var(--muted); }
.gesund-fuss { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.gesund-fuss svg { width: 18px; height: 18px; fill: var(--muted); flex: 0 0 auto; }
.gd-kopf { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); }
.gd-kopf.is-hoch, .gd-kopf.is-sehrhoch { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.gd-ampel { font-size: 17px; font-weight: 700; flex: 1; }
.gd-kopf.is-ok .gd-ampel { color: var(--ok); }
.gd-kopf.is-warn .gd-ampel { color: #b98a05; }
.gd-kopf.is-hoch .gd-ampel, .gd-kopf.is-sehrhoch .gd-ampel { color: var(--danger); }
.gd-konf { font-size: 12px; color: var(--muted); }
@media (max-width: 420px) { .gk-ampeln { grid-template-columns: 1fr; } }
.gesund-lade { color: var(--brand); font-weight: 600; }
.gk-stand { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- Auswertungen (Admins) ---------- */
/* Interne Ansicht – bewusst nüchtern und dicht, sie soll Zahlen zeigen, nicht
   Eindruck machen. Farben und Radien wie im Rest der App. */
.view-admin { padding: 14px; }
.admin-body { max-width: 900px; margin-inline: auto; }
.ad-stand { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.ad-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.ad-kachel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.ad-wert { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.ad-titel { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 2px; }
.ad-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.ad-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-bottom: 14px; }
.ad-block h2 { font-size: 15px; margin: 0 0 4px; }
.ad-hinweis { font-size: 12px; color: var(--muted); margin: 0 0 10px; line-height: 1.45; }
.ad-leer { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* Balken: Label | Balken | Zahl. Die Zahl steht daneben, nicht im Balken –
   bei kleinen Werten wäre er sonst kürzer als seine eigene Beschriftung. */
.ad-balken { display: flex; flex-direction: column; gap: 6px; }
.ad-zeile { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; align-items: center; gap: 10px; }
.ad-label { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-bar { background: var(--surface-2); border-radius: 999px; height: 10px; overflow: hidden; }
.ad-bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.ad-bar i.is-fehler { background: var(--danger); }
.ad-num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.ad-saeulen { width: 100%; height: 120px; display: block; fill: var(--brand); }
.ad-achse { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Kalender: ein Kästchen je Tag, 12 Wochen. */
.ad-kal { display: grid; grid-template-columns: repeat(28, 1fr); gap: 3px; }
.ad-kal i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.ad-kal i.an { background: var(--brand); border-color: var(--brand); }

.ad-tabelle-wrap { overflow-x: auto; }
.ad-tabelle { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ad-tabelle th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
                 color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ad-tabelle td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ad-tabelle tr:last-child td { border-bottom: 0; }
.ad-name { font-weight: 600; }
.ad-mail { font-size: 11.5px; color: var(--muted); }
.ad-chip { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
           border-radius: 999px; padding: 1px 6px; background: var(--surface-2); color: var(--muted); }
.ad-chip.is-warn { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ad-chip.is-ok { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); }

.ad-detail-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ad-detail-kopf h2 { font-size: 19px; margin: 0; }
.ad-liste { display: flex; flex-direction: column; gap: 8px; }
.ad-eintrag { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; }
.ad-eintrag-kopf { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ad-ua { font-size: 10.5px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.ad-rot { color: var(--danger); font-size: 11.5px; }
.ad-paare { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 16px; }
.ad-paar { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 5px; font-size: 12.5px; }
.ad-paar span { color: var(--muted); }
.ad-fuss { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted);
           line-height: 1.5; padding: 10px 2px 20px; }
.ad-fuss svg { width: 16px; height: 16px; fill: currentColor; flex: none; margin-top: 1px; }
