.ata-chat {
	--ata-bg: #07111f;
	--ata-panel: #0d1b2d;
	--ata-panel-soft: #13243a;
	--ata-accent: #29c4a9;
	--ata-accent-strong: #f4b860;
	--ata-text: #f7fbff;
	--ata-muted: #aab8c8;
	--ata-border: rgba(255, 255, 255, 0.12);
	--ata-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
	bottom: 22px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	position: fixed;
	right: 22px;
	z-index: 99999;
}

.ata-chat * {
	box-sizing: border-box;
}

.ata-chat__toggle {
	align-items: center;
	background: linear-gradient(135deg, var(--ata-accent), #1f8fff);
	border: 0;
	border-radius: 999px;
	box-shadow: var(--ata-shadow);
	color: #fff;
	cursor: pointer;
	display: flex;
	height: 62px;
	justify-content: center;
	transition: transform 180ms ease, box-shadow 180ms ease;
	width: 62px;
}

.ata-chat__toggle:hover,
.ata-chat__toggle:focus-visible {
	box-shadow: 0 18px 48px rgba(41, 196, 169, 0.38);
	transform: translateY(-2px);
}

.ata-chat__toggle-icon {
	font-size: 28px;
	line-height: 1;
}

.ata-chat__window {
	background:
		radial-gradient(circle at top left, rgba(41, 196, 169, 0.2), transparent 34%),
		linear-gradient(160deg, var(--ata-panel), var(--ata-bg));
	border: 1px solid var(--ata-border);
	border-radius: 18px;
	bottom: 78px;
	box-shadow: var(--ata-shadow);
	color: var(--ata-text);
	display: flex;
	flex-direction: column;
	height: min(660px, calc(100vh - 118px));
	overflow: hidden;
	position: absolute;
	right: 0;
	transform-origin: bottom right;
	width: 390px;
}

.ata-chat__window:not([hidden]) {
	animation: ata-chat-open 180ms ease-out;
}

.ata-chat__window[hidden] {
	display: none;
}

.ata-chat__header {
	align-items: center;
	background: rgba(7, 17, 31, 0.72);
	border-bottom: 1px solid var(--ata-border);
	display: flex;
	justify-content: space-between;
	padding: 18px;
}

.ata-chat__eyebrow {
	color: var(--ata-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0;
	margin: 0 0 4px;
	text-transform: uppercase;
}

.ata-chat__header h2 {
	color: var(--ata-text);
	font-size: 18px;
	line-height: 1.25;
	margin: 0;
}

.ata-chat__close {
	align-items: center;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--ata-border);
	border-radius: 999px;
	color: var(--ata-text);
	cursor: pointer;
	display: flex;
	font-size: 26px;
	height: 36px;
	justify-content: center;
	line-height: 1;
	width: 36px;
}

.ata-chat__messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
	padding: 18px;
	scroll-behavior: smooth;
}

.ata-message {
	display: flex;
	width: 100%;
}

.ata-message--user {
	justify-content: flex-end;
}

.ata-message--assistant {
	justify-content: flex-start;
}

.ata-message__bubble {
	border: 1px solid var(--ata-border);
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.55;
	max-width: 86%;
	padding: 12px 14px;
	white-space: pre-wrap;
}

.ata-message--user .ata-message__bubble {
	background: var(--ata-accent);
	border-color: rgba(41, 196, 169, 0.5);
	color: #031014;
}

.ata-message--assistant .ata-message__bubble {
	background: rgba(255, 255, 255, 0.08);
	color: var(--ata-text);
}

.ata-message__links {
	display: grid;
	gap: 8px;
	margin-top: 12px;
}

.ata-message__links-title {
	color: var(--ata-muted);
	font-size: 12px;
	font-weight: 700;
	margin: 0;
	text-transform: uppercase;
}

.ata-message__link,
.ata-message__cta {
	align-items: center;
	border-radius: 10px;
	display: flex;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	padding: 10px 12px;
	text-decoration: none;
	transition: background 160ms ease, transform 160ms ease;
}

.ata-message__link {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--ata-border);
	color: var(--ata-text);
}

.ata-message__link:hover,
.ata-message__link:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	color: var(--ata-text);
	transform: translateY(-1px);
}

.ata-message__cta {
	background: var(--ata-accent-strong);
	color: #1a1204;
	justify-content: center;
	margin-top: 12px;
}

.ata-message__cta:hover,
.ata-message__cta:focus-visible {
	background: #ffd082;
	color: #1a1204;
	transform: translateY(-1px);
}

.ata-chat__form {
	align-items: flex-end;
	background: rgba(7, 17, 31, 0.86);
	border-top: 1px solid var(--ata-border);
	display: flex;
	gap: 10px;
	padding: 14px;
}

.ata-chat__input {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--ata-border);
	border-radius: 12px;
	color: var(--ata-text);
	flex: 1;
	font: inherit;
	line-height: 1.45;
	max-height: 120px;
	min-height: 44px;
	outline: none;
	padding: 11px 12px;
	resize: none;
}

.ata-chat__input::placeholder {
	color: rgba(247, 251, 255, 0.55);
}

.ata-chat__input:focus {
	border-color: rgba(41, 196, 169, 0.78);
	box-shadow: 0 0 0 3px rgba(41, 196, 169, 0.16);
}

.ata-chat__send {
	background: var(--ata-accent);
	border: 0;
	border-radius: 12px;
	color: #031014;
	cursor: pointer;
	font-weight: 800;
	min-height: 44px;
	padding: 0 16px;
}

.ata-chat__send:disabled {
	cursor: wait;
	opacity: 0.65;
}

.ata-typing {
	align-items: center;
	display: flex;
	gap: 5px;
}

.ata-typing span {
	animation: ata-typing 900ms infinite ease-in-out;
	background: var(--ata-muted);
	border-radius: 999px;
	height: 7px;
	width: 7px;
}

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

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

@keyframes ata-chat-open {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes ata-typing {
	0%,
	80%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}

	40% {
		opacity: 1;
		transform: translateY(-4px);
	}
}

@media (max-width: 520px) {
	.ata-chat {
		bottom: 14px;
		right: 14px;
	}

	.ata-chat__window {
		border-radius: 16px;
		bottom: 76px;
		height: min(620px, calc(100vh - 104px));
		right: -4px;
		width: calc(100vw - 28px);
	}

	.ata-message__bubble {
		max-width: 92%;
	}
}
