/* ==========================================================================
   vault · Werkbank — Basis-Stylesheet
   Vorlage: mockups/werkbank.html. Die Klassennamen sind der Vertrag zwischen
   CSS und JS; app.css, trim.css und pages.css ergänzen nur.

   Darstellung über Attribute am <html> (gesetzt von partials/head.ejs):
     data-base   = graphit (Vorgabe) | schwarz | hell
     data-accent = orange (Vorgabe) | gruen | blau | magenta | gelb

   Tokens (in eigenem CSS nur diese benutzen, keine festen Farben):
     Flächen   --bg0 (tiefste: Leiste, Felder) … --bg4 (Hover, Spuren)
     Linien    --ln0 (Zeilen) --ln --ln2 (Rahmen) --ln3 (Hover-Rahmen)
     Text      --tx --tx2 --tx3 · --tx4 nur für Trennzeichen
     Akzent    --acc (Fläche) --acc2 (Hover) --accs (12 %-Tönung) --acct (Text auf --acc)
               --acci (Akzent als Text/Icon/Fokus auf Flächen, ≥ 4.5:1 in allen Grundtönen)
               --accl (heller Akzent-Text, z. B. Warnhinweise)
     Status    --keep --keeps · --red --reds --redt (Text auf --red) --redl
     Schrift   --f (Geist) · --m (Geist Mono)
     Schatten  --sh-btn --sh-seg --sh-pop --sh-media --sh-modal --sh-sheet · --veil
   Die Medienbühne (.media, .th, .track, .pmedia, .vc) bleibt in allen Grundtönen dunkel.

   Layout: ≥ 1280 px drei Spalten · 900–1279 px schmale Icon-Leiste ·
   < 900 px Handy (body.m-list | m-detail | m-trim wählt die sichtbare Spalte).
   ========================================================================== */


/* --------------------------------------------------------------------------
   1 · Tokens
   -------------------------------------------------------------------------- */

/* Grundton graphit = Werte des Entwurfs */
:root {
  color-scheme: dark;
  --bg0: #0f1113; --bg1: #14171a; --bg2: #191c20; --bg3: #212529; --bg4: #2a2f35;
  --ln0: #1c1f23; --ln: #262a30; --ln2: #343a42; --ln3: #454c55;
  --tx: #eceef1; --tx2: #aab1ba; --tx3: #868e98; --tx4: #4e555e;
  --hov: #1a1d21; --sel: #20242a; --rih: #181b1e; --rion: var(--bg3); --segon: var(--bg4);
  --sbar: #2b2f35; --tick: #3a4048; --tick2: #59616b; --ring: rgba(255, 255, 255, .07);
  --swoff: var(--bg4); --knob0: #a3aab3;
  --keep: #4fdc9b; --red: #ff5d6c; --redt: #22060a;
  --veil: rgba(6, 7, 8, .64);
  --sh-btn: inset 0 1px 0 rgba(255, 255, 255, .04);
  --sh-seg: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .4);
  --sh-pop: 0 8px 24px rgba(0, 0, 0, .45);
  --sh-media: 0 24px 48px -12px rgba(0, 0, 0, .6);
  --sh-modal: 0 40px 120px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .05);
  --sh-sheet: 0 -20px 60px rgba(0, 0, 0, .55);
  --f: 'Geist', Inter, system-ui, sans-serif;
  --m: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --tabh: 0px;
  --v-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
}

/* Tiefschwarz: echte Schwarzflächen für OLED, Stufen nur über Linien und leichte Anhebung */
:root[data-base="schwarz"] {
  --bg0: #000000; --bg1: #060607; --bg2: #0b0b0d; --bg3: #17171a; --bg4: #202024;
  --ln0: #111114; --ln: #1b1b1f; --ln2: #2a2a2f; --ln3: #3d3d44;
  --tx: #f1f1f3; --tx2: #a9a9b1; --tx3: #8a8a93; --tx4: #4a4a52;
  --hov: #0f0f12; --sel: #16161a; --rih: #0d0d0f;
  --sbar: #26262b; --tick: #34343a; --tick2: #55555d; --ring: rgba(255, 255, 255, .08);
  --knob0: #a3a3ab;
  --veil: rgba(0, 0, 0, .72);
}

/* Hell: Leiste und Felder grau vertieft, Liste fast weiß, Vorschau weiß.
   Akzent bleibt als Fläche kräftig; als Schrift dient die dunkle Variante --accd. */
:root[data-base="hell"] {
  color-scheme: light;
  --bg0: #e8ebee; --bg1: #f6f7f9; --bg2: #ffffff; --bg3: #eef0f3; --bg4: #e3e7eb;
  --ln0: #e9ecf0; --ln: #dfe3e8; --ln2: #cbd1d8; --ln3: #a9b1bb;
  --tx: #14171b; --tx2: #434b55; --tx3: #59616b; --tx4: #a2a9b2;
  --hov: #eef1f4; --sel: #e6eaef; --rih: #dfe3e7; --rion: #ffffff; --segon: #ffffff;
  --sbar: #c3c9d0; --tick: #c3c9d0; --tick2: #98a0aa; --ring: rgba(16, 24, 40, .12);
  --swoff: #bcc3cb; --knob0: #ffffff;
  --keep: #08703f; --red: #b42231; --redt: #ffffff;
  --veil: rgba(22, 26, 32, .42);
  --sh-btn: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 1px rgba(16, 24, 40, .05);
  --sh-seg: 0 1px 2px rgba(16, 24, 40, .14), 0 0 0 1px rgba(16, 24, 40, .06);
  --sh-pop: 0 8px 24px rgba(16, 24, 40, .14), 0 1px 3px rgba(16, 24, 40, .08);
  --sh-media: 0 18px 40px -16px rgba(16, 24, 40, .35);
  --sh-modal: 0 30px 90px rgba(16, 24, 40, .25), 0 1px 3px rgba(16, 24, 40, .08);
  --sh-sheet: 0 -16px 48px rgba(16, 24, 40, .18);
}

/* Akzente: Fläche, Hover, Text auf Fläche, dunkle Schrift-Variante für „hell" */
:root { --acc: #ff6a2b; --acc2: #ff8552; --acct: #1c0c03; --accd: #b03b06; }
:root[data-accent="gruen"] { --acc: #c6f432; --acc2: #d4f866; --acct: #172100; --accd: #3b6400; }
:root[data-accent="blau"] { --acc: #4c8dff; --acc2: #6fa3ff; --acct: #03132f; --accd: #1d58d0; }
:root[data-accent="magenta"] { --acc: #ff4fa3; --acc2: #ff73b6; --acct: #2b0517; --accd: #b0185c; }
:root[data-accent="gelb"] { --acc: #ffd23f; --acc2: #ffdd6b; --acct: #241a00; --accd: #765600; }

/* Abgeleitete Tokens — am <html> berechnet, damit Grundton und Akzent beide greifen */
:root {
  --accs: color-mix(in srgb, var(--acc) 12%, transparent);
  --acci: var(--acc);
  --accl: color-mix(in srgb, var(--acc) 50%, #fff);
  --keeps: color-mix(in srgb, var(--keep) 12%, transparent);
  --reds: color-mix(in srgb, var(--red) 12%, transparent);
  --redl: color-mix(in srgb, var(--red) 55%, #fff);
}
:root[data-base="hell"] { --acci: var(--accd); --accl: var(--accd); --redl: var(--red); }


/* --------------------------------------------------------------------------
   2 · Grundregeln
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { background: var(--bg1); }
body {
  min-height: 100vh; min-height: 100dvh;
  color: var(--tx);
  font: 13px/1.45 var(--f);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img, video, canvas { display: block; max-width: 100%; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.015em; }
ul, ol { padding-left: 1.3em; }
code { font-family: var(--m); font-size: .94em; }
option { background: var(--bg2); color: var(--tx); }
input::placeholder, textarea::placeholder { color: var(--tx3); opacity: 1; }
p a:not([class]), .cd a:not([class]), .note a:not([class]) { color: var(--acci); text-decoration: underline; text-underline-offset: 2px; }

:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--acci); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--acc) 34%, transparent); color: var(--tx); }

/* Bildlaufleisten wie im Entwurf (schmal, abgerundet); Firefox nur über die Standard-Eigenschaften */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sbar); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--ln3); }
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; scrollbar-color: var(--sbar) transparent; }
}

/* Chrome-Autofill soll das Feld nicht hell einfärben */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--tx);
  -webkit-box-shadow: 0 0 0 40px var(--bg0) inset;
  caret-color: var(--tx);
  transition: background-color 9999s;
}

@keyframes v-sh { from { background-position: -40px 0; } to { background-position: 200px 0; } }
@keyframes v-fade { from { opacity: 0; } }
@keyframes v-pop { from { opacity: 0; transform: translateY(4px) scale(.985); } }
@keyframes v-up { from { opacity: .4; transform: translateY(28px); } }
@keyframes v-toast { from { opacity: 0; transform: translate(-50%, 6px); } }


/* --------------------------------------------------------------------------
   3 · Hilfsklassen
   -------------------------------------------------------------------------- */

.mono { font-family: var(--m); font-variant-numeric: tabular-nums; }
.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.f { fill: currentColor; stroke: none; }
.logo { width: 22px; height: 22px; flex: none; }
.sp, .grow { flex: 1; }
.tx2 { color: var(--tx2); }
.tx3 { color: var(--tx3); }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* .dsk = nur Desktop/Tablet (≥ 900 px), .mob = nur Handy (< 900 px) — siehe Abschnitt 18 */


/* --------------------------------------------------------------------------
   4 · Schaltflächen & Bedienelemente
   -------------------------------------------------------------------------- */

