.ait-chat,
.ait-chat * {
	box-sizing: border-box;
}

.ait-chat {
	--ait-launcher-bg: #CFB84F;
	--ait-launcher-text: #FFFFFF;
	--ait-teaser-bg: #CFB84F;
	--ait-teaser-text: #FFFFFF;
	--ait-teaser-border: #CFB84F;
	--ait-teaser-close-bg: #561D11;
	--ait-teaser-close-text: #FFFFFF;
	--ait-panel-bg: #FFFFFF;
	--ait-header-bg: #CFB84F;
	--ait-header-text: #FFFFFF;
	--ait-messages-bg: #F8FAFC;
	--ait-assistant-bg: #FFFFFF;
	--ait-assistant-text: #1F2937;
	--ait-user-bg: #CFB84F;
	--ait-user-text: #FFFFFF;
	--ait-action-bg: #CFB84F;
	--ait-action-text: #FFFFFF;
	--ait-action-hover: #561D11;
	--ait-close-bg: #561D11;
	--ait-close-text: #FFFFFF;
	--ait-close-hover-bg: #CFB84F;
	--ait-close-hover-text: #561D11;
	--ait-border: #CFB84F;
	--ait-wa-bg: #2C6D18;
	--ait-wa-text: #FFFFFF;
	--ait-wa-hover: #25D366;
	position: fixed;
	right: 22px;
	bottom: calc(8vh + env(safe-area-inset-bottom, 0px));
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.45;
}

.ait-chat button,
.ait-chat textarea {
	font: inherit;
}

.ait-chat__launcher {
	display: grid;
	width: 60px;
	height: 60px;
	margin-left: auto;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--ait-launcher-bg);
	opacity: 1;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
	color: var(--ait-launcher-text);
	cursor: pointer;
	font-size: 26px;
	transition: transform 160ms ease, box-shadow 160ms ease;
}

.ait-chat__launcher:hover,
.ait-chat__launcher:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 13px 34px rgba(0, 0, 0, 0.29);
}

.ait-chat__teaser {
	position: fixed;
	left: 50%;
	top: 50%;
	right: auto;
	bottom: auto;
	display: flex;
	width: min(330px, calc(100vw - 44px));
	align-items: flex-start;
	border: 2px solid var(--ait-teaser-border);
	border-radius: 16px;
	background: var(--ait-teaser-bg);
	box-shadow: 0 12px 35px rgba(15, 23, 42, 0.18);
	overflow: hidden;
	transform: translate(-50%, -50%);
	animation: ait-teaser-pop 220ms ease-out;
}

.ait-chat__teaser[hidden],
.ait-chat__panel[hidden],
.ait-chat__contact-card[hidden] {
	display: none;
}

.ait-chat__teaser-text {
	flex: 1;
	padding: 16px 9px 16px 16px;
	border: 0;
	background: transparent !important;
	color: var(--ait-teaser-text) !important;
	text-align: left;
	cursor: pointer;
}

.ait-chat__teaser-close {
	padding: 7px 11px;
	border: 0;
	background: var(--ait-teaser-close-bg) !important;
	color: var(--ait-teaser-close-text) !important;
	cursor: pointer;
	font-size: 20px;
	transition: background 140ms ease, color 140ms ease;
}

.ait-chat__teaser-close:hover,
.ait-chat__teaser-close:focus-visible {
	background: var(--ait-close-hover-bg) !important;
	color: var(--ait-close-hover-text) !important;
}

.ait-chat__panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	display: flex;
	width: min(390px, calc(100vw - 44px));
	height: min(650px, calc(100vh - 120px));
	min-height: 480px;
	flex-direction: column;
	border: 2px solid var(--ait-border);
	border-radius: 20px;
	background: var(--ait-panel-bg);
	box-shadow: 0 20px 55px rgba(15, 23, 42, 0.25);
	overflow: hidden;
	animation: ait-pop 180ms ease-out;
}

.ait-chat__header {
	display: flex;
	min-height: 70px;
	align-items: center;
	gap: 11px;
	padding: 12px 14px;
	background: var(--ait-header-bg);
	color: var(--ait-header-text);
}

.ait-chat__avatar {
	display: grid;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	place-items: center;
	border: 2px solid var(--ait-close-bg);
	border-radius: 50%;
	background: var(--ait-close-bg);
	color: var(--ait-close-text);
	font-size: 13px;
	font-weight: 750;
}

