/* ------------------------------------------------------------------
   lhm-live – Oberfläche
   Grundsätze: helle, ruhige Fläche; eine Kontrollhöhe (38 px) für alle
   Felder und Buttons; ein Eckenradius (6 px); Abstand statt Rahmen;
   Zahlen tabellarisch; keine Schatten außer bei Menüs.
   ------------------------------------------------------------------ */
:root {
  --bg: #f5f4f0;          /* Seitenhintergrund, warmes Grau */
  --surface: #ffffff;     /* Flächen: Seitenleiste, Tabellen, Karten */
  --surface-2: #f0efea;   /* leicht abgesetzt: Kopfzeilen, Hover */
  --ink: #1c1c1a;
  --ink-2: #55544f;
  --ink-3: #8b8a83;
  --line: #e4e2db;
  --line-strong: #c9c7be;
  --accent: #1f6f4a;      /* wird pro Veranstaltung überschrieben */
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, white);
  --accent-line: color-mix(in srgb, var(--accent) 45%, white);
  --live: #c8102e;        /* "auf Monitor", "Signal liegt an" */
  --live-soft: #fbe9ec;
  --danger: #b3261e;
  --danger-soft: #fbeae8;
  --warn-soft: #fff4d6;
  --warn-ink: #7a5300;
  --ok-soft: #e6f2ea;
  --ok-ink: #1d5a3a;
  --radius: 6px;
  --ctl: 38px;            /* Höhe aller Bedienelemente */
  --sidebar: 240px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 650; letter-spacing: -.01em; line-height: 1.25; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }
