/* ==========================================================================
   Website-Chatbot (unten rechts) - gehoert zu chat-widget.js
   Alle Klassen beginnen mit "smc-", damit nichts mit dem Theme kollidiert.
   Das Theme setzt auf a/button/p/span/svg eine globale Transition und
   entfernt Fokusrahmen - beides wird hier fuer das Widget zurueckgenommen.
   ========================================================================== */

.smc-root {
	--smc-primary: var(--tj-color-theme-primary, #0075ff);
	--smc-primary-dark: #0060d6;
	--smc-gradient: linear-gradient(135deg, #2491ff 0%, #0068e8 100%);
	--smc-navy: var(--tj-color-heading-primary, #051229);
	--smc-navy-2: #0b2a5e;
	--smc-text: #1d2939;
	--smc-muted: #6b7686;
	--smc-line: #e7ebf1;
	--smc-soft: #f4f6fa;
	--smc-error-bg: #fff5f3;
	--smc-error-line: #f8d3cb;
	--smc-error-text: #a0291a;
	font-family: var(--tj-ff-body, "Lato", sans-serif);
	color: var(--smc-text);
}

.smc-root *,
.smc-root *::before,
.smc-root *::after {
	box-sizing: border-box;
	-webkit-transition: none;
	transition: none;
}

.smc-root :focus-visible {
	outline: 2px solid var(--smc-primary);
	outline-offset: 2px;
}

.smc-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.smc-root svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.smc-root img {
	display: block;
	max-width: 100%;
}

/* --- Knopf unten rechts --------------------------------------------------- */

.smc-launcher {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 9990;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--smc-gradient);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 12px 30px rgba(0, 104, 232, 0.38), 0 3px 8px rgba(5, 18, 41, 0.18);
	-webkit-transition: transform 0.25s ease, box-shadow 0.25s ease;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.smc-launcher:hover {
	transform: translateY(-3px) scale(1.03);
	box-shadow: 0 16px 36px rgba(0, 104, 232, 0.45), 0 4px 10px rgba(5, 18, 41, 0.2);
}

/* Zwei sanfte Wellen beim ersten Erscheinen, danach Ruhe. */
.smc-launcher::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid rgba(0, 117, 255, 0.55);
	opacity: 0;
	pointer-events: none;
	-webkit-animation: smc-ping 1.8s ease-out 1.2s 2;
	animation: smc-ping 1.8s ease-out 1.2s 2;
}

.smc-open .smc-launcher::after {
	-webkit-animation: none;
	animation: none;
}

@-webkit-keyframes smc-ping {
	0% { transform: scale(1); opacity: 0.9; }
	100% { transform: scale(1.55); opacity: 0; }
}

@keyframes smc-ping {
	0% { transform: scale(1); opacity: 0.9; }
	100% { transform: scale(1.55); opacity: 0; }
}

.smc-launcher-icon {
	position: absolute;
	width: 28px;
	height: 28px;
	-webkit-transition: opacity 0.2s ease, transform 0.25s ease;
	transition: opacity 0.2s ease, transform 0.25s ease;
}

.smc-launcher .smc-icon-close {
	opacity: 0;
	transform: rotate(-90deg) scale(0.6);
}

.smc-open .smc-launcher .smc-icon-open {
	opacity: 0;
	transform: rotate(90deg) scale(0.6);
}

.smc-open .smc-launcher .smc-icon-close {
	opacity: 1;
	transform: none;
}

/* --- Begruessungs-Sprechblase neben dem Knopf ----------------------------- */

.smc-teaser {
	position: fixed;
	right: 24px;
	bottom: 100px;
	z-index: 9990;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 290px;
	padding: 14px 14px 14px 14px;
	background: #fff;
	border: 1px solid var(--smc-line);
	border-radius: 18px 18px 6px 18px;
	box-shadow: 0 18px 44px rgba(5, 18, 41, 0.18);
	cursor: pointer;
	visibility: hidden;
	opacity: 0;
	transform: translateY(10px);
	-webkit-transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

.smc-teaser.is-visible {
	visibility: visible;
	opacity: 1;
	transform: none;
	-webkit-transition: opacity 0.3s ease, transform 0.3s ease;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.smc-open .smc-teaser {
	display: none;
}

.smc-teaser-logo {
	flex: none;
	width: 34px;
	height: 34px;
	padding: 6px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--smc-line);
}

.smc-root .smc-teaser-text {
	flex: 1;
	margin: 0;
	padding-right: 14px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--smc-text);
}

.smc-root .smc-teaser-text strong {
	display: block;
	margin-bottom: 2px;
	font-family: var(--tj-ff-heading, "Libre Franklin", sans-serif);
	font-size: 14.5px;
	color: var(--smc-navy);
}

.smc-root .smc-teaser-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	padding: 5px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #98a2b3;
	cursor: pointer;
}

.smc-root .smc-teaser-close:hover {
	background: var(--smc-soft);
	color: var(--smc-text);
}

/* --- Fenster --------------------------------------------------------------- */

.smc-panel {
	position: fixed;
	right: 24px;
	bottom: 100px;
	z-index: 9991;
	display: flex;
	flex-direction: column;
	width: 392px;
	height: min(640px, calc(100vh - 124px));
	overflow: hidden;
	background: #fff;
	border-radius: 22px;
	box-shadow: 0 30px 80px rgba(5, 18, 41, 0.25), 0 4px 14px rgba(5, 18, 41, 0.08);
	visibility: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.97);
	transform-origin: bottom right;
	-webkit-transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}

