:root {
	--legacy-ai-gold: #bf933f;
	--legacy-ai-gold-light: #e3c16d;
	--legacy-ai-black: #070a0b;
	--legacy-ai-panel: #0d1112;
	--legacy-ai-text: #f7f7f4;
	--legacy-ai-muted: #aeb4b2;
}

.legacy-ai,
.legacy-ai * {
	box-sizing: border-box;
}

.legacy-ai {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 2147483000;
	font-family: Montserrat, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
}

.legacy-ai button,
.legacy-ai textarea,
.legacy-ai a {
	font: inherit;
}

.legacy-ai__launcher {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 190px;
	height: 62px;
	gap: 10px;
	padding: 0 20px 0 15px;
	border: 1px solid rgba(227, 193, 109, 0.78);
	border-radius: 999px;
	background: linear-gradient(145deg, #cda74f, #92702f);
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.36), 0 0 24px rgba(191, 147, 63, 0.24);
	cursor: pointer;
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.legacy-ai__launcher:hover,
.legacy-ai__launcher:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42), 0 0 30px rgba(191, 147, 63, 0.36);
	outline: none;
}

.legacy-ai__launcher-icon {
	display: grid;
	flex: 0 0 31px;
	place-items: center;
	width: 31px;
	height: 31px;
}

.legacy-ai__launcher-icon svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: #080909;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.legacy-ai__launcher-icon .legacy-ai__spark {
	fill: #080909;
	stroke: none;
}

.legacy-ai__launcher-close {
	display: none;
	color: #080909;
	font-size: 36px;
	font-weight: 300;
	line-height: 1;
}

.legacy-ai[data-state="open"] .legacy-ai__launcher-icon {
	display: none;
}

.legacy-ai[data-state="open"] .legacy-ai__launcher-close {
	display: block;
}

.legacy-ai[data-state="open"] .legacy-ai__launcher {
	width: 62px;
	min-width: 62px;
	padding: 0;
}

.legacy-ai__launcher-label {
	width: max-content;
	color: #080909;
	font-size: 12.5px;
	font-weight: 750;
	letter-spacing: 0.01em;
	pointer-events: none;
}

.legacy-ai[data-state="open"] .legacy-ai__launcher-label {
	display: none;
}

.legacy-ai__panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	display: flex;
	flex-direction: column;
	width: min(390px, calc(100vw - 32px));
	height: min(610px, calc(100vh - 120px));
	min-height: 430px;
	overflow: hidden;
	border: 1px solid rgba(191, 147, 63, 0.45);
	border-radius: 20px;
	background: var(--legacy-ai-panel);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
	opacity: 0;
	transform: translateY(14px) scale(0.98);
	transform-origin: bottom right;
	visibility: hidden;
	transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.legacy-ai[data-state="open"] .legacy-ai__panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	visibility: visible;
}

.legacy-ai__header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 76px;
	padding: 15px 50px 14px 19px;
	border-bottom: 1px solid rgba(191, 147, 63, 0.26);
	background: radial-gradient(circle at 12% -20%, rgba(191, 147, 63, 0.25), transparent 44%), #090c0d;
}

.legacy-ai__brand {
	display: flex;
	flex-direction: column;
	color: #fff;
	line-height: 1;
}

.legacy-ai__brand span {
	font-size: 20px;
	font-weight: 800;
	letter-spacing: 0.12em;
}

.legacy-ai__brand small {
	margin-top: 7px;
	color: var(--legacy-ai-gold-light);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.28em;
}

.legacy-ai__status {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #d9ddda;
	font-size: 11px;
	font-weight: 500;
}

.legacy-ai__status span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #49c770;
	box-shadow: 0 0 9px rgba(73, 199, 112, 0.78);
}

.legacy-ai__close {
	position: absolute;
	top: 17px;
	right: 14px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #bfc4c2;
	font-size: 27px;
	font-weight: 300;
	line-height: 30px;
	cursor: pointer;
}

.legacy-ai__close:hover,
.legacy-ai__close:focus-visible {
	background: rgba(255, 255, 255, 0.07);
	color: #fff;
	outline: none;
}

.legacy-ai__messages {
	flex: 1;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 18px 16px 12px;
	scroll-behavior: smooth;
	scrollbar-color: rgba(191, 147, 63, 0.5) transparent;
	scrollbar-width: thin;
}

.legacy-ai__message {
	width: fit-content;
	max-width: 88%;
	margin-bottom: 11px;
	padding: 11px 13px;
	border-radius: 15px;
	white-space: pre-wrap;
	word-break: break-word;
}

.legacy-ai__message--assistant {
	margin-right: auto;
	border: 1px solid rgba(191, 147, 63, 0.2);
	border-bottom-left-radius: 5px;
	background: #171c1d;
	color: #f3f4f1;
}

