/* HS (14.11.2026): Seiten nutzen die volle Fensterbreite statt fester Höchstbreite (Admin-Bereich und Partner-Ansicht).
   Dokumente (Rechnungen/Gutschriften), Anmelde- und Einrichtungsseiten bleiben bewusst schmal. */
.content { max-width: none; }
.portal-header-inner, .portal-content { max-width: none; }

/* HS 17.11.2026: Zwei-Faktor-Anmeldung (Login-Schritt + Konto → Zwei-Faktor). Kein Inline-CSS wegen CSP (style-src 'self'). */
.tf-code-input { font-size: 22px; letter-spacing: .25em; text-align: center; }
.tf-code-small { width: 150px; font-size: 20px; letter-spacing: .2em; }
.tf-h2 { margin: 0; font-size: 17px; }
.tf-h2-gap { margin-top: 8px; }
.tf-setup { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.tf-qr { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--border); line-height: 0; }
.tf-qr svg { display: block; width: 220px; height: 220px; }
.tf-key { font-size: 16px; letter-spacing: .08em; user-select: all; word-break: break-all; }
.tf-wrap { flex-wrap: wrap; }
.tf-pw { max-width: 240px; }
.tf-warn { border-color: var(--warning); }
.tf-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-width: 640px; }
.tf-rc { font-size: 16px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; text-align: center; user-select: all; }