.smc-open .smc-panel {
	visibility: visible;
	opacity: 1;
	transform: none;
	-webkit-transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
	transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

/* Kopf */

.smc-head {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 14px 18px 18px;
	overflow: hidden;
	background: linear-gradient(135deg, var(--smc-navy) 0%, var(--smc-navy-2) 100%);
	color: #fff;
}

.smc-head::before {
	content: "";
	position: absolute;
	top: -70px;
	right: -40px;
	width: 200px;
	height: 200px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(0, 117, 255, 0.45) 0%, rgba(0, 117, 255, 0) 70%);
	pointer-events: none;
}

.smc-head > * {
	position: relative;
}

.smc-avatar {
	flex: none;
	position: relative;
	width: 46px;
	height: 46px;
	padding: 8px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.smc-avatar::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 1px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #22c55e;
	border: 2px solid var(--smc-navy);
}

.smc-head-text {
	flex: 1;
	min-width: 0;
}

.smc-root .smc-title {
	margin: 0;
	font-family: var(--tj-ff-heading, "Libre Franklin", sans-serif);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: #fff;
}

.smc-root .smc-sub {
	margin: 3px 0 0;
	font-size: 12.5px;
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.7);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.smc-root .smc-head-btn {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 9px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: rgba(255, 255, 255, 0.78);
	cursor: pointer;
	-webkit-transition: background-color 0.15s ease, color 0.15s ease;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.smc-root .smc-head-btn:hover {
	background: rgba(255, 255, 255, 0.13);
	color: #fff;
}

/* Verlauf */

.smc-log {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px 16px 14px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--smc-soft);
	scrollbar-width: thin;
	scrollbar-color: #cdd5e0 transparent;
}

.smc-log::-webkit-scrollbar {
	width: 6px;
}

.smc-log::-webkit-scrollbar-thumb {
	background: #cdd5e0;
	border-radius: 3px;
}

.smc-msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	-webkit-animation: smc-in 0.28s ease both;
	animation: smc-in 0.28s ease both;
}

@-webkit-keyframes smc-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@keyframes smc-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

.smc-msg-user {
	justify-content: flex-end;
}

.smc-msg-avatar {
	flex: none;
	width: 30px;
	height: 30px;
	padding: 5px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--smc-line);
}

.smc-bubble {
	max-width: 82%;
	padding: 11px 15px;
	font-size: 14.5px;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	border-radius: 18px;
}

.smc-msg-bot .smc-bubble {
	background: #fff;
	border: 1px solid var(--smc-line);
	border-bottom-left-radius: 6px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
	color: var(--smc-text);
}

.smc-msg-user .smc-bubble {
	background: var(--smc-gradient);
	border-bottom-right-radius: 6px;
	box-shadow: 0 6px 16px rgba(0, 104, 232, 0.2);
	color: #fff;
}

/* KI-Antwort: Sprechblase plus Hinweis darunter */
.smc-stack {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	max-width: 82%;
}

.smc-stack .smc-bubble {
	max-width: 100%;
}

.smc-root .smc-ai-label {
	display: flex;
	align-items: center;
	gap: 4px;
	height: 16px;
	margin: 6px 0 0 6px;
	font-size: 11px;
	line-height: 16px;
	color: #8a94a6;
	white-space: nowrap;
}

.smc-root .smc-ai-label svg {
	flex: none;
	width: 12px;
	height: 12px;
	color: var(--smc-primary);
}

/* Avatar auf Hoehe der Sprechblase halten, nicht auf Hoehe des Hinweises */
.smc-msg-ai .smc-msg-avatar {
	margin-bottom: 22px;
}

.smc-msg-error .smc-bubble {
	background: var(--smc-error-bg);
	border-color: var(--smc-error-line);
	color: var(--smc-error-text);
	box-shadow: none;
}

