/**
 * Beratungs-Messenger – Web: Farben/Aufbau wie Beratungsanfragen / Einzelberatung
 * Mobile: dunklerer Chat-Kopf (WhatsApp-Flow) in @media
 */

.bm-app {
  /* Wie .sc-app / Beratungsanfragen */
  --bm-brand: var(--zusammen-brand, #2A6B6B);
  --bm-cta: var(--zusammen-cta, #F08060);
  --bm-cta-hover: var(--zusammen-cta-hover, #E8544F);
  --bm-brand-dark: var(--zusammen-brand-dark, #1A4F4F);
  --bm-brand-soft: #D4EDED;
  --bm-bg: #ffffff;
  --bm-panel: #ffffff;
  --bm-surface-alt: #D4EDED;
  --bm-head-bg: #F9EFE6;
  --bm-header: var(--bm-head-bg);
  --bm-header-text: #4A6A6A;
  --bm-mine: #D4EDED;
  --bm-mine-text: #4A6A6A;
  --bm-theirs: #ffffff;
  --bm-theirs-text: #4A6A6A;
  --bm-system-bg: #fff8e6;
  --bm-system-text: #4A6A6A;
  --bm-urgent-bg: #fff5f2;
  --bm-accent: var(--bm-brand);
  --bm-border: #C5DADA;
  --bm-muted: #6B8585;
  --bm-text: #4A6A6A;
  --bm-heading: #2A6B6B;
  --bm-danger: #b32d2e;
  --bm-warn: #dba617;
  --bm-ok: #00a32a;
  --bm-radius: 4px;
  --bm-radius-btn: 8px;
  --bm-radius-sm: 2px;
  --bm-font: inherit;
  --bm-desktop-height: min(70vh, 720px);

  font-family: var(--bm-font);
  color: var(--bm-text);
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  background: var(--bm-bg);
  border-radius: var(--bm-radius);
  overflow: hidden;
  border: 1px solid var(--bm-border);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bm-app *,
.bm-app *::before,
.bm-app *::after {
  box-sizing: border-box;
}

.bm-app--login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  min-height: 280px;
  background: var(--bm-panel);
}

.bm-app--login p {
  margin: 0;
  color: var(--bm-muted);
  max-width: 28rem;
}

.bm-app--login .bm-btn {
  display: inline-block;
  text-decoration: none;
}

.bm-shell {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.bm-shell--three {
  align-items: flex-start;
}

.bm-shell--three > .bm-chat {
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--bm-border);
  overflow: hidden;
}

.bm-shell--three > .bm-sidebar--rooms,
.bm-shell--three > .bm-sidebar--people,
.bm-shell--three > .bm-sidebar--advisors {
  align-self: flex-start;
  max-height: 100%;
  height: auto;
}

.bm-sidebar {
  width: 300px;
  max-width: 100%;
  background: var(--bm-panel);
  border-right: 1px solid var(--bm-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bm-sidebar--rooms {
  width: 280px;
  flex: 0 0 280px;
}

.bm-sidebar--advisors {
  width: 260px;
  flex: 0 0 260px;
}

.bm-sidebar--people {
  width: 320px;
  flex: 0 0 320px;
  border-right: none;
  border-left: 0;
}

.bm-sidebar__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.bm-room-section {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--bm-border);
}

.bm-room-section:last-child {
  border-bottom: 0;
}

.bm-room-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 4px;
}

.bm-room-section__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bm-muted, #667);
}

.bm-room-section__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.bm-room-section__toggle .bm-room-section__title {
  display: inline;
}

.bm-room-section__count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--bm-muted, #667);
}

.bm-room-section--archive .bm-room-list__item {
  opacity: 0.9;
}

.bm-room-section__filter {
  margin: 0;
  flex: 0 1 140px;
  min-width: 0;
}

.bm-room-section__filter select {
  width: 100%;
  max-width: 140px;
  font-size: 0.8rem;
  padding: 2px 4px;
}

.bm-room-section .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.bm-room-section .bm-room-list {
  flex: none;
  overflow: visible;
}

.bm-room-section .bm-room-list > .bm-empty {
  padding: 8px 14px 12px;
  font-size: 0.9rem;
  color: var(--bm-muted, #667);
}

.bm-lobby-chat-hint {
  margin: 8px 12px 0;
  padding: 10px 12px;
  background: var(--bm-surface-alt, #f3f6f6);
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--bm-muted, #556);
}

.bm-lobby-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 0;
}

.bm-lobby-detail {
  padding: 16px;
  background: var(--bm-panel);
  border-radius: var(--bm-radius);
  margin: 12px;
}

.bm-lobby-detail h3 {
  margin-top: 0;
}

.bm-lobby-detail--escalated {
  border-left: 3px solid #c47b00;
}

.bm-lobby-escalate {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff4e5;
  color: #5c3d00;
  border-radius: 4px;
  font-size: 0.95rem;
}

.bm-lobby-rejections {
  margin: 12px 0;
}

.bm-lobby-rejections__title {
  margin: 0 0 4px;
}

.bm-lobby-rejections__list {
  margin: 0;
  padding-left: 1.2em;
}

.bm-lobby-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--bm-surface-alt, #f3f6f6);
  border-radius: 6px;
}

.bm-lobby-status__block {
  min-width: 0;
}

.bm-lobby-status__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 6px;
}

.bm-lobby-status__title {
  margin: 0;
  font-size: 0.88rem;
}

.bm-lobby-status__count {
  font-weight: 400;
  color: var(--bm-muted);
}

.bm-lobby-status__empty {
  margin: 0;
  font-size: 0.85rem;
}

.bm-lobby-status__filter {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: 200px;
  margin-left: auto;
  padding: 4px 8px;
  font-size: 0.85rem;
  border: 1px solid var(--bm-border, #c5d0d0);
  border-radius: 4px;
  background: #fff;
}

.bm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bm-chips--scroll {
  max-height: 7.5rem;
  overflow: auto;
  padding-right: 2px;
}

.bm-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 2px 8px;
  font-size: 0.78rem;
  line-height: 1.35;
  border-radius: 999px;
  background: #e8efef;
  color: var(--bm-text, #1a2a2a);
}

.bm-chip--rejected {
  background: #fde8e8;
  color: #5c1a1a;
  padding-right: 2px;
}

.bm-chip--ok {
  background: #e7f3ee;
}

.bm-chip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10rem;
}

.bm-chip__x {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.bm-chip__x:hover,
.bm-chip__x:focus {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

.bm-lobby-unreject {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--bm-border, #d0dbdb);
}

.bm-lobby-unreject__title {
  margin: 0 0 4px;
  font-size: 0.92rem;
}

.bm-lobby-unreject__hint {
  margin: 0 0 8px;
}

.bm-lobby-unreject__label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.bm-lobby-unreject__label textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--bm-border, #c5d0d0);
  border-radius: 4px;
  font: inherit;
  resize: vertical;
  min-height: 4.5rem;
}

.bm-actions--tight {
  margin-top: 0;
  gap: 8px;
}

.bm-lobby-assign {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.bm-lobby-assign__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bm-room-list__row.is-escalated .bm-room-list__item {
  border-left: 3px solid #c47b00;
}

.bm-room-list__escalate {
  color: #8a5a00;
  font-weight: 600;
}

.bm-muted {
  color: var(--bm-muted);
  font-size: 0.9rem;
}

.bm-room-list__advisor {
  font-weight: 300;
}

.bm-sidebar__head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.bm-offline {
  max-width: 520px;
  margin: 24px auto;
  padding: 20px 22px;
  background: var(--bm-surface-alt);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
}

.bm-offline h2 {
  margin: 0 0 12px;
  color: var(--bm-heading);
}

.bm-offline__msg {
  margin-bottom: 12px;
  line-height: 1.5;
}

.bm-offline__next {
  color: var(--bm-muted);
  font-size: 0.9rem;
}

.bm-offline__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Erreichbarkeit: normale Seitenhöhe (kein Chat-„Iframe“ mit fester Höhe) */
.bm-app--availability {
  --bm-desktop-height: auto;
  height: auto !important;
  max-height: none !important;
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.bm-app--availability > .bm-availability {
  display: block;
  width: 100%;
}

.bm-shell--avail {
  flex: 1;
  min-height: 0;
}

.bm-availability {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bm-availability__head {
  margin: 0 0 12px;
  padding: 0;
}

.bm-availability__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bm-heading);
  line-height: 1.3;
}

.bm-availability__body {
  padding: 0;
  overflow: visible;
  flex: none;
  background: transparent;
}

.bm-availability__body h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.bm-av-top {
  margin-bottom: 12px;
}

.bm-av-layout[hidden] {
  display: none !important;
}

.bm-av-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.25fr);
  gap: 20px 28px;
  align-items: start;
  margin-bottom: 20px;
}

.bm-av-layout__left,
.bm-av-layout__right {
  min-width: 0;
}

.bm-av-layout__right h3 {
  margin-top: 0;
}

.bm-av-offline {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--bm-border);
}

