.faso-ai-chat {
	position: fixed;
	right: 22px;
	bottom: var(--faso-ai-chat-bottom-offset, 22px);
	z-index: 1000000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: #1f2937;
	pointer-events: none;
}

.faso-ai-chat--bottom_right {
	right: 22px;
	bottom: var(--faso-ai-chat-bottom-offset, 22px);
	left: auto;
	top: auto;
}

.faso-ai-chat--bottom_left {
	left: 22px;
	bottom: var(--faso-ai-chat-bottom-offset, 22px);
	right: auto;
	top: auto;
}

.faso-ai-chat--bottom_left .faso-ai-chat__launcher {
	left: 22px;
	right: auto;
}

.faso-ai-chat--bottom_left .faso-ai-chat__panel {
	left: 22px;
	right: auto;
}

.faso-ai-chat--top_right {
	right: 22px;
	top: 42px;
	left: auto;
	bottom: auto;
}

.faso-ai-chat--top_right .faso-ai-chat__launcher {
	top: calc(42px + env(safe-area-inset-top, 0px));
	bottom: auto;
}

.faso-ai-chat--top_right .faso-ai-chat__panel {
	top: calc(124px + env(safe-area-inset-top, 0px));
	bottom: auto;
}

.faso-ai-chat--top_left {
	left: 22px;
	top: 42px;
	right: auto;
	bottom: auto;
}

.faso-ai-chat--top_left .faso-ai-chat__launcher {
	left: 22px;
	right: auto;
	top: calc(42px + env(safe-area-inset-top, 0px));
	bottom: auto;
}

.faso-ai-chat--top_left .faso-ai-chat__panel {
	left: 22px;
	right: auto;
	top: calc(124px + env(safe-area-inset-top, 0px));
	bottom: auto;
}

.faso-ai-chat * {
	box-sizing: border-box;
}

.faso-ai-chat__launcher {
	position: fixed;
	right: 22px;
	bottom: calc(var(--faso-ai-chat-bottom-offset, 22px) + env(safe-area-inset-bottom, 0px));
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	width: 68px;
	height: 68px;
	border: 0;
	border-radius: 999px;
	background: #2f55e7;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	box-shadow: 0 14px 36px rgba(47, 85, 231, 0.35);
	cursor: pointer;
	pointer-events: auto;
	z-index: 1000001;
}

.faso-ai-chat__launcher-icon {
	display: block;
	font-size: 20px;
	line-height: 1;
}

.faso-ai-chat__panel {
	position: fixed;
	right: 22px;
	bottom: calc(var(--faso-ai-chat-bottom-offset, 22px) + 82px + env(safe-area-inset-bottom, 0px));
	display: none;
	width: min(390px, calc(100vw - 28px));
	max-height: min(620px, calc(100dvh - 126px));
	border: 1px solid #dbe3f0;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 18px 60px rgba(15, 23, 42, 0.22);
	overflow: hidden;
	pointer-events: auto;
	z-index: 1000002;
}

.faso-ai-chat[data-open="1"] .faso-ai-chat__panel {
	display: flex;
	flex-direction: column;
}

.faso-ai-chat[data-open="1"] .faso-ai-chat__launcher {
	display: none;
}

body.faso-ai-chat-open .hotline-phone-ring-wrap,
body.faso-ai-chat-open .hotline-phone-ring,
body.faso-ai-chat-open .float-contact,
body.faso-ai-chat-open .floating-contact,
body.faso-ai-chat-open .button-contact,
body.faso-ai-chat-open .call-now-button,
body.faso-ai-chat-open .zalo-container,
body.faso-ai-chat-open .zalo-chat-widget,
body.faso-ai-chat-open .fb_dialog {
	opacity: 0 !important;
	pointer-events: none !important;
}

.faso-ai-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 58px;
	padding: 16px 18px;
	background: #1f46d6;
	color: #fff;
}

.faso-ai-chat__header strong {
	font-size: 17px;
	line-height: 1.2;
}

.faso-ai-chat__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.faso-ai-chat__body {
	flex: 1;
	min-height: 0;
	padding: 16px;
	background: #f6f8fc;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.faso-ai-chat__form {
	display: grid;
	gap: 10px;
	margin-top: 14px;
	padding: 14px;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	background: #fff;
}

