/* AO Chat-Suche – widget styles (mobile-first) */

#ao-chat {
	--ao-accent: #4a7c74;
	position: fixed;
	right: 16px;
	/* Raised so the button clears the cookie manager badge in the corner */
	bottom: 96px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.45;
}

/* Toggle button (min. 44px touch target) */
#ao-chat .ao-chat-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: var(--ao-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

#ao-chat .ao-chat-toggle:hover,
#ao-chat .ao-chat-toggle:focus-visible {
	transform: scale(1.06);
}

#ao-chat .ao-chat-toggle:focus-visible,
#ao-chat .ao-chat-close:focus-visible,
#ao-chat .ao-chat-submit:focus-visible,
#ao-chat .ao-chat-link:focus-visible {
	outline: 3px solid var(--ao-accent);
	outline-offset: 2px;
}

/* Panel – mobile: nearly full screen */
#ao-chat .ao-chat-panel {
	display: none;
	position: fixed;
	right: 8px;
	left: 8px;
	bottom: 164px;
	top: 10vh;
	flex-direction: column;
	background: #fff;
	color: #222;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

#ao-chat .ao-chat-panel.ao-open {
	display: flex;
}

/* Desktop: compact panel */
@media (min-width: 600px) {
	#ao-chat .ao-chat-panel {
		left: auto;
		right: 0;
		top: auto;
		width: 380px;
		height: min(560px, 75vh);
		position: absolute;
		bottom: 72px;
	}
}

/* Header */
#ao-chat .ao-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--ao-accent);
	color: #fff;
}

#ao-chat .ao-chat-title {
	font-weight: 600;
	font-size: 16px;
}

#ao-chat .ao-chat-close {
	width: 44px;
	height: 44px;
	margin: -8px -12px -8px 0;
	border: none;
	background: transparent;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	border-radius: 8px;
}

/* Messages */
#ao-chat .ao-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f6f6f4;
}

#ao-chat .ao-chat-bubble {
	max-width: 88%;
	padding: 10px 13px;
	border-radius: 12px;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

#ao-chat .ao-chat-bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e3e3df;
	border-bottom-left-radius: 4px;
}

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

#ao-chat .ao-chat-loading {
	opacity: 0.7;
	font-style: italic;
}

#ao-chat .ao-chat-note {
	margin: 0 0 8px;
	font-size: 13.5px;
	color: #555;
}

/* Result groups */
#ao-chat .ao-chat-group {
	margin: 10px 0 6px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ao-accent);
}

#ao-chat .ao-chat-group:first-child {
	margin-top: 0;
}

#ao-chat .ao-chat-results {
	list-style: none;
	margin: 0;
	padding: 0;
}

#ao-chat .ao-chat-results li {
	margin: 0 0 10px;
	padding: 0 0 10px;
	border-bottom: 1px solid #efefec;
}

#ao-chat .ao-chat-results li:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

#ao-chat .ao-chat-link {
	display: inline-block;
	min-height: 24px;
	padding: 2px 0;
	color: var(--ao-accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

#ao-chat .ao-chat-excerpt {
	margin: 3px 0 0;
	font-size: 13.5px;
	color: #555;
}

#ao-chat mark {
	background: #ffe9a8;
	padding: 0 1px;
	border-radius: 2px;
}

/* Input form */
#ao-chat .ao-chat-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	background: #fff;
	border-top: 1px solid #e3e3df;
}

#ao-chat .ao-chat-form input {
	flex: 1;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 10px;
	font-size: 16px; /* prevents iOS zoom on focus */
	background: #fff;
	color: #222;
}

#ao-chat .ao-chat-form input:focus {
	border-color: var(--ao-accent);
	outline: none;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--ao-accent) 30%, transparent);
}

#ao-chat .ao-chat-submit {
	min-height: 44px;
	min-width: 44px;
	padding: 8px 16px;
	border: none;
	border-radius: 10px;
	background: var(--ao-accent);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

#ao-chat .ao-chat-submit:hover {
	filter: brightness(1.08);
}

#ao-chat p {
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	#ao-chat .ao-chat-toggle {
		transition: none;
	}
}
