/* FUS Chatbot Widget */
.fus-chatbot-root {
	--fus-chatbot-color: #2563eb;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Sprechblasen-Launcher: 3 weich gerundete Ecken + 1 spitze Ecke = "Speech-Bubble".
   Farbe bewusst NICHT --fus-chatbot-color (Brandfarbe der Seite), sondern ein warmer
   Orange-Pink-Verlauf, der vor blauen/dunklen Flächen sticht. */
.fus-chatbot-launcher {
	position: relative;
	width: 66px;
	height: 60px;
	border: none;
	border-radius: 22px 22px 22px 6px;
	background: linear-gradient(135deg, #f97316 0%, #db2777 100%);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 12px 28px rgba(219, 39, 119, 0.45), 0 4px 10px rgba(15, 23, 42, 0.18);
	overflow: visible;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}
.fus-chatbot-launcher-icon {
	width: 30px;
	height: 30px;
	display: block;
}
.fus-chatbot-launcher:hover,
.fus-chatbot-launcher:focus-visible {
	transform: scale(1.06);
	box-shadow: 0 16px 36px rgba(219, 39, 119, 0.6), 0 6px 14px rgba(15, 23, 42, 0.22);
	outline: none;
}
.fus-chatbot-launcher:active { transform: scale(0.97); }

/* Pulsierender Ring – passt sich der Sprechblasen-Form an. */
.fus-chatbot-launcher::before {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: 24px 24px 24px 6px;
	background: linear-gradient(135deg, #f97316 0%, #db2777 100%);
	opacity: 0.55;
	z-index: -1;
	animation: fus-chatbot-pulse 2.6s ease-out infinite;
}
@keyframes fus-chatbot-pulse {
	0%   { transform: scale(0.85); opacity: 0.55; }
	70%  { transform: scale(1.45); opacity: 0; }
	100% { transform: scale(1.45); opacity: 0; }
}

/* Titel-Label nur als Hover-Tooltip rechts neben dem Button, damit die Bubble selbst kompakt bleibt. */
.fus-chatbot-launcher-label {
	position: absolute;
	right: calc(100% + 14px);
	top: 50%;
	transform: translateY(-50%) translateX(6px);
	background: #0f172a;
	color: #fff;
	font-size: 0.82rem;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 8px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}
.fus-chatbot-launcher-label::after {
	content: '';
	position: absolute;
	right: -5px;
	top: 50%;
	transform: translateY(-50%) rotate(45deg);
	width: 10px;
	height: 10px;
	background: #0f172a;
}
.fus-chatbot-launcher:hover .fus-chatbot-launcher-label,
.fus-chatbot-launcher:focus-visible .fus-chatbot-launcher-label {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
}
/* Pulsanimation aus, sobald gehovert wird – wirkt ruhiger beim Lesen. */
.fus-chatbot-launcher:hover::before { animation-play-state: paused; opacity: 0; }

.fus-chatbot-panel {
	position: absolute;
	right: 0;
	bottom: 64px;
	width: 380px;
	max-width: 92vw;
	max-height: 72vh;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 0.22s ease, transform 0.22s ease;
}
.fus-chatbot-panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.fus-chatbot-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 0.85rem;
	background: linear-gradient(135deg, var(--fus-chatbot-color) 0%, color-mix(in srgb, var(--fus-chatbot-color) 75%, #1e3a8a) 100%);
	color: #fff;
}
.fus-chatbot-header-main {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-width: 0;
}
.fus-chatbot-header-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.fus-chatbot-header-avatar svg { width: 22px; height: 22px; }
.fus-chatbot-header-text { min-width: 0; }
.fus-chatbot-title { font-weight: 700; font-size: 0.95rem; display: block; line-height: 1.25; }
.fus-chatbot-status {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.72rem;
	opacity: 0.92;
	margin-top: 0.1rem;
}
.fus-chatbot-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35);
	animation: fus-chatbot-online 2s ease-in-out infinite;
}
@keyframes fus-chatbot-online {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.55; }
}
.fus-chatbot-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.fus-chatbot-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0.85rem 0.65rem 1.5rem;
	background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 40%, #f8fafc 100%);
	font-size: 0.9rem;
	color: #0f172a;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	scroll-behavior: smooth;
}