.smc-root .smc-bubble a,
.smc-root .smc-bubble a:hover,
.smc-root .smc-bubble a:focus {
	color: var(--smc-primary);
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.smc-root .smc-msg-error .smc-bubble a {
	color: inherit;
}

/* Vorschlaege */

.smc-suggest {
	padding-left: 38px;
	-webkit-animation: smc-in 0.28s ease 0.1s both;
	animation: smc-in 0.28s ease 0.1s both;
}

.smc-root .smc-suggest-label {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #98a2b3;
}

.smc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.smc-root .smc-chip {
	padding: 8px 14px;
	border: 1px solid #cfe2ff;
	border-radius: 999px;
	background: #fff;
	color: var(--smc-primary-dark);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
	-webkit-transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.smc-root .smc-chip:hover {
	background: #eef5ff;
	border-color: var(--smc-primary);
	transform: translateY(-1px);
}

/* Tipp-Anzeige */

.smc-typing .smc-bubble {
	display: flex;
	gap: 5px;
	padding: 15px 16px;
}

.smc-typing .smc-bubble span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #98a2b3;
	-webkit-animation: smc-bounce 1.2s infinite ease-in-out;
	animation: smc-bounce 1.2s infinite ease-in-out;
}

.smc-typing .smc-bubble span:nth-child(2) {
	-webkit-animation-delay: 0.15s;
	animation-delay: 0.15s;
}

.smc-typing .smc-bubble span:nth-child(3) {
	-webkit-animation-delay: 0.3s;
	animation-delay: 0.3s;
}

@-webkit-keyframes smc-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
	30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes smc-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* --- Eingabe --------------------------------------------------------------- */

.smc-composer {
	padding: 12px 14px 0;
	background: #fff;
	border-top: 1px solid var(--smc-line);
}

.smc-form {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	margin: 0;
	padding: 5px 5px 5px 16px;
	background: var(--smc-soft);
	border: 1px solid #e0e6ee;
	border-radius: 24px;
	-webkit-transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.smc-form:focus-within {
	background: #fff;
	border-color: var(--smc-primary);
	box-shadow: 0 0 0 4px rgba(0, 117, 255, 0.12);
}

.smc-root .smc-input {
	flex: 1;
	width: auto;
	min-width: 0;
	height: 38px;
	max-height: 120px;
	margin: 0;
	padding: 9px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--smc-text);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.35;
	resize: none;
	overflow-y: auto;
	box-shadow: none;
}

.smc-root .smc-input:focus {
	outline: 0;
	box-shadow: none;
}

.smc-root .smc-input::placeholder {
	color: #98a2b3;
	font-size: 15px;
	opacity: 1;
}

.smc-root .smc-send {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 10px 11px 10px 9px;
	border: 0;
	border-radius: 50%;
	background: var(--smc-gradient);
	color: #fff;
	cursor: pointer;
	-webkit-transition: transform 0.15s ease, opacity 0.15s ease;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.smc-root .smc-send:hover {
	transform: scale(1.06);
}

.smc-root .smc-send:disabled {
	background: #cfd6e0;
	cursor: default;
	transform: none;
}

.smc-root .smc-note {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px 8px;
	margin: 0;
	padding: 8px 16px 12px;
	background: #fff;
	font-size: 11px;
	line-height: 1.45;
	text-align: center;
	color: var(--smc-muted);
}

.smc-root .smc-note a,
.smc-root .smc-note a:hover {
	color: inherit;
	text-decoration: underline;
}

.smc-count {
	flex: none;
	font-variant-numeric: tabular-nums;
}

.smc-count:empty {
	display: none;
}

.smc-count.is-limit {
	color: var(--smc-error-text);
	font-weight: 700;
}

/* --- Kleine Bildschirme: Fenster ueber die ganze Flaeche ------------------ */

@media (max-width: 575px) {
	.smc-launcher {
		right: 16px;
		bottom: 16px;
		width: 58px;
		height: 58px;
	}

	.smc-teaser {
		right: 16px;
		bottom: 88px;
		width: auto;
		max-width: calc(100vw - 32px);
	}

	.smc-panel {
		inset: 0;
		width: auto;
		height: 100%;
		border-radius: 0;
		transform: translateY(24px);
	}

	.smc-head {
		padding-top: calc(16px + env(safe-area-inset-top, 0px));
	}

	.smc-root .smc-note {
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}

	.smc-open .smc-launcher {
		display: none;
	}

	/* Solange der Chat die ganze Flaeche belegt: Seite dahinter nicht
	   mitscrollen und den Cookie-Knopf (liegt sonst ueber der Eingabe)
	   ausblenden. Banner und Einstellungsdialog bleiben darueber. */
	.smc-chat-open body {
		overflow: hidden;
	}

	.smc-chat-open .cc-relaunch {
		display: none;
	}

	/* 16px verhindert, dass iOS beim Tippen ins Feld hineinzoomt. */
	.smc-root .smc-input,
	.smc-root .smc-input::placeholder {
		font-size: 16px;
	}
}

/* Der "GO TOP"-Knopf des Themes sitzt auf kleineren Bildschirmen sonst
   genau hinter dem Chat-Knopf. */
@media (max-width: 1199px) {
	.back-to-top-wrapper.back-to-top-btn-show {
		bottom: 96px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.smc-root *,
	.smc-root *::after,
	.smc-launcher,
	.smc-teaser,
	.smc-panel,
	.smc-open .smc-panel {
		-webkit-animation: none !important;
		animation: none !important;
		-webkit-transition: none !important;
		transition: none !important;
	}
}

@media print {
	.smc-root {
		display: none;
	}
}
