/* ============================================================
   مبادرة — واجهة الشات v1
   كسوة كاملة للكلاسات القائمة بهوية مبادرة
   القاعدة: 4 داخل · 8 إخوة · 12 مقاطع · 16 قبل الفعل
   ============================================================ */

[hidden] { display: none !important; }

/* ===== قائمة المحادثات ===== */
.chv-list-wrap {
  max-width: 640px;
  margin-inline: auto;
  padding: 12px 12px 40px;
}
.chv-list-wrap .page-head { padding: 8px 4px 12px; }
.chv-list-wrap .page-head h1 {
  font-size: 20px;
  line-height: 28px;
  font-weight: var(--weight-bold);
  color: var(--ink);
  margin: 0;
}

.cv-list {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.cv {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-block-start: 0.5px solid var(--divider);
  transition: background var(--duration-fast) var(--ease-out);
}
.cv:first-child { border-block-start: none; }
.cv:hover { background: var(--stone-50); }
.cv-new { background: var(--accent-subtle); }
.cv-new:hover { background: var(--accent-subtle); }
.cv-link { position: absolute; inset: 0; z-index: 1; }

.cv-av {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background: var(--accent-subtle);
}
.cv-av .avimg,
.cv-av .cv-ph {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  display: block;
  overflow: hidden;
}
.cv-av .avblur { filter: blur(7px); }
.cv-ph {
  filter: blur(6px);
  transform: scale(1.15);
  background: radial-gradient(circle at 45% 32%, var(--indigo-100) 0%, var(--indigo-300) 40%, var(--indigo-500) 68%, var(--indigo-800) 100%);
}
.cv-av { overflow: visible; }
.cv-av > .avimg, .cv-av > .cv-ph { overflow: hidden; }
.cv-live {
  position: absolute;
  inset-block-end: 1px;
  inset-inline-start: 1px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--success);
  border: 2px solid var(--surface);
  z-index: 2;
}

.cv-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cv-mid b {
  font-size: 14px;
  line-height: 20px;
  font-weight: var(--weight-semibold);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}
