/* ====================================================================
   AMIR TEAM — قالب تمام‌صفحه‌ی چت (دسکتاپ ≥ 1280px)

   ساختار (RTL):
     .aat-shell
       ├─ .aat-shell-top     ← ۶ کاشی زنده + تیکر
       └─ .aat-shell-body
            ├─ .aat-widget-monitor   ← سایدبار (سمت راست)
            └─ .aat-widget-panel     ← پنل چت (بقیه‌ی عرض)

   روی موبایل/تبلت (< 1280px) و وقتی ویجت بسته است، .aat-shell و
   .aat-shell-body با display:contents «نامرئی» هستند و رفتار قبلی
   (پنل تمام‌صفحه‌ی fixed) دقیقاً حفظ می‌شود.

   تم: همان تم تیره‌ی سبز/زمردی افزونه (بدون نارنجی).
   ==================================================================== */

.aat-floating-widget {
	--aat-shell-pad: 10px;          /* فاصله‌ی داخلی قاب دور کل صفحه؛ برای چسبیدن کامل به لبه‌ها 0 کنید */
	--aat-shell-gap: 12px;
	--aat-sh-line: rgba(52, 211, 153, .26);
	--aat-sh-line-soft: rgba(52, 211, 153, .14);
	--aat-sh-card: rgba(8, 13, 22, .96);
	--aat-sh-accent: #26ffb0;
	--aat-sh-text: #eafff5;
	--aat-sh-muted: rgba(209, 250, 229, .72);
}

/* ---------------------------------------------------------------
   پایه (همه‌ی اندازه‌ها): پوسته شفاف است
   --------------------------------------------------------------- */
.aat-shell,
.aat-shell-body { display: contents; }
.aat-shell-top { display: none; }

/* هدر: نوار «تماس صوتی» و نوار «تماس تصویری» اکنون در HTML مستقیماً
   کنار هم، به‌عنوان دو فرزندِ همین هدر قرار دارند.
   برای این‌که این دو دکمه همیشه — مستقل از طول نام ایجنت، عرض صفحه، یا
   هر محاسبه‌ی نامطمئنِ دیگرِ چیدمان — دقیقاً در یک ردیفِ کاملاً جداگانه
   (زیرِ کارتِ ایجنت) بنشینند، به‌جای تکیه بر «سرریز طبیعی» (که وابسته به
   عرض محتواست و دقیقاً همان چیزی بود که قبلاً باعث به‌هم‌ریختگی/
   روی‌هم‌افتادن این دو دکمه با دکمه‌ی بستن می‌شد)، از ترفندِ استاندارد و
   قطعیِ «شکستِ خط اجباری در flexbox» استفاده شده: یک عنصرِ نامرئیِ
   ::before با flex-basis:100% درست بینِ ردیفِ اول (منو/کارتِ ایجنت/بستن)
   و ردیفِ دوم (دو دکمه‌ی تماس) قرار می‌گیرد؛ چون این عنصر به‌تنهایی کل
   عرضِ خط را اشغال می‌کند، هرچه از نظرِ order بعد از آن بیاید مجبور است
   به خطِ بعد برود — بدون هیچ وابستگی به اندازه‌ی محتوا. */
.aat-widget-header { flex-wrap: wrap; row-gap: 10px; }
.aat-widget-menu-btn { order: 1; }
.aat-widget-agent-switcher { order: 2; }
.aat-widget-close { order: 3; }
.aat-widget-header::before {
	content: "";
	order: 4;
	flex-basis: 100%;
	width: 0;
	height: 0;
}
.aat-widget-header .aat-voice-call-bar,
.aat-widget-header .aat-video-call-bar {
	order: 5;
	display: flex;
	flex: 1 1 calc(50% - 5px);
	min-width: 0;
	max-width: none;
	margin: 0;
}
.aat-widget-header .aat-video-call-bar { order: 6; }
/* اگر ایجنتی فقط تماس تصویری داشته باشد (نوار تماس صوتی با
 style="display:none" مخفی است)، نوار تماس تصویری به‌جای نیمه‌عرضِ
 تنها و بی‌قرینه، کل ردیف را می‌گیرد. */
.aat-widget-header:has(.aat-voice-call-bar[style*="display:none"]) .aat-video-call-bar,
.aat-widget-header:has(.aat-voice-call-bar[style*="display: none"]) .aat-video-call-bar {
	flex-basis: 100%;
}

