#abar-ai-root, #abar-ai-root * {
	box-sizing: border-box;
}

.abar-ai-bubble {
	position: fixed;
	bottom: 22px;
	z-index: 99998;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--abar-ai-primary), var(--abar-ai-secondary));
	box-shadow: 0 6px 18px rgba(16, 32, 51, 0.25);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
}

.abar-ai-bubble:hover {
	transform: scale(1.06);
}

.abar-ai-bubble.abar-ai-pos-right { right: 20px; }
.abar-ai-bubble.abar-ai-pos-left { left: 20px; }

.abar-ai-bubble svg {
	width: 30px;
	height: 30px;
}

.abar-ai-window {
	position: fixed;
	bottom: 96px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(16, 32, 51, 0.28);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 99999;
	direction: rtl;
	font-family: inherit;
}

.abar-ai-window.abar-ai-pos-right { right: 20px; }
.abar-ai-window.abar-ai-pos-left { left: 20px; }

.abar-ai-window.abar-ai-open {
	display: flex;
	animation: abar-ai-zoom 0.18s ease;
}

@keyframes abar-ai-zoom {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

.abar-ai-header {
	background: linear-gradient(135deg, var(--abar-ai-primary), var(--abar-ai-secondary));
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.abar-ai-header-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.abar-ai-header-avatar svg {
	width: 20px;
	height: 20px;
}

.abar-ai-header-text {
	flex: 1;
	min-width: 0;
}

.abar-ai-header-name {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
}

.abar-ai-header-sub {
	font-size: 12px;
	opacity: 0.9;
}

.abar-ai-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
	opacity: 0.9;
}

.abar-ai-close:hover {
	opacity: 1;
}

.abar-ai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f7f9fb;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.abar-ai-msg {
	max-width: 82%;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 13.5px;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
}

.abar-ai-msg.abar-ai-bot {
	background: #fff;
	color: var(--abar-ai-text);
	align-self: flex-start;
	border: 1px solid #e7ebef;
	border-bottom-left-radius: 4px;
}

.abar-ai-msg.abar-ai-user {
	background: var(--abar-ai-primary);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

.abar-ai-msg.abar-ai-typing {
	display: flex;
	gap: 4px;
	align-items: center;
}

.abar-ai-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9aa5b1;
	animation: abar-ai-blink 1.2s infinite ease-in-out;
}

.abar-ai-dot:nth-child(2) { animation-delay: 0.15s; }
.abar-ai-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes abar-ai-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

.abar-ai-quick-replies {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 4px 2px 2px;
}

.abar-ai-quick-btn {
	background: #fff;
	border: 1.5px solid var(--abar-ai-secondary);
	color: var(--abar-ai-text);
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 13px;
	text-align: right;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.abar-ai-quick-btn:hover {
	background: var(--abar-ai-secondary);
	color: #fff;
}

.abar-ai-inputbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e7ebef;
	background: #fff;
}

.abar-ai-input {
	flex: 1;
	border: 1px solid #dde3e9;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 13.5px;
	outline: none;
	font-family: inherit;
}

.abar-ai-input:focus {
	border-color: var(--abar-ai-secondary);
}

.abar-ai-send {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: var(--abar-ai-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.abar-ai-send:disabled {
	opacity: 0.5;
	cursor: default;
}

.abar-ai-send svg {
	width: 16px;
	height: 16px;
}

@media (max-width: 480px) {
	.abar-ai-window {
		width: calc(100vw - 24px);
		height: calc(100vh - 110px);
		bottom: 88px;
	}
}
