#haas-chatbot-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--haas-orange: #FF7425;
	--haas-orange-ink: #E6651A;
	--haas-dark: #0B0B0B;
	--haas-green: #2F8F4E;
	/* Bubble color/icon color are separate from --haas-dark on purpose, so an admin
	   can restyle just the bubble without also changing the header/buttons. Overridden
	   per-site via an inline <style> the plugin adds (see haas-chatbot.php). */
	--haas-bubble-bg: var(--haas-dark);
	--haas-bubble-icon: #ffffff;
}

.haas-chat-bubble {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--haas-bubble-bg);
	color: var(--haas-bubble-icon);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	padding: 0;
}

.haas-chat-bubble:hover {
	transform: scale(1.04);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.haas-chat-bubble svg {
	width: 26px;
	height: 26px;
	stroke: currentColor;
}

.haas-bubble-icon-img {
	width: 30px;
	height: 30px;
	object-fit: contain;
	pointer-events: none;
}

.haas-chat-panel {
	position: fixed;
	right: 20px;
	bottom: 92px;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	/* Smooth open/close: animate opacity + a slight rise, and only actually hide
	   (visibility + no pointer events) once the fade-out has finished. */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(10px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.haas-chat-panel.haas-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0) scale(1);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
}

@media (prefers-reduced-motion: reduce) {
	.haas-chat-panel,
	.haas-chat-panel.haas-open,
	.haas-chat-bubble {
		transition: none;
	}
}

/* --- Header: brand row always visible, welcome block only pre-conversation --- */

.haas-chat-header {
	background: var(--haas-dark);
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px 18px 20px;
}

.haas-header-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.haas-brand-mark {
	width: 8px;
	height: 8px;
	min-width: 8px;
	border-radius: 50%;
	background: var(--haas-orange);
}

.haas-brand-name {
	flex: 1;
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: -0.01em;
}

.haas-chat-close {
	width: 26px;
	height: 26px;
	min-width: 26px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}

.haas-chat-close:hover {
	background: rgba(255, 255, 255, 0.18);
}

.haas-chat-close svg {
	width: 13px;
	height: 13px;
}

.haas-header-welcome {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.haas-welcome-heading {
	color: #fff;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
}

.haas-welcome-subtext {
	color: #9CA3AF;
	font-size: 12.5px;
	line-height: 1.5;
}

/* --- Launcher: start card + quick topics --- */

.haas-launcher {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 22px;
	padding: 20px;
	background: #fff;
	overflow-y: auto;
}

.haas-label-sm {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: #6B7280;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 10px;
}

.haas-start-card {
	display: flex;
	flex-direction: column;
}

.haas-cta-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	background: var(--haas-orange);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 13px 16px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.haas-cta-btn:hover {
	background: var(--haas-orange-ink);
}

.haas-cta-btn svg {
	width: 17px;
	height: 17px;
}

.haas-topics {
	display: flex;
	flex-direction: column;
}

.haas-chip-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.haas-chip {
	border: 1px solid #E5E7EB;
	border-radius: 999px;
	padding: 9px 15px;
	font-size: 13px;
	font-weight: 500;
	color: #1F2937;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.12s ease, color 0.12s ease;
}

.haas-chip:hover {
	border-color: var(--haas-orange);
	color: var(--haas-orange);
}

/* --- Conversation view --- */

.haas-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #F9FAFB;
}

.haas-msg {
	max-width: 82%;
	padding: 10px 14px;
	font-size: 13.5px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.haas-msg-user {
	align-self: flex-end;
	background: var(--haas-orange);
	color: #fff;
	border-radius: 16px 16px 4px 16px;
}

.haas-msg-bot {
	align-self: flex-start;
	background: #F3F4F6;
	color: #1F2937;
	border-radius: 16px 16px 16px 4px;
}

.haas-typing-indicator {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 13px 15px;
}

.haas-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9CA3AF;
	animation: haas-bounce 1.2s infinite ease-in-out both;
}

.haas-dot:nth-child(1) { animation-delay: -0.24s; }
.haas-dot:nth-child(2) { animation-delay: -0.12s; }
.haas-dot:nth-child(3) { animation-delay: 0s; }

@keyframes haas-bounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
	40% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.haas-dot {
		animation: none;
		opacity: 0.7;
	}
}

.haas-book-btn {
	align-self: flex-start;
	background: var(--haas-orange);
	color: #fff;
	text-decoration: none;
	padding: 10px 16px;
	border-radius: 10px;
	font-size: 13.5px;
	font-weight: 600;
}

.haas-chat-input-row {
	display: flex;
	align-items: center;
	border-top: 1px solid #E5E7EB;
	padding: 10px 11px;
	gap: 8px;
	background: #fff;
}

.haas-chat-input {
	flex: 1;
	border: 1px solid #D1D5DB;
	border-radius: 999px;
	padding: 10px 15px;
	font-size: 13.5px;
	font-family: inherit;
	color: #111827;
}

.haas-chat-input:focus {
	outline: none;
	border-color: var(--haas-orange);
}

.haas-chat-send {
	width: 38px;
	height: 38px;
	min-width: 38px;
	border-radius: 50%;
	background: var(--haas-orange);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.haas-chat-send:hover {
	background: var(--haas-orange-ink);
}

.haas-chat-send svg {
	width: 16px;
	height: 16px;
}

@media (max-width: 480px) {
	.haas-chat-panel {
		right: 10px;
		left: 10px;
		width: auto;
	}
}
