.zte-chat {
	position: fixed;
	bottom: 24px;
	z-index: 99990;
}

.zte-chat--right { right: 24px; }
.zte-chat--left  { left: 24px; }

/* Text-only pill button: no icon, label always visible */
.zte-chat__fab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	padding: 0 18px;
	border-radius: 999px;
	background: var(--zte-chat-accent, #2563eb);
	color: #fff;
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.zte-chat__fab:hover,
.zte-chat__fab:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.32);
	color: #fff;
}

.zte-chat__fab:active { transform: translateY(0); }

@media (max-width: 768px) {
	.zte-chat { bottom: 16px; }
	.zte-chat--right { right: 16px; }
	.zte-chat--left { left: 16px; }
	.zte-chat__fab { min-width: 44px; height: 44px; padding: 0 14px; font-size: 14px; }
}

/* Transparent overlay: no background colour, click-to-close only */
.zte-chat-overlay {
	position: fixed;
	inset: 0;
	z-index: 99990;
}

.zte-chat-overlay[hidden] { display: none; }

/* Chat drawer: fixed 393:852 aspect ratio (~2.17); height fills the viewport (868px cap), width derives from the ratio */
.zte-chat-drawer {
	position: fixed;
	bottom: 24px;
	width: auto;
	max-width: calc(100vw - 48px);
	height: min(868px, calc(100vh - 48px));
	height: min(868px, calc(100dvh - 48px));
	aspect-ratio: 393 / 852;
	display: flex;
	flex-direction: column;
	background: #fff;
	z-index: 100000;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
	overflow: hidden;
	transition: transform 0.28s ease;
}

.zte-chat-drawer--right {
	right: 24px;
	transform: translateX(calc(100% + 32px));
}

.zte-chat-drawer--left {
	left: 24px;
	transform: translateX(calc(-100% - 32px));
}

.zte-chat-drawer.is-open { transform: translateX(0); }
.zte-chat-drawer[hidden] { display: none; }

.zte-chat-drawer__header {
	display: flex;
	align-items: center;
	gap: 4px;
	height: 52px;
	padding: 0 12px 0 16px;
	border-bottom: 1px solid #e5e7eb;
	flex: none;
}

.zte-chat-drawer__title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 15px;
	font-weight: 600;
	color: #111827;
}

.zte-chat-drawer__open,
.zte-chat-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #4b5563;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.zte-chat-drawer__open:hover,
.zte-chat-drawer__close:hover {
	background: #f3f4f6;
	color: #111827;
}

.zte-chat-drawer__open svg,
.zte-chat-drawer__close svg {
	width: 18px;
	height: 18px;
}

.zte-chat-drawer__frame {
	flex: 1;
	width: 100%;
	border: 0;
	background: #fff;
}

body.zte-chat-no-scroll { overflow: hidden; }

.zte-chat-link {
	color: var(--zte-chat-accent, #2563eb);
	text-decoration: underline;
	cursor: pointer;
}

.zte-chat-link:hover { opacity: 0.85; }

/* Pre-chat consent dialog: centered, background / text colours configurable in admin */
.zte-consent {
	position: fixed;
	inset: 0;
	z-index: 100010;
	display: flex;
	align-items: center;
	justify-content: center;
}

.zte-consent[hidden] { display: none; }

.zte-consent__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.35);
}

.zte-consent__dialog {
	position: relative;
	width: min(560px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	overflow: auto;
	background: var(--zte-consent-bg, #1c1c1e);
	color: var(--zte-consent-fg, #fff);
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-color: color-mix(in srgb, var(--zte-consent-fg, #fff) 28%, transparent);
	border-radius: 12px;
	padding: 26px 28px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

.zte-consent__body {
	font-size: 14px;
	line-height: 1.9;
}

.zte-consent__body p { margin: 0 0 0.9em; }
.zte-consent__body p:last-child { margin-bottom: 0; }
.zte-consent__body a { color: inherit; text-decoration: underline; }

.zte-consent__divider {
	height: 1px;
	background: currentColor;
	opacity: 0.22;
	margin: 18px 0 16px;
}

.zte-consent__actions {
	display: flex;
	justify-content: center;
	gap: 14px;
}

.zte-consent__yes,
.zte-consent__no {
	min-width: 120px;
	height: 40px;
	border-radius: 8px;
	font-size: 15px;
	cursor: pointer;
}

.zte-consent__yes {
	background: var(--zte-chat-accent, #2563eb);
	color: #fff;
	border: 0;
}

.zte-consent__yes:hover { filter: brightness(1.08); }

.zte-consent__no {
	background: transparent;
	color: var(--zte-consent-fg, #fff);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-color: color-mix(in srgb, var(--zte-consent-fg, #fff) 40%, transparent);
}

.zte-consent__no:hover { background: rgba(255, 255, 255, 0.08); }

@media (max-width: 768px) {
	.zte-consent__dialog { padding: 20px 18px; }
	.zte-consent__actions { flex-direction: column; gap: 10px; }
	.zte-consent__yes,
	.zte-consent__no { width: 100%; }
}
