:root {
	--ao-ai-ico: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.2L4 17.2V4h16v12z'/%3E%3C/svg%3E");
	--ao-ai-font: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen-sans, ubuntu, cantarell, "Helvetica Neue", sans-serif;
}

.ao-ai-chat {
	--sep: 20px;
	--bottom: var(--sep);
	--s: 44px;
	--h: calc(var(--s) / 2);
	--header: 46px;
	--vh: 100vh;
	--ao-ai-color: #ff3131;
	--text: rgba(0, 0, 0, 0.85);
	display: none;
	position: fixed;
	z-index: 9001;
	right: var(--sep);
	bottom: var(--bottom);
	font: normal normal normal 15px/1.5em var(--ao-ai-font);
	letter-spacing: 0;
	transform: scale3d(0, 0, 0);
	transform-origin: calc(var(--s) / -2) calc(var(--s) / -4);
	animation: ao_ai_show 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) 10ms both;
	touch-action: manipulation;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

.ao-ai-chat *,
.ao-ai-chat *::before,
.ao-ai-chat *::after {
	box-sizing: border-box;
}

.ao-ai-chat--show {
	display: block;
	transform: scaleX(1);
}

.ao-ai-chat--left {
	right: auto;
	left: var(--sep);
}

.ao-ai-chat__button {
	position: absolute;
	z-index: 2;
	bottom: 8px;
	right: 8px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--ao-ai-color) var(--ao-ai-ico) 50% / 58% no-repeat;
	box-shadow: 1px 6px 24px 0 rgba(255, 49, 49, 0.28);
	cursor: pointer;
	transition: background-color 0.2s linear;
}

.ao-ai-chat__button:hover,
.ao-ai-chat__button:active {
	background-color: #cc2727;
}

.ao-ai-chat--left .ao-ai-chat__button {
	right: auto;
	left: 8px;
}

.ao-ai-chat--chatbox .ao-ai-chat__button {
	display: none;
}

.ao-ai-chat.ao-ai-chat--chatbox {
	z-index: var(--ao-ai-z-open, 9010) !important;
}

.ao-ai-chat__chatbox {
	display: flex;
	flex-direction: column;
	position: absolute;
	right: 0;
	bottom: 0;
	z-index: 1;
	width: calc(100vw - var(--sep) * 2);
	max-width: 360px;
	height: min(520px, calc(var(--vh) - var(--bottom) - var(--sep) - 40px));
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.18);
	text-align: left;
	overflow: hidden;
	opacity: 0;
	transform: scale3d(0, 0, 0);
	transition: opacity 80ms, transform 0s linear 81ms;
}

.ao-ai-chat--chatbox .ao-ai-chat__chatbox {
	opacity: 1;
	transform: scaleX(1);
	transition: opacity 0.2s ease-out, transform 0s linear;
}

.ao-ai-chat--left .ao-ai-chat__chatbox {
	right: auto;
	left: 0;
}

.ao-ai-chat__header {
	display: flex;
	align-items: center;
	position: relative;
	flex-shrink: 0;
	height: var(--header);
	padding: 0 52px 0 16px;
	background: var(--ao-ai-color);
}

.ao-ai-chat__header__text {
	font-size: 16px;
	font-weight: 600;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #fff;
}

.ao-ai-chat__close {
	position: absolute;
	top: calc(50% - 14px);
	right: 12px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 24 24'%3E%3Cpath d='M24 2.4 21.6 0 12 9.6 2.4 0 0 2.4 9.6 12 0 21.6 2.4 24l9.6-9.6 9.6 9.6 2.4-2.4-9.6-9.6z'/%3E%3C/svg%3E") 50% / 10px no-repeat;
	cursor: pointer;
}

.ao-ai-chat__close:hover {
	background-color: rgba(0, 0, 0, 0.55);
}

.ao-ai-chat__messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	scroll-behavior: smooth;
	overscroll-behavior-y: contain;
	padding: 12px 0 8px;
	background: #f7f7f7;
}

.ao-ai-chat__bubble {
	position: relative;
	max-width: calc(100% - 40px);
	padding: 10px 14px;
	margin: 0 16px 8px;
	border-radius: 18px;
	background: #fff;
	color: #4a4a4a;
	font-size: 14px;
	word-break: break-word;
	user-select: text;
	-webkit-user-select: text;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	animation: ao_ai_show 0.22s cubic-bezier(0, 0, 0.58, 1.19) 10ms both;
}

.ao-ai-chat__bubble a {
	color: var(--ao-ai-color);
	font-weight: 600;
	text-decoration: underline;
	word-break: break-all;
}

.ao-ai-chat__bubble a:hover {
	color: #cc2727;
}

.ao-ai-chat__bubble::before {
	content: "";
	display: block;
	position: absolute;
	bottom: 12px;
	left: -10px;
	width: 12px;
	height: 18px;
	background: inherit;
	clip-path: path("M17 25V0C17 12.877 6.082 14.9 1.031 15.91c-1.559.31-1.179 2.272.004 2.272C9.609 18.182 17 18.088 17 25z");
	transform: scale(0.7);
}