.bm-av-offline h3 {
  margin-top: 0;
}

.bm-av-toggle,
.bm-av-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  font-size: 0.95rem;
}

.bm-av-toggle {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.bm-av-field input,
.bm-availability__body textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  font: inherit;
}

.bm-av-week {
  display: grid;
  gap: 8px;
  max-width: none;
}

.bm-av-day {
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  padding: 8px 10px;
  background: var(--bm-panel);
}

.bm-av-day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.bm-av-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.bm-av-slot input[type='time'] {
  width: 7.5rem;
  padding: 4px 6px;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-sm);
  font: inherit;
}

.bm-av-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  max-width: none;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .bm-av-layout {
    grid-template-columns: 1fr;
  }
}

.bm-av-cal__day {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 10px;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  background: var(--bm-panel);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.bm-av-cal__day:hover,
.bm-av-cal__day:focus-visible {
  border-color: var(--bm-brand);
  background: var(--bm-brand-soft);
}

.bm-av-cal__day.is-override {
  border-color: var(--bm-warn);
  background: #fcf9e8;
}

.bm-av-cal__date {
  font-weight: 600;
}

.bm-av-cal-hint,
.bm-av-field__hint,
.bm-av-eff-note {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--bm-muted);
  max-width: 560px;
  line-height: 1.4;
}

.bm-av-eff-note {
  color: var(--bm-warn);
}

.bm-av-cal__day.is-prev {
  border-style: dashed;
  opacity: 0.9;
}

.bm-av-day-editor,
.bm-av-modal {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
}

.bm-av-modal[hidden] {
  display: none !important;
}

.bm-av-modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.bm-av-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(90, 100, 105, 0.55);
  cursor: pointer;
}

.bm-av-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px 28px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
}

.bm-av-modal__panel h3 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
}

.bm-av-modal__desc {
  margin: 0 0 16px;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #4a5560;
}