.legacy-ai__message--user {
	margin-left: auto;
	border-bottom-right-radius: 5px;
	background: linear-gradient(135deg, #d8b65d, #ae8435);
	color: #0a0b0b;
	font-weight: 500;
}

.legacy-ai__message--rich {
	white-space: normal;
}

.legacy-ai__message--rich p {
	margin: 0 0 9px;
}

.legacy-ai__message--rich p:last-child,
.legacy-ai__message--rich ul:last-child {
	margin-bottom: 0;
}

.legacy-ai__message--rich ul {
	margin: 4px 0 10px;
	padding-left: 19px;
}

.legacy-ai__message--rich li + li {
	margin-top: 5px;
}

.legacy-ai__message--rich strong {
	color: #fff;
	font-weight: 750;
}

.legacy-ai__inline-whatsapp {
	color: #71e394;
	font-weight: 750;
	text-decoration: underline;
	text-decoration-color: rgba(113, 227, 148, 0.62);
	text-underline-offset: 3px;
}

.legacy-ai__inline-whatsapp:hover,
.legacy-ai__inline-whatsapp:focus-visible {
	color: #a3f1ba;
	outline: none;
}

.legacy-ai__message--error {
	border-color: rgba(222, 109, 90, 0.4);
	background: rgba(116, 35, 28, 0.25);
	color: #ffd7cf;
}

.legacy-ai__typing {
	display: flex;
	align-items: center;
	gap: 4px;
	width: 54px;
	min-height: 39px;
}

.legacy-ai__typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--legacy-ai-gold-light);
	animation: legacy-ai-bounce 1.1s infinite ease-in-out;
}

.legacy-ai__typing i:nth-child(2) { animation-delay: 0.14s; }
.legacy-ai__typing i:nth-child(3) { animation-delay: 0.28s; }

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

.legacy-ai__follow-ups {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin: -2px 0 12px;
	padding: 0 2px;
}

.legacy-ai__follow-ups-label {
	color: var(--legacy-ai-muted);
	font-size: 10px;
	line-height: 1.3;
}

.legacy-ai__follow-up {
	max-width: 100%;
	padding: 8px 11px;
	border: 1px solid rgba(191, 147, 63, 0.48);
	border-radius: 15px;
	background: rgba(191, 147, 63, 0.08);
	color: #e7d29b;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
}

.legacy-ai__follow-up:hover,
.legacy-ai__follow-up:focus-visible {
	background: rgba(191, 147, 63, 0.18);
	color: #fff;
	outline: none;
}

.legacy-ai__follow-up:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.legacy-ai__quick-actions {
	display: flex;
	gap: 7px;
	overflow-x: auto;
	padding: 7px 14px 8px;
	scrollbar-width: none;
}

.legacy-ai__quick-actions::-webkit-scrollbar { display: none; }

.legacy-ai__quick-actions button,
.legacy-ai__quick-actions a {
	flex: 0 0 auto;
	padding: 7px 10px;
	border: 1px solid rgba(191, 147, 63, 0.45);
	border-radius: 16px;
	background: transparent;
	color: #e7d29b;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.legacy-ai__quick-actions .legacy-ai__whatsapp-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px 5px 6px;
	color: #fff;
}

.legacy-ai__whatsapp-icon {
	display: grid;
	flex: 0 0 20px;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #25d366;
}

.legacy-ai__whatsapp-icon svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: #fff;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.65;
}

.legacy-ai__quick-actions button:hover,
.legacy-ai__quick-actions button:focus-visible,
.legacy-ai__quick-actions a:hover,
.legacy-ai__quick-actions a:focus-visible {
	background: rgba(191, 147, 63, 0.14);
	color: #fff;
	outline: none;
}

.legacy-ai__remaining {
	padding: 0 16px 6px;
	color: var(--legacy-ai-muted);
	font-size: 10px;
	text-align: right;
}

.legacy-ai__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0 12px;
	padding: 8px 8px 8px 13px;
	border: 1px solid rgba(191, 147, 63, 0.35);
	border-radius: 16px;
	background: #111617;
}

.legacy-ai__form textarea {
	flex: 1;
	min-height: 34px;
	max-height: 105px;
	padding: 7px 0 5px;
	resize: none;
	overflow-y: auto;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
	outline: none;
}

.legacy-ai__form textarea::placeholder { color: #858c89; }

.legacy-ai__form button {
	display: grid;
	flex: 0 0 35px;
	place-items: center;
	width: 35px;
	height: 35px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(145deg, #d7b459, #a57c31);
	cursor: pointer;
}

.legacy-ai__form button:disabled,
.legacy-ai__form textarea:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.legacy-ai__form button svg {
	width: 18px;
	height: 18px;
	fill: #090b0b;
}

.legacy-ai__footer {
	padding: 8px 12px 10px;
	color: #737a77;
	font-size: 9px;
	letter-spacing: 0.02em;
	text-align: center;
}

@media (max-width: 600px) {
	.legacy-ai {
		right: 14px;
		bottom: 18px;
	}

	.legacy-ai__launcher {
		width: auto;
		min-width: 176px;
		height: 58px;
		gap: 8px;
		padding: 0 15px 0 13px;
	}

	.legacy-ai__launcher-label {
		display: block;
		font-size: 12px;
	}

	.legacy-ai[data-state="open"] .legacy-ai__launcher {
		width: 58px;
		min-width: 58px;
		padding: 0;
	}

	.legacy-ai[data-state="open"] .legacy-ai__launcher-label {
		display: none;
	}

	.legacy-ai__panel {
		right: 0;
		bottom: 70px;
		width: calc(100vw - 28px);
		height: min(620px, calc(100dvh - 104px));
		min-height: 400px;
		border-radius: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.legacy-ai *,
	.legacy-ai *::before,
	.legacy-ai *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
