:root {
	--alzor-primary: #77c720;
	--alzor-radius: 18px;
	--alzor-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.alzor-chatbot {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.alzor-chatbot.alzor-position-bottom-left {
	right: auto;
	left: 24px;
}

.alzor-chatbot-toggle {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--alzor-primary), #4e8f14);
	color: #fff;
	border: none;
	box-shadow: var(--alzor-shadow);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.alzor-chatbot-toggle:hover {
	transform: translateY(-3px) scale(1.04);
}

.alzor-chatbot-toggle .alzor-icon-close {
	display: none;
}

.alzor-chatbot.alzor-open .alzor-chatbot-toggle .alzor-icon-chat {
	display: none;
}

.alzor-chatbot.alzor-open .alzor-chatbot-toggle .alzor-icon-close {
	display: inline-flex;
}

.alzor-chatbot-window {
	position: absolute;
	bottom: 78px;
	right: 0;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 140px);
	background: #ffffff;
	border-radius: var(--alzor-radius);
	box-shadow: var(--alzor-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(24px) scale(0.96);
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.alzor-chatbot.alzor-position-bottom-left .alzor-chatbot-window {
	right: auto;
	left: 0;
}

.alzor-chatbot.alzor-open .alzor-chatbot-window {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: all;
}

.alzor-chatbot-header {
	background: linear-gradient(135deg, var(--alzor-primary), #4e8f14);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.alzor-chatbot-header-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

.alzor-chatbot-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 13px;
}

.alzor-chatbot-title {
	font-weight: 600;
	font-size: 15px;
}

.alzor-chatbot-subtitle {
	font-size: 12px;
	opacity: 0.85;
}

.alzor-chatbot-header-actions {
	display: flex;
	gap: 8px;
}

.alzor-chatbot-header-actions button {
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
}

.alzor-chatbot-header-actions button:hover {
	background: rgba(255, 255, 255, 0.3);
}

.alzor-chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #ffffff;
	scroll-behavior: smooth;
	min-height: 0;
}

.alzor-message {
	max-width: 80%;
	padding: 11px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.45;
	animation: alzorFadeUp 0.25s ease;
	white-space: pre-wrap;
	word-wrap: break-word;
}

@keyframes alzorFadeUp {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.alzor-message-user {
	align-self: flex-end;
	background: var(--alzor-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.alzor-message-bot,
.alzor-message-agent {
	align-self: flex-start;
	background: #ffffff;
	color: #000000;
	border: 1px solid #e5e9f0;
	border-bottom-left-radius: 4px;
}

.alzor-message-time {
	font-size: 10px;
	opacity: 0.6;
	margin-top: 4px;
	display: block;
}

.alzor-message a {
	color: inherit;
	text-decoration: underline;
	word-break: break-all;
}

.alzor-message-bot a,
.alzor-message-agent a {
	color: var(--alzor-primary);
}

.alzor-chatbot-typing {
	padding: 0 18px 8px;
	display: flex;
	gap: 4px;
	align-items: center;
	background: #ffffff;
	flex-shrink: 0;
}

.alzor-dot {
	width: 6px;
	height: 6px;
	background: #9aa4b2;
	border-radius: 50%;
	animation: alzorBounce 1.2s infinite ease-in-out;
}

.alzor-dot:nth-child(2) { animation-delay: 0.15s; }
.alzor-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes alzorBounce {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
	40% { transform: translateY(-5px); opacity: 1; }
}

.alzor-chatbot-error {
	background: #fef2f2;
	color: #b91c1c;
	padding: 10px 18px;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-shrink: 0;
}

.alzor-chatbot-error button {
	background: #b91c1c;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 4px 10px;
	font-size: 12px;
	cursor: pointer;
}

.alzor-chatbot-input-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #e5e9f0;
	background: #fff;
	flex-shrink: 0;
}

.alzor-chatbot-input-row textarea {
	flex: 1;
	resize: none;
	border: 1px solid #dbe1ea;
	border-radius: 14px;
	padding: 10px 14px;
	font-size: 14px;
	max-height: 100px;
	font-family: inherit;
	outline: none;
	color: #000000;
	transition: border-color 0.2s ease;
}

.alzor-chatbot-input-row textarea:focus {
	border-color: var(--alzor-primary);
}

.alzor-chatbot-input-row button {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--alzor-primary);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: transform 0.15s ease;
}

.alzor-chatbot-input-row button:hover {
	transform: scale(1.06);
}

.alzor-chatbot-input-row button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.alzor-chatbot-footer {
	text-align: center;
	font-size: 11px;
	color: #6b7280;
	padding: 6px 0 10px;
	background: #fff;
	flex-shrink: 0;
}

.alzor-chatbot.alzor-theme-dark .alzor-chatbot-window {
	background: #111827;
}

.alzor-chatbot.alzor-theme-dark .alzor-chatbot-messages {
	background: #0b1220;
}

.alzor-chatbot.alzor-theme-dark .alzor-message-bot,
.alzor-chatbot.alzor-theme-dark .alzor-message-agent {
	background: #1f2937;
	border-color: #2a3648;
	color: #e5e9f0;
}

.alzor-chatbot.alzor-theme-dark .alzor-chatbot-input-row {
	background: #111827;
	border-top-color: #2a3648;
}

.alzor-chatbot.alzor-theme-dark .alzor-chatbot-input-row textarea {
	background: #1f2937;
	border-color: #2a3648;
	color: #e5e9f0;
}

.alzor-chatbot.alzor-theme-dark .alzor-chatbot-footer {
	background: #111827;
	color: #6b7280;
}

.alzor-chatbot.alzor-theme-dark .alzor-chatbot-typing {
	background: #0b1220;
}

/* ============================================
   MOBILE FIX
   - Bottom-sheet chat window on small screens (page
     stays visible above the sheet), not full-screen.
   - height/top below are just a pre-JS fallback. The
     real height/top are set in PX by JS on every resize
     (visualViewport), because the CSS `vh` unit does not
     reliably shrink/restore with the on-screen keyboard
     on mobile browsers. See alzorPositionSheet() in JS.
   ============================================ */
@media (max-width: 480px) {
	.alzor-chatbot-toggle {
		width: 52px;
		height: 52px;
	}

	/* hide the round launcher button while chat is open so it can't overlap page content */
	.alzor-chatbot.alzor-open .alzor-chatbot-toggle {
		display: none;
	}

	.alzor-chatbot-window {
		position: fixed;
		left: 0;
		right: 0;
		bottom: auto;
		width: 100%;
		height: 65vh;
		top: 35vh;
		max-width: none;
		max-height: none;
		border-radius: 20px 20px 0 0;
		z-index: 999999;
		transition: opacity 0.25s ease, transform 0.25s ease, top 0.15s ease, height 0.15s ease;
	}
}