#dtai-agent-root {
	--dtai-accent: #111111;
	position: relative;
	z-index: 2147482600;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.dtai-widget {
	position: fixed;
	right: 22px;
	bottom: max(22px, env(safe-area-inset-bottom));
	z-index: 2147482600;
}

.dtai-widget.dtai-desktop-bottom_left {
	right: auto;
	left: 22px;
}

.dtai-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	min-height: 52px;
	padding: 8px 18px 8px 10px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 999px;
	background: var(--dtai-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 760;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
	transform: translateZ(0);
	transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s ease, opacity .18s ease;
}

.dtai-launcher:hover,
.dtai-launcher:focus-visible {
	transform: translateY(-2px) scale(1.01);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
	outline: none;
}

.dtai-orb {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .13);
	overflow: hidden;
}

.dtai-orb::before {
	content: "";
	position: absolute;
	inset: 8px;
	border-radius: inherit;
	background: #fff;
	opacity: .98;
}

.dtai-orb i {
	position: relative;
	width: 3px;
	height: 12px;
	margin: 0 1.5px;
	border-radius: 999px;
	background: var(--dtai-accent);
	animation: dtai-wave 1.12s ease-in-out infinite;
}

.dtai-orb i:nth-child(2) {
	animation-delay: .12s;
	height: 17px;
}

.dtai-orb i:nth-child(3) {
	animation-delay: .24s;
}

@keyframes dtai-wave {
	0%, 100% { transform: scaleY(.55); opacity: .68; }
	50% { transform: scaleY(1.18); opacity: 1; }
}

.dtai-chat-panel {
	position: absolute;
	right: 0;
	bottom: 66px;
	display: flex;
	flex-direction: column;
	width: min(390px, calc(100vw - 28px));
	height: min(620px, calc(100vh - 110px));
	border: 1px solid rgba(15, 23, 42, .12);
	border-radius: 28px;
	background: rgba(255, 255, 255, .96);
	color: #111827;
	box-shadow: 0 24px 80px rgba(15, 23, 42, .26);
	opacity: 0;
	pointer-events: none;
	transform: translateY(18px) scale(.94);
	transform-origin: bottom right;
	transition: opacity .16s ease, transform .34s cubic-bezier(.16, 1, .3, 1);
	overflow: hidden;
	backdrop-filter: blur(18px);
}

.dtai-desktop-bottom_left .dtai-chat-panel {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

.dtai-widget.is-open .dtai-chat-panel {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.dtai-widget.is-open .dtai-launcher {
	opacity: .96;
	transform: scale(.98);
}

.dtai-theme-dark .dtai-chat-panel {
	background: rgba(15, 23, 42, .96);
	color: #f8fafc;
	border-color: rgba(255, 255, 255, .12);
}

.dtai-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 18px 14px;
	border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.dtai-chat-header strong,
.dtai-chat-header span {
	display: block;
}

.dtai-chat-header strong {
	font-size: 15px;
	line-height: 1.2;
}

.dtai-chat-header span {
	margin-top: 3px;
	color: #64748b;
	font-size: 12px;
}

.dtai-theme-dark .dtai-chat-header span {
	color: #cbd5e1;
}

.dtai-icon-button {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: #f1f5f9;
	color: #0f172a;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.dtai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	scroll-behavior: smooth;
}

.dtai-message {
	width: fit-content;
	max-width: 84%;
	margin: 0 0 10px;
	padding: 11px 13px;
	border-radius: 18px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.dtai-message.dtai-assistant {
	background: #f1f5f9;
	color: #111827;
	border-bottom-left-radius: 6px;
}

.dtai-theme-dark .dtai-message.dtai-assistant {
	background: rgba(255, 255, 255, .1);
	color: #f8fafc;
}

.dtai-message.dtai-user {
	margin-left: auto;
	background: var(--dtai-accent);
	color: #fff;
	border-bottom-right-radius: 6px;
}

.dtai-products {
	display: grid;
	gap: 8px;
	margin: 6px 0 12px;
}

.dtai-product {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: 16px;
	background: #fff;
	color: #111827;
	text-decoration: none;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.dtai-theme-dark .dtai-product {
	background: rgba(255, 255, 255, .08);
	color: #f8fafc;
}

.dtai-product img {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	object-fit: cover;
	background: #f1f5f9;
}

.dtai-product-copy {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.dtai-product-copy strong {
	font-size: 13px;
	line-height: 1.25;
}

.dtai-product-copy small {
	color: #64748b;
}

.dtai-input-bar,
.dtai-handoff {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid rgba(148, 163, 184, .18);
	background: rgba(248, 250, 252, .84);
}

.dtai-theme-dark .dtai-input-bar,
.dtai-theme-dark .dtai-handoff {
	background: rgba(15, 23, 42, .7);
}

.dtai-input {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	max-height: 120px;
	padding: 11px 12px;
	border: 1px solid rgba(15, 23, 42, .12);
	border-radius: 16px;
	background: #fff;
	font: inherit;
	resize: none;
}

.dtai-send,
.dtai-handoff button {
	min-height: 44px;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: var(--dtai-accent);
	color: #fff;
	font-weight: 800;
	cursor: pointer;
}

.dtai-send:disabled,
.dtai-handoff button:disabled {
	opacity: .55;
	cursor: wait;
}

.dtai-handoff {
	display: grid;
	grid-template-columns: 1fr 1fr;
	border: 1px solid rgba(15, 23, 42, .08);
	border-radius: 18px;
	margin: 4px 0 12px;
}

.dtai-handoff input,
.dtai-handoff textarea {
	min-width: 0;
	min-height: 40px;
	padding: 9px 10px;
	border: 1px solid rgba(15, 23, 42, .12);
	border-radius: 12px;
	font: inherit;
}

.dtai-handoff textarea,
.dtai-handoff button {
	grid-column: 1 / -1;
}

@media (max-width: 640px) {
	.dtai-widget {
		right: 14px;
		bottom: max(14px, env(safe-area-inset-bottom));
	}

	.dtai-widget.dtai-mobile-bottom_left {
		right: auto;
		left: 14px;
	}

	.dtai-widget.dtai-mobile-bottom_right {
		left: auto;
		right: 14px;
	}

	.dtai-chat-panel {
		position: fixed;
		left: 10px;
		right: 10px;
		bottom: calc(max(14px, env(safe-area-inset-bottom)) + 66px);
		width: auto;
		height: min(620px, calc(100dvh - 96px));
		transform-origin: bottom center;
	}

	.dtai-mobile-shape-circle .dtai-launcher {
		width: 58px;
		height: 58px;
		min-height: 58px;
		padding: 0;
		justify-content: center;
	}

	.dtai-mobile-shape-circle .dtai-launcher-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.dtai-mobile-shape-circle .dtai-orb {
		width: 40px;
		height: 40px;
		flex-basis: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dtai-launcher,
	.dtai-chat-panel,
	.dtai-orb i {
		animation: none;
		transition: none;
	}
}
