/* ClickEdit — Dashboard UI
   Hochmodernes, neutrales Interface (Schwarz · Weiß · Graustufen + Blau-Akzent, Grün = „fertig").
   Komplett überarbeitet: feine Design-Tokens, kompaktere Karten, weiche Schatten, dezente
   Animationen. Alle Klassen/IDs unverändert — nur Optik. (Video-Designs/Paletten bleiben farbig.) */

:root {
  /* Akzent — dezentes Indigo (Linear-Stil) */
  --accent: #5b5bd6;
  --accent-dark: #4f4fc4;
  --accent-soft: rgba(91, 91, 214, 0.10);
  --primary: #5b5bd6;
  --primary-hover: #4f4fc4;
  /* Neutral — kühle, sehr helle Graustufen */
  --bg: #fbfbfc;
  --bg-2: #f5f5f7;
  --bg-3: #ededf0;
  --card: #ffffff;
  --ink: #17171b;
  --ink-soft: #62646c;
  --ink-faint: #9a9ca4;
  --line: #ececee;
  --line-strong: #e1e1e4;
  /* Status */
  --green: #2da44e;
  --green-soft: rgba(45, 164, 78, 0.12);
  --danger: #d1242f;
  --danger-soft: rgba(209, 36, 47, 0.07);
  /* Form — sehr weiche, niedrige Schatten */
  --shadow-sm: 0 1px 2px rgba(20, 21, 26, 0.05);
  --shadow: 0 1px 2px rgba(20, 21, 26, 0.05), 0 4px 12px rgba(20, 21, 26, 0.05);
  --shadow-lg: 0 8px 28px rgba(20, 21, 26, 0.10);
  --shadow-modal: 0 16px 50px rgba(20, 21, 26, 0.18);
  --radius: 12px;
  --r-sm: 7px;
  --r: 10px;
  --r-lg: 14px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --accent: #7c83ff;
  --accent-dark: #8f95ff;
  --accent-soft: rgba(124, 131, 255, 0.16);
  --primary: #7c83ff;
  --primary-hover: #8f95ff;
  --bg: #0b0b0d;
  --bg-2: #151517;
  --bg-3: #1e1f22;
  --card: #131316;
  --ink: #f4f4f6;
  --ink-soft: #9a9ca6;
  --ink-faint: #6a6c74;
  --line: #232327;
  --line-strong: #2e2e33;
  --green: #3fb950;
  --green-soft: rgba(63, 185, 80, 0.18);
  --danger: #f06a6a;
  --danger-soft: rgba(240, 106, 106, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
::selection { background: var(--accent-soft); }

/* schlanke, moderne Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); background-clip: padding-box; }

/* ---- Kopfzeile ---- */
header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  background: var(--card); /* Fallback */
  background: color-mix(in srgb, var(--card) 78%, transparent);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px var(--accent-soft), inset 0 1px 0 rgba(255,255,255,0.2);
  flex: 0 0 auto;
}
.title h1 { font-size: 16px; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
.title p { font-size: 11.5px; margin: 1px 0 0; color: var(--ink-soft); }
header .spacer { flex: 1; }
.server-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.btn {
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 7px 13px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform .1s var(--ease), background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease);
}
.btn:hover { border-color: var(--line-strong); background: var(--bg-2); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 2px 8px var(--accent-soft); }
.btn.primary:hover { background: var(--primary-hover); box-shadow: 0 6px 18px rgba(37,99,235,0.30); }
.btn.danger { color: var(--danger); border-color: var(--line); background: transparent; }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn[disabled], .mini[disabled] { opacity: .45; pointer-events: none; cursor: default; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- Board ---- */
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  max-width: 1540px;
  margin: 0 auto;
  padding: 26px 28px 72px;
  align-items: start;
}
/* Icons */
.ic { width: 16px; height: 16px; flex: 0 0 auto; display: inline-block; }
.user-pill .ic { width: 15px; height: 15px; opacity: .85; }
.icon-btn { padding: 8px; }
.icon-btn .ic { width: 17px; height: 17px; }
.column {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 110px;
  display: flex; flex-direction: column;
  transition: background .15s var(--ease), box-shadow .15s var(--ease), outline-color .15s var(--ease);
  outline: 2px dashed transparent; outline-offset: -4px;
}
.column.drop-target { outline-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 13px 11px;
  position: sticky; top: 0;
}
.col-head .name { font-weight: 700; font-size: 12.5px; letter-spacing: -0.015em; }
.col-head .count {
  font-size: 10.5px; font-weight: 600; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px; margin-left: auto;
}
.col-accent { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent); }
.cards { padding: 2px 10px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 36px; }