.ait-chat__header > div:nth-child(2) {
	display: flex;
	min-width: 0;
	flex: 1;
	flex-direction: column;
}

.ait-chat__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ait-chat__header span {
	font-size: 12px;
	opacity: 0.86;
}

.ait-chat__close {
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--ait-close-bg) !important;
	color: var(--ait-close-text) !important;
	cursor: pointer;
	font-size: 24px;
	transition: background 140ms ease, color 140ms ease;
}

.ait-chat__close:hover,
.ait-chat__close:focus-visible {
	background: var(--ait-close-hover-bg) !important;
	color: var(--ait-close-hover-text) !important;
}

.ait-chat__messages {
	display: flex;
	min-height: 0;
	flex: 1;
	flex-direction: column;
	gap: 13px;
	padding: 18px 15px;
	background: var(--ait-messages-bg);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ait-chat__message {
	display: flex;
	max-width: 92%;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

.ait-chat__message--user {
	align-self: flex-end;
	align-items: flex-end;
}

.ait-chat__bubble {
	padding: 11px 13px;
	border: 1px solid #e5e7eb;
	border-radius: 15px 15px 15px 4px;
	background: var(--ait-assistant-bg);
	box-shadow: 0 2px 7px rgba(15, 23, 42, 0.05);
	color: var(--ait-assistant-text);
	white-space: pre-wrap;
}

.ait-chat__message--user .ait-chat__bubble {
	border-color: var(--ait-border);
	border-radius: 15px 15px 4px 15px;
	background: var(--ait-user-bg);
	color: var(--ait-user-text);
}

.ait-chat__message--waiting .ait-chat__bubble {
	color: #64748b;
	font-style: italic;
}

.ait-chat__feedback {
	display: grid;
	width: 100%;
	gap: 6px;
	padding: 9px 10px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: var(--ait-panel-bg);
	color: var(--ait-assistant-text);
	font-size: 12px;
}

.ait-chat__feedback-actions {
	display: flex;
	gap: 6px;
}

.ait-chat__feedback-actions button,
.ait-chat__feedback-detail button {
	padding: 6px 9px;
	border: 1px solid var(--ait-border);
	border-radius: 8px;
	background: transparent;
	color: var(--ait-assistant-text);
	cursor: pointer;
	font-size: 12px;
}

.ait-chat__feedback-actions button:hover,
.ait-chat__feedback-actions button:focus-visible,
.ait-chat__feedback-actions button.is-selected,
.ait-chat__feedback-detail button:hover,
.ait-chat__feedback-detail button:focus-visible {
	background: var(--ait-action-bg);
	color: var(--ait-action-text);
}

.ait-chat__feedback-detail {
	display: grid;
	gap: 6px;
}

.ait-chat__feedback-detail[hidden] {
	display: none;
}

.ait-chat__feedback-detail textarea {
	width: 100%;
	min-height: 54px;
	padding: 7px 8px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	color: #111827;
	resize: vertical;
}

.ait-chat__feedback-status {
	min-height: 15px;
	color: #64748b;
}

.ait-chat__sources {
	display: grid;
	width: 100%;
	gap: 7px;
}

.ait-chat__source {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	border: 1px solid #e2e8f0;
	border-left: 3px solid var(--ait-border);
	border-radius: 10px;
	background: var(--ait-panel-bg);
	color: #1f2937;
	text-decoration: none;
	transition: border-color 140ms ease, transform 140ms ease;
}

.ait-chat__source:hover,
.ait-chat__source:focus-visible {
	border-color: var(--ait-border);
	transform: translateY(-1px);
}

.ait-chat__source strong {
	font-size: 14px;
}

.ait-chat__source > span {
	color: #64748b;
	font-size: 12px;
}

.ait-chat__source .ait-chat__source-action {
	margin-top: 3px;
	color: var(--ait-border);
	font-weight: 650;
}

.ait-chat__whatsapp-fixed {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 13px;
	border: 1px solid var(--ait-wa-bg);
	border-radius: 12px;
	background: var(--ait-wa-bg) !important;
	color: var(--ait-wa-text) !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.ait-chat__whatsapp-fixed:hover,
.ait-chat__whatsapp-fixed:focus-visible {
	border-color: var(--ait-wa-hover);
	background: var(--ait-wa-hover) !important;
	color: var(--ait-wa-text) !important;
	transform: translateY(-1px);
}

.ait-chat__whatsapp-fixed--attention {
	animation: ait-whatsapp-pulse 1.4s ease-in-out 2;
}

.ait-chat__whatsapp-icon {
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
}

.ait-chat__contact-actions {
	display: grid;
	flex: 0 0 auto;
	gap: 7px;
	padding: 8px 12px;
	border-top: 1px solid #e5e7eb;
	background: var(--ait-panel-bg);
}

.ait-chat__contact-open {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 13px;
	border: 1px solid var(--ait-action-bg);
	border-radius: 12px;
	background: var(--ait-action-bg) !important;
	color: var(--ait-action-text) !important;
	cursor: pointer;
	font-size: 14px;
	font-weight: 750;
	transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.ait-chat__contact-open:hover,
.ait-chat__contact-open:focus-visible {
	border-color: var(--ait-action-hover);
	background: var(--ait-action-hover) !important;
	color: var(--ait-action-text) !important;
	transform: translateY(-1px);
}

.ait-chat__contact-actions--whatsapp .ait-chat__whatsapp-fixed {
	order: -1;
}

.ait-chat__contact-actions--whatsapp .ait-chat__contact-open {
	background: transparent !important;
	color: var(--ait-assistant-text) !important;
}

.ait-chat__contact-actions--whatsapp .ait-chat__contact-open:hover,
.ait-chat__contact-actions--whatsapp .ait-chat__contact-open:focus-visible {
	background: var(--ait-action-bg) !important;
	color: var(--ait-action-text) !important;
}

.ait-chat__contact-card {
	flex: 0 1 auto;
	max-height: 64%;
	padding: 13px;
	border-top: 2px solid var(--ait-border);
	background: var(--ait-panel-bg);
	color: var(--ait-assistant-text);
	overflow-y: auto;
}

.ait-chat__contact-heading {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 10px;
}

.ait-chat__contact-heading > div {
	flex: 1;
}

.ait-chat__contact-heading p {
	margin: 3px 0 0;
	color: #64748b;
	font-size: 12px;
}

.ait-chat__contact-close {
	display: grid;
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--ait-close-bg) !important;
	color: var(--ait-close-text) !important;
	cursor: pointer;
	font-size: 19px;
}

.ait-chat__contact-close:hover,
.ait-chat__contact-close:focus-visible {
	background: var(--ait-close-hover-bg) !important;
	color: var(--ait-close-hover-text) !important;
}

.ait-chat__contact-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.ait-chat__contact-form > label {
	display: grid;
	gap: 4px;
	color: var(--ait-assistant-text);
	font-size: 12px;
	font-weight: 650;
}

.ait-chat__contact-form > .ait-chat__comment-field,
.ait-chat__contact-requirement,
.ait-chat__consent,
.ait-chat__contact-submit,
.ait-chat__contact-status {
	grid-column: 1 / -1;
}

.ait-chat__contact-form input[type="tel"],
.ait-chat__contact-form input[type="email"],
.ait-chat__contact-form textarea {
	width: 100%;
	min-height: 38px;
	padding: 8px 9px;
	border: 1px solid #cbd5e1;
	border-radius: 9px;
	background: #fff;
	color: #111827;
	font: inherit;
	font-weight: 400;
}

.ait-chat__contact-form textarea {
	min-height: 64px;
	resize: vertical;
}

.ait-chat__contact-form input:focus,
.ait-chat__contact-form textarea:focus {
	border-color: var(--ait-border);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--ait-border) 28%, transparent);
	outline: none;
}

.ait-chat__contact-requirement {
	margin: -3px 0 0;
	color: #64748b;
	font-size: 11px;
}

.ait-chat__contact-form .ait-chat__consent {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	font-size: 11px;
	font-weight: 400;
}

.ait-chat__consent input {
	margin: 2px 0 0;
}

.ait-chat__consent a {
	color: var(--ait-border);
	font-weight: 650;
}

.ait-chat__contact-submit {
	padding: 10px 12px;
	border: 1px solid var(--ait-action-bg);
	border-radius: 10px;
	background: var(--ait-action-bg) !important;
	color: var(--ait-action-text) !important;
	cursor: pointer;
	font-weight: 750;
}

.ait-chat__contact-submit:hover,
.ait-chat__contact-submit:focus-visible {
	border-color: var(--ait-action-hover);
	background: var(--ait-action-hover) !important;
}

.ait-chat__contact-submit:disabled {
	cursor: wait;
	opacity: 0.66;
}

.ait-chat__contact-status {
	min-height: 16px;
	margin: 0;
	color: var(--ait-assistant-text);
	font-size: 12px;
	font-weight: 650;
}

.ait-chat__contact-form--sent .ait-chat__contact-status {
	padding: 9px;
	border-radius: 8px;
	background: #dcfce7;
	color: #166534;
}

.ait-chat__honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.ait-chat__handoff {
	display: grid;
	width: 100%;
	gap: 7px;
	padding: 12px;
	border: 2px solid var(--ait-border);
	border-radius: 13px;
	background: var(--ait-panel-bg);
	color: var(--ait-assistant-text);
}

.ait-chat__handoff button,
.ait-chat__handoff a {
	padding: 8px 10px;
	border: 1px solid var(--ait-action-bg);
	border-radius: 9px;
	background: var(--ait-action-bg) !important;
	color: var(--ait-action-text) !important;
	cursor: pointer;
	font-size: 12px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

.ait-chat__handoff a {
	border-color: var(--ait-wa-bg);
	background: var(--ait-wa-bg) !important;
	color: var(--ait-wa-text) !important;
}

.ait-chat__suggestions {
	display: flex;
	gap: 7px;
	padding: 10px 12px 4px;
	background: var(--ait-panel-bg);
	overflow-x: auto;
}

.ait-chat__suggestions[hidden] {
	display: none;
}

.ait-chat__suggestions button {
	flex: 0 0 auto;
	padding: 7px 10px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: #fff;
	color: #475569;
	cursor: pointer;
	font-size: 12px;
}

.ait-chat__suggestions button:hover {
	border-color: var(--ait-border);
	color: var(--ait-border);
}

.ait-chat__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e5e7eb;
	background: var(--ait-panel-bg);
}

.ait-chat__form textarea {
	min-height: 42px;
	max-height: 110px;
	flex: 1;
	resize: none;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	padding: 10px 12px;
	background: #fff;
	color: #111827;
	line-height: 1.35;
}

.ait-chat__form textarea:focus {
	border-color: var(--ait-border);
	box-shadow: 0 0 0 2px rgba(207, 184, 79, 0.3);
	outline: none;
}

.ait-chat__form button {
	display: grid;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	place-items: center;
	border: 0;
	border-radius: 12px;
	background: var(--ait-action-bg);
	color: var(--ait-action-text);
	cursor: pointer;
	font-size: 20px;
	transition: background 140ms ease, color 140ms ease;
}

.ait-chat__form button:hover,
.ait-chat__form button:focus-visible {
	border-color: var(--ait-action-hover) !important;
	background: var(--ait-action-hover) !important;
	color: var(--ait-action-text) !important;
}

.ait-chat__form button:disabled,
.ait-chat__form textarea:disabled {
	cursor: wait;
	opacity: 0.62;
}

.ait-chat__notice {
	margin: 0;
	padding: 0 12px 9px;
	background: var(--ait-panel-bg);
	color: #64748b;
	font-size: 10px;
	text-align: center;
}

@keyframes ait-pop {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ait-teaser-pop {
	from { opacity: 0; transform: translate(-50%, -46%) scale(0.98); }
	to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes ait-whatsapp-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(44, 109, 24, 0); }
	50% { box-shadow: 0 0 0 5px rgba(44, 109, 24, 0.24); }
}

@media (max-width: 520px) {
	.ait-chat {
		right: 14px;
		bottom: calc(8vh + env(safe-area-inset-bottom, 0px));
	}

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

	.ait-chat--open .ait-chat__launcher {
		display: none;
	}

	.ait-chat__teaser {
		left: 50%;
		top: 50%;
		right: auto;
		width: min(330px, calc(100vw - 28px));
	}

	.ait-chat__contact-form {
		grid-template-columns: 1fr;
	}

	.ait-chat__contact-form > label,
	.ait-chat__contact-requirement,
	.ait-chat__contact-submit,
	.ait-chat__contact-status {
		grid-column: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ait-chat__panel,
	.ait-chat__teaser,
	.ait-chat__launcher,
	.ait-chat__source {
		animation: none;
		transition: none;
	}

	.ait-chat__teaser {
		transform: translate(-50%, -50%);
	}
}