/* HS 19.11.2026: Live-Studio (Creator / Admin) */
.lv-body { background: var(--bg); }
.lv-app { min-height: 100vh; display: flex; flex-direction: column; }
.lv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.lv-head .badge { margin-left: 8px; }
.lv-head-right { display: flex; align-items: center; gap: 10px; }
.lv-head-right form { margin: 0; }
.lv-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; padding: 16px 20px; }
.lv-stage, .lv-chat { padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lv-video-wrap { position: relative; background: #000; border-radius: 12px; aspect-ratio: 16 / 9; overflow: hidden; }
.lv-video-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; }
.lv-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #aaa; font-size: 14px; pointer-events: none; }
.lv-placeholder[hidden] { display: none; }
.lv-status { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; background: #000a; color: #ddd; font-weight: 700; font-size: 12px; letter-spacing: .06em; }
.lv-status i { width: 9px; height: 9px; border-radius: 50%; background: #888; }
.lv-status.is-live { background: #b91c1c; color: #fff; }
.lv-status.is-live i { background: #fff; }
.lv-status.is-starting i { background: #f59e0b; }
.lv-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.lv-grow { flex: 1; min-width: 200px; }
.lv-controls .field { margin: 0; }
.lv-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.lv-next { display: flex; flex-direction: column; gap: 6px; }
.lv-next label { font-weight: 600; font-size: 13px; }
.lv-next input { flex: 1; }
.lv-chat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lv-messages { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 300px; max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.lv-messages li { padding: 7px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.lv-messages li b { margin-right: 6px; }
.lv-messages li.model b { color: #b45309; }
.lv-messages li.team b { color: var(--brand); }
.lv-messages li .lv-mod { float: right; display: inline-flex; gap: 4px; margin-left: 8px; }
.lv-messages li .lv-mod button { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; font-size: 11px; padding: 1px 6px; cursor: pointer; color: var(--text-2); }
.lv-messages li .lv-mod button:hover { border-color: var(--danger); color: var(--danger); }
.lv-messages li .lv-mod button.lv-to { border-color: var(--danger); color: var(--danger); }
.lv-messages li.lv-timed-out > b { text-decoration: line-through; opacity: .6; }
.lv-messages .lv-empty { background: none; color: var(--text-3); text-align: center; }
.lv-compose { display: flex; gap: 8px; }
.lv-compose input { flex: 1; min-width: 0; }
@media (max-width: 860px) { .lv-main { grid-template-columns: 1fr; padding: 12px; } .lv-messages { max-height: 45vh; } }
/* Admin-Seite Live & Creator */
.lv-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.lv-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.lv-inline input { width: 160px; }

/* HS 19.11.2026: Live-Qualitätsanzeige */
#lv-quality { font-variant-numeric: tabular-nums; min-height: 1.2em; }
#lv-quality.lv-q-warn { color: var(--danger); font-weight: 600; }

/* HS 23.11.2026: angepinnte Nachricht im Live-Chat */
.lv-pinned { margin: 8px 0; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--brand); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.lv-pinned a { font-weight: 650; }
.lv-pin-form { margin-top: 12px; }
.lv-pin-form > input { width: 100%; margin-bottom: 6px; }

/* HS 23.11.2026: Mikrofon-Test im Studio */
.lv-mic-test { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 4px; }
.lv-meter { position: relative; display: inline-block; width: 160px; height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.lv-meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: #16a34a; transition: width .06s linear; }
.lv-meter i.hot { background: #dc2626; }

/* HS 23.11.2026: Studio einfach + handytauglich */
.lv-steps { display: flex; flex-direction: column; gap: 12px; }
.lv-step { display: flex; gap: 12px; align-items: flex-start; }
.lv-num { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); margin-top: 6px; }
.lv-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lv-step-body > input { width: 100%; }
.lv-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lv-big { min-height: 46px; font-size: 15px; font-weight: 650; }
.lv-go { width: 100%; min-height: 52px; font-size: 17px; }
details.lv-more { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
details.lv-more > summary { cursor: pointer; font-weight: 650; font-size: 14px; padding: 4px 0; }
details.lv-more[open] > summary { margin-bottom: 8px; }
@media (max-width: 640px) {
  .lv-head { padding: 8px 12px; }
  .lv-head .badge { display: none; }
  .lv-main { padding: 8px; gap: 10px; }
  .lv-stage, .lv-chat { padding: 10px; }
  .lv-video-wrap { aspect-ratio: auto; height: 50vh; }
  .lv-row .lv-big { flex: 1 1 100%; }
  .lv-meter { width: 100%; }
  .lv-app input, .lv-app select, .lv-app textarea { font-size: 16px; } /* iPhone zoomt sonst beim Tippen */
  .lv-messages { min-height: 160px; max-height: 40vh; }
  .lv-chat .lv-compose { position: sticky; bottom: 0; background: var(--surface); padding-top: 6px; }
  .lv-messages li .lv-mod button { padding: 4px 8px; font-size: 12px; }
}

/* HS 23.11.2026 (Felix): Handy während der Show – eigenes Bild klein oben, Chat ist das Wichtigste und füllt den Rest */
@media (max-width: 640px) {
  .lv-app.lv-is-live { height: 100vh; height: 100dvh; overflow: hidden; }
  .lv-app.lv-is-live .lv-head { padding: 6px 10px; }
  .lv-app.lv-is-live .lv-head-right > span { display: none; }
  .lv-app.lv-is-live .lv-main { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding: 6px; gap: 6px; }
  .lv-app.lv-is-live .lv-stage { flex: 0 0 auto; padding: 6px; gap: 6px; }
  .lv-app.lv-is-live .lv-video-wrap { height: 30vh; height: 30dvh; }
  .lv-app.lv-is-live .lv-step:not(:last-child),
  .lv-app.lv-is-live .lv-stage details.lv-more,
  .lv-app.lv-is-live .lv-stage > .hint,
  .lv-app.lv-is-live .lv-num { display: none; }
  .lv-app.lv-is-live .lv-go { min-height: 40px; font-size: 15px; }
  .lv-app.lv-is-live .lv-controls .hint { display: none; }
  .lv-app.lv-is-live .lv-chat { flex: 1 1 auto; min-height: 0; padding: 8px; gap: 6px; }
  .lv-app.lv-is-live .lv-messages { flex: 1 1 auto; min-height: 0; max-height: none; }
  .lv-app.lv-is-live .lv-pinned { margin: 0; }
}
@media (max-width: 640px) { .lv-app.lv-is-live #lv-quality.lv-q-warn { display: block; font-size: 12px; margin: 0; } } /* Warnung bei schlechter Verbindung bleibt sichtbar */

/* HS 23.11.2026 v2 (Felix): Live-Ansicht für Creator – eigener Bildschirm: nur Bild + Chat, kein Scrollen, Beenden auf dem Bild */
body.lv-noscroll { overflow: hidden; }
.lv-stop-overlay { position: absolute; top: 10px; right: 10px; z-index: 3; border: 0; border-radius: 999px; padding: 10px 18px;
  background: #dc2626; color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .02em; box-shadow: 0 2px 12px #0007; cursor: pointer; }
.lv-stop-overlay[hidden] { display: none; }
.lv-q-overlay { display: none; }
.lv-app.lv-live-mode { position: fixed; inset: 0; z-index: 50; height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }
.lv-app.lv-live-mode .lv-head { display: none; }
.lv-app.lv-live-mode .lv-main { height: 100%; min-height: 0; padding: 8px; gap: 8px; grid-template-rows: minmax(0, 1fr); }
.lv-app.lv-live-mode .lv-stage { padding: 0; overflow: hidden; min-height: 0; }
.lv-app.lv-live-mode .lv-stage > :not(.lv-video-wrap) { display: none !important; }
.lv-app.lv-live-mode .lv-video-wrap { height: 100%; aspect-ratio: auto; border-radius: 12px; }
.lv-app.lv-live-mode .lv-q-overlay:not(:empty) { display: block; position: absolute; left: 8px; right: 8px; bottom: 8px; margin: 0; z-index: 3;
  padding: 5px 9px; border-radius: 8px; background: #b91c1cd9; color: #fff; font-size: 12px; font-weight: 600; }
.lv-app.lv-live-mode .lv-chat { min-height: 0; overflow: hidden; padding: 10px; }
.lv-app.lv-live-mode .lv-messages { flex: 1 1 auto; min-height: 0; max-height: none; }
.lv-app.lv-live-mode .lv-pinned { margin: 0; }
@media (max-width: 640px) {
  .lv-app.lv-live-mode .lv-main { display: flex; flex-direction: column; padding: 6px; gap: 6px; }
  .lv-app.lv-live-mode .lv-stage { flex: 0 0 36%; }
  .lv-app.lv-live-mode .lv-chat { flex: 1 1 auto; padding: 8px; gap: 6px; }
  .lv-app.lv-live-mode .lv-chat .lv-compose { position: static; padding-top: 0; }
}

/* HS 23.11.2026: Chat-Regeln als erste Nachricht */
.lv-messages li.lv-rules { white-space: pre-line; background: color-mix(in srgb, var(--brand) 10%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  font-size: 13px; line-height: 1.45; }