/* ---- Karte (kompakt) ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: grab;
  transition: transform .15s var(--ease), box-shadow .18s var(--ease), border-color .15s var(--ease);
  animation: cardIn .26s var(--ease) both;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .5; cursor: grabbing; transform: rotate(1.5deg) scale(0.98); }
.card .thumb {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000 center/cover no-repeat; background-color: var(--bg-3);
  display: block; overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease), filter .2s; }
.card:hover .thumb img { transform: scale(1.04); }
.card .thumb .ph {
  width: 100%; height: 100%; background: var(--bg-3) center / 34px no-repeat
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='4' width='20' height='16' rx='2'/><path d='M7 4v16M17 4v16M2 9h5M2 15h5M17 9h5M17 15h5'/></svg>");
}
.card .thumb .play {
  position: absolute; inset: 0; margin: auto; width: 42px; height: 42px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 15px;
  opacity: 0; transform: scale(0.85); transition: opacity .15s, transform .15s var(--ease);
}
.card:hover .thumb .play { opacity: 1; transform: scale(1); }
.card .thumb .play .ic { width: 18px; height: 18px; }
.card .body { padding: 10px 12px 12px; }
.card .pname { font-weight: 700; font-size: 13px; margin: 0 0 9px; word-break: break-word; letter-spacing: -0.015em; line-height: 1.3; }
/* Kompakter Status-Stepper (Schnitt · Grafik · Final) */
.steps { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.step { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--ink-faint); }
.step .ic { width: 13px; height: 13px; }
.step.done { color: var(--ink); }
.step.done .ic { color: var(--green); }

/* Gates / grüne Haken */
.gates { display: flex; flex-direction: column; gap: 4px; margin-bottom: 9px; }
.gate { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-soft); }
.gate .mark {
  width: 15px; height: 15px; border-radius: 5px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 9px; font-weight: 800;
  border: 1px solid var(--line); background: var(--bg-2); color: transparent;
  transition: all .2s var(--ease);
}
.gate.done .mark { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 1px 4px var(--green-soft); }
.gate.done { color: var(--ink); font-weight: 600; }

.card .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card .actions .mini {
  font-size: 11px; font-weight: 600; padding: 5px 9px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
  transition: all .13s var(--ease);
}
.card .actions .mini:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.card .actions .mini.accent { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 2px 8px var(--accent-soft); }
.card .actions .mini.accent:hover { background: var(--accent-dark); color: #fff; }
.card .badge-auto { font-size: 10px; color: var(--ink-faint); margin-left: 6px; }

.empty-col { color: var(--ink-faint); font-size: 12px; text-align: center; padding: 16px 6px; opacity: .8; }

/* Karten-Lauf-Indikator */
.card .running-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
  color: var(--accent-dark); background: var(--accent-soft);
  border-radius: 999px; padding: 2px 8px 2px 6px; margin-left: 6px;
}
.card.is-running { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.thumb .run-overlay {
  position: absolute; inset: 0; background: rgba(8,10,14,0.55); backdrop-filter: blur(1px);
  display: grid; place-items: center; gap: 8px; color: #fff; font-size: 12px; font-weight: 600;
  grid-auto-flow: row; text-align: center; padding: 8px;
}
.thumb .run-overlay .spinner { border-color: rgba(255,255,255,0.35); border-top-color: #fff; }

/* ---- Upload-Zone ---- */
#dropveil {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: var(--accent-soft); backdrop-filter: blur(4px);
  place-items: center; pointer-events: none;
}
#dropveil.show { display: grid; animation: fadeIn .15s var(--ease); }
#dropveil .inner {
  background: var(--card); border: 2px dashed var(--accent); border-radius: var(--r-lg);
  padding: 40px 56px; text-align: center; box-shadow: var(--shadow-lg);
}
#dropveil .inner b { font-size: 18px; }
#dropveil .inner p { color: var(--ink-soft); margin: 6px 0 0; font-size: 13px; }

