/*
  Updater Unified - Designsystem (Modernisierung Phase 2).

  Ein einziges, wiederverwendbares Token- und Komponentenset fuer die gesamte
  neue Weboberflaeche. Bewusst zurueckhaltend und professionell: neutrale
  Graustufen, EIN Akzent, klare Statusfarben, keine dekorativen Effekte.

  Kompatibel mit der strengen CSP (style-src 'self'): keine Inline-Styles -
  Zustaende werden ueber Klassen gesetzt, dynamische Werte ueber CSSOM (el.style).

  Dark Mode folgt dem System (prefers-color-scheme) und laesst sich ueber
  [data-theme="hell"|"dunkel"] am <html> uebersteuern.
*/

:root {
  /* Typografie: System-Stack, keine Web-Fonts (CSP + Performance). */
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --schrift-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
  --fs-xs: 0.75rem;   /* 12 */
  --fs-sm: 0.8125rem; /* 13 */
  --fs-md: 0.875rem;  /* 14 - Basistext der Verwaltung */
  --fs-lg: 1rem;      /* 16 */
  --fs-xl: 1.25rem;   /* 20 */
  --fs-2xl: 1.625rem; /* 26 */
  --lh: 1.5;
  --fw-normal: 450;
  --fw-med: 550;
  --fw-bold: 650;

  /* Abstaende: 4px-Raster. */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-8: 3rem;

  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px; --radius-pill: 999px;

  /* Neutrale Flaechen + Text (hell). */
  --bg: #f4f5f7;
  --flaeche: #ffffff;
  --flaeche-2: #fafbfc;
  --flaeche-hover: #f0f2f5;
  --rand: #e3e6ea;
  --rand-stark: #cdd2d9;
  --text: #1a1d21;
  --text-2: #4a515a;
  --text-3: #767e89;
  --text-aus: #9aa2ac;

  /* Akzent (ein einziger). */
  --akzent: #2f6bd8;
  --akzent-stark: #2457b8;
  --akzent-schwach: #e8f0fd;
  --akzent-text: #ffffff;

  /* Statuspalette: Text/Rahmen (-d) und zarte Flaeche (-f). */
  --ok-d: #1f8a4c;  --ok-f: #e6f5ec;
  --warn-d: #b26a00; --warn-f: #fdf1df;
  --fehler-d: #c23434; --fehler-f: #fbe9e9;
  --info-d: #2f6bd8; --info-f: #e8f0fd;
  --neutral-d: #5a626c; --neutral-f: #eef0f3;

  --schatten-1: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --schatten-2: 0 4px 12px rgba(16, 24, 40, 0.10);
  --ring: 0 0 0 3px rgba(47, 107, 216, 0.35);

  --kopf-h: 56px;
  --nav-b: 232px;
}

