.ai-chat {
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	padding: 24px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: #e2e8f0;
	background: radial-gradient(120% 140% at 50% 0%, rgba(59, 130, 246, 0.08), rgba(15, 23, 42, 0.9));
}

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

.ai-chat__surface {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(720px, 100%);
	min-height: 480px;
	background: rgba(15, 23, 42, 0.75);
	backdrop-filter: blur(18px);
	border: 1px solid rgba(148, 163, 184, 0.1);
	border-radius: 24px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
	overflow: hidden;
}

.ai-chat__header {
	padding: 24px 28px 20px;
	border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.ai-chat__branding {
	display: flex;
	gap: 16px;
	align-items: center;
}

.ai-chat__indicator {
	width: 14px;
	height: 14px;
	border-radius: 999px;
	background: linear-gradient(145deg, #38bdf8, #6366f1);
	box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
	animation: ai-chat-pulse 1.8s ease-in-out infinite;
}

@keyframes ai-chat-pulse {
	0%,
	100% {
		transform: scale(1);
		box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
	}
	50% {
		transform: scale(0.85);
		box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
	}
}

.ai-chat__title {
	font-size: 1.125rem;
	font-weight: 600;
	color: #f8fafc;
	margin: 0;
}

.ai-chat__description {
	margin: 4px 0 0;
	color: #94a3b8;
	font-size: 0.95rem;
}

.ai-chat__messages {
	flex: 1 1 auto;
	padding: 24px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 20px;
	scroll-behavior: smooth;
}

.ai-chat__messages::-webkit-scrollbar {
	width: 8px;
}

.ai-chat__messages::-webkit-scrollbar-thumb {
	background-color: rgba(99, 102, 241, 0.4);
	border-radius: 999px;
}

.ai-chat__empty {
	margin: auto;
	text-align: center;
	max-width: 360px;
	color: #94a3b8;
}

.ai-chat__empty-title {
	margin: 0 0 12px;
	font-size: 1.25rem;
	font-weight: 600;
	color: #f8fafc;
}

.ai-chat__empty-text {
	margin: 0;
	line-height: 1.5;
}

.ai-chat__message {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px;
	align-items: flex-start;
}

.ai-chat__message--user {
	grid-template-columns: 1fr auto;
}

.ai-chat__message--user .ai-chat__avatar {
	order: 2;
}

.ai-chat__message--user .ai-chat__bubble {
	order: 1;
	background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(59, 130, 246, 0.6));
	color: #f8fafc;
}

.ai-chat__message--assistant .ai-chat__bubble {
	background: rgba(148, 163, 184, 0.12);
	border: 1px solid rgba(148, 163, 184, 0.16);
}

.ai-chat__avatar {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: rgba(59, 130, 246, 0.12);
	color: #cbd5f5;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
}

.ai-chat__bubble {
	padding: 14px 16px;
	border-radius: 18px;
	line-height: 1.6;
	font-size: 0.98rem;
	color: #e2e8f0;
	white-space: pre-wrap;
}

.ai-chat__bubble p {
	margin: 0 0 10px;
}

.ai-chat__bubble p:last-child {
	margin-bottom: 0;
}

.ai-chat__meta {
	grid-column: span 2;
	font-size: 0.75rem;
	color: rgba(148, 163, 184, 0.7);
	margin-top: 4px;
	padding-left: 52px;
}

.ai-chat__footer {
	padding: 20px 24px;
	border-top: 1px solid rgba(148, 163, 184, 0.08);
	background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.86));
}

.ai-chat__form {
	display: flex;
	gap: 12px;
	align-items: flex-end;
}

.ai-chat__input {
	flex: 1 1 auto;
	min-height: 58px;
	max-height: 200px;
	padding: 16px 18px;
	border-radius: 18px;
	border: 1px solid rgba(148, 163, 184, 0.25);
	background: rgba(15, 23, 42, 0.92);
	color: #f8fafc;
	resize: vertical;
	font-size: 0.98rem;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
	transition: border 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat__input:focus {
	outline: none;
	border-color: rgba(59, 130, 246, 0.8);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.ai-chat__controls {
	display: flex;
	align-items: center;
}

.ai-chat__submit {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 14px 22px;
	border-radius: 16px;
	border: none;
	background: linear-gradient(135deg, #38bdf8, #6366f1);
	color: #f8fafc;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	box-shadow: 0 12px 25px rgba(79, 70, 229, 0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ai-chat__submit:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 16px 30px rgba(79, 70, 229, 0.4);
}

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

.ai-chat__submit-spinner {
	position: relative;
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 999px;
	border: 2px solid rgba(248, 250, 252, 0.7);
	border-top-color: transparent;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.2s ease;
}

.ai-chat--sending .ai-chat__submit-spinner {
	opacity: 1;
	animation: ai-chat-spin 1s linear infinite;
}

@keyframes ai-chat-spin {
	to {
		transform: rotate(360deg);
	}
}

.ai-chat__banner {
	position: absolute;
	left: 24px;
	right: 24px;
	top: 16px;
	padding: 12px 16px;
	border-radius: 14px;
	background: rgba(239, 68, 68, 0.9);
	color: #fff;
	font-size: 0.95rem;
	box-shadow: 0 12px 25px rgba(239, 68, 68, 0.35);
	opacity: 0;
	transform: translateY(-12px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 10;
}

.ai-chat__banner--visible {
	opacity: 1;
	transform: translateY(0);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

@media (max-width: 768px) {
	.ai-chat {
		padding: 16px;
	}

	.ai-chat__surface {
		border-radius: 20px;
	}

	.ai-chat__messages {
		padding: 20px 18px;
		gap: 16px;
	}

	.ai-chat__form {
		gap: 10px;
		flex-direction: column;
	}

	.ai-chat__input {
		width: 100%;
	}

	.ai-chat__controls {
		align-self: flex-end;
	}
}


