/* ============================================================
   OBT Meet — OrangeBayTech Designsystem
   Marke: llh-knowledge/orangebytech/website
   Fonts self-hosted (NFR-3: keine externen Requests)
   ============================================================ */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('assets/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('assets/jetbrains-mono.woff2') format('woff2');
}

:root {
  --bg: #0c080e;
  --surface: #160f1a;
  --surface-2: #1e1526;
  --border: #2e2040;
  --text: #f2dfc0;
  --muted: #907868;
  --acc: #ff6520;
  --acc-deep: #e85510;
  --acc-dim: rgba(255, 101, 32, 0.12);
  --glow: rgba(255, 101, 32, 0.28);
  --green: #28ca41;
  --red: #ff4444;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* Muss vor allen display-Regeln gewinnen: sonst überstimmt z.B. `display:flex`
   das HTML-Attribut `hidden` (UA-Stylesheet ist schwächer als Autor-CSS). */
[hidden] { display: none !important; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg); color: var(--text);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 72% -10%, rgba(255,101,32,0.075), transparent 65%),
    radial-gradient(700px 500px at -10% 110%, rgba(120,60,190,0.06), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .028;
  background-image: url('assets/noise.svg');
}
main, .topbar { position: relative; z-index: 1; }

/* ── Screen-Umschaltung ──
   Zentrierte Screens direkt hier als flex — sonst überstimmt diese Regel
   (höhere Spezifität) das Layout weiter unten. */
.screen { display: none; }
body[data-screen="join"]  #s-join,
body[data-screen="wait"]  #s-wait,
body[data-screen="ended"] #s-ended,
body[data-screen="error"] #s-error {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100dvh - 56px);
  padding: 2rem 1.25rem calc(2rem + var(--safe-b));
}
body[data-screen="call"] #s-call { display: block; }
body[data-screen="call"] { overflow: hidden; }

/* ── Topbar ── */
.topbar {
  height: 56px; padding: 0 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(12,8,14,.82); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.wordmark { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: .95rem;
  letter-spacing: -0.02em; white-space: nowrap; }
.wordmark .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); flex-shrink: 0; }
.topbar .title { font-weight: 700; font-size: .9rem; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .meta { display: flex; align-items: center; gap: .9rem;
  font-family: var(--mono); font-size: .7rem; color: var(--muted); white-space: nowrap; }

.live-pill { display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .66rem; color: var(--green);
  background: rgba(40,202,65,.08); border: 1px solid rgba(40,202,65,.2);
  padding: .18rem .55rem; border-radius: 100px; }
.live-pill.ready { color: var(--acc); background: var(--acc-dim); border-color: rgba(255,101,32,.3); }
.live-pill.ready .live-dot { background: var(--acc); }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Aufzeichnung — sichtbar für ALLE Teilnehmer, nicht nur für den Aufnehmenden (§ 201 StGB) */
.rec-pill { display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .66rem; color: var(--red);
  background: rgba(255,68,68,.1); border: 1px solid rgba(255,68,68,.35);
  padding: .18rem .55rem; border-radius: 100px; }
.rec-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); animation: pulse 2s infinite; }

/* ── Typo ── */
.eyebrow { font-family: var(--mono); font-size: .68rem; color: var(--acc);
  text-transform: uppercase; letter-spacing: .14em; }
.h-xl { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.sub { color: var(--muted); font-size: .92rem; line-height: 1.65; }
.sub b { color: var(--text); font-weight: 600; }
.mono { font-family: var(--mono); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }

/* ── Buttons ── */
.btn { font: inherit; cursor: pointer; border: 0; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent; }
.btn:focus-visible, .ctl:focus-visible, .input:focus-visible, .send:focus-visible,
.vids-toggle:focus-visible, .vtoggle:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.btn-primary { background: var(--acc); color: var(--bg); font-weight: 700; font-size: 1rem;
  padding: .95rem 1.6rem; letter-spacing: -0.01em; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 30px var(--glow); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 500; font-size: .85rem; padding: .6rem 1rem; }
.btn-ghost:hover { color: var(--text); }

/* ── Inputs ── */
.field label { display: block; font-family: var(--mono); font-size: .65rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: .45rem; }
.input { width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: .8rem .95rem; font-size: 1rem;
  transition: border-color .18s, box-shadow .18s; }
.input::placeholder { color: #5c4c44; }
.input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-dim); }

