/* PC-Wachhalter Fernsteuerung – Handy-Bedienfeld (PWA). Designsystem „Graphit & Gelb“ (DESIGNSYSTEM.md).
   Alle Farben, Radien, Ebenen und Dauern kommen aus tokens.css (vorher eingebunden, kein Import).
   Architektur (DESIGNSYSTEM §9.1): Das Dokument scrollt nie. Die Schale ist ein Grid aus Kopf / main / Navigation;
   main ist der einzige Scroll-Container. Overlays sind Geschwister der Schale.
   Paketlokale Variablen (dokumentiert): --feld-flaeche, --schalter-rand (Hell/Dunkel-Alias auf Tokens),
   --stufe, --stufe-tint (Statusfarbe je data-stufe/Klasse), --ring (Ringgröße).
   Dauern ohne eigenes Token sind aus Tokens abgeleitet (Spinner = 2 × --d-lang, Puls = 3 × --d-lang,
   Atmen = 6 × --d-lang); unter reduzierter Bewegung schrumpfen sie damit automatisch. */

/* ===================================================================== Grundlagen */
:root {
  --feld-flaeche: var(--flaeche-2);
  --schalter-rand: transparent;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --feld-flaeche: var(--flaeche-1); --schalter-rand: var(--rand-eingabe); }
}
:root[data-theme="light"] { --feld-flaeche: var(--flaeche-1); --schalter-rand: var(--rand-eingabe); }

*, *::before, *::after { box-sizing: border-box; }
html {
  height: 100%; overflow: hidden; overscroll-behavior: none;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
body {
  height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none;
  background:
    radial-gradient(120% 60% at 0% 0%, var(--bg-verlauf-1), transparent 60%),
    radial-gradient(100% 50% at 100% 100%, var(--bg-verlauf-2), transparent 60%),
    var(--bg);
  color: var(--text-1);
  font-family: var(--schrift-text); font-size: var(--t-text); line-height: var(--zh-text);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
svg { width: var(--icon-m); height: var(--icon-m); fill: none; stroke: currentColor; stroke-width: var(--icon-strich); stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .knopf, .chip, .tabs button, label.zeile, .schalter-zeile, .haken { -webkit-user-select: none; user-select: none; }
b { font-weight: var(--gewicht-halbfett); }
h1, h2, h3 { margin: 0; }
h2 { font-family: var(--schrift-display); font-size: var(--t-titel-1); line-height: var(--zh-titel-1); font-weight: var(--gewicht-fett); letter-spacing: var(--laufweite-gross); }
h3 { font-size: var(--t-titel-3); line-height: var(--zh-titel-3); font-weight: var(--gewicht-halbfett); letter-spacing: var(--laufweite-titel); }

/* Fokus: eine globale Regel (DESIGNSYSTEM §7) */
:focus-visible { outline: var(--fokus-breite) solid var(--fokus-ring); outline-offset: var(--fokus-abstand); }
:focus:not(:focus-visible) { outline: none; }

/* Statusfarben je Stufe (data-stufe oder JS-Klasse). „akzent“ ist ein Aktivitäts-, kein Schweregrad und wird
   deshalb als Info dargestellt – Gelb ist nie ein Zustand (DESIGNSYSTEM §2.2). */
:where(.befehle li, .geraete li, .verlauf li) { --stufe: var(--neutral); --stufe-tint: var(--neutral-tint); }
:where(.pille, .toast) { --stufe: var(--ok); --stufe-tint: var(--ok-tint); }
:where(.hinweis) { --stufe: var(--info); --stufe-tint: var(--info-tint); }
[data-stufe="ok"], .ok { --stufe: var(--ok); --stufe-tint: var(--ok-tint); }
[data-stufe="warn"], .warn, .hinweis--warn { --stufe: var(--warn); --stufe-tint: var(--warn-tint); }
[data-stufe="fehler"], .fehler { --stufe: var(--fehler); --stufe-tint: var(--fehler-tint); }
[data-stufe="neutral"], .neutral { --stufe: var(--neutral); --stufe-tint: var(--neutral-tint); }
[data-stufe="akzent"], .akzent, [data-stufe="info"] { --stufe: var(--info); --stufe-tint: var(--info-tint); }

/* Sprunglink – erstes fokussierbares Element */
.sprunglink {
  position: fixed; z-index: var(--z-sprunglink);
  top: calc(var(--sicher-oben) + var(--a-2)); left: calc(var(--sicher-links) + var(--a-2));
  display: inline-flex; align-items: center; min-height: var(--ziel-min); padding: 0 var(--a-4);
  border-radius: var(--r-voll); background: var(--akzent); color: var(--akzent-auf);
  font-weight: var(--gewicht-halbfett); text-decoration: none; box-shadow: var(--schatten-2);
}
.sprunglink:not(:focus) { width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ===================================================================== Schale (§9.1) */
.schale {
  height: var(--schale-hoehe);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "kopf" "inhalt" "nav";
}
/* Bildschirmtastatur (§9.1.4, Befund B1): iOS lässt den Layout-Viewport stehen und verkleinert nur den sichtbaren
   Bereich (visualViewport). Die Schale liegt dann genau darauf – main (einziger Scroll-Container) wird damit kürzer und
   das fokussierte Feld kann darin sichtbar gescrollt werden (app.js feldZeigen). Fixed bezieht sich wie
   visualViewport.offsetTop auf den Layout-Viewport; ohne transform, damit fixed-Kinder unberührt bleiben. */
html[data-tastatur] .schale { position: fixed; left: 0; right: 0; top: var(--vv-oben); height: var(--vv-hoehe); }

/* Kopf */
.kopf {
  grid-area: kopf; display: grid; min-width: 0;
  padding: var(--sicher-oben) calc(var(--rand-seite) + var(--sicher-rechts)) 0 calc(var(--rand-seite) + var(--sicher-links));
  background: var(--glas-1);
  box-shadow: var(--glas-kante), inset 0 -1px 0 var(--haarlinie);
}
.kopf__zeile { min-height: var(--kopf-hoehe); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--a-3); }
.marke { display: flex; align-items: center; gap: var(--a-3); min-width: 0; }
.marke__text { min-width: 0; }
.kopf h1 { font-size: var(--t-kopf); line-height: var(--zh-kopf); font-weight: var(--gewicht-halbfett); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unter { margin: 0; color: var(--text-2); font-size: var(--t-mini); line-height: var(--zh-mini); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Logo (§10): unverändert, eigene dunkle Kachel, Schatten nur über Token */
.logo { display: block; flex: none; border-radius: var(--r-logo); box-shadow: var(--schatten-logo); -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
.logo--kopf { width: 28px; height: 28px; }
.logo--seite { width: 32px; height: 32px; }
.logo--formular { width: 56px; height: 56px; margin-bottom: var(--a-3); }
.logo--laden { width: 72px; height: 72px; }

/* Offline-Zeile im Kopf (§8.12) */
.offline {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--a-2) var(--a-3);
  margin-bottom: var(--a-2); padding: var(--a-1) var(--a-1) var(--a-1) var(--a-3);
  border-radius: var(--r-m); background: var(--warn-tint); color: var(--text-1); font-size: var(--t-fussnote);
}
.offline > svg { color: var(--warn); width: var(--icon-m); height: var(--icon-m); }
.offline__text { min-width: 0; overflow-wrap: anywhere; }

/* Status-Pille */
.pille {
  display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 100%;
  min-height: 28px; padding: 0 10px; border-radius: var(--r-voll);
  /* Tönung über deckender Kartenfläche: die geprüften Kontraste (≥ 4,57) gelten für Tönung über --flaeche-1,
     nicht über dem durchscheinenden Kopf (gemessen Hell 4,32 ohne Unterlage) */
  background: linear-gradient(var(--stufe-tint), var(--stufe-tint)), var(--flaeche-1); color: var(--stufe);
  font-size: var(--t-fussnote); font-weight: var(--gewicht-halbfett); white-space: nowrap;
}
.pille > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pille__punkt { width: 8px; height: 8px; border-radius: var(--r-voll); background: currentColor; flex: none; }
.pille:not(.warn):not(.fehler):not(.neutral) .pille__punkt { animation: atmen calc(var(--d-lang) * 6) ease-in-out infinite; }
.pille.warn .pille__punkt { width: 11px; height: 10px; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
@keyframes atmen { 50% { opacity: .4; } }

/* Kopf rechts: Status-Pille + Glocke (Mitteilungscenter) */
.kopf__rechts { display: flex; align-items: center; gap: var(--a-1); min-width: 0; }
.glocke {
  position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--ziel-min); height: var(--ziel-min); margin: 0 calc(-1 * var(--a-2)) 0 0; padding: 0;
  border: 0; border-radius: var(--r-voll); background: transparent; color: var(--text-2); cursor: pointer;
  transition: background var(--d-sofort) var(--kurve-standard), color var(--d-sofort) var(--kurve-standard);
}
.glocke:active { background: var(--flaeche-druck); color: var(--text-1); }
.glocke__zahl {
  position: absolute; top: 5px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-voll);
  background: var(--akzent); color: var(--akzent-auf); font-size: var(--t-mini); line-height: 18px; font-weight: var(--gewicht-halbfett);
  font-variant-numeric: tabular-nums; text-align: center; pointer-events: none;
}
.glocke__zahl[hidden] { display: none; }
@media (hover: hover) { .glocke:hover { background: var(--flaeche-druck); color: var(--text-1); } }

/* Navigation: Tab-Bar (Handy) – Grid-Zeile, KEIN position: fixed (§8.14) */
.tabs {
  grid-area: nav; min-width: 0;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: start;
  padding: var(--a-1) calc(var(--a-2) + var(--sicher-rechts)) max(var(--a-2), var(--sicher-unten)) calc(var(--a-2) + var(--sicher-links));
  background: var(--glas-1);
  box-shadow: var(--glas-kante), inset 0 1px 0 var(--haarlinie);
}
.tabs__marke { display: none; }
.tabs button {
  min-width: 0; min-height: var(--ziel-min);
  display: grid; justify-items: center; align-content: center; gap: 2px;
  padding: var(--a-1) 0 2px; border: 0; border-radius: var(--r-m); background: none;
  color: var(--text-2); font-size: var(--t-leiste); line-height: var(--zh-leiste); font-weight: var(--gewicht-halbfett);
  cursor: pointer; touch-action: manipulation;
}
.tabs__kapsel {
  display: grid; place-items: center; width: 56px; max-width: 100%; height: 30px; border-radius: var(--r-voll);
  transition: background-color var(--d-kurz) var(--kurve-standard);
}
.tabs__kapsel svg { width: var(--icon-l); height: var(--icon-l); transition: transform var(--d-kurz) var(--kurve-standard); }
.tabs__text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs button[aria-current="page"] { color: var(--text-1); font-weight: var(--gewicht-fett); }
.tabs button[aria-current="page"] .tabs__kapsel { background: var(--akzent); color: var(--akzent-auf); }
.tabs button:active .tabs__kapsel { background: var(--fuellung-druck); }
.tabs button[aria-current="page"]:active .tabs__kapsel { background: var(--akzent-druck); }
.tabs button:active svg { transform: scale(var(--skala-druck-klein)); }
.tabs button:focus-visible { outline: none; }
.tabs button:focus-visible .tabs__kapsel { outline: var(--fokus-breite) solid var(--fokus-ring); outline-offset: var(--fokus-abstand); }
.tabs__marke-text { display: grid; min-width: 0; }
.tabs__marke-text b { font-size: var(--t-kopf); color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs__marke-text small { font-size: var(--t-fussnote); color: var(--text-3); }

html[data-tastatur] .tabs { display: none; }
html[data-vollbild="seite"] .tabs { visibility: hidden; }

/* Inhalt: einziger Scroll-Container */
main#ansichten {
  grid-area: inhalt; min-width: 0; min-height: 0;
  overflow-y: auto; overflow-x: hidden; overflow-x: clip;
  overscroll-behavior: contain; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch;
  padding: var(--a-4) calc(var(--rand-seite) + var(--sicher-rechts)) var(--a-6) calc(var(--rand-seite) + var(--sicher-links));
}
main#ansichten:focus { outline: none; }

/* Ansichten: Grid ohne Transform/Animation auf .ansicht selbst (§9.1 Regel 1) */
.ansicht {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--spalten-luecke); align-content: start;
  width: 100%; max-width: var(--inhalt-max); min-width: 0; margin-inline: auto;
}
.ansicht > * { grid-column: 1 / -1; min-width: 0; animation: blende-ein var(--d-blende) var(--kurve-standard); }
@keyframes blende-ein { from { opacity: 0; } }
.ansicht__titel {
  margin: var(--a-2) var(--a-1) 0; font-family: var(--schrift-display); font-size: var(--t-gross-titel);
  line-height: var(--zh-gross-titel); font-weight: var(--gewicht-fett); letter-spacing: var(--laufweite-gross);
  hyphens: auto; overflow-wrap: break-word;   /* „Einstellungen“ bei 320 px + 175 % Schrift: trennen statt überlaufen */
}
.ansicht__titel:focus { outline: none; }
.ansicht--lesen { max-width: var(--inhalt-lesen); }
/* Ansichten ohne Schale (laden, einrichtung, anmeldung …): zentriert, nie abgeschnitten */
.ansicht--formular {
  max-width: var(--inhalt-formular); min-height: 100%;
  padding-top: var(--sicher-oben); padding-bottom: var(--sicher-unten);
}
.ansicht--mitte { justify-items: center; text-align: center; }
@media (min-height: 700px) { .ansicht--formular { align-content: safe center; } }
.ansicht--mitte > .karte { width: 100%; text-align: left; }
.ansicht__kopf { display: grid; gap: var(--a-1); justify-items: start; padding: var(--a-2) var(--a-1) 0; }
.ansicht--mitte .ansicht__kopf { justify-items: center; }
.ansicht--formular .drehen { width: 28px; height: 28px; border-width: 3px; }

/* Abschnitte: Überschrift über der Gruppe (§8.3) */
.gruppe { display: grid; gap: var(--a-2); align-content: start; min-width: 0; }
.gruppe > .ueberschrift { padding: 0 var(--a-4); }
.gruppe > .hilfe { margin: 0; padding: 0 var(--a-4); }
.spalte { display: grid; gap: var(--spalten-luecke); align-content: start; min-width: 0; }

/* ===================================================================== Text */
.ueberschrift {
  margin: 0; font-size: var(--t-fussnote); line-height: var(--zh-fussnote); font-weight: var(--gewicht-halbfett);
  letter-spacing: var(--laufweite-versal); text-transform: uppercase; color: var(--text-2); overflow-wrap: anywhere;
}
.info { margin: 0; color: var(--text-2); font-size: var(--t-unterzeile); line-height: var(--zh-unterzeile); max-width: 65ch; overflow-wrap: break-word; hyphens: auto; }
.ansicht--mitte .info { margin-inline: auto; }
.info b { color: var(--text-1); }
.hilfe { margin: 0; font-size: var(--t-fussnote); line-height: var(--zh-fussnote); color: var(--text-3); text-align: center; }
.hilfe--liste, .hilfe--links { text-align: left; }
.fuss { margin: 0; color: var(--text-3); font-size: var(--t-mini); text-align: center; font-variant-numeric: tabular-nums; }
.leer { margin: 0; padding: var(--a-4); color: var(--text-3); font-size: var(--t-fussnote); text-align: center; }
.meldung { margin: 0; color: var(--fehler); font-size: var(--t-unterzeile); text-align: center; overflow-wrap: anywhere; }
.meldung:empty { display: none; }
.meldung.ok { color: var(--ok); }
.meldung:not(.ok)::before, .feld__fehler::before, .warte.fehler::before {
  content: ""; display: inline-block; flex: none; width: 12px; height: 11px; margin-right: 6px;
  background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* ===================================================================== Karten (§8.2) */
/* .glas ist seit dem Redesign eine DECKENDE Karte (kein backdrop-filter auf Karten, §4.4). */
.glas { background: var(--flaeche-1); border: 1px solid var(--haarlinie); border-radius: var(--r-karte); box-shadow: var(--schatten-1); }
.karte { display: grid; gap: var(--a-3); padding: var(--a-4); align-content: start; min-width: 0; }
.karte__kopf { display: flex; align-items: center; gap: var(--a-3); min-width: 0; }
.karte__icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: var(--r-s); }
.karte__icon svg { width: var(--icon-m); height: var(--icon-m); }
.hinweis-karte { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.hinweis-karte > div:last-child { display: grid; gap: var(--a-2); justify-items: start; }

/* Icon-Tönungen (Klassennamen bleiben, Bedeutung neu – §8.3) */
.orange { background: var(--akzent-tint); color: var(--akzent-text); }
.gruen { background: var(--ok-tint); color: var(--ok); }
.blau { background: var(--info-tint); color: var(--info); }
.rot { background: var(--fehler-tint); color: var(--fehler); }
.grau { background: var(--neutral-tint); color: var(--neutral); }

/* Hinweis im Fluss (§8.2) */
.hinweis {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--a-3); align-items: start;
  padding: var(--a-3) var(--a-4); border-radius: var(--r-m);
  background: var(--stufe-tint); color: var(--text-1); font-size: var(--t-unterzeile); line-height: var(--zh-unterzeile);
}
.hinweis > svg { color: var(--stufe); }
/* Hinweis mit Aktion (Fehlerzustand mit „Erneut versuchen“, §8.13) – Hook von P3 (Verlauf, Geräte) */
.hinweis__text { display: grid; gap: var(--a-1); justify-items: start; min-width: 0; }
.hinweis__text > p { margin: 0; overflow-wrap: anywhere; }
.hinweis__text > .link { justify-self: start; padding: 0; }

/* ===================================================================== Knöpfe (§8.1) */
.knopf {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--a-2);
  min-height: var(--ziel-min); min-width: var(--ziel-min); padding: 0 var(--a-5);
  border: 0; border-radius: var(--r-knopf); background: var(--fuellung); color: var(--text-1);
  font-size: var(--t-kopf); line-height: 1.2; font-weight: var(--gewicht-halbfett); text-align: center; text-decoration: none;
  cursor: pointer; touch-action: manipulation;
  transition: background-color var(--d-sofort) var(--kurve-standard), transform var(--d-kurz) var(--kurve-standard), opacity var(--d-kurz) var(--kurve-standard);
}
.knopf svg { width: var(--icon-m); height: var(--icon-m); }
.knopf:active:not(:disabled) { background: var(--fuellung-druck); transform: scale(var(--skala-druck)); transition-duration: var(--d-sofort); }
.knopf--primaer { background: var(--akzent); color: var(--akzent-auf); box-shadow: var(--schatten-akzent); }
.knopf--primaer:active:not(:disabled) { background: var(--akzent-druck); }
.knopf--getoent { background: var(--akzent-tint); color: var(--akzent-text); }
.knopf--gefahr { background: var(--gefahr-flaeche); color: var(--gefahr-auf); }
.knopf--gefahr-leise, .knopf--rot-leise { background: var(--fehler-tint); color: var(--fehler); }
.knopf--getoent::after, .knopf--gefahr::after, .knopf--gefahr-leise::after, .knopf--rot-leise::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--flaeche-druck); opacity: 0;
  transition: opacity var(--d-sofort) var(--kurve-standard); pointer-events: none;
}
.knopf--getoent:active:not(:disabled)::after, .knopf--gefahr:active:not(:disabled)::after,
.knopf--gefahr-leise:active:not(:disabled)::after, .knopf--rot-leise:active:not(:disabled)::after { opacity: 1; }
.knopf--gefahr:active:not(:disabled) { background: var(--gefahr-flaeche); }
.knopf--getoent:active:not(:disabled) { background: var(--akzent-tint); }
.knopf--gefahr-leise:active:not(:disabled), .knopf--rot-leise:active:not(:disabled) { background: var(--fehler-tint); }
.knopf--voll { width: 100%; }
.knopf--klein { padding: 0 var(--a-4); font-size: var(--t-unterzeile); }
.knopf--klein svg { width: var(--icon-s); height: var(--icon-s); }
.knopf--icon { width: var(--ziel-min); padding: 0; }
.knopf--icon-text { padding: 0 var(--a-4); font-size: var(--t-unterzeile); }
.knopf:disabled, .knopf[aria-disabled="true"] {
  background: var(--flaeche-3); color: var(--text-aus); box-shadow: none; cursor: not-allowed; transform: none;
}
.knopf[aria-busy="true"] { cursor: progress; }
.knopf[aria-busy="true"] > svg { display: none; }
.knopf[aria-busy="true"]::before {
  content: ""; flex: none; width: var(--icon-s); height: var(--icon-s); border-radius: var(--r-voll);
  border: 2px solid var(--fuellung-hover); border-top-color: currentColor;
  animation: drehen calc(var(--d-lang) * 2) linear infinite;
}
.knopfreihe { display: flex; flex-direction: column-reverse; gap: var(--a-2); }
.knopfreihe .knopf { width: 100%; }

