/* itb KI-Assistent – Chat-Widget */
.itbbot {
	--ib-ink: #0B0F17;
	--ib-ink-2: #151B28;
	--ib-blue: #0E88C6;
	--ib-blue-dark: #0A6CA0;
	--ib-blue-light: #4FB3E8;
	--ib-signal: #C4F25A;
	--ib-paper: #F4F2ED;
	--ib-line: #E2DED5;
	--ib-muted: #5B6170;
	--ib-ease: cubic-bezier(.2, .7, .2, 1);
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ib-ink);
	-webkit-font-smoothing: antialiased;
}
.itbbot *, .itbbot *::before, .itbbot *::after { box-sizing: border-box; }
.itbbot button { font: inherit; cursor: pointer; }
.itbbot :focus-visible { outline: 2px solid var(--ib-blue-light); outline-offset: 2px; }

/* ---------- Button ---------- */
.itbbot__launcher {
	position: relative;
	width: 62px; height: 62px;
	border-radius: 50%;
	border: 0;
	padding: 0;
	display: grid; place-items: center;
	color: #fff;
	background: radial-gradient(circle at 30% 25%, #1FA3E3, var(--ib-blue-dark) 70%);
	box-shadow: 0 14px 34px -10px rgba(10, 108, 160, .7), 0 0 0 6px rgba(14, 136, 198, .12);
	transition: transform .25s var(--ib-ease), box-shadow .25s;
	margin-left: auto;
	display: flex; align-items: center; justify-content: center;
}
.itbbot__launcher:hover { transform: translateY(-2px) scale(1.03); }
.itbbot__launcher svg { width: 28px; height: 28px; transition: transform .3s var(--ib-ease), opacity .2s; }
.itbbot__launcher::after {
	content: "";
	position: absolute; top: 4px; right: 4px;
	width: 13px; height: 13px; border-radius: 50%;
	background: var(--ib-signal);
	border: 2px solid var(--ib-blue-dark);
	transition: opacity .2s;
}
.itbbot__launcher-close { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: rotate(-90deg); transition: transform .3s var(--ib-ease), opacity .2s; }
.itbbot__launcher-close svg { width: 24px; height: 24px; }
.itbbot[data-open="true"] .itbbot__launcher > svg { opacity: 0; transform: rotate(90deg) scale(.6); }
.itbbot[data-open="true"] .itbbot__launcher-close { opacity: 1; transform: none; }
.itbbot[data-open="true"] .itbbot__launcher::after { opacity: 0; }
.itbbot[data-open="true"] .itbbot__launcher { background: var(--ib-ink); box-shadow: 0 14px 34px -12px rgba(0,0,0,.6); }

/* ---------- Teaser ---------- */
.itbbot__teaser {
	position: absolute;
	right: 74px; bottom: 12px;
	white-space: nowrap;
	background: #fff;
	color: var(--ib-ink);
	border: 1px solid var(--ib-line);
	border-radius: 14px 14px 4px 14px;
	padding: .6rem .9rem;
	font-size: 14px;
	font-weight: 500;
	box-shadow: 0 12px 30px -12px rgba(11, 15, 23, .35);
	opacity: 0;
	transform: translateX(8px);
	pointer-events: none;
	transition: opacity .35s var(--ib-ease), transform .35s var(--ib-ease);
}
.itbbot__teaser.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Panel ---------- */
.itbbot__panel {
	position: absolute;
	right: 0; bottom: 78px;
	width: 380px;
	height: min(620px, calc(100vh - 120px));
	display: flex; flex-direction: column;
	background: var(--ib-paper);
	border-radius: 22px;
	overflow: hidden;
	box-shadow: 0 30px 80px -20px rgba(11, 15, 23, .45), 0 0 0 1px rgba(11, 15, 23, .06);
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px) scale(.98);
	transform-origin: bottom right;
	transition: opacity .25s var(--ib-ease), transform .3s var(--ib-ease), visibility 0s .3s;
}
.itbbot[data-open="true"] .itbbot__panel {
	opacity: 1; visibility: visible; transform: none;
	transition: opacity .25s var(--ib-ease), transform .3s var(--ib-ease), visibility 0s;
}

