/* ═══════════════════════════════════════════════════════════════════════
   دردش — كل التنسيق. التوكنز أولاً، ولا يُكتب hex خارج هذا القسم أبداً.
   RTL: logical properties حصراً — أي left/right صريحة خطأ برمجي.
   ═══════════════════════════════════════════════════════════════════════ */

/* خط واحد للكل — self-hosted بلا أي CDN خارجي (القسم 8.3). */
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plex-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/plex-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2190-2193, U+2212, U+2215;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plex-arabic-500.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plex-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2190-2193, U+2212, U+2215;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/plex-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/plex-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2190-2193, U+2212, U+2215;
}

:root {
  /* الوضع النهاري */
  --bg: #FAF7F2;            /* أبيض دافئ — وليس أبيض مستشفيات */
  --surface: #FFFFFF;
  --text: #1C1B18;
  --text-muted: #6E6A61;
  --border: #E7E1D6;
  --accent: #0E8A6D;
  --accent-hover: #0B7057;
  --accent-soft: #E3F2ED;   /* خلفية فقاعات رسائلي */
  --male: #1C1B18;          /* الذكر: أسود (قرار العلامة) */
  --female: #1565DB;        /* الأنثى: أزرق (قرار العلامة) */
  --danger: #C6453B;
  /* توكنز لازمة لتحقيق شرط التباين الإلزامي (القسم 8.2) — لا hex خارج هذه الكتلة */
  --on-accent: #FFFFFF;     /* النص فوق accent */
  --on-danger: #FFFFFF;     /* النص فوق danger */
  --border-strong: #8A8375; /* حدود عناصر الإدخال والأزرار — ≥ 3:1 (الفواصل تبقى --border) */
  --warn: #F6C445;          /* شريط انقطاع الاتصال */
  --on-warn: #2A2000;
  --radius: 12px;
  --radius-bubble: 14px;
  --font: "IBM Plex Sans Arabic", system-ui, sans-serif;

  --header-h: 56px;
  --shadow-card: 0 2px 16px rgb(28 27 24 / 8%);
}

/* الوضع الليلي — ثيم متوازن وليس انعكاساً */
[data-theme="dark"] {
  --bg: #14161B;
  --surface: #1D2027;
  --text: #ECEAE5;
  --text-muted: #9B978E;
  --border: #2B2F38;
  --accent: #19B389;
  --accent-hover: #2BC69B;
  --accent-soft: #1B2E29;
  --male: #ECEAE5;          /* القاعدة الدلالية: الذكر = المحايد القوي للثيم */
  --female: #6FA8FF;
  --danger: #E0655C;
  --on-accent: #06231B;     /* حبر داكن فوق الأخضر الفاتح — 6.2:1 */
  --on-danger: #2A0E0B;     /* حبر داكن فوق الأحمر الفاتح — 4.9:1 */
  --border-strong: #6C7180;
  --shadow-card: 0 2px 16px rgb(0 0 0 / 40%);
}

/* نفس قيم الليلي عند اتّباع تفضيل النظام (بلا اختيار صريح من المستخدم) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161B;
    --surface: #1D2027;
    --text: #ECEAE5;
    --text-muted: #9B978E;
    --border: #2B2F38;
    --accent: #19B389;
    --accent-hover: #2BC69B;
    --accent-soft: #1B2E29;
    --male: #ECEAE5;
    --female: #6FA8FF;
    --danger: #E0655C;
    --on-accent: #06231B;
    --on-danger: #2A0E0B;
    --border-strong: #6C7180;
    --shadow-card: 0 2px 16px rgb(0 0 0 / 40%);
  }
}

/* ─────────────────────────────── أساسيات ─────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  block-size: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0;          /* يُمنع أي تباعد أحرف على العربية */
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}

i, em { font-style: normal; }  /* يُمنع الـ italic نهائياً — التأكيد بالوزن أو اللون */