.faso-ai-chat__form input,
.faso-ai-chat__form textarea,
.faso-ai-chat__composer input {
	width: 100%;
	border: 1px solid #cbd5e1;
	border-radius: 9px;
	padding: 11px 12px;
	background: #fff;
	color: #111827;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	outline: none;
	box-shadow: none;
}

.faso-ai-chat__form input:focus,
.faso-ai-chat__form textarea:focus,
.faso-ai-chat__composer input:focus {
	border-color: #2f55e7;
	box-shadow: 0 0 0 3px rgba(47, 85, 231, 0.12);
}

.faso-ai-chat__status {
	min-height: 18px;
	color: #64748b;
	font-size: 12px;
	line-height: 1.45;
}

.faso-ai-chat__status.is-error {
	color: #b91c1c;
}

.faso-ai-chat__status.is-ok {
	color: #047857;
}

.faso-ai-chat__form button,
.faso-ai-chat__composer button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #2f55e7;
	border-radius: 9px;
	padding: 11px 14px;
	background: #2f55e7;
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 700;
	cursor: pointer;
	box-shadow: none;
}

.faso-ai-chat__messages {
	display: grid;
	gap: 10px;
}

.faso-ai-chat__bubble {
	max-width: 86%;
	margin-bottom: 10px;
	padding: 11px 13px;
	border-radius: 13px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.faso-ai-chat__bubble a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	overflow-wrap: anywhere;
	word-break: break-all;
}

.faso-ai-chat__bubble.is-bot a {
	color: #1f46d6;
}

.faso-ai-chat__bubble.is-bot {
	margin-right: auto;
	border-bottom-left-radius: 4px;
	background: #fff;
	border: 1px solid #e2e8f0;
}

.faso-ai-chat__bubble.is-greeting {
	display: block;
	width: 100%;
	max-width: 100%;
	text-align: left !important;
	text-align-last: left;
	white-space: normal !important;
}

.faso-ai-chat__bubble.is-user {
	margin-left: auto;
	border-bottom-right-radius: 4px;
	background: #2f55e7;
	color: #fff;
}

.faso-ai-chat__composer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px;
	padding: 12px;
	border-top: 1px solid #e2e8f0;
	background: #fff;
}

.faso-ai-chat__composer[hidden],
.faso-ai-chat__messages[hidden],
.faso-ai-chat__form[hidden] {
	display: none;
}

.faso-ai-chat.is-loading button {
	opacity: 0.72;
	pointer-events: none;
}

@media (max-width: 480px) {
	.faso-ai-chat {
		right: 0;
		bottom: 0;
	}

	.faso-ai-chat--bottom_right {
		right: 14px;
		bottom: var(--faso-ai-chat-bottom-offset, 14px);
	}

	.faso-ai-chat--bottom_left {
		left: 14px;
		bottom: var(--faso-ai-chat-bottom-offset, 14px);
	}

	.faso-ai-chat--top_right {
		right: 14px;
		top: 14px;
	}

	.faso-ai-chat--top_left {
		left: 14px;
		top: 14px;
	}

	.faso-ai-chat__panel {
		left: 12px;
		right: 12px;
		bottom: calc(var(--faso-ai-chat-bottom-offset, 14px) + 68px + env(safe-area-inset-bottom, 0px));
		width: auto;
		max-height: calc(100vh - 106px);
		max-height: calc(100dvh - 106px);
		border-radius: 16px;
	}

	.faso-ai-chat--bottom_right .faso-ai-chat__panel,
	.faso-ai-chat--bottom_left .faso-ai-chat__panel {
		left: 12px;
		right: 12px;
		top: auto;
		bottom: calc(var(--faso-ai-chat-bottom-offset, 14px) + 68px + env(safe-area-inset-bottom, 0px));
		width: auto;
	}

	.faso-ai-chat--top_right .faso-ai-chat__panel,
	.faso-ai-chat--top_left .faso-ai-chat__panel {
		left: 12px;
		right: 12px;
		top: calc(82px + env(safe-area-inset-top, 0px));
		bottom: auto;
		width: auto;
	}

	.faso-ai-chat__launcher {
		right: 14px;
		bottom: calc(var(--faso-ai-chat-bottom-offset, 14px) + env(safe-area-inset-bottom, 0px));
		width: 60px;
		height: 60px;
	}
}
