:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #efefeb;
  --text: #1b1c1e;
  --muted: #62656b;
  --border: #dddcd6;
  --accent: #1f5f8b;
  --accent-text: #ffffff;
  --accent-soft: #e3eef6;
  --rec: #c8322b;
  --rec-soft: #fbe7e5;
  --ok: #2c7a4b;
  --ok-soft: #e2f2e8;
  --warn: #9a6200;
  --warn-soft: #fbf0d9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .04);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --surface: #1d1f22;
    --surface-2: #26292d;
    --text: #ececea;
    --muted: #9da1a8;
    --border: #33363b;
    --accent: #6fb0e0;
    --accent-text: #0d1b26;
    --accent-soft: #1d3142;
    --rec: #ff6b61;
    --rec-soft: #3a1f1d;
    --ok: #6fcf97;
    --ok-soft: #1c3226;
    --warn: #f0b75a;
    --warn-soft: #3a2f1a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
[hidden] { display: none !important; }

.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.wrap.wide { max-width: 1040px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 650; color: var(--muted); font-size: .95rem; margin-bottom: 20px;
}
.brand .logo {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; color: var(--accent-text);
}
.brand .spacer { flex: 1; }
.brand { flex-wrap: wrap; row-gap: 8px; }
.brand .chip { font-weight: 600; }
@media (max-width: 480px) { .brand #render-chip { order: 10; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=tel] {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent); }
input.pin {
  font-family: var(--mono); font-size: 2rem; letter-spacing: .35em; text-align: center; padding: 14px 8px;
}

.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }

button, .btn {
  font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 10px;
  padding: 12px 18px; cursor: pointer; background: var(--accent); color: var(--accent-text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  min-height: 46px;
}
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { font-size: 1.1rem; min-height: 56px; }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--rec); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .9rem; }

.notice { border-radius: 10px; padding: 12px 14px; font-size: .95rem; }
.notice.info { background: var(--accent-soft); }
.notice.warn { background: var(--warn-soft); color: var(--text); }
.notice.err { background: var(--rec-soft); color: var(--text); }
.notice.ok { background: var(--ok-soft); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600;
  padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.chip.rec { background: var(--rec-soft); color: var(--rec); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* Pegelanzeige */
.meter { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .1s linear; border-radius: 99px; }
.meter.big { height: 16px; }

/* Handy: Aufnahme-Ansicht */
.rec-hero { text-align: center; padding: 28px 12px 8px; }
.rec-ring {
  width: 132px; height: 132px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  background: var(--rec-soft); color: var(--rec); position: relative;
}
.rec-ring::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--rec);
  opacity: .35; animation: ring 2s ease-out infinite;
}
.rec-ring.paused { background: var(--warn-soft); color: var(--warn); }
.rec-ring.paused::after { display: none; }
.rec-ring.idle { background: var(--accent-soft); color: var(--accent); }
.rec-ring.idle::after { display: none; }
@keyframes ring { from { transform: scale(.92); opacity: .5; } to { transform: scale(1.12); opacity: 0; } }
.timer { font-family: var(--mono); font-size: 2.4rem; font-weight: 600; letter-spacing: .02em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats div { background: var(--surface-2); border-radius: 10px; padding: 10px 4px; }
.stats b { display: block; font-size: 1.15rem; font-family: var(--mono); }
.stats span { font-size: .75rem; color: var(--muted); }

.overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 12, .72); display: grid; place-items: center;
  padding: 16px; z-index: 50;
}
.overlay .card { max-width: 420px; width: 100%; }

/* Moderator */
.host-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .host-grid { grid-template-columns: 1fr; } }
.pin-big { font-family: var(--mono); font-size: 2.6rem; font-weight: 700; letter-spacing: .12em; text-align: center; }
.qr { background: #fff; border-radius: 12px; padding: 8px; display: block; width: 100%; max-width: 260px; margin: 0 auto; }
.join-url { font-family: var(--mono); font-size: .8rem; word-break: break-all; text-align: center; }

table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--surface-2); }
.table-scroll { overflow-x: auto; }

.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.progress.indet > i { width: 30% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { margin-left: -30%; } to { margin-left: 100%; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 -20px 16px; padding: 0 12px; overflow-x: auto; }
.tabs button {
  background: none; color: var(--muted); border-radius: 0; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 12px; min-height: 0;
}
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); }

.utt { display: grid; grid-template-columns: 76px 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.utt:last-child { border-bottom: 0; }
.utt .ts { font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: 3px; background: none; border: 0; min-height: 0; padding-left: 0; padding-right: 0; justify-content: flex-start; font-weight: 400; }
.utt .ts:hover { color: var(--accent); }
.utt .who { font-weight: 650; font-size: .9rem; }
.utt .text { grid-column: 2; }
.utt .unsure { text-decoration: underline dotted var(--warn); text-underline-offset: 3px; }
.utt.low .text { color: var(--muted); }
.spk { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

.prose { line-height: 1.6; }
.prose h1 { font-size: 1.4rem; }
.prose h2 { font-size: 1.15rem; margin-top: 1.4em; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1rem; margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }

audio { width: 100%; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: .95rem; z-index: 60; max-width: calc(100% - 32px);
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
