/* Farben und Maße wie im Kundenportal von zirke.digital: monochrom, hell und dunkel nach Systemeinstellung */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface2: #f5f5f7; --fill: #e6e6eb; --text: #1d1d1f; --muted: #6e6e73; --line: #e3e3e8;
  --brand: #1d1d1f; --brand-ink: #ffffff;
  --danger: #d70015; --danger-ink: #ffffff; --danger-soft: #fde2e2; --danger-text: #b91c1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 18px rgba(0, 0, 0, .05);
  --kachel: #e6e6eb;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --surface: #1c1c1e; --surface2: #2c2c2e; --fill: #2c2c2e; --text: #f5f5f7; --muted: #a1a1a6; --line: #38383a;
    --brand: #f5f5f7; --brand-ink: #1d1d1f;
    --danger: #ff453a; --danger-ink: #ffffff; --danger-soft: #3b1616; --danger-text: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
    --kachel: #1c1c1e;
  }
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
/* Sichtbare Höhe ohne die Safari-Leisten, damit die Steuerung nicht darunter verschwindet */
@supports (height: 100dvh) { html, body { height: 100dvh; } }
body { margin: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
svg.klein { width: 14px; height: 14px; }
h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1:focus { outline: none; }
.leise { margin: 0; color: var(--muted); font-size: 13.5px; }

/* Kopfzeile: nur der Name, klein und ruhig */
.kopf { flex: none; padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
body[data-ansicht="raum"] .kopf { display: none; }
.kopf-marke { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }

/* Beitreten, Hinweise, Ende: eine Karte auf dem Seitenhintergrund */
.seite { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.karte { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 20px 18px; box-shadow: var(--shadow); }
.schloss-zeile { display: flex; gap: 6px; align-items: baseline; margin-bottom: 16px; }
.schloss-zeile svg { position: relative; top: 2px; fill: var(--muted); }

.vorschau { position: relative; aspect-ratio: var(--seite, 1.7778); width: min(100%, calc(46dvh * var(--seite, 1.7778))); margin-inline: auto; border-radius: 12px; background: var(--surface2); overflow: hidden; display: grid; place-items: center; }
.vorschau video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.vorschau.mit-bild video { opacity: 1; }
.vorschau.mit-bild .vorschau-text { display: none; }
.vorschau-text { color: var(--muted); font-size: 13px; }

.aus .symbol::after { content: ""; position: absolute; width: 26px; height: 2px; border-radius: 1px; background: currentColor; transform: rotate(-45deg); box-shadow: 0 0 0 1.5px var(--surface); }

label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none; }
input::placeholder { color: var(--muted); opacity: .8; }
input:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }

.haupt { display: block; width: 100%; min-height: 48px; margin-top: 14px; padding: 12px 20px; border: 0; border-radius: 100px; background: var(--brand); color: var(--brand-ink); font-size: 16px; font-weight: 600; transition: opacity .15s, transform .12s; }
.haupt:active:not(:disabled) { transform: scale(.98); }
.haupt:disabled { opacity: .4; cursor: default; }
.meldung { min-height: 1.45em; margin: 10px 0 0; color: var(--muted); font-size: 13.5px; text-align: center; }

/* Zustände: Link ungültig, Raum noch nicht geöffnet, Termin vorbei, verlassen */
.zustand { text-align: left; }
.zustand .haupt { margin-top: 18px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.textknopf { padding: 4px 2px; border: 0; background: none; color: var(--text); font-size: 13.5px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.klein-text { font-size: 12px; }
.mittig { text-align: center; }
a { color: inherit; }

/* Vorschau wie Webex: Bild, darunter geteilte Knöpfe */
.vorab-karte { max-width: 520px; }
.vorab-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.vorab-knoepfe { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 16px; }
.pegel-leiste { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.pegel-leiste i { display: block; height: 100%; width: calc(var(--pegel, 0) * 100%); background: #34c759; transition: width .08s linear; }
.pegel-leiste.breit { position: static; display: block; margin-top: 8px; height: 6px; background: var(--fill); }
.verbindung { margin-top: 10px; text-align: center; }
.pruefliste { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; text-align: left; }
.pruefliste li { padding: 3px 0; }
.pruefliste .ok { color: var(--text); } .pruefliste .fehler { color: var(--danger-text); } .pruefliste .info { color: var(--muted); }

/* Geteilte Knöpfe: links schalten, rechts das Menü */
.split { display: inline-flex; align-items: stretch; border-radius: 12px; background: var(--fill); }
.split-haupt, .split-pfeil, .steuer { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 0; background: transparent; font-size: 13.5px; font-weight: 500; transition: transform .12s, background .15s; }
.split-haupt { padding: 6px 12px 6px 14px; border-radius: 12px 0 0 12px; }
.split-pfeil { width: 34px; padding: 0; border-radius: 0 12px 12px 0; border-left: 1px solid var(--line); }
.split-pfeil svg { width: 18px; height: 18px; }
.split-haupt:hover, .split-pfeil:hover, .steuer:hover { background: rgba(127, 127, 127, .14); }
.split-haupt.aus { color: var(--danger-text); }
.split-haupt.an { color: var(--text); background: rgba(127, 127, 127, .22); }
.split-haupt .kurz, .steuer .kurz { display: none; }
.split:has(.split-haupt.aus) { background: var(--danger-soft); }
.split:has(.split-haupt.aus) .split-pfeil { border-left-color: color-mix(in srgb, var(--danger-text) 22%, transparent); color: var(--danger-text); }
.steuer > span[data-symbol], .split-pfeil > span[data-symbol], .split-haupt > span[data-symbol] { display: flex; }

/* Wartebereich */
.warte-zeile { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
#warte-vorschau-platz .vorschau { margin-bottom: 4px; }
.kreisel { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--text); animation: drehen 1s linear infinite; flex: none; }
@keyframes drehen { to { transform: rotate(360deg); } }
#wartebereich .zweit { margin-top: 14px; }

/* Während des Gesprächs */
.raum { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.raum-kopf { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; min-height: 36px; }
.kopf-links, .kopf-rechts { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kopf-rechts { justify-content: flex-end; color: var(--muted); font-size: 13px; }
.kopf-mitte { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.titel { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.schloss { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.schloss svg { fill: var(--muted); }
/* Warnung statt „Verschlüsselt“: nicht alle Spuren sind E2EE */
.schloss.warnung, .schloss.warnung .schloss-text { color: var(--danger-text); font-weight: 600; }
.schloss.warnung svg { fill: var(--danger-text); }
.p-warnung { color: var(--danger-text); font-weight: 600; }
.kachel.unsicher::after { border: 2px solid var(--danger); }
.schloss b, .meeting b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.kopf-knopf { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 13px; font-weight: 500; }
.kopf-knopf:hover { background: var(--fill); }
.kopf-knopf svg { width: 20px; height: 20px; }
.sperr-symbol { display: inline-grid; place-items: center; color: var(--text); }
.sperr-symbol svg { width: 18px; height: 18px; }
.dauer { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .breit-text, .schloss-text, .meeting { display: none; }
  .schloss.warnung .schloss-text { display: inline; }
  .titel { font-size: 13px; }
  .raum-kopf { grid-template-columns: auto minmax(0, 1fr) auto; }
  .kopf-knopf { padding: 4px 6px; }
}

.hinweise { display: flex; flex-direction: column; gap: 6px; }
.hinweise:not(:has(> :not([hidden]))) { display: none; }
.hinweis { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--fill); color: var(--text); font-size: 13.5px; text-align: center; }
.hinweis.warnung { background: var(--danger-soft); color: var(--danger-text); }
.hinweis.aktion { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; text-align: left; }
.aktionen { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.klein-knopf { min-height: 34px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 100px; background: var(--surface); font-size: 13px; font-weight: 500; }
.haupt-klein { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.raum-mitte { flex: 1; min-height: 0; display: flex; gap: 10px; }
.buehne { position: relative; flex: 1; min-width: 0; display: flex; }
.flaeche { flex: 1; min-height: 0; display: grid; gap: 8px; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
@media (min-width: 760px) {
  .flaeche[data-anzahl="2"], .flaeche[data-anzahl="3"], .flaeche[data-anzahl="4"] { grid-template-columns: 1fr 1fr; }
  .flaeche:not([data-anzahl="1"]):not([data-anzahl="2"]):not([data-anzahl="3"]):not([data-anzahl="4"]) { grid-template-columns: repeat(3, 1fr); }
}
.kachel { position: relative; min-height: 0; border-radius: 16px; overflow: hidden; background: var(--kachel); display: grid; place-items: center; cursor: zoom-in; }
.kachel::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid var(--line); pointer-events: none; }
.kachel.spricht::after { border: 2px solid var(--brand); }
.kachel.bildschirm { grid-column: 1 / -1; background: #000; }
.kachel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kachel.bildschirm video { object-fit: contain; }
.kachel:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.flaeche.fokus { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) 92px; grid-auto-rows: 92px; }
.kachel.gross { grid-column: 1 / -1; cursor: zoom-out; }
.kachel.mini { border-radius: 12px; }
.kachel.mini .avatar { width: 40px; height: 40px; font-size: 15px; }
.kachel.mini .name { font-size: 11px; padding: 2px 6px; left: 4px; bottom: 4px; max-width: calc(100% - 8px); }
.kachel.mini .kachel-knoepfe, .kachel.mini .kachel-status { display: none; }
.kachel-oben { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; align-items: center; z-index: 1; }
.hand-symbol { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #ffd60a; color: #1d1d1f; }
.hand-symbol svg { width: 17px; height: 17px; }
.kachel-oben .balken.stufe-0 { display: none; }
.kachel-oben .balken { box-sizing: content-box; padding: 6px 7px; border-radius: 8px; background: rgba(0, 0, 0, .45); color: #fff; }
.kachel-knoepfe { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 1; }
.kachel-knopf { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .55); color: #fff; }
.kachel-knopf svg { width: 19px; height: 19px; }
.kachel-status { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); padding: 4px 10px; border-radius: 100px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12.5px; white-space: nowrap; z-index: 1; }
.kachel:fullscreen { border-radius: 0; background: #000; }
.kachel:fullscreen video { object-fit: contain; }
.gespiegelt { transform: scaleX(-1); }
.avatar { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); color: var(--muted); font-size: 28px; font-weight: 600; }
@media (prefers-color-scheme: light) { .avatar { background: var(--surface); } }
.name { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 9px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12.5px; font-weight: 500; z-index: 1; }
.stumm-symbol { display: inline-grid; color: #ff6961; }
.stumm-symbol svg { width: 14px; height: 14px; }

/* Verbindungsqualität: drei Balken */
.balken { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.balken i { display: block; width: 3px; border-radius: 1px; background: currentColor; opacity: .3; }
.balken i:nth-child(1) { height: 4px; } .balken i:nth-child(2) { height: 8px; } .balken i:nth-child(3) { height: 12px; }
.balken.stufe-1 i:nth-child(1), .balken.stufe-2 i:nth-child(-n+2), .balken.stufe-3 i { opacity: 1; }
.balken.stufe-1 { color: #ff453a; }
.kachel-oben .balken.stufe-1 { color: #ff6961; }

/* Reaktionen steigen kurz über der Kachel auf */
.reaktionen { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.reaktion { position: absolute; font-size: 34px; line-height: 1; transform: translateX(-50%); animation: aufsteigen 2.5s ease-out forwards; }
.reaktion.ruhig { animation: einblenden 2.5s ease forwards; }
@keyframes aufsteigen { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -160px) scale(1); } }
@keyframes einblenden { 0%, 100% { opacity: 0; } 15%, 80% { opacity: 1; } }

/* Leerer Raum */
.allein-karte { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); width: min(420px, calc(100% - 24px)); padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); text-align: center; z-index: 2; }
.allein-text { margin: 0; font-weight: 600; }
.allein-knoepfe { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.allein-knoepfe:has(button:not([hidden])) { margin-top: 10px; }
.allein-knoepfe .zweit { flex: 1 1 0; min-width: 0; width: auto; margin: 0; padding-inline: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.allein-knoepfe { flex-wrap: nowrap; }

/* Seitenleiste (Teilnehmer, Chat): rechts auf großen Bildschirmen, als Sheet auf dem Handy */
.seitenleiste { width: 340px; flex: none; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.seiten-kopf { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 6px 16px; }
.seiten-kopf h2 { margin: 0; font-size: 16px; font-weight: 700; }
.seiten-kopf h2:focus { outline: none; }
.symbol-knopf { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; }
.symbol-knopf:hover { background: var(--fill); }
.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.seiten-hintergrund { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .4); }
@media (max-width: 900px) {
  .seitenleiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; width: auto; height: min(80dvh, 640px); border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); box-shadow: var(--shadow); }
}
@media (min-width: 901px) { .seiten-hintergrund { display: none; } }
.such-feld { margin: 0 12px 6px; }
.such-feld input { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.gruppe { padding: 0 6px; }
#panel-teilnehmer { overflow: auto; }
.gruppe-kopf { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 4px; }
.gruppe-kopf h3 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.personen { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; }
.person:hover { background: var(--surface2); }
.p-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--fill); font-size: 13px; font-weight: 600; color: var(--muted); }
.p-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-rolle { font-size: 12px; color: var(--muted); }
.p-symbole { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); }
.p-symbol { display: inline-grid; place-items: center; width: 28px; height: 28px; }
.p-symbol svg, .p-knopf svg { width: 18px; height: 18px; }
.p-symbol.aus { color: var(--danger-text); }
.p-knopf { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text); }
.p-knopf:hover { background: var(--fill); }
.hand-an { color: #b28704; }
.p-symbole .balken { margin: 0 6px; color: var(--text); }
.panel-fuss { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.panel-fuss .zweit { flex: 1 1 140px; width: auto; margin: 0; min-height: 38px; font-size: 13.5px; }

.chat-hinweis { padding: 0 16px 6px; font-size: 12px; }
.chat-verlauf { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 4px 14px 8px; }
.nachricht { margin-top: 2px; }
.nachricht-kopf { margin-top: 10px; font-size: 12px; color: var(--muted); }
.nachricht-kopf b { color: var(--text); font-weight: 600; }
.nachricht p { display: inline-block; margin: 2px 0 0; padding: 7px 11px; border-radius: 14px; background: var(--surface2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.nachricht.eigene { text-align: right; }
.nachricht.eigene p { background: var(--brand); color: var(--brand-ink); text-align: left; }
.chat-formular { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-formular textarea { flex: 1; min-height: 40px; max-height: 140px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface2); color: var(--text); font: inherit; font-size: 15px; resize: none; }
.chat-formular textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.haupt-rund { border-radius: 50%; background: var(--brand); color: var(--brand-ink); }
.haupt-rund:hover { background: var(--brand); opacity: .9; }

/* Steuerleiste: Mitte wie Webex, rechts Teilnehmer und Chat */
.leiste { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding-top: 2px; }
.leiste-mitte { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.leiste-rechts { grid-column: 3; display: flex; justify-content: flex-end; gap: 6px; }
.leiste .split { background: var(--fill); }
.leiste .split-haupt { min-width: 150px; justify-content: flex-start; }
.leiste #hand { min-width: 0; }
.steuer { position: relative; padding: 6px 12px; border-radius: 12px; background: var(--fill); }
.steuer[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.leiste-rechts .steuer { background: transparent; }
.leiste-rechts .steuer[aria-pressed="true"] { background: var(--fill); color: var(--text); }
.auflegen { width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--danger); color: var(--danger-ink); }
.auflegen:hover { filter: brightness(1.08); }
.reaktion-pfeil { width: 40px; }
.reaktion-pfeil svg { width: 20px; height: 20px; }
.zaehler { position: absolute; top: 2px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.menue .zaehler { position: static; margin-left: auto; }
.nur-handy { display: none !important; }
@media (max-width: 1100px) { .leiste .split-haupt { min-width: 0; } }
@media (max-width: 900px) {
  .leiste { grid-template-columns: 1fr; }
  .leiste-mitte { grid-column: 1; justify-content: center; }
  .leiste-rechts { display: none; }
  .nur-handy:not([hidden]) { display: flex !important; }
  .menue .nur-handy { flex-direction: column; }
}
@media (max-width: 640px) {
  .leiste-mitte { gap: 4px; width: 100%; justify-content: space-between; }
  .leiste .split-haupt, .leiste .steuer { flex-direction: column; gap: 1px; min-height: 52px; padding: 4px 6px; font-size: 10.5px; }
  .leiste .split-haupt .lang, .leiste .steuer .lang { display: none; }
  .leiste .split-haupt .kurz, .leiste .steuer .kurz { display: inline; }
  .leiste .split-haupt { min-width: 46px; justify-content: center; }
  .leiste .split-pfeil { width: 24px; }
  .reaktion-pfeil { width: 30px; }
  .steuer { min-width: 46px; background: var(--fill); }
  .auflegen { width: 48px; height: 48px; flex: none; }
  .zaehler { top: 0; right: 0; }
}
@media (max-width: 370px) { #teilen { display: none; } }
@media (max-width: 640px) {
  .vorab-knoepfe { flex-wrap: nowrap; }
  .vorab-knoepfe .split-haupt .lang { display: none; }
  .vorab-knoepfe .split-haupt .kurz { display: inline; }
}

/* Aufklappmenüs und Sheets */
.popup { position: fixed; z-index: 40; width: 300px; max-height: calc(100dvh - 120px); overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 8px 32px rgba(0, 0, 0, .18); }
.popup.breit, .geraete-popup { width: 380px; }
.popup.breit { width: 440px; }
.popup.sheet { left: 0 !important; right: 0; bottom: 0 !important; top: auto !important; width: auto; max-height: 82dvh; border-radius: 20px 20px 0 0; padding: 12px 12px max(16px, env(safe-area-inset-bottom)); }
.sheet-hintergrund { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .4); }
.popup-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 6px 8px; }
.popup-kopf h2 { margin: 0; font-size: 15px; font-weight: 700; }
.popup-unter { margin: 12px 6px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.feld-zeile { padding: 4px 6px 8px; }
.feld-zeile label { margin-bottom: 4px; }
select { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); color: var(--text); font: inherit; font-size: 14px; text-overflow: ellipsis; }
.schalter-zeile { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 6px 4px; padding: 6px 0; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
.schalter-zeile span { order: -1; }
input[type="checkbox"][role="switch"] { appearance: none; -webkit-appearance: none; position: relative; width: 44px; min-height: 0; height: 26px; padding: 0; border: 0; border-radius: 13px; background: var(--line); cursor: pointer; flex: none; transition: background .15s; }
input[type="checkbox"][role="switch"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
input[type="checkbox"][role="switch"]:checked { background: #34c759; }
input[type="checkbox"][role="switch"]:checked::after { transform: translateX(18px); }
.menue { padding: 6px; }
.menue [role^="menuitem"] { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 14px; text-align: left; }
.menue [role^="menuitem"] > svg { width: 20px; height: 20px; color: var(--muted); margin-right: 4px; }
.menue [role^="menuitem"]:hover, .menue [role^="menuitem"]:focus-visible { background: var(--fill); outline: none; }
.menue [role="menuitemcheckbox"]::after, .menue [role="menuitemradio"]::after { content: ""; margin-left: auto; width: 16px; height: 16px; }
.menue [aria-checked="true"]::after { content: "✓"; font-weight: 700; }
.menue-titel { margin: 8px 12px 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.menue-gruppe { border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 2px; }
.reaktionen-popup { display: flex; width: auto; gap: 2px; padding: 6px; }
.reaktionen-popup.sheet { justify-content: space-around; }
.reaktionen-popup button { width: 48px; height: 48px; border: 0; border-radius: 12px; background: transparent; font-size: 26px; }
.reaktionen-popup button:hover, .reaktionen-popup button:focus-visible { background: var(--fill); outline: none; }

/* Hintergrund-Kachelraster: 4 Spalten, auf dem Handy 3 */
.hg-raster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 6px; }
@media (max-width: 640px) { .hg-raster { grid-template-columns: repeat(3, 1fr); } }
.hg-kachel { position: relative; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); overflow: hidden; font-size: 11.5px; font-weight: 500; color: var(--text); }
.hg-kachel img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hg-kachel[aria-pressed="true"] { outline: 2px solid var(--brand); outline-offset: 1px; }
.hg-text { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.hg-text svg { width: 16px; height: 16px; }
.hg-weich { justify-content: flex-end; padding-bottom: 3px; background: radial-gradient(ellipse 22% 30% at 50% 40%, var(--muted) 0 60%, transparent 62%), repeating-linear-gradient(90deg, var(--fill) 0 6px, var(--surface2) 6px 12px); }
.hg-weich.leicht { background: radial-gradient(ellipse 22% 30% at 50% 40%, var(--muted) 0 60%, transparent 62%), repeating-linear-gradient(90deg, var(--fill) 0 8px, var(--surface2) 8px 16px); }
.hg-weich.stark { background: radial-gradient(ellipse 22% 30% at 50% 40%, var(--muted) 0 60%, transparent 62%), linear-gradient(90deg, var(--fill), var(--surface2)); }
.hg-meldung { min-height: 1.2em; margin: 6px 6px 0; }
#hintergrund-bereich .klein-text { margin: 2px 6px 4px; }

/* Dialoge */
.details { max-height: calc(100dvh - 32px); max-height: calc(100svh - 32px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; margin: auto; width: min(400px, calc(100% - 32px)); padding: 22px 20px 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.details.breit { width: min(520px, calc(100% - 32px)); }
.details::backdrop { background: rgba(0, 0, 0, .45); }
.details h2 { margin: 0 0 12px; font-size: 19px; font-weight: 700; }
.details dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 14.5px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details .ziffern { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.details .hinweis { margin: 10px 0 0; }
.zweit { display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 10px 20px; border: 1px solid var(--line); border-radius: 100px; background: transparent; font-size: 15px; font-weight: 500; }
.qr { width: min(240px, 70vw); margin: 14px auto 6px; padding: 0; border-radius: 12px; overflow: hidden; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.qr:empty { display: none; }
.statistik { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13.5px; }
.statistik th { text-align: left; font-weight: 500; color: var(--muted); padding: 5px 10px 5px 0; vertical-align: top; white-space: nowrap; }
.statistik td { padding: 5px 0; font-variant-numeric: tabular-nums; }
#einstellungen #audio-inhalt, #einstellungen #video-inhalt { margin: 0 -6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .kreisel { animation-duration: 3s; } }

/* Logo wie im Kundenportal: schwarz, im Dunkelmodus umgekehrt */
.kopf-marke { display: inline-flex; align-items: center; }
.marke { display: block; height: 22px; width: auto; }
@media (prefers-color-scheme: dark) { .marke { filter: invert(1); } }

/* Mit Code beitreten (wie Teams/Webex): Meeting-ID, Kenncode, Name */
.abstand { margin-bottom: 18px; }
#code-formular label { margin-top: 12px; }
#code-formular label:first-of-type { margin-top: 0; }
#meeting-feld, #kenncode-feld { font-variant-numeric: tabular-nums; letter-spacing: .06em; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.schloss-zeile.unten { margin: 14px 0 0; }
p.unten { margin-top: 10px; }

dialog h2:focus, .popup h2:focus { outline: none; }
.kachel video.hochkant { object-fit: contain; background: #111; }