.btn {
  height: 32px; padding: 0 12px; border-radius: 7px;
  border: 1px solid var(--ln2); background: var(--bg3); color: var(--tx);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 500 13px var(--f); white-space: nowrap; text-decoration: none; cursor: pointer;
  box-shadow: var(--sh-btn);
  transition: background .12s, border-color .12s, color .12s;
  -webkit-user-select: none; user-select: none;
}
.btn:hover:not(:disabled) { background: var(--bg4); border-color: var(--ln3); }
.btn:focus-visible { outline: 2px solid var(--acci); outline-offset: 2px; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acct); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 0 rgba(0, 0, 0, .3); }
.btn.pri:hover:not(:disabled) { background: var(--acc2); border-color: var(--acc2); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--tx2); }
.btn.ghost:hover:not(:disabled) { background: var(--bg3); color: var(--tx); }
.btn.icon { width: 32px; padding: 0; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 6px; }
.btn.sm.icon { width: 28px; padding: 0; }
.btn.lg { height: 42px; padding: 0 16px; font-size: 14px; border-radius: 9px; }
.btn.wide { width: 100%; }
.btn.danger, .btn.danger:hover:not(:disabled) { color: var(--red); }
.btn.ghost.danger:hover:not(:disabled) { background: var(--reds); }
.btn.dangerf { background: var(--red); border-color: var(--red); color: var(--redt); font-weight: 600; }
.btn.dangerf:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 86%, #fff); border-color: transparent; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
a.btn[aria-disabled="true"] { pointer-events: none; }

kbd {
  font: 500 10.5px/1 var(--m); padding: 3px 5px; border-radius: 4px;
  border: 1px solid var(--ln2); border-bottom-width: 2px;
  color: var(--tx2); background: var(--bg1);
  display: inline-block; min-width: 18px; text-align: center;
}
.btn kbd { margin-left: 2px; padding: 2px 4px; color: var(--tx3); }
.btn.pri kbd { background: rgba(0, 0, 0, .13); border-color: rgba(0, 0, 0, .2); color: color-mix(in srgb, var(--acct) 80%, var(--acc)); }

/* Segment-Umschalter: <div class="seg"><b|button class="on">…</b></div> */
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg0); border: 1px solid var(--ln2); border-radius: 8px; flex: none; }
.seg > :is(b, button) {
  height: 28px; padding: 0 11px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 12.5px var(--f); color: var(--tx2); white-space: nowrap; cursor: pointer;
}
.seg > :is(b, button):hover { color: var(--tx); }
.seg > :is(b, button):focus-visible { outline-offset: 0; }
.seg > .on { background: var(--segon); color: var(--tx); box-shadow: var(--sh-seg); }
.seg > .on.k { background: var(--keeps); color: var(--keep); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--keep) 38%, transparent); }
.seg > .on.x { background: var(--accs); color: var(--acci); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 42%, transparent); }
.seg.sm > :is(b, button) { height: 24px; padding: 0 7px; }
.seg.full { display: flex; width: 100%; }
.seg.full > :is(b, button) { flex: 1; }

/* Schalter: <button class="sw" role="switch" aria-checked="true|false"> (oder .off) */
.sw {
  --k: 14px;
  position: relative; display: inline-block; flex: none; vertical-align: middle;
  width: 32px; height: 18px; padding: 0; border: 0; border-radius: 9px;
  background: var(--acc); cursor: pointer; transition: background .15s;
}
.sw::after {
  content: ""; position: absolute; top: 2px; left: calc(100% - var(--k) - 2px);
  width: var(--k); height: var(--k); border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  transition: left .15s, background .15s;
}
.sw.off, .sw[aria-checked="false"] { background: var(--swoff); }
.sw.off::after, .sw[aria-checked="false"]::after { left: 2px; background: var(--knob0); }
.sw:disabled { opacity: .5; cursor: not-allowed; }

/* Eingabefelder. Im Entwurf Attrappen (div) — hier echt:
   <input class="in2">, <select class="in2">, <textarea class="in2"> oder
   <div class="in2"><svg class="i"/><input></div> */
.in2 {
  height: 34px; border-radius: 7px; background: var(--bg0); border: 1px solid var(--ln2);
  display: flex; align-items: center; gap: 8px; padding: 0 11px; min-width: 0;
  font-size: 13px; color: var(--tx3);
  transition: border-color .12s, box-shadow .12s;
}
.in2:hover { border-color: var(--ln3); }
.in2.v { color: var(--tx); font-family: var(--m); letter-spacing: .02em; }
.in2.on, .in2:focus-within { border-color: var(--acci); box-shadow: 0 0 0 3px var(--accs); }
.in2.err, .in2[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--reds); }
.in2:has(> [aria-invalid="true"]) { border-color: var(--red); box-shadow: 0 0 0 3px var(--reds); }
.in2 > :is(input, select) {
  flex: 1; min-width: 0; height: 100%;
  background-color: transparent; border: 0; outline: 0;
  font: inherit; letter-spacing: inherit; color: var(--tx);
}
:is(input, select, textarea).in2 { width: 100%; color: var(--tx); outline: 0; }
textarea.in2 { display: block; height: auto; min-height: 84px; padding: 9px 11px; line-height: 1.45; resize: vertical; }
:is(select.in2, .in2 > select, select.inp) {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--tx3) 50%), linear-gradient(135deg, var(--tx3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.in2 > select { padding-right: 22px; background-position: calc(100% - 9px) 52%, calc(100% - 4px) 52%; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* Zeitfeld im Schnitt: <input class="inp"> oder Anzeige-div */
.inp {
  height: 30px; display: flex; align-items: center; padding: 0 9px; min-width: 0;
  background: var(--bg0); border: 1px solid var(--ln2); border-radius: 6px;
  font: 500 13px var(--m); font-variant-numeric: tabular-nums; color: var(--tx);
}
input.inp { width: 100%; outline: 0; }
.inp:hover { border-color: var(--ln3); }
.inp.on, .inp:focus, .inp:focus-within { border-color: var(--acci); box-shadow: 0 0 0 3px var(--accs); }
.inp[aria-invalid="true"], .inp.err { border-color: var(--red); box-shadow: 0 0 0 3px var(--reds); }

/* Kontrollkästchen: <label class="chk"><input type="checkbox">Text</label> (oder <i> wie im Entwurf) */
.chk { display: flex; align-items: center; gap: 9px; margin: 16px 0 20px; font-size: 12.5px; color: var(--tx2); cursor: pointer; }
.chk i { width: 16px; height: 16px; border-radius: 4px; background: var(--acc); display: grid; place-items: center; color: var(--acct); }
.chk i .i { width: 12px; height: 12px; stroke-width: 2.4; }
.chk input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--ln2); background: var(--bg0);
}
.chk input[type="checkbox"]:checked {
  border-color: var(--acc); background: var(--acc);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-opacity='.82' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
  background-position: center; background-size: 12px; background-repeat: no-repeat;
}


/* --------------------------------------------------------------------------
   5 · App-Gerüst (volle Fensterhöhe, Spalten scrollen selbst)
   -------------------------------------------------------------------------- */

.app {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 232px 560px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  height: 100vh; height: 100dvh;
  background: var(--bg1);
}
.app.cut { grid-template-columns: 232px 76px minmax(0, 1fr); }
.app.one { grid-template-columns: 232px minmax(0, 1fr); }
/* Schnittmodus: Miniaturleiste statt Liste, Editor statt Vorschau (falls getrennt vorhanden) */
.app:not(.cut) > .mini, .app:not(.cut) > .ed, .app.cut > .lp { display: none; }
.app.cut:has(> .ed) > .prev { display: none; }

.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--ln); }


/* --------------------------------------------------------------------------
   6 · Leiste (.rail)
   -------------------------------------------------------------------------- */

.rail {
  background: var(--bg0); border-right: 1px solid var(--ln);
  display: flex; flex-direction: column; padding: 12px 10px 10px;
  min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex-shrink: 0; }
.rail > .grow { flex: 1 1 0; }
.brand { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 6px; margin-bottom: 10px; }
.brand b { font-size: 16px; font-weight: 650; letter-spacing: -.03em; }
.rs { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 8px 5px; font: 600 10.5px var(--f); letter-spacing: .09em; text-transform: uppercase; color: var(--tx3); }
.rs span { font: 400 10.5px var(--f); letter-spacing: 0; text-transform: none; }
.ri {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  height: 29px; padding: 0 8px; border-radius: 6px;
  color: var(--tx2); text-align: left; cursor: pointer;
}
.ri span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ri:hover { background: var(--rih); color: var(--tx); }
.ri.on { background: var(--rion); color: var(--tx); }
.ri.on::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--acc); }
.ri em { margin-left: auto; font: 500 11px var(--m); font-style: normal; color: var(--tx3); }
.ri.warn em, .ri.warn .i, .ri.pend em { color: var(--acci); }
.ri:focus-visible { outline-offset: -2px; }
.dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--tx3)); margin: 0 4px; flex: none; }

/* Aufträge (Upload/Schnitt) */
.jobs { border: 1px solid var(--ln); border-radius: 9px; padding: 10px; background: var(--bg1); margin-bottom: 8px; }
.jobs .rs { padding: 0 0 8px; }
.job + .job { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--ln); }
.jt { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; }
.jt span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.jt .i { width: 14px; height: 14px; color: var(--acci); }
.pbar { height: 4px; border-radius: 2px; background: var(--bg4); margin: 7px 0 5px; overflow: hidden; }
.pbar i {
  display: block; width: 0; height: 100%; border-radius: 2px;
  background: var(--acc) linear-gradient(90deg, transparent, rgba(255, 255, 255, .4), transparent) no-repeat;
  background-size: 40px 100%; animation: v-sh 1.6s linear infinite; transition: width .3s;
}
.jm { display: flex; justify-content: space-between; gap: 8px; font: 11px var(--m); color: var(--tx3); }
.job.err .jt .i, .job.err .jm { color: var(--red); }
.job.err .pbar i { background: var(--red); animation: none; }
.job.done .pbar i { animation: none; }

