#aaa-chat-widget {
	--aaa-green: #0E4740;
	--aaa-green-dark: #0a332e;
	--aaa-gold: #B5904A;
	--aaa-gold-light: #d8bd85;
	position: fixed;
	bottom: 20px;
	inset-inline-end: 20px;
	z-index: 999999;
	font-family: -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
	direction: rtl;
}

#aaa-toggle-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}

#aaa-toggle-label {
	background: #fff;
	color: var(--aaa-green);
	border: 1.5px solid var(--aaa-gold);
	padding: 9px 16px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 4px 14px rgba(14, 71, 64, 0.22);
}
#aaa-chat-widget.aaa-open #aaa-toggle-label {
	display: none;
}

#aaa-toggle-btn {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(145deg, var(--aaa-green), var(--aaa-green-dark));
	color: var(--aaa-gold-light);
	border: 2px solid var(--aaa-gold);
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(14, 71, 64, 0.4);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
#aaa-toggle-btn:hover {
	transform: scale(1.06);
	box-shadow: 0 6px 20px rgba(14, 71, 64, 0.55);
}

#aaa-toggle-btn .aaa-toggle-icon-close { display: none; }
#aaa-chat-widget.aaa-open #aaa-toggle-btn .aaa-toggle-icon-open { display: none; }
#aaa-chat-widget.aaa-open #aaa-toggle-btn .aaa-toggle-icon-close { display: inline; }

@media (max-width: 480px) {
	#aaa-toggle-label { display: none; }
}

#aaa-chat-panel {
	position: absolute;
	bottom: 74px;
	inset-inline-end: 0;
	width: 340px;
	max-width: calc(100vw - 40px);
	height: 460px;
	max-height: 70vh;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #e5e0d5;
}
.aaa-hidden { display: none !important; }

#aaa-chat-header {
	background: var(--aaa-green);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 600;
	font-size: 15px;
}
#aaa-chat-title-wrap {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
#aaa-chat-subtitle {
	font-weight: 400;
	font-size: 10.5px;
	color: var(--aaa-gold-light);
	opacity: 0.9;
}

#aaa-close-btn {
	background: none;
	border: none;
	color: var(--aaa-gold-light);
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
	padding: 4px;
}

#aaa-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #faf8f4;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.aaa-msg {
	max-width: 85%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.6;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.aaa-msg-bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e5e0d5;
	color: #2a2a2a;
	border-bottom-left-radius: 4px;
}
.aaa-msg-user {
	align-self: flex-end;
	background: var(--aaa-green);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.aaa-msg-error {
	align-self: center;
	background: #fdecea;
	color: #a33a2f;
	border: 1px solid #f3c6c1;
	font-size: 12.5px;
}

#aaa-chat-typing {
	padding: 0 16px 8px;
	display: flex;
	gap: 4px;
}
#aaa-chat-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--aaa-gold);
	animation: aaa-bounce 1.2s infinite ease-in-out;
}
#aaa-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
#aaa-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes aaa-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

#aaa-chat-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e5e0d5;
	background: #fff;
}
#aaa-chat-input {
	flex: 1;
	border: 1px solid #ddd6c5;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 13.5px;
	outline: none;
}
#aaa-chat-input:focus { border-color: var(--aaa-gold); }
#aaa-send-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: var(--aaa-gold);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	flex-shrink: 0;
}

#aaa-send-btn:disabled { opacity: 0.5; cursor: default; }

#aaa-chat-footer {
	text-align: center;
	padding: 8px;
	font-size: 11.5px;
	border-top: 1px solid #f0ece0;
	background: #fff;
}
#aaa-chat-footer a { color: var(--aaa-green); text-decoration: none; font-weight: 600; }
#aaa-chat-footer a:hover { text-decoration: underline; }

@media (max-width: 480px) {
	#aaa-chat-panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 120px);
		bottom: 78px;
	}
}
