/* BlackOS – App-Panels BlackGit, BlackN8N, BlackAI und System (os/bausteine.js und die Module os/blackgit.js, os/blackn8n.js,
   os/blackai.js, os/system.js). Nur Ergänzungen zu stil.css/komfort.css/os.css und ausschließlich mit deren Tokens; das helle Thema
   kommt über dieselben Tokens. Feste Zeilen- und Kopfhöhen, damit Skelett und Inhalt gleich hoch sind (nichts springt). Handy (≤ 720 px):
   Tabellen werden zu Karten, Werkzeugleisten brechen um, nichts läuft waagrecht über. */

/* ======================================================================= Statuspille, Etikett */
.os-pille { display: inline-flex; align-items: center; gap: .4em; height: 1.55rem; padding: 0 .6em 0 .5em; border-radius: var(--r-voll); border: 1px solid var(--linie-stark);
  background: var(--bg-1); color: var(--text-2); font-size: var(--t-xs); font-weight: 520; white-space: nowrap; vertical-align: middle; line-height: 1; }
.os-pille > i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--blass); }
.os-pille.gut { border-color: var(--gut-rand); background: var(--gut-flaeche); color: var(--gut-text); } .os-pille.gut > i { background: var(--gut); }
.os-pille.warn { border-color: var(--warn-rand); background: var(--warn-flaeche); color: var(--warn-text); } .os-pille.warn > i { background: var(--warn); }
.os-pille.fehl { border-color: var(--fehl-rand); background: var(--fehl-flaeche); color: var(--fehl-text); } .os-pille.fehl > i { background: var(--fehl); }
.os-pille.info { border-color: var(--akzent-rand); background: var(--akzent-flaeche); color: var(--akzent-text); } .os-pille.info > i { background: var(--akzent); }
.os-pille.aktiv { border-color: var(--akzent-rand); background: var(--akzent-flaeche); color: var(--akzent-text); }
.os-pille.aktiv > i { background: var(--akzent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent-2) 25%, transparent); animation: os-puls 1.6s var(--kurve-ein-aus) infinite; }
.os-pille.neutral { color: var(--leise); }
@keyframes os-puls { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--akzent-2) 10%, transparent); } }
.os-etikett { display: inline-flex; align-items: center; gap: .35em; max-width: 100%; height: 1.45rem; padding: 0 .55em; border-radius: var(--r-s); background: var(--hover-stark);
  color: var(--text-2); font-size: var(--t-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.os-etikett > i { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.os-pillen { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }

/* ======================================================================= Allgemeines */
.os-knopfreihe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.os-knopfreihe > a.knopf, .os-knopfreihe > .os-gesperrt > button { white-space: nowrap; }
a.knopf.klein { padding: .3em .7em; min-height: 30px; font-size: var(--t-s); border-radius: var(--r-s); }
.knopf svg, button.os-aktion svg, .os-fehlerband .os-knopfreihe svg { width: 15px; height: 15px; flex: none; }
.os-gesperrt { display: inline-flex; cursor: not-allowed; }
.os-zeit { white-space: nowrap; font-variant-numeric: tabular-nums; }
.os-zweizeilig { display: grid; min-width: 0; gap: 1px; }
.os-zweizeilig > b { font-weight: 560; overflow: hidden; text-overflow: ellipsis; }
.os-zweizeilig > small { font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-werte dd { overflow-wrap: anywhere; min-width: 0; }
/* Werte-Listen (auch die allgemeine App-Übersicht): lange Statusmarken kürzen statt über den Rand zu laufen. */
dl.werte { grid-template-columns: max-content minmax(0, 1fr); }
dl.werte dd { min-width: 0; }
dl.werte dd > .os-status { max-width: 100%; }
.os-werte code, .os-meta code { font-size: .82em; }
.os-umbruch { overflow-wrap: anywhere; word-break: break-word; }
.os-abstand-oben { margin-top: 12px; }
.os-fussnote { margin: 8px 2px 0; font-size: var(--t-xs); }
.os-liste-suche { font-size: var(--t-s); }
/* Zusatz-Tafeln der App-Übersicht: „doppelt“ füllt neben einer normalen Tafel die Reihe (nur, wenn drei Spalten Platz haben). */
@media (min-width: 1180px) { .tafel.doppelt { grid-column: span 2; } }
.os-mehr-link { display: inline-block; margin-top: 10px; font-size: var(--t-s); font-weight: 500; }
.os-hinweislink { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; border-radius: var(--r-m); background: var(--akzent-flaeche); color: var(--akzent-text); font-size: var(--t-s); }
.os-hinweislink svg { width: 16px; height: 16px; }
.os-erklaerung { display: flex; gap: 10px; align-items: flex-start; margin: -6px 0 16px; padding: 10px 12px; border-radius: var(--r-m); border: 1px dashed var(--linie-stark); color: var(--text-2); font-size: var(--t-s); }
.os-erklaerung svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--akzent); }
.os-liste-punkte { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--text-2); }
.os-ue-raster { align-items: start; }
/* Zwei Tafeln nebeneinander (z. B. Statistik | Gesundheit) statt zwei Dritteln mit leerer dritter Spalte. */
.raster.os-zweier { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.os-listentafel { padding-top: 14px; }
.os-listentafel > h2 { margin-bottom: .6em; }

/* ======================================================================= Leerzustand */
.os-leere { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 180px; padding: 20px 16px; text-align: center; color: var(--text-2);
  border: 1px dashed var(--rand-gestrichelt); border-radius: var(--r-m); background: var(--glas-innen); }   /* derselbe Leerzustand wie .leer (stil.css) */
.os-leere svg { width: 22px; height: 22px; padding: 9px; box-sizing: content-box; border-radius: var(--r-m); color: var(--akzent); background: var(--akzent-flaeche); }
.os-leere b { font-weight: 580; }
.os-leere .leise { max-width: 42em; font-size: var(--t-s); }
.os-leere > button { margin-top: 6px; }
.os-leere.klein { min-height: 110px; padding: 12px; gap: 4px; }
.os-leere.klein svg { width: 18px; height: 18px; padding: 7px; }

/* ======================================================================= Fehlerband (je Fehlerklasse) */
.os-fehlerband { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; min-height: 120px; padding: 14px 16px; border-radius: var(--r-m);
  border: 1px solid var(--fehl-rand); background: var(--fehl-flaeche); box-shadow: inset 3px 0 0 var(--fehl); }
.os-fehlerband.warn { border-color: var(--warn-rand); background: var(--warn-flaeche); box-shadow: inset 3px 0 0 var(--warn); }
.os-fehlerband.info { border-color: var(--akzent-rand); background: var(--akzent-flaeche); box-shadow: inset 3px 0 0 var(--akzent-mitte); }
.os-fehlerband.kompakt { min-height: 0; }
.os-fehlerband-symbol { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-s); background: var(--fehl-flaeche-stark); color: var(--fehl-text); }
.os-fehlerband.warn .os-fehlerband-symbol { background: var(--warn-flaeche-stark); color: var(--warn-text); }
.os-fehlerband.info .os-fehlerband-symbol { background: var(--akzent-flaeche-stark); color: var(--akzent-text); }
.os-fehlerband-symbol svg { width: 17px; height: 17px; }
.os-fehlerband-text { display: grid; gap: 4px; min-width: 0; font-size: var(--t-s); }
.os-fehlerband-text b { font-size: var(--t-m); font-weight: 600; color: var(--text); }
.os-fehlerband-text small { overflow-wrap: anywhere; font-family: var(--mono); font-size: var(--t-xs); }
.os-fehlerband > .os-knopfreihe { justify-content: flex-end; }

/* ======================================================================= Liste / Tabelle */
.os-liste { min-width: 0; }
.os-liste-werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 40px; margin-bottom: 10px; }
.os-liste-suche { flex: 1 1 14em; min-width: 0; max-width: 26em; min-height: 36px; padding: .4em .75em; }
span.os-liste-suche.sk-feldform { display: flex; align-items: center; height: 36px; border: 1px solid var(--linie); border-radius: var(--r-m); background: var(--feld); }
.os-liste-filter { width: auto; min-height: 36px; padding: .35em 2em .35em .7em; font-size: var(--t-s); max-width: 16em; }
.os-liste-zahl { color: var(--blass); font-size: var(--t-xs); white-space: nowrap; min-width: 6em; }
.os-liste-extra { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.os-tabelle-huelle { margin: 0 -6px; }
.os-tabelle { table-layout: auto; }
.os-tabelle th { height: 34px; vertical-align: middle; }
.os-tabelle th[aria-sort] { padding: 0 .4em; }
.os-sort { min-height: 0; padding: .35em .3em; border: 0; background: none; color: inherit; font: inherit; font-size: inherit; letter-spacing: inherit; text-transform: inherit; gap: .3em; }
.os-sort:hover, .os-sort.an { background: none; color: var(--text); }
.os-sort-pfeil { display: inline-block; width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; opacity: 0; transform: translateY(2px); transition: transform var(--dauer-1); }
.os-sort.an .os-sort-pfeil { opacity: .8; } .os-sort.ab .os-sort-pfeil { transform: translateY(-2px) rotate(180deg); }
.os-tabelle td { height: 48px; vertical-align: middle; }
.os-tabelle tbody tr { transition: background-color var(--dauer-1); }
.os-tabelle tr.klickbar { cursor: pointer; }
.os-tabelle tr.klickbar:hover { background: var(--hover); }
.os-tabelle tr:last-child td { border-bottom: 0; }
.os-tabelle td.os-haupt { max-width: 28em; }
.os-zeilenlink { color: var(--text); display: block; min-width: 0; }
.os-zeilenlink:hover { color: var(--akzent-text); }
.os-tabelle tr.os-zeile-fehl td:first-child { box-shadow: inset 3px 0 0 var(--fehl); }
.os-tabelle tr.os-zeile-ruhig { color: var(--leise); }
.os-tabelle .sk-text { display: block; }
.os-sk-zahl { display: inline-block; width: 3.5em; height: .9em; vertical-align: middle; }
.os-liste-leer[hidden], .os-mehr-laden[hidden] { display: none; }
.os-mehr-laden { margin: 10px auto 0; display: flex; }
.os-abbild { font-size: var(--t-xs); color: var(--text-2); overflow-wrap: anywhere; }

/* ======================================================================= Einträge (kurze Listen in Tafeln) */
.os-eintraege { display: grid; gap: 2px; }
.os-eintrag { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px; margin: 0 -8px;
  border-radius: var(--r-m); color: var(--text); text-align: left; }
.os-eintrag:not(:has(> .os-eintrag-sym)):not(:has(> svg)) { grid-template-columns: minmax(0, 1fr) auto; }
a.os-eintrag:hover { background: var(--hover); color: var(--text); }
button.os-eintrag { width: calc(100% + 16px); min-height: 48px; border: 1px solid transparent; background: none; font: inherit; font-weight: 400; }
button.os-eintrag:hover { background: var(--hover); }
button.os-eintrag.gewaehlt { background: var(--akzent-flaeche); border-color: var(--akzent-rand); }
.os-eintrag > svg, .os-eintrag-sym svg { width: 16px; height: 16px; color: var(--blass); }
.os-eintrag-sym { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-s); background: var(--bg-3); }
.os-eintrag-text { display: grid; min-width: 0; gap: 1px; }
.os-eintrag-text > b, .os-eintrag-text > a > b { font-weight: 540; font-size: var(--t-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-eintrag-text > .leise, .os-eintrag-text > span { font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; }
.os-eintrag-text > .leise:not(.os-umbruch) { white-space: nowrap; }
.os-eintrag-rechts { display: inline-flex; align-items: center; gap: 8px; color: var(--blass); font-size: var(--t-xs); white-space: nowrap; }
.os-audit .os-eintrag-text > span { white-space: normal; }
.os-ikonlink { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-s); color: var(--leise); }
.os-ikonlink:hover { background: var(--hover-stark); } .os-ikonlink svg { width: 14px; height: 14px; }
.os-plusminus { font-family: var(--mono); font-size: var(--t-xs); gap: 10px; }
.os-plusminus .plus { color: var(--gut-text); } .os-plusminus .minus { color: var(--fehl-text); }

/* ======================================================================= Detailblatt */
.os-detail-kopf { display: grid; gap: 6px; margin-bottom: 20px; min-width: 0; }
.os-zurueck { justify-self: start; font-size: var(--t-xs); font-weight: 500; color: var(--leise); min-height: 20px; }
.os-zurueck:hover { color: var(--text); }
.os-detail-titelzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.os-detail-titelzeile h1 { margin: 0; font-size: var(--t-2xl); overflow-wrap: anywhere; min-width: 0; }
.os-detail-pillen { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.os-detail-kopf.klein .os-detail-titelzeile h2 { margin: 0; font-size: var(--t-xl); font-weight: 640; overflow-wrap: anywhere; min-width: 0; }
.os-detail-kopf.klein { margin-bottom: 16px; }
.os-detail-unter { margin: 0; color: var(--leise); font-size: var(--t-s); overflow-wrap: anywhere; }
.os-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.os-meta > div { display: grid; gap: 1px; min-width: 0; padding: 7px 11px; border: 1px solid var(--linie); border-radius: var(--r-m); background: var(--bg-1); }
.os-meta dt { font-size: var(--t-xs); color: var(--blass); font-weight: 500; }
.os-meta dd { margin: 0; font-size: var(--t-s); font-weight: 520; overflow-wrap: anywhere; min-height: 1.3em; }
.os-meta dd .os-pille { height: 1.35rem; }
.os-meta dd .os-zeit { white-space: normal; }
.os-detail-aktionen { margin-top: 6px; }
.os-unterreiter { margin-bottom: 16px; }
.os-unterreiter a { font-size: var(--t-s); display: inline-flex; align-items: center; gap: 6px; }
.os-reiter-zahl { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; padding: 0 .35em; border-radius: var(--r-voll); background: var(--hover-stark); font-size: var(--t-xs); color: var(--text-2); }
.os-repo-kopf { min-height: 150px; }

/* ======================================================================= Dialoge */
dialog.os-dialog { width: min(560px, calc(100vw - 32px)); }
.os-formular .feld:last-child { margin-bottom: 4px; }
.os-formular textarea { font-family: var(--schrift); font-size: var(--t-s); }
.os-formular > p { color: var(--text-2); }
.os-formular .hinweis { margin: 8px 0; }

/* ======================================================================= Fortschritt, Belegung */
.os-fortschritt { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--linie); border-radius: var(--r-m); background: var(--bg-1); }
.os-fortschritt-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-height: 1.4em; }
.os-fortschritt-kopf b { font-weight: 580; }
.os-fortschritt-text { flex: 1; min-width: 0; color: var(--leise); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-fortschritt-prozent { font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--t-s); }
.os-fortschritt-balken { height: 8px; border-radius: var(--r-voll); background: var(--hover-stark); overflow: hidden; }
.os-fortschritt-balken > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--iris); transition: width var(--dauer-3) var(--kurve-aus); }
.os-fortschritt.unbestimmt .os-fortschritt-balken > i { width: 35%; animation: os-wandern 1.4s var(--kurve-ein-aus) infinite; }
.os-fortschritt.gut .os-fortschritt-balken > i { background: var(--gut); } .os-fortschritt.fehl .os-fortschritt-balken > i { background: var(--fehl); width: 100%; }
.os-fortschritt.warn .os-fortschritt-balken > i { background: var(--warn); width: 100%; } .os-fortschritt.neutral .os-fortschritt-balken > i { background: var(--blass); }
.os-fortschritt.fehl .os-fortschritt-text { color: var(--fehl-text); white-space: normal; } .os-fortschritt.gut .os-fortschritt-text { color: var(--gut-text); }
@keyframes os-wandern { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
.os-belegung { display: grid; gap: 6px; margin-bottom: 12px; }
.os-belegung-balken { height: 10px; border-radius: var(--r-voll); background: var(--hover-stark); overflow: hidden; }
.os-belegung-balken > i { display: block; height: 100%; border-radius: inherit; background: var(--gut); }
.os-belegung-balken > i.warn { background: var(--warn); } .os-belegung-balken > i.fehl { background: var(--fehl); }
.os-belegung > span { font-size: var(--t-xs); }

/* ======================================================================= Log (folgen, suchen) */
.os-logansicht { display: grid; gap: 8px; min-width: 0; }
.os-log-werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 36px; }
.os-log-suche { flex: 1 1 12em; min-width: 0; max-width: 22em; min-height: 34px; padding: .35em .7em; font-size: var(--t-s); }
.os-log-zeilen { width: auto; min-height: 34px; padding: .3em 2em .3em .6em; font-size: var(--t-xs); }
.os-log-werkzeuge > button { white-space: nowrap; }
.os-logansicht [hidden], .os-liste [hidden] { display: none !important; }   /* Knöpfe sind inline-flex – [hidden] allein reicht nicht */
@media (max-width: 1179px) { .tafel.os-log-tafel.doppelt { grid-column: 1 / -1; } }
.os-kz-raster.frei { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.os-log-info { margin-left: auto; font-size: var(--t-xs); white-space: nowrap; }
.os-log-folgen.an { border-color: var(--akzent-rand); background: var(--akzent-flaeche); color: var(--akzent-text); }
.os-live-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--blass); }
.os-log-folgen.an .os-live-punkt { background: var(--fehl); animation: os-blinken 1.2s steps(2) infinite; }
@keyframes os-blinken { 50% { opacity: .25; } }
.os-log { height: 420px; overflow: auto; overscroll-behavior: contain; padding: 8px 10px; border: 1px solid var(--linie); border-radius: var(--r-m); background: var(--bg-1);
  font: .78rem/1.5 var(--mono); color: var(--text-2); scrollbar-width: thin; }