/* Kennzahlen 2×2 — Rahmen über negative Ränder, damit jede Anzahl Zellen sauber endet */
.stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ln); border-radius: 9px; overflow: hidden; margin-bottom: 8px; }
.stats > div { padding: 7px 10px; min-width: 0; border-right: 1px solid var(--ln); border-bottom: 1px solid var(--ln); margin: 0 -1px -1px 0; }
.stats b { display: block; font: 500 14px var(--m); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats span { font-size: 10.5px; color: var(--tx3); }
.stats .w b { color: var(--acci); }

.rnav { margin-bottom: 6px; }
.acct { display: flex; align-items: center; gap: 9px; padding: 8px 2px 0 4px; border-top: 1px solid var(--ln); }
.acct > div { flex: 1; min-width: 0; line-height: 1.25; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct small { display: block; color: var(--tx3); font-size: 11px; }
.acct form { display: flex; flex: none; }
.av {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font: 600 12px var(--f); color: var(--tx); text-transform: uppercase;
  background: linear-gradient(135deg, var(--tick), var(--ln)); box-shadow: inset 0 0 0 1px var(--ring);
}


/* --------------------------------------------------------------------------
   7 · Liste (.lp)
   -------------------------------------------------------------------------- */

.lp { background: var(--bg1); }
.lh { padding: 12px 14px 10px; border-bottom: 1px solid var(--ln); flex: none; }

/* Suche: <label class="search"><svg class="i"/><input type="search" placeholder="…"><kbd>/</kbd></label> */
.search {
  display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 8px 0 11px;
  background: var(--bg0); border: 1px solid var(--ln2); border-radius: 8px;
  color: var(--tx3); font-size: 13px; cursor: text;
  transition: border-color .12s, box-shadow .12s;
}
.search:hover { border-color: var(--ln3); }
.search.on, .search:focus-within { border-color: var(--acci); box-shadow: 0 0 0 3px var(--accs); color: var(--tx); }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font: inherit; color: var(--tx); }
.search kbd, .search .btn { margin-left: auto; }
.search input:not(:placeholder-shown) ~ kbd { display: none; }
.sscope { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 9px; font: 11.5px var(--m); color: var(--tx3); }
.sscope b { font-weight: 500; color: var(--tx); }

.lbar { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--ln); flex: none; }
.lbar h1 { font-size: 14px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnt { font: 11.5px var(--m); color: var(--tx3); padding: 2px 6px; border: 1px solid var(--ln2); border-radius: 5px; flex: none; }
.list { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }

/* Gruppenkopf (Monat · Anzahl · Größe) */
.gh {
  position: sticky; top: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  height: 30px; padding: 0 14px;
  background: color-mix(in srgb, var(--bg1) 94%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ln);
  font: 600 10.5px var(--f); letter-spacing: .09em; text-transform: uppercase; color: var(--tx3);
}
.gh .mono { font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 11px; }

/* Zeile: .th · .nm (.t + .m [+ .snip]) · .st (Status) · .acts (Schnellaktionen, ersetzt .st beim Überfahren) */
.row {
  position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--ln0); cursor: pointer;
}
.row:hover, .row.hov { background: var(--hov); }
.row.sel { background: var(--sel); box-shadow: inset 2px 0 0 var(--acci); }
.row.sel .th { box-shadow: 0 0 0 1px var(--acci); }
.row:focus-visible { outline: 2px solid var(--acci); outline-offset: -2px; }
.nm { min-width: 0; }

.th { position: relative; width: 96px; height: 54px; border-radius: 5px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--ring); flex: none; }
.th > :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th > svg:not(.i) { display: block; width: 100%; height: 100%; }
.th :is(.dur, .hpb, .hpt) { z-index: 1; }
.th .dur { position: absolute; right: 4px; bottom: 4px; display: flex; align-items: center; gap: 3px; padding: 1px 4px; border-radius: 3px; background: rgba(0, 0, 0, .76); color: #fff; font: 500 10px/1.3 var(--m); }
.th .dur .i { width: 11px; height: 11px; }
.th .hpb { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--acc); }
.th .hpt { position: absolute; left: 4px; top: 4px; padding: 1px 4px; border-radius: 3px; background: var(--acc); color: var(--acct); font: 600 10px/1.3 var(--m); }
.th.doc { display: grid; place-items: center; align-content: center; gap: 3px; background: linear-gradient(160deg, var(--ln), var(--bg2)); color: var(--tx2); }
.th.doc .i { width: 20px; height: 20px; }
.th.doc span { font: 600 9px var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); }

/* Name: Farbpunkt · Spiel (fett) · Rest in Mono (kürzt zuerst) · Tag */
.t { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; font-size: 13px; }
.t b { font-weight: 600; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.t .rest { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 12px var(--m); color: var(--tx2); }
.gd { width: 7px; height: 7px; border-radius: 2px; background: var(--c, var(--tx3)); flex: none; }
.tag { flex: none; padding: 3px 5px; border: 1px solid var(--ln2); border-radius: 4px; font: 500 10.5px/1 var(--f); font-style: normal; color: var(--tx2); }
.m { margin-top: 4px; font: 11.5px var(--m); color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m i { font-style: normal; color: var(--tx4); padding: 0 6px; }

/* Status */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: 5px; font: 500 11.5px var(--m); white-space: nowrap; }
.chip .i { width: 13px; height: 13px; }
.chip.exp { color: var(--acci); background: var(--accs); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 28%, transparent); }
.chip.new { background: var(--acc); color: var(--acct); }
.kept { display: grid; place-items: center; width: 22px; height: 22px; color: var(--keep); }
.kept .i { width: 14px; height: 14px; fill: color-mix(in srgb, var(--keep) 20%, transparent); }

/* Schnellaktionen */
.acts { display: none; align-items: center; gap: 2px; padding: 3px; margin-right: -2px; z-index: 2; background: var(--bg3); border: 1px solid var(--ln2); border-radius: 9px; box-shadow: var(--sh-pop); }
.acts .btn { height: 28px; width: 28px; padding: 0; }
.acts .on { color: var(--keep); }
.acts .vs { width: 1px; height: 16px; background: var(--ln2); margin: 0 3px; }
.row.hov .acts, .row.cf .acts { display: flex; }
.row.hov .st, .row.cf .st { display: none; }
/* Überfahren nur mit echter Maus — auf Touch übernimmt das ⋯-Blatt */
@media (hover: hover) {
  .row:hover .acts { display: flex; }
  .row:hover .st { display: none; }
}
.row:focus-visible .acts { display: flex; }
.row:focus-visible .st { display: none; }
.row:has(:focus-visible) .acts { display: flex; }
.row:has(:focus-visible) .st { display: none; }
/* Löschen mit Bestätigung in der Zeile */
.row.cf { background: linear-gradient(90deg, transparent 30%, var(--reds)); }
.acts.conf { padding: 3px 3px 3px 11px; gap: 6px; font-size: 12.5px; white-space: nowrap; border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.acts.conf .btn { width: auto; padding: 0 10px; }

.lf { display: flex; gap: 14px; align-items: center; height: 34px; padding: 0 14px; border-top: 1px solid var(--ln); flex: none; overflow: hidden; white-space: nowrap; font-size: 11px; color: var(--tx3); }
.lf kbd { margin-right: 3px; padding: 2px 4px; }
.snip { margin-top: 7px; padding: 5px 8px; background: var(--bg0); border: 1px solid var(--ln); border-radius: 5px; font: 11.5px/1.4 var(--m); color: var(--tx2); white-space: normal; overflow-wrap: anywhere; }
mark { background: color-mix(in srgb, var(--acc) 22%, transparent); color: var(--accl); border-radius: 2px; padding: 0 2px; box-shadow: inset 0 -1px 0 var(--acc); }
.empty { padding: 18px 14px 20px; color: var(--tx3); font-size: 12.5px; }
.recent { padding: 6px 8px; }
.recent > :is(a, button) { display: flex; align-items: center; gap: 10px; width: 100%; height: 30px; padding: 0 8px; border-radius: 6px; color: var(--tx2); font: 12px var(--m); text-align: left; overflow: hidden; white-space: nowrap; }
.recent > :is(a, button):hover { background: var(--bg2); }


/* --------------------------------------------------------------------------
   8 · Raster-Ansicht der Liste (.grid-view mit .tile)
   -------------------------------------------------------------------------- */

.grid-view { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; padding: 12px 14px 16px; align-content: start; }
.grid-view > .gh { grid-column: 1 / -1; margin: 0 -14px; }
.grid-view > .gh:first-child { margin-top: -12px; }
.grid-view > :is(.empty, .drop) { grid-column: 1 / -1; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; padding: 0; border-radius: 7px; color: var(--tx); text-align: left; cursor: pointer; }
.tile .th { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 6px; }
.tile:hover .th { box-shadow: 0 0 0 1px var(--ln3); }
.tile.sel .th { box-shadow: 0 0 0 2px var(--acci); }
.tile .t { font-size: 12.5px; gap: 5px; }
.tile .m { margin-top: -2px; font-size: 11px; }
.tile .st { position: absolute; top: 5px; left: 5px; z-index: 1; }
.tile .st .chip { height: 20px; padding: 0 6px; font-size: 10.5px; }
/* Statusmarken liegen auf dem Bild → dunkler Grund in jedem Grundton */
.tile .st .chip.exp { background: rgba(0, 0, 0, .72); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 60%, transparent); }
.tile .st .kept { width: 20px; height: 20px; border-radius: 5px; background: rgba(0, 0, 0, .6); color: color-mix(in srgb, var(--keep) 55%, #fff); }


/* --------------------------------------------------------------------------
   9 · Vorschau (.prev)
   -------------------------------------------------------------------------- */

.prev { background: var(--bg2); border-right: 0; }
.ph { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px 0 20px; border-bottom: 1px solid var(--ln); flex: none; min-width: 0; font-size: 12.5px; }
.ph > span:not(.sp):not(.vsep) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 20px 20px; }

/* Medienbühne — bleibt dunkel */
.media { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--ln2), var(--sh-media); }
.media > :is(img, video) { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.media > svg:not(.i) { display: block; width: 100%; height: 100%; }
.pb .media { max-height: 70vh; }
/* Datei ohne Vorschau */
.media.doc { display: grid; place-items: center; align-content: center; gap: 8px; background: linear-gradient(160deg, var(--ln), var(--bg1)); color: var(--tx2); }
.media.doc .i { width: 40px; height: 40px; stroke-width: 1.3; }
.media.doc span { font: 600 12px var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); }

