/* ELCH-Chat – Widget-Styles (präfixiert, robust gegen Theme-/Elementor-Styles) */
.elch-chat {
	--elch-color: #1d4f91;
	--elch-bg: #ffffff;
	--elch-soft: #f2f5fa;
	--elch-text: #1d2330;
	--elch-muted: #5f6b7a;
	--elch-radius: 16px;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--elch-text);
}
.elch-chat *, .elch-chat *::before, .elch-chat *::after { box-sizing: border-box; }
.elch-chat [hidden] { display: none !important; }
.elch-chat button { font: inherit; letter-spacing: normal; text-transform: none; margin: 0; box-shadow: none; min-height: 0; line-height: 1.3; }
.elch-chat svg { width: 100%; height: 100%; display: block; }

.elch-chat .elch-chat__launcher {
	width: 60px; height: 60px; padding: 15px;
	border: 0; border-radius: 50%;
	background: var(--elch-color); color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
	transition: transform .15s ease;
	float: right;
}
.elch-chat .elch-chat__launcher:hover { transform: scale(1.06); }
.elch-chat .elch-chat__launcher:focus-visible,
.elch-chat button:focus-visible,
.elch-chat textarea:focus-visible,
.elch-chat input:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.elch-chat.is-open .elch-chat__launcher { display: none; }

.elch-chat .elch-chat__panel {
	width: 370px; height: min(600px, calc(100vh - 40px));
	background: var(--elch-bg);
	border-radius: var(--elch-radius);
	box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
	display: flex; flex-direction: column;
	overflow: hidden;
}