.bm-av-modal__modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.bm-av-modal__mode {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.95rem;
  cursor: pointer;
}

.bm-av-modal #bm-av-day-slots {
  margin: 0 0 10px;
}

.bm-av-modal .bm-av-add-day {
  margin-bottom: 16px;
}

.bm-av-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.bm-av-modal__actions .bm-btn {
  flex: 0 1 auto;
}

body.bm-av-modal-open {
  overflow: hidden;
}

.bm-av-status {
  margin: 10px 0;
  color: var(--bm-ok);
  font-size: 0.9rem;
}

.bm-av-status.is-error {
  color: var(--bm-danger);
}

.bm-sidebar__head,
.bm-chat__head {
  background: var(--bm-header);
  color: var(--bm-header-text);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--bm-border);
}

.bm-chat__head {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
}

.bm-chat__head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bm-chat__title {
  min-width: 0;
}

.bm-chat--room {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bm-surface-alt);
  overflow: hidden;
}

.bm-sidebar__head h2,
.bm-chat__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
  line-height: 1.35;
}

/* Mobile-Kopf: Logo + Schließen (Desktop ausgeblendet) */
.bm-mobile-bar {
  display: none;
}

/* Theme (.single-content ul) setzt padding-left: 2em – hier zurücksetzen */
.bm-app ul,
.bm-app ol,
.single-content .bm-app ul,
.single-content .bm-app ol,
.entry-content .bm-app ul,
.entry-content .bm-app ol {
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  list-style: none;
}

.bm-room-list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-left: 0;
  overflow-y: auto;
  flex: 1;
  width: 100%;
}

.bm-room-list > li {
  margin: 0;
  padding: 0;
  width: 100%;
  border-bottom: 1px solid var(--bm-border);
}

.bm-room-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px 14px;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: var(--bm-text);
  position: relative;
  transition: background 0.12s ease;
}

.bm-room-list__item:hover {
  background: var(--bm-head-bg);
}

.bm-room-list__item.is-active {
  background: var(--bm-brand-soft);
  box-shadow: inset 3px 0 0 var(--bm-brand);
}

.bm-room-list__item.is-active::before {
  display: none;
}

/* Ampel rot / dringend – wie Beratungsanfragen-Zeile */
.bm-room-list__item:has(.bm-ampel--red) {
  background: var(--bm-urgent-bg);
}

.bm-room-list__item:has(.bm-ampel--red).is-active {
  background: #ffe8e2;
  box-shadow: inset 3px 0 0 var(--bm-danger);
}

.bm-room-list__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bm-head-bg);
  color: var(--bm-brand);
  border: 1px solid var(--bm-border);
  font-weight: 700;
  font-size: 0.85rem;
}

.bm-room-list__text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bm-room-list__title {
  font-weight: 600;
  display: block;
  color: var(--bm-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-room-list__user {
  font-weight: 300;
  color: var(--bm-muted);
}

.bm-room-list__row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.bm-room-list__row > .bm-room-list__item {
  flex: 1;
  min-width: 0;
}

.bm-room-list__transfer {
  flex: 0 0 auto;
  align-self: center;
  margin-right: 6px;
  width: 34px;
  height: 34px;
  color: var(--bm-brand);
}

.bm-room-list__transfer.is-open,
.bm-room-list__transfer:hover,
.bm-room-list__transfer:focus-visible {
  background: var(--bm-brand-soft);
  color: var(--bm-brand-dark);
}

.bm-assign-menu {
  display: none;
}

.bm-assign-modal {
  --bm-brand: var(--zusammen-brand, #2A6B6B);
  --bm-cta: var(--zusammen-cta, #F08060);
  --bm-cta-hover: var(--zusammen-cta-hover, #E8544F);
  --bm-brand-dark: var(--zusammen-brand-dark, #1A4F4F);
  --bm-brand-soft: #D4EDED;
  --bm-border: #C5DADA;
  --bm-text: #4A6A6A;
  --bm-muted: #6B8585;
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--bm-text);
}

.bm-assign-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(90, 100, 105, 0.55);
  cursor: pointer;
}

.bm-assign-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px 28px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
}

.bm-assign-modal__panel h3 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bm-text);
}

.bm-assign-modal__desc {
  margin: 0 0 16px;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--bm-muted);
}

.bm-assign-modal__search {
  margin: 0 0 12px;
}

.bm-assign-modal__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #8a9499;
  border-radius: 4px;
  font: inherit;
  font-size: 1rem;
  color: var(--bm-text);
  background: #fff;
}

.bm-assign-modal__input:focus {
  outline: 2px solid var(--bm-brand);
  outline-offset: 1px;
  border-color: var(--bm-brand);
}

.bm-assign-modal__results {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--bm-border);
  border-radius: 6px;
  background: #fff;
}

.bm-assign-modal__empty {
  padding: 12px;
  color: var(--bm-muted);
  font-size: 0.9rem;
}

.bm-assign-modal__item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--bm-border);
  border-radius: 0;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  color: var(--bm-text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.bm-assign-modal__item:last-child {
  border-bottom: 0;
}

.bm-assign-modal__item:hover,
.bm-assign-modal__item:focus-visible {
  background: #eaf3f3 !important;
  color: #215950 !important;
}

.bm-assign-modal__item.is-selected {
  background: #eaf3f3 !important;
  font-weight: 600;
  color: #215950 !important;
  box-shadow: inset 3px 0 0 #2a6b6b;
}

.bm-assign-modal__selected {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--bm-muted);
}