/* Text-Knopf / Link */
.link {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--ziel-min); padding: 0 var(--a-2);
  border: 0; border-radius: var(--r-s); background: none; color: var(--akzent-text);
  font-size: var(--t-unterzeile); font-weight: var(--gewicht-halbfett); text-align: center;
  cursor: pointer; justify-self: center; touch-action: manipulation; text-underline-offset: 3px;
}
.link--gefahr { color: var(--fehler); }
.link:active:not(:disabled) { opacity: .7; }
.link:disabled { color: var(--text-aus); cursor: not-allowed; }

/* ===================================================================== Eingaben (§8.6) */
.feld { display: grid; gap: 6px; min-width: 0; }
.feld > span, .feldname { margin: 0; font-size: var(--t-fussnote); font-weight: var(--gewicht-halbfett); color: var(--text-2); }
.feld input, .feld textarea {
  width: 100%; min-height: 48px; padding: 0 14px; margin: 0;
  border: 1px solid var(--rand-eingabe); border-radius: var(--r-feld); background: var(--feld-flaeche); color: var(--text-1);
  font-size: var(--t-eingabe); outline: none; -webkit-user-select: text; user-select: text;
  transition: border-color var(--d-kurz) var(--kurve-standard), box-shadow var(--d-kurz) var(--kurve-standard);
}
.feld textarea { min-height: 96px; padding: var(--a-3) 14px; resize: vertical; }
.feld input::placeholder { color: var(--text-3); letter-spacing: normal; }
.feld input:focus, .feld textarea:focus { border-color: var(--fokus-ring); box-shadow: 0 0 0 3px var(--akzent-tint); }
.feld input[aria-invalid="true"] { border-color: var(--fehler); }
.feld input:disabled, .feld input[readonly] { background: var(--flaeche-3); color: var(--text-2); }
.feld input[type="time"] { font-variant-numeric: tabular-nums; }
.feld .code-feld { font-family: var(--schrift-mono); font-size: var(--t-22); letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.feld .eingabe--mono { font-family: var(--schrift-mono); letter-spacing: .02em; }
.feld__eingabe { position: relative; min-width: 0; }
.feld__eingabe input { padding-right: 52px; }
.feld__zeigen {
  position: absolute; top: 50%; right: 2px; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--r-s); background: none; color: var(--text-2); cursor: pointer; touch-action: manipulation;
}
.feld__zeigen:focus-visible { outline-offset: -2px; }
.feld__fehler { margin: 0; display: flex; align-items: baseline; color: var(--fehler); font-size: var(--t-fussnote); overflow-wrap: anywhere; }

