/* Gestaltung im Stil von shadcn/ui (Farbschema „Zinc"), hell und dunkel */
:root {
  --bg: #ffffff; --fg: #09090b; --muted: #f4f4f5; --muted-fg: #71717a;
  --border: #e4e4e7; --input: #e4e4e7; --ring: #a1a1aa; --accent: #f4f4f5;
  --primary: #18181b; --primary-fg: #fafafa; --destructive: #dc2626;
  --sel: #f4f4f5; --sel-strong: #e4e4e7; --cloud: #2563eb; --ordner: #b4b4bd;
  --radius: 0.5rem; --shadow: 0 1px 2px rgba(0,0,0,.05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --fg: #fafafa; --muted: #18181b; --muted-fg: #a1a1aa;
    --border: #27272a; --input: #27272a; --ring: #52525b; --accent: #27272a;
    --primary: #fafafa; --primary-fg: #18181b; --destructive: #ef4444;
    --sel: #18181b; --sel-strong: #27272a; --cloud: #60a5fa; --ordner: #5c5c66; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --fg: #fafafa; --muted: #18181b; --muted-fg: #a1a1aa;
  --border: #27272a; --input: #27272a; --ring: #52525b; --accent: #27272a;
  --primary: #fafafa; --primary-fg: #18181b; --destructive: #ef4444;
  --sel: #18181b; --sel-strong: #27272a; --cloud: #60a5fa; --ordner: #5c5c66; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.leise { color: var(--muted-fg); margin: 0; }

/* Symbole */
.ic { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.ic.stroke { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 36px; padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px); border: 1px solid transparent; background: transparent; color: var(--fg); cursor: pointer;
  font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background .15s, color .15s; }
.knopf:focus-visible, input:focus-visible, .baum-zeile:focus-visible, tr:focus-visible, .umschalter button:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px; }
.knopf.primaer { background: var(--primary); color: var(--primary-fg); }
.knopf.primaer:hover { opacity: .9; }
.knopf.umriss { border-color: var(--input); background: var(--bg); box-shadow: var(--shadow); }
.knopf.umriss:hover, .knopf.geist:hover { background: var(--accent); }
.knopf.icon { width: 36px; padding: 0; }
.knopf.klein { height: 32px; padding: 0 .75rem; font-size: 13px; }
.knopf.breit { width: 100%; }
.knopf[disabled] { opacity: .5; pointer-events: none; }

/* Anmeldung */
.anmeldung { min-height: 100%; display: grid; place-items: center; padding: 16px; background: var(--muted); }
.karte { width: 100%; max-width: 380px; background: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 24px; display: grid; gap: 16px; }
.karte-kopf { display: grid; gap: 6px; }
.karte-kopf h1 { margin: 6px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.logo { width: 40px; height: 40px; border-radius: var(--radius); background: var(--primary); color: var(--primary-fg); display: grid; place-items: center; }
.logo .ic { width: 20px; height: 20px; }
.feld { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
.feld input { height: 36px; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); padding: 0 12px; background: var(--bg); box-shadow: var(--shadow); }
.fehler { color: var(--destructive); margin: 0; font-size: 13px; }

/* Grundaufbau */
.app { display: grid; grid-template-columns: 280px 1fr; grid-template-rows: 56px 1fr; height: 100vh; }
.kopf { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--bg); }
.marke { display: flex; align-items: center; gap: 8px; font-weight: 600; width: 248px; flex: none; }
.marke .ic { width: 18px; height: 18px; }
.suche { position: relative; flex: 1; max-width: 560px; }
.suche input { width: 100%; height: 36px; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); padding: 0 40px 0 34px;
  background: var(--bg); box-shadow: var(--shadow); }
.suche input::-webkit-search-cancel-button { cursor: pointer; }
.suche-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); display: flex; pointer-events: none; }
.suche input:focus ~ kbd, .suche input:not(:placeholder-shown) ~ kbd { display: none; }
.suche kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 11px var(--font); color: var(--muted-fg);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; background: var(--muted); }
.nutzer { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--muted); border: 1px solid var(--border); display: grid; place-items: center;
  font-size: 12px; font-weight: 600; text-transform: uppercase; }

