/* B-Singular-Assistent */
.bsa-root, .bsa-root * { box-sizing: border-box; }
.bsa-root.bsa-left { right: auto; left: 24px; }
.bsa-root.is-open { bottom: 24px; } /* offenes Fenster liegt über Pfeil und Symbolen */
.bsa-root {
	--bsa-c: #46768f;
	position: fixed; right: 24px; bottom: var(--bsa-bottom, 84px); z-index: 100010;
	font-family: inherit; font-size: 15px; line-height: 1.5; color: #2b2b2b;
}
.bsa-toggle {
	display: flex; align-items: center; gap: 8px;
	background: var(--bsa-c); color: #fff; border: 0; border-radius: 16px;
	padding: 0 18px 0 14px; height: 50px; cursor: pointer; font: inherit; font-weight: 600;
	box-shadow: 0 6px 20px rgba(0,0,0,.18); transition: transform .15s ease, box-shadow .15s ease;
}
.bsa-toggle:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.22); }
.bsa-toggle:focus-visible, .bsa-root button:focus-visible, .bsa-root a:focus-visible, .bsa-input:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.bsa-toggle svg { width: 24px; height: 24px; flex: none; }
.bsa-root.is-open .bsa-toggle { display: none; }

.bsa-panel {
	display: none; flex-direction: column;
	width: 370px; max-width: calc(100vw - 32px);
	height: 540px; max-height: calc(100vh - 40px);
	background: #fff; border-radius: 16px; overflow: hidden;
	box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.bsa-root.is-open .bsa-panel { display: flex; animation: bsa-in .18s ease-out; }
@keyframes bsa-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.bsa-head { background: var(--bsa-c); color: #fff; padding: 14px 16px; display: flex; align-items: flex-start; gap: 10px; }
.bsa-head-text { flex: 1; min-width: 0; }
.bsa-title { font-weight: 700; font-size: 17px; margin: 0; color: #fff; }
.bsa-sub { font-size: 13px; opacity: .9; margin: 2px 0 0; }
.bsa-close { background: rgba(255,255,255,.18); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; flex: none; }
.bsa-close:hover { background: rgba(255,255,255,.3); }

.bsa-msgs { flex: 1; overflow-y: auto; padding: 16px; background: #f5f8fa; display: flex; flex-direction: column; gap: 10px; }
.bsa-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; word-wrap: break-word; }
.bsa-msg p { margin: 0 0 .6em; } .bsa-msg p:last-child { margin-bottom: 0; }
.bsa-msg ul, .bsa-msg ol { margin: .3em 0 .6em 1.2em; padding: 0; }
.bsa-msg a { color: var(--bsa-c); text-decoration: underline; }
.bsa-bot { background: #fff; border: 1px solid #dde6ec; align-self: flex-start; border-bottom-left-radius: 4px; }
.bsa-user { background: var(--bsa-c); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bsa-q { font-weight: 700; margin-bottom: 4px; }

.bsa-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.bsa-chip {
	background: #fff; border: 1px solid var(--bsa-c); color: var(--bsa-c);
	border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left;
}
.bsa-chip:hover { background: var(--bsa-c); color: #fff; }
.bsa-label { font-size: 12.5px; color: #7a716b; align-self: flex-start; margin-top: 2px; }

.bsa-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bsa-action { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; text-decoration: none !important; color: #fff !important; background: var(--bsa-c); }
.bsa-action.bsa-wa { background: #1f9d55; }

.bsa-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #dde6ec; background: #fff; }
.bsa-input { flex: 1; min-width: 0; border: 1px solid #c9d5dd; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; color: #2b2b2b; background: #fff; }
.bsa-send { background: var(--bsa-c); color: #fff; border: 0; border-radius: 10px; padding: 0 14px; cursor: pointer; font: inherit; font-weight: 600; }
.bsa-note { font-size: 11.5px; color: #8b837d; text-align: center; padding: 0 10px 8px; background: #fff; }

.bsa-typing { display: inline-flex; gap: 4px; }
.bsa-typing span { width: 6px; height: 6px; border-radius: 50%; background: #b9aea6; animation: bsa-dot 1s infinite; }
.bsa-typing span:nth-child(2) { animation-delay: .15s; } .bsa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bsa-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* Schutz gegen Theme-Stile (Enfold u. a.) */
.bsa-root input, .bsa-root select, .bsa-root textarea, .bsa-root button { margin: 0; box-shadow: none; text-transform: none; letter-spacing: normal; }
.bsa-root .bsa-input { height: auto; min-height: 44px; line-height: 1.3; }
.bsa-root .bsa-send { height: auto; min-height: 44px; line-height: 1.2; padding: 0 16px; }
.bsa-root .bsa-form { align-items: stretch; }

/* Persönliches Angebot */
.bsa-offer { border-left: 3px solid var(--bsa-c); }
.bsa-sign { font-style: italic; color: #4a5a63; margin-top: 4px !important; }
.bsa-root button.bsa-action { border: 0; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; }
.bsa-link { background: none; border: 0; padding: 0; color: var(--bsa-c); text-decoration: underline; cursor: pointer; font: inherit; font-size: inherit; }

/* Kontaktformular */
.bsa-lead { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.bsa-lead p { margin: 0; }
.bsa-lead label { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; font-weight: 600; color: #3a3a3a; margin: 0; }
.bsa-lead input[type=text], .bsa-lead select, .bsa-lead textarea {
	width: 100%; height: auto; min-height: 40px; padding: 8px 10px; border: 1px solid #c9d5dd; border-radius: 8px;
	font: inherit; font-size: 16px; font-weight: 400; color: #2b2b2b; background: #fff;
}
.bsa-lead textarea { resize: vertical; min-height: 56px; }
.bsa-lead .bsa-check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 12.5px; line-height: 1.4; }
.bsa-lead .bsa-check input { width: 18px; height: 18px; flex: none; margin-top: 1px; accent-color: var(--bsa-c); }
.bsa-lead .bsa-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.bsa-err { color: #b3261e; font-size: 13px; }
.bsa-err:empty { display: none; }
.bsa-submit { align-self: flex-start; padding: 10px 18px !important; }
.bsa-submit[disabled] { opacity: .6; cursor: default; }

@media (max-width: 480px) {
	.bsa-root.is-open, .bsa-root.bsa-left.is-open { left: 12px; right: 12px; bottom: 12px; }
	.bsa-panel { width: 100%; max-width: none; height: calc(100vh - 24px); height: calc(100dvh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
	.bsa-root.is-open .bsa-panel, .bsa-typing span { animation: none; }
	.bsa-toggle { transition: none; }
}
@media print { .bsa-root { display: none !important; } }
.bsa-bot:has(.bsa-lead) { max-width: 100%; width: 100%; }

/* B-Singular: pinker Akzent und Schutz gegen Enfold-Rahmenfarben */
.bsa-root { --bsa-pk: #E6007E; }
.bsa-head { border-bottom: 3px solid var(--bsa-pk); }
#top .bsa-root .bsa-offer { border-left: 3px solid var(--bsa-pk) !important; }
#top .bsa-root .bsa-bot { border: 1px solid #dde6ec !important; }
#top .bsa-root .bsa-offer { border-left: 3px solid var(--bsa-pk) !important; }
#top .bsa-root .bsa-chip { border: 1px solid var(--bsa-c) !important; }
#top .bsa-root .bsa-form { border-top: 1px solid #dde6ec !important; }
#top .bsa-root .bsa-input { border: 1px solid #c9d5dd !important; }
.bsa-toggle { border-radius: 999px; }
.bsa-title { font-weight: 500; }

/* Breiter und höher, damit Antworten genug Platz haben */
.bsa-panel { width: 440px; height: 620px; max-height: calc(100vh - 40px); }
.bsa-msgs { position: relative; }
.bsa-msg { max-width: 92%; }
/* Rückruf-Angebot kompakter, damit es die Antwort nicht verdrängt */
.bsa-offer { font-size: 14px; padding: 9px 12px; }
.bsa-offer .bsa-actions { margin-top: 6px; }
.bsa-root .bsa-offer .bsa-action { padding: 6px 10px; font-size: 13px; }
@media (max-width: 480px) { .bsa-panel { width: calc(100vw - 24px); height: calc(100vh - 40px); } }
