:root {
  --brand: #2f6f8f;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #667085;
  --line: #e2e5ea;
  --danger: #c0392b;
  --ok: #2e8b57;
  --radius: 14px;
  --fs: 1.25rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --card: #1b212a;
    --text: #e8ecf1;
    --muted: #98a2b3;
    --line: #2c3440;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
[hidden] { display: none !important; }

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--brand); color: #fff;
}
.topbar img { height: 34px; width: auto; border-radius: 6px; }
.topbar .brand { font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
.topbar .tagline { font-size: .8rem; opacity: .85; font-weight: 400; }
.topbar .spacer { flex: 1; }
.topbar a, .topbar button.link { color: #fff; opacity: .9; font-size: .9rem; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; white-space: nowrap;
  background: rgba(127, 127, 127, .18);
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .6; }
.pill.live { background: #fff; color: var(--danger); }
.pill.live::before { opacity: 1; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Bausteine ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }
button, select, input { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 9px 16px; cursor: pointer;
}
button:hover { border-color: var(--brand); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
button.small { padding: 4px 10px; font-size: .85rem; }
button.link { border: 0; background: none; padding: 0; text-decoration: underline; }
input[type=text], input[type=password], select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
label { display: block; font-size: .85rem; color: var(--muted); margin: 12px 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: .9rem; }
.error { color: var(--danger); font-size: .9rem; }
.notice {
  border-left: 4px solid var(--danger); background: rgba(192, 57, 43, .1);
  padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: .92rem;
}

/* ---------- Zuhörer-Seite ---------- */
.listener { display: flex; flex-direction: column; height: 100dvh; }
.event { padding: 12px 16px 0; }
.event h1 { margin: 0; font-size: 1.15rem; }
.langs {
  display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto;
  border-bottom: 1px solid var(--line); scrollbar-width: thin;
}
.langs button { border-radius: 999px; white-space: nowrap; flex: none; }
.langs button[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.transcript {
  flex: 1; overflow-y: auto; padding: 16px 16px 40vh;
  font-size: var(--fs); line-height: 1.55; scroll-behavior: smooth;
}
.transcript p { margin: 0 0 .7em; max-width: 46em; color: var(--muted); transition: color .6s; }
.transcript p.new, .transcript p:last-of-type { color: var(--text); }
.transcript p.partial { color: var(--muted); font-style: italic; }
.transcript .hint { color: var(--muted); font-size: 1rem; text-align: center; margin-top: 18vh; }
.toolbar {
  position: fixed; right: 12px; bottom: 12px; display: flex; gap: 6px;
}
.toolbar button { border-radius: 999px; min-width: 44px; height: 44px; padding: 0 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }

/* ---------- Admin ---------- */
.admin { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.admin .wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .admin { grid-template-columns: 1fr; } }
.login { max-width: 360px; margin: 12vh auto; }
.timer { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.meter { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 6px; }
.meter div { height: 100%; width: 0; background: var(--ok); transition: width .1s linear; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .88rem; }
.qr { margin-top: 14px; gap: 16px; }
.qr img { border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.qr p { margin: 0 0 6px; }
.qr a { color: var(--brand); }
.monitor { max-height: 260px; overflow-y: auto; font-size: .95rem; }
.monitor p { margin: 0 0 .4em; }
.monitor p.partial { color: var(--muted); font-style: italic; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; }
td .row { gap: 6px; }
td a { color: var(--brand); }

/* ---------- QR-Seite (Beamer/Aushang) ---------- */
.poster { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5vh; padding: 4vh 5vw; text-align: center; }
.poster img.logo { height: 9vh; }
.poster h1 { margin: 0; font-size: clamp(1.6rem, 5vh, 4rem); }
.poster .sub { font-size: clamp(1rem, 2.8vh, 2rem); color: var(--muted); }
.poster img.code { height: min(52vh, 80vw); width: auto; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.poster .url { font-size: clamp(1.1rem, 3.4vh, 2.4rem); font-weight: 700; color: var(--brand); word-break: break-all; }
.poster .names { font-size: clamp(.95rem, 2.4vh, 1.6rem); color: var(--muted); max-width: 60em; }
@media print { .poster { color: #000; } }