:root[data-theme="dunkel"],
:root:not([data-theme="hell"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    color-scheme: dark;
    --bg: #0f1215;
    --flaeche: #181c21;
    --flaeche-2: #14181c;
    --flaeche-hover: #202630;
    --rand: #2a313a;
    --rand-stark: #3a434f;
    --text: #e8ebef;
    --text-2: #b4bcc6;
    --text-3: #8a93a0;
    --text-aus: #646d79;
    --akzent: #5b92f0;
    --akzent-stark: #71a2f5;
    --akzent-schwach: #1a2740;
    --ok-d: #4ec27d; --ok-f: #11291c;
    --warn-d: #e0a44a; --warn-f: #2e2310;
    --fehler-d: #ec6a6a; --fehler-f: #2e1718;
    --info-d: #5b92f0; --info-f: #1a2740;
    --neutral-d: #9aa3af; --neutral-f: #232a33;
    --schatten-1: 0 1px 2px rgba(0,0,0,0.4);
    --schatten-2: 0 6px 16px rgba(0,0,0,0.5);
    --ring: 0 0 0 3px rgba(91, 146, 240, 0.45);
  }
}
:root[data-theme="dunkel"] {
  color-scheme: dark;
  --bg: #0f1215; --flaeche: #181c21; --flaeche-2: #14181c; --flaeche-hover: #202630;
  --rand: #2a313a; --rand-stark: #3a434f;
  --text: #e8ebef; --text-2: #b4bcc6; --text-3: #8a93a0; --text-aus: #646d79;
  --akzent: #5b92f0; --akzent-stark: #71a2f5; --akzent-schwach: #1a2740;
  --ok-d: #4ec27d; --ok-f: #11291c; --warn-d: #e0a44a; --warn-f: #2e2310;
  --fehler-d: #ec6a6a; --fehler-f: #2e1718; --info-d: #5b92f0; --info-f: #1a2740;
  --neutral-d: #9aa3af; --neutral-f: #232a33;
  --schatten-1: 0 1px 2px rgba(0,0,0,0.4); --schatten-2: 0 6px 16px rgba(0,0,0,0.5);
  --ring: 0 0 0 3px rgba(91, 146, 240, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--schrift);
  font-size: var(--fs-md);
  line-height: var(--lh);
  font-weight: var(--fw-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: var(--fw-bold); line-height: 1.3; }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sichtbarer, einheitlicher Fokus - Tastaturbedienung. */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Grundgerüst: Kopf + Seitennavigation + Inhalt ---- */
.uu-shell { min-height: 100vh; display: grid; grid-template-columns: var(--nav-b) 1fr; grid-template-rows: var(--kopf-h) 1fr; grid-template-areas: "marke kopf" "nav inhalt"; }
.uu-marke { grid-area: marke; display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-4); border-bottom: 1px solid var(--rand); border-right: 1px solid var(--rand); background: var(--flaeche); font-weight: var(--fw-bold); }
.uu-marke .punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--akzent); }
.uu-kopf { grid-area: kopf; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 0 var(--sp-5); border-bottom: 1px solid var(--rand); background: var(--flaeche); }
.uu-nav { grid-area: nav; border-right: 1px solid var(--rand); background: var(--flaeche); padding: var(--sp-3); overflow-y: auto; }
.uu-inhalt { grid-area: inhalt; padding: var(--sp-5); overflow-y: auto; max-width: 1240px; width: 100%; }

/* Grid-/Flex-Kinder duerfen nie breiter als ihr Track werden (sonst horizontales Seiten-Ueberlaufen):
   min-width:0 hebt die implizite min-width:auto auf, damit Inhalte umbrechen/scrollen statt zu schieben. */
.uu-marke, .uu-kopf, .uu-nav, .uu-inhalt { min-width: 0; }
.uu-kopf > .uu-reihe { min-width: 0; }
.uu-kopf #seitentitel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Lange, UNUNTERBROCHENE Zeichenketten (Geraetenamen, Dateinamen, IDs, lange Fehlermeldungen)
   umbrechen statt den Container zu sprengen. "anywhere" bricht nur, wenn es keine normale
   Umbruchstelle (Leerzeichen) gibt - normaler Text bricht weiterhin zuerst an Leerzeichen. */
.uu-inhalt, .uu-player-kopf strong, .uu-player-info { overflow-wrap: anywhere; }