.elch-chat .elch-chat__header {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 12px 12px 14px;
	background: var(--elch-color); color: #fff;
}
.elch-chat .elch-chat__avatar { width: 36px; height: 36px; border-radius: 50%; background: #fff; padding: 2px; flex: none; margin: 0; }
.elch-chat .elch-chat__title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.elch-chat .elch-chat__title strong { font-size: 16px; color: #fff; }
.elch-chat .elch-chat__title span { font-size: 12px; opacity: .85; }
.elch-chat .elch-chat__close { width: 34px; height: 34px; padding: 8px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.elch-chat .elch-chat__close:hover { background: rgba(255, 255, 255, .15); }

.elch-chat .elch-chat__log {
	flex: 1; overflow-y: auto; padding: 14px;
	display: flex; flex-direction: column; gap: 8px;
	background: var(--elch-soft);
	overscroll-behavior: contain;
}
.elch-chat .elch-chat__msg {
	max-width: 85%; padding: 9px 12px;
	border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere;
}
.elch-chat .elch-chat__msg p { margin: 0 0 6px; padding: 0; font-size: inherit; line-height: inherit; color: inherit; }
.elch-chat .elch-chat__msg p:last-child { margin-bottom: 0; }
.elch-chat .elch-chat__msg ul { margin: 4px 0 6px; padding-left: 18px; }
.elch-chat .elch-chat__msg li { margin: 2px 0; }
.elch-chat .elch-chat__msg a { color: var(--elch-color); text-decoration: underline; }
.elch-chat .elch-chat__msg--assistant { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.elch-chat .elch-chat__msg--user { align-self: flex-end; background: var(--elch-color); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.elch-chat .elch-chat__msg--system { align-self: center; background: transparent; color: var(--elch-muted); font-size: 13px; text-align: center; max-width: 95%; }

.elch-chat .elch-chat__typing { display: flex; gap: 4px; padding: 12px 14px; }
.elch-chat .elch-chat__typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5b4; animation: elch-dot 1.2s infinite ease-in-out; }
.elch-chat .elch-chat__typing i:nth-child(2) { animation-delay: .15s; }
.elch-chat .elch-chat__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes elch-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.elch-chat .elch-chat__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; background: var(--elch-soft); }
.elch-chat .elch-chat__chip {
	padding: 6px 12px; border: 1px solid var(--elch-color); border-radius: 999px;
	background: #fff; color: var(--elch-color); font-size: 13px; cursor: pointer;
}
.elch-chat .elch-chat__chip:hover { background: var(--elch-color); color: #fff; }

.elch-chat .elch-chat__notice { padding: 8px 14px; font-size: 12px; color: var(--elch-muted); background: var(--elch-soft); }
.elch-chat .elch-chat__notice a { color: inherit; text-decoration: underline; }
.elch-chat .elch-chat__turnstile:empty { display: none; }
.elch-chat .elch-chat__turnstile { padding: 0 14px; background: var(--elch-soft); }

.elch-chat .elch-chat__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3e8ef; position: relative; background: #fff; }
.elch-chat .elch-chat__input {
	flex: 1; resize: none; min-height: 40px; max-height: 120px; margin: 0;
	padding: 9px 12px; border: 1px solid #cdd5df; border-radius: 12px;
	font: inherit; color: var(--elch-text); background: #fff; line-height: 1.4;
}
.elch-chat .elch-chat__counter { position: absolute; right: 64px; top: -18px; font-size: 11px; color: var(--elch-muted); }
.elch-chat .elch-chat__send { width: 40px; height: 40px; padding: 9px; border: 0; border-radius: 50%; background: var(--elch-color); color: #fff; cursor: pointer; flex: none; }
.elch-chat .elch-chat__send:disabled { opacity: .5; cursor: wait; }
.elch-chat .elch-chat__human { border: 0; background: #fff; color: var(--elch-muted); font-size: 12px; text-decoration: underline; padding: 0 12px 10px; cursor: pointer; text-align: center; }

.elch-chat .elch-chat__offer { align-self: flex-start; }
.elch-chat .elch-chat__btn {
	padding: 8px 14px; border: 0; border-radius: 10px;
	background: var(--elch-color); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.elch-chat .elch-chat__btn:disabled { opacity: .6; cursor: wait; }

.elch-chat .elch-chat__handoff {
	align-self: stretch; background: #fff; border-radius: 12px; padding: 12px;
	display: flex; flex-direction: column; gap: 4px; border: 1px solid #dfe5ee; margin: 0;
}
.elch-chat .elch-chat__handoff-intro { margin: 0 0 6px; font-size: 13px; color: var(--elch-muted); }
.elch-chat .elch-chat__handoff label { font-size: 13px; font-weight: 600; margin: 4px 0 0; color: var(--elch-text); display: block; }
.elch-chat .elch-chat__handoff input[type=text],
.elch-chat .elch-chat__handoff input[type=email],
.elch-chat .elch-chat__handoff textarea {
	width: 100%; padding: 8px 10px; margin: 0; border: 1px solid #cdd5df; border-radius: 8px;
	font: inherit; font-size: 14px; color: var(--elch-text); background: #fff;
}
.elch-chat .elch-chat__handoff .elch-chat__consent { display: flex; gap: 6px; align-items: flex-start; font-weight: 400; font-size: 12px; color: var(--elch-muted); margin: 8px 0 4px; }
.elch-chat .elch-chat__consent input { margin: 2px 0 0; flex: none; width: auto; }
.elch-chat .elch-chat__consent a { color: inherit; text-decoration: underline; }
.elch-chat .elch-chat__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.elch-chat .elch-chat__err { color: #b42318; font-size: 13px; }
.elch-chat .elch-chat__err:empty { display: none; }
.elch-chat .elch-chat__handoff .elch-chat__btn { margin-top: 6px; align-self: flex-start; }

@media (max-width: 480px) {
	.elch-chat { right: 12px; bottom: 12px; }
	.elch-chat.is-open { right: 0; bottom: 0; left: 0; top: 0; }
	.elch-chat .elch-chat__panel { width: 100%; height: 100%; border-radius: 0; }
	.elch-chat .elch-chat__input { font-size: 16px; } /* verhindert Zoom auf iOS */
}
@media (prefers-reduced-motion: reduce) {
	.elch-chat * { animation: none !important; transition: none !important; }
}
@media print { .elch-chat { display: none !important; } }
