/* Live-Chat (von Pfennigmeister übernommen, Farben von buchhaltungsservice-lueneburg.de, eigenständig) */
:root {
  --bb-chat-dark: #0B0033;
  --bb-chat-accent: #B50B3E;
  --bb-chat-accent-hover: #960932;
  --bb-chat-wash: #f1f5f9;
  --bb-chat-line: #e2e8f0;
  --bb-chat-bg: #ffffff;
  --bb-chat-text: #0B0033;
  --bb-chat-soft: #475569;
  --bb-chat-green: #1f8a4c;
}

.bb-chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--bb-chat-accent); color: #fff;
  font: 700 15px/1 "DM Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  box-shadow: 0 8px 24px rgba(11, 0, 51, 0.22);
}
.bb-chat-launcher:hover { background: var(--bb-chat-accent-hover); }
.bb-chat-launcher:focus-visible { outline: 3px solid var(--bb-chat-dark); outline-offset: 3px; }
.bb-chat-launcher svg { width: 20px; height: 20px; }
.bb-chat-launcher.is-open span { display: none; }

.bb-chat-panel {
  position: fixed; right: 20px; bottom: 84px; z-index: 900;
  width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 110px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bb-chat-bg); color: var(--bb-chat-text);
  border: 1px solid var(--bb-chat-line); border-radius: 18px;
  box-shadow: 0 20px 50px rgba(11, 0, 51, 0.25);
  font: 15px/1.5 "DM Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
.bb-chat-panel[hidden] { display: none; }
.bb-chat-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px; background: var(--bb-chat-dark); color: #fff; }
.bb-chat-head strong { display: block; font-size: 16px; }
.bb-chat-presence { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; opacity: 0.9; }
.bb-chat-presence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b9c6cf; }
.bb-chat-presence.is-online::before { background: #6ee39a; }
.bb-chat-close { border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.bb-chat-close:focus-visible { outline: 2px solid #fff; border-radius: 4px; }

.bb-chat-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: #f8f9fb; }
.bb-chat-intro { margin: 0; color: var(--bb-chat-soft); }
.bb-chat-note { margin: 0; font-size: 13.5px; color: var(--bb-chat-soft); }
.bb-chat-note.is-error, .bb-chat-error { color: #b42318; font-size: 13.5px; margin: 0; min-height: 0; }
.bb-chat-msg { display: flex; flex-direction: column; max-width: 85%; }
.bb-chat-msg.from-you { align-self: flex-end; align-items: flex-end; }
.bb-chat-msg.from-us { align-self: flex-start; }
.bb-chat-bubble { padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bb-chat-wash); }
.bb-chat-msg.from-you .bb-chat-bubble { background: var(--bb-chat-dark); color: #fff; }
.bb-chat-meta { font-size: 11.5px; color: var(--bb-chat-soft); margin-top: 2px; }

.bb-chat-foot { padding: 12px 16px; border-top: 1px solid var(--bb-chat-line); background: var(--bb-chat-bg); max-height: 60%; overflow-y: auto; }
.bb-chat-start { display: grid; gap: 8px; }
.bb-chat-start label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; }
.bb-chat-start label > span [data-mail-hint], .bb-chat-start [data-mail-hint] { font-weight: 400; color: var(--bb-chat-soft); }
.bb-chat-start input, .bb-chat-start textarea, .bb-chat-reply textarea {
  font: inherit; color: inherit; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; resize: vertical;
}
.bb-chat-start input:focus, .bb-chat-start textarea:focus, .bb-chat-reply textarea:focus { outline: 2px solid var(--bb-chat-accent); outline-offset: 1px; }
.bb-chat-consent { flex-direction: row !important; gap: 8px; align-items: flex-start; font-weight: 400 !important; }
.bb-chat-consent input { margin-top: 3px; flex: none; }
.bb-chat-consent a { color: var(--bb-chat-dark); }
/* Abfrage des Kanzleibuchs im Gespräch (z. B. Angaben für die Mandatsanlage) */
.bb-chat-msg.is-request { max-width: 100%; align-self: stretch; }
.bb-chat-request { background: #fff; border: 2px solid var(--bb-chat-accent); }
.bb-chat-request > p { margin: 0 0 8px; }
.bb-chat-request-form { display: grid; gap: 6px; white-space: normal; }
.bb-chat-request-form label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 600; }
.bb-chat-request-form input, .bb-chat-request-form textarea { font: inherit; color: inherit; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; }
.bb-chat-request-form input:focus, .bb-chat-request-form textarea:focus { outline: 2px solid var(--bb-chat-accent); outline-offset: 1px; }
.bb-chat-request-form .bb-chat-send { justify-self: start; }
.bb-chat-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.bb-chat-send {
  border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer;
  background: var(--bb-chat-accent); color: #fff; font: 700 14px/1 "Segoe UI", system-ui, sans-serif;
}
.bb-chat-send:hover { background: var(--bb-chat-accent-hover); }
.bb-chat-send:disabled { opacity: 0.6; cursor: wait; }
.bb-chat-reply { display: flex; gap: 8px; align-items: flex-end; }
.bb-chat-reply textarea { flex: 1; min-height: 42px; }
.bb-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 480px) {
  .bb-chat-panel { right: 8px; left: 8px; bottom: 76px; width: auto; max-width: none; height: calc(100vh - 96px); }
  .bb-chat-launcher { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .bb-chat-panel:not([hidden]) { animation: bb-chat-in 0.16s ease-out; }
  @keyframes bb-chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
