/* Vendor Hub Pro – گفت‌وگو (RTL، موبایل‌محور). همه‌ی قواعد زیر .vcx / .vhp-chat-* محدودند. */
.vcx, .vcx-inbox, .vcx-modal, .vcx-modal * { box-sizing: border-box; }
.vcx-inbox, .vcx-modal, .vhp-chat-row, .vhp-chat-box {
	--vc-navy: #0a2540; --vc-navy2: #123a63; --vc-gold: #b8913a; --vc-ink: #0f1f33; --vc-ink2: #55657c;
	--vc-line: #d5dde8; --vc-bg: #eef2f7; --vc-me: #0a2540; --vc-them: #fff; --vc-red: #a52a20;
	font-family: inherit; line-height: 1.7; color: var(--vc-ink);
}
html.vcx-lock, html.vcx-lock body { overflow: hidden; }

/* ----- دکمه‌ی شروع گفت‌وگو ----- */
.vhp-chat-row { margin: 12px 0; }
a.vhp-chat-btn, .vhp-chat-box a.vhp-chat-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 8px; border: 1px solid var(--vc-navy) !important; background: #fff !important; color: var(--vc-navy) !important; font-weight: 700; font-size: 14px; text-decoration: none !important; cursor: pointer; transition: background .15s, color .15s; }
a.vhp-chat-btn:hover { background: var(--vc-navy) !important; color: #fff !important; }
a.vhp-chat-btn svg { flex: none; }
.vhp-chat-box { margin: 24px 0; padding: 18px 20px; border: 1px solid var(--vc-line); border-radius: 10px; background: #f8fafd; }
.vhp-chat-box h2 { margin: 0 0 4px; font-size: 1.1em; }
.vhp-chat-box p { margin: 0 0 12px; color: var(--vc-ink2); font-size: .92em; }
.vhp-chat-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vhp-chat-box li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: #fff; border: 1px solid var(--vc-line); border-radius: 8px; }
.vhp-chat-box__name { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* ----- صندوق پیام ----- */
.vcx-inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: min(78vh, 720px); min-height: 460px; border: 1px solid var(--vc-line); border-radius: 12px; overflow: hidden; background: #fff; }
.vcx-side { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--vc-line); background: #fff; }
.vcx-side__h { padding: 12px 14px; background: var(--vc-navy); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.vcx-side__h strong { color: #fff; font-size: 14px; }
.vcx-tabs { display: flex; gap: 4px; }
.vcx-tabs button { padding: 2px 10px !important; border-radius: 99px !important; border: 1px solid rgba(255, 255, 255, .35) !important; background: transparent !important; color: #fff !important; font-size: 12px !important; cursor: pointer; min-height: 0 !important; line-height: 1.8 !important; }
.vcx-tabs button.is-on { background: #fff !important; color: var(--vc-navy) !important; }
.vcx-pick { padding: 10px 12px; background: #fdf6e3; border-bottom: 1px solid var(--vc-line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vcx-pick small { width: 100%; color: var(--vc-ink2); }
.vcx-threads { flex: 1; min-height: 0; overflow-y: auto; }
.vcx-th { display: flex !important; align-items: center; gap: 10px; width: 100%; padding: 12px 14px !important; border: 0 !important; border-bottom: 1px solid #edf1f6 !important; border-radius: 0 !important; background: #fff !important; color: var(--vc-ink) !important; text-align: start; cursor: pointer; font: inherit; min-height: 0 !important; }
.vcx-th:hover { background: #f3f7fc !important; }
.vcx-th.is-active { background: #e6eef8 !important; box-shadow: inset -4px 0 0 var(--vc-navy); }
.vcx-th__m { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vcx-th__m strong { font-size: 14px; display: flex; align-items: center; gap: 4px; color: var(--vc-ink); }
.vcx-th__m small { color: var(--vc-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcx-th.is-unread .vcx-th__m small { color: var(--vc-ink); font-weight: 700; }
.vcx-th__e { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.vcx-th__e small { color: var(--vc-ink2); font-size: 11px; }
.vcx-count { font-style: normal; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--vc-red); color: #fff; font-size: 11px; font-weight: 800; text-align: center; line-height: 20px; }
.vcx-tick { color: #1d9bf0; font-size: 12px; }
.vcx-flag { color: var(--vc-red); }
.vcx-av { width: 40px; height: 40px; border-radius: 10px; background: var(--vc-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; overflow: hidden; }
.vcx-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcx-empty, .vcx-loading, .vcx-err { padding: 22px 16px; text-align: center; color: var(--vc-ink2); font-size: 13px; }
.vcx-err { color: var(--vc-red); }

/* ----- گفت‌وگو ----- */
.vcx-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--vc-bg); }
.vcx-blank { margin: auto; text-align: center; color: var(--vc-ink2); }
.vcx-blank svg { width: 46px; height: 46px; opacity: .5; }
.vcx { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.vcx-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--vc-line); }
.vcx-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.vcx-ttl strong { font-size: 14px; color: var(--vc-ink); display: flex; align-items: center; gap: 4px; }
.vcx-ttl small { color: var(--vc-ink2); font-size: 12px; }
.vcx-ibtn { display: inline-flex !important; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--vc-ink2) !important; cursor: pointer; flex: none; }
.vcx-ibtn:hover { background: #eef2f7 !important; color: var(--vc-navy) !important; }
.vcx-back { display: none !important; }
.vcx-back svg { transform: scaleX(1); }
.vcx-menu { position: absolute; inset-inline-end: 12px; top: 52px; z-index: 5; min-width: 200px; background: #fff; border: 1px solid var(--vc-line); border-radius: 10px; box-shadow: 0 12px 30px -10px rgba(10, 37, 64, .35); overflow: hidden; }
.vcx-menu button { display: block !important; width: 100%; padding: 10px 14px !important; border: 0 !important; border-radius: 0 !important; background: #fff !important; color: var(--vc-ink) !important; text-align: start; font: inherit; font-size: 13px !important; cursor: pointer; min-height: 0 !important; }
.vcx-menu button:hover { background: #f3f7fc !important; }
.vcx-menu button.is-danger { color: var(--vc-red) !important; }
.vcx-ctx { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px; background: #f8fafd; border-bottom: 1px solid var(--vc-line); }
.vcx-card { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; background: #fff; border: 1px solid var(--vc-line); border-radius: 8px; text-decoration: none !important; color: var(--vc-ink) !important; max-width: 100%; }
.vcx-card img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; }
.vcx-card span { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.vcx-card small { color: var(--vc-ink2); font-size: 11px; }
.vcx-card b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.vcx-closed { width: 100%; padding: 8px 12px; border-radius: 8px; background: #fdf1d3; border: 1px solid #ebd18c; color: #6d4b00; font-size: 12.5px; }

.vcx-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; scroll-behavior: smooth; }
.vcx-msgs { display: flex; flex-direction: column; gap: 6px; }
.vcx-more { display: block !important; margin: 0 auto 10px !important; padding: 4px 14px !important; border-radius: 99px !important; border: 1px solid var(--vc-line) !important; background: #fff !important; color: var(--vc-navy) !important; font-size: 12px !important; cursor: pointer; min-height: 0 !important; }
.vcx-day { align-self: center; margin: 8px 0 2px; padding: 1px 12px; border-radius: 99px; background: rgba(10, 37, 64, .08); color: var(--vc-ink2); font-size: 11.5px; }
.vcx-m { display: flex; max-width: 100%; }
.vcx-m--me { justify-content: flex-start; }   /* در RTL ابتدای سطر = سمت راست */
.vcx-m--them { justify-content: flex-end; }
.vcx-m--auto, .vcx-m--sys { justify-content: center; }
.vcx-b { max-width: min(78%, 460px); padding: 7px 11px 5px; border-radius: 14px; background: var(--vc-them); border: 1px solid var(--vc-line); font-size: 14px; word-break: break-word; }
.vcx-m--me .vcx-b { background: var(--vc-me); border-color: var(--vc-me); color: #fff; border-top-right-radius: 4px; }
.vcx-m--them .vcx-b { border-top-left-radius: 4px; }
.vcx-m--auto .vcx-b, .vcx-m--sys .vcx-b { max-width: 90%; background: #fdf6e3; border-color: #ebd18c; color: #5b4300; text-align: center; font-size: 12.5px; }
.vcx-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.vcx-auto { display: block; font-weight: 800; font-size: 11px; opacity: .8; }
.vcx-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 2px; font-size: 10.5px; opacity: .65; }
.vcx-ck { display: inline-flex; }
.vcx-ck svg { width: 14px; height: 14px; }
.vcx-m--me.is-read .vcx-ck { color: #7fd1ff; opacity: 1; }
.vcx-m--me.is-failed .vcx-b { background: #7a1d16; border-color: #7a1d16; }
.vcx-img img { display: block; max-width: 100%; max-height: 240px; border-radius: 10px; margin-bottom: 4px; }
.vcx-newpill { position: absolute; inset-inline-start: 50%; transform: translateX(50%); bottom: 96px; z-index: 3; padding: 4px 14px !important; border-radius: 99px !important; border: 0 !important; background: var(--vc-navy) !important; color: #fff !important; font-size: 12px !important; cursor: pointer; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5); min-height: 0 !important; }
.vcx-typing { padding: 0 14px 4px; font-size: 12px; color: var(--vc-ink2); }
.vcx-quick { display: flex; gap: 6px; padding: 6px 10px; overflow-x: auto; background: #f8fafd; border-top: 1px solid var(--vc-line); }
.vcx-chip { flex: none; max-width: 220px; padding: 3px 12px !important; border-radius: 99px !important; border: 1px solid var(--vc-line) !important; background: #fff !important; color: var(--vc-navy) !important; font-size: 12.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; min-height: 0 !important; line-height: 1.8 !important; }
.vcx-chip:hover { background: #e6eef8 !important; }
.vcx-chip--edit { border-style: dashed !important; color: var(--vc-ink2) !important; }

.vcx-foot { position: relative; padding: 8px 10px 10px; background: #fff; border-top: 1px solid var(--vc-line); }
.vcx-notice { padding: 10px 12px; border-radius: 8px; background: #fae3df; color: var(--vc-red); font-size: 13px; text-align: center; }
.vcx-row { display: flex; align-items: flex-end; gap: 6px; }
.vcx-ta { flex: 1; min-height: 40px !important; max-height: 130px; padding: 9px 12px !important; border: 1px solid #b4c1d3 !important; border-radius: 12px !important; resize: none; font: inherit !important; font-size: 14px !important; line-height: 1.6 !important; background: #fff !important; color: var(--vc-ink) !important; box-shadow: none !important; }
.vcx-ta:focus { outline: 0; border-color: var(--vc-navy) !important; box-shadow: 0 0 0 3px rgba(10, 37, 64, .14) !important; }
.vcx-send { display: inline-flex !important; align-items: center; justify-content: center; width: 42px; height: 42px; min-height: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 12px !important; background: var(--vc-navy) !important; color: #fff !important; cursor: pointer; flex: none; }
.vcx-send:hover { background: var(--vc-navy2) !important; }
.vcx-send:disabled { opacity: .5; cursor: default; }
.vcx-send svg { transform: scaleX(-1); }
.vcx-prev { position: relative; display: inline-block; margin-bottom: 6px; }
.vcx-prev img { height: 64px; border-radius: 8px; display: block; border: 1px solid var(--vc-line); }
.vcx-prev button { position: absolute; top: -6px; inset-inline-start: -6px; width: 20px; height: 20px; min-height: 0 !important; padding: 0 !important; border-radius: 50% !important; border: 0 !important; background: var(--vc-red) !important; color: #fff !important; cursor: pointer; line-height: 1 !important; }
.vcx-emojis { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px; padding: 6px; border: 1px solid var(--vc-line); border-radius: 10px; background: #fff; }
.vcx-emojis button { width: 34px; height: 34px; min-height: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; font-size: 20px !important; cursor: pointer; border-radius: 6px !important; }
.vcx-emojis button:hover { background: #eef2f7 !important; }
.vcx-toast { position: absolute; inset-inline: 12px; bottom: 84px; z-index: 6; padding: 8px 12px; border-radius: 8px; background: #14233a; color: #fff; font-size: 13px; text-align: center; }
.vcx-edit { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; gap: 8px; padding: 16px; background: rgba(255, 255, 255, .98); }
.vcx-edit textarea { flex: 1; padding: 10px !important; border: 1px solid #b4c1d3 !important; border-radius: 8px !important; font: inherit !important; }
.vcx-edit__bar { display: flex; gap: 8px; }
.vcx-btn { padding: 8px 18px !important; border-radius: 8px !important; border: 1px solid var(--vc-navy) !important; background: var(--vc-navy) !important; color: #fff !important; font-weight: 700; cursor: pointer; min-height: 0 !important; }
.vcx-btn--ghost { background: #fff !important; color: var(--vc-navy) !important; }

/* ----- پنجره‌ی شناور ----- */
.vcx-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 20, 35, .55); }
.vcx-dialog { width: min(460px, 100%); height: min(640px, 100%); border-radius: 16px; overflow: hidden; background: var(--vc-bg); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); display: flex; flex-direction: column; }
.vcx-dialog .vcx { height: 100%; }

/* ----- نشان در منوها ----- */
.vhp-nav__badge { margin-inline-start: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: #a52a20; color: #fff; font-style: normal; font-size: 11px; font-weight: 800; text-align: center; line-height: 20px; }
.vhp-nav__badge[hidden] { display: none; }

@media (max-width: 760px) {
	.vcx-inbox { grid-template-columns: 1fr; height: 80vh; }
	.vcx-inbox .vcx-main { display: none; }
	.vcx-inbox.is-conv .vcx-side { display: none; }
	.vcx-inbox.is-conv .vcx-main { display: flex; }
	.vcx-inbox .vcx-back { display: inline-flex !important; }
	.vcx-modal { padding: 0; }
	.vcx-dialog { width: 100%; height: 100%; border-radius: 0; }
	.vcx-b { max-width: 86%; }
}
@media (prefers-reduced-motion: reduce) { .vcx-list { scroll-behavior: auto; } }