.seite { border-right: 1px solid var(--border); overflow: auto; padding: 12px 8px; background: var(--bg); }
.seite-titel { font-size: 12px; font-weight: 500; color: var(--muted-fg); padding: 4px 8px 8px; }
.haupt { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* Baum */
.baum, .baum ul { list-style: none; margin: 0; padding: 0; }
.baum ul { padding-left: 14px; }
.baum-zeile { display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 6px; border-radius: calc(var(--radius) - 2px);
  cursor: pointer; user-select: none; white-space: nowrap; }
.baum-zeile:hover { background: var(--accent); }
.baum-zeile.aktiv { background: var(--sel-strong); font-weight: 500; }
.baum-zeile .pfeil { width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted-fg); border-radius: 4px; flex: none; }
.baum-zeile .pfeil:hover { background: var(--border); }
.baum-zeile .pfeil.leer { visibility: hidden; }
.baum-zeile .name { overflow: hidden; text-overflow: ellipsis; }
.baum-zeile .ordner-ic { color: var(--muted-fg); display: flex; }
.baum-zeile .ordner-ic.ist-ordner { color: var(--ordner); }
.abzeichen { margin-left: auto; font-size: 11px; color: var(--cloud); display: inline-flex; align-items: center; gap: 3px; }
.abzeichen .ic { width: 13px; height: 13px; }
.dreht { animation: drehen .8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* Werkzeugleiste und Pfad */
.werkzeug { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); min-height: 57px; }
.pfad { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 14px; color: var(--muted-fg); min-width: 0; }
.pfad a { color: var(--muted-fg); text-decoration: none; padding: 2px 6px; border-radius: 4px; }
.pfad a:hover { color: var(--fg); background: var(--accent); }
.pfad .aktuell { color: var(--fg); font-weight: 500; padding: 2px 6px; }
.pfad .trenner { display: flex; color: var(--muted-fg); }
.pfad .trenner .ic { width: 14px; height: 14px; }
.werkzeug-rechts { margin-left: auto; }
.umschalter { display: inline-flex; background: var(--muted); border-radius: var(--radius); padding: 3px; }
.umschalter button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: calc(var(--radius) - 2px); cursor: pointer; font-size: 13px; color: var(--muted-fg); }
.umschalter button.aktiv { background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font-weight: 500; }
.hinweis { margin: 12px 20px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--muted-fg);
  display: flex; gap: 8px; align-items: center; }

