.ai-human-chat-root {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 2147483640;
	pointer-events: none;
}

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

.ai-human-chat-launcher {
	display: flex;
	align-items: center;
	gap: 12px;
	pointer-events: auto;
	border: none;
	border-radius: 999px;
	padding: 12px 18px;
	font-size: 15px;
	font-weight: 600;
	color: #ffffff;
	background: linear-gradient(135deg, #4c6ef5, #6574cd);
	box-shadow: 0 14px 30px rgba(76, 110, 245, 0.32);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-human-chat-launcher:focus {
	outline: 3px solid rgba(255, 255, 255, 0.6);
	outline-offset: 2px;
}

.ai-human-chat-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 18px 34px rgba(76, 110, 245, 0.4);
}

.ai-human-chat-launcher__avatar {
	display: inline-flex;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background:
		radial-gradient(circle at 30% 30%, #ffffff, transparent 40%),
		radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.8), transparent 45%),
		linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent 60%);
	background-color: rgba(255, 255, 255, 0.18);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.21);
}

.ai-human-chat-overlay {
	position: fixed;
	bottom: 110px;
	right: 24px;
	width: 360px;
	max-width: calc(100% - 32px);
	border-radius: 24px;
	background: rgba(6, 10, 36, 0.82);
	backdrop-filter: blur(18px);
	box-shadow: 0 18px 44px rgba(12, 22, 74, 0.45);
	pointer-events: auto;
	color: #ffffff;
}

.ai-human-chat-overlay[hidden] {
	display: none !important;
}

.ai-human-chat-modal {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.ai-human-chat-modal__header,
.ai-human-chat-modal__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
}

.ai-human-chat-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
    color: #ffffff !important;
}

.ai-human-chat-modal__close {
	border: none;
	background: transparent;
	color: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.ai-human-chat-modal__body {
	position: relative;
	padding: 0 22px 18px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ai-human-chat-video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 18px;
	overflow: hidden;
	background: radial-gradient(circle at 50% 18%, rgba(46, 61, 150, 0.25), rgba(6, 10, 36, 0.9));
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-human-chat-video__remote,
.ai-human-chat-video__local {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-human-chat-video__remote video,
.ai-human-chat-video__local video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #02050f;
}

.ai-human-chat-video__local {
	inset: auto;
	right: 14px;
	bottom: 14px;
	width: 30%;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	overflow: hidden;
	border: 2px solid rgba(255, 255, 255, 0.45);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
	background: rgba(6, 10, 36, 0.75);
}

.ai-human-chat-video__local video {
	transform: scaleX(-1);
}

.ai-human-chat-waiting {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 28px 24px;
	text-align: center;
	background: rgba(2, 6, 24, 0.92);
}

.ai-human-chat-waiting[hidden] {
	display: none !important;
}

.ai-human-chat-spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 4px solid rgba(255, 255, 255, 0.25);
	border-top-color: #ffffff;
	animation: aiHumanChatSpin 1.05s linear infinite;
}

.ai-human-chat-waiting__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.95);
}

.ai-human-chat-waiting__subtitle {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.8);
}

.ai-human-chat-status {
	margin: 4px 0 0;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.78);
}

.ai-human-chat-status[hidden] {
	display: none !important;
}

.ai-human-chat-status[data-tone="error"] {
	color: #ffb4c6;
}

.ai-human-chat-status[data-tone="success"] {
	color: #9fffcf;
}

.ai-human-chat-controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 14px;
	margin: 16px 0 4px;
}

.ai-human-chat-control-button {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 10px 22px rgba(7, 12, 44, 0.3);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-human-chat-control-button svg {
	width: 22px;
	height: 22px;
}

.ai-human-chat-control-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 26px rgba(7, 12, 44, 0.35);
}

.ai-human-chat-control-button[data-enabled="false"] {
	background: rgba(255, 255, 255, 0.6);
}

.ai-human-chat-control-button[data-enabled="false"] svg {
	opacity: 0.6;
}

.ai-human-chat-control-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	box-shadow: none;
}

.ai-human-chat-control-button[data-variant="leave"] {
	background: linear-gradient(135deg, #ff665a, #ff3163);
	color: #ffffff;
}

@keyframes aiHumanChatSpin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

@media (max-width: 768px) {
	.ai-human-chat-root {
		right: 16px;
		left: 16px;
		bottom: 16px;
	}

	.ai-human-chat-launcher {
		width: 100%;
		justify-content: center;
	}

	.ai-human-chat-overlay {
		right: 16px;
		left: 16px;
		bottom: 96px;
		width: auto;
	}
}

@media (max-width: 540px) {
	.ai-human-chat-overlay {
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		width: auto;
		border-radius: 0;
		background: rgba(6, 10, 36, 0.9);
	}

	.ai-human-chat-launcher {
		max-width: 280px;
		margin: 0 auto;
	}
}