.haken { display: flex; gap: var(--a-3); align-items: center; min-height: var(--ziel-min); font-size: var(--t-unterzeile); color: var(--text-2); cursor: pointer; }
.haken input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--akzent); }

/* ===================================================================== Laden, Einrichtung */
.drehen {
  width: 20px; height: 20px; border-radius: var(--r-voll); color: var(--text-2);
  border: 2px solid var(--fuellung-hover); border-top-color: currentColor;
  animation: drehen calc(var(--d-lang) * 2) linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

.fortschritt {
  position: relative; width: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
  margin: var(--a-2) 0 var(--a-6); padding: 0; list-style: none; counter-reset: schritt;
}
.fortschritt li { height: 4px; border-radius: var(--r-voll); background: var(--flaeche-3); counter-increment: schritt; transition: background-color var(--d-mittel) var(--kurve-standard); }
.fortschritt li.fertig, .fortschritt li.aktiv { background: var(--akzent-text); }
.fortschritt li.aktiv::after {
  content: "Schritt " counter(schritt) " von 7"; position: absolute; left: 0; top: var(--a-3);
  font-size: var(--t-fussnote); font-weight: var(--gewicht-halbfett); color: var(--text-2);
}
.pruefliste { list-style: none; margin: 0; padding: 0; display: grid; }
.pruefliste li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: var(--a-3); align-items: center;
  padding: var(--a-2) 0; font-size: var(--t-unterzeile); box-shadow: inset 0 -1px 0 var(--trenner);
}
.pruefliste li:last-child { box-shadow: none; }
.pruefliste i { width: 22px; height: 22px; border-radius: var(--r-voll); display: grid; place-items: center; font-style: normal; font-size: var(--t-12); font-weight: var(--gewicht-fett); background: var(--ok-tint); color: var(--ok); }
.pruefliste li.nein i { background: var(--fehler-tint); color: var(--fehler); }
.pruefliste li.hinweis-nur i { background: var(--warn-tint); color: var(--warn); }
.pruefliste small { color: var(--text-3); font-size: var(--t-mini); }
/* QR-Code braucht unabhängig vom Modus Schwarz auf Weiß (Scanner) */
.qr { justify-self: center; max-width: 100%; padding: var(--a-3); border-radius: var(--r-m); background: var(--weiss); line-height: 0; }
.qr svg { width: 216px; height: 216px; max-width: 100%; stroke: none; display: block; }
.code {
  margin: 0; padding: var(--a-3) var(--a-4); border: 1px solid var(--haarlinie); border-radius: var(--r-feld); background: var(--flaeche-2);
  font-family: var(--schrift-mono); font-size: var(--t-15); letter-spacing: .06em; text-align: center; overflow-wrap: anywhere;
}
.code--gross { font-size: var(--t-28); font-weight: var(--gewicht-fett); letter-spacing: .1em; color: var(--text-1); }
.code--waehlbar { -webkit-user-select: all; user-select: all; }
.codes { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--a-2); counter-reset: c; }
.codes li {
  counter-increment: c; padding: var(--a-2); border: 1px solid var(--haarlinie); border-radius: var(--r-s); background: var(--flaeche-2);
  font-family: var(--schrift-mono); font-size: var(--t-unterzeile); letter-spacing: .04em; text-align: center; white-space: nowrap;
  -webkit-user-select: all; user-select: all;
}
.codes li::before { content: counter(c) ". "; color: var(--text-3); }
.staerke { margin: 0; font-size: var(--t-fussnote); color: var(--text-3); min-height: 1.4em; }
.staerke.ok { color: var(--ok); }
.staerke.nein { color: var(--fehler); }
.schritt__form { display: grid; gap: var(--a-3); }

/* ===================================================================== Übersicht */
.hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--a-3) var(--a-4); align-items: start;
  padding: var(--a-4) var(--a-4) var(--a-4) var(--a-5); overflow: hidden;
  box-shadow: var(--schatten-1), inset 4px 0 0 var(--stufe);
}
.hero__symbol { display: grid; color: var(--stufe); padding-top: 2px; }
.hero__s { display: none; width: var(--icon-xl); height: var(--icon-xl); }
.hero[data-stufe="ok"] .hero__s--ok, .hero[data-stufe="warn"] .hero__s--warn,
.hero[data-stufe="fehler"] .hero__s--fehler, .hero[data-stufe="neutral"] .hero__s--neutral { display: block; }
.hero__text { min-width: 0; }
.hero h3 { margin: var(--a-1) 0; font-family: var(--schrift-display); font-size: var(--t-titel-1); line-height: var(--zh-titel-1); font-weight: var(--gewicht-fett); letter-spacing: var(--laufweite-gross); }
.hero__info { margin: 0; color: var(--text-2); font-size: var(--t-unterzeile); overflow-wrap: anywhere; }

.ringe-karte { display: grid; place-items: center; padding: var(--a-4); }
.ringe { --ring: 120px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--a-4); }
.ring { position: relative; margin: 0; width: var(--ring); text-align: center; }
.ring svg { width: var(--ring); height: var(--ring); transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring__bahn { stroke: var(--flaeche-3); }
.ring__wert {
  stroke: var(--stufe); stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16;
  transition: stroke-dashoffset var(--d-lang) var(--kurve-standard), stroke var(--d-mittel) var(--kurve-standard);
}
.ring figcaption { position: absolute; top: 0; left: 0; width: var(--ring); height: var(--ring); display: grid; place-content: center; }
.ring figcaption b { font-size: var(--t-zahl-gross); line-height: 1.05; font-weight: var(--gewicht-fett); letter-spacing: var(--laufweite-gross); font-variant-numeric: tabular-nums; }
.ring figcaption span { font-size: var(--t-mini); color: var(--text-3); }
.ring small { display: block; margin-top: var(--a-2); color: var(--text-2); font-size: var(--t-fussnote); }

.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--spalten-luecke); min-width: 0; }
.kachel { position: relative; display: grid; gap: var(--a-2); align-content: start; padding: var(--a-4); min-width: 0; }
.kachel--breit { grid-column: 1 / -1; }
.kachel__icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-xs); background: var(--stufe-tint); color: var(--stufe); }
.kachel__icon svg { width: var(--icon-s); height: var(--icon-s); }
.kachel__status { position: absolute; top: var(--a-4); right: var(--a-4); display: none; color: var(--stufe); }
.kachel__status svg { display: none; }
.kachel[data-stufe="warn"] .kachel__status, .kachel[data-stufe="fehler"] .kachel__status { display: block; }
.kachel[data-stufe="warn"] .kachel__s--warn, .kachel[data-stufe="fehler"] .kachel__s--fehler { display: block; }
.kachel__text { min-width: 0; }
.kachel__wert { margin: 2px 0 0; font-size: var(--t-titel-3); line-height: var(--zh-titel-3); font-weight: var(--gewicht-fett); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kachel__info { margin: 2px 0 0; color: var(--text-2); font-size: var(--t-fussnote); line-height: var(--zh-fussnote); white-space: pre-line; overflow-wrap: anywhere; }

.zahlen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--a-2); }
.zahl, .abzeichen {
  display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 var(--a-2); border-radius: var(--r-xs);
  background: var(--fuellung); color: var(--text-2);
  font-size: var(--t-mini); font-weight: var(--gewicht-halbfett); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.abzeichen { text-transform: uppercase; letter-spacing: var(--laufweite-versal); }
.abzeichen.warn { background: var(--warn-tint); color: var(--warn); }
.abzeichen.warn::before { content: ""; width: 10px; height: 9px; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.grafik { display: grid; gap: var(--a-3); padding: var(--a-4); align-content: start; }
.grafik__kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--a-1) var(--a-3); min-width: 0; }
.grafik__info { margin: 0; color: var(--text-3); font-size: var(--t-mini); }
.spark { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: var(--a-3); align-items: center; min-width: 0; }
.spark__text { display: grid; gap: 2px; min-width: 0; }
.spark__name { font-size: var(--t-mini); font-weight: var(--gewicht-halbfett); letter-spacing: var(--laufweite-versal); text-transform: uppercase; color: var(--text-3); }
.spark__text b { font-size: var(--t-kopf); font-weight: var(--gewicht-fett); font-variant-numeric: tabular-nums; }
.spark__text small { color: var(--text-3); font-size: var(--t-mini); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.spark__svg { width: 100%; height: 60px; overflow: visible; border-radius: var(--r-s); background: var(--flaeche-2); }
.spark__linie { fill: none; stroke: var(--text-1); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark--ram .spark__linie { stroke: var(--info); }
.spark__punkt { fill: var(--text-1); stroke: none; }
.spark--ram .spark__punkt { fill: var(--info); }
.spark__warn { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.spark__achse { display: flex; justify-content: space-between; margin-left: calc(6rem + var(--a-3)); color: var(--text-3); font-size: var(--t-mini); font-variant-numeric: tabular-nums; }

/* ===================================================================== Steuerung */
.plan {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--a-3); align-items: center;
  padding: var(--a-3) var(--a-4); box-shadow: var(--schatten-1), inset 4px 0 0 var(--info);
}
.plan__text { min-width: 0; }
.plan__text b { display: block; overflow-wrap: anywhere; }
.plan__text small { display: block; color: var(--text-3); font-size: var(--t-fussnote); }
.plan .knopf { min-height: 44px; }
.plan-in { display: grid; gap: var(--a-3); }
.plan-vorschau { text-align: center; font-variant-numeric: tabular-nums; }

.aus { display: grid; gap: var(--a-4); padding: var(--a-4); align-content: start; }
.aus h3 { margin: var(--a-1) 0; font-size: var(--t-titel-2); line-height: var(--zh-titel-2); font-weight: var(--gewicht-fett); }
.aus__info { margin: 0; color: var(--text-2); font-size: var(--t-unterzeile); overflow-wrap: anywhere; }
.aus[data-phase="countdown"] { border-color: var(--warn); box-shadow: var(--schatten-1), inset 4px 0 0 var(--warn); }
.aus[data-phase="wartet"] { box-shadow: var(--schatten-1), inset 4px 0 0 var(--info); }
.aus__start { display: grid; gap: var(--a-3); }
.aus[data-phase="countdown"] .aus__start, .aus[data-phase="wartet"] .aus__start { display: none; }
.countdown { position: relative; width: 150px; height: 150px; justify-self: center; display: none; }
.aus[data-phase="countdown"] .countdown { display: block; animation: blende-ein var(--d-mittel) var(--kurve-rein); }
.countdown svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke-width: 10; }
.countdown__wert { stroke: var(--warn); stroke-linecap: round; stroke-dasharray: 376.99; stroke-dashoffset: 0; transition: stroke-dashoffset var(--d-lang) linear; }
.countdown__text { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 2px; text-align: center; }
.countdown__text .countdown__warn { width: var(--icon-m); height: var(--icon-m); color: var(--warn); transform: none; }
.countdown__text b { font-size: var(--t-zahl-gross); line-height: 1.05; font-weight: var(--gewicht-fett); color: var(--warn); font-variant-numeric: tabular-nums; }
.countdown__text span { max-width: 96px; font-size: var(--t-mini); color: var(--text-2); }

/* Segment (§8.4) */
.segment {
  --n: 3; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  padding: 3px; border-radius: var(--r-segment); background: var(--flaeche-3); min-width: 0;
}
.segment--zwei { --n: 2; }
.segment button {
  position: relative; z-index: 1; min-width: 0; min-height: var(--ziel-min); padding: 0 var(--a-2);
  border: 0; border-radius: var(--r-segment); background: none; color: var(--text-2);
  font-size: var(--t-unterzeile); font-weight: var(--gewicht-halbfett); cursor: pointer; touch-action: manipulation;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--d-kurz) var(--kurve-standard);
}
.segment button[aria-checked="true"] { color: var(--text-1); }
.segment button:focus-visible { outline-offset: -2px; }
.segment__marke {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n));
  border-radius: var(--r-segment); background: var(--segment-daumen); box-shadow: var(--schatten-1);
  transition: transform var(--d-mittel) var(--kurve-feder);
}
.segment[data-index="1"] .segment__marke { transform: translateX(100%); }
.segment[data-index="2"] .segment__marke { transform: translateX(200%); }
.segment[data-index="3"] .segment__marke { transform: translateX(300%); }
.segment--vier { --n: 4; }
.segment[aria-disabled="true"] { opacity: .5; }