.cv-mid small {
  font-size: 11.5px;
  line-height: 16px;
  color: var(--indigo-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-unread-s { color: var(--ink); font-weight: var(--weight-medium); }
.cv-you { color: var(--faint); }
.cv-st { color: var(--faint); font-size: 10.5px; }
.cv-delp { color: var(--faint); font-style: italic; }
.cv-req {
  display: inline-flex;
  align-items: center;
  height: 20px;
  font-size: 9.5px;
  font-style: normal;
  color: var(--accent);
  background: var(--accent-subtle);
  border-radius: var(--radius-pill);
  padding: 0 8px;
  font-weight: var(--weight-semibold);
}
.cv-new .cv-req { background: var(--surface); }

.cv-endc {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  z-index: 2;
  pointer-events: none;
}
.cv-tm {
  font-size: 10px;
  font-style: normal;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.cv-tm-hot { color: var(--accent); font-weight: var(--weight-semibold); }
.cv-n {
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.cv-n-req { background: var(--accent); }

/* فارغ */
.mh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 20px;
  text-align: center;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 16px;
}
.mh-empty-ic { color: var(--indigo-300); }
.mh-empty b { font-size: 15px; color: var(--ink); font-weight: var(--weight-semibold); }
.mh-empty small { font-size: 12px; color: var(--muted); }

/* ===== غرفة المحادثة ===== */
/* ===== إصلاح لوحة المفاتيح على iOS (نمط معياري موثّق) ===== */
/* قفل الصفحة: لا تتمرّر النافذة، فلا يختفي الرأس عند فتح لوحة المفاتيح */
html:has(.chat-w), body:has(.chat-w) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.chat-w {
  max-width: 640px;
  margin-inline: auto;
  height: 100dvh;                        /* fallback للمتصفحات الحديثة */
  height: var(--appvh, 100dvh);          /* يُضبط من visualViewport على iOS */
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;                      /* فقط .ch-msgs تتمرّر داخليًا */
}
.ch-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* الرأس */
.ch-top {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding-inline: 14px;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(10px);
  border-block-end: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}
.ch-back {
  font-size: 15px;
  color: var(--indigo-600);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}
.ch-back:hover { color: var(--accent); }
.ch-av {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent-subtle);
  display: block;
}
.ch-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-av .avblur { filter: blur(6px); }
.ch-av .cv-ph { width: 100%; height: 100%; display: block; }
.ch-tt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ch-tt b {
  font-size: 14px;
  line-height: 20px;
  font-weight: var(--weight-semibold);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-tt small {
  font-size: 10px;
  line-height: 14px;
  color: var(--indigo-400);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ch-livedot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
  flex-shrink: 0;
}
.ch-call {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding-inline: 12px;
  border: 1.5px solid var(--border-strong);
  color: var(--faint);
  border-radius: 8px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}
.ch-more {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--indigo-400);
  font-size: 17px;
  font-weight: var(--weight-bold);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.ch-more:hover { background: var(--accent-subtle); color: var(--accent); }
.ch-menu2 {
  position: absolute;
  inset-block-start: 52px;
  inset-inline-end: 14px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: var(--z-popover);
  min-width: 150px;
}
.ch-menu2 button {
  display: block;
  width: 100%;
  text-align: start;
  padding: 10px 12px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--body);
  font-family: var(--font-sans);
  border-radius: 8px;
  cursor: pointer;
}
.ch-menu2 button:hover { background: var(--stone-50); color: var(--danger); }

/* الرسائل */
.ch-msgs {
  flex: 1;
  overflow-y: auto;
  overflow-anchor: none;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dchip {
  align-self: center;
  font-size: 9.5px;
  color: var(--faint);
  background: var(--surface-sunk);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  margin-block: 4px;
}
.msg {
  max-width: 78%;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink);
  position: relative;
  word-break: break-word;
}
.msg p { margin: 0; }
.msg.me {
  align-self: flex-end;
  background: var(--accent-subtle);
  border-radius: 12px 12px 4px 12px;
}
.msg.them {
  align-self: flex-start;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px 12px 12px 4px;
}
[dir="rtl"] .msg.me { border-radius: 12px 12px 12px 4px; }
[dir="rtl"] .msg.them { border-radius: 12px 12px 4px 12px; }
.msg-q {
  border-inline-start: 2.5px solid var(--indigo-300);
  padding-inline-start: 10px;
  font-size: 11px;
  color: var(--indigo-600);
  margin-block-end: 6px;
  opacity: 0.9;
}
.msg-snap {
  display: inline-block;
  font-size: 12.5px;
  font-weight: var(--weight-semibold);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.msg-st {
  display: block;
  font-size: 8.5px;
  color: var(--indigo-400);
  margin-block-start: 4px;
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.msg-del { opacity: 0.75; }
.del-p {
  margin: 0;
  font-size: 12px;
  font-style: italic;
  color: var(--faint);
}

/* قائمة إجراءات الفقاعة */
.msg-acts {
  display: flex;
  gap: 6px;
  margin-block-start: -2px;
}
.msg-acts.me { align-self: flex-end; }
.msg-acts.them { align-self: flex-start; }
.msg-acts button {
  height: 26px;
  padding-inline: 12px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  color: var(--indigo-600);
  font-family: var(--font-sans);
  cursor: pointer;
}
.msg-acts button:hover { border-color: var(--accent); color: var(--accent); }
.msg-acts .ma-d:hover { border-color: var(--danger); color: var(--danger); }

/* الكتابة الآن */
.peek-slot { padding: 0 14px; min-height: 0; }
.peek-av {
  display: none;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
  width: fit-content;
  margin-block-end: 8px;
}
.peek-av.on { display: inline-flex; }
.pk-th { display: inline-flex; gap: 3px; }
.pk-th i {
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--indigo-400);
  animation: mb-typing 1.2s infinite var(--ease-out);
}
.pk-th i:nth-child(2) { animation-delay: 0.15s; }
.pk-th i:nth-child(3) { animation-delay: 0.3s; }
@keyframes mb-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* شريط الرد */
.ch-reply {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px;
  padding: 8px 12px;
  background: var(--accent-subtle);
  border-inline-start: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 11px;
  color: var(--indigo-800);
}
.ch-reply span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ch-reply button {
  border: none;
  background: none;
  color: var(--indigo-400);
  cursor: pointer;
  font-size: 12px;
  padding: 2px;
}

/* شريط الإدخال */
.ch-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-block-start: 0.5px solid var(--border);
  flex-shrink: 0;
}
.ch-in {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 14px;
  border: 1px solid var(--indigo-200);
  border-radius: 12px;
  background: var(--stone-50);
  font-size: 16px;   /* يمنع زوم iOS عند التركيز */
  font-family: var(--font-sans);
  color: var(--ink);
  resize: none;
  line-height: 1.6;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.ch-in:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  background: var(--surface);
}
.ch-ic {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  color: var(--indigo-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.ch-ic:hover { border-color: var(--accent); color: var(--accent); }
.ch-ic.rec { border-color: var(--danger); color: var(--danger); }
#chSend, .ch-send {
  width: 42px;
  height: 42px;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration-fast) var(--ease-out);
}
#chSend:hover, .ch-send:hover { background: var(--accent-hover); }

/* شريط قبولها */
.mb-lkbar--her { background: var(--accent-subtle); border-color: var(--indigo-200); }
.mb-lkbar--her .mb-lkbar__txt { color: var(--indigo-800); }

/* ===== المودالات (كسوة cmod) ===== */
.cmod {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cmod-ovl {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}
.cmod-card {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 340px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.cmod-t {
  font-size: 14.5px;
  font-weight: var(--weight-bold);
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.6;
}
.mh-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.8;
}
.mh-cic { display: none; }

/* ===== قائمة إجراءات المحادثة — صفوف رأسية أنيقة ===== */
#mhOpts .cmod-card { padding: 8px; max-width: 360px; text-align: right; }
#mhOpts .cv-av {
  width: 44px !important; height: 44px !important;
  margin: 14px auto 6px !important; display: block;
}
#mhOpts .cmod-t { text-align: center; margin-bottom: 10px; font-size: 15px; }
.mh-acts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}
.mh-acts > button {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 14px;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: var(--weight-semibold, 600);
  color: var(--ink, #1C1A17);
  cursor: pointer;
  text-align: right;
  transition: background var(--duration-fast, .1s) var(--ease-out, ease);
}
.mh-acts > button:hover { background: var(--surface-sunk, #F5F4F0); }
.mh-acts > button svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
  padding: 8px;
  box-sizing: content-box;
  border-radius: var(--radius-md, 8px);
  background: var(--surface-sunk, #F5F4F0);
  color: var(--body, #57544E);
}
/* الأفعال الخطرة: حظر وبلاغ */
#mhBlock, #mhReport { color: var(--danger, #B23A48); }
#mhBlock svg, #mhReport svg { background: var(--danger-bg, #FBEEF0); color: var(--danger, #B23A48); }
.mh-acts .mh-cancel {
  justify-content: center;
  color: var(--muted, #7A766F);
  margin-top: 4px;
  border-top: 1px solid var(--border, #E9E7E2);
  border-radius: 0;
  padding-top: 16px;
}
.mh-acts .mh-cancel:hover { background: none; color: var(--body); }

.cmod-btns {
  display: flex;
  gap: 8px;
}
.cmod-ok {
  flex: 1.1;
  height: 42px;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 10px;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
}
.cmod-ok:disabled { opacity: 0.45; cursor: default; }
.cmod-ok.mh-danger { background: var(--danger); }
.cmod-no {
  flex: 1;
  height: 42px;
  border: 0.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--body);
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
}
#rChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-block-end: 12px;
}
#rChips button {
  height: 30px;
  padding-inline: 14px;
  border: 0.5px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  color: var(--body);
  font-family: var(--font-sans);
  cursor: pointer;
}
#rChips button.on {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: var(--weight-semibold);
}
#rTxt {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--indigo-200);
  border-radius: 10px;
  background: var(--stone-50);
  font-size: 12px;
  font-family: var(--font-sans);
  resize: vertical;
  margin-block-end: 12px;
}
#rTxt:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }

/* أيقونة المايك الكبيرة داخل مودال الإملاء */
#micModal .mic-big {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent);
  margin-block-end: 12px;
  position: relative;
}
.mic-waves {
  position: absolute;
  inset-block-end: 10px;
  display: flex;
  gap: 2.5px;
  align-items: flex-end;
  height: 10px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}
#micModal.rec .mic-waves { opacity: 1; }
.mic-waves i {
  width: 2.5px;
  background: var(--accent);
  border-radius: var(--radius-pill);
  animation: mb-wave 0.9s infinite var(--ease-in-out);
  height: 4px;
}
.mic-waves i:nth-child(2) { animation-delay: 0.12s; }
.mic-waves i:nth-child(3) { animation-delay: 0.24s; }
.mic-waves i:nth-child(4) { animation-delay: 0.36s; }
.mic-waves i:nth-child(5) { animation-delay: 0.48s; }
@keyframes mb-wave { 0%,100% { height: 4px; } 50% { height: 10px; } }

/* النص الحي المُملى: محدود ولا يطغى على الأزرار */
.mic-live {
  min-height: 24px;
  max-height: 88px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--stone-50);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0 0 14px;
  text-align: start;
  word-break: break-word;
}
.cmod-re {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 0.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--indigo-600);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cmod-re:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 480px) {
  .msg { max-width: 84%; }
  .ch-call { padding-inline: 10px; font-size: 10.5px; }
}