.bm-assign-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  justify-content: center;
}

/* Explizite Hex-Werte: Modal kann Theme-Button-Resets außerhalb von .bm-app treffen */
.bm-assign-modal .bm-assign-modal__actions .bm-btn,
.bm-assign-modal button.bm-btn {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-block !important;
  border: 2px solid #2a6b6b !important;
  border-radius: 8px !important;
  padding: 0.45em 1.15em !important;
  font: inherit !important;
  font-weight: 600 !important;
  cursor: pointer;
  background: #fff !important;
  color: var(--bm-brand, #2A6B6B) !important;
  white-space: nowrap;
  line-height: 1.5 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bm-assign-modal .bm-assign-modal__actions .bm-btn:hover:not(:disabled),
.bm-assign-modal .bm-assign-modal__actions .bm-btn:focus-visible:not(:disabled),
.bm-assign-modal button.bm-btn:hover:not(:disabled),
.bm-assign-modal button.bm-btn:focus-visible:not(:disabled) {
  background: var(--bm-cta, #F08060) !important;
  color: #fff !important;
  border-color: var(--bm-cta, #F08060) !important;
}

.bm-assign-modal .bm-assign-modal__actions .bm-btn:focus-visible,
.bm-assign-modal button.bm-btn:focus-visible {
  outline: 2px solid #2a6b6b !important;
  outline-offset: 2px;
}

.bm-assign-modal .bm-assign-modal__actions .bm-btn:disabled,
.bm-assign-modal button.bm-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #fff !important;
  color: var(--bm-brand, #2A6B6B) !important;
  border-color: var(--bm-cta, #F08060) !important;
}

.bm-assign-modal .bm-assign-modal__actions .bm-btn--secondary,
.bm-assign-modal button.bm-btn--secondary {
  border-color: var(--bm-cta, #F08060) !important;
  color: var(--bm-brand, #2A6B6B) !important;
  background: #fff !important;
}

.bm-assign-modal .bm-assign-modal__actions .bm-btn--secondary:hover:not(:disabled),
.bm-assign-modal .bm-assign-modal__actions .bm-btn--secondary:focus-visible:not(:disabled),
.bm-assign-modal button.bm-btn--secondary:hover:not(:disabled),
.bm-assign-modal button.bm-btn--secondary:focus-visible:not(:disabled) {
  background: var(--bm-cta, #F08060) !important;
  color: #fff !important;
  border-color: var(--bm-cta, #F08060) !important;
}

body.bm-assign-modal-open {
  overflow: hidden;
}

.bm-room-list__meta {
  font-size: 0.8rem;
  color: var(--bm-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.bm-people-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bm-people-invite {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px;
  margin: 0 0 4px;
  background: var(--bm-head-bg);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
}

.bm-people-invite__label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--bm-heading);
  margin: 0;
}

.bm-people-invite__search {
  margin: 0;
}

.bm-people-invite__input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.9rem;
  min-height: 38px;
  color: var(--bm-text);
  background: #fff;
}

.bm-people-invite__input:focus {
  outline: 2px solid var(--bm-brand);
  outline-offset: 1px;
  border-color: var(--bm-brand);
}

.bm-people-invite__discoverable {
  margin-top: 2px;
}

.bm-people-invite__help {
  margin: 0 0 6px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--bm-muted);
}

.bm-people-invite__results {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  max-height: 11rem;
  overflow-y: auto;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  background: #fff;
}

.bm-people-invite__item {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f1;
  font-size: 0.9rem;
  line-height: 1.35;
}

.bm-people-invite__item:last-child {
  border-bottom: none;
}

.bm-people-invite__item:hover,
.bm-people-invite__item:focus {
  background: #f6f7f7;
  outline: none;
}

.bm-people-invite__item.is-selected {
  background: var(--bm-brand-soft);
  box-shadow: inset 3px 0 0 var(--bm-brand);
}

.bm-people-invite__item-label {
  font-weight: 500;
  color: var(--bm-heading);
}

.bm-people-invite__login {
  font-weight: 400;
  color: var(--bm-muted);
  font-size: 0.85em;
}

.bm-people-invite__empty {
  padding: 0.5rem 0.55rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--bm-muted);
  font-style: italic;
}

.bm-people-invite__hint {
  min-height: 1.2em;
  margin: 0 0 2px;
  font-size: 0.8rem;
  color: var(--bm-muted);
}

.bm-people-invite #bm-invite-submit {
  margin-top: 2px;
}

.bm-btn--pill {
  width: 100%;
  border-radius: var(--bm-radius-btn);
  justify-content: center;
}

.bm-btn--sm {
  padding: 0.3em 0.7em;
  font-size: 0.85rem;
}

.bm-people-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bm-people-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--bm-radius-sm);
  border-bottom: 1px solid var(--bm-border);
}

.bm-people-list__item:hover {
  background: var(--bm-head-bg);
}

.bm-people-list__remove {
  flex-shrink: 0;
  margin-left: auto;
  width: 32px;
  height: 32px;
  color: var(--bm-muted);
}

.bm-people-list__remove:hover,
.bm-people-list__remove:focus-visible {
  color: var(--bm-danger);
  background: var(--bm-urgent-bg, #fff5f2);
}

.bm-people-list__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bm-head-bg);
  color: var(--bm-brand);
  border: 1px solid var(--bm-border);
  font-weight: 700;
  font-size: 0.85rem;
}

.bm-people-list__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bm-people-list__name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.bm-people-list__name {
  font-weight: 600;
  color: var(--bm-heading);
  min-width: 0;
}

.bm-people-list__name-row .wpxf-author-extras {
  flex-shrink: 0;
}

.bm-badge-team {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  background: var(--bm-brand);
  color: #fff;
  border-radius: 3px;
  line-height: 1.35;
  flex-shrink: 0;
}

.bm-people-list__name-row .brm-role-icon,
.bm-people-list__name-row .wpxf-role-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--bm-brand-dark);
  line-height: 1;
}