/* Eigene Video-Bedienelemente */
.vc { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 36px 12px 10px; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .62) 45%, rgba(0, 0, 0, .88)); color: #fff; font: 500 11.5px var(--m); font-variant-numeric: tabular-nums; }
.vc .pl { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; }
.vc .pl:hover { background: rgba(255, 255, 255, .26); }
.vc .i { width: 15px; height: 15px; }
.vc button { color: #fff; }
.vc button:not(.pl) { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; flex: none; }
.vc button:not(.pl):hover { background: rgba(255, 255, 255, .12); }
.vc :focus-visible { outline-color: #fff; }
.scrub { position: relative; flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .24); cursor: pointer; touch-action: none; }
.scrub::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px; }
.scrub i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--acc); border-radius: 2px; }
.scrub b { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 40%, transparent); }

/* Storyboard-Streifen: Kacheln als beliebige Kinder (img oder i mit Hintergrund) */
.strip { position: relative; display: flex; gap: 2px; height: 36px; margin-top: 8px; border-radius: 6px; overflow: hidden; cursor: pointer; }
.strip > :not(.sph) { display: block; flex: 1; min-width: 0; height: 100%; opacity: .8; background-color: #000; background-repeat: no-repeat; }
.strip > img { object-fit: cover; }
.strip .sph { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); pointer-events: none; }

.ttl { display: flex; align-items: center; gap: 4px; margin-top: 16px; min-width: 0; }
.ttl h2 { min-width: 0; font-size: 19px; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sub { margin-top: 3px; font: 12px var(--m); color: var(--tx3); }

/* Aufbewahrungs-Karte: .ret.exp (läuft ab / offen) · .ret.kp (behalten) */
.ret { margin-top: 16px; display: flex; align-items: center; gap: 13px; padding: 12px 12px 12px 14px; border: 1px solid var(--ln2); border-radius: 10px; background: var(--bg1); }
.ret > .i { width: 20px; height: 20px; }
.rt { flex: 1; min-width: 0; }
.rt b { display: block; font-size: 13.5px; font-weight: 600; }
.rt span { font: 11.5px var(--m); color: var(--tx3); }
.ret.exp { border-color: color-mix(in srgb, var(--acc) 42%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 11%, transparent), color-mix(in srgb, var(--acc) 2%, transparent) 60%); }
.ret.exp > .i { color: var(--acci); }
.ret.kp { border-color: color-mix(in srgb, var(--keep) 30%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--keep) 7%, transparent), transparent 60%); }
.ret.kp > .i { color: var(--keep); }
.ret .bar { height: 3px; max-width: 260px; margin-top: 7px; border-radius: 2px; background: var(--bg4); overflow: hidden; }
.ret .bar i { display: block; height: 100%; background: var(--acc); }

.acts2 { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; align-items: center; }
.pb .acts2 .btn:not(.icon) { padding: 0 11px; }

/* Metadaten-Raster (Rahmen über negative Ränder, beliebige Zellenzahl) */
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; border: 1px solid var(--ln); border-radius: 10px; overflow: hidden; background: var(--bg1); }
.meta > div { min-width: 0; padding: 9px 12px; border-right: 1px solid var(--ln); border-bottom: 1px solid var(--ln); margin: 0 -1px -1px 0; }
.lab { display: block; margin-bottom: 3px; font: 500 10.5px var(--f); text-transform: uppercase; letter-spacing: .08em; color: var(--tx3); }
/* wie im Entwurf: gilt auch für die .lab-Beschriftung darin (Mono, gleiche Größe) */
.meta span { display: block; font: 500 12.5px var(--m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ocrp { margin-top: 14px; padding: 11px 14px; border: 1px solid var(--ln); border-radius: 10px; background: var(--bg1); }
.ocrp p { font: 12.5px/1.6 var(--m); color: var(--tx2); white-space: pre-wrap; overflow-wrap: anywhere; }


/* --------------------------------------------------------------------------
   10 · Dialog (.veil > .modal) — unter 900 px als Blatt von unten (Abschnitt 18)
   -------------------------------------------------------------------------- */

.veil {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto;
  display: grid; place-items: center; padding: 24px;
  background: var(--veil); -webkit-backdrop-filter: blur(3px) saturate(.7); backdrop-filter: blur(3px) saturate(.7);
  animation: v-fade .14s ease-out;
}
.modal { width: 548px; max-width: 100%; background: var(--bg2); border: 1px solid var(--ln2); border-radius: 14px; box-shadow: var(--sh-modal); overflow: hidden; animation: v-pop .16s ease-out; }
.mhd { display: flex; align-items: center; gap: 14px; padding: 18px; border-bottom: 1px solid var(--ln); background: var(--bg1); }
.mhd > div:not(.th) { min-width: 0; }
.mhd .th { width: 144px; height: 81px; border-radius: 7px; }
.mbd { padding: 20px 18px 18px; }
.mbd h3 { font-size: 18px; }
.mbd > p { max-width: 470px; margin: 6px 0 16px; color: var(--tx2); }
.opt { display: grid; grid-template-columns: 38px 1fr auto; gap: 13px; align-items: center; width: 100%; padding: 14px; border: 1px solid var(--ln2); border-radius: 10px; background: var(--bg1); color: var(--tx); text-align: left; cursor: pointer; }
.opt + .opt { margin-top: 10px; }
.opt:hover { border-color: var(--ln3); background: var(--bg3); }
.oi { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; }
.oi .i { width: 18px; height: 18px; }
/* „Behalten" ist vorausgewählt (Ring wie Fokus) */
.opt.k { border-color: color-mix(in srgb, var(--keep) 60%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--keep) 10%, transparent), transparent 70%); outline: 2px solid color-mix(in srgb, var(--keep) 32%, transparent); outline-offset: 2px; }
.opt.k .oi { background: var(--keeps); color: var(--keep); }
.opt.d .oi { background: var(--accs); color: var(--acci); }
.opt b { display: block; font-size: 14px; }
.opt span { font-size: 12px; color: var(--tx2); }
.mft { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--ln); font-size: 11.5px; color: var(--tx3); }


/* --------------------------------------------------------------------------
   11 · Schnitt (.mini, .ed …) — trim.css ergänzt
   -------------------------------------------------------------------------- */

.mini { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 0; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; background: var(--bg1); border-right: 1px solid var(--ln); }
.mini::-webkit-scrollbar { display: none; }
.mini .th { width: 56px; height: 32px; border-radius: 4px; opacity: .55; cursor: pointer; }
.mini .th:hover { opacity: .85; }
.mini .th.sel { opacity: 1; box-shadow: 0 0 0 2px var(--acci); }
.mini .th.doc .i { width: 14px; height: 14px; }
.mini .th.doc span { display: none; }

.ed { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; background: var(--bg2); }
.ed > .ph { padding-left: 16px; }
.edm { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; padding: 16px 20px 0; }
.insp { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.card { min-width: 0; background: var(--bg1); border: 1px solid var(--ln); border-radius: 10px; }
.ch { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--ln); font: 600 12px var(--f); }
.ch .mono { margin-left: auto; font-weight: 400; font-size: 11px; color: var(--tx3); }
.card .ch { font-size: 13px; padding: 11px 14px; }
.card .ch .i { color: var(--tx2); }
.cb { padding: 10px 12px; }
.tf { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto; gap: 5px; align-items: center; }
.tf + .tf { margin-top: 7px; }
.tf label { font-size: 12px; color: var(--tx2); }
.tf kbd { margin-left: 2px; }
.nud { height: 30px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--ln2); background: var(--bg3); font: 500 11px var(--m); color: var(--tx2); white-space: nowrap; cursor: pointer; }
.nud:hover:not(:disabled) { background: var(--bg4); color: var(--tx); }
.nud:disabled { opacity: .4; }
.len { display: flex; justify-content: space-between; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--ln2); font: 12px var(--m); color: var(--tx3); }
.len b { color: var(--tx); font-weight: 500; }

/* Teile-Liste: .prt.a aktiv, .prt.r entfernt */
.prt { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--ln); font: 12px var(--m); color: var(--tx2); cursor: pointer; }
.prt:last-child { border: 0; }
.prt > i { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid var(--tx3); }
.prt.a { background: var(--accs); color: var(--tx); }
.prt.a > i { border-color: var(--acc); background: var(--acc); }
.prt.r { color: var(--tx3); }
.prt.r .tm { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 70%, transparent); }
.prt.r > i { border-color: var(--red); background: repeating-linear-gradient(135deg, var(--red) 0 1.5px, transparent 1.5px 3.5px); }
.prt :is(a, button) { display: inline-flex; align-items: center; gap: 4px; font: 500 11.5px var(--f); color: var(--acci); cursor: pointer; }
.keys { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 7px 8px; align-items: center; font-size: 11.5px; color: var(--tx2); }
.keys kbd { justify-self: start; }