/* Schalter (§8.5) – im Hell-Modus mit Rand (Gelb auf Weiß hat nur 1,1 : 1, Befund P0) */
.schalter {
  -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 51px; height: 31px; margin: 0; border-radius: var(--r-voll);
  background: var(--flaeche-3); box-shadow: inset 0 0 0 1px var(--schalter-rand);
  cursor: pointer; transition: background-color var(--d-mittel) var(--kurve-standard);
}
.schalter::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: var(--r-voll);
  background: var(--weiss); box-shadow: var(--schatten-2);
  transition: transform var(--d-mittel) var(--kurve-feder);
}
.schalter:checked { background: var(--akzent); }
.schalter:checked::after { transform: translateX(20px); }
.schalter--gefahr:checked { background: var(--gefahr-flaeche); }
.schalter:disabled { opacity: .4; cursor: not-allowed; }
.schalter.wartet { opacity: .6; }
.schalter-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--a-3); align-items: center; min-height: var(--ziel-min); cursor: pointer; }
.schalter-zeile b, .zeile__text b { display: block; font-size: var(--t-kopf); line-height: var(--zh-kopf); font-weight: var(--gewicht-mittel); overflow-wrap: anywhere; }
.schalter-zeile small, .zeile__text small { display: block; color: var(--text-3); font-size: var(--t-fussnote); line-height: var(--zh-fussnote); overflow-wrap: anywhere; }

/* Halte-Knopf (§8.1) – touch-action pan-y: Wischen scrollt und bricht das Halten ab (pointercancel) */
.halten {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: var(--a-3);
  width: 100%; min-height: 58px; padding: 0 var(--a-5); border: 0; border-radius: var(--r-knopf);
  background: var(--fehler-tint); color: var(--text-1); font-size: var(--t-kopf); font-weight: var(--gewicht-halbfett);
  cursor: pointer; touch-action: pan-y; -webkit-touch-callout: none;
  transition: transform var(--d-kurz) var(--kurve-standard);
}
.halten > svg { color: var(--fehler); }
.halten > svg, .halten__text { position: relative; z-index: 1; min-width: 0; }
.halten__fuellung { position: absolute; inset: 0; background: var(--halte-fuellung); transform-origin: left center; transform: scaleX(0); }
.halten.haelt .halten__fuellung { transform: scaleX(1); transition: transform var(--d-halten) linear; }
.halten:active:not(:disabled), .halten.haelt { transform: scale(var(--skala-druck)); }
.halten:disabled { background: var(--flaeche-3); color: var(--text-aus); cursor: not-allowed; transform: none; }
.halten:disabled > svg { color: var(--text-aus); }

/* Gruppierte Listen (§8.3) */
.liste { display: grid; padding: 0; overflow: hidden; min-width: 0; }
.zeile {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--a-3);
  width: 100%; min-width: 0; min-height: var(--ziel-min); margin: 0; padding: var(--a-3) var(--a-4);
  border: 0; border-radius: 0; background: none; color: inherit; text-align: left;
  cursor: pointer; touch-action: manipulation; transition: background-color var(--d-sofort) var(--kurve-standard);
}
.zeile::after {
  content: ""; position: absolute; right: 0; bottom: 0; left: calc(var(--a-4) + 30px + var(--a-3)); height: 1px;
  background: var(--trenner); pointer-events: none;
}
.liste > .zeile:last-child::after, .monitorliste > .zeile:last-child::after { display: none; }
.zeile:active:not(:disabled):not(.zeile--statisch) { background: var(--flaeche-druck); }
.zeile:focus-visible { outline-offset: -3px; border-radius: var(--r-m); }
.zeile--statisch { cursor: default; }
.zeile:disabled { cursor: not-allowed; }
.zeile:disabled > * { opacity: .4; }
.zeile--gefahr .zeile__text b { color: var(--fehler); }
.zeile__text { min-width: 0; }
.zeile__icon { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: var(--r-s); }
.zeile__icon svg { width: 18px; height: 18px; }
.pfeil { color: var(--text-3); font-size: var(--t-20); line-height: 1; }
.kopplung { display: grid; gap: var(--a-3); padding: var(--a-4); box-shadow: inset 0 -1px 0 var(--trenner); }

/* Befehle, Geräte, Verlauf – Zeilen im gleichen Stil; keine Einblend-Animation im Poll-Takt */
.befehle, .geraete, .verlauf { list-style: none; margin: 0; padding: 0; display: grid; min-width: 0; }
.befehle li, .geraete li, .verlauf li {
  position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: var(--a-3); align-items: center;
  min-height: var(--ziel-min); padding: var(--a-3) var(--a-4); font-size: var(--t-unterzeile); min-width: 0;
}
.befehle li + li::before, .geraete li + li::before, .verlauf li + li::before {
  content: ""; position: absolute; top: 0; right: 0; left: calc(var(--a-4) + 10px + var(--a-3)); height: 1px; background: var(--trenner);
}
.befehle i, .geraete i, .verlauf i { width: 8px; height: 8px; justify-self: center; border-radius: var(--r-voll); background: var(--stufe); }
.befehle li > span, .geraete li > span, .verlauf li > span { min-width: 0; overflow-wrap: anywhere; }
.befehle b, .geraete b, .verlauf b { font-weight: var(--gewicht-mittel); }
.befehle small, .geraete small, .verlauf small { display: block; color: var(--text-3); font-size: var(--t-fussnote); }
.befehle time, .verlauf time { color: var(--text-3); font-size: var(--t-mini); font-variant-numeric: tabular-nums; white-space: nowrap; }
.verlauf .ungelesen b { font-weight: var(--gewicht-fett); }
.verlauf .ungelesen i { box-shadow: 0 0 0 3px var(--stufe-tint); }
.geraete .knopf { min-height: var(--ziel-min); }

/* Mitteilungscenter (Sheet): Stufen-Symbol · Titel/Text/Zeit · Punkt für „neu“ */
.mz li { grid-template-columns: var(--icon-m) minmax(0, 1fr) 10px; align-items: start; }
.mz li + li::before { left: calc(var(--a-4) + var(--icon-m) + var(--a-3)); }
.mz__symbol { color: var(--stufe); line-height: 0; padding-top: 1px; }
.mz__text { display: grid; gap: 2px; min-width: 0; }
.mz__text b { overflow-wrap: anywhere; }
.mz__text time { display: block; margin-top: 2px; }
.mz__neu { width: 8px; height: 8px; margin-top: 6px; justify-self: center; border-radius: var(--r-voll); }
.mz .ungelesen .mz__neu { background: var(--akzent); }
.mz__status:empty { display: none; }

.mz[hidden] { display: none; }

/* Chips (§8.8) – nie horizontal überlaufend */
.chips, .wechsel { display: flex; flex-wrap: wrap; gap: var(--a-2); min-width: 0; }
.wechsel:empty { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; max-width: 100%; min-height: var(--ziel-min); padding: 0 var(--a-4);
  border: 0; border-radius: var(--r-voll); background: var(--fuellung); color: var(--text-1);
  font-size: var(--t-unterzeile); font-weight: var(--gewicht-halbfett); cursor: pointer; touch-action: manipulation;
  transition: background-color var(--d-sofort) var(--kurve-standard), transform var(--d-kurz) var(--kurve-standard);
}
.chips .chip { min-height: 44px; }
.chip[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-auf); }
.chip:active:not(:disabled) { transform: scale(var(--skala-druck)); }
.chip:disabled { opacity: .5; cursor: not-allowed; }

/* Bildschirm aus / Ton / Medien */
.pc-karte { padding: var(--a-3); }
.steuerkacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--a-3); }
.steuerkachel {
  display: grid; justify-items: start; align-content: start; gap: 2px; min-height: 100px; min-width: 0; padding: var(--a-3);
  border: 0; border-radius: var(--r-m); background: var(--fuellung); color: var(--text-1); text-align: left;
  cursor: pointer; touch-action: manipulation;
  transition: background-color var(--d-sofort) var(--kurve-standard), transform var(--d-kurz) var(--kurve-standard);
}
.steuerkachel b { margin-top: var(--a-2); font-size: var(--t-unterzeile); font-weight: var(--gewicht-halbfett); }
.steuerkachel small { color: var(--text-3); font-size: var(--t-mini); line-height: var(--zh-mini); overflow-wrap: anywhere; }
.steuerkachel__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-s); background: var(--flaeche-druck); color: var(--text-1); transition: background-color var(--d-kurz) var(--kurve-standard); }
.steuerkachel.aktiv .steuerkachel__icon { background: var(--akzent); color: var(--akzent-auf); }
.steuerkachel:active:not(:disabled) { background: var(--fuellung-druck); transform: scale(var(--skala-druck)); }
.steuerkachel:disabled { color: var(--text-aus); cursor: not-allowed; }
.steuerkachel:disabled small { color: var(--text-aus); }
.medien { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--a-3); margin-top: var(--a-3); }
.medien__knopf {
  width: 54px; height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: var(--a-2); padding: 0;
  border: 0; border-radius: var(--r-voll); background: var(--fuellung); color: var(--text-1);
  font-size: var(--t-unterzeile); font-weight: var(--gewicht-halbfett); cursor: pointer; touch-action: manipulation;
  transition: background-color var(--d-sofort) var(--kurve-standard), transform var(--d-kurz) var(--kurve-standard);
}
.medien__knopf svg { width: 22px; height: 22px; }
.medien__knopf--haupt { width: auto; min-width: 0; padding: 0 var(--a-4); background: var(--akzent-tint); color: var(--akzent-text); }
.medien__knopf--haupt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medien__knopf:active:not(:disabled) { background: var(--fuellung-druck); transform: scale(var(--skala-druck-klein)); }
.medien__knopf--haupt:active:not(:disabled) { background: var(--akzent-tint); }
.medien__knopf:disabled { color: var(--text-aus); cursor: not-allowed; }
.quittung { color: var(--text-2); }
.quittung.fehler { color: var(--fehler); }

/* ===================================================================== Bildschirm: Auswahl */
.auswahl { gap: var(--a-4); }
.auswahl__intro, .auswahl__start { display: grid; gap: var(--a-3); align-content: start; min-width: 0; }
/* 320 px + große Schrift (R41): lange Wörter („Wiederherstellungscode“) dürfen die Spalte nicht über die Karte hinaus verbreitern */
.auswahl__intro > *, .auswahl__start > *, .fingerabdruck > *, .e2e-stand > * { min-width: 0; }
.fingerabdruck { display: grid; gap: var(--a-1); padding: var(--a-3) var(--a-4); border: 1px solid var(--haarlinie); border-radius: var(--r-m); background: var(--flaeche-2); }
.fingerabdruck__wert {
  margin: 0; font-family: var(--schrift-mono); font-size: var(--t-17); font-weight: var(--gewicht-fett); letter-spacing: .08em; word-spacing: .2em;
  color: var(--text-1); overflow-wrap: anywhere; -webkit-user-select: all; user-select: all;
}
.fingerabdruck.ok { border-color: var(--ok); }
.fingerabdruck.offen { border-color: var(--warn); }
.monitore__titel { margin-top: var(--a-1); }
.monitorliste { display: grid; overflow: hidden; border-radius: var(--r-m); background: var(--flaeche-2); }
.foto-wahl { display: grid; gap: var(--a-3); padding-top: var(--a-4); box-shadow: inset 0 1px 0 var(--trenner); }
/* Bildrate + Direktverbindung (ERGÄNZUNG 4 §G6): Teil der Auswahl, gleiche Abstände wie die Foto-Wahl */
.bildrate { display: grid; gap: var(--a-2); padding-bottom: var(--a-4); box-shadow: inset 0 -1px 0 var(--trenner); }
.bildrate .schalter-zeile { margin-top: var(--a-1); }

