:root {
  --bg: #0f1218;
  --panel: #161b23;
  --panel-2: #1c222c;
  --line: #262e3a;
  --text: #e7ebf2;
  --muted: #8b95a5;
  --accent: #4f8cff;
  --accent-dim: #23375c;

  --richtig: #2f9e5f;
  --falsch: #d64545;
  --irrefuehrend: #d99a2b;
  --nicht_belegt: #6b7280;
  --nicht_pruefbar: #4b5563;

  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
}

body { overflow: hidden; }

body.desk {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

button { font: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- Desk */

.desk header {
  flex: 0 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  font-weight: 700;
  letter-spacing: .3px;
  font-size: 16px;
}
.brand span { color: var(--accent); }

.event { color: var(--muted); font-size: 13px; flex: 1; }

.status { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--nicht_belegt); display: inline-block;
}
.dot.on { background: var(--richtig); }

.desk main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 440px;
  /* Ohne minmax(0, 1fr) waechst die Zeile mit dem Inhalt und nichts scrollt. */
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

/* Transkript */

.transcript {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.transcript-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.transcript-head .spacer { flex: 1; }

#segments {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 120px;
  scroll-behavior: smooth;
}

/* Sprecher-Leiste */

.speaking {
  color: var(--text);
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.speaker-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.speaker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  transition: border-color .12s, background .12s;
}

.speaker-btn i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.speaker-btn:hover { border-color: var(--accent-dim); }

.speaker-btn.on {
  border-width: 2px;
  padding: 4px 10px;
  color: #fff;
}

.speaker-btn.auto {
  margin-left: auto;
  color: var(--muted);
  font-weight: 500;
}
.speaker-btn.auto.on { color: var(--text); border-color: var(--accent); }

.transcript-hint {
  padding: 7px 16px;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  line-height: 1.4;
}

/* Schwebender Prüf-Knopf bei Textauswahl */

.sel-btn {
  position: fixed;
  z-index: 60;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.sel-btn.hidden { display: none; }

.seg {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.seg:hover { background: var(--panel); }
.seg.active { background: var(--panel-2); border-color: var(--accent-dim); }

.seg .meta {
  font-size: 11px;
  color: var(--muted);
  padding-top: 3px;
  line-height: 1.5;
}

.seg .speaker {
  display: inline-block;
  font-weight: 600;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  color: #0b0e13;
  margin-bottom: 3px;
  background: #6b7280;
}

.seg .text { line-height: 1.55; }
.seg.selected { box-shadow: inset 2px 0 0 var(--accent); }

/* Bereits gepusht */
.seg.done { position: relative; box-shadow: inset 3px 0 0 var(--richtig); }
.seg.done::after {
  content: "✓";
  position: absolute;
  top: 9px;
  right: 12px;
  color: var(--richtig);
  font-weight: 800;
  font-size: 14px;
}
.seg.done .text { opacity: .78; }

/* Mehrfachauswahl */

.seg-pick {
  margin-top: 6px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}
.seg-pick:hover { color: var(--text); border-color: var(--accent); }

.seg.picked { background: var(--panel-2); border-color: var(--accent); }
.seg.picked .seg-pick { background: var(--accent); border-color: var(--accent); color: #fff; }

.sel-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--accent-dim);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.sel-bar.hidden { display: none; }
.sel-bar span { flex: 1; }
.sel-bar button { font-size: 12px; padding: 5px 10px; }

/* Zahlenanzeige im Desk */

.fig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fig-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.fig-grid label { margin-top: 8px; }
.fig-grid input { font-size: 12px; padding: 6px 8px; }

.fig-preview {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fig-preview-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.fig-preview-value span { font-size: 14px; font-weight: 600; margin-left: 5px; color: var(--muted); }

.fig-preview-bar {
  position: relative;
  height: 8px;
  background: var(--panel-2);
  border-radius: 5px;
  margin: 12px 0 5px;
}

.fig-mark {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 16px;
  transform: translateX(-1.5px);
  border-radius: 2px;
}
.fig-mark.value { background: var(--richtig); }
.fig-mark.compare { background: var(--falsch); }

.fig-preview-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }

.fig-off { font-size: 11px; color: var(--muted); }

/* Zahlenanzeige auf der iPad-Karte */

.fig {
  margin: 4px 0 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #f4f6fa;
  border: 1px solid #e3e7ee;
}

.fig-value {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  color: #10141a;
}
.fig-unit { font-size: 28px; font-weight: 700; margin-left: 6px; color: #4a5361; }
.fig-label { font-size: 15px; color: #5c6675; margin-top: 6px; }

.fig-scale {
  position: relative;
  height: 10px;
  background: #dfe3ea;
  border-radius: 6px;
  margin: 20px 0 6px;
}

.fig-mark.is-value { background: #1f9d55; }
.fig-mark.is-compare { background: #d64545; }
.fig-mark span {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  white-space: nowrap;
  color: #4a5361;
}

.fig-scale-labels { display: flex; justify-content: space-between; font-size: 11px; color: #8a93a0; }

/* ------------------------------------------------------------- Dossier-Editor */

.editor-wrap { max-width: 1200px; }

.editor-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  align-items: start;
}

.editor-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  max-height: 70vh;
  overflow: auto;
}

.editor-file {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 500;
}
.editor-file:hover { color: var(--text); background: var(--panel-2); }
.editor-file.on { color: var(--accent); border-color: var(--accent-dim); background: var(--panel-2); }

.editor-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.editor-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.editor-bar span {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, Consolas, monospace;
}

#content {
  width: 100%;
  min-height: 58vh;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  tab-size: 2;
}

@media (max-width: 820px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-files { flex-direction: row; flex-wrap: wrap; max-height: none; }
}

/* Eingeklapptes Panel nach dem Push */

.desk main.collapsed { grid-template-columns: 1fr 118px; }

.panel-mini {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 8px;
  height: 100%;
}

.panel.collapsed .panel-mini { display: flex; }
.panel.collapsed .panel-scroll,
.panel.collapsed .pushbar { display: none; }

.mini-check {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--richtig);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(47, 158, 95, .35);
  animation: popIn .25s ease-out;
}

@keyframes popIn {
  from { transform: scale(.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.mini-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  text-align: center;
}

.mini-party {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.mini-open {
  margin-top: auto;
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 500;
}
.mini-open:hover { color: var(--text); border-color: var(--accent); }

.empty {
  color: var(--muted);
  padding: 40px 20px;
  text-align: center;
  line-height: 1.7;
}

/* Panel */

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
}

.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 24px;
}

.block { margin-bottom: 18px; }

.block-head, label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 7px;
}

textarea, input, select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  resize: vertical;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.row { display: flex; gap: 8px; margin-top: 8px; }

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 600;
}

button:hover { filter: brightness(1.08); }
button:disabled { opacity: .4; cursor: not-allowed; filter: none; }

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Treffer */

.matches { display: flex; flex-direction: column; gap: 6px; }

.match {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  font-weight: 400;
}

.match:hover { border-color: var(--accent-dim); background: var(--panel-2); }

.match .t { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.match .s { font-size: 11px; color: var(--muted); }
.match .w { color: var(--accent); font-weight: 600; }

.badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-right: 4px;
}
.badge.ok { color: var(--richtig); border-color: #24513a; }

/* Verdikte */

.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.verdicts button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 500;
  padding: 8px;
  font-size: 13px;
}

.verdicts button.on[data-v="richtig"] { background: var(--richtig); border-color: var(--richtig); }
.verdicts button.on[data-v="falsch"] { background: var(--falsch); border-color: var(--falsch); }
.verdicts button.on[data-v="irrefuehrend"] { background: var(--irrefuehrend); border-color: var(--irrefuehrend); color: #1a1205; }
.verdicts button.on[data-v="nicht_belegt"] { background: var(--nicht_belegt); border-color: var(--nicht_belegt); }
.verdicts button.on[data-v="nicht_pruefbar"] { background: var(--nicht_pruefbar); border-color: var(--nicht_pruefbar); }

/* Quellen */

.source {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  margin-bottom: 5px;
  font-size: 12px;
}

.source .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source a { color: var(--accent); text-decoration: none; }
.source button { background: transparent; color: var(--muted); padding: 0 4px; font-size: 15px; }

.source-add { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 5px; margin-top: 6px; }
.source-add input { font-size: 12px; padding: 6px 8px; }
.source-add button { padding: 0; }

/* Push-Leiste */

.pushbar {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
}

.problems { flex: 1; font-size: 12px; color: var(--muted); line-height: 1.4; }
.problems.bad { color: var(--irrefuehrend); }
.problems.good { color: var(--richtig); }

#pushBtn { padding: 11px 18px; font-size: 14px; }

/* Toast */

#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--falsch); color: #ffd6d6; }

/* --------------------------------------------------------------- iPad */

body.live {
  background: #0b0d12;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
}

.live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 22px 8px;
  color: #6b7484;
  font-size: 13px;
  letter-spacing: .6px;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.live-meta { display: flex; align-items: center; gap: 12px; }
.live-left { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
#eventName { color: #6b7484; font-size: 12px; letter-spacing: .4px; }

/* --- Buehne: die grosse Karte ---------------------------------------- */

.stage {
  flex: 0 0 auto;
  min-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 22px 8px;
}

.live-idle {
  text-align: center;
  color: #4d5566;
  font-size: 20px;
  line-height: 1.6;
}
.live-idle strong { display: block; font-size: 28px; color: #6b7484; margin-bottom: 8px; }

.card {
  position: relative;
  width: min(1180px, 97vw);
  max-height: 46vh;
  overflow: hidden;
  background: #ffffff;
  color: #10141a;
  border-radius: 20px;
  padding: 26px 34px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  animation: pop .26s cubic-bezier(.2,.9,.3,1.2);
}

@keyframes pop {
  from { transform: scale(.965); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.countdown {
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  animation-name: shrink;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes shrink {
  from { width: 100%; }
  to { width: 0; }
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.party {
  font-weight: 800;
  font-size: 18px;
  padding: 5px 12px;
  border-radius: 7px;
  color: #fff;
  background: #444;
}

.verdict-pill {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .5px;
  padding: 5px 12px;
  border-radius: 7px;
  color: #fff;
  text-transform: uppercase;
}

.card-time { margin-left: auto; color: #8a93a0; font-size: 16px; }

.card-claim {
  font-size: 19px;
  color: #5c6675;
  line-height: 1.4;
  border-left: 4px solid #dfe3ea;
  padding-left: 14px;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-text {
  font-size: 31px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.3px;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-sources {
  border-top: 1px solid #e3e7ee;
  padding-top: 12px;
  font-size: 15px;
  color: #4a5361;
  line-height: 1.45;
}

.card-sources .lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8a93a0;
  margin-bottom: 4px;
}

.card-sources a { color: #1653c7; text-decoration: none; }

/* Karte aus dem Verlauf */

.card.review { box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 3px rgba(255, 255, 255, .18); }

.review-badge {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8a93a0;
  border: 1px solid #dfe3ea;
  border-radius: 5px;
  padding: 2px 8px;
}

.review-close {
  background: transparent;
  border: none;
  color: #8a93a0;
  font-size: 26px;
  line-height: 1;
  padding: 0 2px 4px;
  cursor: pointer;
}
.review-close:hover { color: #10141a; }

.history-rows { -webkit-overflow-scrolling: touch; }

/* --- Verlauf: Tabelle ------------------------------------------------- */

.history {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 22px 16px;
}

.history-head,
.hrow {
  display: grid;
  grid-template-columns: 70px 122px 132px 1fr;
  gap: 14px;
  align-items: center;
}

.history-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5c6675;
  padding: 6px 12px 7px;
  border-bottom: 1px solid #1b212b;
  flex: 0 0 auto;
}

.history-rows {
  overflow-y: auto;
  padding-top: 6px;
  flex: 1;
  min-height: 0;
}

.hrow {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  border: none;
  border-left: 4px solid transparent;
  padding: 10px 12px;
  border-radius: 8px;
  background: #12161d;
  margin-bottom: 5px;
  font-size: 14px;
  color: #c7ced9;
  transition: filter .1s;
}

.hrow:active { filter: brightness(1.4); }
.hrow.active { outline: 2px solid rgba(255, 255, 255, .28); outline-offset: -2px; }

.hrow.richtig { border-left-color: #2f9e5f; background: rgba(47, 158, 95, .11); }
.hrow.falsch { border-left-color: #d64545; background: rgba(214, 69, 69, .11); }
.hrow.irrefuehrend { border-left-color: #d99a2b; background: rgba(217, 154, 43, .11); }
.hrow.nicht_belegt { border-left-color: #6b7280; background: rgba(107, 114, 128, .11); }
.hrow.nicht_pruefbar { border-left-color: #4b5563; background: rgba(75, 85, 99, .09); }

.c-time { color: #6b7484; font-variant-numeric: tabular-nums; }
.c-party { display: flex; align-items: center; gap: 7px; font-weight: 600; color: #e6eaf1; }
.c-party i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.c-verdict { font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.c-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.history-empty {
  color: #4d5566;
  font-size: 15px;
  padding: 14px 12px;
}
.history-empty.hidden { display: none; }

@media (max-width: 1200px) {
  .desk main { grid-template-columns: 1fr 400px; }
  .card-text { font-size: 26px; }
  .history-head, .hrow { grid-template-columns: 62px 108px 118px 1fr; }
}

/* --------------------------------------------------------- KI-Vorschlag */

.ai-state {
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 400;
}

.mini-toggle {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.mini-toggle input { width: auto; }

.ai-body { min-height: 40px; }

.ai-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  padding: 12px;
}

.ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }

.ai-verdict {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 5px;
  color: #fff;
}
.ai-verdict.richtig { background: var(--richtig); }
.ai-verdict.falsch { background: var(--falsch); }
.ai-verdict.irrefuehrend { background: var(--irrefuehrend); color: #1a1205; }
.ai-verdict.nicht_belegt { background: var(--nicht_belegt); }
.ai-verdict.nicht_pruefbar { background: var(--nicht_pruefbar); }

.ai-conf { font-size: 11px; color: var(--muted); }

.ai-text { font-size: 14px; line-height: 1.5; }
.ai-text.missing { color: var(--muted); font-style: italic; }

.ai-src { margin-top: 9px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.ai-src a { color: var(--accent); text-decoration: none; }
.ai-src .lbl { text-transform: uppercase; letter-spacing: .6px; font-size: 10px; }

.ai-warning {
  margin-top: 9px;
  font-size: 11px;
  color: var(--irrefuehrend);
  line-height: 1.4;
}

.ai-reason {
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.ai-actions { display: flex; gap: 6px; margin-top: 11px; }
.ai-actions button { font-size: 12px; padding: 7px 11px; }

.scope-row { margin-top: 10px; }
.scope-row input { font-size: 11px; padding: 6px 8px; }

.spin {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid var(--accent-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -1px;
  margin-right: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ai-banner {
  background: #2a2410;
  border: 1px solid #4a3f1a;
  color: #e8d9a8;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.ai-banner strong { display: block; margin-bottom: 3px; color: #f3e2b0; }
.ai-banner a { color: #ffd76e; font-weight: 600; text-decoration: none; }
.ai-banner a:hover { text-decoration: underline; }
.ai-banner.hidden { display: none; }

/* ------------------------------------------------------- Einstellungen */

body.settings-page { overflow-y: auto; }

.settings-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 20px 90px;
}

.settings-head h1 { font-size: 24px; margin: 10px 0 4px; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.sub { color: var(--muted); font-size: 13px; margin: 0; }

.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-top: 16px;
}

.box h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin: 0 0 12px;
}

.box label { margin-top: 12px; }
.box input, .box select { margin-bottom: 2px; }

.hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; line-height: 1.5; }

.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.presets button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
  font-weight: 500;
}
.presets button:hover { border-color: var(--accent); }

.keyline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.link {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  font-size: 12px;
  padding: 0;
  font-weight: 400;
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--text);
  margin-top: 14px;
}
.check input { width: auto; margin: 0; }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }

.note {
  background: #2a2410;
  border: 1px solid #4a3f1a;
  color: #e8d9a8;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-top: 14px;
  line-height: 1.5;
}

.hidden { display: none; }

.effective dl { margin: 0; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.effective dl div { display: grid; grid-template-columns: 140px 1fr; }
.effective dt { color: var(--muted); }
.effective dd { margin: 0; word-break: break-all; }

.settings-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.settings-link:hover { color: var(--text); border-color: var(--accent); }

/* ------------------------------------------------------------ Navigation */

.nav {
  position: fixed;
  top: 9px;
  right: 12px;
  z-index: 200;
}

.nav-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
}
.nav-btn:hover { color: var(--text); border-color: var(--accent); }

.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}

.nav-menu.hidden { display: none; }

.nav-menu a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
}
.nav-menu a:hover { background: var(--panel-2); }
.nav-menu a.on { color: var(--accent); font-weight: 600; }

.brand-link {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .3px;
  color: var(--text);
  line-height: 1.25;
}
.brand-link span { color: var(--accent); margin-left: 1px; }
.brand-link:hover span { text-decoration: underline; }

.desk header { padding-right: 118px; }
.live-head { padding-right: 118px; }
.sp-head { padding-right: 118px; }
.settings-head { padding-right: 118px; }

.test-result {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
}
.test-result.ok { border-color: #24513a; background: rgba(47, 158, 95, .12); color: #9be3bb; }
.test-result.bad { border-color: #5a2626; background: rgba(214, 69, 69, .12); color: #ffb3b3; }
.test-result.hidden { display: none; }

.row input[type="file"] {
  padding: 7px;
  font-size: 12px;
  color: var(--muted);
}
.row input[type="file"]::file-selector-button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 9px;
  margin-right: 10px;
  font: inherit;
  cursor: pointer;
}

/* ------------------------------------------------- Sprecher-Seite (iPad) */

body.speaker-page {
  background: #0b0d12;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.sp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 24px 10px;
  flex: 0 0 auto;
}

.sp-title { font-size: 30px; font-weight: 800; letter-spacing: -.3px; }
.sp-sub { color: #8b95a5; font-size: 17px; margin-top: 4px; }

.sp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7484;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding-top: 8px;
}

.sp-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 10px 24px 14px;
  align-content: start;
}

.sp-btn {
  position: relative;
  min-height: 128px;
  border-radius: 16px;
  border: 2px solid #262e3a;
  background: #161b23;
  color: #e7ebf2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding: 20px 22px;
  text-align: left;
  transition: transform .08s, border-color .12s;
}

.sp-btn:hover { border-color: #35507d; }
.sp-btn:active { transform: scale(.98); }
.sp-btn.on { border-color: transparent; box-shadow: 0 12px 34px rgba(0, 0, 0, .45); }
.sp-btn.on .sp-name { color: #fff; }

.sp-dot { width: 14px; height: 14px; border-radius: 50%; }
.sp-name { font-size: 24px; font-weight: 700; line-height: 1.2; }
.sp-check { position: absolute; top: 12px; right: 16px; font-size: 24px; font-weight: 800; color: #fff; }

.sp-foot { padding: 8px 24px 22px; flex: 0 0 auto; }

.sp-auto {
  width: 100%;
  background: transparent;
  border: 1px solid #262e3a;
  color: #8b95a5;
  border-radius: 12px;
  padding: 15px;
  font-size: 15px;
  font-weight: 500;
}
.sp-auto.on { border-color: #4f8cff; color: #e7ebf2; }

/* ------------------------------------------------------------- Audio-Seite */

.audio-page .settings-wrap { max-width: 780px; }

.meter {
  height: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 14px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  background: var(--nicht_belegt);
  transition: width .08s linear;
}

.audio-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.audio-stats {
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.audio-stats div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.audio-stats dt { color: var(--muted); }
.audio-stats dd { margin: 0; word-break: break-word; }

/* --------------------------------------------------------------- Startseite */

.start-wrap { max-width: 900px; }

.start-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-bottom: 6px;
}

.settings-head h1 { font-size: 24px; margin: 10px 0 4px; }
.settings-head .brand-link,
.tr-head .brand-link,
.start-head .brand-link { display: flex; margin-bottom: 8px; }
.sp-head .brand-link { display: flex; margin-bottom: 8px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .12s, transform .08s;
}
.link-card:hover { border-color: var(--accent); }
.link-card:active { transform: scale(.99); }
.link-card .ico { font-size: 18px; color: var(--accent); }
.link-card .name { font-size: 16px; font-weight: 700; }
.link-card .desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

.pill {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.ok { color: #9be3bb; border-color: #24513a; background: rgba(47, 158, 95, .12); }
.pill.bad { color: #ffb3b3; border-color: #5a2626; background: rgba(214, 69, 69, .12); }

/* ------------------------------------------------------------- Transkript */

.tr-wrap { max-width: 920px; }
.tr-head h1 { font-size: 28px; margin: 6px 0 4px; }

.tr-tools {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 16px 0 12px;
}
.tr-tools input { flex: 1; }

.tr-list { display: flex; flex-direction: column; gap: 10px; }

.tr-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.tr-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tr-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.tr-check {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
}
.tr-check:hover { color: var(--text); border-color: var(--accent); }

.tr-text { margin: 0; font-size: 16px; line-height: 1.6; }

.transcript-page .history-empty { padding: 22px 4px; }

/* -------------------------------------------------------------- Sessions */

.session-chip {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0 0 14px;
}

.session-label { font-size: 12px; color: var(--muted); flex: 1 1 220px; min-width: 0; }
.session-bar select { flex: 0 1 280px; font-size: 12px; padding: 6px 8px; }
.session-bar button { font-size: 12px; padding: 6px 10px; }

.sessions-list { display: flex; flex-direction: column; gap: 8px; }

.session-row {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.s-main { flex: 1; min-width: 0; }
.s-name { font-weight: 600; font-size: 14px; }
.s-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

.s-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.s-actions a {
  text-decoration: none;
  font-size: 11px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
}
.s-actions a:hover { color: var(--text); border-color: var(--accent); }
.s-actions button { font-size: 11px; padding: 6px 10px; }
.s-actions .danger:hover { color: #ffb3b3; border-color: #5a2626; }

/* ------------------------------------------------------------------ Login */

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-wrap { width: 100%; max-width: 400px; padding: 20px; }

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
}

.login-card h1 { font-size: 22px; margin: 4px 0 6px; }
.login-card input { margin-top: 16px; font-size: 16px; padding: 12px; }
.login-card button { width: 100%; margin-top: 10px; padding: 12px; font-size: 15px; }

.login-msg { margin-top: 10px; font-size: 13px; min-height: 18px; color: var(--muted); }
.login-msg.bad { color: #ffb3b3; }

.nav-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ------------------------------------------------------- Admin-Passwort */

.gate {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 300;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
}

.gate-card h2 { font-size: 21px; margin: 4px 0 6px; }
.gate-card input { margin-top: 16px; font-size: 16px; padding: 12px; }
.gate-card button { width: 100%; margin-top: 10px; padding: 12px; font-size: 15px; }

@media (max-width: 600px) {
  .sp-title { font-size: 24px; }
  .sp-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 14px; }
  .sp-btn { min-height: 100px; padding: 14px; }
  .sp-name { font-size: 19px; }
}