.itbbot__header {
	display: flex; align-items: center; gap: .75rem;
	padding: 1rem 1rem 1rem 1.1rem;
	background: var(--ib-ink);
	background-image: radial-gradient(circle at 100% 0, rgba(14, 136, 198, .45), transparent 55%);
	color: #fff;
}
.itbbot__avatar {
	position: relative;
	width: 42px; height: 42px; border-radius: 13px; flex: none;
	display: grid; place-items: center;
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .12);
	font-weight: 700; letter-spacing: -.04em; font-size: 16px;
}
.itbbot__avatar i { position: absolute; top: 7px; left: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--ib-blue-light); }
.itbbot__titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.itbbot__titles strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.itbbot__titles span { font-size: 12.5px; color: #A3AAB9; display: flex; align-items: center; gap: .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itbbot__online { width: 7px; height: 7px; border-radius: 50%; background: var(--ib-signal); flex: none; box-shadow: 0 0 0 3px rgba(196, 242, 90, .18); }
.itbbot__actions { display: flex; gap: .25rem; }
.itbbot__icon {
	width: 34px; height: 34px; border-radius: 10px; border: 0; padding: 0;
	background: transparent; color: #A3AAB9;
	display: grid; place-items: center;
	transition: background .2s, color .2s;
}
.itbbot__icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.itbbot__icon svg { width: 18px; height: 18px; }

/* ---------- Verlauf ---------- */
.itbbot__body {
	flex: 1;
	overflow-y: auto;
	padding: 1.1rem 1rem .5rem;
	display: flex; flex-direction: column; gap: .6rem;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}
.itbbot__msg {
	max-width: 86%;
	padding: .7rem .95rem;
	border-radius: 16px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	animation: itbbot-in .3s var(--ib-ease);
}
.itbbot__msg p { margin: 0; }
.itbbot__msg p + p, .itbbot__msg p + ul, .itbbot__msg ul + p { margin-top: .5rem; }
.itbbot__msg ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.itbbot__msg li { margin: .15rem 0; }
.itbbot__msg a { color: var(--ib-blue-dark); text-decoration: underline; text-underline-offset: 2px; }
.itbbot__msg--assistant { align-self: flex-start; background: #fff; border: 1px solid var(--ib-line); border-bottom-left-radius: 5px; }
.itbbot__msg--user { align-self: flex-end; background: var(--ib-blue-dark); color: #fff; border-bottom-right-radius: 5px; }
.itbbot__msg--system { align-self: center; max-width: 94%; font-size: 13px; text-align: center; background: transparent; color: var(--ib-muted); padding: .3rem .5rem; }
.itbbot__msg--ok { color: #2F6B12; background: #EAF8D5; border-radius: 99px; padding: .45rem .9rem; }
.itbbot__msg--error { color: #9B1C1C; }

@keyframes itbbot-in { from { opacity: 0; transform: translateY(6px); } }

.itbbot__typing { display: flex; align-items: center; gap: 4px; color: var(--ib-muted); }
.itbbot__typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ib-blue); animation: itbbot-dot 1.2s infinite ease-in-out; }
.itbbot__typing span:nth-child(2) { animation-delay: .15s; }
.itbbot__typing span:nth-child(3) { animation-delay: .3s; }
.itbbot__typing em { font-style: normal; font-size: 12.5px; margin-left: .4rem; }
@keyframes itbbot-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }

.itbbot__suggestions { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; margin-top: .2rem; }
.itbbot__chip {
	border: 1px solid rgba(10, 108, 160, .35);
	background: #fff;
	color: var(--ib-blue-dark);
	border-radius: 99px;
	padding: .45rem .9rem;
	font-size: 13.5px; font-weight: 500;
	text-align: left;
	transition: background .2s, border-color .2s;
	animation: itbbot-in .35s var(--ib-ease);
}
.itbbot__chip:hover { background: #EAF5FC; border-color: var(--ib-blue); }

/* ---------- Einwilligung ---------- */
.itbbot__consent { margin: auto 0; text-align: center; padding: 1rem .5rem; }
.itbbot__consent-icon { width: 54px; height: 54px; margin: 0 auto 1rem; border-radius: 16px; display: grid; place-items: center; background: var(--ib-ink); color: var(--ib-blue-light); font-size: 22px; }
.itbbot__consent .itbbot__consent-title { color: var(--ib-ink); font-weight: 600; font-size: 17px; margin: 0 0 .5rem; letter-spacing: -.01em; }
.itbbot__consent p { color: var(--ib-muted); font-size: 13.5px; margin: 0 0 1.2rem; }
.itbbot__consent a { color: var(--ib-blue-dark); }
.itbbot__start {
	border: 0; border-radius: 99px;
	background: var(--ib-blue-dark); color: #fff;
	padding: .8rem 1.6rem; font-weight: 500;
	transition: background .2s, transform .2s;
}
.itbbot__start:hover { background: #085A85; transform: translateY(-1px); }

/* ---------- Eingabe ---------- */
.itbbot__footer {
	display: flex; align-items: flex-end; gap: .5rem;
	margin: .5rem .75rem 0;
	padding: .4rem .4rem .4rem .9rem;
	background: #fff;
	border: 1px solid var(--ib-line);
	border-radius: 18px;
	transition: border-color .2s, box-shadow .2s;
}
.itbbot__footer[hidden] { display: none; }
.itbbot__footer:focus-within { border-color: var(--ib-blue); box-shadow: 0 0 0 4px rgba(14, 136, 198, .14); }
.itbbot__input {
	flex: 1; border: 0; outline: 0; resize: none;
	font: inherit; font-size: 15px; line-height: 1.45;
	padding: .45rem 0; background: transparent; color: var(--ib-ink);
	max-height: 120px;
}
.itbbot__input:focus-visible { outline: 0; }
.itbbot__send {
	width: 38px; height: 38px; flex: none; border-radius: 12px; border: 0; padding: 0;
	display: grid; place-items: center;
	background: var(--ib-blue-dark); color: #fff;
	transition: background .2s, opacity .2s;
}
.itbbot__send:hover { background: #085A85; }
.itbbot__send:disabled { opacity: .45; cursor: default; }
.itbbot__send svg { width: 18px; height: 18px; }

.itbbot__quick { display: flex; justify-content: center; gap: 1rem; padding: .55rem .75rem .75rem; font-size: 12.5px; }
.itbbot__quick a { color: var(--ib-muted); text-decoration: none; }
.itbbot__quick a:hover { color: var(--ib-blue-dark); }

/* ---------- Mobil ---------- */
@media (max-width: 520px) {
	.itbbot { right: 14px; bottom: 14px; }
	.itbbot__launcher { width: 56px; height: 56px; }
	.itbbot__teaser { right: 66px; bottom: 9px; width: max-content; max-width: calc(100vw - 100px); white-space: normal; }
	.itbbot__panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		height: 100dvh;
		border-radius: 0;
	}
	.itbbot[data-open="true"] .itbbot__launcher { display: none; }
	.itbbot__input { font-size: 16px; } /* verhindert Zoom auf iOS */
	.itbbot__quick { padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
	.itbbot *, .itbbot *::before, .itbbot *::after { animation: none !important; transition: none !important; }
}

@media print { .itbbot { display: none; } }