.bm-people-list__name-row .brm-role-icon .dashicons,
.bm-people-list__name-row .wpxf-role-icon .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.bm-people-list__name-row .brm-role-icon img,
.bm-people-list__name-row .wpxf-role-icon img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.bm-people-list__role {
  font-size: 0.78rem;
  color: var(--bm-muted);
}

.bm-user-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Profil- / Klientenakte-Icons (wie WPX-Forum / Einzelberatung) */
.bm-app .wpxf-author-extras,
.bm-app .bm-author-extras {
  display: inline-flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  gap: 0.15rem;
}

.bm-app .wpxf-author-extra-link,
.bm-app .wpxf-author-extra-link:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bm-brand);
  text-decoration: none !important;
  line-height: 1;
}

.bm-app .wpxf-author-extra-link:hover,
.bm-app .wpxf-author-extra-link:focus-visible {
  color: var(--bm-brand-dark);
  text-decoration: none !important;
}

.bm-app .wpxf-author-extra-link .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.bm-bubble--theirs .wpxf-author-extra-link,
.bm-bubble--theirs .wpxf-author-extra-link:visited {
  color: var(--bm-brand-dark);
}

.bm-empty--center {
  margin: auto;
}

.bm-icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.bm-icon-btn:hover,
.bm-icon-btn:focus-visible {
  background: var(--bm-brand-soft);
  color: var(--bm-brand);
}

.bm-icon-btn:focus-visible {
  outline: 2px solid var(--bm-brand);
  outline-offset: 1px;
}

.bm-chat__title h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25em;
}

.bm-chat__user {
  font-weight: 300;
  opacity: 0.85;
}

.bm-sidebar__head--nav {
  gap: 8px;
  justify-content: flex-start;
}

.bm-sidebar__head--nav h2 {
  flex: 1;
  min-width: 0;
}

.bm-people-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Desktop: Mobile-only Controls ausblenden */
.bm-only-mobile {
  display: none !important;
}

.bm-chat {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bm-surface-alt);
  overflow: hidden;
}

.bm-chat__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bm-bubble {
  max-width: min(78%, 520px);
  padding: 10px 12px 8px;
  border-radius: var(--bm-radius);
  border: 1px solid var(--bm-border);
  position: relative;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.bm-bubble--mine {
  align-self: flex-end;
  background: var(--bm-mine);
  color: var(--bm-mine-text);
  border-color: #c5d9d9;
}

.bm-bubble--mine .bm-bubble__time {
  color: var(--bm-muted);
}

.bm-bubble--theirs {
  align-self: flex-start;
  background: var(--bm-theirs);
  color: var(--bm-theirs-text);
}

.bm-bubble--system {
  align-self: center;
  background: var(--bm-system-bg);
  box-shadow: inset 4px 0 0 var(--bm-warn);
  border: 1px solid #e6d8a8;
  color: var(--bm-system-text);
  font-size: 0.85rem;
  text-align: left;
  max-width: min(92%, 560px);
  border-radius: var(--bm-radius);
}

.bm-bubble--system p {
  margin: 0 0 0.5em;
}

.bm-bubble--system p:last-child {
  margin-bottom: 0;
}

.bm-bubble--system a {
  color: var(--bm-brand);
  font-weight: 600;
  text-decoration: underline;
}

.bm-bubble__author {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bm-brand);
  margin-bottom: 2px;
}

.bm-bubble__time {
  display: block;
  text-align: right;
  font-size: 0.68rem;
  color: var(--bm-muted);
  margin-top: 4px;
}

.bm-bubble a {
  color: inherit;
  text-decoration: underline;
}

.bm-bubble--theirs a {
  color: var(--bm-brand-dark);
}

.bm-chat__compose {
  background: var(--bm-panel);
  padding: 12px 14px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  border-top: 1px solid var(--bm-border);
  flex-shrink: 0;
}

.bm-chat__compose textarea {
  flex: 1;
  min-height: 44px;
  height: 44px;
  max-height: 44px;
  resize: none;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-btn);
  padding: 10px 12px;
  font: inherit;
  color: var(--bm-text);
  background: #fff;
}

.bm-chat__compose textarea:focus {
  outline: 2px solid var(--bm-brand);
  outline-offset: 1px;
  border-color: var(--bm-brand);
}