.uu-navlink { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-2) var(--sp-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font: inherit; font-weight: var(--fw-med); text-align: left; cursor: pointer; margin-bottom: 2px; }
.uu-navlink:hover { background: var(--flaeche-hover); color: var(--text); }
.uu-navlink.aktiv { background: var(--akzent-schwach); color: var(--akzent-stark); }
.uu-navlink .ikone { width: 18px; text-align: center; flex: none; opacity: 0.9; }
.uu-navlink .marke-zahl { margin-left: auto; font-size: var(--fs-xs); font-weight: var(--fw-bold); background: var(--fehler-d); color: #fff; border-radius: var(--radius-pill); padding: 0 6px; min-width: 18px; text-align: center; }
/* UA ausser Betrieb: betroffene Navigationspunkte dezent abgesetzt + kleiner "aus"-Marker. */
.uu-navlink.aus { opacity: 0.55; }
.uu-navlink.aus .marke-aus { margin-left: auto; font-size: var(--fs-xs); font-weight: var(--fw-med); color: var(--text-3); border: 1px solid var(--rand); border-radius: var(--radius-pill); padding: 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.uu-nav-gruppe { margin: var(--sp-4) 0 var(--sp-1); padding: 0 var(--sp-3); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-aus); }

/* ---- Karten ---- */
.uu-karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten-1); }
.uu-karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--rand); }
.uu-karte-kopf h3 { font-size: var(--fs-md); }
.uu-karte-koerper { padding: var(--sp-4); }
.uu-raster { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.uu-kennzahlen { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.uu-kennzahl { padding: var(--sp-4); border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); }
.uu-kennzahl .wert { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.uu-kennzahl .etikett { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }
.uu-kennzahl.ok .wert { color: var(--ok-d); } .uu-kennzahl.warn .wert { color: var(--warn-d); } .uu-kennzahl.fehler .wert { color: var(--fehler-d); }

/* ---- Statusanzeigen (klar getrennt, nie irrefuehrend zusammengefasst) ---- */
.uu-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-med); border: 1px solid transparent; white-space: nowrap; }
.uu-pill .led { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.uu-pill.ok { color: var(--ok-d); background: var(--ok-f); }
.uu-pill.warn { color: var(--warn-d); background: var(--warn-f); }
.uu-pill.fehler { color: var(--fehler-d); background: var(--fehler-f); }
.uu-pill.info { color: var(--info-d); background: var(--info-f); }
.uu-pill.neutral { color: var(--neutral-d); background: var(--neutral-f); }
.uu-pill.aus { color: var(--text-aus); background: var(--neutral-f); }

/* Zustandsliste: Name links, klarer Einzelzustand rechts. */
.uu-zustandsliste { display: flex; flex-direction: column; gap: 1px; }
.uu-zustand { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--rand); }
.uu-zustand:last-child { border-bottom: 0; }
.uu-zustand .bez { color: var(--text-2); }
.uu-zustand .bez .unter { display: block; font-size: var(--fs-xs); color: var(--text-aus); }

/* ---- Buttons ---- */
.uu-btn { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm); border: 1px solid var(--rand-stark); background: var(--flaeche); color: var(--text); font: inherit; font-weight: var(--fw-med); cursor: pointer; }
.uu-btn:hover { background: var(--flaeche-hover); }
.uu-btn.primaer { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.uu-btn.primaer:hover { background: var(--akzent-stark); }
.uu-btn.gefahr { color: var(--fehler-d); border-color: var(--fehler-d); }
.uu-btn.gefahr:hover { background: var(--fehler-f); }
.uu-btn.klein { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); }
.uu-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Tabellen ---- */
/* Scrollhuelle: breite Tabellen scrollen horizontal IN diesem Container (erreichbar), statt den
   gesamten Inhaltsbereich zu verschieben. -webkit-overflow-scrolling fuer weiches Touch-Scrollen. */
.uu-tabelle-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* min-width haelt die Spalten auf schmalen Viewports lesbar: statt die Tabelle auf die
   Containerbreite zu stauchen (Kopfzeilen brachen dann Zeichen fuer Zeichen um), scrollt
   der .uu-tabelle-scroll-Container horizontal. Auf Desktop ohne Wirkung (width:100% groesser). */
.uu-tabelle { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: var(--fs-sm); }
.uu-tabelle th { text-align: left; font-weight: var(--fw-med); color: var(--text-3); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--rand); position: sticky; top: 0; background: var(--flaeche); white-space: nowrap; }
.uu-tabelle td { padding: var(--sp-3); border-bottom: 1px solid var(--rand); white-space: nowrap; }
.uu-tabelle tr:hover td { background: var(--flaeche-hover); }

/* ---- Zustaende: laden / leer / fehler ---- */
.uu-skeleton { background: linear-gradient(90deg, var(--flaeche-hover) 25%, var(--rand) 37%, var(--flaeche-hover) 63%); background-size: 400% 100%; animation: uu-shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes uu-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.uu-leer, .uu-fehler { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--text-3); }
.uu-leer .ikone, .uu-fehler .ikone { font-size: 1.75rem; opacity: 0.6; display: block; margin-bottom: var(--sp-2); }
.uu-fehler { color: var(--fehler-d); }
.uu-ok { color: var(--ok-d); }