.os-log.laedt { opacity: .6; }
.os-logzeile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.os-logzeile:not(:has(.os-logzeit)) { grid-template-columns: minmax(0, 1fr); }
.os-logzeile.err { color: var(--fehl-text); }
.os-logzeit { color: var(--blass); user-select: none; }
.os-log mark { background: var(--warn-flaeche-stark); color: var(--text); border-radius: 2px; }
.os-log-leer { color: var(--blass); padding: 12px 0; }
.os-log-tafel { min-width: 0; }

/* ======================================================================= Verläufe */
.os-linien-huelle { display: grid; gap: 6px; }
.os-linien-flaeche { position: relative; padding-left: 44px; }
.os-linien { display: block; width: 100%; overflow: visible; }
.os-linien-gitter { stroke: var(--linie); stroke-width: 1; }
.os-linie { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.os-linie.a { stroke: var(--akzent); } .os-linie.b { stroke: var(--app-tuerkis); } .os-linie.c { stroke: var(--warn); }
.legende i.os-legende-a { background: var(--akzent); } .legende i.os-legende-b { background: var(--app-tuerkis); } .legende i.os-legende-c { background: var(--warn); }
.os-linien-achse { position: absolute; left: 0; font-size: var(--t-xs); color: var(--blass); font-variant-numeric: tabular-nums; }
.os-linien-achse.oben { top: -2px; } .os-linien-achse.unten { bottom: -2px; }
.os-linien-zeit { display: flex; justify-content: space-between; padding-left: 44px; font-size: var(--t-xs); }

/* ======================================================================= BlackGit: Code, Diff, Kommentare, Einstellungen */
.os-code-leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; margin-bottom: 10px; }
.os-pfadleiste { min-width: 0; font-size: var(--t-s); overflow-wrap: anywhere; }
.os-ref { width: auto; max-width: 16em; min-height: 34px; padding: .3em 2em .3em .6em; font-size: var(--t-s); }
.os-baum { display: grid; border: 1px solid var(--linie); border-radius: var(--r-m); overflow: hidden; }
.os-baum-zeile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; color: var(--text);
  border-bottom: 1px solid var(--linie); font-size: var(--t-s); }