/* Buttons: Outline wie .sc-btn / „Zum Dialog“ */
.bm-btn {
  appearance: none;
  border: 2px solid var(--bm-brand);
  border-radius: var(--bm-radius-btn);
  padding: 0.4em 1.1em;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: var(--bm-brand);
  white-space: nowrap;
  line-height: 1.5;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bm-btn:hover,
.bm-btn:focus-visible {
  background: var(--bm-brand);
  color: #fff;
  border-color: var(--bm-brand);
}

.bm-btn:focus-visible {
  outline: 2px solid var(--bm-brand);
  outline-offset: 2px;
}

.bm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bm-btn--ghost {
  background: #fff;
  color: var(--bm-brand);
  border: 2px solid var(--bm-brand);
  padding: 0.3em 0.75em;
  font-size: 0.85rem;
}

.bm-btn--ghost:hover,
.bm-btn--ghost:focus-visible {
  background: var(--bm-brand);
  color: #fff;
  border-color: var(--bm-brand);
}

.bm-btn--secondary {
  border-color: var(--bm-brand);
  color: var(--bm-brand);
}

.bm-btn--secondary:hover,
.bm-btn--secondary:focus-visible {
  background: var(--bm-brand);
  border-color: var(--bm-brand);
  color: #fff;
}

.bm-btn--danger {
  border-color: var(--bm-danger);
  color: var(--bm-danger);
}

.bm-btn--danger:hover,
.bm-btn--danger:focus-visible {
  background: var(--bm-danger);
  border-color: var(--bm-danger);
  color: #fff;
}

.bm-btn--file {
  background: #fff;
  color: var(--bm-brand-dark);
  border: 2px solid var(--bm-border);
  border-radius: var(--bm-radius-btn);
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.bm-btn--file:hover,
.bm-btn--file:focus-visible {
  background: var(--bm-brand-soft);
  color: var(--bm-brand-dark);
  border-color: var(--bm-brand);
}

.bm-form {
  max-width: 520px;
  margin: 32px auto;
  background: var(--bm-panel);
  padding: 1.25rem;
  border-radius: var(--bm-radius);
  border: 1px solid var(--bm-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bm-form h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: var(--bm-heading);
  font-weight: 700;
}

.bm-form > p {
  color: var(--bm-muted);
  margin: 0 0 16px;
}

.bm-form label {
  display: block;
  font-weight: 600;
  margin: 12px 0 6px;
  color: var(--bm-heading);
}

.bm-form input[type="text"],
.bm-form textarea {
  width: 100%;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  padding: 10px 12px;
  font: inherit;
  color: var(--bm-text);
  background: #fff;
}

.bm-form input[type="text"]:focus,
.bm-form textarea:focus {
  outline: 2px solid var(--bm-brand);
  outline-offset: 1px;
  border-color: var(--bm-brand);
}

.bm-form .bm-gdpr {
  font-size: 0.85rem;
  color: var(--bm-muted);
  margin: 14px 0;
}

.bm-form .bm-btn {
  margin-top: 4px;
}

.bm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--bm-radius);
  background: var(--bm-head-bg);
  border: 1px solid var(--bm-border);
  color: var(--bm-text);
}

.bm-ampel {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.bm-ampel--green { background: var(--bm-ok); }
.bm-ampel--yellow { background: var(--bm-warn); }
.bm-ampel--red { background: var(--bm-danger); }

.bm-participants {
  font-size: 0.8rem;
  opacity: 0.92;
  margin-top: 2px;
}

.bm-typing {
  min-height: 20px;
  padding: 0 16px 6px;
  font-size: 0.8rem;
  color: var(--bm-muted);
  font-style: italic;
  flex-shrink: 0;
}

.bm-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--bm-muted);
}

.bm-error {
  background: #fdecea;
  color: #611a15;
  padding: 10px 12px;
  border-radius: var(--bm-radius-btn);
  margin: 12px;
  border: 1px solid rgba(184, 33, 5, 0.15);
}

.bm-invite {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bm-panel);
  border-bottom: 1px solid var(--bm-border);
  flex-wrap: wrap;
  align-items: center;
}

.bm-invite input {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-btn);
  padding: 8px 10px;
  font: inherit;
  color: var(--bm-text);
}

.bm-invite input:focus {
  outline: 2px solid var(--bm-brand);
  outline-offset: 1px;
  border-color: var(--bm-brand);
}

.bm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Wartehinweis unter dem Kopf */
.bm-chat > .bm-empty {
  margin: 0;
  padding: 10px 16px;
  background: var(--bm-brand-soft);
  border-bottom: 1px solid var(--bm-border);
  color: var(--bm-brand-dark);
  font-size: 0.9rem;
}