/* Quellen-Wahl (ERGÄNZUNG 5 §H7.1): Feld im Stil von .feld, öffnet das Auswahlblatt (Listbox). Kompakt auf der Bühne. */
.quelle-wahl, .quelle-knoepfe { display: grid; gap: var(--a-3); min-width: 0; }
.quelle {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--a-3);
  width: 100%; min-width: 0; min-height: 56px; margin: 0; padding: var(--a-2) var(--a-3);
  border: 1px solid var(--rand-eingabe); border-radius: var(--r-feld); background: var(--feld-flaeche); color: var(--text-1);
  text-align: left; cursor: pointer; touch-action: manipulation;
  transition: border-color var(--d-kurz) var(--kurve-standard), background-color var(--d-sofort) var(--kurve-standard);
}
.quelle__text { display: grid; min-width: 0; }
.quelle__text small { color: var(--text-2); font-size: var(--t-fussnote); line-height: var(--zh-fussnote); font-weight: var(--gewicht-halbfett); }
.quelle__name { min-width: 0; font-size: var(--t-kopf); line-height: var(--zh-kopf); font-weight: var(--gewicht-halbfett); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quelle__pfeil { color: var(--text-3); transform: rotate(90deg); }
.quelle[aria-expanded="true"], .quelle:focus-visible { border-color: var(--fokus-ring); }
.quelle:active:not(:disabled) { background: var(--flaeche-druck); }
.quelle:disabled { background: var(--flaeche-3); color: var(--text-aus); cursor: not-allowed; }
.quelle:disabled :is(.quelle__icon, .quelle__pfeil) { opacity: .4; }
.quelle--kompakt { width: auto; flex: 1 1 14rem; max-width: 100%; min-height: var(--ziel-min); padding-block: var(--a-1); }
.quelle--kompakt .quelle__text small { font-size: var(--t-mini); line-height: var(--zh-mini); }
/* Programmsymbol (geprüftes PNG, Blob-URL): neutrale Kachel, Bild eingepasst */
.quelle__icon--symbol { background: var(--flaeche-2); overflow: hidden; }
:is(.quelle__icon, .zeile__icon) > img { display: block; width: 30px; height: 30px; object-fit: contain; }

/* ===================================================================== Bildschirm: Spieler (§8.17) */
.buehne { display: grid; gap: var(--a-3); padding: var(--a-3); }
.buehne__kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--a-2); min-width: 0; }
.tonlos { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--t-fussnote); font-weight: var(--gewicht-halbfett); white-space: nowrap; }
.tonlos svg { width: var(--icon-s); height: var(--icon-s); }
.spieler { position: relative; display: grid; gap: var(--a-3); min-width: 0; }
.warnband {
  display: none; grid-template-columns: auto minmax(0, 1fr); gap: var(--a-2); align-items: center;
  padding: var(--a-2) var(--a-3); border-radius: var(--r-s); background: var(--warn-tint); color: var(--text-1);
  font-size: var(--t-fussnote); font-weight: var(--gewicht-halbfett);
}
.warnband > svg { width: var(--icon-s); height: var(--icon-s); color: var(--warn); }
.buehne[data-modus="mehr"] .warnband, .spieler[data-modus="mehr"] .warnband { display: grid; }
.bildrahmen { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--video-grund); min-width: 0; }
.spieler .bildrahmen {
  width: 100%; aspect-ratio: var(--vi-ar, 16 / 9); max-height: 70vh; max-height: 70dvh; border-radius: var(--r-s);
}
.spieler__canvas, .spieler__video {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  object-fit: var(--vi-fit, contain); transform-origin: 50% 50%;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* Befund Schwarzbild iPhone (20.10.): das Canvas ist die einzige sichtbare Fläche und liegt über den Videos (iPhone-Canvas-
   Strom fürs native Vollbild, Dekoder des Direktstroms – beide gerendert, nie durchsichtig/verborgen, sonst dekodiert WebKit
   u. U. nicht). Overlays (z-index 1, später im DOM) liegen darüber. */
.spieler__canvas { z-index: 1; }
.spieler__tippen { position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%); }
.warte {
  position: relative; z-index: 1; display: grid; justify-items: center; gap: var(--a-3); padding: var(--a-6) var(--a-4);
  color: var(--video-chrome-text-2); font-size: var(--t-unterzeile); text-align: center;
}
.warte .drehen { color: var(--video-chrome-text-2); border-color: var(--pause-flaeche); border-top-color: currentColor; }
.warte.fehler { display: block; max-width: 320px; color: var(--video-chrome-text); }
.warte.fehler .drehen { display: none; }
.warte .knopf { background: rgb(255 255 255 / .14); color: var(--video-chrome-text); }
.zoomwert {
  position: absolute; left: var(--a-3); top: var(--a-3); z-index: 1; padding: 2px var(--a-2); border-radius: var(--r-xs);
  background: var(--video-chrome); color: var(--video-chrome-text); font-size: var(--t-mini); font-weight: var(--gewicht-halbfett);
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.spieler__status {
  position: absolute; top: var(--a-3); left: 50%; z-index: 1; transform: translateX(-50%);
  max-width: calc(100% - 2 * var(--a-8) - 2 * var(--a-3)); margin: 0; padding: var(--a-1) var(--a-3); border-radius: var(--r-voll);
  background: var(--video-chrome); color: var(--video-chrome-text); font-size: var(--t-fussnote); font-weight: var(--gewicht-halbfett);
  text-align: center; pointer-events: none;
}
.spieler__status:empty { padding: 0; background: none; }
/* Fehler ohne Bild: Text steht im Warte-Feld – die Statusblase nur noch für Screenreader (sonst Doppeltext übereinander) */
.bildrahmen:has(> .warte.fehler:not([hidden])) > .spieler__status {
  width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.quer {
  position: absolute; left: 50%; bottom: var(--a-3); z-index: 1; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--a-2); align-items: center;
  padding: 0 0 0 var(--a-3); border-radius: var(--r-voll);
  background: var(--video-chrome); color: var(--video-chrome-text); font-size: var(--t-fussnote); font-weight: var(--gewicht-halbfett);
  -webkit-backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung)); backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung));
  animation: blende-ein var(--d-mittel) var(--kurve-rein);
}
.quer > svg { color: var(--video-chrome-text); }
.quer__zu { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-voll); background: none; color: var(--video-chrome-text-2); cursor: pointer; }
.quer__zu svg { width: var(--icon-s); height: var(--icon-s); }

/* Schließen-Knopf der Großansicht bzw. des API-Vollbilds (oben rechts, 44 × 44) */
.vb-zu {
  position: absolute; z-index: 1; top: max(var(--a-3), var(--sicher-oben)); right: calc(var(--a-3) + var(--sicher-rechts));
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-voll);
  background: var(--video-chrome); color: var(--video-chrome-text); cursor: pointer;
  -webkit-backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung)); backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung));
  transition: transform var(--d-kurz) var(--kurve-standard), opacity var(--d-mittel) var(--kurve-standard);
}
.vb-zu:active { transform: scale(var(--skala-druck-klein)); }
.vb-zu svg { width: var(--icon-m); height: var(--icon-m); }

/* Bedienleiste: inline UNTER dem Bild (nie überlagert) */
.buehne__leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--a-2); min-width: 0; }
.buehne__info {
  flex: 1 1 8rem; min-width: 0; color: var(--text-2); font-size: var(--t-mini); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.buehne__alter { color: var(--text-2); font-size: var(--t-mini); font-variant-numeric: tabular-nums; white-space: nowrap; }
#vi-pause[aria-pressed="true"] .nur-laeuft, #vi-pause:not([aria-pressed="true"]) .nur-pausiert,
#vi-fit[aria-pressed="true"] .nur-einpassen, #vi-fit:not([aria-pressed="true"]) .nur-fuellen,
#vi-gross[aria-pressed="true"] .nur-inline, #vi-gross:not([aria-pressed="true"]) .nur-vollbild { display: none; }

/* Live-Abzeichen (§8.17) – Gelb kommt nicht vor */
.abzeichen--live { background: var(--pause-flaeche); color: var(--pause-text); }
.abzeichen--live[data-live="live"] { background: var(--live-flaeche); color: var(--live-text); }
.abzeichen--live[data-live="live"]::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-voll); background: currentColor; animation: atmen calc(var(--d-lang) * 6) ease-in-out infinite; }
.abzeichen--live[data-live="verzoegert"] { background: var(--verzoegert-flaeche); color: var(--verzoegert-text); }

/* Vollflächiger Spieler: Spieler-Ebene (Großansicht, Strategie seite) und System-Vollbild (Fullscreen API).
   :is() ist fehlertolerant – ein unbekanntes Präfix-Pseudo verwirft die Regel nicht. */
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) {
  width: 100%; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0;
  background: var(--video-grund); color: var(--video-chrome-text);
}
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .warnband {
  grid-row: 1; grid-column: 1; border-radius: 0; padding: var(--a-2) calc(var(--a-3) + var(--sicher-rechts)) var(--a-2) calc(var(--a-3) + var(--sicher-links));
}
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .warnband { padding-top: max(var(--a-2), var(--sicher-oben)); }
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .bildrahmen {
  grid-row: 2; grid-column: 1; width: 100%; height: 100%; aspect-ratio: auto; max-height: none; min-height: 0; border-radius: 0; touch-action: none; cursor: grab;
}
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .buehne__leiste {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: var(--a-3) calc(var(--a-3) + var(--sicher-rechts)) max(var(--a-3), var(--sicher-unten)) calc(var(--a-3) + var(--sicher-links));
  background: var(--video-chrome); color: var(--video-chrome-text);
  -webkit-backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung)); backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung));
  transition: opacity var(--d-mittel) var(--kurve-standard);
}
/* Knöpfe auf dem Video-Chrome: weiß getönt (Werte laut DESIGNSYSTEM §8.17, modusunabhängig dunkel) */
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .buehne__leiste .knopf:not(.knopf--gefahr-leise) { background: rgb(255 255 255 / .14); color: var(--video-chrome-text); }
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .buehne__leiste .knopf:not(.knopf--gefahr-leise):active { background: rgb(255 255 255 / .28); }
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .buehne__leiste .knopf--gefahr-leise { background: var(--gefahr-flaeche); color: var(--gefahr-auf); }
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) :is(.buehne__info, .buehne__alter) { color: var(--video-chrome-text-2); }
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) :focus-visible { outline-color: var(--gelb-500); }
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen)[data-chrome="aus"] :is(.buehne__leiste, .vb-zu) { opacity: 0; pointer-events: none; }
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .vb-zu {
  position: relative; top: auto; right: auto; grid-row: 2; grid-column: 1; align-self: start; justify-self: end;
  margin: var(--a-3) calc(var(--a-3) + var(--sicher-rechts)) 0 0;
}
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen):not([data-modus="mehr"]) .vb-zu { margin-top: max(var(--a-3), var(--sicher-oben)); }
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen):not([data-modus="mehr"]) .spieler__status { top: max(var(--a-3), var(--sicher-oben)); }
/* Quer-Hinweis in der Großansicht: unten läge er unter der überlagernden Leiste (gemessen P3) → oben unter dem
   Schließen-Knopf */
.spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .quer { bottom: auto; top: calc(max(var(--a-3), var(--sicher-oben)) + var(--ziel-min) + var(--a-2)); }
.spieler::backdrop { background: #000; }

/* Spieler-Ebene (Strategie „seite“, Großansicht): Portal direkt unter <body>. Ersetzt den alten Overlay-Weg
   .buehne.gross + html.vollbild-offen (DESIGNSYSTEM §6.4); Foto/Sheet/Toasts liegen mit höherem Token darüber. */
.spieler-ebene {
  position: fixed; inset: 0; z-index: var(--z-grossansicht); display: grid;
  background: var(--video-grund); touch-action: none; overscroll-behavior: none;
}

/* ===================================================================== Bildschirmfoto */
.foto {
  position: fixed; inset: 0; z-index: var(--z-foto);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--video-grund); color: var(--video-chrome-text);
  touch-action: none; overscroll-behavior: none; animation: blende-ein var(--d-blende) var(--kurve-standard);
}
html[data-tastatur] .foto { top: var(--vv-oben); bottom: auto; height: var(--vv-hoehe); }
.foto__kopf {
  display: flex; justify-content: space-between; align-items: center; gap: var(--a-3); min-width: 0;
  padding: max(var(--a-2), var(--sicher-oben)) calc(var(--a-3) + var(--sicher-rechts)) var(--a-2) calc(var(--a-4) + var(--sicher-links));
  background: var(--video-chrome);
}
.foto__titel { min-width: 0; }
.foto__titel h3 { font-size: var(--t-kopf); color: var(--video-chrome-text); }
.foto__info { margin: 0; color: var(--video-chrome-text-2); font-size: var(--t-mini); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foto__zu {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--r-voll); background: rgb(255 255 255 / .14); color: var(--video-chrome-text); cursor: pointer;
  transition: transform var(--d-kurz) var(--kurve-standard);
}
.foto__zu:active { transform: scale(var(--skala-druck-klein)); }
.foto__rahmen { min-height: 0; height: 100%; overflow: hidden; touch-action: none; cursor: grab; }
.foto__rahmen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 50%; touch-action: none; }
.foto__leiste {
  display: flex; justify-content: center; gap: var(--a-3);
  padding: var(--a-3) calc(var(--a-4) + var(--sicher-rechts)) max(var(--a-3), var(--sicher-unten)) calc(var(--a-4) + var(--sicher-links));
  background: var(--video-chrome);
}
.foto__leiste .knopf { flex: 1 1 0; max-width: 220px; }
.foto__leiste .knopf:not(.knopf--primaer) { background: rgb(255 255 255 / .14); color: var(--video-chrome-text); }
.foto__leiste:not(:has(:not([hidden]))) { display: none; }
.foto :focus-visible { outline-color: var(--gelb-500); }

/* ===================================================================== Sheets / Dialoge (§8.10) */
.sheet {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  display: grid; align-items: end; justify-items: center;
  background: var(--abdunkeln); animation: blende-ein var(--d-blende) var(--kurve-standard);
}
html[data-tastatur] .sheet { top: var(--vv-oben); bottom: auto; height: var(--vv-hoehe); }
html[data-tastatur] .sheet__box { padding-bottom: var(--a-4); }   /* Safe-Area unten liegt unter der Tastatur */
.sheet__box {
  width: min(600px, 100%); max-height: 92vh; max-height: min(92dvh, calc(var(--vv-hoehe) - 16px));
  display: flex; flex-direction: column; gap: var(--a-3); overflow: hidden;
  padding: var(--a-6) calc(var(--a-6) + var(--sicher-rechts)) max(var(--a-6), var(--sicher-unten)) calc(var(--a-6) + var(--sicher-links));
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--glas-2);
  -webkit-backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung)); backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung));
  box-shadow: var(--glas-kante), var(--schatten-3);
  animation: sheet-rein var(--d-lang) var(--kurve-rein);
}
@keyframes sheet-rein { from { transform: translateY(var(--versatz-sheet)); } }
.sheet__box > h3 { flex: none; text-align: center; font-size: var(--t-titel-2); line-height: var(--zh-titel-2); font-weight: var(--gewicht-fett); }
/* Aktion rechts im Kopf (Symbol-Knopf 44 × 44, z. B. „Aktualisieren“); der Titel bleibt zentriert und überlappt nie */
.sheet__box { position: relative; }
.sheet__aktion { position: absolute; z-index: 1; top: calc(var(--a-6) - var(--a-2)); right: calc(var(--a-6) + var(--sicher-rechts) - var(--a-2)); }
.sheet__box[data-aktion] > h3 { padding-inline: calc(var(--ziel-min) + var(--a-1)); }
#sheet[data-gefahr] .sheet__box > h3::before, .sheet__box[data-gefahr] > h3::before {
  content: ""; display: block; width: 26px; height: 23px; margin: 0 auto var(--a-2);
  background: var(--fehler); clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.sheet__box > p { flex: none; margin: 0; color: var(--text-2); font-size: var(--t-unterzeile); white-space: pre-line; text-align: center; }
.sheet__box > p:empty { display: none; }
.sheet__box > .sheet__hinweis { color: var(--text-3); font-size: var(--t-fussnote); }
.sheet__box > .meldung { color: var(--fehler); }
.sheet__inhalt {
  display: grid; gap: var(--a-3); align-content: start; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; margin: 0 calc(-1 * var(--a-1)); padding: var(--a-1);
}
.sheet__inhalt:empty { display: none; }
.sheet__knoepfe { flex: none; display: flex; flex-direction: column-reverse; gap: var(--a-2); }
.sheet__knoepfe .knopf { width: 100%; }
/* Tastatur offen (Befund B1): wenig Höhe – Titel, Text und Inhalt scrollen GEMEINSAM in der Box, damit das
   fokussierte Feld auch bei kleinem sichtbaren Bereich Platz hat; die Knöpfe bleiben unten stehen (sticky, deckend,
   app.js feldZeigen rechnet sie aus dem sichtbaren Bereich heraus). */
html[data-tastatur] .sheet__box { overflow-y: auto; overscroll-behavior: contain; }
html[data-tastatur] .sheet__box > * { flex-shrink: 0; }
html[data-tastatur] .sheet__inhalt { flex: none; overflow: visible; }
html[data-tastatur] .sheet__knoepfe {
  position: sticky; bottom: calc(-1 * var(--a-4)); margin-bottom: calc(-1 * var(--a-4));
  padding: var(--a-2) 0 var(--a-4); background: var(--glas-2-deckend); box-shadow: 0 -1px 0 var(--haarlinie);
}

/* Auswahlblatt „Quelle wählen“ (ERGÄNZUNG 5 §H7.2): eine Listbox, Gruppen mit Überschrift, gewählt = Auswahlfläche + Haken */
.quellen { display: grid; gap: var(--a-4); min-width: 0; }
.quellen__gruppe { display: grid; gap: var(--a-2); min-width: 0; }
.quellen__kopf { padding: 0 var(--a-4); }
.quellen__option[aria-selected="true"] { background: var(--flaeche-auswahl); }
.quellen__option[aria-selected="true"] .zeile__text b { font-weight: var(--gewicht-halbfett); }
.quellen__haken { display: grid; color: var(--akzent-text); visibility: hidden; }
.quellen__option[aria-selected="true"] .quellen__haken { visibility: visible; }
.quellen__option[aria-disabled="true"] { cursor: not-allowed; }
.quellen__option[aria-disabled="true"] .zeile__icon { opacity: .4; }
.quellen__option[aria-disabled="true"] .zeile__text b { color: var(--text-2); }
.quellen__option .zeile__text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Titel/Hinweis höchstens zwei Zeilen (lange Fenstertitel), Rest gekürzt */
.quellen__option .zeile__text small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.quellen__laden { text-align: left; padding-bottom: 0; }
.quellen .hinweis { margin: 0 var(--a-1); }

/* ===================================================================== Toasts (§8.11) – oben mittig */
.toasts {
  position: fixed; z-index: var(--z-toast); top: calc(var(--sicher-oben) + var(--a-2)); left: 0; right: 0;
  width: min(420px, 100% - 2 * var(--rand-seite)); margin-inline: auto;
  display: grid; gap: var(--a-2); pointer-events: none;
}
html[data-tastatur] .toasts { top: calc(var(--vv-oben) + var(--sicher-oben) + var(--a-2)); }
.toast {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--a-3); align-items: start;
  padding: var(--a-3) 14px; border-radius: var(--r-toast); color: var(--text-1);
  background: var(--glas-2);
  -webkit-backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung)); backdrop-filter: blur(var(--glas-blur-2)) saturate(var(--glas-saettigung));
  box-shadow: var(--glas-kante), var(--schatten-2);
  pointer-events: auto; cursor: pointer; animation: toast-rein var(--d-mittel) var(--kurve-rein);
}
.toast.weg { animation: toast-raus var(--d-kurz) var(--kurve-raus) forwards; }
@keyframes toast-rein { from { opacity: 0; transform: translateY(calc(-1 * var(--versatz-mittel))); } }
@keyframes toast-raus { to { opacity: 0; transform: translateY(calc(-1 * var(--versatz-mittel))); } }
.toast > i { width: 10px; height: 10px; margin-top: 6px; border-radius: var(--r-voll); background: var(--stufe); }
.toast__icon { width: var(--icon-m); height: var(--icon-m); color: var(--stufe); }
.toast b { display: block; font-size: var(--t-unterzeile); font-weight: var(--gewicht-halbfett); }
.toast span { display: block; color: var(--text-2); font-size: var(--t-fussnote); overflow-wrap: anywhere; }
.toast__zu {
  width: 44px; height: 44px; margin: -10px -10px -10px 0; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--r-voll); background: none; color: var(--text-2); cursor: pointer;
}
.toast__zu svg { width: var(--icon-s); height: var(--icon-s); }

/* ===================================================================== Lade-, Leer-, Neu-Zustände (§8.13) */
.liste[data-laedt]::after {
  content: ""; display: block; height: 100px; margin: var(--a-4);
  background:
    linear-gradient(var(--flaeche-3) 0 0) 0 0 / 60% 14px no-repeat,
    linear-gradient(var(--flaeche-3) 0 0) 0 43px / 40% 14px no-repeat,
    linear-gradient(var(--flaeche-3) 0 0) 0 86px / 80% 14px no-repeat;
  animation: pulsieren calc(var(--d-lang) * 3) ease-in-out infinite alternate;
}
@keyframes pulsieren { to { opacity: .6; } }
.liste[aria-busy="true"] > :not(.ueberschrift):not(.skelett-liste) { opacity: .5; transition: opacity var(--d-kurz) var(--kurve-standard); }
.gruppe:has(> .liste[aria-busy="true"]) > .ueberschrift { display: flex; align-items: center; gap: var(--a-2); }
.gruppe:has(> .liste[aria-busy="true"]) > .ueberschrift::after {
  content: ""; width: 12px; height: 12px; border-radius: var(--r-voll); border: 2px solid var(--fuellung-hover); border-top-color: currentColor;
  animation: drehen calc(var(--d-lang) * 2) linear infinite;
}
.neu { animation: neu-rein var(--d-mittel) var(--kurve-rein); }
@keyframes neu-rein { from { opacity: 0; transform: translateY(var(--versatz-klein)); } }

/* Skelett-Platzhalter (Durchgang B): gleiche Maße wie der echte Inhalt (gleiche Markup-/Klassenstruktur oder Text unsichtbar
   im selben Element) → kein Layout-Sprung. Schimmer nur per transform auf dem Pseudo-Element der Platzhalter selbst
   (keine fixierten Vorfahren); Farben ausschließlich Tokens. */