.aat-widget-header .aat-voice-call-btn,
.aat-widget-header .aat-video-call-btn {
	width: 100%; height: auto;
	justify-content: center;
	gap: 8px;
	padding: 10px 10px;
	border-radius: 14px;
	color: #eafff5;
	font-size: 12px;
}
.aat-widget-header .aat-voice-call-btn {
	background: linear-gradient(100deg, #059669, #0d9488 60%, #10b981);
	border: 1px solid rgba(110, 231, 183, .55);
	box-shadow: 0 8px 22px rgba(4, 120, 87, .4);
}
.aat-widget-header .aat-voice-call-btn:hover,
.aat-widget-header .aat-voice-call-btn:active {
	background: linear-gradient(100deg, #10b981, #14b8a6 60%, #34d399);
}
.aat-widget-header .aat-voice-call-btn.aat-voice-connecting { background: #F4B740; color: #201a05; }
.aat-widget-header .aat-voice-call-btn.aat-voice-active { background: #FF5C7C; color: #fff; }
.aat-widget-header .aat-video-call-btn {
	background: linear-gradient(100deg, #4338ca, #2563eb 55%, #06b6d4);
	border: 1px solid rgba(125, 211, 252, .5);
	box-shadow: 0 8px 22px rgba(37, 99, 235, .35);
}
.aat-widget-header .aat-voice-call-btn > svg,
.aat-widget-header .aat-video-call-btn > svg {
	box-sizing: content-box;
	width: 16px; height: 16px;
	padding: 6px;
	border-radius: 10px;
	background: rgba(0, 0, 0, .28);
	flex-shrink: 0;
}

/* المان‌های اضافه‌ی کارت ایجنت/دکمه‌ها فقط در دسکتاپ دیده می‌شوند.
   نکته: aat-agent-card-text دیگر اینجا contents نمی‌شود — از نسخه‌ای که
   دکمه‌های «تیم» و «انتخاب ایجنت» داخل خودِ کارتِ ایجنت رفتند، این کلاس
   در حالت پایه/موبایل هم باید واقعاً یک باکس ستونی (نام روی وضعیت) باشد؛
   قبلاً همین قانون در تمام اندازه‌ها فعال بود و چیدمانِ کارت را در موبایل
   به‌هم می‌ریخت.
   دکمه‌ی «تماس صوتی» هم مثل دکمه‌ی «تماس تصویری» برچسبِ متنی نشان
   می‌دهد (نه فقط آیکن)، اما برای تشخیصِ بصری، رنگش سبز (متفاوت از
   آبی-بنفشِ ویدیو) است. */
.aat-agent-card-eyebrow,
.aat-agent-card-status,
.aat-call-btn-text small { display: none; }
.aat-voice-call-btn .aat-call-btn-text,
.aat-video-call-btn .aat-call-btn-text {
	display: inline-block;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	flex: 1 1 auto; min-width: 0;
}
.aat-call-btn-text b { font-size: 12px; font-weight: 800; }
.aat-chat-hero { display: none; }

/* ===============================================================
   دسکتاپ
   =============================================================== */
@media (min-width: 1280px) {

	/* ---------- قاب تمام‌صفحه ---------- */
	.aat-floating-widget.open .aat-shell {
		position: fixed;
		inset: 0;
		z-index: 999999;
		display: flex;
		flex-direction: column;
		gap: 10px;
		width: 100%;
		height: 100vh;
		height: 100dvh;
		padding: var(--aat-shell-pad);
		direction: rtl;
		color: var(--aat-sh-text);
		background:
			radial-gradient(900px 520px at 88% -8%, rgba(16, 185, 129, .17), transparent 62%),
			radial-gradient(800px 520px at 8% 112%, rgba(14, 165, 233, .12), transparent 62%),
			#04070f;
	}
	.aat-floating-widget.open .aat-shell-top {
		display: flex;
		flex-direction: column;
		gap: 8px;
		flex: 0 0 auto;
	}
	.aat-floating-widget.open .aat-shell-body {
		display: flex;
		flex-direction: row;
		flex: 1 1 auto;
		min-height: 0;
	}

	/* ---------- کاشی‌های بالا ---------- */
	.aat-shell-tiles {
		display: grid;
		grid-template-columns: repeat(6, minmax(0, 1fr));
		gap: 10px;
	}
	.aat-tile {
		position: relative;
		display: flex;
		align-items: center;
		gap: 10px;
		min-width: 0;
		padding: 12px 14px;
		border-radius: 16px;
		color: #f0fff8;
		background: linear-gradient(270deg, var(--t1, #0a6e55), var(--t2, #065f46));
		border: 1px solid var(--tb, rgba(110, 231, 183, .42));
		box-shadow: 0 6px 18px rgba(0, 0, 0, .45), 0 0 22px -8px var(--tb, transparent), inset 0 1px 0 rgba(255, 255, 255, .14);
		overflow: hidden;
	}
	.aat-tile-ico svg { width: 22px; height: 22px; }
	.aat-tile-txt { order: 1; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
	.aat-tile-badge,
	.aat-tile-sub { order: 2; flex: 0 0 auto; }
	.aat-tile-ico {
		order: 3;
		flex: 0 0 auto;
		width: 42px; height: 42px;
		border-radius: 12px;
		display: grid; place-items: center;
		background: rgba(0, 0, 0, .28);
		color: var(--tc, #a7f3d0);
	}
	.aat-tile-lbl { font-size: 13px; color: rgba(255, 255, 255, .78); font-weight: 500; }
	.aat-tile-val {
		font-size: 18px; font-weight: 900; color: #fff; line-height: 1.35;
		white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
		font-variant-numeric: tabular-nums;
	}
	.aat-tile-val small { font-size: 11px; font-weight: 600; opacity: .85; }
	.aat-tile-badge {
		display: inline-flex; align-items: center; gap: 5px;
		padding: 3px 9px;
		border-radius: 9px;
		font-size: 12px; font-weight: 800; white-space: nowrap;
		background: rgba(0, 0, 0, .35);
		color: #a7f3d0;
		border: 1px solid rgba(110, 231, 183, .4);
	}
	.aat-tile-badge.is-live::before {
		content: ''; width: 6px; height: 6px; border-radius: 50%;
		background: #34d399; box-shadow: 0 0 8px #34d399;
		animation: aatMonitorBlink 1.6s ease-in-out infinite;
	}
	.aat-tile-badge.is-up   { color: #86efac; border-color: rgba(134, 239, 172, .45); }
	.aat-tile-badge.is-down { color: #fda4af; border-color: rgba(253, 164, 175, .45); }
	.aat-tile-badge { color: #fff; border-color: rgba(255, 255, 255, .3); }
	.aat-tile-sub { font-size: 12px; color: rgba(255, 255, 255, .8); white-space: nowrap; }

	/* هر کاشی یک رنگ اختصاصی */
	.aat-tile[data-tile="date"]    { --t1: #6d28d9; --t2: #3b1a8a; --tb: rgba(196, 181, 253, .55); --tc: #ddd6fe; }  /* بنفش */
	.aat-tile[data-tile="time"]    { --t1: #1d4ed8; --t2: #172c73; --tb: rgba(147, 197, 253, .55); --tc: #bfdbfe; }  /* آبی */
	.aat-tile[data-tile="weather"] { --t1: #0e7490; --t2: #0b4a5e; --tb: rgba(103, 232, 249, .5);  --tc: #a5f3fc; }  /* فیروزه‌ای */
	.aat-tile[data-tile="credit"]  { --t1: #be185d; --t2: #6b0f3a; --tb: rgba(249, 168, 212, .55); --tc: #fbcfe8; }  /* سرخابی */
	.aat-tile[data-tile="usd"]     { --t1: #047857; --t2: #064e3b; --tb: rgba(110, 231, 183, .5);  --tc: #a7f3d0; }  /* سبز */
	.aat-tile[data-tile="gold"]    { --t1: #b45309; --t2: #6b3407; --tb: rgba(252, 211, 77, .55);  --tc: #fde68a; }  /* کهربایی/طلایی */
	.aat-tile[data-tile="credit"].is-clickable { cursor: pointer; }

	/* ---------- تیکر ---------- */
	.aat-shell-tickerbar {
		display: flex; align-items: center; gap: 12px;
		min-height: 42px;
		padding: 6px 10px;
		border-radius: 14px;
		background: var(--aat-sh-card);
		border: 1px solid var(--aat-sh-line);
	}
	.aat-shell-tickerbar-tag {
		flex: 0 0 auto;
		padding: 5px 12px;
		border-radius: 10px;
		font-size: 12px; font-weight: 800; color: #fff;
		background: linear-gradient(100deg, #c2410c, #d97706);
		border: 1px solid rgba(253, 186, 116, .6);
	}
	.aat-shell-tickerbar-body { flex: 1 1 auto; min-width: 0; }
	.aat-shell-tickerbar .aat-ticker {
		margin: 0; padding: 0;
		background: transparent; border: 0;
		backdrop-filter: none; -webkit-backdrop-filter: none;
		color: var(--aat-sh-text);
		--ad-text: #eafff5; --ad-muted: #a7f3d0; --ad-border: rgba(52, 211, 153, .35); --ad-primary-2: #26ffb0;
	}
	.aat-shell-tickerbar .aat-ticker-item a,
	.aat-shell-tickerbar .aat-ticker-item span { color: var(--aat-sh-text); }
	.aat-shell-tickerbar-status {
		flex: 0 0 auto;
		display: inline-flex; align-items: center; gap: 6px;
		padding: 4px 10px;
		border-radius: 10px;
		font-size: 10.5px; font-weight: 700; color: #a7f3d0;
		background: rgba(0, 0, 0, .3);
		border: 1px solid rgba(110, 231, 183, .35);
	}
	.aat-shell-tickerbar-status i {
		width: 7px; height: 7px; border-radius: 50%;
		background: #6b7280;
	}
	.aat-shell-tickerbar-status.is-ok i { background: #34d399; box-shadow: 0 0 8px #34d399; }
	.aat-shell-tickerbar-status.is-fail { color: #fda4af; border-color: rgba(253, 164, 175, .4); }

	/* ---------- سایدبار (مانیتور) ---------- */
	.aat-floating-widget.open .aat-widget-monitor {
		position: relative;
		display: block;
		flex: 0 0 var(--aat-monitor-w);
		width: var(--aat-monitor-w);
		height: 100%;
		margin-inline-end: var(--aat-shell-gap);
		overflow: visible;
		opacity: 1;
		transform: none;
		pointer-events: all;
		z-index: 1;
		border-radius: 22px;
		border: 1px solid var(--aat-sh-line);
		background: linear-gradient(170deg, rgba(9, 16, 26, .97), rgba(5, 9, 15, .99));
		box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
		transition: flex-basis .3s ease, width .3s ease, margin .3s ease, border-width .3s ease;
	}
	.aat-floating-widget.open.monitor-collapsed .aat-widget-monitor {
		margin-inline-end: 0;
		border-width: 0;
	}
	.aat-floating-widget.open .aat-monitor-inner {
		border-radius: inherit;
		padding: 14px 14px 22px;
	}
	.aat-floating-widget.open.monitor-collapsed .aat-monitor-inner {
		visibility: hidden;
		pointer-events: none;
	}

	/* دستگیره‌ی جمع/باز: روی لبه‌ی رو‌به‌پنل‌چتِ سایدبار (سمت چپِ آن) */
	.aat-floating-widget.open .aat-monitor-collapse-toggle {
		right: auto;
		left: -13px;
	}
	.aat-floating-widget.open .aat-monitor-collapse-toggle svg { transform: rotate(180deg); }
	.aat-floating-widget.open.monitor-collapsed .aat-monitor-collapse-toggle svg { transform: rotate(0deg); }

	/* کارت کاربر */
	.aat-widget-monitor .aat-monitor-account { padding-bottom: 14px; margin-bottom: 16px; }
	.aat-side-usercard {
		text-align: center;
		padding: 6px 0 12px;
		margin-bottom: 4px;
	}
	.aat-side-avatar-wrap { position: relative; width: 84px; height: 84px; margin: 0 auto 10px; }
	.aat-widget-monitor .aat-side-avatar {
		width: 100%; height: 100%;
		object-fit: cover;
		border-radius: 26px;
		border: 2px solid rgba(165, 180, 252, .7);
		box-shadow: 0 10px 30px -8px rgba(99, 102, 241, .55);
		background: #04121a;
		display: grid; place-items: center;
		font-size: 38px;
	}
	.aat-side-online {
		position: absolute; bottom: -3px; inset-inline-end: -3px;
		width: 18px; height: 18px; border-radius: 9px;
		background: #34d399; border: 3px solid #0a0d16;
		box-shadow: 0 0 10px #34d399;
	}
	.aat-widget-monitor .aat-side-username { font-size: 16px; font-weight: 800; color: #fff; }
	.aat-side-userrole {
		display: inline-block; margin-top: 6px;
		padding: 3px 10px; border-radius: 8px;
		font-size: 10.5px; color: #a7f3d0;
		background: rgba(0, 0, 0, .32);
		border: 1px solid rgba(110, 231, 183, .35);
	}

	/* دکمه‌های اکشن سایدبار — بزرگ‌تر، با آیکون‌های رنگی و مشخص برای هر عملکرد
	 تا کاربر سریع‌تر «گفتگوها»، «پنل کاربری» و … را از هم تشخیص دهد */
	.aat-widget-monitor .aat-side-action {
		display: flex; align-items: center; gap: 12px;
		width: 100%;
		padding: 10px 14px;
		margin-bottom: 8px;
		border-radius: 16px;
		text-align: start; font-family: inherit;
		color: var(--aat-sh-text);
		background: rgba(255, 255, 255, .03);
		border: 1px solid var(--aat-sh-line);
		transition: background .15s ease, border-color .15s ease, transform .15s ease;
	}
	.aat-widget-monitor .aat-side-action:hover { background: rgba(38, 255, 176, .08); border-color: rgba(38, 255, 176, .45); transform: translateY(-1px); }
	.aat-widget-monitor .aat-side-action.is-active { background: rgba(38, 255, 176, .12); border-color: rgba(38, 255, 176, .5); color: var(--aat-sh-text); }
	.aat-widget-monitor .aat-side-action-primary {
		background: linear-gradient(100deg, #6d28d9, #2563eb);
		border-color: rgba(196, 181, 253, .6);
		box-shadow: 0 6px 18px rgba(99, 60, 220, .35);
	}
	.aat-widget-monitor .aat-side-action-primary:hover { filter: brightness(1.12); background: linear-gradient(100deg, #6d28d9, #2563eb); }
	.aat-side-action-ico {
		flex: 0 0 auto;
		width: 42px; height: 42px; border-radius: 13px;
		display: grid; place-items: center;
		background: rgba(0, 0, 0, .28);
		color: #a7f3d0;
		box-shadow: 0 2px 8px rgba(0,0,0,.25);
	}
	.aat-side-action-ico .dashicons { font-size: 21px; width: 21px; height: 21px; }
	.aat-side-action-ico svg { width: 20px; height: 20px; }
	/* رنگ‌بندی مجزا برای هر اکشن: گفتگوی جدید = بنفش/آبی (روی زمینه‌ی گرادیانت خودش)،
	 گفتگوها = سبز زمردی، پنل کاربری = کهربایی/طلایی، ورود به حساب = آبی */
	.aat-side-action-primary .aat-side-action-ico { background: rgba(255, 255, 255, .18); color: #fff; }
	.aat-widget-monitor .aat-side-action.is-active .aat-side-action-ico { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
	.aat-widget-monitor .aat-side-action-panel .aat-side-action-ico { background: linear-gradient(135deg, #d97706, #f59e0b); color: #1a1203; }
	.aat-widget-monitor .aat-side-action.is-guest .aat-side-action-ico { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; }
	.aat-side-action-txt { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
	.aat-side-action-txt b { font-size: 14px; font-weight: 800; }
	.aat-side-action-txt small { font-size: 11px; color: var(--aat-sh-muted); }

	/* نمای «گفتگوها» در سایدبار: دکمه‌ی برگشت + جستجو + فهرست؛ بقیه‌ی بخش‌ها پنهان */
	.aat-side-back[hidden] { display: none; }
	.aat-widget-monitor.is-history-view .aat-side-back { display: flex; animation: aatHistIn .3s both; }
	/* دکمه‌ی «برگشت» رنگ مجزا (نارنجی-صورتی) می‌گیرد تا از بقیه‌ی دکمه‌ها متمایز و مشخص باشد */
	.aat-widget-monitor .aat-side-back {
		background: linear-gradient(100deg, rgba(251, 113, 133, .14), rgba(251, 146, 60, .12));
		border-color: rgba(251, 146, 60, .45);
	}
	.aat-widget-monitor .aat-side-back:hover { background: linear-gradient(100deg, rgba(251, 113, 133, .22), rgba(251, 146, 60, .2)); }
	.aat-widget-monitor .aat-side-back .aat-side-action-ico { background: linear-gradient(135deg, #f43f5e, #fb923c); color: #fff; }
	.aat-widget-monitor.is-history-view .aat-side-action:not(.aat-side-back),
	.aat-widget-monitor.is-history-view .aat-lsx,
	.aat-widget-monitor.is-history-view .aat-monitor-head { display: none; }
	.aat-widget-monitor.is-history-view .aat-monitor-account { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
	.aat-widget-monitor.is-history-view .aat-side-history-list { max-height: calc(100vh - 420px); min-height: 160px; }

	/* ---------- پنل چت ---------- */
	.aat-floating-widget.open .aat-widget-panel {
		position: relative;
		inset: auto;
		flex: 1 1 auto;
		min-width: 0;
		width: auto;
		max-width: none;
		height: 100% !important;
		top: auto !important;
		bottom: auto !important;
		max-height: none;
		border-radius: 22px;
		border: 1px solid var(--aat-sh-line);
		background: linear-gradient(180deg, rgba(8, 13, 22, .96), rgba(6, 10, 17, .98));
		box-shadow: 0 10px 40px rgba(0, 0, 0, .55);
	}
	.aat-floating-widget.open .aat-orb-3 { background: radial-gradient(circle, #10b981, transparent 70%); }

	/* ---------- هدر: کارت ایجنت + دکمه‌های تماس ---------- */
	.aat-floating-widget.open .aat-widget-header {
		flex-wrap: nowrap;
		gap: 12px;
		padding: 12px 14px;
		border-bottom: 1px solid var(--aat-sh-line-soft);
	}
	/* شکنِ خطِ اجباریِ حالتِ موبایل (که دو دکمه‌ی تماس را به ردیفِ دومِ
	 جداگانه می‌برد) اینجا لازم نیست — در دسکتاپ همه‌چیز در یک ردیف
	 (flex-wrap:nowrap بالا) کنار هم می‌ماند؛ پس این عنصر را غیرفعال
	 می‌کنیم تا خطِ دسکتاپ را نشکند. */
	.aat-floating-widget.open .aat-widget-header::before { content: none; display: none; }
	.aat-floating-widget.open .aat-widget-agent-switcher,
	.aat-floating-widget.open .aat-widget-header-center { display: contents; }

	/* کارت ایجنت: حالا هم آواتار/نام و هم دو دکمه‌ی هم‌اندازه‌ی «تیم» و
	 «انتخاب ایجنت» داخل همین یک کارت‌اند (قبلاً دکمه‌ی تیم یک قرصِ کاملاً
	 جدا و بیرون از این کارت بود). */
	.aat-floating-widget.open .aat-widget-agent-switcher-btn {
		order: 1;
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		max-width: none;
		min-width: 360px;
		padding: 12px 16px 12px 14px;
		border-radius: 18px;
		color: #fff;
		font-size: inherit;
		background: linear-gradient(100deg, #064e3b, #047857 55%, #0f766e);
		border: 1.5px solid rgba(110, 231, 183, .6);
		box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
	}
	.aat-floating-widget.open .aat-agent-card-top { display: flex; align-items: center; gap: 13px; }
	.aat-floating-widget.open .aat-widget-agent-switcher-avatar {
		width: 66px; height: 66px;
		border-radius: 16px;
		border: 2px solid rgba(167, 243, 208, .8);
		box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
		font-size: 24px;
	}
	.aat-floating-widget.open .aat-agent-card-text {
		display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
		flex: 1 1 auto; min-width: 0; text-align: start;
	}
	.aat-floating-widget.open .aat-agent-card-eyebrow { display: block; font-size: 10.5px; font-weight: 700; color: #a7f3d0; }
	.aat-floating-widget.open .aat-agent-card-text [data-role="agent-switcher-label"] { font-size: 19px; font-weight: 900; max-width: 100%; }
	.aat-floating-widget.open .aat-agent-card-status {
		display: inline-flex; align-items: center; gap: 6px;
		padding: 2px 9px; border-radius: 8px;
		font-size: 10.5px; font-weight: 600; color: #d1fae5;
		background: rgba(0, 0, 0, .32);
		border: 1px solid rgba(110, 231, 183, .35);
	}
	.aat-agent-card-status i {
		width: 7px; height: 7px; border-radius: 50%;
		background: #34d399; box-shadow: 0 0 8px #34d399;
	}
	/* ردیفِ دو دکمه‌ی هم‌اندازه‌ی «همه‌ی تیم‌ها» و «انتخاب ایجنت»، داخل خودِ کارت */
	.aat-floating-widget.open .aat-agent-card-picks { display: flex; gap: 8px; }
	.aat-floating-widget.open .aat-pick-chip {
		flex: 1 1 0;
		padding: 8px 10px;
		border-radius: 11px;
		font-size: 12px;
		gap: 6px;
	}
	.aat-floating-widget.open .aat-team-switcher-ico {
		width: 22px; height: 22px; border-radius: 7px;
		background: rgba(0, 0, 0, .25);
	}

	/* منوی انتخاب ایجنت/تیم: زیر کارت، هم‌راستا با لبه‌ی راستِ همان کارت
	 (هر دو دکمه حالا داخل یک کارت‌اند، پس هر دو منو هم دقیقاً زیر همان
	 کارت باز می‌شوند، نه وسط صفحه). */
	.aat-floating-widget.open .aat-widget-agent-switcher-menu,
	.aat-floating-widget.open .aat-widget-team-switcher-menu {
		top: calc(100% - 6px);
		right: 14px;
		left: auto;
		transform: none;
		min-width: 340px;
	}

	/* دکمه‌های تماس */
	.aat-floating-widget.open .aat-voice-call-bar,
	.aat-floating-widget.open .aat-video-call-bar {
		/* ریست کامل چیزهایی که در حالت پایه/موبایل ست شده‌اند (flex, min-width,
		 margin-top/bottom/right/left)؛ اینجا فقط order و margin-inline-start
		 صراحتاً ست می‌شدند و بقیه از حالت موبایل باقی می‌ماندند — همان چیزی که
		 باعث می‌شد در دسکتاپ نوارها روی هم بیفتند و به‌هم بریزند. */
		flex: 0 0 auto;
		min-width: 0;
		margin: 0;
		padding: 0;
		border: 0;
		background: transparent;
	}
	.aat-floating-widget.open .aat-voice-call-bar { order: 3; margin-inline-start: auto; }
	.aat-floating-widget.open .aat-video-call-bar { order: 4; }
	.aat-floating-widget.open .aat-voice-call-btn,
	.aat-floating-widget.open .aat-video-call-btn {
		width: auto; height: auto;
		gap: 10px;
		padding: 8px 16px 8px 14px;
		border-radius: 14px;
		color: #eafff5;
		font-size: 12px;
	}
	.aat-floating-widget.open .aat-voice-call-btn {
		background: linear-gradient(100deg, #059669, #0d9488 60%, #10b981);
		border: 1px solid rgba(110, 231, 183, .55);
		box-shadow: 0 8px 22px rgba(4, 120, 87, .4);
	}
	.aat-floating-widget.open .aat-voice-call-btn:hover { background: linear-gradient(100deg, #10b981, #14b8a6 60%, #34d399); transform: translateY(-1px); }
	.aat-floating-widget.open .aat-voice-call-btn.aat-voice-connecting { background: #F4B740; color: #201a05; }
	.aat-floating-widget.open .aat-voice-call-btn.aat-voice-active { background: #FF5C7C; color: #fff; }
	.aat-floating-widget.open .aat-video-call-btn {
		background: linear-gradient(100deg, #0369a1, #2563eb 55%, #4f46e5);
		border: 1px solid rgba(125, 211, 252, .5);
		box-shadow: 0 8px 22px rgba(37, 99, 235, .35);
	}
	.aat-floating-widget.open .aat-voice-call-btn > svg,
	.aat-floating-widget.open .aat-video-call-btn > svg {
		box-sizing: content-box;
		width: 16px; height: 16px;
		padding: 6px;
		border-radius: 10px;
		background: rgba(0, 0, 0, .28);
	}
	.aat-floating-widget.open .aat-call-btn-text,
	.aat-floating-widget.open .aat-video-call-btn .aat-call-btn-text {
		display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3;
	}
	.aat-floating-widget.open .aat-call-btn-text small { display: block; font-size: 9.5px; font-weight: 500; color: rgba(224, 255, 240, .85); }
	.aat-call-btn-text b { font-size: 13px; font-weight: 900; }

	.aat-floating-widget.open .aat-widget-menu-btn { order: 5; }
	.aat-floating-widget.open .aat-widget-close { order: 6; }
	.aat-floating-widget.open .aat-widget-menu-btn,
	.aat-floating-widget.open .aat-widget-close {
		width: 40px; height: 40px;
		border: 1px solid var(--aat-sh-line);
		background: rgba(255, 255, 255, .04);
	}
	.aat-floating-widget.open .aat-widget-menu-btn:hover,
	.aat-floating-widget.open .aat-widget-close:hover { background: rgba(38, 255, 176, .1); }

	/* ---------- هیرو (خوش‌آمدگویی + پیشنهادها) ---------- */
	.aat-floating-widget.open.aat-is-fresh .aat-chat-hero {
		position: relative; z-index: 1;
		display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
		gap: 10px;
		flex: 1 1 auto; min-height: 0;
		overflow-y: auto;
		padding: 18px 28px;
		text-align: center;
	}
	.aat-floating-widget.open.aat-is-fresh .aat-widget-messages { flex: 0 0 auto; max-height: 34%; }
	/* وسط‌چین امن: اگر جا کم بود، بالای محتوا بریده نشود و اسکرول شود */
	.aat-chat-hero > :first-child { margin-top: auto; }
	.aat-chat-hero > :last-child { margin-bottom: auto; }
	.aat-hero-badge {
		padding: 4px 14px; border-radius: 999px;
		font-size: 11.5px; font-weight: 700; color: #a7f3d0;
		background: rgba(16, 185, 129, .12);
		border: 1px solid rgba(52, 211, 153, .4);
	}
	.aat-hero-title {
		margin: 4px 0 0;
		font-size: clamp(22px, 2.3vw, 32px);
		font-weight: 900; line-height: 1.4; color: #fff;
	}
	.aat-hero-sub { margin: 0; font-size: 12.5px; color: var(--aat-sh-muted); }
	.aat-hero-cards {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
		width: min(880px, 100%);
		margin-top: 14px;
	}
	.aat-hero-cards:empty { display: none; }
	.aat-hero-card {
		display: flex; align-items: center; gap: 12px;
		padding: 14px 16px;
		border-radius: 16px;
		text-align: start; font-family: inherit;
		color: var(--aat-sh-text);
		background: rgba(9, 20, 27, .85);
		border: 1px solid rgba(52, 211, 153, .28);
		cursor: pointer;
		transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
	}
	.aat-hero-card:hover {
		border-color: rgba(38, 255, 176, .6);
		background: rgba(16, 185, 129, .1);
		transform: translateY(-2px);
		box-shadow: 0 10px 26px rgba(4, 120, 87, .25);
	}
	.aat-hero-card-ico {
		flex: 0 0 auto;
		width: 36px; height: 36px; border-radius: 11px;
		display: grid; place-items: center;
		color: #6ee7b7;
		background: rgba(16, 185, 129, .14);
		border: 1px solid rgba(52, 211, 153, .3);
	}
	.aat-hero-card-txt { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 700; line-height: 1.6; }

	/* پیام‌ها */
	.aat-floating-widget.open .aat-widget-messages { padding: 18px 26px; }
	.aat-floating-widget.open .aat-msg-bubble { max-width: 72%; }
	.aat-floating-widget.open .aat-msg-agent .aat-msg-bubble {
		background: rgba(255, 255, 255, .045);
		border: 1px solid rgba(52, 211, 153, .18);
		color: var(--aat-sh-text);
	}

	/* چیپ‌های پاسخ سریع جای خود را به کارت‌های هیرو داده‌اند */
	.aat-floating-widget.open .aat-quick-replies { display: none; }

	/* ورودی */
	.aat-floating-widget.open .aat-widget-toolbar { padding-inline: 22px; }
	.aat-floating-widget.open .aat-widget-input-form { padding: 10px 20px 8px; }
}

/* دسکتاپ کوچک: کاشی‌ها دو ردیف سه‌تایی شوند */
@media (min-width: 1280px) and (max-width: 1499px) {
	.aat-shell-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.aat-floating-widget.open .aat-widget-agent-switcher-btn { min-width: 300px; }
	.aat-floating-widget.open .aat-pick-chip { padding: 7px 8px; font-size: 11px; }
}

/* ارتفاع کم: هیرو فشرده‌تر */
@media (min-width: 1280px) and (max-height: 760px) {
	.aat-hero-cards { margin-top: 6px; }
	.aat-hero-card { padding: 9px 12px; }
	.aat-tile { padding: 8px 12px; }
}

@media (min-width: 1280px) {
	.aat-hero-title.is-anim { animation: aatHeroTitle .7s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes aatHeroTitle { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* عنوان در حال ساخته‌شدن توسط ایجنت: خط درخشان به‌جای متن */
@media (min-width: 1280px) {
	.aat-hero-title.is-loading {
		width: min(460px, 70%); height: 1.3em; margin-inline: auto; border-radius: 14px; color: transparent;
		background: linear-gradient(90deg, rgba(255, 255, 255, .06) 25%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .06) 75%);
		background-size: 200% 100%; animation: aatHeroShimmer 1.3s linear infinite;
	}
}
@keyframes aatHeroShimmer { to { background-position: -200% 0; } }

/* ====================================================================
   موبایل / تبلت (< 1280px): سایدبار به‌صورت کشوی کناری
   باز شدن از منوی همبرگری: «گفتگوهای من» و «آمار و پنل کاربری»
   ==================================================================== */
.aat-drawer-close { display: none; }
.aat-menu-mobile-only { display: flex; }
.aat-monitor-backdrop { display: none; }

@media (max-width: 1279px) {
	.aat-monitor-backdrop {
		display: block; position: fixed; inset: 0; z-index: 1000020;
		background: rgba(3, 4, 10, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
		opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s;
	}
	.aat-floating-widget.aat-drawer-open .aat-monitor-backdrop { opacity: 1; visibility: visible; transition: opacity .3s ease; }

	.aat-widget-monitor {
		position: fixed; top: 0; bottom: 0; right: 0; left: auto;
		width: min(88vw, 340px); max-width: none; height: auto;
		display: block; opacity: 1; z-index: 1000030;
		transform: translateX(104%); visibility: hidden; pointer-events: none;
		border-radius: 24px 0 0 24px; border: 1px solid var(--aat-sh-line); border-right: 0;
		background: linear-gradient(170deg, rgba(9, 16, 26, .985), rgba(5, 9, 15, .995));
		box-shadow: -18px 0 60px rgba(0, 0, 0, .55);
		transition: transform .4s cubic-bezier(.2, .8, .2, 1), visibility 0s .4s;
		direction: rtl;
	}
	.aat-floating-widget.aat-drawer-open .aat-widget-monitor {
		transform: none; visibility: visible; pointer-events: all;
		transition: transform .4s cubic-bezier(.2, .8, .2, 1), visibility 0s;
	}
	.aat-monitor-collapse-toggle { display: none !important; }
	.aat-widget-monitor .aat-monitor-inner {
		height: 100%; overflow-y: auto; border-radius: inherit;
		padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(28px + env(safe-area-inset-bottom, 0px));
	}
	.aat-drawer-close {
		position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; z-index: 3;
		display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
		color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
	}

	/* آواتار کاربر و دکمه‌ها (همان استایل دسکتاپ) */
	.aat-side-usercard { text-align: center; padding: 8px 0 12px; }
	.aat-side-avatar-wrap { position: relative; width: 84px; height: 84px; margin: 0 auto 10px; }
	.aat-widget-monitor .aat-side-avatar {
		width: 100%; height: 100%; object-fit: cover; border-radius: 26px; display: grid; place-items: center; font-size: 34px;
		border: 2px solid rgba(165, 180, 252, .7); box-shadow: 0 10px 30px -8px rgba(99, 102, 241, .55); background: #04121a;
	}
	.aat-side-online { position: absolute; bottom: -3px; inset-inline-end: -3px; width: 18px; height: 18px; border-radius: 9px; background: #34d399; border: 3px solid #0a0d16; box-shadow: 0 0 10px #34d399; }
	.aat-widget-monitor .aat-side-username { font-size: 16px; font-weight: 800; color: #fff; }
	.aat-side-userrole { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 8px; font-size: 10.5px; color: #a7f3d0; background: rgba(0, 0, 0, .32); border: 1px solid rgba(110, 231, 183, .35); }
	.aat-widget-monitor .aat-side-action {
		display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-bottom: 8px; box-sizing: border-box;
		border-radius: 16px; text-align: start; font-family: inherit; color: var(--aat-sh-text);
		background: rgba(255, 255, 255, .03); border: 1px solid var(--aat-sh-line);
	}
	.aat-widget-monitor .aat-side-action.is-active { background: rgba(38, 255, 176, .12); border-color: rgba(38, 255, 176, .5); }
	.aat-widget-monitor .aat-side-action-primary { background: linear-gradient(100deg, #6d28d9, #2563eb); border-color: rgba(196, 181, 253, .6); }
	.aat-side-action-ico { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(0, 0, 0, .28); color: #a7f3d0; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
	.aat-side-action-ico .dashicons { font-size: 21px; width: 21px; height: 21px; }
	.aat-side-action-ico svg { width: 20px; height: 20px; }
	.aat-side-action-primary .aat-side-action-ico { background: rgba(255, 255, 255, .18); color: #fff; }
	.aat-widget-monitor .aat-side-action.is-active .aat-side-action-ico { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
	.aat-widget-monitor .aat-side-action-panel .aat-side-action-ico { background: linear-gradient(135deg, #d97706, #f59e0b); color: #1a1203; }
	.aat-widget-monitor .aat-side-action.is-guest .aat-side-action-ico { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; }
	.aat-side-action-txt { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
	.aat-side-action-txt b { font-size: 14px; font-weight: 800; }
	.aat-side-action-txt small { font-size: 11px; color: var(--aat-sh-muted); }
	/* دکمه‌ی «برگشت» رنگ مجزا (نارنجی-صورتی) می‌گیرد تا از بقیه‌ی دکمه‌ها متمایز و مشخص باشد */
	.aat-widget-monitor .aat-side-back {
		background: linear-gradient(100deg, rgba(251, 113, 133, .14), rgba(251, 146, 60, .12));
		border-color: rgba(251, 146, 60, .45);
	}
	.aat-widget-monitor .aat-side-back .aat-side-action-ico { background: linear-gradient(135deg, #f43f5e, #fb923c); color: #fff; }
	.aat-side-back[hidden] { display: none; }

	/* نمای «گفتگوها» */
	.aat-widget-monitor.is-history-view .aat-side-back { display: flex; }
	.aat-widget-monitor.is-history-view .aat-side-action:not(.aat-side-back),
	.aat-widget-monitor.is-history-view .aat-lsx,
	.aat-widget-monitor.is-history-view .aat-monitor-head { display: none; }
	.aat-widget-monitor.is-history-view .aat-side-history-list { max-height: calc(100dvh - 250px); min-height: 140px; }
	.aat-widget-monitor .aat-monitor-account { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--aat-sh-line-soft); }
	.aat-widget-monitor.is-history-view .aat-monitor-account { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

	/* ابزارهای کارت گفتگو در موبایل همیشه دیده می‌شوند (hover ندارد) */
	.aat-side-history-tools { opacity: 1; }
}
@media (min-width: 1280px) {
	.aat-menu-mobile-only { display: none; }
}

/* ---------- فهرست گفتگوهای قبلی (دسکتاپ و موبایل) ---------- */
/* فهرست گفتگوهای قبلی: جستجو، سنجاق، حذف */
.aat-side-history { margin: 0 0 10px; }
.aat-side-history[hidden] { display: none; }
.aat-side-search {
	position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 0 10px;
	border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--aat-sh-line-soft);
	transition: border-color .2s, background .2s;
}
.aat-side-search:focus-within { border-color: rgba(165, 180, 252, .6); background: rgba(99, 102, 241, .1); }
.aat-side-search-ico { display: grid; place-items: center; color: var(--aat-sh-muted); }
.aat-side-search-input {
	flex: 1; min-width: 0; height: 36px; padding: 0; border: 0; outline: 0; background: transparent;
	color: var(--aat-sh-text); font: inherit; font-size: 12.5px;
}
.aat-side-search-input::placeholder { color: var(--aat-sh-muted); }
.aat-side-search-input::-webkit-search-cancel-button { display: none; }
.aat-side-search-clear { border: 0; background: rgba(255, 255, 255, .1); color: var(--aat-sh-text); width: 20px; height: 20px; border-radius: 50%; font-size: 10px; cursor: pointer; }
.aat-side-search-clear[hidden] { display: none; }

.aat-side-history-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-inline: 2px; scrollbar-width: thin; scrollbar-color: rgba(165, 180, 252, .3) transparent; }
.aat-side-history-note { padding: 12px 10px; text-align: center; font-size: 12px; color: var(--aat-sh-muted); }
.aat-side-history-item {
	position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
	width: 100%; padding: 9px 12px; padding-inline-end: 44px;
	border-radius: 12px; text-align: start; font-family: inherit; cursor: pointer; box-sizing: border-box;
	color: var(--aat-sh-text);
	background: rgba(255, 255, 255, .035);
	border: 1px solid var(--aat-sh-line-soft);
	animation: aatHistIn .35s both cubic-bezier(.2, .8, .2, 1);
	transition: background .15s, border-color .15s, transform .25s, opacity .25s, max-height .25s;
}
@keyframes aatHistIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.aat-side-history-item:hover, .aat-side-history-item:focus-visible { background: rgba(99, 102, 241, .14); border-color: rgba(165, 180, 252, .45); outline: 0; }
.aat-side-history-item.is-active { background: rgba(99, 102, 241, .2); border-color: rgba(165, 180, 252, .6); }
.aat-side-history-item.is-pinned { border-color: rgba(252, 211, 77, .35); }
.aat-side-history-item:has(.is-armed) { padding-inline-end: 84px; }
.aat-side-history-item.is-removing { opacity: 0; transform: translateX(24px) scale(.96); pointer-events: none; }
.aat-side-history-title { font-size: 12.5px; font-weight: 700; line-height: 1.6; width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.aat-side-pin-mark { display: inline-block; vertical-align: -2px; margin-inline-end: 5px; color: #fcd34d; }
.aat-side-history-snippet { font-size: 11px; line-height: 1.7; color: var(--aat-sh-muted); width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.aat-side-history mark { background: rgba(252, 211, 77, .28); color: #fef3c7; border-radius: 3px; padding: 0 2px; }
.aat-side-history-meta { display: flex; justify-content: space-between; gap: 8px; width: 100%; font-size: 10.5px; color: var(--aat-sh-muted); }

.aat-side-history-tools { position: absolute; top: 6px; inset-inline-end: 6px; display: flex; flex-direction: column; gap: 4px; opacity: 0; transition: opacity .15s; }
.aat-side-history-item:hover .aat-side-history-tools,
.aat-side-history-item:focus-within .aat-side-history-tools { opacity: 1; }
@media (hover: none) { .aat-side-history-tools { opacity: 1; } }
.aat-side-tool {
	display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; cursor: pointer;
	font: inherit; font-size: 10.5px; font-weight: 700; white-space: nowrap;
	color: var(--aat-sh-muted); background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .14);
	transition: color .15s, background .15s, border-color .15s;
}
.aat-side-tool:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.aat-side-tool.is-on { color: #fcd34d; border-color: rgba(252, 211, 77, .5); }
.aat-side-tool-del:hover { color: #fda4af; border-color: rgba(253, 164, 175, .5); }
.aat-side-tool-del.is-armed { color: #fff; background: #be123c; border-color: #fb7185; }