/* Desktop: feste Messenger-Höhe – Nachrichten scrollen, Eingabe bleibt unten */
@media (min-width: 761px) {
  .bm-app:not(.bm-app--availability) {
    height: var(--bm-desktop-height);
    max-height: var(--bm-desktop-height);
    min-height: 480px;
  }

  .bm-app:not(.bm-app--availability) > .bm-shell,
  .bm-app:not(.bm-app--availability) > .bm-chat,
  .bm-app:not(.bm-app--availability) > .bm-chat--room {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  .bm-sidebar {
    overflow: hidden;
  }

  .bm-shell--three > .bm-sidebar--rooms,
  .bm-shell--three > .bm-sidebar--people,
  .bm-shell--three > .bm-sidebar--advisors {
    align-self: flex-start;
    max-height: 100%;
    height: auto;
  }

  .bm-shell--three .bm-sidebar__scroll {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  .bm-shell--three .bm-people-body {
    flex: 0 1 auto;
  }

  .bm-shell--three .bm-people-actions {
    margin-top: 12px;
  }

  .bm-room-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  .bm-shell--three .bm-room-section .bm-room-list {
    flex: none;
    overflow: visible;
  }

  .bm-chat__compose,
  .bm-chat__head,
  .bm-typing,
  #bm-compose-blocked {
    flex-shrink: 0;
  }
}

@media (max-width: 1100px) {
  .bm-shell--three {
    flex-wrap: wrap;
  }

  .bm-shell--three .bm-sidebar--rooms {
    width: 240px;
    flex: 0 0 240px;
  }

  .bm-shell--three > .bm-chat {
    flex: 1 1 calc(100% - 240px);
    min-width: 280px;
    border-right: none;
  }

  .bm-shell--three .bm-sidebar--people {
    width: 100%;
    flex: 1 1 100%;
    max-height: 220px;
    border-top: 1px solid var(--bm-border);
  }
}

@media (max-width: 760px) {
  /* Mobile: dunklerer Kopf wie zuvor (WhatsApp-Flow) – nicht für Erreichbarkeits-Seite */
  .bm-app:not(.bm-app--availability) {
    --bm-header: #215950;
    --bm-header-text: #ffffff;
    --bm-mine: #2a6b6b;
    --bm-mine-text: #ffffff;
    --bm-radius: 8px;
  }

  .bm-app:not(.bm-app--availability) .bm-sidebar__head,
  .bm-app:not(.bm-app--availability) .bm-chat__head,
  .bm-app:not(.bm-app--availability) .bm-mobile-bar {
    background: var(--bm-header);
    color: var(--bm-header-text);
    border-bottom-color: rgba(255, 255, 255, 0.15);
  }

  .bm-app:not(.bm-app--availability) .bm-btn--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
  }

  .bm-app:not(.bm-app--availability) .bm-btn--ghost:hover,
  .bm-app:not(.bm-app--availability) .bm-btn--ghost:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: #fff;
  }

  .bm-app:not(.bm-app--availability) .bm-status {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
  }

  .bm-app:not(.bm-app--availability) .bm-icon-btn:hover,
  .bm-app:not(.bm-app--availability) .bm-icon-btn:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
  }

  .bm-app:not(.bm-app--availability) .bm-bubble--mine {
    border-color: transparent;
  }

  .bm-app:not(.bm-app--availability) .bm-bubble--mine .bm-bubble__time {
    color: rgba(255, 255, 255, 0.75);
  }

  .bm-only-mobile {
    display: inline-flex !important;
  }

  .bm-only-desktop {
    display: none !important;
  }

  .bm-shell {
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  /* WhatsApp-Flow: Liste → Chat → Personen (eine Ansicht gleichzeitig) */
  .bm-shell--three {
    position: relative;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-height: 0;
    overflow: hidden;
  }

  .bm-shell--three > .bm-sidebar--rooms,
  .bm-shell--three > .bm-chat,
  .bm-shell--three > .bm-sidebar--people,
  .bm-shell--coord > .bm-sidebar--advisors {
    position: absolute;
    inset: 0;
    width: 100% !important;
    max-width: none;
    max-height: none !important;
    height: 100%;
    flex: none;
    border: 0 !important;
    display: none;
    flex-direction: column;
    background: var(--bm-panel);
    z-index: 1;
  }

  .bm-shell--three.is-view-list > .bm-sidebar--rooms,
  .bm-shell--three.is-view-chat > .bm-chat,
  .bm-shell--three.is-view-people > .bm-sidebar--people {
    display: flex;
    z-index: 2;
  }

  /* Koordinator: Berater → Räume → Detail */
  .bm-shell--coord.is-view-list > .bm-sidebar--rooms,
  .bm-shell--coord.is-view-chat > .bm-chat,
  .bm-shell--coord.is-view-people > .bm-sidebar--people {
    display: none;
    z-index: 1;
  }

  .bm-shell--coord.is-view-list > .bm-sidebar--advisors,
  .bm-shell--coord.is-view-rooms > .bm-sidebar--rooms,
  .bm-shell--coord.is-view-people > .bm-chat {
    display: flex;
    z-index: 2;
  }

  .bm-app--lobby.bm-app--view-rooms > .bm-mobile-bar,
  .bm-app--lobby.bm-app--view-people > .bm-mobile-bar,
  .bm-app--team.bm-app--view-chat > .bm-mobile-bar,
  .bm-app--team.bm-app--view-people > .bm-mobile-bar {
    display: none;
  }

  .bm-shell--three > .bm-chat {
    background: var(--bm-bg);
  }

  .bm-shell--three .bm-room-list {
    padding: 0;
    width: 100%;
  }

  .bm-shell--three .bm-room-list__item {
    border-radius: 0;
    width: 100%;
    padding: 12px 14px;
    gap: 12px;
  }

  .bm-shell--three .bm-room-list__item.is-active::before {
    display: none;
  }

  .bm-shell--three .bm-chat__head-row {
    gap: 8px;
  }

  .bm-shell--three .bm-chat__title {
    flex: 1;
    min-width: 0;
  }

  .bm-shell--three .bm-chat__title h2 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bm-shell--three .bm-chat__title .bm-participants {
    font-size: 0.75rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bm-shell--three .bm-actions {
    margin-left: auto;
  }

  .bm-shell--three .bm-chat--room,
  .bm-shell--three #bm-adv-chat {
    min-height: 0;
    height: 100%;
  }

  .bm-shell--three .bm-people-body {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* Logo/Schließen nur auf der Raumliste */
  .bm-app--advisor.bm-app--view-chat > .bm-mobile-bar,
  .bm-app--advisor.bm-app--view-people > .bm-mobile-bar,
  .bm-app--team.bm-app--view-chat > .bm-mobile-bar,
  .bm-app--team.bm-app--view-people > .bm-mobile-bar {
    display: none;
  }

  .bm-sidebar:not(.bm-sidebar--rooms):not(.bm-sidebar--people) {
    width: 100%;
    flex: 0 0 auto;
    max-height: 32vh;
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--bm-border);
  }

  .bm-app:not(.bm-app--availability) {
    min-height: 70vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .bm-bubble {
    max-width: 88%;
  }

  .bm-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    flex-shrink: 0;
    background: var(--bm-header);
    color: var(--bm-header-text);
    padding: 10px 12px;
    box-sizing: border-box;
  }

  .bm-chat__head > .bm-mobile-bar {
    padding: 0 0 8px;
    margin: 0 0 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .bm-app > .bm-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .bm-mobile-bar__brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    text-decoration: none;
    color: inherit;
  }

  .bm-mobile-bar__logo {
    display: block;
    max-height: 28px;
    width: auto;
    max-width: min(160px, 55vw);
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    padding: 3px 6px;
  }

  .bm-mobile-bar__name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bm-mobile-bar__close {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    text-decoration: none;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    line-height: 1.2;
  }

  .bm-mobile-bar__close:hover,
  .bm-mobile-bar__close:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: #fff;
  }

  .bm-mobile-bar__close-icon {
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 400;
  }

  .bm-form {
    margin: 16px 12px 24px;
    max-width: none;
  }

  .bm-chat--room {
    min-height: 0;
    flex: 1;
  }
}