/* ---- Hilfsklassen ---- */
/* Reihen brechen standardmaessig um: Button-/Tab-Leisten (Aktivitaets-/Archiv-Unternavigation,
   Geraete-Detailtabs, Aktionsreihen) laufen so nie horizontal aus dem Container, alle
   Schaltflaechen bleiben erreichbar. row-gap setzt den vertikalen Abstand umgebrochener Zeilen. */
.uu-reihe { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; row-gap: var(--sp-2); }
.uu-reihe.verteilt { justify-content: space-between; }
.uu-umbruch { flex-wrap: wrap; row-gap: var(--sp-2); }
.uu-stapel { display: flex; flex-direction: column; gap: var(--sp-3); }
.uu-mono { font-family: var(--schrift-mono); font-size: var(--fs-sm); }
.uu-gedaempft { color: var(--text-3); }
.uu-klein { font-size: var(--fs-sm); }
.uu-abschnitt-titel { font-size: var(--fs-xl); margin-bottom: var(--sp-4); }
.uu-abstand { margin-top: var(--sp-5); }

/* ---- Responsiv ---- */
@media (max-width: 860px) {
  /* Kopfzeile darf auf Schmalgeraeten in eine zweite Reihe umbrechen (auto-Hoehe), damit die
     Aktionen (Aktualisieren/Thema/Archiv) immer erreichbar bleiben statt die Seite zu verbreitern. */
  .uu-shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; grid-template-areas: "kopf" "nav" "inhalt"; }
  .uu-marke { display: none; }
  .uu-kopf { flex-wrap: wrap; height: auto; min-height: var(--kopf-h); padding: var(--sp-2) var(--sp-3); row-gap: var(--sp-2); }
  .uu-kopf > .uu-reihe { flex-wrap: wrap; }
  .uu-nav { border-right: 0; border-bottom: 1px solid var(--rand); display: flex; gap: var(--sp-1); overflow-x: auto; padding: var(--sp-2); }
  .uu-navlink { width: auto; white-space: nowrap; margin-bottom: 0; flex: none; }
  .uu-nav-gruppe { display: none; }
  .uu-inhalt { padding: var(--sp-4) var(--sp-3); }
}

/* ---- Video-Overlay (Aufnahmen-Player) ---- */
.uu-overlay { position: fixed; inset: 0; background: rgba(10,13,16,0.72); display: flex; align-items: center; justify-content: center; padding: var(--sp-4); z-index: 50; }
.uu-player { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius-lg); box-shadow: var(--schatten-2); width: min(960px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.uu-player-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--rand); }
.uu-player video { width: 100%; max-height: 64vh; background: #000; display: block; }
.uu-player-leiste { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--rand); flex-wrap: wrap; }
.uu-player-leiste select { padding: var(--sp-1) var(--sp-2); }
.uu-player-info { padding: 0 var(--sp-4) var(--sp-3); }

/* Aufnahme-Kacheln */
.uu-aufnahme { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--rand); border-radius: var(--radius-sm); }
.uu-aufnahme .meta { min-width: 0; }
.uu-aufnahme .meta .zeit { font-weight: var(--fw-med); }
.uu-aufnahme .meta .unter { font-size: var(--fs-xs); color: var(--text-3); }
.uu-balken { height: 8px; border-radius: var(--radius-pill); background: var(--flaeche-hover); overflow: hidden; border: 1px solid var(--rand); }
.uu-balken > span { display: block; height: 100%; background: var(--akzent); }