code { font: 13px/1.4 var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: .1em .4em; border-radius: 4px; word-break: break-all; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.error { color: var(--danger); }
.ok { color: var(--ok-ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Bedienelemente: eine Höhe, ein Radius ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), textarea, select {
  width: 100%; height: var(--ctl); padding: 0 12px; margin: 0;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .12s;
}
textarea { height: auto; min-height: 96px; padding: 9px 12px; line-height: 1.45; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, textarea:hover, select:hover { border-color: #b3b1a7; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%2355544f' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; }
select:disabled { color: var(--ink-3); background-color: var(--surface-2); cursor: default; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; cursor: pointer; vertical-align: -3px; }
input[type=color] { width: var(--ctl); height: var(--ctl); padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 3px; }
input[type=file] { width: 100%; font: inherit; color: var(--ink-2); padding: 6px 0; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; height: 32px; padding: 0 12px; margin-right: 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }
input[type=datetime-local] { min-width: 0; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.hint { display: block; font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 400; color: var(--ink); cursor: pointer; margin: 0; line-height: 1.4; }
.check input { margin-top: 2px; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-size: 14px; font-weight: 400; color: var(--ink); }
.inline input[type=text], .inline input:not([type]) { width: auto; }

/* Buttons: .btn ist die Basis; Varianten primary / ghost / danger; .sm für Tabellen und Listen */
button { font: inherit; }
.btn, button:not([class]), #poll-send, .formfoot button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl); padding: 0 14px; margin: 0;
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover, button:not([class]):hover { background: var(--surface-2); border-color: #b3b1a7; text-decoration: none; }
.btn:disabled, button:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary, button.primary, #poll-send, .formfoot button[type=submit], .card form > button[type=submit] {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover, button.primary:hover, #poll-send:hover, .card form > button[type=submit]:hover { filter: brightness(.94); background: var(--accent); }
.btn.ghost, button.link { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover, button.link:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.btn.danger, button.danger { color: var(--danger); }
.btn.danger:hover, button.danger:hover { background: var(--danger-soft); border-color: #e3b2ad; color: var(--danger); }
.btn.danger.solid { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn.sm, .qactions select, .qactions input, .tbl .btn { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.live { color: var(--live); }
.btn.live:hover { background: var(--live-soft); border-color: #efb3bd; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row > input { flex: 1; min-width: 8rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions.right { justify-content: flex-end; }
.spacer { flex: 1; }

/* Status-Kennzeichnungen: ruhig, als Punkt + Text; Pillen nur für Rubriken/Begriffe */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; font-size: 12px; font-weight: 600; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); vertical-align: middle; white-space: nowrap; }
.badge.hot { background: var(--live-soft); color: var(--live); }
.badge.ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge.cat { background: #e7eefb; color: #27477f; }
.badge.tag { background: #efe9fb; color: #553e8a; }
.badge.grey { background: var(--surface-2); color: var(--ink-2); }
.badge.ov { background: #fde0fd; color: #8a0f8a; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); vertical-align: 1px; margin-right: 7px; }
.dot.open, .dot.on { background: #1f9d5a; }
.dot.live { background: var(--live); box-shadow: 0 0 0 3px var(--live-soft); }
.dot.closed { background: #27477f; }
.dot.archived { background: var(--line-strong); }
.dot.draft { background: #d9a400; }
.st { white-space: nowrap; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 600; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.count:empty { display: none; }

/* Hinweise / Rückmeldungen */
.flash, .notice { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin: 0 0 24px; font-size: 14px; }
.flash.ok { background: var(--ok-soft); border-color: #bfdccb; color: var(--ok-ink); }
.flash.err { background: var(--danger-soft); border-color: #e3b2ad; color: var(--danger); }
.notice { background: var(--warn-soft); border-color: #ecd9a0; color: var(--warn-ink); }
.flash .btn { margin-top: 10px; }
.bigcode { font-size: 20px; letter-spacing: .1em; padding: .15em .5em; background: #fff; }

/* ---------- Anwendungsrahmen: Seitenleiste + Inhalt ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 0; }
.side .brand strong { font-size: 15px; font-weight: 650; }
.side .brand .sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.side .logo-bar { height: 28px; width: auto; }
.side .section { padding: 0 10px; }
.side .section label { margin-bottom: 6px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a, .side nav button { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--radius); color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.side nav a:hover, .side nav button:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side nav a.active, .side nav button.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.side nav .count { margin-left: auto; }
.side nav .ext::after { content: "↗"; margin-left: auto; color: var(--ink-3); font-size: 12px; }
.side .group { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 4px; }
.side .foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.side .foot .who { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .foot form { margin: 0; }
.side .foot button { height: 32px; padding: 0 10px; font-size: 13px; }
.side .conn { font-size: 12px; color: var(--ink-3); }
.side .conn::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-right: 6px; }
.side .conn.on::before { background: #1f9d5a; }
.side .conn.off::before { background: var(--danger); }
.main { padding: 40px 40px 64px; max-width: 1240px; width: 100%; min-width: 0; }
.main.narrow { max-width: 860px; }

/* Seitenkopf */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.pagehead .lead { font-size: 15px; color: var(--ink-2); margin-top: 6px; max-width: 60ch; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }

/* Fakten-Zeile (Status, Link, aktuelle Veranstaltung) */
.facts { display: flex; flex-wrap: wrap; gap: 8px 36px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.fact { min-width: 0; }
.fact .k { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.fact .v { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Abschnitte ohne Kasten: Überschrift, Linie, Inhalt */
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.section-h:first-child { margin-top: 0; }
.section-h h2 { font-size: 16px; }
.section-h .muted { font-size: 13px; }

/* Werkzeugleiste über Listen */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar form.search, .toolbar .search { display: flex; gap: 8px; flex: 1; min-width: 240px; max-width: 420px; }
.toolbar .search input { flex: 1; }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #faf9f6; }
.tbl .num { text-align: right; }
.tbl .actions { justify-content: flex-end; flex-wrap: nowrap; }
.tbl td.act { text-align: right; white-space: nowrap; width: 1%; padding-left: 8px; }
.tbl td.nowrap { white-space: nowrap; }
.tbl .inline-form { display: inline; }
.tbl .sub { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.tbl a.strong { color: var(--ink); font-weight: 600; }
.tbl tr.current td { background: var(--accent-soft); }
.tbl tr.current:hover td { background: var(--accent-soft); }
.tbl tr.editrow td { background: var(--surface-2); padding: 14px 16px 18px; }
.tbl tr.editrow .row > input { min-width: 10rem; }
.empty { padding: 40px 24px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty .btn { margin-top: 12px; }

/* Ausklappbare Bereiche (Import, Hinzufügen, Gefahrenzone) */
details.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; }
details.panel > summary { list-style: none; cursor: pointer; padding: 12px 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(-45deg); transition: transform .12s; margin: 0 4px 0 2px; }
details.panel[open] > summary::before { transform: rotate(45deg); }
details.panel > summary .muted { font-weight: 400; font-size: 13px; }
details.panel > .body { padding: 4px 16px 18px; border-top: 1px solid var(--line); }
details.panel > .body > *:first-child { margin-top: 14px; }
details.panel.danger { border-color: #e3b2ad; }
details.panel.danger > summary { color: var(--danger); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.formgrid .field { margin: 0; }

/* Aufklapp-Menü ("Mehr …") */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 260px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(20,20,10,.12); padding: 6px; display: flex; flex-direction: column; }
details.menu .pop a, details.menu .pop button { display: block; width: 100%; height: auto; padding: 9px 10px; text-align: left; font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; border-radius: 4px; cursor: pointer; text-decoration: none; justify-content: flex-start; }
details.menu .pop a:hover, details.menu .pop button:hover { background: var(--surface-2); }
details.menu .pop .danger { color: var(--danger); }
details.menu .pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
details.menu .pop form { margin: 0; }

/* Formulare (Veranstaltung) */
.form2col { display: grid; grid-template-columns: 1fr; gap: 0 48px; }
@media (min-width: 960px) { .form2col { grid-template-columns: 1fr 1fr; } .form2col .formfoot { grid-column: 1 / -1; } }
.fs { margin-bottom: 28px; }
.fs > h2 { font-size: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.formfoot { display: flex; gap: 10px; align-items: center; padding-top: 20px; border-top: 1px solid var(--line); margin-top: 8px; }
.help { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-3); }
.help li { margin: 2px 0; }
.colorrow { display: flex; gap: 10px; align-items: center; }
.colorrow input[type=text] { width: 120px; font-family: var(--mono); text-transform: lowercase; }
.logo-preview { max-height: 56px; max-width: 200px; background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); }

/* Schlüssel/Wert (Stream-Einstellungen) */
.kv { width: 100%; border-collapse: collapse; }
.kv th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 12px 24px 12px 0; vertical-align: middle; white-space: nowrap; width: 1%; }
.kv td { padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv tr:last-child td { border-bottom: 0; }
.kv td .row { flex-wrap: wrap; }
.kv code { font-size: 13px; padding: 6px 10px; }
.secret { filter: blur(5px); user-select: none; }
.secret.shown { filter: none; user-select: text; }

/* ---------- Anmeldung / einfache Seiten ---------- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 36px 36px 32px; }
.card h1 { font-size: 22px; margin-bottom: 6px; }
.card .meta { color: var(--ink-3); font-size: 14px; margin-bottom: 18px; }
.card .welcome { white-space: pre-line; color: var(--ink-2); margin-bottom: 22px; }
.card form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.card form label { margin-bottom: 6px; }
.card form input { height: 44px; font-size: 16px; }
.card form > button { height: 44px; font-size: 15px; width: 100%; margin-top: 6px; }
.card .foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.logo { max-height: 56px; max-width: 70%; display: block; margin: 0 0 20px; }

/* ---------- Player (Teilnehmende) ---------- */
.topbar { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who { margin-left: auto; color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar form { margin: 0; }
.topbar .logo-bar { height: 30px; width: auto; }
.player-layout { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 20px; max-width: 1400px; margin: 0 auto; }
@media (min-width: 960px) { .player-layout { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); padding: 28px 32px; gap: 28px; } }
.video-wrap { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; align-self: start; }
video { width: 100%; height: 100%; display: block; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; background: #15171c; color: #fff; }
.overlay p { margin: 4px 0; max-width: 44ch; }
.overlay .muted { color: #a8adb8; }
.questions { align-self: start; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.questions h2 { font-size: 16px; margin-bottom: 12px; }
.questions h3 { margin: 26px 0 10px; }
.questions textarea { min-height: 110px; }
.questions .row { justify-content: space-between; margin-top: 10px; }
.myq { list-style: none; padding: 0; margin: 0; }
.myq li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.myq .qt { display: block; margin-top: 2px; }
.footer { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line); }
.pollbox { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 8px; padding: 16px 18px; margin-bottom: 22px; }
.pollbox h2 { font-size: 15px; margin-bottom: 10px; }
.opt { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-weight: 400; font-size: 15px; color: var(--ink); cursor: pointer; margin: 0; }
#poll-send { margin-top: 8px; }
.bars { margin-top: 8px; }
.pbar { margin: 8px 0; }
.pbar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 4px; }
.pbar-track { height: 8px; background: rgba(0,0,0,.08); border-radius: 999px; overflow: hidden; }
.pbar-fill { height: 100%; background: var(--accent); transition: width .4s; }

/* ---------- Redaktion ---------- */
.red-main .pagehead { margin-bottom: 22px; }
.red-main .pagehead .lead { max-width: 72ch; }
.red-main .toolbar { margin-bottom: 18px; }
.red-main .toolbar select { width: auto; min-width: 11rem; }
.red-main .toolbar .search-field { max-width: 380px; }
.qlist { display: flex; flex-direction: column; gap: 12px; }
.q { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius); padding: 16px 20px 14px; }
.q.onmon { border-left-color: var(--live); }
.q.onair { border-left-color: #1f9d5a; }
.q.arch { opacity: .72; }
.q.arch:hover { opacity: 1; }
.qhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--ink-3); min-height: 22px; }
.qhead .pos { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.qid { font-weight: 600; color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.qname { font-weight: 600; color: var(--ink); font-size: 14px; }
.qmeta { color: var(--ink-3); }
.qtext { margin: 10px 0 14px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; color: var(--ink); max-width: 80ch; }
.qactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.qactions .btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qactions select { width: auto; min-width: 11rem; padding-right: 30px; }
.qactions input.tagin { width: 12rem; }
.btngroup { display: inline-flex; }
.btngroup .btn { padding: 0 9px; }
.btngroup .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btngroup .btn + .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { gap: 8px; }
.chips .chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips .chip.active .count { background: rgba(255,255,255,.22); color: #fff; }
.catmanage { margin-bottom: 18px; max-width: 640px; }
.catrows:not(:empty) { margin-bottom: 14px; }
.catrow { margin: 0 0 8px; }
.catrow input { flex: 1; }
#catform input { flex: 1; }
.poll-card .bars { margin: 0 0 14px; max-width: 560px; }
.ovbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 900px; }
.ovbox-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ovbox-foot { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 12px 16px 16px; }
.ov-preview { background: #FF00FF; padding: 24px; min-height: 120px; display: flex; align-items: center; color: #111; }
.ov-preview .ov-empty { font-size: 13px; color: #4a004a; background: rgba(255,255,255,.55); padding: 6px 10px; border-radius: 4px; }
.ov-preview .ov-card { background: rgba(10,10,14,.92); color: #fff; border-left: 5px solid var(--accent); border-radius: 8px; padding: 14px 18px; display: inline-block; max-width: 100%; min-width: 320px; }
.ov-preview .ov-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #9fe0bd; margin-bottom: 2px; }
.ov-preview .ov-text { font-size: 17px; font-weight: 600; line-height: 1.3; }
.ov-preview .ov-name { font-size: 13px; color: #bbb; margin-top: 4px; }
.ov-preview .pbar-track { background: rgba(255,255,255,.15); }
.ov-preview .pbar-fill { background: var(--accent); }
.ov-preview .pbar-head { color: #fff; }

/* ---------- Bühnenmonitor (dunkel, unverändert in der Wirkung) ---------- */
body.monitor { background: #000; color: #fff; overflow: hidden; }
.mon { height: 100vh; overflow-y: auto; padding: 2rem 3rem; scroll-behavior: smooth; }
.mon-empty { color: #888; font-size: 2rem; margin-top: 30vh; text-align: center; }
.mon-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2rem; justify-content: flex-end; min-height: calc(100vh - 4rem); }
.mq { border-left: .6rem solid var(--accent); padding: .3rem 0 .3rem 1.5rem; }
.mq-name { font-size: 1.6rem; color: #bbb; margin-bottom: .3rem; }
.mq-org { color: #777; font-size: 1.2rem; }
.mq-text { font-size: 2.6rem; line-height: 1.3; font-weight: 600; }
.mq:last-child { border-left-color: var(--live); }
.mon-hint { position: fixed; right: 1rem; bottom: .6rem; font-size: .85rem; color: #666; transition: opacity .5s; }
.mon-hint.fade { opacity: 0; }
.mon-poll { position: fixed; left: 0; right: 0; bottom: 0; background: #111; border-top: .3rem solid var(--accent); padding: 1rem 3rem 1.5rem; }
.mp-q { font-size: 1.6rem; font-weight: 600; margin-bottom: .5rem; }
.mp-total { color: #999; font-weight: 400; font-size: 1.2rem; }
.mp-row { display: grid; grid-template-columns: 1fr 2fr 4rem; gap: 1rem; align-items: center; font-size: 1.3rem; margin: .3rem 0; }
.mp-track { height: 1rem; background: #333; border-radius: 999px; overflow: hidden; display: block; }
.mp-fill { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.mp-pct { text-align: right; }

/* ---------- Overlay für den ATEM (Magenta wird gekeyt) ---------- */
body.overlay { background: #FF00FF; color: #fff; overflow: hidden; margin: 0; }
body.overlay .ov { position: fixed; left: 4vw; right: 4vw; bottom: 6vh; display: flex; }
body.overlay .ov-card { background: rgba(10, 10, 14, .94); border-left: .8vw solid var(--accent); border-radius: 1vw; padding: 1.6vw 2.4vw; max-width: 70vw; box-shadow: 0 .5vw 2vw rgba(0,0,0,.4); }
body.overlay .ov-label { font-size: 1.6vw; text-transform: uppercase; letter-spacing: .08em; color: #9fe0bd; margin-bottom: .4vw; }
body.overlay .ov-text { font-size: 3.2vw; line-height: 1.25; font-weight: 600; }
body.overlay .ov-name { font-size: 1.8vw; color: #bbb; margin-top: .6vw; }
body.overlay .ov-name:empty { display: none; }
body.overlay .ov-bars { margin-top: 1vw; min-width: 40vw; }
body.overlay .ov-bar { margin: .7vw 0; }
body.overlay .ov-bar-head { display: flex; justify-content: space-between; font-size: 2vw; }
body.overlay .ov-bar-track { height: 1.2vw; background: #333; border-radius: 999px; overflow: hidden; }
body.overlay .ov-bar-fill { height: 100%; background: var(--accent); transition: width .5s; }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 10px; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 4px; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .side nav a, .side nav button { width: auto; flex: none; height: 34px; }
  .side .group { display: none; }
  .side .foot { margin-top: 0; padding-top: 10px; flex-direction: row; align-items: center; justify-content: space-between; }
  .side .foot .muted, .side .brand .sub { display: none; }
  .side .brand { padding: 0 4px; }
  .side .section { padding: 0; }
  .main { padding: 24px 16px 48px; }
  h1 { font-size: 22px; }
  .pagehead { margin-bottom: 20px; }
  .facts { gap: 12px 24px; }
  .tbl th, .tbl td { padding: 10px 12px; }
  .card { padding: 28px 22px; }
  .topbar { padding: 0 16px; }
  .mon { padding: 1rem 1.2rem; }
  .q { padding: 14px 14px 12px; }
  .qactions .spacer { flex: 0 0 100%; height: 0; }
  .red-main .toolbar .search-field { min-width: 100%; }
}

/* ---------- Navigation mit Symbolen ---------- */
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.side nav a .ico { color: var(--ink-3); }
.side nav a.active .ico, .side nav a:hover .ico { color: var(--accent); }

/* ---------- Geführtes Anlegen (Schritte) ---------- */
.steps { display: flex; gap: 8px; list-style: none; margin: 0 0 28px; padding: 0; counter-reset: s; }
.steps li { display: flex; align-items: center; gap: 8px; flex: 1; padding: 10px 0; font-size: 14px; color: var(--ink-3); border-top: 2px solid var(--line); }
.steps li span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-3); }
.steps li.active { color: var(--ink); font-weight: 600; border-top-color: var(--accent); }
.steps li.active span { background: var(--accent); color: var(--accent-ink); }
.steps li.done { color: var(--ink-2); border-top-color: var(--accent-line); }
.steps li.done span { background: var(--accent-soft); color: var(--accent); }
.wizard .step { max-width: 560px; }

/* ---------- Nächste Schritte (Checkliste) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.checklist li { display: flex; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .mark { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; }
.checklist li.done .mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.checklist .mark svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.checklist .ct { flex: 1; min-width: 0; }
.checklist .ct p { margin: 4px 0 10px; color: var(--ink-2); font-size: 14px; max-width: 70ch; }
.checklist li.done .ct p { margin-bottom: 0; }
.checklist li.done .ct strong { color: var(--ink-2); }
.checklist li.done .actions { margin-top: 10px; }
.kvs { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px 10px; align-items: center; width: 100%; }
.kvs .k { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.kvs code { font-size: 12px; padding: 5px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .kvs { grid-template-columns: 1fr auto; } .kvs .k { grid-column: 1 / -1; } .steps li { font-size: 12px; } }

/* ---------- Vorschau im Veranstaltungsformular ---------- */
.fs.full { grid-column: 1 / -1; }
.preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-top: 8px; }
.preview-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.preview-bar .k { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { height: 30px; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 0; border-right: 1px solid var(--line-strong); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--ink); color: #fff; }
.preview-frame { position: relative; background: #e9e8e2; overflow: hidden; display: flex; justify-content: center; }
.preview-frame iframe { border: 0; background: #fff; transform-origin: top left; pointer-events: none; }
.preview-frame.desktop { height: 420px; justify-content: flex-start; }
.preview-frame.desktop iframe { width: 1280px; height: 840px; transform: scale(.5); }
.preview-frame.mobile { height: 520px; padding: 16px 0; }
.preview-frame.mobile iframe { width: 390px; height: 844px; transform: scale(.58); border-radius: 18px; border: 6px solid #2a2a28; margin-bottom: calc(-844px * .42); }
@media (max-width: 900px) { .preview-frame.mobile iframe { transform: scale(.5); } }

/* ---------- Suchfeld mit Lupe ---------- */
.search-field { position: relative; display: block; flex: 1; min-width: 260px; max-width: 480px; margin: 0; }
.search-field .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-field input { height: 42px !important; padding-left: 40px !important; font-size: 15px; }  /* !important: schlägt die allgemeine Feldregel */
.search-field input::-webkit-search-decoration { -webkit-appearance: none; }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; width: 14px; height: 14px; cursor: pointer; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M3 3l8 8M11 3l-8 8' stroke='%238b8a83' stroke-width='1.6' stroke-linecap='round'/></svg>") no-repeat center; }
.toolbar form.search { max-width: none; }