/* ── Avatare / EQ ── */
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: var(--bg);
  background: linear-gradient(135deg, #ffa060, var(--acc)); }
.avatar.c1 { background: linear-gradient(135deg, #d8c39a, #907868); }
.avatar.c2 { background: linear-gradient(135deg, #b98ae0, #7a4bb5); }
.avatar.c3 { background: linear-gradient(135deg, #7fd4a8, #2e8b63); }
.speaking .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--acc), 0 0 20px var(--glow); }
.eq { display: inline-flex; gap: 2.5px; align-items: flex-end; height: 13px; }
.eq i { width: 3px; border-radius: 2px; background: var(--acc); height: 4px; }
.speaking .eq i { animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .12s; } .eq i:nth-child(3) { animation-delay: .26s; }
.eq i:nth-child(4) { animation-delay: .07s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 13px; } }
.ic-13 { width: 13px; height: 13px; }
.ic-16 { width: 16px; height: 16px; }
.ic-17 { width: 17px; height: 17px; }
.ic-30 { width: 30px; height: 30px; }
.ic-rot { transform: rotate(135deg); }
.ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.reveal { opacity: 0; transform: translateY(16px); animation: reveal .6s ease forwards; }
.reveal.d1 { animation-delay: .08s; } .reveal.d2 { animation-delay: .16s; }
.reveal.d3 { animation-delay: .24s; } .reveal.d4 { animation-delay: .32s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
.spinner { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--border);
  border-top-color: var(--acc); animation: spin 1s linear infinite; display: inline-block; }
.spinner.big { width: 26px; height: 26px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ 01 Beitreten ══ */
.join { width: 100%; max-width: 400px; }
.join-head { margin-bottom: 1.6rem; }
.join-head .eyebrow { margin-bottom: .7rem; }
.join-head .h-xl { margin-bottom: .55rem; }
.panel { padding: 1.4rem; display: grid; gap: 1.25rem; }
.miccheck { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  padding: .9rem 1rem; display: grid; gap: .8rem; }
.miccheck-row { display: flex; align-items: center; gap: .8rem; }
.mic-badge { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--acc-dim); color: var(--acc); display: flex; align-items: center; justify-content: center; }
.level { display: flex; align-items: flex-end; gap: 3px; height: 26px; flex: 1; }
.level i { flex: 1; max-width: 7px; border-radius: 2px; background: var(--acc); opacity: .35;
  height: 18%; transition: height .09s ease-out, opacity .09s; }
.level i.on { opacity: .95; }
.mic-status { display: flex; align-items: center; gap: .45rem; font-family: var(--mono);
  font-size: .68rem; color: var(--muted); text-transform: uppercase; }
.mic-status .live-dot { background: var(--muted); animation: none; }
.mic-status.ok { color: var(--green); } .mic-status.ok .live-dot { background: var(--green); animation: pulse 2s infinite; }
.mic-status.err { color: var(--red); } .mic-status.err .live-dot { background: var(--red); }
.mic-select { width: 100%; font-family: var(--mono); font-size: .72rem; color: var(--muted);
  background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: .5rem .6rem;
  appearance: none;
  background-image: url('assets/chevron.svg');
  background-repeat: no-repeat; background-position: right .6rem center; }
/* Kamera-Vorschau: das Bild ist der Status — Text nur, wenn es nicht geht. */
.camcheck { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  padding: .7rem; display: grid; gap: .6rem; }
.camprev { position: relative; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden;
  background: #0a0710; display: flex; align-items: center; justify-content: center; }
.camprev video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-off { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .5rem;
  text-align: center; color: var(--muted); font-family: var(--mono); font-size: .58rem;
  letter-spacing: .1em; text-transform: uppercase; }
.cam-off.err { color: var(--red); }
.camrow { display: flex; align-items: center; gap: .5rem; }
.cam-toggle { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-size: .78rem; font-weight: 600; padding: .55rem .8rem; border-radius: 9px; }
.cam-toggle:hover { color: var(--text); border-color: #4a3560; }
.cam-toggle.on { background: var(--acc-dim); border-color: rgba(255,101,32,.4); color: var(--acc); }
.camrow .mic-select { flex: 1; width: auto; min-width: 0; }

.btn-join { width: 100%; padding: 1.05rem; font-size: 1.02rem; }
.below { text-align: center; }
.finefoot { margin-top: 1.4rem; text-align: center; font-family: var(--mono);
  font-size: .62rem; color: #5c4c44; letter-spacing: .06em; }

/* ══ 02 Warteraum ══ */
.wait { width: 100%; max-width: 380px; display: grid; justify-items: center; text-align: center; }
.radar { position: relative; width: 96px; height: 96px; margin-bottom: 1.8rem; }
.radar .avatar { width: 96px; height: 96px; font-size: 2rem; box-shadow: 0 0 40px var(--glow); }
.ring { position: absolute; inset: 0; border: 1.5px solid var(--acc); border-radius: 50%;
  animation: radar 2.6s ease-out infinite; opacity: 0; }
.ring.r2 { animation-delay: 1.3s; }
@keyframes radar { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(2.05); opacity: 0; } }
.wait .eyebrow { margin-bottom: .7rem; }
.wait .h-xl { margin-bottom: .6rem; }
.dots::after { content: "…"; display: inline-block; overflow: hidden; vertical-align: bottom;
  animation: dots 1.6s steps(4) infinite; width: 0; }
@keyframes dots { to { width: 1.1em; } }
.wait .sub { max-width: 300px; margin-bottom: 1.6rem; }
.retry { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--mono);
  font-size: .68rem; color: var(--muted); border: 1px solid var(--border); border-radius: 100px;
  padding: .4rem .9rem; margin-bottom: 2rem; background: var(--surface); }
.meetcard { width: 100%; padding: 1rem 1.2rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; text-align: left; margin-bottom: 1.2rem; }
.meetcard .t { font-weight: 700; font-size: .95rem; letter-spacing: -0.01em; }
.meetcard .s { font-family: var(--mono); font-size: .65rem; color: var(--muted); margin-top: 2px;
  text-transform: uppercase; }

/* ══ 03/04 Call ══ */
.app { display: grid; grid-template-columns: 1fr 320px; height: calc(100dvh - 56px); }
.stage-wrap { position: relative; padding: 1.1rem; display: flex; flex-direction: column; min-width: 0; }
.stage { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #0a0710;
  border: 1px solid var(--border); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45); }
#stage-video { width: 100%; height: 100%; object-fit: contain; background: #0a0710; }
.share-label { position: absolute; left: .9rem; bottom: .9rem; z-index: 5;
  display: inline-flex; align-items: center; gap: .45rem; font-family: var(--mono);
  font-size: .64rem; letter-spacing: .08em; color: var(--acc); text-transform: uppercase;
  background: rgba(12,8,14,.78); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,101,32,.35); border-radius: 100px; padding: .32rem .7rem; }
.stage-empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2rem; padding: 2rem 1.5rem; width: 100%; }
.tiles { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; }
.tile { width: clamp(150px, 22vw, 210px); aspect-ratio: 1/.92; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem;
  transition: border-color .3s, box-shadow .3s; }
.tile .avatar { width: 64px; height: 64px; font-size: 1.4rem; }
.tile .nm { font-weight: 700; font-size: .95rem; letter-spacing: -0.01em; }
.tile .rl { font-family: var(--mono); font-size: .56rem; color: var(--muted); letter-spacing: .1em; margin-top: -.5rem; }
.tile .st { position: absolute; top: .8rem; right: .8rem; color: var(--muted); }
.tile .st .ic { width: 15px; height: 15px; }
.tile.speaking { border-color: rgba(255,101,32,.55); box-shadow: 0 0 0 1px rgba(255,101,32,.35), 0 12px 44px var(--glow); }
.tile.speaking .st { color: var(--acc); }
.tile.is-muted .st { color: var(--red); }
/* Kamerabild. Dasselbe Element wandert zwischen Kachel und Filmstreifen —
   deshalb hier keine Position, die setzt der jeweilige Ort. */
.cam { overflow: hidden; background: #0a0710; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam.self video { transform: scaleX(-1); }          /* Selbstbild spiegeln */
.cam-nm { position: absolute; left: .5rem; bottom: .38rem; max-width: calc(100% - 1rem);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: .55rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text); text-shadow: 0 1px 6px rgba(0,0,0,.9); }

.tile { overflow: hidden; }
.tile .cam { position: absolute; inset: 0; border-radius: inherit; }
.tile .cam .cam-nm { display: none; }               /* die Kachel zeigt den Namen schon */
/* Mit Bild wird aus der Avatar-Kachel eine Video-Kachel: 16:9 statt quadratisch,
   sonst schneidet `object-fit: cover` das halbe Gesicht weg. */
.tile.has-cam { aspect-ratio: 16/9; width: clamp(220px, 30vw, 340px); }
.tile.has-cam .avatar, .tile.has-cam .rl { display: none; }
.tile.has-cam .nm { position: absolute; left: .8rem; bottom: .7rem; z-index: 2;
  text-shadow: 0 1px 8px rgba(0,0,0,.9); }
.tile.has-cam .st { z-index: 2; text-shadow: 0 1px 8px rgba(0,0,0,.9); }

/* Filmstreifen: nur sichtbar, während jemand den Bildschirm teilt. */
.strip { position: absolute; top: .9rem; right: .9rem; z-index: 6; display: flex;
  flex-direction: column; gap: .55rem; max-height: calc(100% - 1.8rem); }
.strip .cam { position: relative; width: clamp(112px, 13vw, 168px); aspect-ratio: 16/9;
  border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.5); }

.stage-hint { font-family: var(--mono); font-size: .64rem; color: var(--muted); letter-spacing: .1em;
  display: flex; align-items: center; gap: .5rem; text-align: center; }
.stage-hint .ic { width: 14px; height: 14px; }

.controls { position: absolute; bottom: 1.9rem; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; gap: .6rem; padding: .55rem; background: rgba(22,15,26,.85); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 100px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.ctl { width: 52px; height: 52px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; background: var(--surface-2);
  color: var(--text); border: 1px solid var(--border); cursor: pointer;
  transition: all .18s ease; font-family: var(--font); -webkit-tap-highlight-color: transparent; }
.ctl:hover { transform: translateY(-2px); border-color: #4a3560; }
.ctl small { font-family: var(--mono); font-size: .48rem; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.ctl.on { background: var(--acc-dim); border-color: rgba(255,101,32,.4); color: var(--acc); }
.ctl.on small { color: var(--acc); }
.ctl.muted { background: rgba(255,68,68,.12); border-color: rgba(255,68,68,.4); color: var(--red); }
.ctl.muted small { color: var(--red); }
.ctl:disabled { opacity: .4; cursor: not-allowed; }
.ctl.rec-on { background: rgba(255,68,68,.14); border-color: rgba(255,68,68,.5); color: var(--red); }
.ctl.rec-on small { color: var(--red); }
.ctl.leave { background: var(--red); border-color: var(--red); color: #fff; }
.ctl.leave:hover { box-shadow: 0 8px 24px rgba(255,68,68,.35); }
.ctl .ic-off { display: none; }
.ctl.muted .ic-on, .ctl.off .ic-on { display: none; }
.ctl.muted .ic-off, .ctl.off .ic-off { display: block; }
.ctl-chat { display: none; position: relative; }
.ctl-chat .badge { position: absolute; top: 9px; right: 11px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--acc); }

.sidebar { border-left: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; min-height: 0; }
.side-sec { font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; color: var(--muted);
  padding: .9rem 1rem .5rem; display: flex; justify-content: space-between; align-items: center;
  text-transform: uppercase; }
.sheet-close { display: none; background: none; border: 0; color: var(--muted); cursor: pointer; padding: .3rem; }
.side-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.vids-toggle { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .6rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 100px;
  color: var(--muted); font-family: var(--mono); font-size: .56rem; letter-spacing: .08em;
  text-transform: uppercase; cursor: pointer; transition: all .15s ease; }
.vids-toggle:hover { color: var(--text); border-color: #4a3560; }
.vids-toggle .ic { width: 13px; height: 13px; }
.vids-toggle .ic-off { display: none; }
.vids-toggle.off { background: var(--acc-dim); border-color: rgba(255,101,32,.4); color: var(--acc); }
.vids-toggle.off .ic-on { display: none; }
.vids-toggle.off .ic-off { display: block; }
/* Sparmodus-Auswahl (Host) — als Pille, für Gäste nur Anzeige */
.eco-select { appearance: none; padding-right: 1.3rem; background-image: url('assets/chevron.svg');
  background-repeat: no-repeat; background-position: right .5rem center; background-size: 10px; }
.eco-select.active { background-color: var(--acc-dim); border-color: rgba(255,101,32,.4); color: var(--acc); }
.eco-select:disabled { cursor: default; opacity: 1; background-image: none; padding-right: .6rem; }
.eco-select option { background: var(--surface-2); color: var(--text); text-transform: none; letter-spacing: 0; }
.plist { padding: 0 .6rem .6rem; display: grid; gap: 2px; overflow-y: auto; max-height: 40%; }
.p { display: flex; align-items: center; gap: .7rem; padding: .5rem; border-radius: 10px; transition: background .15s; }
.p:hover { background: var(--surface-2); }
.p .nm { font-size: .86rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.p .nm .you { color: var(--muted); font-weight: 400; }
.p .rl { font-family: var(--mono); font-size: .56rem; color: var(--muted); letter-spacing: .06em; }
.p .state { margin-left: auto; color: var(--muted); display: flex; align-items: center; }
.p.is-muted .state { color: var(--red); }
.p .ic { width: 15px; height: 15px; }
.p .vtoggle { margin-left: auto; background: none; border: 0; padding: .2rem; color: var(--muted);
  cursor: pointer; display: flex; align-items: center; }
.p .vtoggle:hover { color: var(--text); }
.p .vtoggle.blocked { color: var(--acc); }
.p .vtoggle ~ .state { margin-left: 0; }

.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--border); }
.msgs { flex: 1; overflow-y: auto; padding: .8rem 1rem; display: flex; flex-direction: column;
  gap: .75rem; justify-content: flex-end; }
.msg .who { font-family: var(--mono); font-size: .56rem; color: var(--muted); letter-spacing: .08em;
  margin-bottom: .2rem; text-transform: uppercase; }
.msg .txt { display: inline-block; font-size: .84rem; line-height: 1.45; background: var(--surface-2);
  border: 1px solid var(--border); padding: .45rem .7rem; border-radius: 10px;
  border-top-left-radius: 3px; max-width: 92%; overflow-wrap: anywhere; }
.msg.me { text-align: right; }
.msg.me .txt { background: var(--acc-dim); border-color: rgba(255,101,32,.3);
  border-radius: 10px; border-top-right-radius: 3px; text-align: left; }
.msg .txt a { color: var(--acc); }
.msg.sys { text-align: center; }
.msg.sys .txt { background: transparent; border: 0; color: var(--muted); font-family: var(--mono); font-size: .62rem; }
.chat-in { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--border); }
.chat-in .input { padding: .6rem .8rem; font-size: .86rem; border-radius: 100px; }
.send { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background: var(--acc);
  color: var(--bg); border: 0; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all .18s; }
.send:hover { box-shadow: 0 6px 18px var(--glow); }

.chips { display: none; gap: .45rem; padding: .8rem .15rem 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: .45rem; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 100px;
  padding: .3rem .75rem .3rem .3rem; font-size: .78rem; font-weight: 600; }
.chip .avatar { width: 26px; height: 26px; font-size: .62rem; }
.chip .ic { width: 13px; height: 13px; color: var(--muted); }
.chip.is-muted .ic { color: var(--red); }
.chip.speaking { border-color: rgba(255,101,32,.5); }
.overlay { display: none; position: fixed; inset: 0; background: rgba(6,4,8,.55); z-index: 90; }

/* ══ Ende / Fehler ══ */
.endbox { width: 100%; max-width: 400px; display: grid; justify-items: center; text-align: center; gap: .7rem; }
.endmark { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; margin-bottom: .8rem; background: var(--acc-dim); color: var(--acc);
  border: 1px solid rgba(255,101,32,.3); }
.endmark.warn { background: rgba(255,68,68,.1); color: var(--red); border-color: rgba(255,68,68,.3); }
.endbox .btn-primary { margin-top: 1rem; }

/* ══ Reconnect-Overlay ══ */
.reconnect { position: fixed; inset: 0; z-index: 200; background: rgba(12,8,14,.86);
  backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; }
.reconnect-box { display: grid; justify-items: center; gap: .8rem; text-align: center; padding: 2rem; }
.reconnect-box .t { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.reconnect-box .s { color: var(--muted); font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

/* ══ Mobil ══ */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .topbar .title { display: none; }
  .stage-wrap { padding: .8rem .8rem calc(96px + var(--safe-b)); }
  .tiles { gap: .8rem; }
  .tile { width: clamp(130px, 42vw, 180px); }
  .tile.has-cam { width: min(100%, 320px); }
  /* Auf dem Handy liegt der Streifen quer unten — sonst frisst er die Bühne. */
  .strip { top: auto; bottom: .6rem; left: .6rem; right: .6rem; flex-direction: row;
    max-height: none; overflow-x: auto; scrollbar-width: none; }
  .strip::-webkit-scrollbar { display: none; }
  .strip .cam { width: 104px; flex-shrink: 0; }
  /* Der Streifen liegt hier unten — die „präsentiert"-Pille weicht nach oben aus. */
  .share-label { top: .7rem; bottom: auto; }
  .chips { display: flex; }
  .ctl-chat { display: flex; }
  .controls { position: fixed; left: 0; right: 0; bottom: 0; transform: none; border-radius: 0;
    border: 0; border-top: 1px solid var(--border); justify-content: center; gap: .9rem;
    padding: .7rem .7rem calc(.7rem + var(--safe-b)); background: rgba(12,8,14,.92); }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 100;
    height: min(72dvh, 560px); border-left: 0; border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0; transform: translateY(105%);
    transition: transform .3s cubic-bezier(.32,.72,.32,1);
    box-shadow: 0 -20px 60px rgba(0,0,0,.5); padding-bottom: var(--safe-b); }
  .sidebar.open { transform: translateY(0); }
  .plist { max-height: 45%; }
  .sheet-close { display: block; }
  .overlay.show { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Live-Transkript (Host, ein-/ausblendbar; PRD F14) ─────────────────── */
.transcript { display: flex; flex-direction: column; max-height: 42%; min-height: 8rem;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.transcript .side-sec { display: flex; justify-content: space-between; align-items: center; }
.tr-live { color: var(--green); }
.tlines { flex: 1; overflow-y: auto; padding: .6rem 1rem .8rem; font-size: .8rem; line-height: 1.45; }
.tline { margin: 0 0 .45rem; }
.tline .tm { font-family: var(--mono); font-size: .56rem; color: var(--muted); margin-right: .4rem; }
.tline .sp { color: var(--acc); font-weight: 600; margin-right: .3rem; }
.tline.live { opacity: .82; }
.tr-empty { color: var(--muted); font-family: var(--mono); font-size: .62rem; line-height: 1.6; margin: 0; }
.tsum { border-bottom: 1px solid var(--border); padding: .5rem 1rem .7rem; background: var(--surface-2); max-height: 38%; overflow-y: auto; }
.tsum-h { font-family: var(--mono); font-size: .56rem; letter-spacing: .12em; color: var(--acc); text-transform: uppercase; margin-bottom: .35rem; display: flex; justify-content: space-between; }
.tsum-at { color: var(--muted); letter-spacing: 0; text-transform: none; }
.tsum-t { margin: 0; white-space: pre-wrap; font: inherit; font-size: .78rem; line-height: 1.45; color: var(--ink); }

/* ── Ansichts-Schalter in der Seitenleiste (PRD F17): jede Kombination, gemerkt ── */
.views { display: flex; gap: .4rem; padding: .2rem 1rem .6rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.view { position: relative; display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 100px; color: var(--muted);
  font: inherit; font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.view.on { background: var(--acc-dim); border-color: rgba(255,101,32,.4); color: var(--acc); }
.view .vbadge { background: var(--red); color: #fff; font-size: .52rem; letter-spacing: 0; min-width: 1.1rem; height: 1.1rem;
  border-radius: 100px; display: inline-flex; align-items: center; justify-content: center; padding: 0 .3rem; }
.view .tr-live { font-size: .6rem; }
.summary { display: flex; flex-direction: column; min-height: 6rem; max-height: 45%; border-bottom: 1px solid var(--border); }
.summary .side-sec { display: flex; justify-content: space-between; }
.summary .tsum { flex: 1; overflow-y: auto; border: 0; background: transparent; padding: 0 1rem .7rem; max-height: none; }
.transcript { flex: 1 1 auto; max-height: none; }
.chat { flex: 1 1 auto; }

/* ── Strukturiertes Protokoll: Themen · Entscheidungen · Offen (PRD F19) ── */
.pgroup { margin: .2rem 0 .7rem; }
.pg-h { display: flex; align-items: center; gap: .45rem; font-family: var(--mono); font-size: .56rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: .4rem 0 .35rem; }
.pg-h b { font-size: .5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 100px; padding: 0 .4rem; color: var(--sub); }
.pg-h.pg-dec { color: var(--green); } .pg-h.pg-open { color: var(--acc); }
.pg-l { display: grid; gap: .35rem; }
.pitem { border: 1px solid var(--border); border-radius: 10px; padding: .45rem .6rem; background: var(--surface-2);
  font-size: .78rem; line-height: 1.4; animation: pin .5s ease-out; }
.pitem.dec { border-left: 3px solid var(--green); } .pitem.open { border-left: 3px solid var(--acc); }
.pitem.topic { background: transparent; border-color: transparent; padding: .15rem 0; }
.pitem .pt { font-weight: 600; color: var(--ink); }
.pitem .pn { color: var(--sub); font-size: .74rem; }
.pitem .pm { display: flex; gap: .5rem; font-family: var(--mono); font-size: .52rem; color: var(--muted); margin-top: .25rem; letter-spacing: .06em; }
.pitem.live { opacity: .8; } .pitem.live .pm::after { content: attr(data-live); color: var(--acc); }
@keyframes pin { from { background: var(--acc-dim); } }
.tmode { margin-left: auto; margin-right: .5rem; font-size: .7rem; letter-spacing: 0; text-transform: none; color: var(--muted); border: 1px solid var(--line, #3a2a1e); border-radius: 999px; padding: 0 .45rem; }
.tmode.cloud { color: var(--accent); border-color: var(--accent); }
.tline.pending { opacity: .55; font-style: italic; }
button.tmode { font: inherit; font-family: var(--mono); font-size: .7rem; background: transparent; cursor: pointer; }
button.tmode:hover { color: var(--text); border-color: var(--text); }
.tmode-menu { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .3rem 1rem .5rem; font-family: var(--mono); font-size: .62rem; color: var(--muted); }
.ticker { display: flex; flex-wrap: wrap; gap: .3rem .9rem; padding: .35rem 1rem .45rem; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: .58rem; letter-spacing: .04em; color: var(--muted); }
.ticker b { font-weight: 600; color: var(--text); }
.ticker .busy.whisper, .ticker .busy.llm-local, .ticker .busy.llm-cloud, .ticker .busy.final { color: var(--acc); }
.ticker.stale b { color: #f0a050; }
.pg-h.pg-task { color: var(--ink); }
.pitem.task { border-left: 3px solid var(--ink); }
.pitem.task.running, .pitem.task.queued { border-left-color: var(--muted); opacity: .85; }
.pitem.task.error { border-left-color: #d05050; }
.pitem .ps { font-size: .68rem; color: var(--sub); margin-top: .25rem; }
.pitem .ps a { color: var(--acc); text-decoration: none; }
.pitem .pm .st { margin-left: auto; color: var(--sub); }
.pitem { position: relative; }
.pitem .prm { position: absolute; top: .2rem; right: .3rem; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .9rem; line-height: 1; cursor: pointer; opacity: 0; padding: .1rem .3rem; }
.pitem:hover .prm { opacity: 1; } .pitem .prm:hover { color: var(--acc); }

/* ══ Landkarte (PRD F25) ══ */
.map { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0a0710;
  background-image: radial-gradient(rgba(242,223,192,.06) 1px, transparent 1px); background-size: 22px 22px; }
.map-head { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem .4rem; font-family: var(--mono); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); flex: none; }
.map-title { color: var(--text); font-weight: 600; }
.map-sub { letter-spacing: .04em; text-transform: none; }
.map-hint { margin-left: auto; letter-spacing: .02em; text-transform: none; opacity: .8; }
.map-cols { flex: 1; min-height: 0; overflow: auto; display: flex; gap: .8rem; align-items: flex-start; padding: .2rem .9rem .6rem; }
.map-cols::-webkit-scrollbar { height: 8px; width: 8px; } .map-cols::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.map-empty { color: var(--muted); font-size: .85rem; padding: 2rem 1rem; max-width: 40ch; }
.tcol { width: 260px; flex: none; max-height: 100%; overflow-y: auto; border: 1px solid transparent; border-radius: 14px; padding: .4rem; transition: border-color .2s, background .2s; }
.tcol.active { border-color: rgba(255,101,32,.45); background: rgba(255,101,32,.04); }
.tcol.over { border-color: var(--acc); background: rgba(255,101,32,.08); }
.tcol.inbox { border-style: dashed; border-color: var(--border); }
.tcol.tasks { width: 280px; }
.tcol.hl { outline: 2px solid var(--acc); outline-offset: 2px; }
.tcol .th { display: flex; align-items: center; gap: .4rem; padding: .25rem .4rem .5rem; cursor: grab; font-family: var(--mono); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--acc); }
.tcol.inbox .th { color: var(--muted); } .tcol .th.blue { color: #7fb3ff; cursor: default; }
.tcol .th b { font-weight: 600; } .tcol .th .n { margin-left: auto; font-size: .52rem; padding: 0 .4rem; border: 1px solid var(--border); border-radius: 100px; color: var(--muted); }
.tcol .sum { padding: 0 .4rem .5rem; color: var(--muted); font-size: .78rem; line-height: 1.4; cursor: pointer; }
.tcol .sum:hover { color: var(--text); }
.tcol .sum .since { display: block; font-family: var(--mono); font-size: .52rem; letter-spacing: .08em; margin-bottom: .15rem; }
.tcol .pitem { margin: 0 0 .5rem; }
.mcard { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: .5rem .65rem .45rem; margin: 0 0 .5rem; cursor: pointer; font-size: .82rem; }
.mcard:hover { border-color: var(--muted); }
.mcard.decision { border-left: 3px solid var(--green); } .mcard.open { border-left: 3px solid var(--acc); }
.mcard.dragging { opacity: .4; }
.mcard.new::before { content: "NEU"; position: absolute; right: .6rem; top: -.45rem; font-family: var(--mono); font-size: .48rem; letter-spacing: .14em; padding: 0 .4rem; border-radius: 100px; background: var(--acc); color: var(--bg); font-weight: 700; }
.mcard .lbl { display: inline-block; font-family: var(--mono); font-size: .5rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-bottom: .2rem; }
.mcard .lbl.dec { color: var(--green); } .mcard .lbl.open { color: var(--acc); }
.mcard .t { font-weight: 600; color: var(--text); line-height: 1.35; }
.mcard .m { display: flex; gap: .5rem; margin-top: .3rem; font-family: var(--mono); font-size: .5rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.mcard .chk { position: absolute; right: .55rem; top: .5rem; width: 15px; height: 15px; border: 1.5px solid var(--acc); border-radius: 4px; display: grid; place-items: center; font-size: .65rem; color: var(--bg); cursor: pointer; }
.mcard .chk:hover { background: var(--acc-dim); } .mcard .chk.on { border-color: var(--green); background: var(--green); }
.map-tl { position: relative; height: 34px; margin: 0 .9rem .3rem; border-top: 1px solid var(--border); flex: none; }
.map-tl i { position: absolute; top: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 8px var(--acc); cursor: pointer; }
.map-tl i.g { background: var(--green); box-shadow: 0 0 8px var(--green); }
.map-tl em { position: absolute; top: 9px; transform: translateX(-50%); font-family: var(--mono); font-size: .5rem; letter-spacing: .08em; color: var(--muted); font-style: normal; cursor: pointer; white-space: nowrap; }
.map-tl .now { position: absolute; top: -1px; bottom: 0; width: 1px; background: var(--acc); }
#stage-video.in-strip { position: relative; width: clamp(180px, 22vw, 300px); aspect-ratio: 16/9; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.5); object-fit: cover; background: #000; }
/* Aufträge: Vorschlag bestätigen (Seitenleiste + Landkarte) */
.pitem.task.proposal { border-left-color: var(--acc); border-style: dashed; }
.pitem .cmdedit { width: 100%; margin: .25rem 0 .35rem; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: .8rem; }
.pitem .acts, .map-popup .acts { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .3rem; }
.pitem .acts button, .map-popup .acts button { font: inherit; font-family: var(--mono); font-size: .55rem; letter-spacing: .1em; text-transform: uppercase; padding: .3rem .6rem; border: 1px solid var(--border); border-radius: 100px; background: transparent; color: var(--muted); cursor: pointer; }
.pitem .acts button.go, .map-popup .acts button.go { background: var(--acc); color: var(--bg); border-color: var(--acc); font-weight: 700; }
.pitem .acts button:hover, .map-popup .acts button:hover { border-color: var(--acc); color: var(--acc); } .map-popup .acts button.go:hover, .pitem .acts button.go:hover { color: var(--bg); }
.pitem .acts .wait { margin-left: auto; font-family: var(--mono); font-size: .5rem; color: var(--muted); }
.map-popup .acts .grow { flex: 1; } .map-popup .acts button.cloudonly { opacity: .4; cursor: not-allowed; }
/* Popup */
.map-popup-bg { position: fixed; inset: 0; z-index: 60; background: rgba(6,3,8,.6); backdrop-filter: blur(3px); display: grid; place-items: center; }
.map-popup-bg[hidden] { display: none; }
.map-popup { width: min(700px, 92vw); max-height: 84vh; overflow: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 1rem 1.2rem; box-shadow: 0 40px 100px rgba(0,0,0,.6); }
.map-popup .head { position: relative; } .map-popup h2 { margin: 0 0 .2rem; font-size: 1.05rem; }
.map-popup .close { position: absolute; right: -.4rem; top: -.4rem; border: 0; background: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: .2rem .5rem; }
.map-popup .meta { font-family: var(--mono); font-size: .55rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .7rem; }
.map-popup textarea { width: 100%; min-height: 64px; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: .9rem; line-height: 1.45; resize: vertical; }
.map-popup .sec { font-family: var(--mono); font-size: .55rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: .8rem 0 .3rem; }
.map-popup .quote { padding: .4rem .6rem; border-left: 2px solid var(--acc); color: var(--muted); font-style: italic; background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: .85rem; }
.map-popup .txx { max-height: 170px; overflow: auto; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 10px; font-size: .8rem; }
.map-popup .txx .tline.hit { background: var(--acc-dim); border-radius: 4px; }
.map-popup .hint { margin-top: .6rem; color: var(--muted); font-size: .75rem; }
.map-popup p.hint { margin: .4rem 0 0; }
@media (max-width: 720px) { .map-hint { display: none; } .tcol { width: 82vw; } }
/* weitere Kartenarten (Bestandsaufnahme / Reflexion) */
.mcard .lbl.claims, .pg-h.pg-claim { color: #e8c86a; } .mcard.claims { border-left: 3px solid #e8c86a; } .pitem.claim { border-left: 3px solid #e8c86a; }
.mcard .lbl.research, .pg-h.pg-research { color: #7fb3ff; } .mcard.research { border-left: 3px solid #7fb3ff; } .pitem.research { border-left: 3px solid #7fb3ff; }
.mcard .lbl.gaps, .pg-h.pg-gap { color: #c9a0ff; } .mcard.gaps { border-left: 3px solid #c9a0ff; } .pitem.gap { border-left: 3px solid #c9a0ff; }
.mcard .lbl.dates, .pg-h.pg-date { color: #8fd8d0; } .mcard.dates { border-left: 3px solid #8fd8d0; } .pitem.date { border-left: 3px solid #8fd8d0; }
.mcard .lbl.references, .pg-h.pg-ref { color: var(--muted); } .mcard.references { border-left: 3px solid var(--border); cursor: default; } .tcol.refs { border-style: dotted; border-color: var(--border); }
.mcard .lbl.insights, .pg-h.pg-insight { color: #e8c86a; } .mcard.insights { border-left: 3px solid #e8c86a; }
.mcard .lbl.patterns, .pg-h.pg-pattern { color: #c9a0ff; } .mcard.patterns { border-left: 3px solid #c9a0ff; }
.mcard .lbl.needs, .pg-h.pg-need { color: var(--acc); } .mcard.needs { border-left: 3px solid var(--acc); }
.mcard .lbl.paths, .pg-h.pg-path { color: var(--green); } .mcard.paths { border-left: 3px solid var(--green); }
.mcard .lbl.questions, .pg-h.pg-question { color: #7fb3ff; } .mcard.questions { border-left: 3px solid #7fb3ff; }
.mcard .lbl.experiments, .pg-h.pg-experiment { color: #8fd8d0; } .mcard.experiments { border-left: 3px solid #8fd8d0; }
.mcard .d { color: var(--muted); font-size: .76rem; margin-top: .15rem; }

.mcard .verdict { display: inline-block; margin-top: .25rem; font-family: var(--mono); font-size: .5rem; letter-spacing: .12em; text-transform: uppercase; padding: .1rem .4rem; border-radius: 100px; border: 1px solid var(--border); color: var(--muted); }
.mcard .verdict.v-bestätigt { color: var(--green); border-color: var(--green); } .mcard .verdict.v-korrigiert { color: var(--red); border-color: var(--red); } .mcard .verdict.v-teilweise { color: #e8c86a; border-color: #e8c86a; } .mcard .verdict.v-recherchiert { color: #7fb3ff; border-color: #7fb3ff; }
.mcard .d.corr { color: var(--text); }
.pitem.doc { border-left: 3px solid var(--text); cursor: pointer; } .pitem.doc.pend { opacity: .6; cursor: default; }
.map-popup .md { font-size: .86rem; line-height: 1.5; } .map-popup .md h2 { font-size: 1rem; margin: .8rem 0 .3rem; } .map-popup .md h3 { font-size: .9rem; margin: .7rem 0 .25rem; color: var(--acc); }
.map-popup .md table { border-collapse: collapse; width: 100%; font-size: .78rem; margin: .4rem 0 .6rem; } .map-popup .md th, .map-popup .md td { border: 1px solid var(--border); padding: .25rem .4rem; vertical-align: top; text-align: left; }
.map-popup .md ul { margin: .3rem 0 .5rem 1.1rem; padding: 0; }
