/* «ذكية» — نافذة الدردشة. عربي RTL، هوية أكابرس: #4B2C5F + #EFD9A4.
   الموضع: أسفل اليمين دائماً (يمين فيزيائي، حتى في RTL) — أفضل ممارسات
   نوافذ الدردشة العالمية. */
.acaprs-dhakiya {
	font-family: inherit;
	direction: rtl;
	text-align: start;
}
.acaprs-dhakiya-float .acaprs-dhakiya-fab {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99990;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 18px 0 14px;
	border: 0;
	border-radius: 999px;
	background: #4b2c5f;
	color: #efd9a4;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.acaprs-dhakiya-float .acaprs-dhakiya-fab:focus-visible {
	outline: 3px solid #efd9a4;
	outline-offset: 2px;
}
.acaprs-dhakiya-fab-icon {
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	border-radius: 50%;
	object-fit: cover;
}
/* 1.0.8: تسمية زر الإطلاق «ذكية» — خط القاهرة فقط (لا تغيير في الحجم أو الموضع أو الألوان). */
.acaprs-dhakiya-fab-label {
	font-family: 'Cairo', sans-serif;
}
.acaprs-dhakiya-panel {
	position: fixed;
	right: 24px;
	bottom: 92px;
	z-index: 99991;
	width: min(380px, calc(100vw - 40px));
	max-height: min(560px, calc(100vh - 120px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
	overflow: hidden;
}
.acaprs-dhakiya-panel[hidden] {
	display: none;
}
.acaprs-dhakiya-inline .acaprs-dhakiya-fab {
	display: none;
}
.acaprs-dhakiya-inline .acaprs-dhakiya-panel {
	position: static;
	width: 100%;
	max-height: 560px;
}
.acaprs-dhakiya-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: #4b2c5f;
	color: #fff;
}
.acaprs-dhakiya-avatar {
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	border-radius: 50%;
	object-fit: cover;
}
.acaprs-dhakiya-head-text {
	flex: 1;
	display: flex;
	flex-direction: column;
}
.acaprs-dhakiya-head-text small {
	opacity: 0.85;
	font-size: 12px;
}
.acaprs-dhakiya-close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	min-width: 44px;
	min-height: 44px;
}
.acaprs-dhakiya-welcome-illo {
	text-align: center;
}
.acaprs-dhakiya-welcome-illo img {
	width: 110px;
	height: auto;
	border-radius: 12px;
}
.acaprs-dhakiya-messages {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #faf7ff;
	min-height: 180px;
}
.acaprs-dhakiya-msg {
	max-width: 88%;
	padding: 10px 12px;
	border-radius: 14px;
	font-size: 15px;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
}
.acaprs-dhakiya-msg a {
	color: #4b2c5f;
	font-weight: 700;
}
.acaprs-dhakiya-msg-bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e6ddf0;
}
.acaprs-dhakiya-msg-user {
	align-self: flex-end;
	background: #4b2c5f;
	color: #fff;
}
.acaprs-dhakiya-msg-user a {
	color: #efd9a4;
}
.acaprs-dhakiya-typing {
	font-style: italic;
	opacity: 0.7;
}
.acaprs-dhakiya-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 12px;
	border-top: 1px solid #eee;
	background: #fff;
}
.acaprs-dhakiya-chip {
	min-height: 36px;
	padding: 6px 12px;
	border: 1px solid #4b2c5f;
	border-radius: 999px;
	background: #fff;
	color: #4b2c5f;
	font-size: 13px;
	cursor: pointer;
}
.acaprs-dhakiya-chip:hover,
.acaprs-dhakiya-chip:focus-visible {
	background: #4b2c5f;
	color: #efd9a4;
}
.acaprs-dhakiya-form {
	display: flex;
	gap: 6px;
	padding: 10px;
	border-top: 1px solid #eee;
	background: #fff;
	box-sizing: border-box;
	width: 100%;
}
.acaprs-dhakiya-input {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 10px;
	font-size: 15px;
}
.acaprs-dhakiya-send,
.acaprs-dhakiya-voice {
	min-height: 44px;
	min-width: 44px;
	padding: 0 10px;
	box-sizing: border-box;
	flex: 0 0 auto;
	border: 0;
	border-radius: 10px;
	background: #4b2c5f;
	color: #efd9a4;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
/* 1.0.7: زر «إرسال» — خط القاهرة + تسمية متمركزة تماماً (يُصلح انحرافها لليسار في RTL). */
.acaprs-dhakiya-send {
	font-family: 'Cairo', sans-serif;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	margin: 0;
	transform: none;
	float: none;
}
.acaprs-dhakiya-voice {
	background: #efe9f5;
	color: #4b2c5f;
	font-size: 18px;
}
.acaprs-dhakiya-voice.is-listening {
	background: #c0392b;
	color: #fff;
}
.acaprs-dhakiya-speak {
	min-height: 44px;
	min-width: 44px;
	padding: 0 10px;
	box-sizing: border-box;
	flex: 0 0 auto;
	border: 0;
	border-radius: 10px;
	background: #efe9f5;
	color: #4b2c5f;
	font-size: 18px;
	cursor: pointer;
}
/* زر النطق مبدّل: إبراز ذهبي أثناء التشغيل، يزول عند الإيقاف/الانتهاء. */
.acaprs-dhakiya-speak.is-speaking {
	background: #efd9a4;
	color: #4b2c5f;
	box-shadow: inset 0 0 0 2px #4b2c5f;
}
/* 1.0.11: تصويت الزائر على الإجابة (حلقة التعلم) — لا يمس زر الإرسال أو الصوت أو الإطلاق. */
.acaprs-dhakiya-feedback {
	display: flex;
	gap: 6px;
	margin-top: 8px;
}
.acaprs-dhakiya-feedback-btn {
	min-height: 32px;
	min-width: 40px;
	padding: 4px 10px;
	border: 1px solid #d8cfe3;
	border-radius: 999px;
	background: #fff;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
}
.acaprs-dhakiya-feedback-btn:disabled {
	cursor: default;
	opacity: 0.55;
}
.acaprs-dhakiya-feedback-btn.is-selected-helpful {
	background: #d5f5e3;
	border-color: #1e8449;
}
.acaprs-dhakiya-feedback-btn.is-selected-not {
	background: #fde8e8;
	border-color: #b42318;
}
/* لوحة المدير */
.acaprs-dhakiya-status {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	background: #eee;
}
.acaprs-dhakiya-status.status-connected {
	background: #d5f5e3;
	color: #1e8449;
}
.acaprs-dhakiya-status.status-expiring {
	background: #fdebd0;
	color: #7d6608;
}
.acaprs-dhakiya-status.status-expired {
	background: #fdebd0;
	color: #b9770e;
}
.acaprs-dhakiya-status.status-not_connected {
	background: #eee;
	color: #555;
}
.acaprs-dhakiya-status.status-external {
	background: #d6eaf8;
	color: #1a5276;
}
.acaprs-dhakiya-status.status-ticket {
	background: #f9e79f;
	color: #7d6608;
}
.acaprs-dhakiya-status.status-flow {
	background: #e8daef;
	color: #4b2c5f;
}

/* ===== تجاوب الجوال (م2 — 1.0.14) =====
   على الجوال تصير اللوحة ورقة سفلية بعرض الشاشة، وبارتفاع dvh
   يتكيف مع شريط المتصفح ولوحة المفاتيح؛ وفي الوضع الأفقي قصير
   الارتفاع يُرفع قيد min-height عن الرسائل حتى لا يُقصّ نموذج
   الإدخال. خط الإدخال 16px يمنع تكبير iOS التلقائي عند التركيز. */
@media (max-width: 480px) {
	.acaprs-dhakiya-float .acaprs-dhakiya-fab { right: 16px; bottom: 16px; }
	.acaprs-dhakiya-float .acaprs-dhakiya-panel {
		right: 0;
		left: 0;
		bottom: 0;
		width: 100%;
		max-height: 88dvh;
		border-radius: 16px 16px 0 0;
	}
	.acaprs-dhakiya-messages { min-height: 0; }
	.acaprs-dhakiya-input { font-size: 16px; }
	.acaprs-dhakiya-chip { min-height: 44px; }
	.acaprs-dhakiya-feedback-btn { min-height: 44px; min-width: 48px; }
}
@media (max-height: 480px) {
	.acaprs-dhakiya-float .acaprs-dhakiya-panel { max-height: calc(100dvh - 76px); }
	.acaprs-dhakiya-messages { min-height: 0; }
}
