.sf-livechat-launcher {
  position: fixed;
  left: calc(1rem + 58px + 0.7rem);
  bottom: 1.15rem;
  right: auto;
  z-index: 1040;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(15, 42, 68, 0.35);
  text-decoration: none;
  font-size: 1.35rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sf-livechat-launcher:hover {
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 42, 68, 0.42);
}
.sf-livechat-launcher--hidden {
  display: none !important;
}

/* Live-Chat Seiten: kompakte Premium-Fläche statt „leerer“ Weißraum */
.sf-livechat-page {
  padding: 2.5rem 0 3rem;
  min-height: auto;
}
.sf-livechat-page .sf-livechat-panel {
  max-width: 640px;
  margin: 0 auto;
  border-radius: 18px;
  background: var(--premium-bg-card, #fff);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  padding: 1.5rem 1.6rem;
}
.sf-livechat-page .sf-livechat-panel h1 {
  margin-bottom: 0.65rem;
}
.sf-livechat-flow,
.sf-livechat-room {
  max-width: 820px;
  margin: 0 auto;
}

.sf-livechat-room__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}
.sf-livechat-room__messages {
  min-height: 360px;
  max-height: 520px;
  overflow: auto;
  padding: 1rem 1.15rem;
  background: rgba(148, 163, 184, 0.06);
}
.sf-livechat-msg {
  max-width: 80%;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.sf-livechat-msg--customer {
  margin-left: auto;
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.25);
}
.sf-livechat-msg--agent {
  background: #f8fafc;
}
.sf-livechat-msg--system {
  margin-inline: auto;
  text-align: center;
  background: transparent;
  border-style: dashed;
  color: #64748b;
  font-size: 0.9rem;
}
.sf-livechat-msg__meta {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}
.sf-livechat-room__composer {
  display: flex;
  gap: 0.55rem;
  padding: 0.85rem 1.15rem 1.1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}
[data-theme="dark"] .sf-livechat-msg {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}
[data-theme="dark"] .sf-livechat-msg--customer {
  background: rgba(37, 99, 235, 0.2);
}
[data-theme="dark"] .sf-livechat-room__messages {
  background: rgba(2, 6, 23, 0.35);
}
[data-theme="dark"] .sf-livechat-page .sf-livechat-panel {
  background: #121a29;
  border-color: rgba(148, 163, 184, 0.18);
}

/* Tablet: A11y-FAB ausgeblendet → Chat links unten */
@media (max-width: 991.98px) and (min-width: 768px) {
  .sf-livechat-launcher,
  .sf-livechat-launcher--footer-aware {
    left: 1rem;
    bottom: 1.1rem;
    width: 50px;
    height: 50px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.92);
    transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.15s ease;
  }
  .sf-livechat-launcher.is-visible:not([hidden]):not(.sf-livechat-launcher--hidden) {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
  .sf-livechat-launcher[hidden],
  .sf-livechat-launcher--hidden {
    display: none !important;
  }
}

/* Mobil: Floating-Chat aus → Link unter Barrierefreiheit */
@media (max-width: 767.98px) {
  .sf-livechat-launcher,
  .sf-livechat-launcher--footer-aware,
  .sf-livechat-launcher.is-visible {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}