button, input, textarea {
  font: inherit;
  letter-spacing: 0;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.screen { block-size: 100dvh; }

/* ─────────────────────── شريط انقطاع الاتصال ─────────────────────────── */

.net-banner {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 50;
  margin: 0;
  padding-block: 6px;
  background: var(--warn);
  color: var(--on-warn);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* ───────────────────────────── شاشة الدخول ───────────────────────────── */

.screen-login {
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.card {
  inline-size: 100%;
  max-inline-size: 400px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.logo {
  margin: 0;
  color: var(--accent);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.tagline {
  margin: 2px 0 22px;
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
}

.field { margin-block-end: 16px; }

.field-label {
  display: block;
  margin-block-end: 6px;
  font-size: 14px;
  font-weight: 500;
}

.card input[type="text"],
.card input[type="number"],
.card input[type="password"] {
  inline-size: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 16px;              /* لا يقل عن 16px حتى لا يُكبّر iOS الحقل */
  text-align: start;
}

.card input::placeholder { color: var(--text-muted); }

.card input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gender {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gender-btn {
  min-block-size: 52px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
}

.gender-btn[data-gender="m"][aria-checked="true"] {
  border-color: var(--male);
  background: var(--surface);
  color: var(--male);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--male);
}

.gender-btn[data-gender="f"][aria-checked="true"] {
  border-color: var(--female);
  background: var(--surface);
  color: var(--female);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--female);
}

.form-error {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
}


.btn-primary {
  inline-size: 100%;
  min-block-size: 52px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 19px;              /* نص كبير: التباين المطلوب 3:1 */
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.terms {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.terms a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
}

.terms-strong {
  margin-block-start: 6px;
  color: var(--text);
  font-weight: 500;
}

/* ─────────────────────────── هيكل التطبيق ────────────────────────────── */

.screen-app {
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  align-items: center;
  block-size: var(--header-h);
  padding-inline: 14px;
  border-block-end: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

.online-count {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
}

.dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-inline-start: auto;
}

.badge {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 2px;
  min-inline-size: 18px;
  padding-inline: 4px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.badge-pulse { animation: badge-pop 220ms ease-out; }

@keyframes badge-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* ───────────────────────── لوحة المحادثات ──────────────────────────── */

.inbox {
  position: absolute;
  z-index: 20;
  inset-block-start: var(--header-h);
  inset-inline: 0;
  max-block-size: min(60dvh, 420px);
  border-block-end: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow-y: auto;
  animation: inbox-in 150ms ease-out;
}

@keyframes inbox-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.inbox-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.inbox-row {
  display: flex;
  gap: 10px;
  align-items: center;
  inline-size: 100%;
  min-block-size: 60px;
  padding: 8px 14px;
  border: none;
  border-block-end: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: start;
}

.inbox-row:hover { background: var(--accent-soft); }

.inbox-main {
  flex: 1;
  min-inline-size: 0;
}

.inbox-last {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-last[data-typing="true"] { color: var(--accent); }

.inbox-side {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  align-items: center;
}

.inbox-unread {
  min-inline-size: 20px;
  padding-inline: 5px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.presence {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.presence[data-online="true"] { background: var(--accent); }

.inbox-empty {
  margin: 0;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
}

/* ───────────────────────────── قائمة ⋮ ─────────────────────────────── */

.menu {
  position: absolute;
  z-index: 30;
  inset-block-start: calc(var(--header-h) - 6px);
  inset-inline-end: 8px;
  min-inline-size: 160px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.menu-item {
  display: block;
  inline-size: 100%;
  min-block-size: 44px;
  padding-inline: 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  cursor: pointer;
  text-align: start;
}

.menu-item:hover { background: var(--bg); }

.app-body {
  display: flex;
  flex: 1;
  min-block-size: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  min-block-size: 0;
}

.panel-users {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.panel-chat { flex: 1; }

/* الجوال: لوح واحد ظاهر */
.app-body[data-mobile="users"] .panel-chat { display: none; }
.app-body[data-mobile="chat"] .panel-users { display: none; }

/* ────────────────────── سطر الهوية (العنصر المميز) ───────────────────── */

.identity {
  display: flex;
  gap: 8px;
  align-items: center;
  min-inline-size: 0;
}

.identity-flag {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
}

.identity-name {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-name[data-gender="m"] { color: var(--male); }
.identity-name[data-gender="f"] { color: var(--female); }

.identity-age {
  flex-shrink: 0;
  padding-inline: 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.panel-chat .identity-age,
.chat-header .identity-age { background: var(--bg); }

/* ────────────────────────── قائمة المتصلين ──────────────────────────── */

/* ───────────────────── شريط المطابقة العشوائية ──────────────────────── */

.match-bar {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-block-end: 1px solid var(--border);
  background: var(--surface);
}

.btn-match {
  flex: 1;
  min-block-size: 44px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease;
}

.btn-match:hover { background: var(--accent-hover); }
.btn-match:disabled { opacity: 0.6; cursor: default; }

.match-filters {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 10px 12px;
  border-block-end: 1px solid var(--border);
  background: var(--bg);
}

.match-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.match-field select,
.match-field input {
  min-block-size: 40px;
  inline-size: 96px;
  padding-inline: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}

.match-notice {
  flex-shrink: 0;
  margin: 0;
  padding: 9px 12px;
  border-block-end: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.match-notice[data-tone="error"] { color: var(--danger); }

.users {
  margin: 0;
  padding: 0;
  list-style: none;
}

.user-row {
  display: flex;
  gap: 10px;
  align-items: center;
  inline-size: 100%;
  min-block-size: 52px;
  padding: 8px 14px;
  border: none;
  border-block-end: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: start;
}

.user-row:hover { background: var(--accent-soft); }
.user-row .identity { flex: 1; }

.user-row-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 18px;
}

.empty {
  display: grid;
  flex: 1;
  align-content: center;
  padding: 32px 24px;
  text-align: center;
}

.empty-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}

.empty-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.btn-share {
  min-block-size: 44px;
  margin-block-start: 14px;
  padding-inline: 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.btn-share:hover { background: var(--accent-soft); }

/* ───────────────────────────── المحادثة ─────────────────────────────── */

.chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-block-size: 0;
}

.chat-header {
  position: relative;
  display: flex;
  flex-shrink: 0;
  gap: 10px;
  align-items: center;
  min-block-size: var(--header-h);
  padding-inline: 10px;
  border-block-end: 1px solid var(--border);
  background: var(--surface);
}

.chat-identity { min-inline-size: 0; }

.chat-status {
  margin-inline-start: auto;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.chat-status[data-state="online"] { color: var(--accent); }
.chat-status[data-state="typing"] { color: var(--accent); font-weight: 500; }

.typing-dots::after {
  content: "...";
  animation: typing-pulse 1.2s ease-in-out infinite;
}

@keyframes typing-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

.icon-btn {
  position: relative;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.icon-btn:hover { background: var(--bg); }

.messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.msg {
  max-inline-size: min(76%, 560px);
  padding: 8px 12px;
  border-radius: var(--radius-bubble);
  animation: msg-in 150ms ease-out;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg-mine {
  align-self: flex-start;
  border-start-start-radius: 4px;
  background: var(--accent-soft);
}

.msg-theirs {
  align-self: flex-end;
  border: 1px solid var(--border);
  border-start-end-radius: 4px;
  background: var(--surface);
}

.msg-time {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: end;
}

.msg-pending { opacity: 0.55; }

.msg-day {
  align-self: center;
  color: var(--text-muted);
  font-size: 13px;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ────────────────────────── شريط الإدخال ────────────────────────────── */

.composer {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px;
  padding-block-end: max(10px, env(safe-area-inset-bottom));
  border-block-start: 1px solid var(--border);
  background: var(--surface);
}

.composer textarea {
  flex: 1;
  max-block-size: 7.6em;        /* ≈ 4 أسطر */
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.7;
  overflow-y: auto;
  resize: none;
}

.composer textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.composer textarea:disabled {
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
}

.char-count {
  align-self: center;
  color: var(--text-muted);
  font-size: 12px;
}

.char-count[data-over="true"] { color: var(--danger); }

.send-btn {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 18px;
  cursor: pointer;
  transition: background 120ms ease;
}

.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { opacity: 0.5; cursor: default; }

/* السهم يشير إلى جهة الإرسال المنطقية في RTL */
.send-btn > span { display: block; transform: scaleX(-1); }

.chat-notice {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 14px;
  border-block-start: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.chat-notice[data-tone="error"] { color: var(--danger); }

.mute-bar {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 14px;
  border-block-start: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* ═════════════ صفحة القواعد والخصوصية (rules.html) ═════════════ */

.doc-body {
  overflow-y: auto;
  background: var(--bg);
}

.doc {
  max-inline-size: 720px;
  margin-inline: auto;
  padding: 24px 20px 48px;
  padding-block-end: max(48px, env(safe-area-inset-bottom));
}

.doc-header {
  margin-block-end: 24px;
  padding-block-end: 20px;
  border-block-end: 1px solid var(--border);
  text-align: center;
}

.doc-header .logo { margin-block-end: 4px; }

.doc-subtitle {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 17px;
}

.doc-back {
  display: inline-block;
  min-block-size: 44px;
  padding-block: 10px;
  padding-inline: 4px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.doc-back:hover { text-decoration: underline; }

.doc-lead {
  margin: 0 0 28px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.9;
}

.doc-section { margin-block-end: 34px; }

.doc h2 {
  margin: 0 0 14px;
  padding-block-end: 8px;
  border-block-end: 2px solid var(--accent);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
}

.doc h3 {
  margin: 22px 0 8px;
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.doc p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.9;
}

.doc-list {
  margin: 0 0 14px;
  padding-inline-start: 22px;
}

.doc-list li {
  margin-block-end: 8px;
  font-size: 16px;
  line-height: 1.9;
}

/* الاستثناء الوحيد لقاعدة «لا رسائل على القرص» — يستحق تمييزاً بصرياً */
.doc-warn {
  padding: 14px 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: var(--surface);
}

.doc-note {
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

/* الجدول العريض يتمرر داخل حاويته — الصفحة نفسها لا تتمرر أفقياً أبداً */
.doc-table-wrap {
  margin-block-end: 14px;
  overflow-x: auto;
}

.doc-table {
  inline-size: 100%;
  min-inline-size: 420px;
  border-collapse: collapse;
  font-size: 15px;
}

.doc-table th,
.doc-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  line-height: 1.8;
  text-align: start;
  vertical-align: top;
}

.doc-table th {
  background: var(--surface);
  font-weight: 700;
}

.doc-footer {
  margin-block-start: 8px;
  padding-block-start: 20px;
  border-block-start: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
}

.doc-footer p {
  margin: 0 0 6px;
  font-size: 14px;
}

/* ──────────── محادثة إعلان الإدارة المثبّتة في لوحة المحادثات ──────────── */

.inbox-item {
  display: flex;
  align-items: stretch;
}

.inbox-item .inbox-row {
  flex: 1;
  min-inline-size: 0;
}

.inbox-pin {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

/* زر حذف الإعلان — يظهر على المحادثة المثبّتة وحدها، بنقرتين للتأكيد */
.inbox-delete {
  flex-shrink: 0;
  min-inline-size: 44px;
  padding-inline: 10px;
  border: none;
  border-block-end: 1px solid var(--border);
  border-inline-start: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.inbox-delete:hover,
.inbox-delete[data-confirm="true"] {
  background: var(--bg);
  color: var(--danger);
  font-weight: 700;
}

/* ────────────────────────── نافذة الإبلاغ ──────────────────────────── */

.overlay {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(0 0 0 / 45%);
}

.report-card { max-inline-size: 360px; }

.report-heading {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}

.report-hint {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.report-reasons {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-block-end: 10px;
}

.report-reasons .btn-small,
.report-cancel {
  min-block-size: 44px;
  padding-inline: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}

.report-reasons .btn-small:hover { background: var(--accent-soft); }

.report-cancel {
  inline-size: 100%;
  color: var(--text-muted);
}

/* ───────────────────────── شاشة الطرد/الحظر ─────────────────────────── */

.screen-blocked {
  display: grid;
  place-items: center;
  padding: 20px;
}

.blocked-card { text-align: center; }

.blocked-icon {
  margin: 0 0 8px;
  font-size: 42px;
  line-height: 1;
}

.blocked-title {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
}

.blocked-reason {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.blocked-until {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* ──────────────────────────── سطح المكتب ────────────────────────────── */

@media (min-width: 900px) {
  .app-body[data-mobile] .panel-users,
  .app-body[data-mobile] .panel-chat { display: flex; }

  .panel-users {
    flex: none;
    inline-size: 320px;
    border-inline-end: 1px solid var(--border);
  }

  .icon-btn.back-only { display: none; }
}

/* ─────────────────────── تقليل الحركة (إلزامي) ──────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