.os-baum-zeile:last-child { border-bottom: 0; }
.os-baum-zeile:hover { background: var(--hover); color: var(--text); }
.os-baum-zeile svg { width: 16px; height: 16px; color: var(--blass); }
.os-baum-zeile.dir svg { color: var(--akzent); }
.os-baum-zeile > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-baum-zeile > span:last-child { font-size: var(--t-xs); }
.os-readme { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--linie); border-radius: var(--r-m); }
.os-readme > h3 { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); color: var(--leise); margin-bottom: 10px; }
.os-readme > h3 svg { width: 14px; height: 14px; }
.os-datei-kopf { display: flex; align-items: center; gap: 10px; min-height: 36px; margin-bottom: 8px; font-size: var(--t-s); }
.os-datei-kopf svg { width: 16px; height: 16px; color: var(--blass); }
.os-datei-kopf b { overflow-wrap: anywhere; }
.os-code, .os-diff { max-height: 70vh; overflow: auto; padding: 8px 0; border: 1px solid var(--linie); border-radius: var(--r-m); background: var(--bg-1);
  font: .8rem/1.55 var(--mono); counter-reset: zeile; scrollbar-width: thin; }
.os-codezeile { display: block; padding: 0 12px 0 0; white-space: pre; counter-increment: zeile; }
.os-codezeile::before { content: counter(zeile); display: inline-block; width: 3.6em; margin-right: 12px; padding-right: 8px; text-align: right; color: var(--blass); border-right: 1px solid var(--linie); user-select: none; }
.os-diff > span { display: block; padding: 0 12px; white-space: pre; }
.os-diff > .plus { background: var(--gut-flaeche); color: var(--gut-text); } .os-diff > .minus { background: var(--fehl-flaeche); color: var(--fehl-text); }
.os-diff > .abschnitt { color: var(--akzent-text); background: var(--akzent-flaeche); } .os-diff > .kopf { color: var(--text); font-weight: 600; margin-top: 8px; }
.os-nachricht { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: .84rem/1.5 var(--mono); color: var(--text-2); max-height: 50vh; overflow: auto; }
.os-lizenz { max-height: 260px; }
.os-kommentare { display: grid; gap: 10px; margin-bottom: 14px; }
.os-kommentar { padding: 10px 12px; border: 1px solid var(--linie); border-radius: var(--r-m); background: var(--bg-1); }
.os-kommentar > header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; font-size: var(--t-xs); }
.os-kommentar-neu { display: grid; gap: 8px; }
.os-kommentar-feld { font-family: var(--schrift); font-size: var(--t-s); min-height: 6em; }
.os-kommentar-neu > .os-knopfreihe { justify-content: flex-end; }
.os-release-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.os-release-kopf h2 { margin: 0; }
.os-schalterliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px 16px; }
.os-gefahrenzone { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 18px; }
.os-gefahrenzone p { margin: 2px 0 0; font-size: var(--t-xs); }
.os-gefahr-tafel { border-color: var(--fehl-rand); }
.os-fehltext { color: var(--fehl-text); font-size: var(--t-xs); overflow-wrap: anywhere; }