.fus-chatbot-msg-row {
	display: flex;
	align-items: flex-end;
	gap: 0.45rem;
	max-width: 100%;
}
.fus-chatbot-msg-row--user { justify-content: flex-end; }
.fus-chatbot-msg-row--bot { justify-content: flex-start; }

.fus-chatbot-msg-col {
	display: flex;
	flex-direction: column;
	max-width: calc(100% - 44px);
	min-width: 0;
}
.fus-chatbot-msg-row--user .fus-chatbot-msg-col { align-items: flex-end; }

.fus-chatbot-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #e2e8f0;
	color: var(--fus-chatbot-color);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}
.fus-chatbot-avatar svg { width: 18px; height: 18px; }

.fus-chatbot-meta {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
	margin: 0 0 0.2rem 0.15rem;
	font-size: 0.72rem;
}
.fus-chatbot-name { font-weight: 700; color: #475569; }
.fus-chatbot-time { color: #94a3b8; }

.fus-chatbot-msg {
	max-width: 100%;
	padding: 0.6rem 0.75rem;
	border-radius: 14px;
	line-height: 1.5;
	word-wrap: break-word;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.28s ease, transform 0.28s ease;
}
.fus-chatbot-msg.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.fus-chatbot-msg.bot {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 4px;
}
.fus-chatbot-msg.user {
	background: var(--fus-chatbot-color);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.fus-chatbot-status-pill {
	display: inline-block;
	margin-top: 0.15rem;
	padding: 0.15rem 0.45rem;
	background: #eff6ff;
	color: #1d4ed8;
	border-radius: 6px;
	font-weight: 600;
	font-size: 0.82rem;
}
.fus-chatbot-inline-heading { margin: 0.35rem 0 0.15rem; font-size: 0.85rem; }
.fus-chatbot-msg .fus-chatbot-q-title {
	font-weight: 700;
	display: block;
	margin-bottom: 0.25rem;
	color: #0f172a;
}
.fus-chatbot-msg.bot a { color: var(--fus-chatbot-color); }
.fus-chatbot-msg.bot p {
	margin: 0 0 0.65em;
}
.fus-chatbot-msg.bot p:last-child {
	margin-bottom: 0;
}
.fus-chatbot-msg.bot ul,
.fus-chatbot-msg.bot ol {
	margin: 0.35em 0 0.65em 1.15rem;
	padding: 0;
}
.fus-chatbot-msg.bot li {
	margin-bottom: 0.25em;
}
.fus-chatbot-cta {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.35rem 0.7rem;
	background: var(--fus-chatbot-color);
	color: #fff !important;
	text-decoration: none;
	border-radius: 6px;
	font-weight: 600;
	font-size: 0.85rem;
}

.fus-chatbot-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.4rem;
	max-height: 200px;
	overflow-y: auto;
	padding-right: 0.15rem;
}
/* schmaler Scrollbar bei vielen Suggestions */
.fus-chatbot-suggestions::-webkit-scrollbar { width: 6px; }
.fus-chatbot-suggestions::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.fus-chatbot-suggestion {
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	color: #3730a3;
	border-radius: 999px;
	padding: 0.2rem 0.65rem;
	font-size: 0.78rem;
	cursor: pointer;
	line-height: 1.3;
}
.fus-chatbot-suggestion:hover { background: #c7d2fe; }

.fus-chatbot-pages {
	margin-top: 0.4rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.fus-chatbot-page {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 0.45rem 0.6rem;
	font-size: 0.82rem;
	line-height: 1.4;
}
.fus-chatbot-page-title { font-weight: 700; color: var(--fus-chatbot-color); text-decoration: none; }
.fus-chatbot-page-excerpt { color: #475569; margin-top: 0.15rem; }

.fus-chatbot-inquiry {
	margin-top: 0.5rem;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 0.6rem;
}
.fus-chatbot-inquiry--highlight {
	border-color: #93c5fd;
	background: #f8fafc;
	box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}
.fus-chatbot-inquiry-intro {
	font-size: 0.88rem;
	color: #475569;
	margin-bottom: 0.45rem;
	line-height: 1.45;
}
.fus-chatbot-inquiry--highlight .fus-chatbot-inquiry-intro {
	color: #1e40af;
	font-weight: 500;
}
.fus-chatbot-inquiry label {
	display: block;
	font-size: 0.78rem;
	font-weight: 600;
	margin: 0.35rem 0 0.15rem;
	color: #334155;
}
.fus-chatbot-inquiry input,
.fus-chatbot-inquiry textarea {
	width: 100%;
	padding: 0.4rem 0.5rem;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font: inherit;
	font-size: 0.85rem;
	box-sizing: border-box;
}
.fus-chatbot-inquiry-btn {
	margin-top: 0.5rem;
	background: var(--fus-chatbot-color);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 0.45rem 0.85rem;
	font-weight: 600;
	cursor: pointer;
}
.fus-chatbot-inquiry-open {
	margin-top: 0.45rem;
	background: #fff;
	color: var(--fus-chatbot-color);
	border: 1px solid var(--fus-chatbot-color);
	border-radius: 6px;
	padding: 0.35rem 0.7rem;
	font-weight: 600;
	font-size: 0.82rem;
	cursor: pointer;
}

.fus-chatbot-form {
	display: flex;
	align-items: flex-end;
	gap: 0.45rem;
	padding: 0.55rem 0.6rem;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}
.fus-chatbot-input {
	flex: 1 1 auto;
	padding: 0.55rem 0.7rem;
	border: 1px solid #cbd5e1;
	border-radius: 20px;
	font: inherit;
	font-size: 0.9rem;
	line-height: 1.4;
	resize: none;
	max-height: 120px;
	min-height: 40px;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fus-chatbot-input:focus {
	outline: none;
	border-color: var(--fus-chatbot-color);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--fus-chatbot-color) 22%, transparent);
}
.fus-chatbot-send {
	background: var(--fus-chatbot-color);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 42px;
	height: 42px;
	min-width: 42px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease;
}
.fus-chatbot-send:hover { transform: scale(1.05); }
.fus-chatbot-send:active { transform: scale(0.96); }

.fus-chatbot-footer {
	padding: 0.5rem 0.75rem 0.55rem;
	border-top: 1px solid #e2e8f0;
	background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
	color: #64748b;
	font-size: 0.7rem;
	line-height: 1.4;
	text-align: center;
	letter-spacing: 0.01em;
}
.fus-chatbot-footer strong {
	color: var(--fus-cb-primary, #2563eb);
	font-weight: 600;
}

.fus-chatbot-typing {
	background: #fff !important;
	border: 1px solid #e5e7eb !important;
	min-width: 52px;
	padding: 0.65rem 0.85rem !important;
}
.fus-chatbot-typing-dots {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	vertical-align: middle;
}
.fus-chatbot-typing-dots span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #94a3b8;
	animation: fus-chatbot-dot 1.2s ease-in-out infinite;
}
.fus-chatbot-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.fus-chatbot-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes fus-chatbot-dot {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
	40% { transform: translateY(-4px); opacity: 1; }
}

.fus-chatbot-notice {
	font-size: 0.8rem;
	color: #92400e;
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-radius: 8px;
	padding: 0.45rem 0.6rem;
	align-self: stretch;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.fus-chatbot-notice.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.fus-chatbot-notice--inline {
	margin-top: 0.55rem;
	align-self: auto;
	opacity: 1;
	transform: none;
}
.fus-chatbot-notice.fus-chatbot-thank.fus-chatbot-notice--inline {
	margin-top: 0.55rem;
}
.fus-chatbot-notice.fus-chatbot-thank {
	color: #166534;
	background: #ecfdf5;
	border-color: #86efac;
}

.fus-chatbot-repeat-lead {
	margin: 0 0 0.5rem;
	font-size: 0.88rem;
	color: #475569;
}
.fus-chatbot-repeat-tail {
	margin: 0.65rem 0 0;
	padding-top: 0.5rem;
	border-top: 1px dashed #cbd5e1;
	font-size: 0.85rem;
	color: #64748b;
}

.fus-chatbot-chips-title {
	font-size: 0.78rem;
	font-weight: 600;
	color: #475569;
	margin-top: 0.35rem;
}
.fus-chatbot-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.25rem; }
.fus-chatbot-chips--welcome {
	margin-top: 0.45rem;
}
.fus-chatbot-chip-more {
	background: #f8fafc !important;
	border-style: dashed !important;
	font-weight: 500 !important;
}
.fus-chatbot-chip {
	background: #fff;
	border: 1px solid var(--fus-chatbot-color);
	color: var(--fus-chatbot-color);
	border-radius: 999px;
	padding: 0.3rem 0.7rem;
	font-size: 0.78rem;
	cursor: pointer;
	font-weight: 600;
}
.fus-chatbot-chip:hover { background: #eff6ff; }

.fus-chatbot-feedback {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.45rem;
	font-size: 0.78rem;
}
.fus-chatbot-feedback-label { color: #64748b; margin-right: 0.25rem; }
.fus-chatbot-feedback-btn {
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	padding: 0.2rem 0.5rem;
	cursor: pointer;
	font-size: 0.78rem;
}
.fus-chatbot-feedback-btn:hover { background: #e2e8f0; }
.fus-chatbot-feedback-done { color: #15803d; font-weight: 600; }

.fus-chatbot-autocomplete {
	position: absolute;
	left: 0.55rem;
	right: 0.55rem;
	/* Über Form (~3.5rem) + Footer (zweizeilig ~3rem) positionieren, damit das Eingabefeld nicht verdeckt wird. */
	bottom: calc(3.5rem + 3rem + 0.5rem);
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
	max-height: 160px;
	overflow-y: auto;
	z-index: 5;
}
.fus-chatbot-ac-item {
	display: block;
	width: 100%;
	text-align: left;
	background: transparent;
	border: none;
	border-bottom: 1px solid #f1f5f9;
	padding: 0.45rem 0.6rem;
	font-size: 0.82rem;
	cursor: pointer;
}
.fus-chatbot-ac-item:hover { background: #f8fafc; }

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	border: 0;
}

/* ---------------------------------------------------------------
 * Teaser-Sprechblase ("👋 Hallo!") – erscheint einmal pro Session
 * über dem Launcher und macht sofort sichtbar, dass es ein Chat ist.
 * --------------------------------------------------------------- */
.fus-chatbot-teaser {
	position: absolute;
	bottom: 78px;
	right: 0;
	width: 240px;
	max-width: calc(100vw - 32px);
	background: #fff;
	color: #0f172a;
	border: 1px solid #e2e8f0;
	border-radius: 14px 14px 4px 14px;
	padding: 10px 30px 10px 12px;
	font-size: 0.88rem;
	line-height: 1.4;
	box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
	opacity: 0;
	transform: translateY(10px) scale(0.96);
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.fus-chatbot-teaser.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	cursor: pointer;
}
.fus-chatbot-teaser-close {
	position: absolute;
	top: 4px;
	right: 6px;
	background: none;
	border: none;
	color: #94a3b8;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
}
.fus-chatbot-teaser-close:hover { color: #475569; }
.fus-chatbot-teaser-text { padding-right: 4px; }

@media (max-width: 480px) {
	.fus-chatbot-launcher-label { display: none; }
	.fus-chatbot-panel {
		right: -10px;
		bottom: 70px;
		width: 92vw;
		max-height: min(78vh, calc(100dvh - 88px));
	}
	.fus-chatbot-teaser { width: calc(100vw - 40px); }
	.fus-chatbot-body {
		padding: 0.65rem 0.5rem 1.25rem;
	}
	.fus-chatbot-suggestions {
		max-height: 160px;
	}
	.fus-chatbot-autocomplete {
		bottom: calc(3.5rem + 3.2rem + 0.4rem);
		max-height: 140px;
		left: 0.4rem;
		right: 0.4rem;
	}
	.fus-chatbot-msg-col {
		max-width: calc(100% - 38px);
	}
	.fus-chatbot-chip {
		font-size: 0.72rem;
		padding: 0.35rem 0.6rem;
		line-height: 1.3;
		text-align: left;
		white-space: normal;
		max-width: 100%;
	}
	.fus-chatbot-chips--welcome {
		max-height: 132px;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding-right: 2px;
	}
	.fus-chatbot-chips-title {
		font-size: 0.72rem;
		margin-top: 0.5rem;
	}
	.fus-chatbot-notice--inline {
		font-size: 0.75rem;
		padding: 0.4rem 0.5rem;
	}
}