/* Tabelle */
.tabelle-rahmen { flex: 1; overflow: auto; padding: 0 12px; }
.tabelle { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tabelle th { position: sticky; top: 0; background: var(--bg); text-align: left; font-weight: 500; color: var(--muted-fg); font-size: 13px;
  height: 40px; padding: 0 8px; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; white-space: nowrap; z-index: 1; }
.tabelle th:hover { color: var(--fg); }
.tabelle th .ic { width: 13px; height: 13px; margin-left: 4px; }
.tabelle td { height: 40px; padding: 0 8px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabelle tbody tr { cursor: default; }
.tabelle tbody tr:hover { background: var(--sel); }
.tabelle tbody tr.gewaehlt { background: var(--sel-strong); }
.spalte-name { width: auto; }
.spalte-ort { width: 30%; }
.spalte-datum { width: 170px; }
.spalte-groesse { width: 100px; text-align: right !important; }
.spalte-aktion { width: 112px; cursor: default !important; }
td.spalte-groesse { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted-fg); }
td.spalte-datum, td.spalte-ort { color: var(--muted-fg); font-variant-numeric: tabular-nums; }
td.spalte-ort a { color: inherit; text-decoration: none; }
td.spalte-ort a:hover { color: var(--fg); text-decoration: underline; }
.zelle-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.zelle-name .typ { display: flex; color: var(--muted-fg); flex: none; }
.zelle-name .typ.ordner { color: var(--ordner); }
.zelle-name .text { overflow: hidden; text-overflow: ellipsis; }
.zelle-name mark { background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .zelle-name mark { background: #854d0e; } }
.verweis { font-size: 11px; color: var(--cloud); display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; flex: none; }
td.spalte-aktion { text-align: right; padding-right: 4px; }
.zeilen-knoepfe { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .1s; }
tr:hover .zeilen-knoepfe, tr.gewaehlt .zeilen-knoepfe, tr:focus-within .zeilen-knoepfe { opacity: 1; }
.zeilen-knoepfe .knopf { width: 30px; height: 30px; color: var(--muted-fg); }
.zeilen-knoepfe .knopf:hover { color: var(--fg); }
.leer { padding: 64px 16px; text-align: center; color: var(--muted-fg); display: grid; gap: 8px; justify-items: center; }
.leer .ic { width: 32px; height: 32px; opacity: .6; }
.fuss { display: flex; justify-content: space-between; gap: 12px; padding: 8px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-fg); }

/* Vorschau */
.dialog-schleier { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: grid; place-items: center; padding: 16px; z-index: 20; }
.dialog { background: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); width: min(1100px, 100%);
  height: min(85vh, 900px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.dialog-kopf { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--border); }
.dialog-kopf h2 { margin: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.dialog-knoepfe { display: flex; gap: 6px; align-items: center; }
.dialog-inhalt { flex: 1; display: grid; place-items: center; background: var(--muted); min-height: 0; }
.dialog-inhalt img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dialog-inhalt iframe { width: 100%; height: 100%; border: 0; background: #fff; }

.toast { position: fixed; bottom: 16px; right: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: 0 4px 12px rgba(0,0,0,.12); font-size: 14px; z-index: 30; max-width: calc(100vw - 32px); }

/* Schmale Bildschirme */
.nur-mobil { display: none; }
.schleier { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .nur-mobil { display: inline-flex; }
  .nur-gross { display: none; }
  .marke { width: auto; }
  .marke span:last-child { display: none; }
  .seite { position: fixed; top: 56px; bottom: 0; left: 0; width: min(300px, 85vw); z-index: 10; transform: translateX(-100%);
    transition: transform .2s; }
  .app.menue-offen .seite { transform: none; box-shadow: 0 0 20px rgba(0,0,0,.15); }
  .app.menue-offen .schleier { display: block; position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,.3); z-index: 9; }
  .werkzeug { padding: 10px 16px; flex-wrap: wrap; }
  .tabelle-rahmen { padding: 0 4px; }
  .spalte-datum, .spalte-ort { display: none; }
  .spalte-groesse { width: 80px; }
  .zeilen-knoepfe { opacity: 1; }
  .spalte-aktion { width: 100px; }
  .fuss { padding: 8px 16px; }
}

/* Betrachter */
.dialog-werkzeug { display: flex; align-items: center; gap: 4px; }
.dialog-werkzeug .knopf.icon.klein { width: 32px; padding: 0; }
.zaehler { font-size: 13px; color: var(--muted-fg); font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.zaehler.warnung { color: #b45309; }
.trennlinie { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.dialog-inhalt { overflow: hidden; position: relative; }
.bild-flaeche, .pdf-flaeche, .editor { position: absolute; inset: 0; }
.laden { display: flex; gap: 8px; align-items: center; color: var(--muted-fg); justify-content: center; padding: 48px; }
.bild-flaeche { overflow: auto; display: flex; align-items: center; justify-content: center; }
.bild-flaeche img.bild { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.bild-flaeche img.bild.echt { max-width: none; max-height: none; cursor: zoom-out; margin: auto; }
.pdf-flaeche { overflow: auto; padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.pdf-seite { margin-inline: auto; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); flex: none; max-width: none; }
.editor { display: flex; background: var(--bg); }
[data-art] .dialog-inhalt { place-items: stretch; }
.zeilennr { flex: none; min-width: 48px; padding: 12px 8px 12px 0; text-align: right; color: var(--muted-fg); background: var(--muted);
  border-right: 1px solid var(--border); font: 13px/20px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; overflow: hidden; user-select: none; }
.editor-text { flex: 1; border: 0; outline: none; resize: none; padding: 12px; background: var(--bg); color: var(--fg); tab-size: 4;
  font: 13px/20px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; overflow: auto; }
.editor-text[readonly] { color: var(--muted-fg); }

/* Web-App im Vollbild (Home-Bildschirm) */
@media (display-mode: standalone) {
  .kopf { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .app { grid-template-rows: calc(56px + env(safe-area-inset-top)) 1fr; }
  .fuss { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}
@media (max-width: 860px) {
  .dialog-schleier { padding: 0; }
  .dialog { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .dialog-kopf { padding: 8px 8px 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); flex-wrap: wrap; row-gap: 4px; }
  .dialog-kopf h2 { flex-basis: calc(100% - 100px); }
  .dialog-werkzeug { order: 3; width: 100%; justify-content: center; }
  .pdf-flaeche { padding: 12px 8px; }
  .zeilennr { min-width: 36px; }
}

/* Dateiverwaltung */
.werkzeug-rechts { display: flex; gap: 8px; align-items: center; }
.knopf.gefahr { color: var(--destructive) !important; }
.knopf.gefahr-voll { background: var(--destructive); color: #fff; }
.knopf.gefahr-voll:hover { opacity: .9; }
.zeilen-knoepfe.sichtbar { opacity: 1; }
.verweis.grau { color: var(--muted-fg); }
.seite { display: flex; flex-direction: column; }
.seite-unten { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.menue { position: fixed; z-index: 40; min-width: 220px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px; }
.menue-punkt { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; background: none;
  border-radius: calc(var(--radius) - 2px); cursor: pointer; text-align: left; font-size: 14px; }
.menue-punkt:hover, .menue-punkt:focus-visible { background: var(--accent); outline: none; }
.menue-punkt .ic { color: var(--muted-fg); }
.menue-punkt.gefahr, .menue-punkt.gefahr .ic { color: var(--destructive); }
.menue-trenner { height: 1px; background: var(--border); margin: 4px -4px; }
.frage { z-index: 35; }
.frage-karte { background: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); width: min(440px, 100%);
  padding: 24px; display: grid; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.frage-karte h2 { margin: 0; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.frage-karte .eingabe { width: 100%; height: 36px; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); padding: 0 12px; background: var(--bg); }
.frage-knoepfe { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.haken { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.haupt { position: relative; }
.ablage { display: none; position: absolute; inset: 8px; z-index: 5; border: 2px dashed var(--ring); border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--bg) 85%, transparent); place-items: center; pointer-events: none; }
.haupt.ziehen .ablage { display: grid; }
.ablage-karte { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; font-weight: 500; }
.uploads { position: fixed; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); max-height: 50vh; display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 25; }
.uploads-kopf { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); font-weight: 500; font-size: 14px; min-height: 44px; }
.upload-liste { overflow: auto; padding: 6px 0; }
.upload-zeile { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 6px 14px; font-size: 13px; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-info { color: var(--muted-fg); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.balken { grid-column: 1 / -1; height: 4px; background: var(--muted); border-radius: 2px; overflow: hidden; }
.balken div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.upload-zeile.fertig .balken div { width: 100% !important; background: #16a34a; }
.upload-zeile.fehler .upload-info { color: var(--destructive); }
.upload-zeile.fehler .balken div, .upload-zeile.uebersprungen .balken div { width: 100% !important; background: var(--border); }
.toast { z-index: 45; }
.klein { font-size: 12px; }
.versionen { display: grid; gap: 4px; max-height: 50vh; overflow: auto; margin: 0 -8px; }
.version { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px; border-radius: calc(var(--radius) - 2px); }
.version:hover { background: var(--accent); }
.version-knoepfe { display: flex; gap: 6px; flex: none; }

/* Rasteransicht */
.umschalter.ansicht button { width: 32px; padding: 0; display: grid; place-items: center; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; padding: 16px 8px; }
.kachel { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; cursor: default; user-select: none; min-width: 0; background: var(--bg); }
.kachel:hover { background: var(--sel); }
.kachel.gewaehlt { background: var(--sel-strong); border-color: var(--ring); }
.kachel:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.kachel-bild { aspect-ratio: 4 / 3; border-radius: calc(var(--radius) - 2px); background: var(--muted); display: grid; place-items: center; overflow: hidden; color: var(--muted-fg); }
.kachel-bild img { width: 100%; height: 100%; object-fit: contain; }
.kachel-bild.ordner { color: var(--ordner); background: transparent; }
.ic.gross { width: 44px; height: 44px; }
.kachel-name { margin-top: 8px; font-size: 13px; font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; line-height: 1.3; }
.kachel-info { font-size: 12px; color: var(--muted-fg); margin-top: 2px; }
@media (max-width: 860px) { .raster { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; } }

/* Statusseite */
.status { padding: 16px 8px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.karte-status { border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); padding: 16px; display: grid; gap: 10px; }
.karte-status h3 { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.karte-status .gross-zahl { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.zeile-status { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.zeile-status span:first-child { color: var(--muted-fg); }
.zeile-status span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.leiste { height: 8px; background: var(--muted); border-radius: 4px; overflow: hidden; }
.leiste div { height: 100%; background: var(--primary); }
.leiste.warnung div { background: #d97706; } .leiste.kritisch div { background: var(--destructive); }
.punkt { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #16a34a; flex: none; }
.punkt.aus { background: var(--destructive); } .punkt.warn { background: #d97706; }
.status-ok { color: #16a34a; } .status-warn { color: #d97706; } .status-fehler { color: var(--destructive); }
.warnung-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--destructive); margin-left: auto; }
.meldung { font-size: 13px; border-top: 1px solid var(--border); padding-top: 8px; }
.meldung:first-of-type { border-top: 0; padding-top: 0; }
.karte-breit { grid-column: 1 / -1; }

/* Versionen mit Vorschau, Projekt-Dialog */
.version-bild { width: 56px; height: 42px; border-radius: 4px; background: var(--muted); object-fit: contain; flex: none; }
.version-text { flex: 1; min-width: 0; }
.version-text .titel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meilenstein-zeile { display: flex; gap: 8px; }
.meilenstein-zeile .eingabe { flex: 1; }
.feld-gruppe { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.vorlage-liste { font-size: 13px; color: var(--muted-fg); margin: 0; padding-left: 18px; }
.frage-karte:has(.versionen), .frage-karte:has(.meilenstein-zeile) { width: min(640px, 100%); }

/* Einstellungen */
.einst { max-width: 760px; margin: 0 auto; padding: 16px 8px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.umschalter.reiter { display: flex; overflow-x: auto; scrollbar-width: none; justify-self: start; max-width: 100%; }
.umschalter.reiter::-webkit-scrollbar { display: none; }
.umschalter.reiter button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; white-space: nowrap; flex: none; }
.umschalter.reiter .ic { width: 14px; height: 14px; }
.einst-inhalt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.einst-karte { border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--bg); box-shadow: var(--shadow); }
.einst-kopf { padding: 16px 20px 4px; display: grid; gap: 4px; }
.einst-kopf h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.einst-kopf .leise { font-size: 13px; }
.einst-karte > :last-child { padding-bottom: 16px; }
.einst-reihe { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--border); }
.einst-kopf + .einst-reihe { border-top: 0; }
.einst-text { min-width: 0; display: grid; gap: 2px; }
.einst-titel { font-weight: 500; font-size: 14px; }
.einst-steuer { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.einst-steuer .wert { font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.einst-aktionen { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 0; flex-wrap: wrap; }
.einst-befehl { display: flex; align-items: center; gap: 8px; padding: 0 20px 14px; }
.einst-befehl code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 7px 10px; font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--muted); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); }
.einst-form { display: grid; gap: 12px; padding: 12px 20px 0; max-width: 420px; }
.einst-form .feld input, .form-dialog .feld input { width: 100%; }
.einst-hinweis { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border: 1px solid #fcd34d; background: #fffbeb; color: #92400e;
  border-radius: calc(var(--radius) + 2px); font-size: 13px; }
.einst-hinweis .ic { margin-top: 2px; }
:root[data-theme="dark"] .einst-hinweis { border-color: #78350f; background: #1c1407; color: #fcd34d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .einst-hinweis { border-color: #78350f; background: #1c1407; color: #fcd34d; } }
.eingabe-feld { height: 36px; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); padding: 0 10px; background: var(--bg); color: var(--fg);
  box-shadow: var(--shadow); font: inherit; min-width: 0; width: 240px; max-width: 100%; }
.eingabe-feld.schmal { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.eingabe-feld:focus-visible, select:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
select.eingabe-feld { width: auto; min-width: 180px; padding-right: 28px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
.schalter { width: 36px; height: 20px; border-radius: 999px; border: 2px solid transparent; background: var(--input); padding: 0; cursor: pointer; position: relative; flex: none; transition: background .15s; }
.schalter[aria-checked="true"] { background: var(--primary); }
.schalter-knopf { position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
:root[data-theme="dark"] .schalter-knopf { background: #fafafa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .schalter-knopf { background: #fafafa; } :root:not([data-theme="light"]) .schalter[aria-checked="true"] .schalter-knopf { background: #18181b; } }
:root[data-theme="dark"] .schalter[aria-checked="true"] .schalter-knopf { background: #18181b; }
.schalter[aria-checked="true"] .schalter-knopf { transform: translateX(16px); }
.schalter:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.schalter[disabled] { opacity: .5; cursor: not-allowed; }
.abzeichen-text { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; font-weight: 500; color: var(--fg); white-space: nowrap; }
.abzeichen-text.warn { color: #b45309; border-color: #fcd34d; }
.tabelle-klein { padding: 8px 20px 0; overflow-x: auto; }
.tabelle-klein table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle-klein th { text-align: left; font-weight: 500; color: var(--muted-fg); font-size: 13px; height: 36px; border-bottom: 1px solid var(--border); padding: 0 8px; }
.tabelle-klein td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabelle-klein tr:last-child td { border-bottom: 0; }
.tabelle-klein .rechts { text-align: right; }
.name-zelle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.klein-avatar { width: 28px; height: 28px; font-size: 11px; }
.protokoll-box { margin: 8px 20px 0; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); }
.protokoll-box summary { cursor: pointer; padding: 8px 12px; font-size: 13px; font-weight: 500; }
.protokoll { margin: 0; padding: 8px 12px; border-top: 1px solid var(--border); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted-fg);
  max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; background: var(--muted); border-radius: 0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px); }
.dienst { display: inline-flex; align-items: center; gap: 8px; }
.form-dialog { display: grid; gap: 12px; }
.form-dialog .eingabe { width: 100%; }
@media (max-width: 860px) {
  .einst { padding: 12px 4px 48px; }
  .einst-reihe { padding: 12px 14px; }
  .einst-reihe:has(.eingabe-feld:not(.schmal):not([type="time"])) { flex-wrap: wrap; }
  .einst-kopf { padding: 14px 14px 4px; }
  .einst-aktionen, .einst-form, .einst-befehl { padding-left: 14px; padding-right: 14px; }
  .tabelle-klein { padding: 8px 6px 0; }
  .protokoll-box { margin: 8px 14px 0; }
  .eingabe-feld { width: 100%; }
  .einst-steuer:has(.eingabe-feld:not(.schmal)) { flex: 1 1 100%; }
}
.einst-karte > .protokoll-box:last-child { padding-bottom: 0; margin-bottom: 16px; }
.eingabe-feld[type="time"] { width: 130px; }

/* Anmeldung über KlopKom-Login */
.trenner-text { display: flex; align-items: center; gap: 12px; color: var(--muted-fg); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin: 4px 0 16px; }
.trenner-text::before, .trenner-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
#sso-bereich { display: grid; }
#sso-bereich[hidden] { display: none !important; }

/* Finder-Tags: Systemfarben von macOS */
:root { --tag-1: #8e8e93; --tag-2: #34c759; --tag-3: #af52de; --tag-4: #007aff; --tag-5: #ffcc00; --tag-6: #ff3b30; --tag-7: #ff9500; }
.farbe-1 { --tag: var(--tag-1); } .farbe-2 { --tag: var(--tag-2); } .farbe-3 { --tag: var(--tag-3); } .farbe-4 { --tag: var(--tag-4); }
.farbe-5 { --tag: var(--tag-5); } .farbe-6 { --tag: var(--tag-6); } .farbe-7 { --tag: var(--tag-7); }
.zelle-name .typ[class*="farbe-"], .baum-zeile .ordner-ic[class*="farbe-"], .kachel-bild.ordner[class*="farbe-"] { color: var(--tag); }
.tag-punkte { display: inline-flex; flex: none; align-items: center; }
.tag-punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--tag); box-shadow: 0 0 0 1.5px var(--bg); }
.tag-punkt + .tag-punkt { margin-left: -3px; }
.kachel-name .tag-punkte { margin-right: 5px; vertical-align: 1px; }

/* Tags setzen: Farbreihe im Kontextmenü und Tag-Dialog */
.menue-tags { border-top: 1px solid var(--border); margin: 4px -4px 0; padding: 6px 4px 0; }
.menue-farben { display: flex; gap: 6px; padding: 2px 8px 6px; }
.farb-knopf { width: 18px; height: 18px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--tag); position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); transition: transform .1s; }
.farb-knopf:hover { transform: scale(1.15); }
.farb-knopf:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.farb-knopf.an::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--tag); }
.farb-knopf.teils::after { content: ""; position: absolute; left: 4px; right: 4px; top: 8px; height: 2px; background: #fff; border-radius: 1px; }
.farb-knopf.an::before { content: ""; position: absolute; left: 6px; top: 4px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.menue-farben.gross { gap: 10px; padding: 4px 0; }
.menue-farben.gross .farb-knopf { width: 24px; height: 24px; }
.tag-liste { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); font-size: 13px; cursor: pointer; }
.tag-chip:hover { background: var(--accent); }
.tag-chip.an { border-color: var(--fg); }
.tag-chip.aus { color: var(--muted-fg); text-decoration: line-through; }
.tag-chip.teils { border-style: dashed; }
.tag-zustand { font-size: 12px; color: var(--muted-fg); min-width: 8px; }

.regler { width: 160px; accent-color: var(--primary); }
.schmal-wert { min-width: 44px; display: inline-block; text-align: right; }

/* Datenübernahme von der Synology (Statusseite) */
.umzug-kopf { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.umzug-volumes { display: grid; gap: 8px; margin-top: 4px; }
.umzug-volume { display: grid; gap: 4px; }
.umzug-volume .leiste { height: 4px; }
.leiste.aktiv div { background-image: linear-gradient(90deg, var(--primary) 0 60%, color-mix(in srgb, var(--primary) 55%, transparent) 60% 100%); background-size: 24px 100%; animation: leiste-lauf 1s linear infinite; }
@keyframes leiste-lauf { to { background-position: 24px 0; } }
.umzug-protokoll pre { margin: 4px 0 0; font-size: 11px; line-height: 1.5; white-space: pre-wrap; color: var(--muted-fg); max-height: 160px; overflow: auto; }

/* Terminal-Ansicht */
.tabelle-rahmen.terminal { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 8px; }
.terminal-rahmen { flex: 1; width: 100%; min-height: 420px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: #09090b; }
.terminal-hinweis { padding: 0 2px 4px; }