/* ---- Screenshot-Galerie + Lightbox ---- */
.uu-galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.uu-shot { position: relative; border: 1px solid var(--rand); border-radius: var(--radius-sm); overflow: hidden; background: var(--flaeche-2); padding: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column; min-width: 0; }
.uu-shot:hover { box-shadow: var(--schatten-1); border-color: var(--rand-stark); }
.uu-shot img { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--flaeche-hover); }
.uu-shot.nv img { opacity: 0.4; }
.uu-shot .cap { padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.uu-shot .cap .z { font-weight: var(--fw-med); font-size: var(--fs-sm); }
.uu-shot .cap .u { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uu-shot .nvtag { position: absolute; top: 6px; right: 6px; }

.uu-lightbox { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius-lg); box-shadow: var(--schatten-2); width: min(1100px, 100%); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.uu-lightbox-buehne { position: relative; display: flex; align-items: center; justify-content: center; background: #000; min-height: 0; }
.uu-lightbox-bild { max-width: 100%; max-height: 72vh; object-fit: contain; display: block; }
.uu-nav-pfeil { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(0,0,0,0.45); color: #fff; font-size: 2rem; line-height: 1; width: 44px; height: 64px; cursor: pointer; border-radius: var(--radius-sm); }
.uu-nav-pfeil.links { left: 8px; } .uu-nav-pfeil.rechts { right: 8px; }
.uu-nav-pfeil:hover { background: rgba(0, 0, 0, 0.7); }
.uu-nav-pfeil:disabled { opacity: 0.3; cursor: default; }

/* ---- Live-Bildschirm ---- */
.uu-live-buehne { position: relative; background: #000; border: 1px solid var(--rand); border-radius: var(--radius-sm); min-height: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.uu-live-bild { max-width: 100%; max-height: 60vh; object-fit: contain; display: none; }
.uu-live-hinweis { position: absolute; padding: var(--sp-4); text-align: center; font-size: var(--fs-sm); color: var(--text-3); }

/* Formularfelder (Einstellungen) */
.uu-feld { display: flex; flex-direction: column; gap: 4px; }
.uu-feld label { font-size: var(--fs-sm); font-weight: var(--fw-med); color: var(--text-2); }
.uu-feld input, .uu-feld select, .uu-input, .uu-select { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--rand-stark); border-radius: var(--radius-sm); background: var(--flaeche); color: var(--text); font: inherit; }
.uu-feld .hinweis { font-size: var(--fs-xs); color: var(--text-3); }
.uu-suchzeile { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--sp-3); }
.uu-suchzeile input[type="search"], .uu-suchzeile select { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--rand-stark); border-radius: var(--radius-sm); background: var(--flaeche); color: var(--text); font: inherit; }
.uu-suchzeile input[type="search"] { min-width: 220px; flex: 1; }

/* ---- WhatsApp-Archiv: Chatliste, Nachrichtenblasen, Mediengalerie ---- */
.uu-archiv { display: grid; grid-template-columns: 300px 1fr; gap: var(--sp-4); align-items: start; }
.uu-chatliste { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; }
.uu-chatzeile { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) var(--sp-3); border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.uu-chatzeile:hover { background: var(--flaeche-hover); }
.uu-chatzeile.aktiv { background: var(--akzent-schwach); border-color: var(--rand); }
.uu-chatzeile .titel { font-weight: var(--fw-med); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uu-chatzeile .unter { font-size: var(--fs-xs); color: var(--text-3); }
.uu-nachrichten { display: flex; flex-direction: column; gap: var(--sp-2); max-height: 70vh; overflow-y: auto; padding: var(--sp-1); }
.uu-blase { max-width: 76%; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); background: var(--flaeche-hover); border: 1px solid var(--rand); align-self: flex-start; }
.uu-blase.aus { align-self: flex-end; background: var(--akzent-schwach); }
.uu-blase .kopf { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: 2px; display: flex; gap: var(--sp-2); justify-content: space-between; }
.uu-blase .txt { white-space: pre-wrap; word-break: break-word; }
.uu-blase .sys { font-style: italic; color: var(--text-3); }
.uu-mediennetz { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-2); }
.uu-mediennetz .kachel { border: 1px solid var(--rand); border-radius: var(--radius-sm); overflow: hidden; background: var(--flaeche-2); }
.uu-mediennetz .kachel img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--flaeche-hover); }
.uu-mediennetz .kachel .cap { padding: 4px 6px; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .uu-archiv { grid-template-columns: 1fr; } .uu-chatliste { max-height: 40vh; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Zentrale (P2-3 / #6): gruppierte Geraetekarten mit ehrlichen Zustaenden */
.uu-zabschnitt { padding: var(--sp-3) 0; border-top: 1px solid var(--rand); }
.uu-zabschnitt:first-of-type { border-top: none; }
.uu-ztitel { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-bold); margin-bottom: var(--sp-2); }
.uu-zik { font-size: 1.05rem; line-height: 1; }
.uu-wachs { flex: 1 1 auto; min-width: 0; }
.uu-schalter { display: inline-flex; border: 1px solid var(--rand-stark); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.uu-schalter .uu-sbtn { border: none; border-left: 1px solid var(--rand); background: var(--flaeche); color: var(--text); padding: var(--sp-2) var(--sp-3); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-med); cursor: pointer; }
.uu-schalter .uu-sbtn:first-child { border-left: none; }
.uu-schalter .uu-sbtn:hover { background: var(--flaeche-hover); }
.uu-schalter .uu-sbtn[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-text); }
.uu-schalter .uu-sbtn:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.uu-schalter .uu-sbtn:disabled { opacity: .5; cursor: not-allowed; }
.uu-zmons { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.uu-zmon { font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--radius-sm); background: var(--flaeche-2); color: var(--text-3); border: 1px solid var(--rand); }
.uu-zmon.ok { color: var(--ok-d); }
.uu-zmon.fehler { color: var(--fehler-d); }
.uu-zspin { width: .8em; height: .8em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: uu-dreh .7s linear infinite; margin-right: 4px; vertical-align: -1px; }
@keyframes uu-dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .uu-zspin { animation: none; } }
.uu-diag { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1) var(--sp-4); font-size: var(--fs-sm); margin: 0 0 var(--sp-2); }
.uu-diag dt { color: var(--text-3); }
.uu-diag dd { margin: 0; }
.uu-zmonwahl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-2); }
.uu-zmonopt { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); padding: 2px 8px; border: 1px solid var(--rand); border-radius: var(--radius-sm); cursor: pointer; }
.uu-zmonopt input { cursor: pointer; }
.uu-zmonopt:focus-within { outline: 2px solid var(--akzent); outline-offset: 1px; }
.uu-zselect { font: inherit; font-size: var(--fs-sm); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--rand-stark); border-radius: var(--radius-sm); background: var(--flaeche); color: var(--text); cursor: pointer; }
.uu-zselect:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }

/* Zwei-Faktor-Einrichtung (Bericht 97) */
.uu-totp-qr { display: block; width: 220px; height: 220px; background: #fff; padding: 6px; border-radius: var(--radius-sm); image-rendering: pixelated; }
.uu-totp-schluessel { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 15px; letter-spacing: 1px; user-select: all; word-break: break-all; }
.uu-wh-codes { display: grid; grid-template-columns: repeat(2, max-content); gap: var(--sp-2) var(--sp-5, 24px); font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 14px; user-select: all; }
.uu-hinweis-warn { border-left: 3px solid var(--warn-d, #e0a800); padding: var(--sp-2) var(--sp-3); }
.uu-reihe { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.uu-klein:empty { display: none; }
/* Verbindungsband (Betreiberanforderung 11): sichtbar, wenn Live-Verbindung oder Abfrage ausfallen. */
.uu-verbindungsband { position: fixed; left: 50%; bottom: var(--sp-4, 16px); transform: translateX(-50%); z-index: 60; max-width: min(760px, calc(100vw - 32px)); padding: var(--sp-2, 8px) var(--sp-4, 16px); border-radius: var(--radius, 10px); border: 1px solid currentColor; box-shadow: var(--schatten-2); font-size: var(--fs-sm, 14px); }
.uu-verbindungsband.warn { color: var(--warn-d); background: var(--warn-f); }
.uu-verbindungsband.fehler { color: var(--fehler-d); background: var(--fehler-f); }