.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 14px 20px 10px; }
.tc { margin: 0 6px; font: 500 15px var(--m); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc span { color: var(--tx3); }
.vsep { width: 1px; height: 20px; margin: 0 6px; background: var(--ln2); flex: none; }

/* Zeitleiste: .ruler (span = beschriftete Marke, i = kleine Marke, beide mit left:%) ·
   .track (.film + .part + .hd) · .plab · .phd (Abspielkopf über Lineal und Spur) */
.tl { position: relative; margin: 0 20px; padding-bottom: 4px; -webkit-user-select: none; user-select: none; }
.ruler { position: relative; height: 20px; }
.ruler span { position: absolute; bottom: 0; height: 12px; padding-left: 4px; border-left: 1px solid var(--tick2); font: 10px/1 var(--m); color: var(--tx3); white-space: nowrap; }
.ruler i { position: absolute; bottom: 0; width: 1px; height: 5px; background: var(--tick); }
.track { position: relative; height: 84px; margin-top: 3px; border-radius: 6px; background: #000; }
.film { position: absolute; inset: 0; display: flex; gap: 1px; border-radius: 6px; overflow: hidden; }
.film > * { display: block; flex: 1; min-width: 0; height: 100%; background-color: #111; background-repeat: no-repeat; }
.film > img { object-fit: cover; }
.part { position: absolute; top: 0; bottom: 0; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.part.rm { background: repeating-linear-gradient(135deg, rgba(12, 13, 15, .88) 0 7px, rgba(12, 13, 15, .7) 7px 14px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 55%, transparent); }
.part.rm span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; gap: 7px; align-items: center; white-space: nowrap; font: 500 11.5px var(--m); color: color-mix(in srgb, var(--red) 55%, #fff); }
.part.rm .rmv { flex-direction: column; align-items: flex-start; gap: 8px; }
.part.rm .rmv > em { display: flex; gap: 7px; align-items: center; font-style: normal; }
.part.act { background: color-mix(in srgb, var(--acc) 8%, transparent); box-shadow: inset 0 0 0 2px var(--acc), 0 0 30px color-mix(in srgb, var(--acc) 28%, transparent); }
.rst { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px; background: rgba(20, 23, 26, .92); border: 1px solid color-mix(in srgb, var(--red) 50%, transparent); color: color-mix(in srgb, var(--red) 25%, #fff); font: 500 11.5px var(--f); cursor: pointer; }
.rst .i { width: 13px; height: 13px; }
.rst kbd { padding: 2px 4px; font-size: 10px; }
.hd { position: absolute; top: -5px; bottom: -5px; z-index: 3; width: 13px; border-radius: 4px; background: var(--acc); display: grid; place-items: center; cursor: ew-resize; touch-action: none; box-shadow: 0 2px 10px rgba(0, 0, 0, .55); }
.hd.l { left: -6px; }
.hd.r { right: -6px; }
.hd::after { content: ""; width: 3px; height: 20px; border-left: 1px solid rgba(0, 0, 0, .5); border-right: 1px solid rgba(0, 0, 0, .5); }
.phd { position: absolute; top: 0; bottom: 34px; z-index: 5; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; }
.phd::before { content: attr(data-t); position: absolute; top: -1px; left: 50%; transform: translateX(-50%); padding: 4px 6px; border-radius: 4px; background: #fff; color: #111; font: 600 10.5px/1 var(--m); white-space: nowrap; }
.phd[data-t=""]::before, .phd:not([data-t])::before { display: none; }
.plab { position: relative; height: 22px; margin-top: 8px; font: 11px var(--m); color: var(--tx3); }
.plab span { position: absolute; top: 0; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.plab .a { color: var(--acci); }
.plab .x { color: var(--redl); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 60%, transparent); }

.srcl { display: flex; align-items: center; gap: 8px; margin-top: 12px; min-width: 0; overflow: hidden; white-space: nowrap; font: 11.5px var(--m); color: var(--tx3); }
.srcl b { font: 500 11.5px var(--f); color: var(--tx2); }
.srcl i { font-style: normal; color: var(--tx4); }
.kchip { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 22px; padding: 0 8px; border-radius: 5px; color: var(--keep); background: var(--keeps); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--keep) 30%, transparent); font: 500 11.5px var(--f); }
.kchip .i { width: 13px; height: 13px; }

.save { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: auto; padding: 12px 20px; border-top: 1px solid var(--ln); background: var(--bg1); }
.grp { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx3); white-space: nowrap; }
.res { font: 11.5px/1.35 var(--m); color: var(--tx3); white-space: nowrap; }
.res b { display: block; font: 500 14px var(--m); color: var(--tx); }
.warnt { display: flex; align-items: center; gap: 7px; max-width: 200px; font-size: 12px; line-height: 1.35; color: var(--accl); }
.warnt .i { flex: none; }


/* --------------------------------------------------------------------------
   12 · Einzelseiten (Einstellungen, Anleitung) im Gerüst .app.one
   -------------------------------------------------------------------------- */

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg1); }
.mh1 { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 24px; border-bottom: 1px solid var(--ln); flex: none; min-width: 0; }
.mh1 h1 { font-size: 15px; white-space: nowrap; }
.mh1 > span:not(.sp) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbody { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px 24px 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-content: start; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.colh { display: flex; align-items: center; gap: 8px; height: 18px; padding: 0 2px; font: 600 10.5px var(--f); letter-spacing: .09em; text-transform: uppercase; color: var(--tx3); }
.colh .i { width: 14px; height: 14px; }
.cd { padding: 12px 14px; color: var(--tx2); font-size: 12.5px; }
.fr { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--ln); }
.fr .ft { flex: 1; min-width: 0; }
.fr .ft b { display: block; font-weight: 500; color: var(--tx); font-size: 13px; }
.fr .ft span { font-size: 11.5px; color: var(--tx3); }
.ff { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: end; padding: 12px 14px; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld label { font-size: 11.5px; color: var(--tx2); }

/* Benutzerliste */
.urow { display: grid; grid-template-columns: 28px minmax(0, 1fr) 86px 200px; gap: 12px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--ln); }
.urow .st2 { justify-self: start; }
.urow .ua { justify-content: flex-end; }
.urow .un { min-width: 0; }
.urow .un b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow .un span { display: block; font: 11px var(--m); color: var(--tx3); }
.urow.pend { background: linear-gradient(90deg, var(--accs), transparent 75%); }
.st2 { padding: 2px 7px; border-radius: 5px; border: 1px solid var(--ln2); font: 500 11px var(--m); color: var(--tx2); white-space: nowrap; }
.st2.a { color: var(--keep); border-color: color-mix(in srgb, var(--keep) 38%, transparent); }
.st2.p { color: var(--acci); border-color: color-mix(in srgb, var(--acc) 50%, transparent); }
.st2.s { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.ua { display: flex; flex-wrap: wrap; gap: 4px; }

/* Darstellung: Grundton-Karten und Akzent-Farbfelder */
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 14px 4px; }
.thm { display: block; width: 100%; padding: 6px; border: 1px solid var(--ln2); border-radius: 9px; background: var(--bg0); color: var(--tx); text-align: left; cursor: pointer; }
.thm:hover { border-color: var(--ln3); }
.thm.on { border-color: var(--acci); box-shadow: 0 0 0 3px var(--accs); }
.pv { height: 58px; border-radius: 5px; display: grid; grid-template-columns: 18% 34% 1fr; gap: 2px; padding: 2px; overflow: hidden; }
.pv i { display: block; border-radius: 2px; }
.thm .tn { display: flex; justify-content: space-between; align-items: center; padding: 7px 3px 1px; font-size: 12px; }
.thm .tn .i { width: 14px; height: 14px; color: var(--acci); }
.sws { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding: 10px 14px 14px; font-size: 12px; color: var(--tx2); }
.swt { width: 24px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 7px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); cursor: pointer; }
.swt.on { outline: 2px solid var(--tx); outline-offset: 2px; }

/* Ablauf-Grafik (Automatisches Löschen) */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 14px 14px; font: 11.5px var(--m); color: var(--tx2); }
.flow span { padding: 5px 8px; border: 1px solid var(--ln2); border-radius: 6px; background: var(--bg0); white-space: nowrap; }
.flow .k { color: var(--keep); border-color: color-mix(in srgb, var(--keep) 40%, transparent); }
.flow .x { color: var(--acci); border-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.flow i { flex: 1; min-width: 10px; height: 1px; background: var(--ln2); }

/* Anleitung */
.steps { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 52px minmax(0, 1fr) 440px; gap: 20px; align-items: center; padding: 16px 18px; background: var(--bg2); border: 1px solid var(--ln); border-radius: 12px; }
.step .no { font: 600 22px var(--m); letter-spacing: -.04em; color: var(--acci); }
.step h3 { font-size: 15px; }
.step p { max-width: 540px; margin-top: 4px; color: var(--tx2); }
.snipb { min-width: 0; padding: 9px 12px; background: var(--bg0); border: 1px solid var(--ln); border-radius: 8px; font: 12px/1.75 var(--m); color: var(--tx2); overflow-wrap: anywhere; }
.snipb b { color: var(--tx); font-weight: 500; }
.snipb em { font-style: normal; color: var(--acci); }
.snipb .g { color: var(--keep); }


/* --------------------------------------------------------------------------
   13 · Geteilter Link (.share)
   -------------------------------------------------------------------------- */

.share { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: radial-gradient(1100px 520px at 50% -8%, color-mix(in srgb, var(--bg3) 70%, var(--bg2)), var(--bg0) 70%); }
.shh { display: flex; align-items: center; gap: 9px; height: 56px; padding: 0 28px; border-bottom: 1px solid var(--ln); flex: none; }
.shh b { font-size: 15px; letter-spacing: -.03em; }
/* Breite so begrenzt, dass das 16:9-Medium samt Titel ins Fenster passt */
.shm { width: min(1100px, calc(100% - 56px), calc((100vh - 230px) * 16 / 9)); min-width: min(560px, calc(100% - 56px)); margin: 28px auto 40px; }
/* Leuchten in der Spielfarbe, falls die Seite --c setzt, sonst Akzent */
.media.big { box-shadow: 0 0 0 1px var(--ln2), 0 40px 140px -30px color-mix(in srgb, var(--c, var(--acc)) 28%, transparent); }
.media.big .vc { padding: 96px 16px 14px; gap: 12px; font-size: 12.5px; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .7) 55%, rgba(0, 0, 0, .92)); }
.media.big .vc .pl { width: 40px; height: 40px; }
.media.big .vc .i { width: 17px; height: 17px; }
.shi { display: flex; align-items: flex-end; gap: 24px; margin-top: 20px; }
.shi > div:first-child { flex: 1; min-width: 0; }
.shi h2 { font-size: 21px; overflow-wrap: anywhere; }
.shi .acts2 { margin: 0; flex: none; }


