/* Diefenbach Info-Assistent – nutzt Astra-Farben, wenn vorhanden */
.dfb-ib {
	--dfb-ib-accent: var(--ast-global-color-0, #1e5aa8);
	--dfb-ib-ink: var(--ast-global-color-3, #1f2a37);
	--dfb-ib-muted: #5f6b7a;
	--dfb-ib-bg: #ffffff;
	--dfb-ib-soft: #f3f5f8;
	--dfb-ib-line: #e3e7ed;
	--dfb-ib-radius: 16px;
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--dfb-ib-ink);
}
.dfb-ib--right { right: 20px; }
.dfb-ib--left { left: 20px; }
.dfb-ib *, .dfb-ib *::before, .dfb-ib *::after { box-sizing: border-box; }
.dfb-ib svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Startknopf ---------- */
.dfb-ib__launcher {
	display: flex; align-items: center; gap: 8px;
	margin: 0; padding: 12px 18px 12px 14px;
	border: 0; border-radius: 999px;
	background: var(--dfb-ib-accent); color: #fff;
	font: inherit; font-weight: 600; font-size: 15px; line-height: 1;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
	cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.dfb-ib--left .dfb-ib__launcher { margin-right: auto; }
.dfb-ib--right .dfb-ib__launcher { margin-left: auto; }
.dfb-ib__launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .22); color: #fff; background: var(--dfb-ib-accent); }
.dfb-ib__launcher:focus-visible, .dfb-ib button:focus-visible, .dfb-ib a:focus-visible, .dfb-ib__input:focus-visible {
	outline: 3px solid var(--dfb-ib-accent); outline-offset: 2px;
}
.dfb-ib__launcher:focus-visible { outline-color: #fff; box-shadow: 0 0 0 5px var(--dfb-ib-accent); }
.dfb-ib.is-open .dfb-ib__launcher-label { display: none; }
.dfb-ib.is-open .dfb-ib__launcher { padding: 12px; }

/* ---------- Fenster ---------- */
.dfb-ib__panel {
	display: flex; flex-direction: column;
	width: 380px; max-width: calc(100vw - 40px);
	height: 600px; max-height: calc(100vh - 110px);
	margin-bottom: 12px;
	background: var(--dfb-ib-bg);
	border-radius: var(--dfb-ib-radius);
	box-shadow: 0 18px 50px rgba(15, 25, 40, .25), 0 0 0 1px rgba(15, 25, 40, .06);
	overflow: hidden;
	animation: dfb-ib-in .18s ease-out;
}
.dfb-ib__panel[hidden] { display: none; }
@keyframes dfb-ib-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.dfb-ib__head {
	display: flex; align-items: center; gap: 10px;
	padding: 14px 12px 14px 16px;
	background: var(--dfb-ib-accent); color: #fff;
}
.dfb-ib__avatar {
	flex: none; width: 38px; height: 38px; border-radius: 50%;
	display: grid; place-items: center; background: rgba(255, 255, 255, .18);
}
.dfb-ib__titles { flex: 1; min-width: 0; }
.dfb-ib__name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.dfb-ib__sub { font-size: 12.5px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dfb-ib__close {
	flex: none; display: grid; place-items: center;
	width: 36px; height: 36px; margin: 0; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer;
}
.dfb-ib__close:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* ---------- Verlauf ---------- */
.dfb-ib__log {
	flex: 1; overflow-y: auto; overscroll-behavior: contain;
	padding: 16px 14px 8px; background: var(--dfb-ib-soft);
	display: flex; flex-direction: column; gap: 10px;
}
.dfb-ib__msg { display: flex; }
.dfb-ib__msg--user { justify-content: flex-end; }
.dfb-ib__bubble {
	max-width: 88%; padding: 10px 13px; border-radius: 14px;
	background: #fff; box-shadow: 0 1px 2px rgba(15, 25, 40, .08);
	overflow-wrap: anywhere;
}
.dfb-ib__msg--bot .dfb-ib__bubble { border-top-left-radius: 4px; }
.dfb-ib__msg--user .dfb-ib__bubble { background: var(--dfb-ib-accent); color: #fff; border-top-right-radius: 4px; }
.dfb-ib__bubble p { margin: 0 0 .5em; }
.dfb-ib__bubble p:last-child { margin-bottom: 0; }
.dfb-ib__bubble ul, .dfb-ib__bubble ol { margin: .2em 0 .5em; padding-left: 1.25em; }
.dfb-ib__bubble li { margin: .15em 0; }
.dfb-ib__bubble a { color: var(--dfb-ib-accent); text-decoration: underline; text-underline-offset: 2px; }
.dfb-ib__topic { font-weight: 700; margin-bottom: 4px; }
.dfb-ib__src { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--dfb-ib-line); font-size: 13px; color: var(--dfb-ib-muted); }
.dfb-ib__ai-note { margin-top: 8px; font-size: 12px; color: var(--dfb-ib-muted); }

.dfb-ib__chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 2px; }
.dfb-ib__chips-label { width: 100%; font-size: 12.5px; color: var(--dfb-ib-muted); }
.dfb-ib__chip {
	margin: 0; padding: 6px 11px;
	border: 1px solid color-mix(in srgb, var(--dfb-ib-accent) 45%, transparent);
	border-radius: 999px; background: #fff; color: var(--dfb-ib-accent);
	font: inherit; font-size: 13.5px; line-height: 1.3; text-align: left; cursor: pointer;
}
.dfb-ib__chip:hover { background: var(--dfb-ib-accent); color: #fff; }

.dfb-ib__dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.dfb-ib__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--dfb-ib-muted); opacity: .4; animation: dfb-ib-dot 1s infinite; }
.dfb-ib__dots i:nth-child(2) { animation-delay: .15s; }
.dfb-ib__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dfb-ib-dot { 50% { opacity: 1; transform: translateY(-3px); } }

/* ---------- KI-Angebot ---------- */
.dfb-ib__ai-offer { padding: 10px 14px; border-top: 1px solid var(--dfb-ib-line); font-size: 13px; background: #fff; }
.dfb-ib__ai-offer[hidden] { display: none; }
.dfb-ib__ai-offer p { margin: 0 0 8px; }
.dfb-ib__offer-btn, .dfb-ib__offer-no {
	margin: 0; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer;
}
.dfb-ib__offer-btn { border: 0; background: var(--dfb-ib-accent); color: #fff; }
.dfb-ib__offer-no { border: 1px solid var(--dfb-ib-line); background: #fff; color: var(--dfb-ib-ink); }
.dfb-ib__progress { margin-top: 8px; height: 6px; border-radius: 3px; background: var(--dfb-ib-line); overflow: hidden; }
.dfb-ib__progress span { display: block; height: 100%; width: 0; background: var(--dfb-ib-accent); transition: width .3s; }

/* ---------- Eingabe ---------- */
.dfb-ib__form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--dfb-ib-line); background: #fff; margin: 0; }
.dfb-ib__input {
	flex: 1; min-width: 0; margin: 0; height: 42px; padding: 0 14px;
	border: 1px solid var(--dfb-ib-line); border-radius: 999px; background: var(--dfb-ib-soft);
	font: inherit; font-size: 15px; color: var(--dfb-ib-ink); box-shadow: none;
}
.dfb-ib__input:focus { border-color: var(--dfb-ib-accent); background: #fff; outline: none; }
.dfb-ib__send {
	flex: none; display: grid; place-items: center; width: 42px; height: 42px; margin: 0; padding: 0;
	border: 0; border-radius: 50%; background: var(--dfb-ib-accent); color: #fff; cursor: pointer;
}
.dfb-ib__send:hover { filter: brightness(1.08); background: var(--dfb-ib-accent); color: #fff; }
.dfb-ib__send svg { width: 19px; height: 19px; }
.dfb-ib__form.is-busy .dfb-ib__send { opacity: .5; pointer-events: none; }
.dfb-ib__privacy { padding: 0 14px 10px; font-size: 11.5px; line-height: 1.4; color: var(--dfb-ib-muted); background: #fff; }
.dfb-ib__privacy a { color: inherit; text-decoration: underline; }
.dfb-ib__sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Handy: Vollbild ---------- */
@media (max-width: 520px) {
	.dfb-ib { bottom: 14px; }
	.dfb-ib--right { right: 14px; }
	.dfb-ib--left { left: 14px; }
	.dfb-ib.is-open { inset: 0; }
	.dfb-ib.is-open .dfb-ib__panel { width: 100vw; max-width: none; height: 100%; max-height: none; margin: 0; border-radius: 0; }
	.dfb-ib.is-open .dfb-ib__launcher { display: none; }
	.dfb-ib__input { font-size: 16px; } /* verhindert Zoom auf iOS */
}
@media (prefers-reduced-motion: reduce) {
	.dfb-ib__panel, .dfb-ib__dots i { animation: none; }
	.dfb-ib__launcher { transition: none; }
}
@media print { .dfb-ib { display: none !important; } }