/* ======================================================================= BlackAI */
.os-zug-zeile { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.os-zug-zeile > input { flex: 1; min-width: 0; }
.os-zug:not(:empty) { margin-top: 10px; }
.os-zug-karte { display: grid; gap: 8px; }
.os-zug-karte > .os-knopfreihe { justify-content: flex-end; }
.os-tempo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px 28px; align-items: start; }
@media (max-width: 860px) { .os-tempo { grid-template-columns: minmax(0, 1fr); } }
.os-tempo-ergebnis .os-kz-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.os-tempo-antwort { margin: 12px 0 0; padding: 8px 12px; border-left: 3px solid var(--akzent-rand); color: var(--leise); font-size: var(--t-s); }

/* ======================================================================= System */
.os-auftrag-ausgabe { margin: 10px 0 0; max-height: 220px; overflow: auto; padding: 8px 10px; border-radius: var(--r-m); background: var(--bg-1); font: .76rem/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; }
.os-auftrag-ausgabe:empty { display: none; }

/* ======================================================================= Schmal: Tabellen als Karten */
@media (max-width: 560px) {
  .os-liste-suche { max-width: none; flex-basis: 100%; }
  .os-liste-filter { flex: 1 1 9em; max-width: none; }
  .os-liste-zahl { flex-basis: 100%; order: 5; }
  .os-liste-extra { margin-left: 0; }
  .os-tabelle-huelle { overflow: visible; margin: 0; padding: 0; }
  .os-tabelle, .os-tabelle tbody { display: block; }
  .os-tabelle thead { display: none; }
  .os-tabelle tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--linie);
    border-radius: var(--r-m); background: var(--bg-1); }
  .os-tabelle tr:last-child { margin-bottom: 0; }
  .os-tabelle td { display: grid; gap: 1px; align-content: start; height: auto; min-height: 0; padding: 0; border: 0; min-width: 0; text-align: left; }
  .os-tabelle td::before { content: attr(data-titel); font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--blass); }
  .os-tabelle td.os-haupt { grid-column: 1 / -1; max-width: none; }
  .os-tabelle td.os-haupt::before { display: none; }
  .os-tabelle td.zahl { text-align: left; }
  .os-tabelle td.os-nur-breit { display: none; }
  .os-tabelle tr.os-zeile-fehl { border-color: var(--fehl-rand); }
  .os-tabelle tr.os-zeile-fehl td:first-child { box-shadow: none; }
  .os-tabelle .os-pillen { justify-content: flex-start; }
  .os-meta > div { flex: 1 1 calc(50% - 8px); }
  dl.os-werte.lang { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.os-werte.lang dt { margin-top: 8px; } dl.os-werte.lang dt:first-child { margin-top: 0; }
  .os-detail-titelzeile h1 { font-size: var(--t-xl); }
  .os-fehlerband { grid-template-columns: auto minmax(0, 1fr); }
  .os-fehlerband > .os-knopfreihe { grid-column: 1 / -1; justify-content: flex-start; }
  .os-log { height: 340px; }
  .os-log-info { margin-left: 0; flex-basis: 100%; }
  .os-gefahrenzone { grid-template-columns: minmax(0, 1fr); }
  .os-codezeile::before { width: 2.6em; margin-right: 8px; }
  .os-zug-zeile { flex-wrap: wrap; }
  .os-zug-zeile > input { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .os-pille.aktiv > i, .os-fortschritt.unbestimmt .os-fortschritt-balken > i, .os-log-folgen.an .os-live-punkt { animation: none; }
}
html[data-bewegung=wenig] .os-pille.aktiv > i, html[data-bewegung=wenig] .os-fortschritt.unbestimmt .os-fortschritt-balken > i { animation: none; }
.os-einzeilig { white-space: nowrap; }

/* LostPlaces: Formular „Ort hinzufügen“ (Felder nebeneinander, auf dem Handy untereinander), Texte, lange Adressen */
.lp-zwei, .lp-drei { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 0 12px; }
.lp-formular input, .lp-formular select, .lp-formular textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
.lp-absenden { margin-top: 14px; }
.lp-link-info { margin: 6px 0 12px; min-height: 1.3em; }
.lp-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.lp-url, .lp-bilder .os-eintrag-text b { overflow-wrap: anywhere; }
.lp-bilder { display: grid; gap: 6px; }
/* LostPlaces-Moderation: Meldungen mit Knöpfen (rechts umbrechend), zitierte Nachricht, Stickerpakete mit aufklappbarer Liste */
.lp-meldungen .os-eintrag-rechts, .lp-paket .os-eintrag-rechts { flex-wrap: wrap; justify-content: flex-end; }
.lp-zitat { font-style: italic; overflow-wrap: anywhere; }
.lp-sticker { margin-top: 6px; }
.lp-sticker > summary { cursor: pointer; color: var(--leise); }
.lp-sticker .os-eintraege { margin-top: 6px; }
@media (max-width: 560px) {
  .lp-meldungen .os-eintrag, .lp-paket { grid-template-columns: auto minmax(0, 1fr); }
  .lp-meldungen .os-eintrag-rechts, .lp-paket .os-eintrag-rechts { grid-column: 1 / -1; justify-content: flex-start; white-space: normal; }
}
/* LostPlaces: Verteilungen (Statistik, Speicher) als schlichte Balken in der Akzentfarbe, Tabellenansicht der Zeitreihen */
.lp-verteilung { display: grid; gap: 6px; }
.lp-verteilung-zeile { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: var(--t-s); }
.lp-verteilung-zeile > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-balken { display: block; height: 8px; border-radius: 4px; background: var(--linie); overflow: hidden; }
.lp-balken > i { display: block; height: 100%; border-radius: 4px; background: var(--akzent); min-width: 2px; }
.lp-tabelle { margin-top: 6px; } .lp-tabelle > summary { cursor: pointer; color: var(--leise); }
.lp-dublette .os-eintrag-text { gap: 4px; }
.lp-check { display: inline-flex; align-items: center; gap: 6px; }

/* ======================================================================= Home (Home Assistant) – os/home.js
   Raum-Kacheln mit festen Zeilenhöhen (Skelett = Endhöhe), Schalter als Pille, Mini-Diagramme, Kamerabilder 16:9. Nur Tokens. */
.hm-suche { max-width: 20em; }
.hm-live { display: inline-flex; min-width: 5.5em; }
.hm-band:empty { display: none; } .hm-band { margin-bottom: 12px; }
.hm-etage { margin-top: 14px; }
.hm-etage-titel { margin: 6px 2px 10px; font-size: var(--t-m, 1rem); color: var(--leise); font-weight: 600; letter-spacing: .02em; }
.hm-raeume { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; align-items: start; }
.hm-raeume > .tafel { margin-bottom: 0; }
.hm-raum.hm-markiert { border-color: var(--akzent-rand); box-shadow: 0 0 0 3px var(--akzent-flaeche); }
.hm-zeilen { display: grid; gap: 2px; }
.hm-zeile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; margin: 0 -8px; border-radius: var(--r-m); }
.hm-zeile:hover { background: var(--hover); }
.hm-zeile.weg .hm-zeile-text { opacity: .6; }
.hm-zeile-text { display: grid; min-width: 0; line-height: 1.25; }
.hm-zeile-text > a { color: var(--text); font-weight: 520; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-zeile-text > small { font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-zeile-rechts { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 0; }
.hm-punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--blass); flex: none; }
.hm-punkt.gut { background: var(--gut); box-shadow: 0 0 0 3px var(--gut-flaeche-stark); } .hm-punkt.warn { background: var(--warn); }
.hm-knoepfe { display: inline-flex; align-items: center; gap: 4px; }
.hm-knoepfe button.klein, .hm-zeile-rechts > button.klein { min-width: 34px; min-height: 32px; padding: .2em .55em; }
.hm-soll { min-width: 3.2em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.hm-gesperrt { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); color: var(--leise); white-space: nowrap; cursor: help; }
.hm-gesperrt svg { width: 13px; height: 13px; }
.hm-gesperrt.fest { color: var(--fehl-text); font-weight: 650; }
.hm-schalter { position: relative; flex: none; display: inline-block; width: 46px; height: 28px; min-height: 0; padding: 0; transform: none !important; border-radius: var(--r-voll); border: 1px solid var(--linie-stark); background: var(--bg-3, var(--hover-stark)); cursor: pointer; box-shadow: none; }
.hm-schalter > i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform var(--dauer-kurz, .15s) ease, background-color .15s; }
.hm-schalter.an, .hm-schalter.an:hover { background: var(--akzent-mitte); border-color: var(--akzent-mitte); } .hm-schalter.an > i { transform: translateX(18px); background: #fff; }
.hm-schalter.hm-gross { width: 54px; height: 32px; max-height: 32px; align-self: center; } .hm-schalter.hm-gross > i { width: 24px; height: 24px; } .hm-schalter.hm-gross.an > i { transform: translateX(22px); }
.hm-schalter:disabled { opacity: .6; cursor: progress; }
.hm-schalter:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.hm-ohne > summary { cursor: pointer; font-weight: 600; }
.hm-ohne[open] > summary { margin-bottom: 10px; }
.hm-sperre { margin: 10px 0 14px; }
.hm-steuerung { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px 18px; margin: 4px 0 16px; padding: 14px 16px; border: 1px solid var(--linie); border-radius: var(--r-karte); background: var(--flaeche); }
.hm-feld { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 36px; font-size: var(--t-s); }
.hm-feld > span:first-child { color: var(--leise); }
.hm-feld > output { min-width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; }
.hm-feld > select, .hm-feld > .hm-farbe { grid-column: 2 / -1; }
.hm-feld > .hm-schalter, .hm-feld > .hm-knoepfe, .hm-feld > button { justify-self: start; grid-column: 2 / -1; }
.hm-regler { width: 100%; accent-color: var(--akzent-mitte); }
.hm-farbe { width: 64px; height: 34px; padding: 2px; border-radius: var(--r-s); }
.hm-verlauf { display: grid; gap: 4px; }
.hm-verlauf-flaeche { position: relative; height: 150px; padding-left: 52px; }
.hm-verlauf-flaeche svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hm-linie { fill: none; stroke: var(--akzent); stroke-width: 2; }
.hm-achse { position: absolute; left: 0; font-size: var(--t-xs); color: var(--blass); font-variant-numeric: tabular-nums; max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-achse.oben { top: -2px; } .hm-achse.unten { bottom: -2px; }
.hm-verlauf .os-linien-zeit { padding-left: 52px; }
.hm-streifen { position: relative; height: 34px; margin-left: 52px; border-radius: var(--r-s); background: var(--hover); overflow: hidden; }
.hm-streifen > i { position: absolute; top: 0; bottom: 0; }
.hm-streifen > i.an { background: var(--akzent-mitte); } .hm-streifen > i.weg { background: var(--warn-flaeche); }
.hm-schritte { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.hm-schritte li { display: grid; grid-template-columns: minmax(7em, auto) minmax(0, 1fr) auto; gap: 10px; align-items: baseline; }
.hm-schritte li.fehl { color: var(--fehl-text); }
.hm-saeulen { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-top: 6px; }
.hm-saeulen > i { flex: 1 1 0; min-width: 2px; border-radius: 3px 3px 0 0; background: var(--akzent-mitte); opacity: .85; }
.hm-kameras { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; }
.hm-kamera { margin-bottom: 0; }
.hm-kamera-rahmen { aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; background: var(--bg-3, var(--hover)); display: grid; place-items: center; }
.hm-kamerabild { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-kamerabild.fehl { visibility: hidden; }
.hm-gesundheit { display: grid; gap: 6px; }
.hm-gesundheit summary { cursor: pointer; font-weight: 560; }
.hm-sperre-neu { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.hm-positiv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px 18px; }
.hm-positiv > div { display: grid; gap: 4px; align-content: start; }
.hm-sperrliste .os-eintrag-text { min-width: 0; }
.hm-sperrliste code { overflow-wrap: anywhere; }
.hm-positiv b { font-family: var(--mono); font-size: var(--t-s); }
.hm-logzeile .os-eintrag-text { display: grid; }
@media (max-width: 560px) {
  .hm-suche { max-width: none; flex: 1 1 100%; }
  .hm-feld { grid-template-columns: minmax(0, 1fr) auto; }
  .hm-feld > span:first-child { grid-column: 1 / -1; }
  .hm-feld > .hm-regler { grid-column: 1; }
  .hm-sperre-neu { grid-template-columns: minmax(0, 1fr); }
  .hm-schritte li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .hm-verlauf-flaeche { padding-left: 44px; } .hm-streifen { margin-left: 44px; } .hm-verlauf .os-linien-zeit { padding-left: 44px; }
}
@media (prefers-reduced-motion: reduce) { .hm-schalter > i { transition: none; } }

/* ---------------------------------------------------------------- os10: Spielwiese (Chat), Einbettungen, Token, Werkzeugzeilen */
.os-chat-kopf { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.os-chat { display: flex; flex-direction: column; gap: 10px; min-height: 120px; max-height: 52vh; overflow: auto; padding: 12px; margin: 8px 0;
  border: 1px solid var(--linie); border-radius: var(--r-m); background: var(--bg-1); }
.os-chat:empty::before { content: 'Noch keine Nachricht.'; color: var(--blass); font-size: var(--t-s); }
.os-chat-blase { max-width: 88%; padding: 8px 12px; border-radius: var(--r-m); border: 1px solid var(--linie); }
.os-chat-blase b { display: block; font-size: var(--t-xs); color: var(--leise); font-weight: 600; margin-bottom: 2px; }
.os-chat-blase.user { align-self: flex-end; background: var(--akzent-flaeche); border-color: var(--akzent-rand); }
.os-chat-blase.assistant { align-self: flex-start; }
.os-chat-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--t-s); line-height: 1.5; }
.os-chat-text.laeuft:empty::after, .os-chat-text.laeuft::after { content: '▍'; color: var(--akzent); animation: os-chat-blinken 1s steps(2) infinite; }
@keyframes os-chat-blinken { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .os-chat-text.laeuft::after { animation: none; } }
.os-chat-eingabe { width: 100%; font-family: var(--schrift); }
.os-tabelle-rahmen { overflow-x: auto; margin-top: 10px; }
.os-aehnlichkeit { border-collapse: collapse; font-size: var(--t-s); width: auto; }
.os-aehnlichkeit caption { text-align: left; color: var(--leise); font-size: var(--t-xs); padding-bottom: 4px; }
.os-aehnlichkeit th, .os-aehnlichkeit td { padding: 4px 10px; border-bottom: 1px solid var(--linie); }
.os-aehnlichkeit td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.os-token { width: 100%; font-family: var(--mono); font-size: var(--t-s); margin: 6px 0 10px; }
.os-reiter-werkzeuge, .os-datei-aktionen { justify-content: flex-end; margin-bottom: 10px; }
.os-datei-anhaengen { display: inline-flex; }
@media (max-width: 560px) {
  .os-chat-kopf { grid-template-columns: minmax(0, 1fr); }
  .os-chat-blase { max-width: 100%; }
}
.os-chat-stopp[hidden] { display: none !important; }
.os-einbettung-ergebnis:not(:empty) { margin-top: 14px; }
.os-netz-warnung:not(:empty) { margin-bottom: 16px; }

/* ---------- BlackQR (os/qr.js) + Lokale Domains (os/lokal.js) ---------- */
.os-qr-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.os-qr-karte { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-width: 0; }
.os-qr-flaeche { display: grid; place-items: center; aspect-ratio: 1; width: 100%; max-width: 220px; margin: 0 auto; padding: 12px; border-radius: var(--r-m); background: #fff; border: 0; cursor: zoom-in; }
.os-qr-flaeche svg { width: 100%; height: 100%; display: block; }
.os-qr-flaeche.leer { background: var(--bg-3); cursor: default; color: var(--leise); }
.os-qr-flaeche.leer svg { width: 44px; height: 44px; }
.os-qr-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.os-qr-text b { overflow-wrap: anywhere; }
.os-qr-inhalt { font-size: var(--t-xs); color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-qr-knoepfe { margin-top: auto; }
.os-qr-zu { opacity: .92; }
.os-qr-zeile { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 14px; align-items: start; padding: 12px 0; border-top: 1px solid var(--linie); }
.os-qr-zeile:first-child { border-top: 0; padding-top: 0; }
.os-qr-ablage { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.os-qr-dateien { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.os-qr-dateien li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--t-m); }
.os-qr-dateien li a { overflow-wrap: anywhere; }
.os-qr-gross { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.os-qr-gross .os-qr-flaeche { max-width: min(78vw, 420px); cursor: default; }
.os-lokal-ziel { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 560px) { .os-qr-zeile { grid-template-columns: 1fr; } }
