:root {
  --bg: #0f1115;
  --bg-2: #16181d;
  --bg-3: #1e2128;
  --bg-4: #272b33;
  --line: #2c303a;
  --text: #e8eaed;
  --muted: #9aa0aa;
  --accent: #3478f6;
  --accent-2: #4f8cff;
  --danger: #e5484d;
  --danger-2: #f0595e;
  --ok: #34c759;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hidden { display: none !important; }

/* Tastatur-Fokus überall sichtbar – Maus-Klicks bleiben dank :focus-visible unberührt. */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.screen { position: fixed; inset: 0; }

.brand-logo { width: 30px; height: 30px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.brand-logo.small { width: 24px; height: 24px; }

/* ============ LOBBY ============ */
.lobby {
  display: grid; place-items: center; padding: 1.2rem;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2030, var(--bg));
  overflow: auto;
}
.lobby-card {
  width: min(440px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: .6rem; font-size: 1.4rem; font-weight: 700; }
.lobby-sub { color: var(--muted); margin: .4rem 0 1.1rem; font-size: .92rem; }

.preview {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius);
  overflow: hidden; background: #000; margin-bottom: 1.1rem;
}
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-controls { position: absolute; bottom: .7rem; left: 50%; transform: translateX(-50%); display: flex; gap: .6rem; }

.round {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(40, 44, 52, .85); color: var(--text); padding: 12px;
  backdrop-filter: blur(8px); transition: background .15s, transform .1s;
}
.round:hover { background: rgba(60, 66, 76, .9); }
.round:active { transform: scale(.94); }
.round.off { background: var(--danger); color: #fff; }
.round .ico { display: flex; width: 22px; height: 22px; }

.entry-form { display: flex; flex-direction: column; gap: .8rem; }
.lobby-name { margin-bottom: .9rem; }
.lobby-name, .entry-form > label:not(.switch-row), .device {
  display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; color: var(--muted); font-weight: 500;
}
.lobby-card input[type="text"], .lobby-card input[type="password"], .lobby-card select {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: .7rem .8rem; font-size: .95rem; outline: none; transition: border-color .15s;
}
.lobby-card input:focus, .lobby-card select:focus { border-color: var(--accent); }
.opt { color: var(--muted); font-weight: 400; }

/* Modus-Umschalter (Meeting starten / Beitreten) */
.mode-tabs { display: flex; gap: .3rem; background: var(--bg-3); padding: .3rem; border-radius: 12px; margin-bottom: .9rem; }
.mode-tab {
  flex: 1; background: none; border: none; color: var(--muted); padding: .6rem; border-radius: 9px;
  cursor: pointer; font-size: .92rem; font-weight: 600; transition: background .15s, color .15s;
}
.mode-tab:hover { color: var(--text); }
.mode-tab.active { background: var(--accent); color: #fff; }

.device-row { display: flex; gap: .6rem; margin-top: .9rem; }
.device { flex: 1; min-width: 0; }
.device select { width: 100%; }

/* Einladen-Button im Call-Header */
.header-right { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.invite-btn {
  background: var(--bg-4); color: var(--text); border: none; border-radius: 8px;
  padding: .4rem .8rem; font-size: .82rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.invite-btn:hover { background: #313641; }
.invite-btn:active { transform: scale(.95); }
.invite-btn.copied { background: var(--ok); color: #fff; }

.primary {
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  border-radius: 10px; padding: .8rem; font-size: 1rem; font-weight: 600;
  transition: background .15s, transform .1s; margin-top: .3rem;
}
.primary:hover { background: var(--accent-2); }
.primary:active { transform: scale(.99); }
.primary:disabled { opacity: .6; cursor: progress; }
.primary.small { margin: 0; padding: .6rem 1rem; font-size: .9rem; }

.error { color: var(--danger-2); font-size: .85rem; min-height: 1.1em; text-align: center; }
.credit { text-align: center; font-size: .76rem; color: var(--muted); margin-top: 1.1rem; }
.credit strong { color: var(--text); font-weight: 600; letter-spacing: .02em; }
/* FUNK DESIGN im Footer: Vantis-Blau mit durchlaufendem Schimmer (kein Link mehr) */
.funk-credit {
  font-weight: 700; letter-spacing: .03em;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 35%, #e3ecff 50%, var(--accent-2) 65%, var(--accent) 100%);
  background-size: 200% auto; background-clip: text; -webkit-background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: funkShine 3.5s linear infinite;
}
@keyframes funkShine { from { background-position: 0% center; } to { background-position: 200% center; } }
@media (prefers-reduced-motion: reduce) { .funk-credit { animation: none; } }

/* ============ CALL ============ */
.call { display: flex; flex-direction: column; background: var(--bg); }

.call-header {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-2);
  padding-top: max(.7rem, env(safe-area-inset-top));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
/* LINKS: feste App-Identität */
.room-info { display: flex; align-items: center; gap: .5rem; font-weight: 600; min-width: 0; flex: 0 1 auto; }
.head-wordmark { font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: .01em; white-space: nowrap; flex-shrink: 0; }
.room-label { font-size: .85rem; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.room-label:not(:empty)::before { content: "· "; }
/* MITTE: Kunden-Branding, optisch echt zentriert (unabhängig von links/rechts) */
.head-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: none; align-items: center; gap: .45rem; max-width: 46%;
  pointer-events: none; white-space: nowrap;
}
.head-center.show { display: flex; }
.hc-logo {
  flex-shrink: 0; width: 26px; height: 26px; display: inline-grid; place-items: center;
  overflow: hidden; background: #fff; border-radius: 6px; padding: 3px;
}
.hc-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hc-logo.logo-plain { background: none; padding: 0; }
.hc-logo.hidden { display: none; }
.hc-name { font-weight: 700; font-size: 1rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.hc-suffix { color: var(--muted); font-weight: 500; font-size: .9rem; flex-shrink: 0; }
.conn-status { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.conn-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn-status.ok::before { background: var(--ok); }
.conn-status.bad::before { background: var(--danger); }
.call-timer {
  font-size: .82rem; color: var(--muted); font-weight: 600; flex-shrink: 0;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: .35rem;
}
.call-timer::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 0 rgba(240, 90, 90, .5);
  animation: timerPulse 2s ease-out infinite;
}
@keyframes timerPulse { 0% { box-shadow: 0 0 0 0 rgba(240, 90, 90, .45); } 70%, 100% { box-shadow: 0 0 0 6px rgba(240, 90, 90, 0); } }
.call-timer.hidden { display: none; }

.call-body { flex: 1; display: flex; min-height: 0; }

/* ---- Video-Grid ---- */
.grid {
  flex: 1; display: grid; gap: .6rem; padding: .6rem; min-height: 0;
  grid-auto-rows: 1fr; place-content: stretch;
}
.grid[data-count="1"] { grid-template-columns: 1fr; }
.grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.grid[data-count="3"], .grid[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
.grid[data-count="5"], .grid[data-count="6"] { grid-template-columns: repeat(3, 1fr); }

/* ---- Spotlight: eine Kachel groß (Bühne), Rest als Streifen darunter ---- */
.grid.spotlight { --strip: clamp(78px, 17vh, 150px); grid-template-rows: 1fr var(--strip); grid-template-columns: 1fr; }
.grid.spotlight .tile.spot { grid-column: 1 / -1; grid-row: 1; }
.grid.spotlight .tile:not(.spot) {
  grid-row: 2;
  /* Nie „quer" beschneiden: Streifen-Kacheln halten ~16:9 statt sich auf volle Breite zu strecken. */
  width: min(100%, calc(var(--strip) * 16 / 9));
  justify-self: center;
}
.grid.spotlight[data-count="2"] { grid-template-columns: 1fr; }
.grid.spotlight[data-count="3"] { grid-template-columns: repeat(2, 1fr); }
.grid.spotlight[data-count="4"] { grid-template-columns: repeat(3, 1fr); }
.grid.spotlight[data-count="5"], .grid.spotlight[data-count="6"] { grid-template-columns: repeat(4, 1fr); }
.tile.spot { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Stage-Position pro User wählbar (nach den data-count-Regeln, damit sie gewinnen).
   „Stage" = großer Bildschirm/Sprecher; die Köpfe liegen als Streifen an der gegenüberliegenden Seite. */
/* Stage UNTEN → Köpfe oben */
.grid.spotlight.stage-bottom { grid-template-rows: var(--strip) 1fr; }
.grid.spotlight.stage-bottom .tile.spot { grid-row: 2; }
.grid.spotlight.stage-bottom .tile:not(.spot) { grid-row: 1; }
/* Stage LINKS → Köpfe rechts (vertikaler Streifen) */
.grid.spotlight.stage-left {
  --stripv: clamp(130px, 22vw, 230px);
  grid-template-columns: 1fr var(--stripv);
  grid-template-rows: none; grid-auto-rows: 1fr;
}
.grid.spotlight.stage-left .tile.spot { grid-column: 1; grid-row: 1 / -1; }
.grid.spotlight.stage-left .tile:not(.spot) { grid-column: 2; grid-row: auto; }
/* Stage RECHTS → Köpfe links (vertikaler Streifen) */
.grid.spotlight.stage-right {
  --stripv: clamp(130px, 22vw, 230px);
  grid-template-columns: var(--stripv) 1fr;
  grid-template-rows: none; grid-auto-rows: 1fr;
}
.grid.spotlight.stage-right .tile.spot { grid-column: 2; grid-row: 1 / -1; }
.grid.spotlight.stage-right .tile:not(.spot) { grid-column: 1; grid-row: auto; }
/* Vertikale Streifen: Köpfe ebenfalls ~16:9 statt hochkant beschnitten. */
.grid.spotlight.stage-left .tile:not(.spot),
.grid.spotlight.stage-right .tile:not(.spot) {
  width: 100%;
  height: min(100%, calc(var(--stripv) * 9 / 16));
  justify-self: stretch;
  align-self: center;
}

/* Wähler-Leiste (oben rechts über der Bühne), nur bei aktiver Stage sichtbar */
.stage-layout { position: absolute; top: 10px; right: 10px; z-index: 7; display: none;
  gap: 4px; padding: 4px; border-radius: 10px; background: rgba(10,14,22,.7);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12); }
.grid.spotlight ~ .stage-layout, .stage-layout.show { display: flex; }
.sl-btn { width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent;
  background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.sl-btn:hover { background: rgba(255,255,255,.18); }
.sl-btn.active { background: var(--accent); border-color: var(--accent); }
.sl-btn svg { width: 18px; height: 18px; }

.tile {
  position: relative; background: var(--bg-3); border-radius: var(--radius);
  overflow: hidden; min-height: 0; min-width: 0;
  border: 2px solid transparent; transition: border-color .12s;
  animation: tileIn .4s cubic-bezier(.18,.9,.32,1);   /* sanft reinschweben beim Beitritt */
}
.tile.leaving { animation: tileOut .32s ease-in forwards; pointer-events: none; }
.tile.no-anim { animation: none; }  /* Reconnect-Rebuild: nicht erneut „einschweben" (wirkt wie neu geladen) */
@keyframes tileIn { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tileOut { to { opacity: 0; transform: scale(.9); } }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }
.tile.self video { transform: scaleX(-1); }
.tile.self.no-mirror video { transform: none; }
.tile.self.screen video { transform: none; }
.tile.cam-off video { visibility: hidden; }
/* Geteilter Bildschirm vollständig anzeigen (nicht beschneiden). */
.tile.screen video { object-fit: contain; background: #000; }

.tile .avatar {
  position: absolute; inset: 0; display: none; place-items: center;
  background: radial-gradient(circle at 50% 40%, var(--bg-4), var(--bg-3));
}
.tile.cam-off .avatar { display: grid; }
.tile .avatar span {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #3a4252, #2a303c); color: #fff;
  font-size: 1.8rem; font-weight: 600;
}

.tile-info {
  position: absolute; left: .5rem; bottom: .5rem; display: flex; align-items: center; gap: .35rem;
  background: rgba(0, 0, 0, .55); padding: .25rem .55rem; border-radius: 8px;
  font-size: .82rem; max-width: calc(100% - 1rem);
}
.tile-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-mic { width: 15px; height: 15px; flex-shrink: 0; color: var(--danger-2); display: flex; }
.tile-mic:empty { display: none; }

.tile.speaking { border-color: var(--ok); animation: speakPulse 1.8s ease-out infinite; }
@keyframes speakPulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,199,89,.5), inset 0 0 0 1px var(--ok); }
  70%  { box-shadow: 0 0 0 7px rgba(52,199,89,0), inset 0 0 0 1px var(--ok); }
  100% { box-shadow: 0 0 0 0 rgba(52,199,89,0), inset 0 0 0 1px var(--ok); }
}
.tile.connecting::after {
  content: "verbindet…"; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .4); color: var(--muted); font-size: .85rem;
}
.tile.failed { border-color: var(--danger); }

/* Bewegung reduzieren: Politur-Animationen aus, Zustände bleiben sichtbar. */
@media (prefers-reduced-motion: reduce) {
  .tile, .tile.leaving, .tile.speaking, .modal, .modal-card { animation: none; }
}

/* ---- Seiten-Panel ---- */
.side-panel {
  width: 320px; flex-shrink: 0; background: var(--bg-2); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.panel-tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; background: none; border: none; color: var(--muted); cursor: pointer;
  padding: .85rem .35rem; font-size: .84rem; font-weight: 600; position: relative;
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  white-space: nowrap;
}
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent); }
.badge {
  background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem;
  min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px;
}
.panel-close {
  flex-shrink: 0; width: 44px; background: none; border: none; color: var(--muted);
  font-size: 1.1rem; cursor: pointer;
}
.panel-close:hover { color: var(--text); }

.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: .8rem; display: flex; flex-direction: column; gap: .6rem; }
.chat-msg { display: flex; flex-direction: column; gap: .15rem; max-width: 90%; align-self: flex-start; }
.chat-msg.self { align-self: flex-end; align-items: flex-end; }
.chat-name { font-size: .72rem; color: var(--muted); }
.chat-text {
  background: var(--bg-3); padding: .5rem .7rem; border-radius: 12px; font-size: .9rem;
  word-break: break-word; line-height: 1.35;
}
.chat-msg.self .chat-text { background: var(--accent); color: #fff; }
.chat-text a { color: inherit; text-decoration: underline; }
.chat-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); padding-bottom: max(.7rem, env(safe-area-inset-bottom)); }
.chat-form input {
  flex: 1; background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: .6rem .9rem; outline: none; font-size: .9rem; min-width: 0;
}
.chat-form input:focus { border-color: var(--accent); }

.participants-panel { flex: 1; overflow-y: auto; padding: .5rem; padding-bottom: max(.5rem, env(safe-area-inset-bottom)); }
.participants-list { list-style: none; display: flex; flex-direction: column; gap: .2rem; }
.participants-list li { display: flex; align-items: center; gap: .6rem; padding: .55rem; border-radius: 10px; }
.participants-list li:hover { background: var(--bg-3); }
.p-avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, #3a4252, #2a303c); font-size: .8rem; font-weight: 600;
}
.p-name { flex: 1; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-mic { width: 16px; height: 16px; color: var(--danger-2); }
.p-mic:empty { display: none; }

/* Gastgeber-Aktionen in der Teilnehmerliste (Stummschalten / Teilen-Recht) */
.p-mod { display: flex; gap: .3rem; flex-shrink: 0; }
.p-act {
  width: 30px; height: 30px; padding: 6px; border-radius: 8px; cursor: pointer;
  background: var(--bg-4); color: var(--text); border: none; display: grid; place-items: center;
}
.p-act svg { width: 100%; height: 100%; }
.p-act:hover { background: #313641; }
.p-act[data-act="mute"]:hover { background: var(--danger); color: #fff; }
.p-act.on { background: var(--accent); color: #fff; }

/* ---- Klick-Menü auf der Kamerakachel (Host-Moderation) ---- */
.grid.host-mode .tile:not(.self) { cursor: pointer; }
.grid.host-mode .screen-tile { cursor: default; } /* Bildschirm-Kachel ist kein Moderationsziel */
.screen-tile { background: #000; }
.tile-menu {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 8; min-width: 180px; padding: 5px;
  background: rgba(18, 21, 27, .97); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px;
  box-shadow: 0 18px 44px -16px rgba(0, 0, 0, .9);
  display: flex; flex-direction: column; gap: 2px;
  animation: tmPop .12s ease both;
}
@keyframes tmPop { from { opacity: 0; transform: translate(-50%, -48%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.tm-item {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .55rem .7rem; border: none; border-radius: 8px; cursor: pointer;
  background: none; color: var(--text); font: inherit; font-size: .9rem; font-weight: 600;
  text-align: left;
}
.tm-item:hover { background: rgba(255, 255, 255, .09); }
.tm-item.danger:hover { background: var(--danger); color: #fff; }
.tm-item.on { color: var(--accent); }
.tm-ico { display: grid; place-items: center; width: 18px; height: 18px; flex-shrink: 0; }
.tm-ico svg { width: 100%; height: 100%; }

/* ---- Einstellungen-Modal ---- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; z-index: 60; padding: 1rem; animation: backdropIn .18s ease-out; }
.modal.hidden { display: none; }
.modal-card {
  width: min(640px, 100%); max-height: 86vh; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: var(--shadow);
  animation: modalIn .24s cubic-bezier(.2,.9,.3,1);
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 1.1rem; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; line-height: 1; }
.icon-btn:hover { color: var(--text); }
.modal-body { display: flex; min-height: 0; flex: 1; }
.settings-nav { display: flex; flex-direction: column; gap: .2rem; padding: .8rem; border-right: 1px solid var(--line); flex-shrink: 0; width: 150px; }
.settings-navbtn { text-align: left; background: none; border: none; color: var(--muted); padding: .6rem .7rem; border-radius: 8px; cursor: pointer; font-size: .92rem; font-weight: 500; }
.settings-navbtn:hover { background: var(--bg-3); }
.settings-navbtn.active { background: var(--bg-3); color: var(--text); }
.settings-sections { flex: 1; overflow-y: auto; padding: 1.2rem; }
.settings-sec { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; font-size: .82rem; color: var(--muted); font-weight: 500; }
.field select, .field input[type="text"] { background: var(--bg-3); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: .65rem .8rem; font-size: .95rem; outline: none; }
.field select:focus, .field input:focus { border-color: var(--accent); }
.field-row { display: flex; gap: .5rem; }
.field-row input { flex: 1; min-width: 0; }
.switch-row { display: flex; align-items: center; gap: .6rem; font-size: .92rem; color: var(--text); cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.switch-row.disabled { opacity: .55; cursor: not-allowed; }
.switch-row .opt { font-size: .78rem; color: var(--muted); }
.settings-preview { aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.settings-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.settings-preview video.no-mirror { transform: none; }
.level-test { display: flex; align-items: center; gap: .6rem; }
.level-label { font-size: .82rem; color: var(--muted); min-width: 3rem; }
.level-bar { flex: 1; height: 8px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.level-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--ok), #8fea8f); transition: width .05s linear; }
.secondary { background: var(--bg-4); color: var(--text); border: none; border-radius: 10px; padding: .6rem 1rem; cursor: pointer; font-size: .9rem; align-self: flex-start; }
.secondary:hover { background: #313641; }
.secondary.small { padding: .55rem .9rem; }
.settings-hint { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.audio-filters { display: flex; flex-direction: column; gap: .55rem; }
.modal-foot { padding: .7rem 1.2rem; border-top: 1px solid var(--line); text-align: center; font-size: .74rem; color: var(--muted); }
.modal-foot strong { color: var(--text); font-weight: 600; }
/* Optionen-Fenster: feste Höhe, damit der Wechsel Allgemein/Video/Audio nicht springt (Inhalt scrollt). */
#settingsModal .modal-card { height: min(600px, 86vh); }

@media (max-width: 560px) {
  .modal-body { flex-direction: column; }
  .settings-nav { flex-direction: row; width: auto; border-right: none; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .settings-navbtn { white-space: nowrap; }
}

/* ---- Steuerleiste ---- */
.controls {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem; background: var(--bg-2); border-top: 1px solid var(--line);
  padding-bottom: max(.7rem, env(safe-area-inset-bottom)); flex-wrap: wrap;
  padding-left: max(.7rem, env(safe-area-inset-left));
  padding-right: max(.7rem, env(safe-area-inset-right));
}
.ctrl {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  background: var(--bg-4); color: var(--text); border: none; cursor: pointer;
  border-radius: 13px; padding: .7rem 1rem; min-width: 80px;
  font-size: .8rem; transition: background .15s, transform .1s;
}
.ctrl:hover { background: #313641; }
.ctrl:active { transform: scale(.95); }
.ctrl .ico { width: 26px; height: 26px; }
.ctrl.off { background: var(--danger); color: #fff; }
.ctrl.active { background: var(--accent); color: #fff; }
.ctrl.leave { background: var(--danger); color: #fff; }
.ctrl.leave:hover { background: var(--danger-2); }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-4); color: var(--text); padding: .7rem 1.1rem; border-radius: 12px;
  border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50;
  max-width: calc(100vw - 2rem); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Warteraum: Gast-Overlay ---- */
.waiting-screen {
  position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; padding: 1.5rem;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2030, var(--bg));
  animation: backdropIn .2s ease-out;
}
.waiting-screen.hidden { display: none; }
.waiting-card {
  width: min(420px, 100%); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px; padding: 2.2rem 1.6rem; text-align: center; box-shadow: var(--shadow);
  animation: modalIn .28s cubic-bezier(.2,.9,.3,1);
}
.waiting-spinner {
  width: 52px; height: 52px; margin: 0 auto 1.2rem; border-radius: 50%;
  border: 4px solid var(--bg-4); border-top-color: var(--accent); animation: waitSpin 1s linear infinite;
}
@keyframes waitSpin { to { transform: rotate(360deg); } }
.waiting-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 .4rem; }
.waiting-sub { color: var(--muted); margin: 0 0 1rem; font-size: .95rem; }
.waiting-room { font-size: .82rem; color: var(--muted); margin: 0 0 1.4rem; }
.waiting-room span { color: var(--text); font-weight: 600; }
.waiting-card .secondary { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .waiting-spinner { animation-duration: 2.4s; }
}

/* ---- Warteraum: Host-Knock-Karten (Stapel) ---- */
.knock-stack {
  position: absolute; top: 12px; right: 12px; z-index: 46;
  display: flex; flex-direction: column; gap: .55rem; width: min(300px, calc(100vw - 24px));
  max-height: calc(100% - 24px); overflow-y: auto; pointer-events: none;
}
.knock-stack.hidden { display: none; }
.knock-card {
  pointer-events: auto; display: flex; gap: .7rem; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: .7rem .8rem; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  animation: knockIn .24s cubic-bezier(.2,.9,.3,1);
}
@keyframes knockIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.knock-avatar {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-4); color: var(--text); font-weight: 700; font-size: .85rem;
}
.knock-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.knock-text { font-size: .9rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.knock-text strong { font-weight: 700; }
.knock-actions { display: flex; gap: .45rem; }
.knock-actions button { flex: 1; border: none; border-radius: 8px; padding: .45rem .4rem; font-size: .85rem; font-weight: 600; cursor: pointer; }
.knock-admit { background: var(--accent); color: #fff; }
.knock-admit:hover { background: var(--accent-2); }
.knock-deny { background: var(--bg-4); color: var(--text); }
.knock-deny:hover { background: var(--danger); color: #fff; }

/* ============ MOBILE ============ */
@media (max-width: 640px) {
  .grid[data-count="2"] { grid-template-columns: 1fr; }
  .grid[data-count="3"], .grid[data-count="4"],
  .grid[data-count="5"], .grid[data-count="6"] { grid-template-columns: repeat(2, 1fr); }

  .side-panel {
    position: fixed; inset: 0; width: 100%; z-index: 40;
    padding-top: env(safe-area-inset-top);
  }
  /* Steuerleiste als horizontale Scroll-Row: große Touch-Buttons, kein krummer Umbruch. */
  .controls {
    flex-wrap: nowrap; justify-content: flex-start; gap: .4rem;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
  }
  .controls::-webkit-scrollbar { display: none; }
  .ctrl { flex: 0 0 auto; scroll-snap-align: center; min-width: 62px; min-height: 62px; padding: .6rem .4rem; justify-content: center; border-radius: 15px; }
  .ctrl .lbl { display: none; }
  .ctrl .ico { width: 27px; height: 27px; }
  /* größere Touch-Ziele für die kleinen Overlay-Knöpfe */
  .sl-btn { width: 40px; height: 40px; }
  .lt-move { width: 40px; height: 40px; }
  /* Knock-Karten am Handy oben zentriert und breiter */
  .knock-stack { left: 12px; right: 12px; width: auto; }
  .knock-actions button { padding: .6rem .4rem; }
}

@media (max-width: 360px) {
  .ctrl { min-width: 56px; min-height: 56px; }
  .controls { gap: .3rem; }
}

/* Querformat / sehr flache Viewports: Kacheln nebeneinander, Header/Controls kompakt */
@media (orientation: landscape) and (max-height: 480px) {
  .grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
  .call-header { padding-top: max(.35rem, env(safe-area-inset-top)); padding-bottom: .35rem; }
  .controls { padding-top: .35rem; gap: .35rem; }
  .ctrl { min-width: 48px; min-height: 40px; padding: .35rem .4rem; }
  .ctrl .lbl { display: none; }
  .ctrl .ico { width: 22px; height: 22px; }
}

/* ============ BRANDING ============ */
/* Markenfarben pro Call. Defaults = Vantis-Akzent, werden bei aktivem Branding überschrieben. */
.call { --brand: var(--accent); --brand-2: var(--accent-2); --on-brand: #fff; }

/* Logo-Chip (weißer Hintergrund, damit weiße & transparente Logos sauber sitzen) */
.head-logo, .lt-logo, .bp-logo, .be-logo-prev {
  flex-shrink: 0; display: inline-grid; place-items: center; overflow: hidden;
  background: #fff; border-radius: 7px;
}
.head-logo { width: 40px; height: 40px; padding: 4px; border-radius: 9px; }
.head-logo img, .lt-logo img, .bp-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Vantis-Default-Logo braucht keinen weißen Chip */
.room-info:not(.branded) .head-logo { background: none; padding: 0; }
.room-info:not(.branded) .head-logo img { object-fit: contain; }
/* Helles, freistehendes Logo (z.B. FUNK DESIGN weiß) direkt auf dem dunklen Header – ohne Chip. */
.head-logo.logo-plain { background: none; padding: 0; }
/* Initialen-Fallback (kein Logo) */
.lt-logo:not(.has-logo), .be-logo-prev:not(.has-logo) {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--on-brand);
  font-weight: 800; font-size: .8rem;
}
/* Mitte ausblenden, wenn der Header zu schmal wird (kein Platz neben links/rechts) */
@media (max-width: 720px) { .head-center { display: none !important; } }

/* ---- Lower-Third im Call ---- */
.call-body { position: relative; }
.lower-third {
  position: absolute; z-index: 5; --edge: 1rem;
  display: flex; align-items: stretch; max-width: min(88%, 700px);
  border-radius: 16px; overflow: hidden;
  background: rgba(10, 12, 16, .85); backdrop-filter: blur(8px);
  box-shadow: 0 14px 36px -14px rgba(0, 0, 0, .85);
  animation: ltRise .45s ease both;
}
/* 4 Ecken – per Button im Call umschaltbar */
.lower-third.pos-tl { left: var(--edge); top: var(--edge); }
.lower-third.pos-tr { right: var(--edge); top: var(--edge); }
.lower-third.pos-bl { left: var(--edge); bottom: var(--edge); }
.lower-third.pos-br { right: var(--edge); bottom: var(--edge); }
@keyframes ltRise { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
/* Button zum Verschieben (erscheint beim Drüberfahren) */
.lt-move {
  position: absolute; top: 5px; right: 5px; z-index: 6;
  width: 27px; height: 27px; padding: 5px; border-radius: 7px;
  background: rgba(0, 0, 0, .5); color: #fff; border: none; cursor: pointer;
  opacity: 0; transition: opacity .15s, background .15s;
}
.lt-move svg { width: 100%; height: 100%; }
.lower-third:hover .lt-move { opacity: .85; }
.lt-move:hover { background: rgba(0, 0, 0, .85); opacity: 1; }
.lt-bar { width: 10px; flex-shrink: 0; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.lower-third .lt-logo { width: 70px; height: 70px; margin: .85rem 0 .85rem .9rem; padding: 5px; border-radius: 13px; }
.lt-text { display: flex; flex-direction: column; justify-content: center; gap: .15rem; padding: .9rem 1.4rem; min-width: 0; }
.lt-label { font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); line-height: 1.1; }
.lt-title { font-weight: 800; font-size: 1.7rem; line-height: 1.12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-title:empty { display: none; }
.lt-comp { font-size: 1.22rem; color: rgba(255, 255, 255, .82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-comp:empty { display: none; }

/* Größe der Einblendung (sm/md/lg) – vom Host gesetzt, für alle gleich. md = Default. */
.lower-third.size-sm .lt-logo { width: 54px; height: 54px; }
.lower-third.size-sm .lt-title { font-size: 1.3rem; }
.lower-third.size-sm .lt-comp { font-size: .95rem; }
.lower-third.size-sm .lt-label { font-size: .7rem; }
.lower-third.size-sm .lt-text { padding: .7rem 1.1rem; }
.lower-third.size-lg .lt-logo { width: 92px; height: 92px; }
.lower-third.size-lg .lt-title { font-size: 2.2rem; }
.lower-third.size-lg .lt-comp { font-size: 1.55rem; }
.lower-third.size-lg .lt-label { font-size: .92rem; }
.lower-third.size-lg .lt-text { padding: 1.1rem 1.7rem; }
.lt-move.hidden { display: none; }

/* FUNK DESIGN: oranger Akzent nur auf dem Wort „THEMA" (sonst Schwarz/Weiß). */
.lower-third.brand-funk .lt-label,
.brand-prev.brand-funk .lt-label { color: #ff6a00; }

@media (max-width: 640px) {
  .lower-third { --edge: .6rem; max-width: calc(100% - 1.2rem); }
  .lower-third .lt-logo { width: 58px; height: 58px; }
  .lt-title { font-size: 1.35rem; }
  .lt-comp { font-size: 1.05rem; }
}

/* ---- Vibe-Layer: flüchtige Reaktionen + Konfetti ---- */
.vibe-layer {
  position: absolute; inset: 0; z-index: 6; /* über lower-third(5), unter tile-menu(8)/modal(60) */
  overflow: hidden; pointer-events: none;   /* fängt nie Klicks ab */
  contain: layout paint style;              /* isoliert Repaints vom Video-Grid */
}
.vibe-react {
  position: absolute; font-size: 3.4rem; line-height: 1;
  --dx: 0px; --rot: 0deg;                 /* Seitwärts-Flug + kleiner Wackel-Ausschlag (aus JS gesetzt) */
  will-change: transform, opacity;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
  transform-origin: center bottom;
  animation: vibe-float-up 3.8s cubic-bezier(.18,.9,.32,1) forwards;
}
.vibe-confetti {
  position: absolute; top: -14px; width: 11px; height: 17px; border-radius: 2px;
  will-change: transform, opacity;
  animation: vibe-confetti-fall linear forwards;
}
@keyframes vibe-float-up {
  0%   { transform: translate(0,0) scale(.2) rotate(0deg); opacity: 0; }
  10%  { transform: translate(calc(var(--dx)*.08), -7%) scale(1.7) rotate(var(--rot)); opacity: 1; }        /* kräftiger Pop */
  32%  { transform: translate(calc(var(--dx)*.30), -24%) scale(1) rotate(calc(var(--rot)*-1)); }            /* Wackeln links… */
  56%  { transform: translate(calc(var(--dx)*.58), -50%) scale(.96) rotate(var(--rot)); }                   /* …und rechts */
  80%  { transform: translate(calc(var(--dx)*.84), -74%) scale(.9) rotate(calc(var(--rot)*-1)); opacity: 1; }
  100% { transform: translate(var(--dx), -92vh) scale(.85) rotate(0deg); opacity: 0; }                       /* endet aufrecht – 👍 bleibt 👍 */
}
@keyframes vibe-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(102vh) rotate(720deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  /* Sanfter Ein-/Ausblend-Flash statt Bewegung. */
  .vibe-react { animation: vibe-fade 1.2s ease-out forwards; }
  .vibe-confetti { display: none; }
  @keyframes vibe-fade { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
}
/* ---- Nerd-/Diagnose-Panel: Live-Verbindungsstatistik ---- */
.nerd-panel {
  position: absolute; top: 10px; right: 10px; z-index: 9; /* über stage-layout(7)/tile-menu(8), unter popover(55)/modal(60) */
  width: min(320px, calc(100% - 20px)); max-width: 320px;
  max-height: calc(100% - 20px); overflow-y: auto; overscroll-behavior: contain;
  background: rgba(10, 14, 22, .86);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px;
  padding: .7rem .8rem; color: #e8eaed;
  font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  pointer-events: auto; /* nur das Panel fängt Klicks (Scrollen), nicht die Fläche darum */
}
.nerd-panel.hidden { display: none; }
.nerd-panel .ns-title { font-weight: 700; font-size: 12px; letter-spacing: .02em; color: #fff; margin-bottom: 2px; }
.nerd-panel .ns-meta { color: #9aa0aa; font-size: 11px; word-break: break-word; }
.nerd-panel .ns-meta b { color: #cdd2da; font-weight: 600; }
.nerd-panel .ns-rows { margin-top: .55rem; display: flex; flex-direction: column; gap: .5rem; }
.nerd-panel .ns-empty { color: #9aa0aa; font-size: 11px; padding: .25rem 0; }
.nerd-panel .ns-row { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: .45rem; }
.nerd-panel .ns-row:first-child { border-top: none; padding-top: 0; }
.nerd-panel .ns-r1 { display: flex; align-items: center; gap: .4rem; }
.nerd-panel .ns-name { font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.nerd-panel .ns-conn { margin-left: auto; font-size: 10.5px; color: #9aa0aa; white-space: nowrap; flex-shrink: 0; }
.nerd-panel .ns-r2, .nerd-panel .ns-r3 { color: #c3c8d0; font-size: 11px; margin-top: 2px; }
.nerd-panel .ns-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; background: #6b7280; }
.nerd-panel .ns-ok { background: var(--ok); box-shadow: 0 0 6px rgba(52, 199, 89, .7); }
.nerd-panel .ns-warn { background: #f5b301; box-shadow: 0 0 6px rgba(245, 179, 1, .6); }
.nerd-panel .ns-bad { background: var(--danger); box-shadow: 0 0 6px rgba(229, 72, 77, .6); }
.nerd-panel .ns-neutral { background: #6b7280; }
.nerd-panel .ns-level { margin-top: 4px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.nerd-panel .ns-level > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), #f5b301); transition: width .2s ease; }
@media (max-width: 640px) {
  /* Mobil: schmaler, oben über die Breite – bleibt in der call-body, überdeckt die Steuerleiste nie. */
  .nerd-panel { top: 6px; right: 6px; left: 6px; width: auto; max-width: none; max-height: 45%; padding: .55rem .65rem; font-size: 11px; }
}

.vibe-popover {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  display: flex; gap: .35rem; padding: .5rem .6rem;
  background: #23272f; border: 1px solid #3a4150; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); z-index: 55; /* über toast(50), unter modal(60) */
}
.vibe-popover.hidden { display: none; }

/* Auftritt-Popover (Host): großer Selbst-Auftritt + Marken-Bumper */
.auftritt-popover {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: .55rem; padding: .7rem .8rem; width: min(320px, 92vw);
  background: #23272f; border: 1px solid #3a4150; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); z-index: 55;
}
.auftritt-popover.hidden { display: none; }
.ap-item { width: 100%; padding: .7rem .9rem; border-radius: 10px; border: 1px solid transparent;
  font-size: 1rem; font-weight: 700; cursor: pointer; text-align: center; }
.ap-primary { background: linear-gradient(160deg, var(--brand, #3478f6), color-mix(in srgb, var(--brand, #3478f6) 60%, #000)); color: var(--on-brand, #fff); }
.ap-primary:hover { filter: brightness(1.08); }
.ap-sep { height: 1px; background: #3a4150; margin: .1rem 0; }
.ap-label { font-size: .78rem; color: var(--muted); }
.ap-row { display: flex; gap: .4rem; }
.ap-input { flex: 1; padding: .5rem .6rem; border-radius: 8px; border: 1px solid #3a4150; background: #1a1d24; color: var(--text); font-size: .95rem; min-width: 0; }
.ap-play { flex-shrink: 0; width: 42px; border-radius: 8px; border: 1px solid #3a4150; background: #2f3542; color: var(--text); font-size: 1rem; cursor: pointer; }
.ap-play:hover { background: #3a4150; }

/* Personen-Auftritt: kurze Namens-Einblendung auf der Kachel (Host-ausgelöst, für alle gleich) */
.tile-namecard {
  position: absolute; left: 12px; bottom: 12px; z-index: 4; max-width: 80%;
  padding: .4rem .75rem; border-radius: 9px;
  background: rgba(10,14,22,.72); color: #fff; font-weight: 700; font-size: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: tile-name 3.2s ease forwards;
}
@keyframes tile-name {
  0% { opacity: 0; transform: translateY(14px); }
  10% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .tile-namecard { animation: tile-name-fade 3.2s ease forwards; }
  @keyframes tile-name-fade { 0%{opacity:0} 12%{opacity:1} 85%{opacity:1} 100%{opacity:0} }
}
.vibe-pick {
  font-size: 1.5rem; line-height: 1; width: 44px; height: 44px; /* Touch-Ziel ≥44px */
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; transition: transform .1s, background .15s;
}
.vibe-pick:hover { background: #313641; transform: scale(1.15); }
.vibe-pick:active { transform: scale(.92); }
.vibe-party { background: #313641; }
@media (max-width: 360px) { .vibe-pick { width: 40px; height: 40px; font-size: 1.35rem; } }

/* ---- Branding-Block in der Lobby ---- */
.brand-block { display: flex; flex-direction: column; gap: .7rem; }
.brand-row { display: flex; align-items: flex-end; gap: .5rem; }
.brand-sel { flex: 1; min-width: 0; }
.brand-sel select { width: 100%; }
.brand-row .secondary { flex-shrink: 0; }
.brand-meeting { display: flex; flex-direction: column; gap: .8rem; }
.brand-meeting.hidden { display: none; }
.brand-sub { margin: 0; font-size: .95rem; font-weight: 600; color: var(--text); }
.brand-div { border: 0; height: 1px; background: var(--line); margin: .5rem 0 .1rem; }
.brand-prev {
  display: flex; align-items: stretch; border-radius: 10px; overflow: hidden;
  background: #0a0c10; min-height: 52px;
}
.brand-prev .lt-logo { width: 46px; height: 46px; margin: .6rem 0 .6rem .65rem; padding: 4px; }
.brand-prev .lt-text { padding: .6rem 1rem; }
.brand-prev .lt-title { font-size: 1.2rem; }
.brand-prev .lt-comp { font-size: .9rem; }
.brand-prev:not(.on) { display: none; }

/* ---- Branding-Verwaltung (Modal) ---- */
.brand-modal-body { flex-direction: column; gap: .9rem; padding: 1.2rem; overflow-y: auto; }
.brand-list { display: flex; flex-direction: column; gap: .5rem; }
.brand-item {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
}
.brand-item .bi-logo { width: 34px; height: 34px; border-radius: 7px; background: #fff; padding: 3px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; }
.brand-item .bi-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-item .bi-logo:not(.has-logo) { background: linear-gradient(135deg, var(--bi-c1, #555), var(--bi-c2, #333)); color: #fff; font-weight: 800; font-size: .8rem; }
.brand-item .bi-name { flex: 1; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-item .bi-colors { display: flex; gap: .25rem; }
.brand-item .bi-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); }
.brand-item .bi-edit, .brand-item .bi-del {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: .82rem; padding: .25rem .4rem; border-radius: 6px;
}
.brand-item .bi-edit:hover { color: var(--text); background: var(--bg-4); }
.brand-item .bi-del:hover { color: var(--danger-2); background: var(--bg-4); }
.brand-list:empty { display: none; }

/* Auftritts-Sounds */
.sound-list { display: flex; flex-direction: column; gap: .4rem; }
.sound-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); }
.sound-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-play, .sound-del { border: 0; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: .85rem; flex-shrink: 0; }
.sound-play { background: var(--accent); color: #fff; }
.sound-del { background: var(--bg-4); color: var(--muted); }
.sound-del:hover { color: var(--danger-2); }
.sound-add { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .3rem; }
.sound-add input[type=text] { flex: 1; min-width: 130px; }

/* Intro-Schalter im Vorlagen-Editor */
.be-check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.be-check input { width: auto; }
.be-intro-opts { display: flex; flex-direction: column; gap: .8rem; margin: .1rem 0; transition: opacity .2s ease; }

.brand-editor { display: flex; flex-direction: column; gap: .9rem; border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .2rem; }
.brand-editor h4 { font-size: .95rem; font-weight: 700; }
.be-row { display: flex; gap: .8rem; }
.be-row .field { flex: 1; }
.color-row { display: flex; align-items: center; gap: .5rem; }
.color-row input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-3); cursor: pointer; }
.color-row .hex { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.be-logo-row { display: flex; align-items: center; gap: .7rem; }
.be-logo-prev { width: 44px; height: 44px; padding: 4px; }
.file-btn {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  background: var(--bg-4); color: var(--text); border: 1px dashed var(--line);
  border-radius: 9px; padding: .55rem .9rem; font-size: .88rem;
}
.file-btn:hover { border-color: var(--accent); }
.link-btn { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .82rem; }
.link-btn:hover { color: var(--danger-2); }
.be-actions { display: flex; justify-content: flex-end; gap: .6rem; }

/* ---- Filter (LUT) im Optionen-Tab ---- */
.filter-looks { display: flex; flex-direction: column; gap: 16px; }
.filter-cat-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }
.flook { background: var(--bg-3); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; cursor: pointer; transition: border-color .12s; }
.flook:hover { border-color: var(--accent); }
.flook.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.flook canvas, .flook .flook-none { width: 100%; aspect-ratio: 4/3; display: block; background: #11141a; }
.flook canvas { transform: scaleX(-1); }
.flook .flook-none { display: grid; place-items: center; color: var(--muted); font-size: 22px; }
.flook .flook-name { padding: 5px 6px; font-size: 11px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Stärke-Regler klebt unten fest, auch wenn man durch die Looks scrollt */
.filter-bar {
  position: sticky; bottom: 0; z-index: 3;
  background: var(--bg-2); border-top: 1px solid var(--line);
  margin: .8rem -1.2rem 0; padding: .9rem 1.2rem 1rem;
  display: flex; flex-direction: column; gap: .55rem;
}
.filter-bar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 1.3rem; background: var(--bg-2); }
.filter-strength { margin: 0; }
.filter-strength .color-row { width: 100%; }
.filter-strength .color-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.filter-active { font-size: .85rem; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Urheber-Credit: auch WÄHREND des Calls immer sichtbar (FUNK DESIGN) ---- */
.call-credit { font-size: .72rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; letter-spacing: .01em; }
.call-credit strong { color: var(--text); font-weight: 700; }
@media (max-width: 640px) {
  .call-credit { display: none; }              /* Credit steht in Lobby/Footer; im Call mobil kein Platz → sonst Überlappung mit „Vantis" */
  .room-label { display: none; }               /* Raum-Code mobil weg – der Einladen-Button reicht */
  .conn-status { font-size: 0; gap: 0; }        /* nur der Status-Punkt, kein „Verbunden"-Text */
  .conn-status::before { width: 10px; height: 10px; }
}