/* --------------------------------------------------------------------------
   14 · Anmelden, Einrichtung, Meldungen
   -------------------------------------------------------------------------- */

.auth { display: grid; grid-template-columns: minmax(0, 1fr) 520px; min-height: 100vh; min-height: 100dvh; }
.wall { position: relative; overflow: hidden; background: var(--bg0); }
/* Kontaktabzug: nur generierte Flächen (pages.css), keine echten Vorschaubilder */
.sheet { position: absolute; inset: -140px -60px -60px -120px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-content: start; transform: rotate(-7deg); }
.sheet > div { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--ring); }
.sheet svg { display: block; width: 100%; height: 100%; }
.sheet span { position: absolute; right: 5px; bottom: 5px; padding: 1px 4px; border-radius: 3px; background: rgba(0, 0, 0, .7); color: #fff; font: 500 10px var(--m); }
.sheet .k::after { content: ""; position: absolute; inset: 0; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--acc); }
.wall::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--bg0) 25%, transparent), color-mix(in srgb, var(--bg0) 60%, transparent) 70%, var(--bg2)), linear-gradient(0deg, color-mix(in srgb, var(--bg0) 97%, transparent) 12%, color-mix(in srgb, var(--bg0) 62%, transparent) 40%, transparent 66%); }
.wm { position: absolute; z-index: 2; left: 56px; right: 56px; bottom: 52px; }
.wm .brand { padding: 0; margin-bottom: 18px; }
.wm h2 { max-width: 560px; font-size: 40px; line-height: 1.08; letter-spacing: -.035em; }
.wm p { max-width: 460px; margin-top: 12px; color: var(--tx2); font-size: 14px; }
.wm .fx { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font: 12px var(--m); color: var(--tx3); }
.wm .fx span { display: flex; gap: 7px; align-items: center; }
.wm .fx .i { width: 14px; height: 14px; color: var(--acci); }
.form { display: flex; flex-direction: column; justify-content: center; padding: 40px 72px; background: var(--bg2); border-left: 1px solid var(--ln); }
.form h1 { font-size: 26px; letter-spacing: -.03em; }
.form > p { margin: 6px 0 26px; color: var(--tx2); }
.form .fld + .fld { margin-top: 14px; }
.form .in2 { height: 42px; font-size: 14px; border-radius: 9px; }
.form .fld + .btn { margin-top: 22px; }
.alt { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ln); font-size: 12.5px; color: var(--tx2); }
.alt a { color: var(--acci); font-weight: 500; }
.alt a:hover { text-decoration: underline; }

/* Einfache Seiten: .pgf = zentrierter Rahmen über die ganze Höhe, .pgc = Formularspalte */
.pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.pg h4 { margin-bottom: 8px; font: 600 12px var(--f); color: var(--tx3); }
.pgf { position: relative; display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 32px 16px; background: radial-gradient(500px 240px at 50% 0, color-mix(in srgb, var(--bg3) 40%, var(--bg2)), var(--bg0)); }
.pgc { width: min(330px, 100%); text-align: left; }
.pgc h3 { font-size: 18px; }
.pgc > p { margin: 4px 0 14px; color: var(--tx2); font-size: 12.5px; }
.pgc .fld + .fld { margin-top: 9px; }
.pgc .btn { margin-top: 14px; }
.note { display: flex; gap: 8px; margin-top: 12px; padding: 9px 10px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--ln); font-size: 11.5px; color: var(--tx2); }
.note .i { width: 14px; height: 14px; margin-top: 1px; color: var(--acci); }
.note.err { border-color: color-mix(in srgb, var(--red) 45%, transparent); background: var(--reds); color: var(--tx); }
.note.err .i { color: var(--red); }
.msg { width: min(330px, 100%); text-align: center; }
.msg .big { font: 600 56px/1 var(--m); letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1px var(--tick2); }
.msg .ic { width: 56px; height: 56px; margin: 0 auto; border-radius: 14px; display: grid; place-items: center; background: var(--reds); color: var(--red); }
.msg .ic.info { background: var(--bg3); color: var(--tx2); }
.msg .ic.ok { background: var(--keeps); color: var(--keep); }
.msg .ic .i { width: 24px; height: 24px; }
.msg h3 { margin-top: 16px; font-size: 18px; }
.msg p { margin: 6px 0 16px; color: var(--tx2); font-size: 12.5px; }

/* Leere Galerie */
.drop { width: min(360px, 100%); min-height: 250px; margin: 0 auto; padding: 20px; border: 1.5px dashed var(--ln3); border-radius: 14px; display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; }
.list > .drop { margin: 40px auto; width: min(360px, calc(100% - 28px)); }
.drop .ic { width: 46px; height: 46px; margin: 0 auto 6px; border-radius: 12px; display: grid; place-items: center; background: var(--bg3); color: var(--tx2); }
.drop h3 { font-size: 16px; }
.drop p { max-width: 280px; color: var(--tx2); font-size: 12.5px; }
.drop .btn { margin-top: 10px; }


/* --------------------------------------------------------------------------
   15 · Allgemeine Bausteine (nicht im Entwurf)
   -------------------------------------------------------------------------- */

/* Ablegen über dem Fenster */
.dragov {
  position: fixed; inset: 14px; z-index: 60; pointer-events: none;
  display: grid; place-items: center; align-content: center; gap: 6px; text-align: center;
  border: 2px dashed var(--acc); border-radius: 12px;
  background: linear-gradient(color-mix(in srgb, var(--acc) 8%, transparent), color-mix(in srgb, var(--acc) 8%, transparent)), color-mix(in srgb, var(--bg1) 78%, transparent);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  animation: v-fade .12s ease-out;
}
.dragov .ic { width: 50px; height: 50px; margin: 0 auto 6px; border-radius: 13px; display: grid; place-items: center; background: var(--acc); color: var(--acct); }
.dragov b { font-size: 16px; }
.dragov span { font: 12px var(--m); color: var(--accl); }

/* Rückmeldung (V.toast): <div class="toast" role="status" data-kind="|error|ok"> */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + max(var(--tabh), env(safe-area-inset-bottom, 0px))); z-index: 70;
  transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 9px; padding: 9px 14px;
  background: var(--bg3); border: 1px solid var(--ln2); border-radius: 9px; box-shadow: var(--sh-pop);
  font: 500 13px var(--f); color: var(--tx); pointer-events: none;
  animation: v-toast .18s ease-out;
}
.toast[data-kind="error"] { border-color: color-mix(in srgb, var(--red) 55%, var(--ln2)); background: color-mix(in srgb, var(--red) 14%, var(--bg3)); }
.toast[data-kind="error"]::before, .toast[data-kind="ok"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--red); }
.toast[data-kind="ok"]::before { background: var(--keep); }

/* Aufklappliste (Sortierung, Gruppierung): .menu-anchor > button + .menu > .menu-item(.on) */
.menu-anchor { position: relative; display: inline-flex; }
.menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 40;
  display: flex; flex-direction: column; gap: 1px; min-width: 200px; max-height: min(420px, 70vh); overflow: auto;
  padding: 4px; background: var(--bg3); border: 1px solid var(--ln2); border-radius: 9px; box-shadow: var(--sh-pop);
  animation: v-pop .12s ease-out;
}
.menu.r { left: auto; right: 0; }
.menu .lab { margin: 0; padding: 8px 9px 4px; }
.menu-sep { height: 1px; margin: 4px 2px; background: var(--ln2); }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; height: 30px; padding: 0 9px; border-radius: 6px; font: 500 12.5px var(--f); color: var(--tx2); text-align: left; white-space: nowrap; cursor: pointer; }
.menu-item .i { color: var(--tx3); }
.menu-item:hover { background: var(--bg4); color: var(--tx); }
.menu-item:focus-visible { background: var(--bg4); color: var(--tx); outline-offset: -2px; }
.menu-item em { margin-left: auto; font: 500 11px var(--m); font-style: normal; color: var(--tx3); }
.menu-item.on, .menu-item[aria-checked="true"] { color: var(--tx); }
/* Häkchen ohne zusätzliches Markup */
.menu-item.on::after, .menu-item[aria-checked="true"]::after {
  content: ""; width: 16px; height: 16px; margin-left: auto; flex: none; background: var(--acci);
  -webkit-mask: var(--v-check) center / 16px no-repeat; mask: var(--v-check) center / 16px no-repeat;
}
.menu-item:has(em)::after { margin-left: 8px; }

