.siteai-widget,
.siteai-widget * {
	box-sizing: border-box;
}

.siteai-widget {
	--siteai-primary: #3157d5;
	--siteai-primary-dark: #2446bb;
	--siteai-background: #fff;
	--siteai-text: #20283a;
	--siteai-muted: #778197;
	--siteai-border: #e7eaf1;
	--siteai-radius: 20px;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--siteai-text);
}

.siteai-widget button,
.siteai-widget textarea {
	margin: 0;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	text-transform: none;
}

.siteai-widget .siteai-panel {
	position: fixed;
	z-index: 999999;
	right: 24px;
	bottom: 104px;
	display: flex;
	width: min(410px, calc(100vw - 40px));
	height: min(640px, calc(100vh - 136px));
	height: min(640px, calc(100dvh - 136px));
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgb(32 40 58 / 8%);
	border-radius: var(--siteai-radius);
	background: var(--siteai-background);
	box-shadow: 0 24px 70px rgb(21 32 61 / 22%), 0 4px 14px rgb(21 32 61 / 8%);
	transform-origin: bottom right;
	animation: siteai-panel-in 180ms ease-out;
}

.siteai-widget .siteai-panel[hidden] {
	display: none;
}

@keyframes siteai-panel-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.siteai-widget .siteai-header {
	position: relative;
	display: flex;
	min-height: 82px;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	background: linear-gradient(115deg, #284bbd 0%, #3963e6 100%);
	color: #fff;
}

.siteai-widget .siteai-brand-mark {
	display: grid;
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	place-items: center;
	border: 1px solid rgb(255 255 255 / 22%);
	border-radius: 14px;
	background: rgb(255 255 255 / 14%);
}

.siteai-widget .siteai-brand-mark svg {
	width: 25px;
	height: 25px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
}

.siteai-widget .siteai-heading {
	display: grid;
	min-width: 0;
	flex: 1;
	gap: 5px;
}

.siteai-widget .siteai-title {
	overflow: hidden;
	font-size: 15px;
	font-weight: 650;
	letter-spacing: -.01em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.siteai-widget .siteai-subtitle {
	display: flex;
	align-items: center;
	gap: 6px;
	color: rgb(255 255 255 / 78%);
	font-size: 12px;
	font-weight: 450;
}

.siteai-widget .siteai-subtitle i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #75e2ad;
	box-shadow: 0 0 0 3px rgb(117 226 173 / 16%);
}

.siteai-widget .siteai-controls {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 3px;
}

.siteai-widget button.siteai-control {
	display: grid;
	width: 34px;
	height: 34px;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: rgb(255 255 255 / 88%);
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}

.siteai-widget .siteai-control svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.siteai-widget .siteai-control:hover {
	background: rgb(255 255 255 / 15%);
	color: #fff;
}

.siteai-widget .siteai-messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 14px;
	overflow-y: auto;
	padding: 22px 18px 18px;
	scrollbar-color: #c9d0df transparent;
	scrollbar-width: thin;
}

.siteai-widget .siteai-message {
	max-width: 86%;
	padding: 12px 15px;
	border-radius: 17px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.55;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.siteai-widget .siteai-message-assistant {
	align-self: flex-start;
	border: 1px solid var(--siteai-border);
	border-bottom-left-radius: 6px;
	background: #f5f7fb;
	color: #30394b;
}

.siteai-widget .siteai-message-user {
	align-self: flex-end;
	border-bottom-right-radius: 6px;
	background: var(--siteai-primary);
	color: #fff;
	box-shadow: 0 4px 10px rgb(49 87 213 / 14%);
}

.siteai-widget .siteai-status {
	display: none;
	min-height: 0;
	padding: 0 20px 8px;
	color: var(--siteai-muted);
	font-size: 12px;
}

.siteai-widget .siteai-status[data-active="true"] {
	display: flex;
	align-items: center;
	gap: 9px;
}

.siteai-widget .siteai-status[data-active="true"]::before {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--siteai-primary);
	box-shadow: 10px 0 0 #a8b8ef, 20px 0 0 #d4dcf5;
	content: "";
	margin-right: 20px;
	animation: siteai-typing 900ms ease-in-out infinite alternate;
}

@keyframes siteai-typing {
	to {
		opacity: .45;
	}
}

.siteai-widget .siteai-form {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	margin: 0;
	padding: 14px 16px 10px;
	border-top: 1px solid #edf0f5;
	background: #fff;
}

.siteai-widget textarea {
	display: block;
	max-height: 112px;
	min-height: 48px;
	flex: 1;
	resize: none;
	padding: 13px 14px;
	border: 1px solid #e1e6ef;
	border-radius: 14px;
	outline: 0;
	background: #fbfcfe;
	box-shadow: inset 0 1px 2px rgb(22 34 58 / 3%);
	color: var(--siteai-text);
	font-size: 14px;
	line-height: 20px;
	transition: border-color 150ms ease, box-shadow 150ms ease;
}

.siteai-widget textarea::placeholder {
	color: #99a2b3;
	opacity: 1;
}

.siteai-widget textarea:focus {
	border-color: #8199ee;
	background: #fff;
	box-shadow: 0 0 0 3px rgb(49 87 213 / 10%);
}

.siteai-widget button.siteai-send {
	display: grid;
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 14px;
	background: var(--siteai-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 10px rgb(49 87 213 / 22%);
	transition: background-color 150ms ease, transform 150ms ease;
}

.siteai-widget .siteai-send svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.siteai-widget .siteai-send:hover:not(:disabled) {
	transform: translateY(-1px);
	background: var(--siteai-primary-dark);
}

.siteai-widget .siteai-send:disabled {
	cursor: wait;
	opacity: .58;
}

.siteai-widget button.siteai-launcher {
	position: fixed;
	z-index: 999999;
	right: 24px;
	bottom: 24px;
	display: flex;
	min-width: 64px;
	height: 62px;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 0 19px;
	border: 0;
	border-radius: 31px;
	background: linear-gradient(135deg, #3963e6, #284bbd);
	box-shadow: 0 9px 24px rgb(35 66 168 / 32%), 0 2px 5px rgb(18 34 83 / 16%);
	color: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .01em;
	transition: box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.siteai-widget .siteai-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgb(35 66 168 / 36%), 0 2px 5px rgb(18 34 83 / 16%);
}

.siteai-widget .siteai-launcher svg {
	width: 21px;
	height: 21px;
	flex: 0 0 21px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
}

.siteai-widget .siteai-launcher.siteai-is-open .siteai-launcher-label {
	display: none;
}

.siteai-widget .siteai-launcher.siteai-is-open {
	width: 56px;
	min-width: 56px;
	height: 56px;
	padding: 0;
}

.siteai-widget button:focus-visible,
.siteai-widget textarea:focus-visible {
	outline: 3px solid #ffbf47;
	outline-offset: 3px;
}

.siteai-widget .siteai-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	clip-path: inset(50%);
}

@media (max-width: 520px) {
	.siteai-widget .siteai-panel {
		right: 10px;
		bottom: 86px;
		width: calc(100vw - 20px);
		height: min(680px, calc(100vh - 106px));
		height: min(680px, calc(100dvh - 106px));
		border-radius: 18px;
	}

	.siteai-widget button.siteai-launcher {
		right: 16px;
		bottom: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.siteai-widget *,
	.siteai-widget *::before,
	.siteai-widget *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
	}
}