.sk, #v-uebersicht[data-laden] :is(.hero h3, .hero__info, .kachel__wert, .kachel__info, .ring figcaption b, .ring figcaption span, .ring small) {
  position: relative; overflow: hidden; border-radius: var(--r-xs); background: var(--fuellung);
  color: transparent !important; user-select: none; pointer-events: none;
}
.sk::after, #v-uebersicht[data-laden] :is(.hero h3, .hero__info, .kachel__wert, .kachel__info, .ring figcaption b, .ring figcaption span, .ring small)::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--fuellung-hover), transparent);
  animation: skelett-glanz calc(var(--d-lang) * 4) var(--kurve-standard) infinite;
}
@keyframes skelett-glanz { to { transform: translateX(100%); } }
#v-uebersicht[data-laden] :is(.hero__info, .kachel__info):empty::before { content: "b"; }
#v-uebersicht[data-laden] :is(.hero h3, .hero__info, .kachel__wert, .kachel__info, .ring small) { white-space: nowrap; }
#v-uebersicht[data-laden] :is(.hero h3, .kachel__wert) { width: 60%; }
#v-uebersicht[data-laden] :is(.hero__info, .kachel__info) { width: 85%; }
#v-uebersicht[data-laden] .ring small { width: 70%; margin-inline: auto; }
#v-uebersicht[data-laden] .ring figcaption b { width: 2.2ch; justify-self: center; }
#v-uebersicht[data-laden] .ring figcaption span { width: 5ch; justify-self: center; }
#v-uebersicht[data-laden] .ring__wert { opacity: 0; }
#v-uebersicht[data-laden] .ring__bahn { animation: pulsieren calc(var(--d-lang) * 3) ease-in-out infinite alternate; }
/* Ende des Ladens: echter Inhalt blendet kurz ein (nur Deckkraft) */
#v-uebersicht.sk-weg :is(.hero h3, .hero__info, .kachel__wert, .kachel__info, .ring figcaption, .ring small) { animation: blende-ein var(--d-mittel) var(--kurve-rein); }

/* Listen-Skelette (Verlauf, Mitteilungscenter): dieselben <li>-Zeilen wie die echten Einträge, nur mit .sk-Platzhaltern */
.verlauf-block > .skelett-liste { display: none; }
.verlauf-block[data-laedt]::after { content: none; }
.verlauf-block[data-laedt] > .skelett-liste { display: grid; }
.skelett-liste li > i { background: var(--fuellung); }
.skelett-liste b, .skelett-liste small, .skelett-liste time { display: block; border-radius: var(--r-xs); }
.skelett-liste b { width: 55%; }
.skelett-liste small { width: 35%; margin-top: 2px; }
.skelett-liste li:nth-child(2n) b { width: 42%; }
.skelett-liste li:nth-child(3n) small { width: 48%; }
.skelett-liste time { width: 2.8em; }
.mz.skelett-liste time { width: 4.5em; margin-top: 2px; }
.sk--symbol { display: block; width: var(--icon-m); height: var(--icon-m); border-radius: var(--r-voll); }

/* System-Ansicht vor dem ersten Schnappschuss */
#v-system .skelett-messung, #v-system .skelett-tabelle, #v-system .skelett-karte { display: none; }
#v-system[data-laden] .skelett-messung { display: grid; }
#v-system[data-laden] .skelett-tabelle, #v-system[data-laden] .skelett-karte { display: grid; }
#v-system[data-laden] .liste > .messung:not(.skelett-messung), #v-system[data-laden] #sy-platten, #v-system[data-laden] .sy-tab, #v-system[data-laden] #sy-proz-leer { display: none; }
.skelett-messung + .skelett-messung { box-shadow: none; }
.skelett-messung .balken { background: var(--fuellung); }
.skelett-messung .messung__name { width: 40%; }
.skelett-messung .messung__wert { width: 3.5em; }
.skelett-messung .messung__info { width: 70%; }
.skelett-messung .messung__kopf > * { border-radius: var(--r-xs); }
.skelett-tabelle { padding: var(--a-2) var(--a-3); gap: var(--a-2); }
.skelett-tabelle .sk { display: block; height: calc(var(--t-fussnote) * var(--zh-fussnote)); }

/* ===================================================================== Grenzen */
.grenzen ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--a-2); color: var(--text-2); font-size: var(--t-fussnote); line-height: var(--zh-fussnote); }

/* ===================================================================== Komplettverschlüsselung (ERGÄNZUNG 6, P4) */
/* Nur vorhandene Tokens. Hinweise im Fluss (§8.2): Stufe über data-stufe, Aktion als Text- bzw. kleiner Primärknopf. */
.e2e-hinweise { display: grid; gap: var(--a-2); min-width: 0; }
.e2e-hinweis .hinweis__text > p:first-child b { font-weight: var(--gewicht-halbfett); }
.e2e-hinweis .hinweis__text > .knopf { justify-self: start; margin-top: var(--a-1); }
/* Sicherheitsnummer (Version 2): sechs Gruppen in zwei Reihen, groß und in Monospace – gut zu vergleichen (§I3.5) */
.e2e-nummer {
  display: grid; grid-template-columns: repeat(3, max-content); justify-content: center; gap: var(--a-2) var(--a-4);
  margin: 0; padding: var(--a-4) var(--a-3); border: 1px solid var(--haarlinie); border-radius: var(--r-m); background: var(--flaeche-2);
  font-family: var(--schrift-mono); font-size: var(--t-28); line-height: 1.2; font-weight: var(--gewicht-fett); letter-spacing: .08em;
  color: var(--text-1); font-variant-numeric: tabular-nums; -webkit-user-select: all; user-select: all;
}
.e2e-frage { margin: 0; text-align: center; font-size: var(--t-kopf); line-height: var(--zh-kopf); font-weight: var(--gewicht-halbfett); color: var(--text-1); }
/* „Verbindung zum PC wird geprüft …“ / „Warte auf den PC …“: Zeile mit kleinem Spinner (role=status) */
.e2e-pruefen { display: flex; align-items: center; justify-content: center; gap: var(--a-2); margin: 0; color: var(--text-2); font-size: var(--t-unterzeile); text-align: center; }
.e2e-pruefen .drehen { width: var(--icon-s); height: var(--icon-s); flex: none; }
.e2e-passkey-hinweis { text-align: center; }
/* Stand der Verschlüsselung in „Bildschirm“ (ersetzt in Stufe 2 die v1-Sicherheitsnummer, §I10.4 Punkt 5) */
.e2e-stand { display: grid; gap: var(--a-1); padding: var(--a-3) var(--a-4); border: 1px solid var(--haarlinie); border-radius: var(--r-m); background: var(--flaeche-2); }
.e2e-stand.ok { border-color: var(--ok); }
.e2e-stand__wert { margin: 0; font-size: var(--t-kopf); line-height: var(--zh-kopf); font-weight: var(--gewicht-halbfett); color: var(--text-1); overflow-wrap: anywhere; }
@media (max-width: 359px) { .e2e-nummer { font-size: var(--t-22); gap: var(--a-2) var(--a-3); } }

/* Transfer (Ergänzung 8): Freigaben und laufende Übertragungen – nur Tokens, keine festen Farben */
.sft-liste { list-style: none; margin: 0; padding: 0; display: grid; min-width: 0; }
.sft {
  --stufe: var(--neutral); position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--a-2) var(--a-3);
  align-items: start; min-width: 0; padding: var(--a-3) var(--a-4);
}
.sft + .sft::before { content: ""; position: absolute; top: 0; right: 0; left: var(--a-4); height: 1px; background: var(--trenner); }
.sft[data-stufe="ok"] { --stufe: var(--ok); }
.sft[data-stufe="warn"] { --stufe: var(--warn); }
.sft[data-stufe="fehler"] { --stufe: var(--fehler); }
.sft[data-stufe="akzent"] { --stufe: var(--akzent-text); }
.sft[aria-current="true"] { background: var(--akzent-tint); }
.sft__icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-s); background: var(--fuellung); color: var(--stufe); }
.sft__icon svg { width: 18px; height: 18px; }
.sft__text { display: grid; gap: var(--a-1); min-width: 0; }
.sft__name { font-weight: var(--gewicht-mittel); overflow-wrap: anywhere; }
.sft__meta, .sft__status, .sft__warnung { color: var(--text-3); font-size: var(--t-fussnote); line-height: var(--zh-fussnote); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sft__status { color: var(--text-2); }
.sft[data-stufe="fehler"] .sft__status { color: var(--fehler); }
.sft__status:empty, .sft__warnung:empty { display: none; }
.sft__balken--offen > span { opacity: .45; }
.sft__knoepfe { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--a-2); min-width: 0; }
.sft__knoepfe:empty { display: none; }

/* ===================================================================== Hover nur mit Maus (§7) */
@media (hover: hover) and (pointer: fine) {
  .knopf:hover:not(:active):not(:disabled) { background: var(--fuellung-hover); }
  .knopf--primaer:hover:not(:active):not(:disabled) { background: var(--akzent-hover); }
  .knopf--getoent:hover:not(:active):not(:disabled) { background: var(--akzent-tint); }
  .knopf--gefahr:hover:not(:active):not(:disabled) { background: var(--gefahr-flaeche); }
  .knopf--gefahr-leise:hover:not(:active):not(:disabled), .knopf--rot-leise:hover:not(:active):not(:disabled) { background: var(--fehler-tint); }
  .knopf--getoent:hover:not(:disabled)::after, .knopf--gefahr:hover:not(:disabled)::after,
  .knopf--gefahr-leise:hover:not(:disabled)::after, .knopf--rot-leise:hover:not(:disabled)::after { opacity: 1; }
  .link:hover:not(:disabled) { text-decoration: underline; }
  button.zeile:hover:not(:disabled), label.zeile:hover { background: var(--flaeche-druck); }
  .quelle:hover:not(:disabled):not(:active), .quellen__option:hover:not([aria-disabled="true"]):not([aria-selected="true"]) { background: var(--flaeche-druck); }
  .chip:hover:not(:disabled):not([aria-pressed="true"]), .steuerkachel:hover:not(:disabled), .medien__knopf:hover:not(:disabled):not(.medien__knopf--haupt) { background: var(--fuellung-hover); }
  .segment button[aria-checked="false"]:hover { color: var(--text-1); }
  .feld__zeigen:hover, .toast__zu:hover, .quer__zu:hover { background: var(--flaeche-druck); }
  .foto__zu:hover, .vb-zu:hover { background: rgb(255 255 255 / .22); }
  .spieler:is(.spieler-ebene > *, :fullscreen, :-webkit-full-screen) .buehne__leiste .knopf:not(.knopf--gefahr-leise):hover:not(:active) { background: rgb(255 255 255 / .22); }
  .tabs button:hover:not([aria-current="page"]) { color: var(--text-1); }
}

/* ===================================================================== Breakpoints */
@media (max-width: 599px) {
  .nur-breit { display: none; }
  .knopf--icon-text { width: var(--ziel-min); padding: 0; }
}

/* sieben Tab-Ziele auf schmalen Handys: Beschriftung etwas enger, Ränder kleiner (Safe-Area bleibt) */
@media (max-width: 479px) {
  .tabs { padding-left: calc(var(--a-1) + var(--sicher-links)); padding-right: calc(var(--a-1) + var(--sicher-rechts)); }
  .tabs__text { font-size: calc(var(--t-leiste) * 0.92); letter-spacing: -0.03em; }
}

@media (max-width: 359px) {
  .ringe { --ring: 104px; gap: var(--a-2); }
  .kacheln { grid-template-columns: minmax(0, 1fr); }
  .codes { grid-template-columns: minmax(0, 1fr); }
  .plan { grid-template-columns: auto minmax(0, 1fr); }
  .plan .knopf { grid-column: 1 / -1; }
  .spark { grid-template-columns: 5rem minmax(0, 1fr); }
  .spark__achse { margin-left: calc(5rem + var(--a-3)); }
}

