:root {
  color-scheme: light;
  --room-navy: var(--app-rail, #0b1c2d);
  --room-navy-2: var(--app-rail-raised, #122b43);
  --room-bg: var(--app-bg, #edf2f6);
  --room-panel: var(--app-surface, #ffffff);
  --room-canvas: #e7edf2;
  --room-line: var(--app-line, #d5e0e7);
  --room-text: var(--app-text, #132437);
  --room-muted: var(--app-muted, #64788b);
  --room-green: #1f9d68;
  --room-green-soft: #e5f6ee;
  --room-cyan: var(--app-teal, #117d87);
  --room-amber: #c47c12;
  --room-red: #c63d4c;
  --room-red-soft: #fff0f2;
  --room-focus: var(--app-teal, #117d87);
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  font-family: var(--wt-font, Verdana, Geneva, Tahoma, sans-serif);
}

body {
  margin: 0;
  background: var(--room-bg);
  color: var(--room-text);
  font-family: inherit;
}

button,
input,
select,
textarea { font: inherit; }

button,
.loginLink {
  min-height: 40px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--room-text);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:hover:not(:disabled),
.loginLink:hover { border-color: #8ca8b5; background: #f7fafb; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--room-focus) 30%, transparent);
  outline-offset: 2px;
}

button:disabled { opacity: .45; cursor: not-allowed; }

button.primary { color: #fff; border-color: var(--room-green); background: var(--room-green); }
button.primary:hover:not(:disabled) { background: #18875a; border-color: #18875a; }
button.danger:not(:disabled) { color: var(--room-red); border-color: #e7b8be; background: var(--room-red-soft); }
button[aria-pressed="true"] { color: #fff; border-color: var(--room-cyan); background: var(--room-cyan); }

/* Die Zahl der sichtbaren Kinder von .shell ist NICHT konstant: im
   Protokoll-Modus wird #protocolWorkspace eingeblendet, dann sind es vier
   (stage, protocolWorkspace, legalBand, toolbar) statt drei. Ein festes
   Drei-Zeilen-Raster hat in diesem Fall das Pflichthinweis-Band in die
   70-px-Zeile der Werkzeugleiste gedrueckt (Band abgeschnitten, mobil vom
   Mikro-Knopf ueberdeckt) und die Werkzeugleiste in eine implizite Zeile von
   41 px. Deshalb wird die feste Hoehe der Werkzeugleiste am Element selbst
   deklariert und das Raster waechst mit — beide Zeilen bleiben so
   inhaltsrichtig, egal ob drei oder vier Kinder sichtbar sind. */
.shell {
  min-height: calc(100dvh - var(--app-topbar-height, 64px) - var(--app-contextbar-height, 52px));
  display: grid;
  grid-template-rows: minmax(460px, 1fr) auto;
}

.status {
  min-width: 100px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #a9d9c2;
  border-radius: 6px;
  color: #12633f;
  background: var(--room-green-soft);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status.online { color: #fff; border-color: var(--room-green); background: var(--room-green); }

.stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 320px;
}

.setup {
  min-width: 0;
  min-height: 0;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--room-line);
  background: var(--room-panel);
}

.setupHeading { padding: 0 2px; }
.eyebrow { color: var(--room-cyan); font-size: 10px; font-weight: 700; text-transform: uppercase; }
h1,
h2 { margin: 0; letter-spacing: 0; }
h2 { margin-top: 3px; font-size: 18px; line-height: 1.15; }

.setupFields {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.setupFields > label { min-width: 0; display: grid; gap: 5px; color: var(--room-muted); font-size: 11px; }
input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--room-text);
  background: #fff;
}

.modeGroup {
  min-height: 80px;
  min-width: 0;
  display: grid;
  grid-template-rows: repeat(2, minmax(40px, 1fr));
  border: 1px solid var(--room-line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.modeGroup label { min-width: 0; cursor: pointer; }
.modeGroup label + label { border-top: 1px solid var(--room-line); }
.modeGroup input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.modeGroup span {
  width: 100%;
  height: 100%;
  padding: 0 9px;
  color: var(--room-muted);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.modeGroup label:has(input:checked) span { color: #fff; background: var(--room-navy-2); }

.joinMediaGroup {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--room-line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.joinMediaGroup label { min-width: 0; cursor: pointer; }
.joinMediaGroup label + label { border-left: 1px solid var(--room-line); }
.joinMediaGroup input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.joinMediaGroup span {
  min-height: 48px;
  padding: 6px 8px;
  color: var(--room-muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  text-align: center;
  font-size: 10px;
  line-height: 1.3;
}
.joinMediaGroup i { font-size: 17px; }
.joinMediaGroup label:has(input:checked) span { color: #fff; background: var(--room-cyan); }

.setupActions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setupActions > * { min-width: 0; padding-inline: 8px; }
.setupActions .loginLink { grid-column: 1 / -1; }
.inviteState {
  min-height: 15px;
  color: var(--room-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.stageMain {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--room-canvas);
}
.stageHeader {
  min-height: 44px;
  flex: 0 0 44px;
  padding: 0 18px;
  border-bottom: 1px solid var(--room-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--room-muted);
  font-size: 11px;
}
.stageHeader div { display: flex; align-items: center; gap: 8px; color: var(--room-text); }
.stageIdentity { min-width: 0; }
.stageIdentity strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stageMeta { min-width: 0; justify-content: flex-end; color: var(--room-muted) !important; }
.stageMeta time { color: var(--room-text); font-family: var(--wt-font-mono); font-weight: 700; }
.stageMeta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stageDot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--room-green); }
.stageLiveBadge {
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid #a9d9c2;
  border-radius: 4px;
  color: #12633f;
  background: var(--room-green-soft);
  display: inline-flex;
  align-items: center;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}
.stageLiveBadge.is-live { color: #fff; border-color: var(--room-green); background: var(--room-green); }
.stageLiveBadge.is-recording { color: #fff; border-color: var(--room-red); background: var(--room-red); }

.roomTabs {
  min-width: 0;
  min-height: 42px;
  flex: 0 0 42px;
  padding: 0 12px;
  border-bottom: 1px solid var(--room-line);
  background: #fff;
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.roomTabs::-webkit-scrollbar { display: none; }
.roomTabs a {
  min-width: max-content;
  padding: 0 10px;
  border-bottom: 3px solid transparent;
  color: var(--room-muted);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}
.roomTabs a:hover,
.roomTabs a.is-active { color: var(--room-cyan); border-bottom-color: var(--room-cyan); }

.liveSpeakerStrip {
  min-width: 0;
  flex: 0 0 auto;
  min-height: 82px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--room-line);
  background: #fff;
  display: flex;
  align-items: stretch;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.liveSpeakerStrip:empty::before {
  content: "Sprecher erscheinen nach dem Beitritt";
  color: var(--room-muted);
  display: flex;
  align-items: center;
  font-size: 11px;
}
.speakerCard {
  --speaker-color: var(--room-cyan);
  flex: 0 0 150px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--room-line);
  border-top: 3px solid var(--speaker-color);
  border-radius: 6px;
  background: #f8fafb;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.speakerCard.is-speaking { border-color: var(--speaker-color); background: #fff; }
.speakerAvatar {
  width: 38px;
  height: 38px;
  border: 2px solid var(--speaker-color);
  border-radius: 50%;
  color: var(--speaker-color);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}
.speakerCopy { min-width: 0; display: grid; gap: 3px; }
.speakerCopy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.speakerCopy small { color: var(--room-muted); font-size: 9px; }
.speakerColor0 { --speaker-color: #24b987; }
.speakerColor1 { --speaker-color: #3388e8; }
.speakerColor2 { --speaker-color: #ef9b18; }
.speakerColor3 { --speaker-color: #e64d72; }
.speakerColor4 { --speaker-color: #8b6ee8; }
.speakerColor5 { --speaker-color: #7d8c99; }

.liveTranscriptPanel {
  min-width: 0;
  min-height: 180px;
  max-height: 36dvh;
  flex: 0 1 260px;
  border-bottom: 1px solid var(--room-line);
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.liveTranscriptPanel[hidden] { display: none; }
.liveTranscriptHeader {
  min-height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--room-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.liveTranscriptHeader > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.liveTranscriptHeader > div > span:last-child { min-width: 0; display: grid; gap: 2px; }
.liveTranscriptHeader strong { color: var(--room-text); font-size: 11px; }
.liveTranscriptHeader small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--room-muted); font-size: 8px; }
.liveTranscriptPulse { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--room-green); }
.liveTranscriptHeader > a,
.liveTranscriptEntry > a {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--room-line);
  border-radius: 50%;
  color: var(--room-muted);
  background: #fff;
  display: grid;
  place-items: center;
  text-decoration: none;
}
.liveTranscriptHeader > a[hidden] { display: none; }
.liveTranscriptSegments { min-height: 0; padding: 3px 0; overflow: auto; }
.liveTranscriptEmpty {
  min-height: 136px;
  padding: 22px;
  color: var(--room-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: left;
}
.liveTranscriptEmpty > .ti { color: var(--room-green); font-size: 26px; }
.liveTranscriptEmpty p { max-width: 520px; margin: 0; display: grid; gap: 5px; }
.liveTranscriptEmpty strong { color: var(--room-text); font-size: 11px; }
.liveTranscriptEmpty span { font-size: 10px; line-height: 1.5; }
.liveTranscriptEntry {
  --speaker-color: var(--room-cyan);
  min-height: 68px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f4;
  display: grid;
  grid-template-columns: 62px 8px minmax(0, 1fr) 36px;
  align-items: start;
  gap: 9px;
}
.liveTranscriptEntry:last-child { border-bottom: 0; }
.liveTranscriptEntry time { padding-top: 2px; color: var(--room-muted); font-family: var(--wt-font-mono); font-size: 9px; }
.liveTranscriptMarker { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--speaker-color); }
.liveTranscriptEntry p { min-width: 0; margin: 0; display: grid; gap: 4px; }
.liveTranscriptEntry p strong { color: var(--speaker-color); font-size: 10px; }
.liveTranscriptEntry p span { color: var(--room-text); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.liveTranscriptEntry.is-redacted p span { color: var(--room-muted); font-style: italic; }

.videoGrid {
  min-height: 240px;
  flex: 1 1 240px;
  padding: 18px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-content: start;
  gap: 12px;
  background: var(--room-canvas);
  position: relative;
}

.videoGrid:empty::before {
  content: "Bereit fuer Teilnehmer";
  min-height: 240px;
  border: 1px dashed #a8bac3;
  border-radius: 8px;
  color: var(--room-muted);
  background: rgba(255,255,255,.55);
  display: grid;
  place-items: center;
  font-size: 13px;
}

.tile {
  min-height: 190px;
  border: 1px solid #173646;
  border-radius: 8px;
  overflow: hidden;
  background: #0d1e27;
  position: relative;
}
.media { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; color: #fff; background: #0d1e27; }
.media > * { grid-area: 1 / 1; }
.mediaFallback { display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.media video { width: 100%; height: 100%; object-fit: cover; }
.media:has(video) .mediaFallback { display: none; }
.media audio { display: none; }
.tile.protocolant .media { color: #fff; background: var(--room-cyan); font-weight: 700; }
.tile.is-speaking { border-color: var(--room-green); box-shadow: 0 0 0 2px color-mix(in srgb, var(--room-green) 34%, transparent); }
.tile.screen-share { grid-column: 1 / -1; }
.tile.protocolant .tileLabel::after { content: " sichtbar"; color: #8fe4c0; }
.tileLabel {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 6px 8px;
  border-radius: 5px;
  color: #fff;
  background: rgba(6, 21, 29, .78);
  font-size: 11px;
}

.side {
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--room-line);
  background: #fff;
}
.sideSection { padding: 15px 16px; border-bottom: 1px solid var(--room-line); }
.sectionTitle { margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.sectionTitle i { color: var(--room-cyan); font-size: 16px; }
.participants { display: grid; gap: 7px; }
.participants:empty::before { content: "Noch nicht beigetreten"; color: var(--room-muted); font-size: 11px; }
.participant {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-muted);
  background: #f8fafb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.participantName { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participantBadges { display: inline-flex; align-items: center; gap: 4px; }
.participantBadge {
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid var(--room-line);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--room-muted);
  background: #fff;
  font-size: 9px;
  white-space: nowrap;
}
.participantBadge.owner { color: #7a4a00; border-color: #e6c789; background: #fff8e7; }
.participantBadge.consent { color: #12633f; border-color: #a9d9c2; background: var(--room-green-soft); }
.participantBadge.missing { color: var(--room-red); border-color: #e7b8be; background: var(--room-red-soft); }
.participant.protocolant { color: var(--room-text); border-color: #8bcdbd; background: var(--room-green-soft); }
.participantRemove {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid #e7b8be;
  border-radius: 5px;
  color: var(--room-red);
  background: #fff;
  display: inline-grid;
  place-items: center;
}
.participantRemove:hover:not(:disabled) { background: var(--room-red-soft); }
.participantRemove i { font-size: 14px; }

.stateStack { display: grid; gap: 8px; }
.serviceState,
.bridgeState,
.recordingState,
.consentRosterSummary,
.consentProof,
.supportState {
  padding: 9px 10px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-muted);
  background: #f8fafb;
  font-size: 11px;
  line-height: 1.4;
}
.serviceState.protocol,
.consentProof.verified { color: #12633f; border-color: #a9d9c2; background: var(--room-green-soft); }
.recordingState.armed { color: #fff; border-color: var(--room-red); background: var(--room-red); }
.recordingState.recording,
.recordingState.consent-withdrawn { color: #fff; border-color: var(--room-red); background: var(--room-red); }
.recordingState.captured { color: #12633f; border-color: #8fc9ad; background: var(--room-green-soft); }
.recordingState.interrupted { color: #7a3100; border-color: #e0a36f; background: #fff1e6; }
.consentRosterSummary.ready { color: #12633f; border-color: #a9d9c2; background: var(--room-green-soft); }
.consentRosterSummary.missing { color: #7a4a00; border-color: #e6c789; background: #fff8e7; }

.consentPanel { display: grid; gap: 9px; }
.consentPanel .sectionTitle { margin-bottom: 1px; }
.checkline { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; color: var(--room-text); font-size: 11px; }
.checkline input { width: 17px; height: 17px; padding: 0; accent-color: var(--room-green); }
.consentPanel #armRecordingBtn { width: 100%; min-width: 0; margin-top: 2px; }

.billingPanel { display: grid; gap: 10px; }
.billingPanel .sectionTitle { margin-bottom: 1px; }
.billingPayer {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #a9d9c2;
  border-radius: 6px;
  color: #12633f;
  background: var(--room-green-soft);
}
.billingPayer > i { font-size: 18px; text-align: center; }
.billingPayer > span { min-width: 0; display: grid; gap: 1px; }
.billingPayer small { color: var(--room-muted); font-size: 9px; }
.billingPayer strong { overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.billingFields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
.billingFields label { min-width: 0; display: grid; gap: 4px; color: var(--room-muted); font-size: 10px; }
.billingFields select,
.billingFields input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 7px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-text);
  background: #fff;
}
.billingParticipantField { grid-column: auto; }
.billingLineItems { display: grid; gap: 5px; }
.billingLineItem {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--room-muted);
  font-size: 10px;
  line-height: 1.35;
}
.billingLineItem span:first-child { min-width: 0; overflow-wrap: anywhere; }
.billingLineItem span:last-child { color: var(--room-text); white-space: nowrap; }
.billingTotal {
  padding-top: 9px;
  border-top: 1px solid var(--room-line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--room-muted);
  font-size: 10px;
}
.billingTotal strong { color: var(--room-text); font-size: 18px; }
.billingState {
  min-height: 34px;
  padding: 8px 9px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-muted);
  background: #f8fafb;
  font-size: 10px;
  line-height: 1.4;
}
.billingState.ready { color: #12633f; border-color: #a9d9c2; background: var(--room-green-soft); }
.billingState.warning { color: #7a4a00; border-color: #e6c789; background: #fff8e7; }
.billingState.error { color: var(--room-red); border-color: #e7b8be; background: var(--room-red-soft); }
.billingActions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.billingActions button { min-width: 0; padding: 0 9px; }
.billingActions a {
  grid-column: 1 / -1;
  min-height: 36px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-text);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  font-size: 10px;
}

.protocolWorkspace {
  min-width: 0;
  border-top: 1px solid var(--room-line);
  background: var(--room-panel);
}
.protocolHeader {
  min-height: 64px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--room-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.protocolHeaderActions { display: flex; align-items: end; gap: 7px; }
.protocolEvidenceLabel { display: grid; gap: 4px; color: var(--room-muted); font-size: 10px; }
.protocolEvidenceLabel select {
  min-width: 190px;
  height: 40px;
  padding: 0 9px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-text);
  background: #fff;
}
.protocolHeaderActions > button { width: 40px; padding: 0; }
.protocolLayout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
}
.protocolDocument {
  min-width: 0;
  max-height: 680px;
  overflow: auto;
  padding: 16px 18px 24px;
  display: grid;
  align-content: start;
  gap: 9px;
  background: #f7fafb;
}
.protocolDocument:empty::before {
  content: "Der Entwurf erscheint nach der lokalen Transkription.";
  min-height: 140px;
  border: 1px dashed #a8bac3;
  border-radius: 6px;
  color: var(--room-muted);
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 12px;
}
.protocolSegment {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  background: #fff;
  display: grid;
  gap: 8px;
}
.protocolSegment.redacted { border-color: #e6c789; background: #fffdf7; }
.segmentMeta { display: flex; align-items: center; justify-content: space-between; gap: 9px; color: var(--room-muted); font-size: 10px; }
.segmentSpeakerRow { display: grid; grid-template-columns: minmax(140px, 220px) 40px minmax(0, 1fr); gap: 7px; align-items: center; }
.segmentSpeakerRow input,
.segmentRedactionReason {
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-text);
  background: #fff;
}
.segmentSpeakerRow button { width: 40px; min-height: 36px; padding: 0; }
.segmentText {
  width: 100%;
  min-width: 0;
  min-height: 86px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-text);
  background: #fff;
  line-height: 1.55;
}
.protocolSegment.redacted .segmentText { color: var(--room-muted); text-decoration: line-through; }
.segmentActions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.segmentActions button { min-height: 36px; }
.segmentRedactionReason { flex: 1 1 220px; min-width: 0; }
.protocolSuggestion {
  min-width: 0;
  padding: 10px;
  border: 1px solid #9ac6d2;
  border-left: 4px solid var(--room-cyan);
  border-radius: 6px;
  background: #f3f9fb;
  display: grid;
  gap: 8px;
}
.protocolSuggestionHead { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 11px; }
.protocolSuggestionHead span { color: var(--room-muted); font-size: 10px; overflow-wrap: anywhere; }
.protocolSuggestionText { padding: 9px; border: 1px solid #c9dfe5; border-radius: 5px; background: #fff; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.protocolSuggestionRationale { color: var(--room-muted); font-size: 11px; line-height: 1.45; }
.protocolSuggestionWarnings { margin: 0; padding-left: 18px; color: #8d3f25; font-size: 11px; line-height: 1.45; }
.protocolSuggestionActions { display: flex; flex-wrap: wrap; gap: 7px; }
.protocolSuggestionActions button { min-height: 34px; }
.segmentAudit { color: var(--room-muted); font-size: 10px; }
.segmentAudit summary { cursor: pointer; }
.segmentAuditBody { margin-top: 7px; padding: 8px 9px; border-left: 3px solid var(--room-cyan); background: #f3f8fa; line-height: 1.5; overflow-wrap: anywhere; }
.protocolReviewRail {
  min-width: 0;
  padding: 16px;
  border-left: 1px solid var(--room-line);
  display: grid;
  align-content: start;
  gap: 9px;
  background: #fff;
}
.protocolState,
.protocolHash,
.protocolApproval,
.protocolRedactions {
  padding: 9px 10px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-muted);
  background: #f8fafb;
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.protocolState.locked { color: #12633f; border-color: #a9d9c2; background: var(--room-green-soft); }
.protocolHash { font-family: Consolas, "Courier New", monospace; }
.protocolRedactionItem { display: grid; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--room-line); }
.protocolRedactionItem:last-child { border-bottom: 0; }
.protocolRedactionDecision { display: flex; gap: 5px; }
.protocolRedactionDecision button { min-height: 32px; padding: 0 8px; font-size: 9px; }
.protocolActions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.protocolActions button { min-width: 0; padding: 0 8px; }
.protocolActions #protocolProposeBtn,
.protocolActions #protocolLockBtn { grid-column: 1 / -1; }

.supportPanel { display: grid; gap: 9px; }
.supportPanel .sectionTitle { margin-bottom: 1px; }
.supportActions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.supportActions button { min-width: 0; min-height: 46px; padding: 5px; display: grid; gap: 2px; font-size: 10px; }
.supportActions i { font-size: 17px; }
.supportActions span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.supportState.ok { color: #12633f; border-color: #a9d9c2; background: var(--room-green-soft); }
.supportState.error { color: var(--room-red); border-color: #e7b8be; background: var(--room-red-soft); }

.prejoinPreview {
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #234352;
  border-radius: 7px;
  background: #081922;
  position: relative;
}
.prejoinPreview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.prejoinPlaceholder {
  height: 100%;
  padding: 16px;
  color: #d9e7ec;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  text-align: left;
}
.prejoinPlaceholder i { flex: 0 0 auto; color: #4ed1a4; font-size: 28px; }
.prejoinPlaceholder span { min-width: 0; display: grid; gap: 4px; }
.prejoinPlaceholder strong { font-size: 11px; line-height: 1.35; }
.prejoinPlaceholder small { color: #9bb0ba; font-size: 9px; line-height: 1.4; }
.prejoinMeter {
  height: 5px;
  position: absolute;
  right: 10px;
  bottom: 9px;
  left: 10px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255,255,255,.18);
}
.prejoinMeter span {
  width: 100%;
  height: 100%;
  display: block;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--room-green);
  transition: transform 80ms linear;
}
.prejoinDevicePanel {
  padding: 11px;
  border: 1px solid var(--room-line);
  border-radius: 7px;
  background: #f8fafb;
}

.devicePanel { display: block; }
.devicePanel summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.devicePanel summary::-webkit-details-marker { display: none; }
.devicePanel summary .sectionTitle { margin: 0; }
.devicePanel[open] .deviceChevron { transform: rotate(180deg); }
.deviceChevron { color: var(--room-muted); transition: transform .16s ease; }
.deviceFields { margin-top: 12px; display: grid; gap: 9px; }
.deviceFields label { display: grid; gap: 4px; color: var(--room-muted); font-size: 10px; }
.deviceFields select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-text);
  background: #fff;
}
.deviceActions { margin-top: 9px; display: flex; align-items: center; gap: 7px; }
.deviceActions button { min-width: 40px; padding: 0 10px; }
.deviceActions .deviceTestButton { flex: 1 1 auto; min-width: 0; }
.deviceActions a {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-text);
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  font-size: 11px;
}
.deviceState {
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-muted);
  background: #f8fafb;
  font-size: 10px;
  line-height: 1.4;
}
.deviceState.error { color: var(--room-red); border-color: #e7b8be; background: var(--room-red-soft); }
.deviceState.ready { color: #12633f; border-color: #a9d9c2; background: var(--room-green-soft); }

.liveAudioPanel {
  min-width: 0;
  flex: 0 0 auto;
  padding: 10px 14px 14px;
  border-top: 1px solid #1d3a47;
  color: #fff;
  background: #081922;
}
.liveAudioHeader {
  min-height: 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.liveAudioHeader strong { font-size: 11px; }
.liveAudioHeader small { color: #91a8b3; font-size: 9px; }
.liveAudioPanel canvas { width: 100%; height: 132px; display: block; }
.audioUnlockButton {
  display: none;
  width: calc(100% - 28px);
  margin: 0 14px 12px;
  color: #fff;
  border-color: var(--room-cyan);
  background: var(--room-cyan);
}
.audioUnlockButton.is-visible { display: inline-flex; }

.toolbar {
  /* Die Hoehe stand frueher als feste Rasterzeile in .shell; sie gehoert an
     das Element, weil die Zahl der Rasterzeilen mit dem Protokoll-Modus
     wechselt (siehe Kommentar bei .shell). */
  min-height: 70px;
  padding: 0 20px;
  border-top: 1px solid var(--room-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: env(safe-area-inset-bottom);
}
.toolbarGroup { display: flex; align-items: center; gap: 8px; }
.toolbar button { min-width: 104px; }
.toolbar i { font-size: 17px; }

@media (max-width: 1100px) and (min-width: 821px) {
  .stage { grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: minmax(430px, 1fr) auto; }
  .side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--room-line); border-left: 0; overflow: visible; }
  .sideSection { min-width: 0; border-right: 1px solid var(--room-line); }
  .sideSection:nth-child(3n) { border-right: 0; }
  .protocolLayout { grid-template-columns: minmax(0, 1fr) 270px; }
}

@media (max-width: 820px) {
  .shell { min-height: 0; grid-template-rows: auto auto; }
  .toolbar { min-height: 66px; }
  .status { min-width: 82px; }
  .stage { display: flex; flex-direction: column; }
  .setup { border-right: 0; border-bottom: 1px solid var(--room-line); }
  .room-connected .setup { display: none; }
  .stageMain {
    min-height: 560px;
    display: flex;
    flex-direction: column;
    background: #081922;
  }
  .stageHeader {
    padding: 0 12px;
    color: #9eb2bc;
    border-bottom-color: #1d3a47;
    background: #081922;
  }
  .stageHeader div { color: #fff; }
  .stageHeader > span { max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .roomTabs { padding: 0 6px; border-bottom-color: #1d3a47; background: #081922; }
  .roomTabs a { min-height: 46px; padding: 0 10px; color: #a8bac3; }
  .roomTabs a:hover,
  .roomTabs a.is-active { color: #72dfba; border-bottom-color: var(--room-green); }
  .liveSpeakerStrip { min-height: 86px; padding: 9px 10px; border-bottom-color: #1d3a47; background: #081922; }
  .liveSpeakerStrip:empty::before { color: #91a8b3; }
  .speakerCard { flex-basis: 132px; border-color: #294754; background: #0d232d; }
  .speakerCard.is-speaking { background: #102b35; }
  .speakerAvatar { color: #fff; background: #132e39; }
  .speakerCopy strong { color: #fff; }
  .speakerCopy small { color: #91a8b3; }
  .liveTranscriptPanel { min-height: 250px; max-height: 44dvh; border-bottom-color: #1d3a47; color: #d9e7ec; background: #081922; }
  .liveTranscriptHeader { min-height: 42px; padding: 0 10px; border-bottom-color: #1d3a47; }
  .liveTranscriptHeader strong { color: #fff; }
  .liveTranscriptHeader small { color: #91a8b3; }
  .liveTranscriptHeader > a,
  .liveTranscriptEntry > a { color: #d9e7ec; border-color: #294754; background: #0d232d; }
  .liveTranscriptSegments { flex: 1; }
  .liveTranscriptEmpty { min-height: 200px; padding: 18px; }
  .liveTranscriptEmpty strong { color: #fff; }
  .liveTranscriptEmpty span { color: #9eb2bc; }
  .liveTranscriptEntry { min-height: 82px; padding: 12px 10px; border-bottom-color: #142f3b; grid-template-columns: 54px 8px minmax(0, 1fr) 36px; gap: 7px; }
  .liveTranscriptEntry time { color: #91a8b3; }
  .liveTranscriptEntry p span { color: #e9f1f5; font-size: 11px; line-height: 1.55; }
  .videoGrid { min-height: 210px; flex: 0 0 auto; padding: 10px; background: #081922; }
  .room-connected .videoGrid:empty { display: none; }
  .videoGrid:empty::before { min-height: 210px; color: #9eb2bc; border-color: #36515d; background: #0d232d; }
  .liveAudioPanel { padding: 8px 10px 12px; }
  .liveAudioPanel canvas { height: 126px; }
  .side { border-left: 0; border-top: 1px solid var(--room-line); overflow: visible; }
  .protocolHeader { align-items: flex-start; flex-direction: column; }
  .protocolHeaderActions { width: 100%; }
  .protocolEvidenceLabel { flex: 1; }
  .protocolEvidenceLabel select { width: 100%; min-width: 0; }
  .protocolLayout { grid-template-columns: 1fr; }
  .protocolDocument { max-height: none; padding: 12px 10px 18px; }
  .protocolReviewRail { border-top: 1px solid var(--room-line); border-left: 0; }
  .segmentSpeakerRow { grid-template-columns: minmax(0, 1fr) 40px; }
  .segmentSpeakerRow .segmentRedactionReason { grid-column: 1 / -1; }
  .toolbar {
    min-height: 66px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 0 8px env(safe-area-inset-bottom);
    border-top-color: #1d3a47;
    background: #081922;
  }
  .toolbar button { color: #d9e7ec; border-color: #294754; background: #0d232d; }
  .toolbar button[aria-pressed="true"] { color: #fff; border-color: var(--room-green); background: var(--room-green); }
  .toolbar button.danger:not(:disabled) { color: #fff; border-color: var(--room-red); background: var(--room-red); }
  .toolbarGroup { flex: 1; justify-content: center; }
  .toolbarGroupRight { flex: 0 0 auto; }
  .toolbar button { min-width: 48px; padding: 0 10px; }
  .toolbar button span { display: none; }
}

@media (max-width: 480px) {
  .status { min-width: 68px; padding: 0 7px; font-size: 10px; }
  .setup { padding: 12px 10px; }
  .joinMediaGroup span { min-height: 52px; padding-inline: 4px; font-size: 9px; }
  .prejoinPreview { min-height: 154px; }
  .deviceActions { display: grid; grid-template-columns: minmax(0, 1fr) 40px 40px; }
  .deviceActions a { grid-column: 1 / -1; justify-content: center; }
  .videoGrid { grid-template-columns: 1fr; padding: 10px; }
  .liveSpeakerStrip { padding-inline: 8px; }
  .speakerCard { flex-basis: 124px; grid-template-columns: 34px minmax(0, 1fr); gap: 6px; }
  .speakerAvatar { width: 34px; height: 34px; }
  .supportActions { grid-template-columns: repeat(3, minmax(74px, 1fr)); }
  .toolbarGroup { gap: 5px; }
}
.inviteJoinGuide {
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--room-green) 35%, var(--room-line));
  border-radius: var(--room-radius);
  background: color-mix(in srgb, var(--room-green) 7%, var(--room-surface));
  display: grid;
  gap: 9px;
}
.inviteJoinGuide[hidden] { display: none; }
.inviteJoinGuide > header { min-width: 0; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 7px; }
.inviteJoinGuide > header > .ti { color: var(--room-green); font-size: 20px; text-align: center; }
.inviteJoinGuide > header span { min-width: 0; display: grid; gap: 1px; }
.inviteJoinGuide > header strong { color: var(--room-text); font-size: 11px; }
.inviteJoinGuide > header small { color: var(--room-muted); font-size: 9px; }
.inviteJoinGuide ol { margin: 0; padding: 0; display: grid; gap: 5px; list-style: none; }
.inviteJoinGuide li {
  min-width: 0;
  min-height: 42px;
  padding: 5px 6px;
  border: 1px solid var(--room-line);
  border-radius: var(--room-radius);
  background: var(--room-surface);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}
.inviteJoinGuide li > span { width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--room-green); display: grid; place-items: center; font-size: 9px; font-weight: 900; }
.inviteJoinGuide li p { min-width: 0; margin: 0; display: grid; gap: 1px; }
.inviteJoinGuide li strong { color: var(--room-text); font-size: 10px; }
.inviteJoinGuide li small { color: var(--room-muted); font-size: 9px; line-height: 1.35; }
.inviteJoinGuideScope { margin: 0; padding-top: 7px; border-top: 1px solid var(--room-line); color: var(--room-muted); display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; font-size: 9px; line-height: 1.45; }
.inviteJoinGuideScope .ti { color: var(--room-green); font-size: 15px; }

.consentScope {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--room-line);
  border-radius: var(--room-radius);
  color: var(--room-muted);
  background: var(--room-soft);
  font-size: 9px;
  line-height: 1.5;
}
.consentScope strong { color: var(--room-text); font-weight: 700; }

/* ══════════════════════════════════════════════════════════════════════════
   PFLICHTHINWEIS-BAND — NICHT KONFIGURIERBAR (R-114)

   Hier steht ABSICHTLICH keine einzige var(). Alle Farben sind Literale.
   Das Mandanten-Branding kann ausschliesslich die Custom Properties
   --wt-ui-brand und --wt-ui-brand-strong setzen (workroom.js, feste
   Whitelist) — auf diesen Block hat es dadurch keinen Zugriff. Ein Mandant
   kann die Rechtshinweise also weder umfaerben noch unlesbar machen noch
   ausblenden.

   Gemessener Kontrast (WCAG 2.2, selbe Formel wie utils/tenant-branding.js):
     #e9f1f6 auf #0b1c2d  = 15,09:1   (Fliesstext)
     #ffffff auf #0b1c2d  = 17,24:1   (fette Marker)
     #b9cbd8 auf #0b1c2d  = 10,34:1   (Mandanten-Fusszeile)
   Alle deutlich ueber 4,5:1 — auch bei 9-px-Schrift.

   Der Block bekommt eine eigene, inhaltsgrosse Rasterzeile in .shell — auch
   im Protokoll-Modus, in dem #protocolWorkspace als viertes Kind dazukommt
   (siehe Kommentar bei .shell; ein festes Drei-Zeilen-Raster hat das Band
   vorher in die Zeile der Werkzeugleiste gedrueckt und abgeschnitten).
   ══════════════════════════════════════════════════════════════════════════ */
.legalBand {
  padding: 8px 20px;
  border-top: 1px solid #1d3548;
  color: #e9f1f6;
  background: #0b1c2d;
  display: grid;
  gap: 4px;
  font-size: 10px;
  line-height: 1.45;
}
.legalBand p { margin: 0; }
.legalBandLead { color: #e9f1f6; }
.legalBandLead strong { color: #ffffff; font-weight: 800; }
.legalBandList {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  color: #e9f1f6;
}
.legalBandList li { min-width: 0; }
.legalBandList b { color: #ffffff; font-weight: 800; }
.legalBandTenantNote { color: #b9cbd8; }
.legalBandTenantNote[hidden] { display: none; }

@media (max-width: 720px) {
  .legalBand { padding: 8px 12px; font-size: 9px; }
  .legalBandList { gap: 3px 12px; }
}

/* ── Mandanten-Bildmarke im Schienenkopf (R-114) ────────────────────────────
   Im ungebrandeten Zustand liegt die Markenfarbe als FLAECHE auf der dunklen
   Schiene (app-shell.css:117). Fuer Mandantenfarben ist das die falsche
   Paarung: klassische Kanzlei-Dunkelblaus wie #1c4f8a erreichen gegen #0b1c2d
   nur 2,08:1. Statt solche Farben abzulehnen, bekommt die Bildmarke im
   gebrandeten Zustand eine WEISSE Platte. Damit gilt wieder:
     Marke auf Weiss   >= 4,5:1  (serverseitig erzwungen, utils/tenant-branding.js)
     Weiss auf Schiene  = 17,24:1 (hier literal, nicht konfigurierbar)
   Die Klasse setzt ausschliesslich workroom.js, nie ein Mandantenwert. */
:root.is-tenant-branded .app-brand-mark {
  color: var(--wt-ui-brand, #117d87);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(11, 28, 45, .18);
}

/* Feste Kantenlaenge, damit ein ungewoehnliches Seitenverhaeltnis das Layout
   nicht sprengt. */
.app-brand-mark img.tenantLogo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  background: #ffffff;
}
