:root {
	--dca-green-900: #142f52;
	--dca-green-800: #1e4875;
	--dca-green-700: #2e669d;
	--dca-gold: #f5a623;
	--dca-cream: #fff6dc;
	--dca-ink: #1d3552;
	--dca-muted: #64748b;
	--dca-border: #dce3eb;
	--dca-white: #ffffff;
}

.dca-root,
.dca-root * {
	box-sizing: border-box;
}

.dca-root {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999999;
	font-family: inherit;
	color: var(--dca-ink);
}

.dca-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 62px;
	padding: 7px 19px 7px 7px;
	border: 1px solid rgba(20, 47, 82, 0.12);
	border-radius: 999px;
	background: linear-gradient(135deg, #ffc451 0%, var(--dca-gold) 58%, #ea8f14 100%);
	box-shadow: 0 13px 34px rgba(20, 47, 82, 0.24), 0 4px 10px rgba(244, 179, 52, 0.24);
	color: var(--dca-green-900);
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.dca-launcher:hover,
.dca-launcher:focus-visible {
	background: linear-gradient(135deg, #ffd16b 0%, #f8b43b 58%, #ef991b 100%);
	box-shadow: 0 16px 38px rgba(20, 47, 82, 0.3), 0 5px 12px rgba(244, 179, 52, 0.3);
	transform: translateY(-2px);
}

.dca-launcher:focus-visible,
.dca-close:focus-visible,
.dca-proactive__close:focus-visible,
.dca-proactive__action:focus-visible,
.dca-form button:focus-visible,
.dca-suggestions button:focus-visible,
.dca-product a:focus-visible,
.dca-phone:focus-visible {
	outline: 3px solid rgba(217, 182, 93, 0.8);
	outline-offset: 2px;
}

.dca-proactive[hidden] {
	display: none;
}

.dca-proactive {
	position: absolute;
	right: 0;
	bottom: 78px;
	width: min(330px, calc(100vw - 28px));
	padding: 17px 42px 17px 18px;
	border: 1px solid rgba(245, 166, 35, 0.55);
	border-radius: 18px;
	background: var(--dca-white);
	box-shadow: 0 18px 48px rgba(20, 47, 82, 0.24), 0 5px 16px rgba(245, 166, 35, 0.16);
	opacity: 0;
	transform: translateY(10px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 180ms ease, transform 180ms ease;
}

.dca-proactive::after {
	position: absolute;
	right: 28px;
	bottom: -8px;
	width: 15px;
	height: 15px;
	border-right: 1px solid rgba(245, 166, 35, 0.55);
	border-bottom: 1px solid rgba(245, 166, 35, 0.55);
	background: var(--dca-white);
	content: "";
	transform: rotate(45deg);
}

.dca-proactive.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.dca-proactive strong {
	display: block;
	color: var(--dca-green-900);
	font-size: 15px;
	line-height: 1.3;
}

.dca-proactive p {
	margin: 6px 0 12px;
	color: var(--dca-ink);
	font-size: 13px;
	line-height: 1.45;
}

.dca-proactive__close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: grid;
	width: 28px;
	height: 28px;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: #f3f5f8;
	color: var(--dca-muted);
	cursor: pointer;
	font: inherit;
	font-size: 20px;
	line-height: 1;
}

.dca-proactive__action {
	padding: 9px 13px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(135deg, #ffc451, var(--dca-gold));
	box-shadow: 0 5px 12px rgba(244, 179, 52, 0.23);
	color: var(--dca-green-900);
	cursor: pointer;
	font: inherit;
	font-size: 12px;
	font-weight: 800;
}

.dca-launcher__icon {
	display: block;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.92);
	background: var(--dca-white);
	color: var(--dca-green-900);
	box-shadow: 0 3px 9px rgba(20, 47, 82, 0.18);
}

.dca-launcher__icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dca-panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	display: flex;
	width: min(410px, calc(100vw - 28px));
	height: min(660px, calc(100vh - 112px));
	min-height: 480px;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--dca-border);
	border-top: 4px solid var(--dca-green-900);
	border-radius: 24px;
	background: var(--dca-white);
	box-shadow: 0 26px 76px rgba(20, 47, 82, 0.26), 0 8px 24px rgba(20, 47, 82, 0.12);
	opacity: 0;
	pointer-events: none;
	transform: translateY(18px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 180ms ease, transform 180ms ease;
}

.dca-root[data-state="open"] .dca-panel {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.dca-root[data-state="open"] .dca-launcher {
	opacity: 0;
	pointer-events: none;
}

.dca-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 15px 14px 16px;
	background: linear-gradient(135deg, #ffc451 0%, var(--dca-gold) 62%, #ec9217 100%);
	color: var(--dca-green-900);
}

.dca-header__brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.dca-header__mark {
	display: block;
	width: 52px;
	height: 52px;
	overflow: hidden;
	border: 2px solid rgba(20, 47, 82, 0.72);
	border-radius: 50%;
	background: var(--dca-white);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
	flex: 0 0 52px;
	place-items: unset;
}

.dca-header__mark img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

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

.dca-header strong {
	font-size: 16px;
	line-height: 1.25;
}

.dca-header__brand div > span {
	margin-top: 3px;
	color: rgba(20, 47, 82, 0.82);
	font-size: 11px;
}

.dca-header__status i {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 3px;
	border: 1px solid rgba(20, 47, 82, 0.42);
	border-radius: 50%;
	background: #56d58a;
	box-shadow: 0 0 0 3px rgba(20, 47, 82, 0.09);
}

.dca-close {
	display: grid;
	width: 36px;
	height: 36px;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: rgba(20, 47, 82, 0.12);
	color: var(--dca-green-900);
	cursor: pointer;
	font: inherit;
	font-size: 27px;
	line-height: 1;
}

.dca-messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
	padding: 18px;
	background: linear-gradient(180deg, #fbfcfe 0%, #f5f7fb 100%);
	scrollbar-width: thin;
	scrollbar-color: #bdcbc5 transparent;
}

.dca-message {
	position: relative;
	display: flex;
	max-width: 88%;
	flex-direction: column;
	gap: 8px;
}

.dca-message--assistant {
	align-self: flex-start;
	padding-left: 36px;
}

.dca-message--assistant::before {
	position: absolute;
	top: 1px;
	left: 0;
	width: 28px;
	height: 28px;
	border: 1px solid rgba(244, 179, 52, 0.72);
	border-radius: 50%;
	background: var(--dca-white) url("../images/detergold-avatar-round.png") center / cover no-repeat;
	box-shadow: 0 2px 7px rgba(20, 47, 82, 0.12);
	content: "";
}

.dca-message--user {
	align-self: flex-end;
}

.dca-message__bubble {
	padding: 11px 13px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}

.dca-message--assistant .dca-message__bubble {
	border: 1px solid var(--dca-border);
	border-left: 3px solid var(--dca-gold);
	border-bottom-left-radius: 5px;
	background: var(--dca-white);
}

.dca-message--user .dca-message__bubble {
	border-bottom-right-radius: 5px;
	background: linear-gradient(135deg, #f9b83f, #ed9518);
	color: var(--dca-green-900);
}

.dca-products {
	display: grid;
	gap: 7px;
}

.dca-product {
	display: flex;
	align-items: stretch;
	flex-direction: column;
	gap: 9px;
	padding: 10px 11px;
	border: 1px solid var(--dca-border);
	border-radius: 14px;
	background: var(--dca-white);
	color: var(--dca-ink);
	box-shadow: 0 4px 14px rgba(20, 47, 82, 0.06);
	transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.dca-product:hover {
	border-color: var(--dca-gold);
	box-shadow: 0 7px 18px rgba(20, 47, 82, 0.11);
	transform: translateY(-1px);
}

.dca-product span,
.dca-product strong,
.dca-product small {
	display: block;
}

.dca-product strong {
	font-size: 13px;
	line-height: 1.3;
}

.dca-product small {
	margin-top: 3px;
	color: var(--dca-muted);
	font-size: 11px;
}

.dca-product__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.dca-product__actions a {
	display: inline-flex;
	min-height: 34px;
	align-items: center;
	justify-content: center;
	padding: 7px 10px;
	border-radius: 9px;
	font-size: 11px;
	font-weight: 800;
	text-decoration: none;
}

.dca-product__view {
	border: 1px solid var(--dca-border);
	background: var(--dca-cream);
	color: var(--dca-green-900);
}

.dca-product__cart {
	border: 1px solid #e89416;
	background: linear-gradient(135deg, #ffc451, var(--dca-gold));
	color: var(--dca-green-900);
}

.dca-phone {
	display: block;
	padding: 10px 12px;
	border-radius: 11px;
	border: 1px solid rgba(244, 179, 52, 0.5);
	background: linear-gradient(135deg, #fff9e8, var(--dca-cream));
	color: var(--dca-green-900);
	font-size: 13px;
	font-weight: 800;
	text-align: center;
	text-decoration: none;
}

.dca-suggestions {
	display: flex;
	gap: 7px;
	overflow-x: auto;
	padding: 10px 14px;
	border-top: 1px solid #edf1ef;
	background: var(--dca-white);
	scrollbar-width: none;
}

.dca-suggestions[hidden] {
	display: none;
}

.dca-suggestions::-webkit-scrollbar {
	display: none;
}

.dca-suggestions button {
	flex: 0 0 auto;
	padding: 7px 10px;
	border: 1px solid rgba(244, 179, 52, 0.48);
	border-radius: 999px;
	background: var(--dca-white);
	background: #fffaf0;
	color: var(--dca-green-900);
	cursor: pointer;
	font: inherit;
	font-size: 11px;
	font-weight: 700;
}

.dca-form {
	display: flex;
	align-items: flex-end;
	gap: 9px;
	padding: 12px 14px;
	border-top: 1px solid var(--dca-border);
	background: var(--dca-white);
}

.dca-form textarea {
	width: 100%;
	min-height: 42px;
	max-height: 112px;
	resize: none;
	border: 1px solid var(--dca-border);
	border-radius: 13px;
	background: #fbfcfb;
	box-shadow: none;
	color: var(--dca-ink);
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	padding: 10px 12px;
}

.dca-form textarea:focus {
	border-color: var(--dca-gold);
	box-shadow: 0 0 0 3px rgba(244, 179, 52, 0.18);
	outline: 0;
}

.dca-form button {
	display: grid;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	place-items: center;
	border: 0;
	border-radius: 13px;
	background: linear-gradient(135deg, #ffc451, var(--dca-gold));
	color: var(--dca-green-900);
	box-shadow: 0 5px 12px rgba(244, 179, 52, 0.28);
	cursor: pointer;
}

.dca-form button:disabled,
.dca-suggestions button:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.dca-form button svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.dca-disclaimer {
	margin: 0;
	padding: 0 16px 11px;
	background: var(--dca-white);
	color: var(--dca-muted);
	font-size: 9px;
	line-height: 1.35;
	text-align: center;
}

.dca-typing {
	display: flex;
	width: 58px;
	min-height: 38px;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 11px;
	border: 1px solid var(--dca-border);
	border-radius: 16px 16px 16px 5px;
	background: var(--dca-white);
}

.dca-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--dca-gold);
	animation: dca-bounce 1.2s infinite ease-in-out;
}

.dca-typing span:nth-child(2) {
	animation-delay: 120ms;
}

.dca-typing span:nth-child(3) {
	animation-delay: 240ms;
}

@keyframes dca-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
	30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 520px) {
	.dca-root {
		right: 12px;
		bottom: 12px;
	}

	.dca-panel {
		position: fixed;
		right: 8px;
		bottom: 8px;
		width: calc(100vw - 16px);
		height: min(720px, calc(100dvh - 16px));
		min-height: 0;
		border-radius: 18px;
	}

	.dca-launcher__label {
		display: none;
	}

	.dca-launcher {
		width: 58px;
		height: 58px;
		padding: 8px;
		justify-content: center;
	}

	.dca-proactive {
		right: 0;
		width: min(330px, calc(100vw - 24px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.dca-panel,
	.dca-launcher,
	.dca-product,
	.dca-proactive {
		transition: none;
	}

	.dca-typing span {
		animation: none;
	}
}