/* Mobile Fullscreen: nur Messenger, Theme-Chrome weg */
html.bm-mobile-fullscreen {
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

html.bm-mobile-fullscreen.wp-toolbar,
html.bm-mobile-fullscreen:has(body.admin-bar) {
  margin-top: 0 !important;
}

body.bm-mobile-fullscreen {
  --bm-admin-bar-offset: 0px;
  margin: 0;
  overflow: hidden;
  max-height: 100vh;
  max-height: 100dvh;
  background: var(--bm-bg, #f7fafc);
}

body.admin-bar.bm-mobile-fullscreen {
  --bm-admin-bar-offset: var(--wp-admin--admin-bar--height, 46px);
  padding-top: var(--bm-admin-bar-offset);
}

body.bm-mobile-fullscreen #wpadminbar {
  position: fixed;
}

body.bm-mobile-fullscreen #masthead,
body.bm-mobile-fullscreen header.site-header,
body.bm-mobile-fullscreen .site-header,
body.bm-mobile-fullscreen #site-header,
body.bm-mobile-fullscreen .site-footer,
body.bm-mobile-fullscreen footer.site-footer,
body.bm-mobile-fullscreen #colophon,
body.bm-mobile-fullscreen .wp-block-template-part,
body.bm-mobile-fullscreen header.wp-block-template-part,
body.bm-mobile-fullscreen footer.wp-block-template-part,
body.bm-mobile-fullscreen .entry-hero,
body.bm-mobile-fullscreen .entry-header,
body.bm-mobile-fullscreen .kadence-breadcrumbs,
body.bm-mobile-fullscreen #secondary,
body.bm-mobile-fullscreen .sidebar,
body.bm-mobile-fullscreen .widget-area {
  display: none !important;
}

body.bm-mobile-fullscreen #page,
body.bm-mobile-fullscreen .site,
body.bm-mobile-fullscreen .wp-site-blocks,
body.bm-mobile-fullscreen .content-area,
body.bm-mobile-fullscreen #primary,
body.bm-mobile-fullscreen .content-container,
body.bm-mobile-fullscreen .entry-content-wrap,
body.bm-mobile-fullscreen .entry-content,
body.bm-mobile-fullscreen article.entry,
body.bm-mobile-fullscreen .entry.single-entry {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
  min-height: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

body.bm-mobile-fullscreen .bm-app {
  position: fixed;
  left: 0;
  right: 0;
  /* visualViewport: Höhe oberhalb der Soft-Tastatur (Firefox/Chrome Android) */
  top: calc(var(--bm-admin-bar-offset, 0px) + var(--bm-vv-top, 0px));
  bottom: auto;
  width: 100%;
  max-width: none;
  height: var(--bm-vv-height, 100dvh);
  max-height: var(--bm-vv-height, 100dvh);
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 99990;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
  box-sizing: border-box;
}

body.bm-mobile-fullscreen .bm-app > .bm-shell,
body.bm-mobile-fullscreen .bm-app > .bm-chat,
body.bm-mobile-fullscreen .bm-app > .bm-chat--room {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
}

body.bm-mobile-fullscreen .bm-chat--room {
  height: 100%;
  min-height: 0 !important;
  max-height: 100%;
}

body.bm-mobile-fullscreen .bm-chat__head,
body.bm-mobile-fullscreen .bm-mobile-bar,
body.bm-mobile-fullscreen .bm-typing,
body.bm-mobile-fullscreen #bm-compose-blocked {
  flex-shrink: 0;
}

body.bm-mobile-fullscreen .bm-chat__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.bm-mobile-fullscreen .bm-chat__compose {
  flex: 0 0 auto;
  flex-shrink: 0;
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  min-height: 52px;
  box-sizing: border-box;
  z-index: 2;
  background: var(--bm-panel);
}

body.bm-mobile-fullscreen .bm-chat__compose textarea {
  min-height: 40px;
  max-height: 88px;
  flex-shrink: 0;
  font-size: 16px; /* verhindert iOS/Android Zoom beim Fokus */
}

body.bm-mobile-fullscreen .bm-form {
  flex: 1;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.bm-mobile-fullscreen .bm-app--login {
  flex: 1;
}