.ao-ai-chat__bubble--out {
	align-self: flex-end;
	margin-left: auto;
	background: var(--ao-ai-color);
	color: #fff;
}

.ao-ai-chat__bubble--out a {
	color: #fff;
}

.ao-ai-chat__bubble--out::before {
	left: auto;
	right: -10px;
	clip-path: path("M0 25.68V0c0 13.23 10.92 15.3 15.97 16.34 1.56.32 1.18 2.34 0 2.34-8.58 0-15.97-.1-15.97 7Z");
}

.ao-ai-chat__bubble--loading {
	width: 56px;
	min-height: 44px;
	background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='4' cy='12' r='3'%3E%3Canimate attributeName='cy' begin='0;a.end+0.1s' calcMode='spline' dur='0.4s' keySplines='.33,.66,.66,1;.33,0,.66,.33' values='12;6;12'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='3'%3E%3Canimate attributeName='cy' begin='c.begin+0.1s' calcMode='spline' dur='0.4s' keySplines='.33,.66,.66,1;.33,0,.66,.33' values='12;6;12'/%3E%3C/circle%3E%3Ccircle cx='20' cy='12' r='3'%3E%3Canimate id='a' attributeName='cy' begin='c.begin+0.2s' calcMode='spline' dur='0.4s' keySplines='.33,.66,.66,1;.33,0,.66,.33' values='12;6;12'/%3E%3C/circle%3E%3C/svg%3E") 16px 14px no-repeat !important;
}

.ao-ai-chat__bubble--loading::before {
	content: none;
}

.ao-ai-chat__footer {
	flex-shrink: 0;
	border-top: 1px solid #eee;
	background: #fff;
	padding: 8px 10px 6px;
}

.ao-ai-chat__composer {
	display: flex;
	align-items: flex-end;
	gap: 6px;
}

body.ao-ai-chat-open #nasa-back-to-top {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.ao-ai-chat__input {
	flex: 1;
	min-height: 40px;
	max-height: 80px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 20px;
	resize: none;
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	color: var(--text);
	background: #fff;
}

.ao-ai-chat__input:focus {
	outline: 2px solid var(--ao-ai-color);
	outline-offset: 0;
	border-color: transparent;
}

.ao-ai-chat__send,
.ao-ai-chat__mic,
.ao-ai-chat__whatsapp-action {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--s);
	height: var(--s);
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.2s linear, box-shadow 0.2s linear;
	text-decoration: none !important;
}

.ao-ai-chat__mic {
	background: #f0f0f0;
	color: #555;
}

.ao-ai-chat__mic:hover,
.ao-ai-chat__mic:active {
	background: #e2e2e2;
}

.ao-ai-chat__mic:disabled,
.ao-ai-chat__mic[hidden] {
	display: none !important;
}

.ao-ai-chat__mic--listening {
	background: var(--ao-ai-color);
	color: #fff;
	box-shadow: 0 0 0 3px rgba(255, 49, 49, 0.25);
}

.ao-ai-chat__mic--listening .ao-ai-chat__mic-icon {
	animation: ao_ai_mic_pulse 1.2s ease-in-out infinite;
}

@keyframes ao_ai_mic_pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.55;
	}
}

.ao-ai-chat__send,
.ao-ai-chat__whatsapp-action {
	background: var(--ao-ai-color);
}

.ao-ai-chat__send:hover,
.ao-ai-chat__send:active {
	background: #cc2727;
}

.ao-ai-chat__send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ao-ai-chat__whatsapp-action {
	background: #25d366;
	color: #fff !important;
}

.ao-ai-chat__whatsapp-action:hover,
.ao-ai-chat__whatsapp-action:active {
	background: #128c7e;
	color: #fff !important;
}

.ao-ai-chat__whatsapp-action[hidden] {
	display: none !important;
}

.ao-ai-chat--whatsapp-mode .ao-ai-chat__send {
	display: none !important;
}

.ao-ai-chat--whatsapp-mode .ao-ai-chat__whatsapp-action {
	display: flex !important;
}

.ao-ai-chat__action__icon {
	display: block;
	color: #fff;
}

.ao-ai-chat__privacy {
	padding: 4px 2px 0;
	margin: 0;
	font-size: 10px;
	line-height: 1.35;
	color: #999;
	text-align: center;
}

.ao-ai-chat__privacy a {
	color: inherit;
	text-decoration: underline;
}

@keyframes ao_ai_show {
	from {
		transform: scale3d(0, 0, 0);
	}
	to {
		transform: scaleX(1);
	}
}

@media only screen and (max-width: 52.96552em) {
	.ao-ai-chat {
		--bottom: 76px;
	}
}

@media (max-width: 480px) {
	.ao-ai-chat {
		--sep: 6px;
	}

	.ao-ai-chat__chatbox {
		max-width: calc(100vw - 12px);
		height: min(480px, calc(var(--vh) - var(--bottom) - 20px));
	}

	.ao-ai-chat__bubble {
		max-width: calc(100% - 32px);
		margin: 0 12px 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ao-ai-chat,
	.ao-ai-chat__bubble {
		animation: none !important;
	}
}