/* ---- Modal (Karten-Detail) ---- */
/* Bearbeiten = ZWEI getrennte Fenster (Video links, Einstellungen rechts), Linear-clean. */
#modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(15,15,20,0.42); backdrop-filter: blur(5px);
  align-items: center; justify-content: center; padding: 24px;
}
#modal.show { display: flex; animation: fadeIn .16s var(--ease); }
.modal-wrap { display: flex; align-items: flex-start; justify-content: center; gap: 16px; max-width: 100%; max-height: 90vh; }
.modal-x {
  position: fixed; top: 18px; right: 20px; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  font-size: 19px; line-height: 1; cursor: pointer; z-index: 202; box-shadow: var(--shadow-sm);
  transition: color .12s, background .12s, transform .1s;
}
.modal-x:hover { color: var(--ink); background: var(--bg-2); }
.modal-x:active { transform: scale(0.94); }
.win {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal); display: flex; flex-direction: column; max-height: 90vh;
  overflow: hidden; animation: modalIn .22s var(--ease);
}
.win-video { overflow: hidden; }
.win-video #mMedia { background: #000; display: flex; align-items: center; justify-content: center; min-height: 0; }
.win-video #mMedia:empty { display: none; }
.win-video #mMedia video,
.win-video #mMedia img { display: block; max-width: 52vw; max-height: 80vh; width: auto; height: auto; }
.win-video { min-width: 300px; }
.win-set { width: 600px; max-width: 94vw; }
.winhead { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.winhead b { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
.winbody { overflow-y: auto; }
.wsec { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.wsec:last-child { border-bottom: none; }
.wsec-h { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 11px; display: flex; align-items: center; gap: 8px; }
.wsec-danger { display: flex; justify-content: flex-end; }
@media (max-width: 880px) {
  #modal { padding: 0; }
  .modal-wrap { flex-direction: column; align-items: center; gap: 0; max-height: 100vh; width: 100%; overflow-y: auto; }
  .win { border-radius: 0; max-height: none; width: 100%; box-shadow: none; border-left: none; border-right: none; }
  .win-set { width: 100%; }
  .win-video #mMedia video, .win-video #mMedia img { max-width: 100vw; max-height: 56vh; }
}

/* Live-Status-Banner */
.statusbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.statusbar .sb-icon { flex: 0 0 auto; display: flex; align-items: center; }
.statusbar .sb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.statusbar .sb-text b { font-size: 12px; font-weight: 700; letter-spacing: -0.01em; }
.statusbar .sb-msg { font-size: 11px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar .time { flex: 0 0 auto; font-weight: 500; font-size: 10.5px; opacity: .65; }
.statusbar.running .sb-text b, .statusbar.review .sb-text b { color: var(--accent-dark); }
.statusbar.done .sb-text b { color: var(--green); }
.statusbar.error .sb-text b { color: var(--danger); }
.statusbar.running, .statusbar.review { background: var(--accent-soft); }
.statusbar.queued { background: var(--bg-2); }
.statusbar.done { background: var(--green-soft); }
.statusbar.error { background: var(--danger-soft); }

/* Versions-Chips */
.vchips { display: flex; gap: 6px; padding: 10px 14px; background: var(--bg-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vchip {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  padding: 4px 12px; border-radius: 999px; transition: all .14s var(--ease);
}
.vchip:hover { border-color: var(--line-strong); color: var(--ink); }
.vchip.active { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 2px 8px var(--accent-soft); }

.fb-stage-info { font-size: 11.5px; color: var(--ink-soft); flex: 1; }

/* Log-Box */
.logbox {
  margin-top: 10px; background: #0f1115; color: #d4d8dd; font-size: 11px; line-height: 1.5;
  padding: 11px 13px; border-radius: var(--r-sm); max-height: 240px; overflow: auto;
  white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Menlo, Consolas, monospace;
  border: 1px solid var(--line);
}
.progress { height: 4px; background: var(--bg-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); transition: width .4s var(--ease); }

/* Spinner */
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  border: 2.5px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.spinner.sm { width: 13px; height: 13px; border-width: 2px; }

.locked-note { font-size: 12px; color: var(--ink-soft); margin-top: 8px; }

/* Stufen-Liste im Modal */
.stage-list { display: flex; flex-direction: column; gap: 8px; }
.stage-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.stage-row .mark {
  width: 20px; height: 20px; border-radius: 7px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  border: 1px solid var(--line); background: var(--bg-2); color: transparent;
  transition: all .2s var(--ease);
}
.stage-row.done .mark { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 1px 5px var(--green-soft); }
.stage-row.active .mark { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.stage-row .lbl { flex: 1; }
.stage-row.done .lbl { font-weight: 600; }
.stage-row .st { font-size: 11px; color: var(--ink-soft); }
.stage-row.stale .mark { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.stage-row.stale .lbl { color: var(--ink); }
.stale-tag { color: var(--danger); font-weight: 700; font-size: 11px; }
.locked-note.stale-note { background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); border-radius: var(--r-sm); padding: 8px 10px; color: var(--ink); }
.stale-badge { font-size: 10.5px; font-weight: 700; color: var(--danger); background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }

/* Feedback */
.fb-form textarea {
  width: 100%; min-height: 64px; resize: vertical; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px;
  background: var(--bg); color: var(--ink); box-sizing: border-box; transition: border-color .14s, box-shadow .14s;
}
.fb-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fb-form .fb-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.fb-form select {
  font: inherit; font-size: 12px; padding: 6px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.fb-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.fb-item {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 9px 11px; font-size: 12.5px;
}
.fb-item .meta { font-size: 10.5px; color: var(--ink-soft); margin-bottom: 3px; display: flex; gap: 8px; }
.fb-item .tag { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.fb-item.done { opacity: .6; }
.fb-empty { font-size: 12px; color: var(--ink-soft); }

/* ---- Modals (Mitarbeiter / Designs / Untertitel) teilen den Look ---- */
#usersModal, #designsModal, #capModal {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(8,10,14,0.55); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 20px;
}
#capModal { z-index: 210; }
#usersModal.show, #designsModal.show, #capModal.show { display: flex; animation: fadeIn .16s var(--ease); }
#usersModal .panel, #designsModal .panel, #capModal .panel {
  background: var(--card); border-radius: var(--r-lg); overflow: hidden; width: 100%;
  max-height: 90vh; display: flex; flex-direction: column; border: 1px solid var(--line);
  box-shadow: var(--shadow-modal); animation: modalIn .22s var(--ease);
}
#usersModal .panel { max-width: 460px; max-height: 88vh; }
#designsModal .panel { max-width: 560px; }
#capModal .panel { max-width: 760px; max-height: 92vh; }
#usersModal .phead, #designsModal .phead, #capModal .phead { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
#usersModal .phead b, #designsModal .phead b, #capModal .phead b { font-size: 15px; letter-spacing: -0.01em; }
#usersModal .phead .x, #designsModal .phead .x, #capModal .phead .x { margin-left: auto; cursor: pointer; font-size: 20px; color: var(--ink-soft); background: var(--bg-2); border: none; width: 30px; height: 30px; border-radius: 8px; line-height: 1; transition: all .12s; }
#usersModal .phead .x:hover, #designsModal .phead .x:hover, #capModal .phead .x:hover { background: var(--bg-3); color: var(--ink); }
#usersModal .pbody, #designsModal .pbody, #capModal .pbody { overflow-y: auto; }
#designsModal .sect, #usersModal .sect { padding: 16px 20px; border-bottom: 1px solid var(--line); }
#designsModal .sect:last-child, #usersModal .sect:last-child { border-bottom: none; }
#designsModal .sect h4, #usersModal .sect h4 { margin: 0 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); font-weight: 700; }

/* Feld-Gruppen */
.field-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field .flabel { font-size: 11px; font-weight: 600; color: var(--ink-soft); letter-spacing: .02em; }
.field .uinput, .field .uselect { width: 100%; box-sizing: border-box; }
@media (max-width: 480px) { .field-grid.two { grid-template-columns: 1fr; } }
.group-head { font-size: 13px; font-weight: 700; color: var(--ink); margin: 8px 0 2px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: baseline; gap: 6px; }
.group-head span { font-size: 11px; font-weight: 500; color: var(--ink-soft); }

.palette-edit, .sub-edit { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--bg-2); }
.sub-edit { display: flex; flex-direction: column; gap: 10px; }
.sub-edit .phint, .palette-edit .phint { font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; }
.palette-edit .phint { margin-bottom: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.check-row input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.sub-preview { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.subprev-stage { min-height: 96px; display: flex; align-items: flex-end; justify-content: center; padding: 14px 12px 18px; }
.subprev-cap { font-weight: 800; font-size: 22px; line-height: 1.15; text-transform: none; letter-spacing: -0.01em; text-align: center; }

.prow { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.prow .rank { font-size: 11px; font-weight: 700; color: var(--ink-soft); width: 58px; flex: 0 0 auto; }
.prow input[type=color] { width: 38px; height: 30px; border: 1px solid var(--line); border-radius: var(--r-sm); background: none; cursor: pointer; padding: 0; flex: 0 0 auto; }
.prow input[type=text] { width: 96px; flex: 0 0 auto; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); text-transform: uppercase; }
.prow input[type=text].bad { border-color: var(--danger); background: var(--danger-soft); }
.prow .premove { background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 15px; padding: 2px 6px; border-radius: 6px; transition: all .12s; }
.prow .premove:hover { color: var(--danger); background: var(--card); }
.dmode-badge { font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.dmode-badge.hell { background: var(--bg-3); color: var(--ink-soft); border: 1px solid var(--line); }
.dmode-badge.dunkel { background: #15161b; color: #fff; }
.dswatch { display: inline-flex; gap: 3px; margin-left: 8px; vertical-align: middle; }
.dswatch span { width: 15px; height: 15px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.12); display: inline-block; }

/* Pro-Video-Optionen */
.proj-design { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); }
.proj-design select, .po-row select { font: inherit; font-size: 12.5px; padding: 6px 9px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); transition: border-color .12s; }
.proj-design select:focus, .po-row select:focus { outline: none; border-color: var(--accent); }
/* Moderne Dropdowns: nativen Pfeil ersetzen, einheitlicher Look */
.uselect, .po-row select, .proj-design select, .fb-form select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px;
}
.uselect:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* Pro-Video-Einstellungen als saubere Settings-Karte (Icon · Label · Steuerung) */
.proj-opts { margin-top: 0; }
.po-row { display: grid; grid-template-columns: 18px 92px 1fr; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink); }
.po-row:last-child { border-bottom: none; }
.po-ic { color: var(--ink-soft); display: inline-flex; align-items: center; }
.po-ic .ic { width: 16px; height: 16px; }
.po-label { font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.po-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.po-ctl > select { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.po-hint { font-size: 11.5px; color: var(--ink-soft); }
.btn .ic { width: 14px; height: 14px; }
.btn.mini .ic, .mini-play .ic { width: 13px; height: 13px; }
.mini-play, .btn.mini { padding: 5px 9px; font-size: 11.5px; line-height: 1; flex: 0 0 auto; }
.mini-play.icon-btn { padding: 6px; }
@media (max-width: 480px) { .po-row { grid-template-columns: 18px 1fr; } .po-row .po-label { grid-column: 2; } .po-ctl { grid-column: 1 / -1; } }

/* Musik-Panel */
.music-panel { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.music-panel .mp-seek { display: flex; align-items: center; gap: 8px; }
.music-panel input[type=range] { flex: 1; accent-color: var(--accent); cursor: pointer; }
.music-panel input[type=number] { width: 62px; font: inherit; font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.mp-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); }
.mp-row .po-ic { color: var(--ink-soft); }
.mp-row .po-ic .ic { width: 15px; height: 15px; }

/* Einklappbare Abschnitte (Accordion) im Popup — räumt das Bearbeiten auf */
.acc { border-bottom: 1px solid var(--line); }
.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px;
  padding: 14px 18px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-soft); user-select: none; transition: color .12s; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .ic { width: 15px; height: 15px; }
.acc > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; flex: 0 0 auto;
  border-right: 2px solid var(--ink-faint); border-bottom: 2px solid var(--ink-faint);
  transform: rotate(-45deg); transition: transform .2s var(--ease); }
.acc[open] > summary::after { transform: rotate(45deg); }
.acc > summary:hover { color: var(--ink); }
.acc-count { font-size: 10.5px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px;
  padding: 0 6px; min-width: 17px; text-align: center; text-transform: none; letter-spacing: 0; }
.acc-count:empty { display: none; }
.acc-body { padding: 2px 18px 16px; }
.acc-body .proj-opts { margin-top: 2px; }

/* Aktions-Buttons sauber umbrechen, Hinweise volle Breite */
#mActions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#mActions:empty { margin-top: 0; }
#mActions .locked-note { flex: 1 0 100%; margin-top: 4px; }

/* Icon-Ausrichtung in Dialog-Köpfen & Gruppen-Überschriften */
.phead b { display: inline-flex; align-items: center; gap: 8px; }
.group-head { align-items: center; }
.group-head .ic { width: 15px; height: 15px; color: var(--ink-soft); }

/* Live-Untertitel-Editor */
.cap-stage { position: relative; background: #000; display: flex; align-items: center; justify-content: center; }
.cap-stage video { display: block; max-width: 100%; max-height: 48vh; width: auto; }
.cap-overlay { position: absolute; left: 0; right: 0; bottom: 7%; display: flex; justify-content: center; pointer-events: none; padding: 0 6%; }
.cap-ov-line { font-weight: 800; font-size: clamp(16px, 3.4vw, 30px); text-transform: uppercase; text-align: center; line-height: 1.15; letter-spacing: -0.01em; }
.cap-hint { font-size: 11.5px; color: var(--ink-soft); padding: 11px 18px 2px; line-height: 1.4; }
.cap-words { padding: 8px 18px 14px; display: flex; flex-direction: column; gap: 8px; }
.cap-line { display: flex; flex-wrap: wrap; gap: 5px 6px; }
.cap-w { font-size: 13.5px; padding: 2px 7px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); cursor: text; outline: none; white-space: pre; transition: border-color .12s, background .12s; }
.cap-w:hover { border-color: var(--line-strong); }
.cap-w:focus { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 2px var(--accent-soft); }

/* Toggle-Switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; cursor: pointer; background: var(--line-strong); border-radius: 999px; transition: background .2s var(--ease); }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ---- Toast ---- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; opacity: 0; transition: all .22s var(--ease); z-index: 300; pointer-events: none;
  box-shadow: var(--shadow-lg); max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); color: #fff; }

/* Upload-Fortschritt */
#uploadbar {
  position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--green));
  width: 0; z-index: 400; transition: width .2s; box-shadow: 0 0 10px var(--accent-soft);
}

/* ---- Login ---- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent), linear-gradient(160deg, var(--bg-2), var(--bg)); }
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 36px 32px; width: 330px; max-width: 90vw; text-align: center;
  animation: modalIn .3s var(--ease);
}
.login-card h1 { font-size: 20px; margin: 0 0 2px; letter-spacing: -0.02em; }
.login-card .sub { color: var(--ink-soft); font-size: 13px; margin: 0 0 20px; }
.login-card input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; margin-bottom: 10px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink); transition: border-color .14s, box-shadow .14s;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .btn.primary { width: 100%; padding: 11px; margin-top: 4px; justify-content: center; }
.login-err { color: var(--danger); font-size: 12.5px; margin-top: 12px; min-height: 16px; }

/* ---- Benutzer-Verwaltung ---- */
.user-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.user-pill b { color: var(--ink); }
.uform { display: flex; flex-direction: column; gap: 9px; }
.uinput { width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink); transition: border-color .14s, box-shadow .14s; }
.uinput:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.uform-row { display: flex; gap: 8px; align-items: center; }
.uselect { flex: 1; cursor: pointer; }
.uform-row .btn.primary { flex: 0 0 auto; }
.userlist { display: flex; flex-direction: column; gap: 8px; }
.userrow { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .12s, box-shadow .12s; }
.userrow:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.userrow .uavatar { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; font-size: 13px; text-transform: uppercase; }
.userrow .uname { font-weight: 600; flex: 1; display: flex; align-items: center; gap: 7px; }
.userrow .urole { font-size: 10.5px; font-weight: 600; color: var(--ink-soft); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.userrow .urole.admin { color: var(--accent-dark); background: var(--accent-soft); border-color: transparent; }
.userrow .uact { background: none; border: none; cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 7px; opacity: .65; transition: all .12s; }
.userrow .uact:hover { opacity: 1; background: var(--bg-2); }
.userrow .uact.del:hover { color: var(--danger); }
.userrow .ume { font-size: 10px; color: var(--ink-soft); background: var(--bg-2); border-radius: 999px; padding: 1px 7px; }

/* ---- Animationen ---- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Bewegung reduzieren, wenn vom System gewünscht */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spinner { animation: spin .8s linear infinite !important; }
}

/* ---- Responsive (Handy) ---- */
@media (max-width: 820px) {
  .board { grid-template-columns: 1fr; overflow-x: visible; padding: 14px 12px 50px; }
  .column { min-height: auto; }
  header { padding: 12px 16px; }
  .title p { display: none; }
  .server-pill { display: none; }
}
