/* Eisbauernhof FAQ-Chat */
.ebh-chat {
	/* Markenfarbe = Astra-Themefarbe; Hex-Werte nur als Fallback */
	--ebh-brand: var(--ast-global-color-0, #046bd2);
	--ebh-brand-dark: var(--ast-global-color-1, #045cb4);
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
}

.ebh-chat__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: var(--ebh-brand);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

.ebh-chat__toggle:hover {
	transform: scale(1.08);
}

.ebh-chat__panel[hidden] {
	display: none;
}

.ebh-chat__panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: 340px;
	max-width: calc(100vw - 40px);
	max-height: min(560px, calc(100vh - 120px));
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #222;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

.ebh-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: var(--ebh-brand);
	color: #fff;
	font-weight: 600;
}

.ebh-chat__close {
	border: none;
	background: none;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
	margin: 0;
	min-height: 0;
}

.ebh-chat__messages {
	position: relative; /* Bezugspunkt für offsetTop beim Scrollen zur Antwort */
	flex: 1;
	min-height: 120px;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #f6f7fb;
}

.ebh-chat__msg {
	max-width: 88%;
	padding: 8px 12px;
	border-radius: 12px;
	overflow-wrap: break-word;
}

.ebh-chat__msg--bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e3e5ef;
	border-bottom-left-radius: 4px;
}

.ebh-chat__msg--user {
	align-self: flex-end;
	background: var(--ebh-brand);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.ebh-chat__msg a {
	color: var(--ebh-brand);
	text-decoration: underline;
}

.ebh-chat__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 12px;
	background: #fff;
	border-top: 1px solid #eceef5;
}

.ebh-chat__chip {
	border: 1px solid #cce1f6;
	border-color: color-mix(in srgb, var(--ebh-brand) 20%, #fff);
	background: #ebf3fb;
	background: color-mix(in srgb, var(--ebh-brand) 8%, #fff);
	color: #045cb4;
	color: var(--ebh-brand-dark);
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 13px;
	cursor: pointer;
}

.ebh-chat__chip:hover {
	background: #d9e9f8;
	background: color-mix(in srgb, var(--ebh-brand) 15%, #fff);
}

.ebh-chat__form {
	display: flex;
	gap: 6px;
	padding: 8px 12px;
	background: #fff;
}

.ebh-chat__input {
	flex: 1;
	border: 1px solid #cce1f6;
	border-color: color-mix(in srgb, var(--ebh-brand) 20%, #fff);
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 15px;
}

.ebh-chat__send {
	border: none;
	border-radius: 8px;
	background: var(--ebh-brand);
	color: #fff;
	padding: 8px 14px;
	cursor: pointer;
}

.ebh-chat__note {
	padding: 4px 12px 8px;
	background: #fff;
	color: #8a8fa3;
	font-size: 11px;
}

@media (max-width: 480px) {
	.ebh-chat {
		right: 12px;
		bottom: 12px;
	}

	.ebh-chat__panel {
		width: calc(100vw - 24px);
	}
}