/* Tablet 600–1023: schwebende Tab-Pille (weiterhin Grid-Zeile), zwei Spalten */
@media (min-width: 600px) {
  .tabs {
    justify-self: center; width: min(560px, 100% - 2 * var(--rand-seite));
    margin-bottom: max(var(--a-3), var(--sicher-unten)); padding: var(--a-1) var(--a-2);
    border-radius: var(--r-voll); box-shadow: var(--schatten-2), var(--glas-kante), inset 0 0 0 1px var(--haarlinie);
  }
  .karte, .aus, .hero, .grafik, .kachel { padding: var(--a-5); }
  .ansicht--schale:not(.ansicht--lesen) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #v-uebersicht > .ringe-karte, #v-uebersicht > .kacheln,
  #v-uebersicht > .kachel--claude, #v-uebersicht > .grafik { grid-column: span 1; }
  #v-uebersicht > .kachel--claude:has(+ .grafik[hidden]) { grid-column: 1 / -1; }
  #v-uebersicht .ringe { --ring: 104px; gap: var(--a-3); }
  .spalte--seite { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spalte--seite > #s-pc-block { grid-column: 1 / -1; }
  #v-einstellungen > .spalte { grid-column: span 1; }
  .steuerkacheln { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
  .knopfreihe, .sheet__knoepfe { flex-direction: row; justify-content: flex-end; flex-wrap: wrap; }
  .knopfreihe .knopf, .sheet__knoepfe .knopf { width: auto; }
  .sheet__knoepfe .knopf--breit, .sheet__knoepfe .knopf:only-child { width: 100%; }
  .sheet { align-items: center; padding: var(--a-6); }
  html[data-tastatur] .sheet { padding-block: var(--a-2); }   /* Box (max. --vv-hoehe − 16 px) passt in den sichtbaren Bereich */
  .sheet__box {
    width: min(var(--inhalt-formular), 100%); border-radius: var(--r-dialog);
    padding: var(--a-6); animation-name: dialog-rein;
  }
  .ansicht--formular { padding-top: calc(var(--sicher-oben) + var(--a-6)); }
}
@keyframes dialog-rein { from { opacity: 0; transform: scale(.96); } }

/* Desktop ≥ 1024: dieselbe Navigation als Sidebar, 12er-Raster */
@media (min-width: 1024px) {
  .schale {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "nav kopf" "nav inhalt";
  }
  .tabs {
    width: var(--sidebar-breite); margin: 0; justify-self: stretch; align-content: start;
    grid-template-columns: minmax(0, 1fr); gap: var(--a-1); border-radius: 0; overflow-y: auto;
    padding: calc(var(--a-4) + var(--sicher-oben)) var(--a-3) calc(var(--a-4) + var(--sicher-unten)) calc(var(--a-3) + var(--sicher-links));
    box-shadow: var(--glas-kante), inset -1px 0 0 var(--haarlinie);
  }
  .tabs__marke { display: flex; align-items: center; gap: var(--a-3); min-width: 0; padding: 0 var(--a-2) var(--a-5); }
  .tabs button {
    grid-template-columns: var(--icon-l) minmax(0, 1fr); justify-items: start; align-items: center; gap: var(--a-3);
    padding: 0 var(--a-3); border-radius: var(--r-s); color: var(--text-1);
    font-size: var(--t-unterzeile); line-height: var(--zh-unterzeile); font-weight: var(--gewicht-normal); text-align: left;
    transition: background-color var(--d-sofort) var(--kurve-standard);
  }
  .tabs__kapsel { width: var(--icon-l); height: var(--icon-l); color: var(--text-2); }
  .tabs__kapsel svg { width: var(--icon-m); height: var(--icon-m); }
  .tabs button[aria-current="page"] { background: var(--flaeche-auswahl); font-weight: var(--gewicht-halbfett); }
  .tabs button[aria-current="page"] .tabs__kapsel, .tabs button:active .tabs__kapsel,
  .tabs button[aria-current="page"]:active .tabs__kapsel { background: none; }
  .tabs button[aria-current="page"] .tabs__kapsel { color: var(--akzent-text); }
  .tabs button:active { background: var(--flaeche-druck); }
  .tabs button:focus-visible { outline: var(--fokus-breite) solid var(--fokus-ring); outline-offset: -2px; }
  .tabs button:focus-visible .tabs__kapsel { outline: none; }
  .logo--kopf { display: none; }
  .ansicht--schale:not(.ansicht--lesen) { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  #v-uebersicht > .hero { grid-column: span 7; }
  #v-uebersicht > .ringe-karte { grid-column: span 5; }
  #v-uebersicht > .kacheln { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #v-uebersicht .kachel--breit { grid-column: auto; }
  #v-uebersicht > .kachel--claude, #v-uebersicht > .grafik { grid-column: span 6; }
  #v-uebersicht > .kachel--claude:has(+ .grafik[hidden]) { grid-column: 1 / -1; }
  #v-steuerung > .aus { grid-column: span 7; }
  #v-steuerung > .spalte--seite { grid-column: span 5; grid-template-columns: minmax(0, 1fr); }
  #v-video > .auswahl { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--a-7); }
  #v-einstellungen > .spalte { grid-column: span 6; }
  #v-system > .spalte { grid-column: span 6; }
  #v-system > .hinweis { grid-column: 1 / -1; }
  .spieler .bildrahmen { max-height: calc(var(--schale-hoehe) - 340px); }
}

/* Breit ≥ 1440: Hero 8 + Ringe 4 (DESIGNSYSTEM §9.2), Ringe wieder 120 */
@media (min-width: 1440px) {
  #v-uebersicht > .hero { grid-column: span 8; }
  #v-uebersicht > .ringe-karte { grid-column: span 4; }
  #v-uebersicht .ringe { --ring: 120px; gap: var(--a-4); }
}

/* Handy quer: Kopf und Leiste flach (44), Icon neben der Beschriftung */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --kopf-hoehe: 44px; }
  .ansicht__titel { font-size: var(--t-titel-1); line-height: var(--zh-titel-1); }
  /* B1: Rahmen + Lücke + Leiste (44) müssen in main passen (844×390: main 286 px) – vorher 20 px zu hoch */
  .spieler .bildrahmen { max-height: calc(var(--schale-hoehe) - 160px); }
  /* … bei ganzen Bildschirmen zusätzlich das Warnband (32–34, je nach Schrift) + Lücke (12). :where hält die Spezifität bei 0,2,0 –
     Großansicht/Vollbild (max-height: none, 0,3,0) bleiben unberührt. */
  .spieler:where([data-modus="mehr"]) .bildrahmen { max-height: calc(var(--schale-hoehe) - 208px); }
}
/* B1 (kleines Handy quer, z. B. 667×375): Spieler-Leiste einzeilig – Vollbild/Beenden nur als Icon (aria-label bleibt) */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 759px) {
  .buehne__leiste .nur-breit { display: none; }
  .buehne__leiste .knopf--icon-text { width: var(--ziel-min); padding: 0; }
}
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1023px) {
  .tabs { padding-top: 0; padding-bottom: max(var(--a-1), var(--sicher-unten)); }
  .tabs button { grid-auto-flow: column; justify-content: center; align-items: center; gap: var(--a-1); padding: 0 var(--a-1); }
  .tabs__kapsel { width: 36px; height: 28px; }
  .tabs__kapsel svg { width: var(--icon-m); height: var(--icon-m); }
}

/* ===================================================================== Rückfälle und Barrierefreiheit */
/* Ohne backdrop-filter: deckende Glasflächen (§4.4) */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sheet__box, .toast { background: var(--glas-2-deckend); }
}

/* Windows-Kontrastdesigns: Ränder statt Schatten/Flächen */
@media (forced-colors: active) {
  .glas, .knopf, .chip, .segment__marke, .steuerkachel, .medien__knopf, .toast, .sheet__box, .pille, .abzeichen, .zahl, .halten, .tabs__kapsel, .quelle { border: 1px solid CanvasText; }
  .quellen__option[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .tabs button[aria-current="page"] .tabs__kapsel, .chip[aria-pressed="true"], .segment button[aria-checked="true"] { outline: 2px solid Highlight; }
  .schalter { border: 1px solid CanvasText; }
  .schalter:checked { background: Highlight; }
  .hero, .aus, .plan { border-left: 4px solid CanvasText; }
}

/* Reduzierte Bewegung: Tokens kürzen Dauern/Versätze; zusätzlich Sicherheitsregel (§5).
   Die Halte-Füllung ist eine TRANSITION mit --d-halten und bleibt deshalb funktional (.bewegung-funktional). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .sk::after, #v-uebersicht[data-laden] :is(.hero h3, .hero__info, .kachel__wert, .kachel__info, .ring figcaption b, .ring figcaption span, .ring small)::after { animation: none !important; display: none; }
  #v-uebersicht[data-laden] .ring__bahn, .liste[data-laedt]::after { animation: none !important; }
  .drehen, .knopf[aria-busy="true"]::before { border-top-color: var(--fuellung-hover); border-right-color: currentColor; }
}

/* Ergänzung 7: Ansicht „System“ (Task-Manager, nur Anzeige) – ausschließlich Tokens */
.messung { --stufe: var(--neutral); display: grid; gap: var(--a-1); padding: var(--a-3) var(--a-4); min-width: 0; box-shadow: inset 0 -1px 0 var(--trenner); }
.liste > .messung:last-child { box-shadow: none; }
.messung[data-stufe="ok"] { --stufe: var(--ok); }
.messung[data-stufe="warn"] { --stufe: var(--warn); }
.messung[data-stufe="fehler"] { --stufe: var(--fehler); }
.messung__kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--a-3); min-width: 0; }
.messung__name { font-size: var(--t-text); color: var(--text-1); min-width: 0; overflow-wrap: anywhere; }
.messung__wert { font-size: var(--t-titel-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.messung__info { color: var(--text-2); font-size: var(--t-fussnote); line-height: var(--zh-fussnote); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.balken { height: 8px; border-radius: var(--r-voll); background: var(--fuellung); overflow: hidden; }
.balken > span { display: block; height: 100%; width: 0; border-radius: var(--r-voll); background: var(--stufe); transition: width var(--d-mittel) var(--kurve-standard); }
.sy-tabelle { overflow-x: auto; overflow-y: hidden; min-width: 0; padding: 0; }
.sy-tab { width: 100%; border-collapse: collapse; font-size: var(--t-fussnote); font-variant-numeric: tabular-nums; }
.sy-tab th { padding: var(--a-2) var(--a-3); text-align: left; font-weight: var(--gewicht-halbfett); color: var(--text-2); box-shadow: inset 0 -1px 0 var(--trenner); white-space: nowrap; }
.sy-tab td { padding: var(--a-2) var(--a-3); color: var(--text-1); box-shadow: inset 0 -1px 0 var(--trenner); vertical-align: top; }
.sy-tab tbody tr:last-child td { box-shadow: none; }
.sy-tab .sy-zahl { text-align: right; white-space: nowrap; }
.sy-tab td:first-child { overflow-wrap: anywhere; word-break: break-word; min-width: 7em; }
.sy-tab td:nth-child(2) { color: var(--text-2); }
.sy-tabelle:focus-visible { outline-offset: -2px; }
@media (max-width: 359px) {
  .tabs { padding-left: calc(var(--a-1) + var(--sicher-links)); padding-right: calc(var(--a-1) + var(--sicher-rechts)); }
  .sy-tab th, .sy-tab td { padding-left: var(--a-2); padding-right: var(--a-2); }
  .tabs__text { letter-spacing: -0.03em; }   /* sieben Ziele ab 320 px: Beschriftungen berühren sich sonst */
  .segment button { padding: 0 var(--a-1); font-size: var(--t-mini); }   /* „Mitteilungen“ passt sonst nicht in ein Drittel (94 px) */
}
