/* Live-Chat – Schreibbüro Franke. Farbe über --sbf-lc-color (Einstellungen). */
.sbf-lc {
	--sbf-lc-color: #c53530;
	--sbf-lc-dark: color-mix(in srgb, var(--sbf-lc-color) 82%, #000);
	--sbf-lc-soft: color-mix(in srgb, var(--sbf-lc-color) 9%, #fff);
	--sbf-lc-text: #1f2328;
	--sbf-lc-muted: #646a73;
	font-family: inherit; font-size: 15px; line-height: 1.45; color: var(--sbf-lc-text);
}
.sbf-lc *, .sbf-lc *::before, .sbf-lc *::after { box-sizing: border-box; }
.sbf-lc [hidden] { display: none !important; }

/* Reiter rechts mittig */
.sbf-lc__tab {
	position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 2147483000;
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	padding: 14px 9px; border: 0; border-radius: 12px 0 0 12px; cursor: pointer;
	background: var(--sbf-lc-color); color: #fff; font: inherit; font-weight: 700; font-size: 14px; letter-spacing: .02em;
	box-shadow: -4px 6px 22px rgba(0,0,0,.18); transition: padding .15s, background .15s;
}
.sbf-lc__tab:hover, .sbf-lc__tab:focus-visible { background: var(--sbf-lc-dark); padding-right: 13px; outline: none; }
.sbf-lc__tab-text { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.sbf-lc__tab-icon { font-size: 18px; line-height: 1; }
.sbf-lc__tab-dot { width: 9px; height: 9px; border-radius: 50%; background: #b9bec5; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.sbf-lc[data-online="1"] .sbf-lc__tab-dot { background: #34c759; }
.sbf-lc__badge { position: absolute; top: -8px; left: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #1f2328; color: #fff; font-size: 12px; line-height: 22px; text-align: center; }
.sbf-lc.is-open .sbf-lc__tab { opacity: 0; pointer-events: none; }

/* Fenster */
.sbf-lc__panel {
	position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 2147483001;
	width: 370px; max-width: calc(100vw - 24px); height: min(580px, calc(100vh - 40px));
	display: flex; flex-direction: column; overflow: hidden;
	background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.08);
	animation: sbf-lc-in .18s ease-out;
}
@keyframes sbf-lc-in { from { opacity: 0; transform: translateY(-46%); } to { opacity: 1; transform: translateY(-50%); } }

.sbf-lc__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--sbf-lc-color); color: #fff; }
.sbf-lc__avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; overflow: hidden; }
.sbf-lc__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sbf-lc__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sbf-lc__who strong { font-size: 15.5px; }
.sbf-lc__sub { font-size: 12.5px; opacity: .92; display: flex; align-items: center; gap: 6px; }
.sbf-lc__dot { width: 8px; height: 8px; border-radius: 50%; background: #d0d4d9; flex: none; }
.sbf-lc[data-online="1"] .sbf-lc__dot { background: #34c759; box-shadow: 0 0 0 2px rgba(52,199,89,.3); }
.sbf-lc__close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.sbf-lc__close:hover, .sbf-lc__close:focus-visible { background: rgba(255,255,255,.18); outline: none; }

.sbf-lc__body { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: #f6f7f9; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.sbf-lc__msg { display: flex; flex-direction: column; max-width: 85%; }
.sbf-lc__msg--visitor { align-self: flex-end; align-items: flex-end; }
.sbf-lc__msg--bot, .sbf-lc__msg--staff { align-self: flex-start; }
.sbf-lc__bubble { padding: 9px 13px; border-radius: 16px; background: #fff; border: 1px solid #e6e8eb; overflow-wrap: anywhere; }
.sbf-lc__msg--bot .sbf-lc__bubble, .sbf-lc__msg--staff .sbf-lc__bubble { border-bottom-left-radius: 5px; }
.sbf-lc__msg--staff .sbf-lc__bubble { border-color: var(--sbf-lc-color); box-shadow: 0 0 0 1px var(--sbf-lc-soft); }
.sbf-lc__msg--visitor .sbf-lc__bubble { background: var(--sbf-lc-color); border-color: var(--sbf-lc-color); color: #fff; border-bottom-right-radius: 5px; }
.sbf-lc__msg--visitor .sbf-lc__bubble a { color: #fff; }
.sbf-lc__bubble a { color: var(--sbf-lc-color); text-decoration: underline; }
.sbf-lc__meta { font-size: 11.5px; color: var(--sbf-lc-muted); margin: 3px 6px 0; }
.sbf-lc__msg--system { align-self: center; max-width: 92%; text-align: center; font-size: 12.5px; color: var(--sbf-lc-muted); }
.sbf-lc__msg--system span { background: #eceef1; border-radius: 999px; padding: 3px 12px; display: inline-block; }
.sbf-lc__pending { opacity: .75; }
.sbf-lc__msg.is-error .sbf-lc__bubble { background: #fdecea; color: #7a1f1b; border-color: #f1b9b5; }

.sbf-lc__typing .sbf-lc__bubble { display: flex; gap: 4px; padding: 13px 14px; }
.sbf-lc__typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9bec5; animation: sbf-lc-dot 1s infinite; }
.sbf-lc__typing i:nth-child(2) { animation-delay: .15s; }
.sbf-lc__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sbf-lc-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.sbf-lc__chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 4px; }
.sbf-lc__chip {
	border: 1.5px solid var(--sbf-lc-color); background: #fff; color: var(--sbf-lc-color);
	border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left;
	transition: background .12s, color .12s;
}
.sbf-lc__chip:hover, .sbf-lc__chip:focus-visible { background: var(--sbf-lc-color); color: #fff; outline: none; }
.sbf-lc__chip--solid { background: var(--sbf-lc-color); color: #fff; }

.sbf-lc__contact { display: flex; flex-direction: column; gap: 7px; background: #fff; border: 1px solid #e6e8eb; border-radius: 14px; padding: 12px; font-size: 13.5px; }
.sbf-lc__contact input { width: 100%; padding: 9px 11px; border: 1px solid #cfd3d9; border-radius: 9px; font: inherit; font-size: 14px; background: #fff; color: inherit; }
.sbf-lc__contact input:focus { outline: none; border-color: var(--sbf-lc-color); box-shadow: 0 0 0 3px var(--sbf-lc-soft); }
.sbf-lc__contact .sbf-lc__chip { align-self: flex-start; }
.sbf-lc__err { color: #a12a26; font-size: 12.5px; }
.sbf-lc__ended { display: flex; justify-content: center; padding: 6px 0; }

.sbf-lc__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 6px 14px; border-top: 1px solid #eceef1; background: #fff; }
.sbf-lc__form textarea { flex: 1; resize: none; border: 0; outline: none; font: inherit; font-size: 15px; line-height: 1.4; padding: 8px 0; max-height: 110px; background: transparent; color: inherit; }
.sbf-lc__send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--sbf-lc-color); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sbf-lc__send:hover, .sbf-lc__send:focus-visible { background: var(--sbf-lc-dark); outline: none; }
.sbf-lc__send svg { width: 18px; height: 18px; margin-left: 2px; }
.sbf-lc__legal { padding: 0 14px 10px; font-size: 11px; color: var(--sbf-lc-muted); background: #fff; }
.sbf-lc__legal a { color: inherit; text-decoration: underline; }

@media (max-width: 640px) {
	.sbf-lc--hide-mobile { display: none; }
	.sbf-lc__tab { padding: 11px 7px; font-size: 13px; gap: 6px; }
	.sbf-lc__tab-icon { font-size: 16px; }
	.sbf-lc__panel { inset: 0; right: 0; top: 0; transform: none; width: 100%; max-width: none; height: 100%; height: 100dvh; border-radius: 0; animation: none; }
	.sbf-lc__form textarea { font-size: 16px; } /* verhindert Zoom auf iPhone */
}
@media print { .sbf-lc { display: none !important; } }