/* ===== الاتصال الصوتي ===== */
.ch-call.is-on {
  border-color: var(--accent);
  color: var(--accent);
  cursor: pointer;
  background: var(--surface);
  transition: background var(--duration-fast) var(--ease-out);
}
.ch-call.is-on:hover { background: var(--accent-subtle); }

.call-chip {
  align-self: center;
  font-size: 10px;
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  margin-block: 2px;
}
.call-chip--ok   { color: var(--success); background: var(--success-bg); }
.call-chip--warn { color: var(--warning); background: var(--warning-bg); }
.call-chip--bad  { color: var(--danger);  background: var(--danger-bg); }

.mb-call {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 10);
  background: var(--indigo-900);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.mb-call__box {
  text-align: center;
  width: 100%;
  max-width: 300px;
}
.mb-call__av {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-inline: auto;
  box-shadow: 0 0 0 5px rgba(175, 169, 236, 0.22);
}
.mb-call__av img { width: 100%; height: 100%; object-fit: cover; filter: blur(9px); transform: scale(1.15); }
.mb-call__ph {
  display: block;
  width: 100%;
  height: 100%;
  filter: blur(8px);
  transform: scale(1.2);
  background: radial-gradient(circle at 45% 32%, var(--indigo-100) 0%, var(--indigo-300) 40%, var(--indigo-500) 68%, var(--indigo-800) 100%);
}
.mb-call__name {
  font-size: 18px;
  font-weight: var(--weight-bold);
  color: var(--stone-0);
  margin-block-start: 16px;
}
.mb-call__state {
  font-size: 12px;
  color: var(--indigo-300);
  margin-block-start: 6px;
  min-height: 18px;
  font-variant-numeric: tabular-nums;
}
.mb-call__pmute {
  display: inline-flex;
  align-items: center;
  margin-block-start: 8px;
  font-size: 10.5px;
  color: var(--warning);
  background: rgba(176, 130, 27, 0.18);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
}
.mb-call__btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-block-start: 28px;
}
.mb-call__b {
  flex: 1;
  max-width: 130px;
  height: 46px;
  border: none;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.mb-call__b:active { opacity: 0.85; }
.mb-call__b.ok     { background: var(--success); color: var(--stone-0); }
.mb-call__b.danger { background: var(--danger);  color: var(--stone-0); }
.mb-call__b.ghost  {
  background: transparent;
  border: 1px solid var(--indigo-600);
  color: var(--indigo-200);
}
.mb-call__b.ghost.on { background: var(--indigo-700); color: var(--stone-0); }

/* ===== بانر الوارد العائم ===== */
.mb-ring {
  position: fixed;
  inset-inline: 10px;
  inset-block-start: 10px;
  z-index: calc(var(--z-modal) + 5);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--indigo-900);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow-xl);
  max-width: 420px;
  margin-inline: auto;
  animation: mb-ring-in var(--duration-slow) var(--ease-spring);
}
@keyframes mb-ring-in {
  from { transform: translateY(-120%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.mb-ring__av {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  display: block;
}
.mb-ring__av img { width: 100%; height: 100%; object-fit: cover; filter: blur(6px); transform: scale(1.15); }
.mb-ring__av .mb-call__ph { width: 100%; height: 100%; display: block; }
.mb-ring__txt { flex: 1; min-width: 0; }
.mb-ring__txt b {
  display: block;
  font-size: 12.5px;
  color: var(--stone-0);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mb-ring__txt small { font-size: 9.5px; color: var(--indigo-300); }
.mb-ring__ok {
  height: 32px;
  padding-inline: 14px;
  border: none;
  background: var(--success);
  color: var(--stone-0);
  border-radius: 8px;
  font-size: 11px;
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  cursor: pointer;
  flex-shrink: 0;
}
.mb-ring__x {
  width: 32px;
  height: 32px;
  border: 1px solid var(--indigo-600);
  background: transparent;
  color: var(--indigo-300);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.cv-call-ok   { color: var(--success); font-weight: var(--weight-semibold); }
.cv-call-warn { color: var(--warning); font-weight: var(--weight-semibold); }
.cv-call-bad  { color: var(--danger);  font-weight: var(--weight-semibold); }

.mb-call__hint {
  margin-block-start: 14px;
  font-size: 11px;
  color: var(--indigo-200);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
  min-height: 16px;
}
.mb-call__hint.on { opacity: 1; }
.mb-call__b.danger.holding {
  transform: scale(0.94);
  filter: brightness(0.85);
  transition: transform 0.6s linear, filter 0.6s linear;
}

.mb-ring__tip {
  display: block;
  font-size: 8.5px;
  color: var(--indigo-400);
  margin-block-start: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-crown { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-inline-start: 2px; }
.grace-preview {
  background: var(--accent-subtle);
  border-radius: 12px 12px 4px 12px;
  padding: 10px 13px;
  font-size: 11.5px;
  color: var(--ink);
  line-height: 1.9;
  text-align: start;
  margin-block-end: 14px;
}

/* زر خيارات المحادثة (⋯) */
.cv-more {
  width: 34px; height: 34px; border-radius: 8px;
  background: none; border: none; color: var(--muted, #A8A5A0);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; position: relative; z-index: 2;
  transition: background 100ms ease;
}
.cv-more:hover { background: var(--surface-sunk, #F5F4F0); color: var(--body, #57544E); }

/* ===== مدخل أرشيف الرسائل ===== */
.cv-archentry {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border, #E9E7E2);
  border-radius: var(--radius-lg, 12px);
  padding: 15px 16px; margin: 12px;
  text-decoration: none;
  transition: border-color 150ms ease;
}
.cv-archentry:hover { border-color: var(--border-strong, #D8D5CE); }
.cv-archentry-ic {
  width: 38px; height: 38px; border-radius: var(--radius-md, 8px);
  background: var(--surface-sunk, #F5F4F0);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted, #7A766F); flex-shrink: 0;
}
.cv-archentry-txt { flex: 1; min-width: 0; }
.cv-archentry-t { display: block; font-size: 14px; font-weight: var(--weight-semibold, 600); color: var(--ink, #1C1A17); }
.cv-archentry-d { display: block; font-size: 11px; color: var(--muted, #A8A5A0); margin-top: 1px; }
.cv-archentry-n {
  font-size: 13px; color: var(--body, #7A766F); font-weight: var(--weight-bold, 700);
  background: var(--surface-sunk, #F5F4F0);
  min-width: 24px; height: 24px; border-radius: var(--radius-pill, 999px);
  display: flex; align-items: center; justify-content: center; padding: 0 6px;
}
.cv-archentry-arrow { color: var(--faint, #B8B4AB); font-size: 18px; }
.cv-archback {
  display: inline-block; font-size: 13px; color: var(--accent, #2D2A6E);
  text-decoration: none; font-weight: var(--weight-semibold, 600);
  margin: 0 12px 8px;
}

/* ===== نافذة البلاغ ===== */
#mhRepC .cmod-card { text-align: right; max-width: 360px; }
#mhRepC .cmod-t { text-align: center; }
#mhRepC .mh-sub { text-align: center; }
.mh-cic {
  display: flex !important; width: 44px; height: 44px;
  border-radius: 50%; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.mh-cic.warn { background: var(--danger-bg, #FBEEF0); color: var(--danger, #B23A48); }
.mh-cic.soft { background: var(--surface-sunk, #F5F4F0); color: var(--body, #57544E); }
.rp-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin: 4px 0 12px;
}
.rp-chips > button {
  font-family: var(--font-sans);
  font-size: 12.5px; font-weight: var(--weight-medium, 500);
  color: var(--body, #57544E);
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border-strong, #D8D5CE);
  border-radius: var(--radius-md, 8px);
  padding: 8px 13px; cursor: pointer;
  transition: all 120ms ease;
}
.rp-chips > button:hover { border-color: var(--stone-400, #B8B4AB); }
.rp-chips > button.on {
  border-color: var(--accent, #2D2A6E);
  background: var(--accent-subtle, #F4F3FA);
  color: var(--accent, #2D2A6E);
  font-weight: var(--weight-semibold, 600);
  box-shadow: inset 0 0 0 1px var(--accent, #2D2A6E);
}
.rp-txt {
  width: 100%; font-family: var(--font-sans); font-size: 14px;
  color: var(--ink, #1C1A17);
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border-strong, #D8D5CE);
  border-radius: var(--radius-md, 8px);
  padding: 11px 13px; resize: vertical; min-height: 60px;
  margin-bottom: 14px; box-sizing: border-box;
  line-height: 1.7;
}
.rp-txt:focus { outline: none; border-color: var(--accent, #2D2A6E); box-shadow: 0 0 0 3px var(--accent-ring, rgba(45,42,110,.2)); }
#rpSend { background: var(--accent, #2D2A6E); color: #fff; }
#rpSend:disabled { opacity: 0.45; }

/* ===== رسالة الطرف المحظور ===== */
.ch-banned-wrap { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 24px; }
.ch-banned { text-align: center; max-width: 380px; }
.ch-banned__ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--danger-bg); color: var(--danger);
  margin-block-end: 20px;
}
.ch-banned__title { display: block; font-size: 19px; font-weight: 700; color: var(--ink); margin-block-end: 10px; }
.ch-banned__sub { font-size: 14px; color: var(--body); line-height: 1.8; margin-block-end: 24px; }

/* أيقونة الحذف: توفيق (أخضر) أو عام (رمادي) */
.ch-banned__ic--ok { background: var(--success-bg); color: var(--success); }
.ch-banned__ic--muted { background: var(--surface-sunk); color: var(--muted); }

/* ===== حالة انتظار الموافقة (اهتمام معلّق، لا رسائل) ===== */
.ch-wait {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin: auto; padding: var(--space-6) var(--space-5);
  max-width: 320px; align-self: center;
}
.ch-wait__ic {
  width: 64px; height: 64px; border-radius: var(--radius-full);
  background: var(--accent-subtle); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-block-end: var(--space-4);
}
.ch-wait__title { font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--ink); margin-block-end: var(--space-2); }
.ch-wait__sub { font-size: var(--text-sm); color: var(--muted); line-height: var(--leading-relaxed); margin-block-end: var(--space-5); }
.ch-wait__card {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-xs);
}
.ch-wait__av {
  width: 44px; height: 44px; border-radius: var(--radius-full);
  overflow: hidden; flex-shrink: 0; background: var(--accent-subtle);
  display: flex; align-items: center; justify-content: center;
}
.ch-wait__av img { width: 100%; height: 100%; object-fit: cover; }
.ch-wait__nm { text-align: start; }
.ch-wait__nm b { display: block; font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--ink); }
.ch-wait__nm small { font-size: var(--text-xs); color: var(--muted); }

/* منطقة الرسائل تسمح بتوسيط الحالة عمودياً */
.ch-msgs:has(.ch-wait) { display: flex; flex-direction: column; justify-content: center; }

/* حالة الانتظار v2: الشارة والفاصل والملاحظة */
.ch-wait__status {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  color: var(--warning); background: var(--warning-bg);
  padding: 3px 12px; border-radius: var(--radius-pill);
  margin-block-end: var(--space-3);
}
.ch-wait__or {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; font-size: var(--text-2xs); color: var(--muted);
  font-weight: var(--weight-semibold);
  margin-block: var(--space-1) var(--space-3);
}
.ch-wait__or::before, .ch-wait__or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ch-wait__note { font-size: var(--text-2xs); color: var(--muted); line-height: var(--leading-normal); margin-block-start: var(--space-3); }
.ch-wait__note b { color: var(--success); font-weight: var(--weight-bold); }
.ch-wait .mb-btn--block + .ch-wait__or { margin-block-start: var(--space-2); }

/* ===== لوحة القفل (رسائل سابقة + مراسلة مغلقة) ===== */
.ch-msgs.is-locked { opacity: .55; pointer-events: none; }
.ch-lkpanel {
  background: var(--surface);
  border-block-start: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  text-align: center;
  flex-shrink: 0;
}
.ch-lkpanel__t {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--ink);
  margin-block-end: 3px;
}
.ch-lkpanel__t svg { color: var(--muted); }
.ch-lkpanel__d {
  font-size: var(--text-xs); color: var(--body); line-height: var(--leading-normal);
  max-width: 420px; margin: 0 auto var(--space-3);
}
.ch-lkpanel__d b { color: var(--ink); }
.ch-lkpanel__row { display: flex; gap: var(--space-2); max-width: 420px; margin-inline: auto; }
.ch-lkpanel__row .mb-btn { flex: 1; }

/* ===== تنبيه منع الروابط ===== */
.ch-lwarn {
  display: flex; gap: var(--space-2); align-items: flex-start;
  margin: 0 var(--space-3) var(--space-2);
  background: var(--danger-bg);
  border: 1px solid rgba(178, 58, 72, .25);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  animation: mb-toast-in var(--duration-base) var(--ease-spring);
}
.ch-lwarn > svg { color: var(--danger); flex-shrink: 0; margin-block-start: 1px; }
.ch-lwarn__t { flex: 1; min-width: 0; }
.ch-lwarn__t b { display: block; font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--danger); margin-block-end: 1px; }
.ch-lwarn__t span { display: block; font-size: var(--text-2xs); color: var(--body); line-height: var(--leading-normal); }
.ch-lwarn__t small { display: block; font-size: 10.5px; color: var(--muted); margin-block-start: 3px; }
.ch-in.is-linkbad { border-color: var(--danger) !important; }