/* Umbenennen an Ort und Stelle: <input class="rename-input"> statt h2 bzw. .t */
.rename-input { display: block; width: 100%; min-width: 0; height: 28px; padding: 0 7px; background: var(--bg0); border: 1px solid var(--acci); border-radius: 6px; box-shadow: 0 0 0 3px var(--accs); font: inherit; color: var(--tx); outline: 0; }
/* Text bleibt beim Umschalten an derselben Stelle (Innenabstand + Rahmen ausgleichen) */
.ttl .rename-input { flex: 1; height: 32px; margin-left: -9px; padding: 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
:is(.t, .row, .prow) .rename-input { height: 24px; padding: 0 6px; font-size: 13px; font-weight: 600; }

/* Kürzel-Übersicht (?): eigenständig fixiert oder innerhalb von .veil.
   Aufbau: .kh (h3 + Schließen) · .kg (Gruppen: section > h4 + dl > dt kbd + dd) */
.kbd-overlay {
  position: fixed; left: 50%; top: 50%; z-index: 55; transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto;
  background: var(--bg2); border: 1px solid var(--ln2); border-radius: 14px; box-shadow: var(--sh-modal);
  animation: v-fade .14s ease-out;
}
.veil > .kbd-overlay { position: relative; left: auto; top: auto; transform: none; }
.kbd-overlay .kh { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--ln); background: var(--bg1); }
.kbd-overlay .kh h3 { flex: 1; font-size: 15px; }
.kbd-overlay .kg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; padding: 16px 18px 18px; }
.kbd-overlay h4 { margin-bottom: 8px; font: 600 10.5px var(--f); letter-spacing: .09em; text-transform: uppercase; color: var(--tx3); }
.kbd-overlay dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; align-items: center; font-size: 12.5px; color: var(--tx2); }
.kbd-overlay dt { display: flex; gap: 3px; justify-self: start; }
.kbd-overlay .keys { padding: 16px 18px 18px; font-size: 12.5px; }


/* --------------------------------------------------------------------------
   16 · Handy-Bausteine (Mockup-Abschnitt „Handy", funktionieren im echten Viewport)
   -------------------------------------------------------------------------- */

.phd1 { display: flex; align-items: center; gap: 8px; padding: 6px 16px 10px; flex: none; }
.phd1 .brand { margin: 0; padding: 0; }
.pbtn { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--bg3); border: 1px solid var(--ln2); color: var(--tx); cursor: pointer; }
.pbtn.pri { background: var(--acc); border-color: var(--acc); color: var(--acct); }
.pbtn.ghost { background: none; border-color: transparent; }
.pbtn .i { width: 19px; height: 19px; }
.psr { display: flex; align-items: center; gap: 9px; height: 42px; margin: 0 16px; padding: 0 12px; flex: none; border-radius: 11px; background: var(--bg0); border: 1px solid var(--ln2); color: var(--tx3); font-size: 14px; }
.psr:focus-within { border-color: var(--acci); box-shadow: 0 0 0 3px var(--accs); color: var(--tx); }
.psr input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font: inherit; color: var(--tx); }
.pctl { display: flex; gap: 8px; padding: 10px 16px; flex: none; }
.pctl .btn { height: 36px; border-radius: 9px; font-size: 13px; }
.pup { margin: 0 16px 8px; padding: 9px 11px; flex: none; border-radius: 10px; border: 1px solid var(--ln); background: var(--bg0); }
.plist { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }

.prow { display: grid; grid-template-columns: 116px minmax(0, 1fr) 36px; gap: 12px; align-items: center; padding: 10px 6px 10px 16px; border-bottom: 1px solid var(--ln0); cursor: pointer; }
.prow:active { background: var(--hov); }
.prow:focus-visible { outline: 2px solid var(--acci); outline-offset: -2px; }
.prow .th { width: 116px; height: 65px; border-radius: 7px; }
.prow .t { font-size: 13.5px; line-height: 1.3; }
.prow .r2 { margin-top: 2px; font: 11.5px var(--m); color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .m { margin-top: 3px; }
.prow .chip { margin-top: 6px; }
.prow .mb { width: 36px; height: 44px; display: grid; place-items: center; border-radius: 8px; color: var(--tx2); }
.kpi { display: inline-flex; vertical-align: -2px; margin-right: 6px; color: var(--keep); }
.kpi .i { width: 12px; height: 12px; fill: color-mix(in srgb, var(--keep) 20%, transparent); }

/* Untere Navigation — nur < 900 px sichtbar (Abschnitt 18) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  height: calc(60px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg0); border-top: 1px solid var(--ln);
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; font-size: 11px; color: var(--tx3); cursor: pointer; }
.tab.on, .tab[aria-current="page"] { color: var(--acci); }
.tab .i { width: 22px; height: 22px; }
.tab em { position: absolute; top: 6px; left: 56%; padding: 2px 4px; border-radius: 6px; background: var(--acc); color: var(--acct); font: 600 10px/1 var(--m); font-style: normal; }
.tab:focus-visible { outline-offset: -4px; }

/* Ansicht */
.pnav { display: flex; align-items: center; gap: 2px; height: 46px; padding: 0 8px; flex: none; }
.pnav .btn { height: 40px; }
.pnav b { font-size: 15px; font-weight: 600; }
.pmedia { position: relative; flex: none; aspect-ratio: 16 / 9; max-height: 56vh; overflow: hidden; background: #000; }
.pmedia > :is(img, video) { display: block; width: 100%; height: 100%; object-fit: contain; }
.pmedia > svg:not(.i) { display: block; width: 100%; height: 100%; }
.pmedia .vc { padding: 24px 12px 8px; }
.pbd { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.pbd .ttl { margin-top: 0; }
.pbd .ttl h2 { font-size: 17px; white-space: normal; overflow-wrap: anywhere; }
.pbd .ret { flex-wrap: wrap; padding: 12px; }
.pbd .ret .seg { display: flex; width: 100%; }
.pbd .ret .seg > :is(b, button) { flex: 1; justify-content: center; height: 38px; font-size: 13.5px; }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pgrid .btn { height: 48px; padding: 0 6px; flex-direction: column; gap: 3px; border-radius: 10px; font-size: 11.5px; line-height: 1.15; white-space: normal; }
.pgrid .btn .i { width: 18px; height: 18px; }
.pmeta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; border: 1px solid var(--ln); border-radius: 10px; overflow: hidden; }
.pmeta > div { min-width: 0; padding: 8px 12px; border-right: 1px solid var(--ln); border-bottom: 1px solid var(--ln); margin: 0 -1px -1px 0; }
/* wie im Entwurf: gilt auch für .lab darin */
.pmeta span { font: 500 12.5px var(--m); }
.pmeta span:not(.lab) { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Schnitt auf dem Handy */
.ptl { padding: 0 16px; }
.ptl .tl { margin: 0; }
.ptl .track { height: 64px; }
.ptl .hd { width: 22px; top: -6px; bottom: -6px; }
.ptl .hd.l { left: -11px; }
.ptl .hd.r { right: -11px; }
.ptl .phd { bottom: 0; }
.ptools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px 16px 0; }
.ptools .btn { height: 58px; padding: 0 4px; flex-direction: column; gap: 4px; border-radius: 11px; font-size: 11.5px; line-height: 1.15; white-space: normal; }
.ptools .btn .i { width: 20px; height: 20px; }
.pnud { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px 16px 0; }
.pnud > div { min-width: 0; padding: 8px 9px; border: 1px solid var(--ln); border-radius: 10px; background: var(--bg0); }
.pnud .r { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.pnud .r .mono { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; }
.pnud .nud { height: 34px; padding: 0 7px; flex: none; }
.psave { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.psave .seg { display: flex; width: 100%; }
.psave .seg > :is(b, button) { flex: 1; justify-content: center; height: 34px; }
.psave .warnt { max-width: none; }

/* Blätter von unten (Aktionen ⋯, Filtern & sortieren, Aufbewahrung):
   .sheet-veil (oder .pdim) + .psheet, beide fixiert */
.pdim, .sheet-veil { position: fixed; inset: 0; z-index: 45; background: var(--veil); animation: v-fade .16s ease-out; }
.psheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
  max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 16px calc(30px + env(safe-area-inset-bottom, 0px));
  background: var(--bg2); border-top: 1px solid var(--ln2); border-radius: 22px 22px 0 0; box-shadow: var(--sh-sheet);
  animation: v-up .22s cubic-bezier(.2, .8, .2, 1);
}
.grab { display: block; width: 38px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--tick); }
.shd { display: flex; align-items: center; gap: 8px; height: 36px; margin-bottom: 6px; }
.shd b { font-size: 16px; font-weight: 600; }
.psheet .lab { margin: 12px 0 7px; }
.psheet h3 { font-size: 19px; }
.psheet > p { margin: 6px 0 14px; font-size: 13.5px; color: var(--tx2); }
.psheet .seg.full > :is(b, button) { height: 36px; font-size: 13px; }
.psheet .opt { grid-template-columns: 38px 1fr; padding: 13px 12px; }
.psheet .opt b { font-size: 14.5px; }
.psheet .opt kbd { display: none; }
.psheet .mft { padding: 12px 2px 0; border: 0; }

.pst4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ln); border-radius: 10px; overflow: hidden; background: var(--bg1); }
.pst4 > div { min-width: 0; padding: 7px 9px; border-right: 1px solid var(--ln); }
.pst4 > div:last-child { border-right: 0; }
.pst4 b { display: block; font: 500 13.5px var(--m); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst4 span { font-size: 10.5px; color: var(--tx3); white-space: nowrap; }
.pst4 .w b { color: var(--acci); }
.ptype { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ptype > :is(b, button) { display: flex; align-items: center; gap: 8px; min-width: 0; height: 40px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--ln2); background: var(--bg1); font: 500 13.5px var(--f); color: var(--tx2); text-align: left; cursor: pointer; }
.ptype em { margin-left: auto; font: 500 11.5px var(--m); font-style: normal; color: var(--tx3); }
.ptype > .on { border-color: var(--acci); background: var(--accs); color: var(--tx); }
.ptype > .on em { color: var(--acci); }
/* Sammlungen: waagerecht wischbar, rechts ausgeblendet */
.pchips { display: flex; gap: 6px; margin-right: -16px; padding-right: 16px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.pchips::-webkit-scrollbar { display: none; }
.pchips .i { width: 14px; height: 14px; }
.pchips .dot { margin: 0; }
.pchips > :is(b, button) { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--ln2); background: var(--bg1); font: 500 13px var(--f); color: var(--tx2); white-space: nowrap; cursor: pointer; }
.pchips em { font: 500 11px var(--m); font-style: normal; color: var(--tx3); }
.pchips > .w, .pchips > .w em { color: var(--acci); }
.pchips > .w { border-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.pchips > .on { border-color: var(--acci); background: var(--accs); color: var(--tx); }
.psort { border: 1px solid var(--ln); border-radius: 10px; overflow: hidden; background: var(--bg1); }
.psort > :is(b, button) { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border-bottom: 1px solid var(--ln); font: 500 13.5px var(--f); color: var(--tx2); text-align: left; cursor: pointer; }
.psort > :last-child { border-bottom: 0; }
.psort .i { width: 16px; height: 16px; margin-left: auto; color: var(--acci); }
.psort > .on { color: var(--tx); }

/* Aktionsblatt (⋯) */
.ash { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; padding: 2px 0 14px; border-bottom: 1px solid var(--ln); }
.ash .th { width: 96px; height: 54px; }
.arow { display: flex; align-items: center; gap: 13px; width: 100%; height: 52px; border-bottom: 1px solid var(--ln); font: 500 14.5px var(--f); color: var(--tx); text-align: left; cursor: pointer; }
.arow > .i { width: 20px; height: 20px; color: var(--tx2); }
.arow small { display: block; margin-top: 1px; font: 11.5px var(--m); color: var(--acci); }
.arow small.k { color: var(--keep); }
.arow .sw { --k: 22px; width: 44px; height: 26px; margin-left: auto; border-radius: 13px; }
.arow kbd { margin-left: auto; }
.arow.del { color: var(--red); border-bottom: 0; }
.arow.del > .i { color: var(--red); }
.dconf { margin-top: 6px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); background: var(--reds); }
.dconf p { margin: 2px 0 10px; font-size: 13px; color: var(--tx2); }
.dconf p b { color: var(--tx); font-weight: 600; }
.dconf > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dconf .btn { height: 44px; border-radius: 10px; font-size: 14px; }


/* --------------------------------------------------------------------------
   17 · Feinabstimmung Grundton „hell"
   -------------------------------------------------------------------------- */

:root[data-base="hell"] mark { color: var(--tx); }
:root[data-base="hell"] .phd { box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
:root[data-base="hell"] .phd::before { background: var(--tx); color: var(--bg2); }
:root[data-base="hell"] .btn.pri { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 1px rgba(16, 24, 40, .12); }
:root[data-base="hell"] .swt { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
:root[data-base="hell"] .sw::after { box-shadow: 0 1px 2px rgba(16, 24, 40, .3); }


/* --------------------------------------------------------------------------
   18 · Breakpoints
   -------------------------------------------------------------------------- */

/* Desktop/Tablet: Handy-Elemente aus */
@media (min-width: 900px) {
  .mob { display: none !important; }
  .tabbar, .phd1, .psr, .pctl, .pnav, .pup { display: none; }
  .psheet { left: 50%; right: auto; bottom: 24px; width: 440px; margin-left: -220px; max-height: calc(100dvh - 48px); border: 1px solid var(--ln2); border-radius: 16px; padding-bottom: 20px; animation: v-pop .16s ease-out; }
  .psheet .grab { display: none; }
}

/* 900–1279 px: schmale Icon-Leiste (Beschriftungen per title), Liste 400 px */
@media (max-width: 1279px) {
  .app { grid-template-columns: 64px 400px minmax(0, 1fr); }
  .app.cut { grid-template-columns: 64px 76px minmax(0, 1fr); }
  .app.one { grid-template-columns: 64px minmax(0, 1fr); }
  .rail { padding: 12px 8px 10px; }
  .rail .brand { justify-content: center; padding: 0; }
  .rail .brand b, .rail .rs, .rail .stats, .rail .ri > span, .rail .ri > em,
  .rail .jobs .rs, .rail .jt span, .rail .jm, .rail .acct > div, .rail .btn.wide kbd { display: none; }
  /* Text im Upload-Knopf ist ein loser Textknoten → über Schriftgröße 0 ausblenden */
  .rail .btn.wide { align-self: center; width: 40px; height: 36px; padding: 0; gap: 0; font-size: 0; }
  .rail .ri { width: 40px; height: 36px; margin: 0 auto; padding: 0; justify-content: center; }
  .rail .ri.on::before { left: -12px; }
  .rail .ri .dot { margin: 0; }
  .rail .ri.warn > em, .rail .ri.pend > em {
    display: block; position: absolute; top: 2px; right: 0;
    min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px;
    background: var(--acc); color: var(--acct); font: 600 9.5px/15px var(--m); text-align: center;
  }
  .rail .ri.pend > em * { color: inherit !important; }
  .rail .jobs { width: 48px; margin: 0 auto 8px; padding: 8px 6px; }
  .rail .jt { justify-content: center; }
  .rail .pbar { margin: 6px 0 0; }
  .rail .acct { flex-direction: column; gap: 6px; padding: 8px 0 0; }

  .lbar { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; height: auto; min-height: 46px; padding-top: 7px; padding-bottom: 7px; }
  .meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .edm { grid-template-columns: minmax(0, 1fr) 270px; }
  .sbody { grid-template-columns: minmax(0, 820px); justify-content: center; }
  .step { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 360px); }
  /* Lösch-Bestätigung passt sonst nicht in die 400-px-Liste: Frage (loser Textknoten)
     nur noch für Screenreader, die Knöpfe behalten über .btn.sm ihre eigene Größe */
  .row .acts.conf { font-size: 0; padding-left: 3px; }
}

/* < 900 px: Handy — eine Spalte, Leiste aus, Tabbar unten */
@media (max-width: 899px) {
  body:not(.m-detail):not(.m-trim):has(.tabbar:not([hidden])) { --tabh: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .dsk { display: none !important; }
  .app, .app.cut, .app.one {
    grid-template-columns: minmax(0, 1fr);
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) var(--tabh) env(safe-area-inset-left, 0px);
  }
  body.m-detail .app, body.m-trim .app { background: var(--bg2); }
  .rail, .app > .mini, .lf { display: none; }
  /* Sichtbare Spalte über die Body-Klasse der App; ohne Klasse die Liste */
  .app > .pane, .app > .ed { display: none; border-right: 0; }
  body:not(.m-detail):not(.m-trim) .app > .lp { display: flex; }
  body.m-detail .app > .prev { display: flex; }
  body.m-trim .app > .ed { display: flex; }
  body.m-trim .app:not(:has(> .ed)) > .prev { display: flex; }
  body.m-detail .tabbar, body.m-trim .tabbar { display: none; }
  /* Gibt es Handy-Kopfzeilen, treten die Desktop-Kopfzeilen zurück */
  .lp:has(> .psr) > .lh, .lp:has(> .pctl) > .lbar, .prev:has(> .pnav) > .ph, .ed:has(> .pnav) > .ph { display: none; }
  /* Tastenhinweise ergeben auf dem Handy keinen Sinn */
  .btn kbd, .opt kbd, .search kbd, .seg kbd, .arow kbd { display: none; }
  /* iOS zoomt bei Feldern unter 16 px */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px; }

  .lh { padding: 10px 16px; }
  .grid-view { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 16px 16px; }
  .grid-view > .gh { margin: 0 -16px; }
  .ph { padding: 0 8px 0 12px; }
  .pb { padding: 14px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .pb .media { max-height: 56vh; border-radius: 8px; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edm { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 16px 0; }
  .transport { padding: 12px 16px 8px; }
  .tl { margin: 0 16px; }
  .save { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .warnt { max-width: none; }

  .mh1 { padding: 0 16px; }
  .sbody { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 28px; }
  .ff { grid-template-columns: minmax(0, 1fr); }
  .urow { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .urow .ua { grid-column: 2 / -1; justify-content: flex-start; }
  .steps { padding: 16px; }
  .step { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .step .no { font-size: 18px; }

  .shh { padding: 0 16px; }
  .shm { width: calc(100% - 32px); min-width: 0; margin: 16px auto 32px; }
  .shi { flex-direction: column; align-items: stretch; gap: 14px; }
  .shi .acts2 .btn { flex: 1 1 auto; }

  .auth { grid-template-columns: minmax(0, 1fr); }
  .wall { display: none; }
  .form { border-left: 0; padding: calc(32px + env(safe-area-inset-top, 0px)) 20px calc(32px + env(safe-area-inset-bottom, 0px)); }

  /* Dialog als Blatt von unten */
  .veil { place-items: end stretch; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; overflow-y: auto; border-width: 1px 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: v-up .22s cubic-bezier(.2, .8, .2, 1); }
  .mhd { padding: 16px; }
  .mhd .th { width: 112px; height: 63px; }
  .mbd { padding: 18px 16px 16px; }
  .kbd-overlay .kg { grid-template-columns: minmax(0, 1fr); }
  .dragov { inset: 8px; }
}

/* Weniger Bewegung */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
