/* لا تظليل أزرق عند اللمس في أي شاشة، القديمة منها أيضًا */
html, body, * { -webkit-tap-highlight-color: transparent; }
/*
 * أنماط الشاشات القديمة (البوابة، الأصدقاء، الإشعارات، القارئ القديم…).
 *
 * كل محدِّد هنا محروس بـ`:not(.v35 *)`: الواجهة الجديدة تعيش داخل `.v35`
 * بأسماء عامة مثل `.hero` و`.page` و`.grid`، وبلا الحارس كانت هذه الأنماط
 * تتسرّب إليها (البانر مثلًا انضغط بحشوة `.hero` القديمة). الحارس يُزال مع
 * الملف كله حين تُنقل آخر شاشة.
 */
/**
 * نظام VANTARA البصري.
 *
 * أسود عميق، بنفسجي هادئ، حواف مستديرة، صور كبيرة، خطوط بسيطة، حركة ناعمة،
 * ولا ازدحام. Mobile first: كل مقاس هنا مكتوب للهاتف أولًا، والشاشة الكبيرة
 * تتسع لا تتغير.
 *
 * ليس لوحة تحكم. لا جداول كثيفة ولا حدود حادة ولا نصوص صغيرة متلاصقة.
 */

:root {
  color-scheme: dark;

  --bg: #08070c;
  --surface: #0a0a0d;
  --surface-2: #101015;
  --surface-3: #16161c;
  --line: #1c1c24;
  --line-soft: #15151b;

  --text: #f6f6fa;
  --text-dim: #a2a2ae;
  --muted: #74747f;

  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-line: rgba(139, 92, 246, 0.34);

  --online: #3fd07f;
  --reading: #8b5cf6;
  --idle: #e5b85d;
  --offline: #4a4a53;
  --danger: #ff5b73;

  /* الحواف: كبيرة بقصد. الحافة الحادة تُقرأ كواجهة إدارية */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;

  --max: 1060px;
  --tabbar-h: 64px;

  font-family: 'Vantara Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
/*
 * `overflow-x: clip` لا `hidden`: سفاري الآيفون يجعل body بـ`hidden` حاويةَ تمرير،
 * فيصير كل `position: fixed` (الشريط السفلي، المشغّل) نسبيًا لها ويتحرك مع
 * المحتوى — الشريط يطلع في منتصف الشاشة بعد التمرير. `clip` يقصّ بلا تمرير.
 */
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); overflow-x: clip; }
@supports not (overflow: clip) { body { overflow-x: hidden; } }
button:not(.v35 *), input:not(.v35 *) { font: inherit; color: inherit; }
button:not(.v35 *) { background: none; border: none; cursor: pointer; }
button:disabled:not(.v35 *) { opacity: .5; cursor: default; }
h1:not(.v35 *), h2:not(.v35 *), h3:not(.v35 *), p:not(.v35 *) { margin: 0; }
.hidden:not(.v35 *) { display: none !important; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 0; height: 0; }

/* اللاتيني بخط النظام: خط النسخ العربي يرسم الأرقام واللاتينية ضعيفة */
.latin:not(.v35 *), .topbar__title:not(.v35 *), .drawer__me-user:not(.v35 *), .profile__user:not(.v35 *), .stats__value:not(.v35 *), .reader__page:not(.v35 *) {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* الاتجاه أيضًا: `@mansour` في سياق RTL يُرسم `mansour@` */
.drawer__me-user:not(.v35 *), .profile__user:not(.v35 *) { direction: ltr; text-align: start; }

/* الأيقونات ترث اللون والحجم من الزر، فلا تُعدّل كل واحدة وحدها */
.icon:not(.v35 *) { display: block; flex: 0 0 auto; }

.state:not(.v35 *) { padding: 26px 8px; color: var(--muted); text-align: center; font-size: 14px; }
.state--error:not(.v35 *) { color: var(--danger); }

/* بطاقة توصية: غلاف صغير ونصّ، والأزرار تلتفّ على الشاشة الضيقة */
.rec:not(.v35 *) { display: flex; gap: 12px; padding: 12px 0; align-items: flex-start; }
.rec__shot:not(.v35 *) { flex: 0 0 56px; width: 56px; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--surface, #1a1a1a); }
.rec__shot--blank:not(.v35 *) { opacity: 0.4; }
.rec__cover:not(.v35 *) { width: 100%; height: 100%; object-fit: cover; }
.rec__meta:not(.v35 *) { flex: 1 1 auto; min-width: 0; }
.rec__title:not(.v35 *) { font-weight: 600; }
.rec__from:not(.v35 *) { color: var(--muted); font-size: 12px; margin-top: 2px; }
.rec__note:not(.v35 *) { color: var(--text-dim); font-size: 13px; line-height: 1.6; margin: 6px 0 0; }
.rec__state:not(.v35 *) { color: var(--muted); font-size: 12px; margin-top: 6px; }
.rec__actions:not(.v35 *) { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* مصدرٌ لم يردّ: خبرٌ يُقال ولا يُصرَخ به، فالنتائج الباقية معروضة فوقه */
.state--dim:not(.v35 *) { padding: 10px 8px; font-size: 12px; opacity: 0.65; }

.skeleton:not(.v35 *) { position: relative; overflow: hidden; background: var(--surface-2); }
.skeleton:not(.v35 *)::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .045), transparent);
  animation: sweep 1.5s ease-in-out infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ───────────────────────────── عناصر مشتركة ───────────────────────────── */

.btn:not(.v35 *) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 700;
  transition: transform .16s ease, filter .16s ease;
}
.btn:active:not(.v35 *) { transform: scale(.975); }
.btn:hover:not(:disabled):not(.v35 *) { filter: brightness(1.09); }
.btn--ghost:not(.v35 *) { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn--small:not(.v35 *) { min-height: 38px; padding: 0 14px; font-size: 13px; }
/* الخيار المختار الآن — حلقة لا لون وحده، فالفرق يُرى بلا تمييز الألوان */
.btn--on:not(.v35 *) { outline: 2px solid var(--accent, #7c5cff); outline-offset: 2px; }

.pill:not(.v35 *) {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-dim);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pill--accent:not(.v35 *) { background: var(--accent-soft); color: #c4a5ff; }
/* حالة مزامنة غير سليمة: تُقرأ كتحذير لا كمعلومة عادية */
.pill--warn:not(.v35 *) { background: rgba(240, 160, 60, 0.16); color: #f0a03c; }

.avatar:not(.v35 *) {
  flex: 0 0 auto; display: block;
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; background: var(--surface-3);
}
.avatar--letter:not(.v35 *) {
  display: grid; place-items: center;
  background: linear-gradient(150deg, #2a1d45, #120c1f);
  color: #c4a5ff; font-weight: 800;
}
.avatar--xs:not(.v35 *) { width: 22px; height: 22px; font-size: 11px; }
.avatar--sm:not(.v35 *) { width: 32px; height: 32px; font-size: 14px; }
.avatar--md:not(.v35 *) { width: 46px; height: 46px; font-size: 18px; }
.avatar--lg:not(.v35 *) { width: 54px; height: 54px; font-size: 22px; }
.avatar--xl:not(.v35 *) { width: 84px; height: 84px; font-size: 34px; border: 3px solid var(--bg); }

.dot:not(.v35 *) {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--offline); box-shadow: 0 0 0 2px var(--bg);
}
.dot--online:not(.v35 *) { background: var(--online); }
.dot--reading:not(.v35 *) { background: var(--reading); }
.dot--idle:not(.v35 *) { background: var(--idle); }
.dot--offline:not(.v35 *) { background: var(--offline); }

/* ───────────────────────────── «من يتابع؟» (v35) ───────────────────────────── */

.gate:not(.v35 *) {
  position: relative; min-height: 100dvh; display: grid; place-items: center;
  overflow: hidden; isolation: isolate; background: #02010A; color: #f5f5f7;
}
.gate__backdrop:not(.v35 *) { position: absolute; inset: 0; z-index: -3; overflow: hidden; background: #02010A; }
.gate__canvas:not(.v35 *) { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* تعتيم أسفل الحرير: الاسم والزر يجلسان هنا ويبقيان مقروءين مع أي لوحة */
.gate__shade:not(.v35 *) {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.03) 0%, rgba(0,0,0,.01) 40%, rgba(0,0,0,.18) 72%, rgba(0,0,0,.58) 100%);
}
.gate__inner:not(.v35 *) {
  position: relative; z-index: 1; width: min(100vw, 460px); max-width: 100vw; min-width: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
  text-align: center; transform: translateY(16px);
}
.gate__brand:not(.v35 *) { display: grid; justify-items: center; gap: 9px; margin-bottom: 20px; pointer-events: none; }
.gate__logo-mark:not(.v35 *) {
  width: 80px; height: 80px; transform: translateX(4px);
  background-color: var(--gate-logo, #a874ff);
  -webkit-mask: url('/icons/logo-mark.png') center / contain no-repeat;
  mask: url('/icons/logo-mark.png') center / contain no-repeat;
  transition: background-color .55s cubic-bezier(.22, .61, .36, 1);
}
.gate__question:not(.v35 *) {
  margin: 0; font-size: 25px; line-height: 1.3; font-weight: 650;
  letter-spacing: -.018em; color: #f7f7f9;
}

.gate-flow:not(.v35 *) { position: relative; margin: 0 -6px; overflow: visible; touch-action: pan-y; user-select: none; outline: none; cursor: grab; }
.gate-flow:active:not(.v35 *) { cursor: grabbing; }
.gate-flow__stage:not(.v35 *) { position: relative; height: 184px; perspective: 860px; overflow: visible; }
/* لا transition: الرسم من requestAnimationFrame، وأي انتقال هنا يتعارك مع الإصبع */
.gate-card:not(.v35 *) {
  position: absolute; left: 50%; top: 50%;
  width: clamp(112px, 33vw, 150px); aspect-ratio: 1;
  transform-origin: center; will-change: transform, opacity; overflow: visible;
}
.gate-card__face:not(.v35 *) {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: #15151c;
  box-shadow: 0 10px 28px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.10);
  transform: translateZ(0);
}
.gate-card--center .gate-card__face:not(.v35 *) { box-shadow: 0 14px 34px rgba(0,0,0,.30), 0 0 0 1px rgba(255,255,255,.16); }
.gate-card__avatar:not(.v35 *) {
  width: 100%; height: 100%; display: grid; place-items: center; object-fit: cover; border-radius: 50%;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: 54px; font-weight: 900; color: #fff;
  pointer-events: none;
}
.gate-card__live:not(.v35 *) {
  position: absolute; right: -4px; bottom: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: #8fda8a; border: 3px solid #111217; box-shadow: 0 0 0 1px rgba(255,255,255,.06); z-index: 4;
}

.gate__caption:not(.v35 *) { min-height: 54px; display: grid; gap: 3px; align-content: start; margin-top: -8px; }
.gate__name:not(.v35 *) { margin: 0; font-size: 19px; line-height: 1.32; font-weight: 680; letter-spacing: -.012em; }
.gate__status:not(.v35 *) { margin: 0; color: #b2afba; font-size: 13px; line-height: 1.4; }
.gate__status--live:not(.v35 *) { color: #95e596; }

.gate__enter:not(.v35 *) {
  min-width: 112px; min-height: 40px; padding: 0 19px; margin-inline: auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.15); border-radius: 999px;
  background: rgba(8,8,12,.34); color: #f7f7f9; font-size: 14px; font-weight: 760;
  backdrop-filter: blur(18px); cursor: pointer;
  transition: transform .16s ease, opacity .16s ease, background .16s ease, border-color .16s ease;
}
.gate__enter:hover:not(.v35 *) { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.20); }
.gate__enter:active:not(.v35 *) { transform: scale(.985); }
.gate__enter:disabled:not(.v35 *) { opacity: .58; cursor: default; }
.gate__enter-lock:not(.v35 *) { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-inline-end: 7px; opacity: .86; }
.gate__enter--locked:not(.v35 *), .gate__enter--locked:hover:not(.v35 *) { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.09); color: #8f8d98; cursor: not-allowed; }
.gate__enter--locked:active:not(.v35 *) { transform: none; }

.gate__message:not(.v35 *) { min-height: 18px; margin: 8px 0 0; color: #9897a3; font-size: 12px; }
.gate__message--error:not(.v35 *) { color: var(--danger); }
/* جوال جديد: رمز الاعتماد في بطاقة زجاجية فوق الحرير */
.gate-approval:not(.v35 *) {
  display: grid; justify-items: center; gap: 8px;
  width: min(340px, calc(100% - 32px)); margin: 14px auto 0; padding: 16px 16px 14px;
  border-radius: 20px; background: rgba(12, 11, 18, .72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); text-align: center;
}
.gate-approval__title:not(.v35 *) { font-size: 16px; font-weight: 800; color: #fff; }
.gate-approval__text:not(.v35 *) { margin: 0; font-size: 12.5px; line-height: 1.7; color: #bab6c6; }
.gate-approval__code:not(.v35 *) {
  margin-top: 4px; padding: 10px 18px; border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, .08); color: #fff;
  font: 800 26px/1.2 ui-monospace, 'SFMono-Regular', Menlo, monospace; letter-spacing: 3px;
  direction: ltr; -webkit-user-select: all; user-select: all;
}
.gate-approval__code:active:not(.v35 *) { background: rgba(255, 255, 255, .14); }
.gate-approval__status:not(.v35 *) { margin: 0; font-size: 12px; color: #9897a3; }
.gate-approval__again:not(.v35 *) {
  border: 0; background: none; color: #bba2ff; font: inherit; font-weight: 700; padding: 4px;
}
.gate__hint:not(.v35 *) { margin: 10px 0 0; font-size: 11px; line-height: 1.35; color: #aaa7b2; opacity: .72; white-space: nowrap; }

@media (max-width: 390px) {
  .gate__inner:not(.v35 *) { padding-inline: 16px; transform: translateY(18px); }
  .gate__question:not(.v35 *) { font-size: 23px; }
  .gate-flow:not(.v35 *) { margin-inline: -2px; }
  .gate-flow__stage:not(.v35 *) { height: 178px; }
  .gate-card:not(.v35 *) { width: clamp(108px, 33vw, 138px); }
  .gate-card__live:not(.v35 *) { width: 17px; height: 17px; }
  .gate__caption:not(.v35 *) { margin-top: -7px; }
}
@media (prefers-reduced-motion: reduce) { .gate__enter:not(.v35 *), .gate__logo-mark:not(.v35 *) { transition: none; } }

/* ───────────────────────────── القشرة ───────────────────────────── */

.page:not(.v35 *) { min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0) + 12px); }
.page__body:not(.v35 *) { width: min(100%, var(--max)); margin: 0 auto; padding: 4px 16px 24px; display: grid; gap: 26px; }

.topbar:not(.v35 *) {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  min-height: 58px;
  padding: calc(env(safe-area-inset-top, 0) + 8px) 14px 8px;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__icon:not(.v35 *) {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 17px; color: var(--text);
  transition: background .16s ease;
}
.topbar__icon:hover:not(.v35 *) { background: var(--surface-2); }
.topbar__dot:not(.v35 *) {
  position: absolute; inset-inline-end: 8px; inset-block-start: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px #000;
}
.topbar__brand:not(.v35 *) { flex: 1; min-width: 0; }
.topbar__title:not(.v35 *) { font-size: 17px; font-weight: 800; letter-spacing: .12em; }
.topbar__actions:not(.v35 *) { display: flex; align-items: center; gap: 4px; }
.topbar__me:not(.v35 *) { display: grid; place-items: center; padding: 0 2px; }

.tabbar:not(.v35 *) {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(0, 0, 0, .9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line-soft);
}
.tabbar__item:not(.v35 *) {
  min-height: var(--tabbar-h);
  display: grid; justify-items: center; align-content: center; gap: 3px;
  color: var(--muted);
  transition: color .16s ease;
}
.tabbar__item--on:not(.v35 *) { color: var(--accent); }
.tabbar__icon:not(.v35 *) { font-size: 19px; line-height: 1; }
.tabbar__label:not(.v35 *) { font-size: 11px; font-weight: 700; }

/* ───────────────────────────── الشريط الجانبي ───────────────────────────── */

.drawer:not(.v35 *) { position: fixed; inset: 0; z-index: 90; }
.drawer__scrim:not(.v35 *) {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .24s ease;
}
.drawer--open .drawer__scrim:not(.v35 *) { opacity: 1; }
.drawer__panel:not(.v35 *) {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  width: min(84vw, 320px);
  display: flex; flex-direction: column; gap: 6px;
  padding: calc(env(safe-area-inset-top, 0) + 18px) 14px calc(env(safe-area-inset-bottom, 0) + 18px);
  background: #070709;
  border-inline-end: 1px solid var(--line);
  overflow-y: auto;
  /* الانزلاق من جهة البداية: في RTL هي اليمين، والمنطقي يتبع الاتجاه تلقائيًا */
  transform: translateX(var(--drawer-out, -102%));
  transition: transform .26s cubic-bezier(.22, .61, .36, 1);
}
:root:dir(rtl) .drawer__panel:not(.v35 *) { --drawer-out: 102%; }
.drawer--open .drawer__panel:not(.v35 *) { transform: translateX(0); }

.drawer__me:not(.v35 *) {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; margin-bottom: 8px;
  border-radius: var(--r-md); background: var(--surface-2);
  text-align: start;
}
.drawer__me-info:not(.v35 *) { min-width: 0; display: grid; gap: 2px; }
.drawer__me-name:not(.v35 *) { font-size: 16px; font-weight: 800; }
.drawer__me-user:not(.v35 *) { font-size: 12px; color: var(--muted); }
.drawer__me-live:not(.v35 *) { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--online); }

.drawer__nav:not(.v35 *) { display: grid; gap: 2px; }
.drawer__link:not(.v35 *) {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 46px; padding: 0 12px;
  border-radius: var(--r-sm);
  font-size: 15px; text-align: start;
  transition: background .14s ease;
}
.drawer__link:hover:not(.v35 *) { background: var(--surface-2); }
.drawer__link-label:not(.v35 *) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__faces:not(.v35 *) { display: flex; }
.drawer__face:not(.v35 *) { position: relative; display: block; margin-inline-start: -7px; }
.drawer__face .avatar:not(.v35 *) { border: 2px solid #070709; }
.drawer__face .dot:not(.v35 *) { position: absolute; inset-block-end: -1px; inset-inline-end: -1px; width: 8px; height: 8px; }

.drawer__out:not(.v35 *) {
  margin-top: auto; min-height: 46px;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  color: var(--text-dim); font-size: 14px;
}

/* ───────────────────────────── الرئيسية ───────────────────────────── */

.hero:not(.v35 *) {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  padding: 24px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.hero__art:not(.v35 *) {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 82% 0%, rgba(139, 92, 246, .3), transparent 58%),
    radial-gradient(90% 80% at 8% 100%, rgba(80, 40, 160, .2), transparent 62%);
  pointer-events: none;
}
.hero__text:not(.v35 *) { position: relative; display: grid; gap: 7px; }
.hero__title:not(.v35 *) { font-size: 25px; font-weight: 900; }
.hero__sub:not(.v35 *) { color: var(--text-dim); font-size: 14px; line-height: 1.6; }

.search:not(.v35 *) { position: relative; display: flex; gap: 8px; margin-top: 18px; }
.search__input:not(.v35 *) {
  flex: 1; min-width: 0; min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(0, 0, 0, .5); color: var(--text);
  outline: none; transition: border-color .16s ease;
}
.search__input:focus:not(.v35 *) { border-color: var(--accent-line); }
.search__go:not(.v35 *) { min-height: 48px; padding: 0 20px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; }

.rail:not(.v35 *) { display: grid; gap: 12px; }
.rail__head:not(.v35 *) { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rail__title:not(.v35 *) { font-size: 17px; font-weight: 800; }
.rail__more:not(.v35 *) { color: var(--accent); font-size: 13px; font-weight: 700; }

/* شريط أفقي: الصور كبيرة والتمرير طبيعي، بلا شبكة تحشر ستة أعمال في صف */
.rail__strip:not(.v35 *) {
  display: grid; grid-auto-flow: column; grid-auto-columns: 132px;
  gap: 12px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
  margin-inline: -16px; padding-inline: 16px;
}
.rail__strip > *:not(.v35 *) { scroll-snap-align: start; }

.tile:not(.v35 *) { display: grid; gap: 7px; text-align: start; }
.tile__shot:not(.v35 *) {
  position: relative; overflow: hidden;
  aspect-ratio: 2 / 3; border-radius: var(--r-md);
  background: var(--surface-2);
  transition: transform .18s ease;
}
.tile:active .tile__shot:not(.v35 *) { transform: scale(.975); }
.tile__cover:not(.v35 *) { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile__shot--blank .tile__cover:not(.v35 *) { visibility: hidden; }
.tile__badge:not(.v35 *) {
  position: absolute; inset-inline-end: 7px; inset-block-start: 7px;
  min-width: 21px; height: 21px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800;
}
.tile__title:not(.v35 *) {
  font-size: 13px; font-weight: 700; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile__meta:not(.v35 *) { color: var(--muted); font-size: 11px; }
.tile--ghost:not(.v35 *) { height: 200px; border-radius: var(--r-md); background: var(--surface-2); }

/* شبكة أعمال المصدر: تلتفّ بدل أن تنزلق، فالتصفّح رأسي كأي موقع قراءة */
.tiles:not(.v35 *) { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 13px; }
.tiles__more:not(.v35 *) { display: grid; place-items: center; padding: 18px 0; }

/* ───────────────────────────── الأصدقاء ───────────────────────────── */

.friends:not(.v35 *) {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr);
  gap: 10px; overflow-x: auto;
  margin-inline: -16px; padding-inline: 16px; padding-bottom: 4px;
}
.friends--column:not(.v35 *) { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; margin-inline: 0; padding-inline: 0; }

.friend:not(.v35 *) {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  text-align: start;
  transition: border-color .16s ease;
}
.friend:hover:not(.v35 *) { border-color: var(--accent-line); }
.friend__face:not(.v35 *) { position: relative; flex: 0 0 auto; }
.friend__face .dot:not(.v35 *) { position: absolute; inset-block-end: 0; inset-inline-end: 0; }
.friend__body:not(.v35 *) { min-width: 0; display: grid; gap: 3px; }
.friend__name:not(.v35 *) { font-size: 14px; font-weight: 800; }
.friend__what:not(.v35 *) { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────────────────────────── نتائج البحث ───────────────────────────── */

.results:not(.v35 *) { display: grid; gap: 10px; }
.result:not(.v35 *) { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 14px; }
.result__head:not(.v35 *) { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.result__title:not(.v35 *) { font-size: 15px; font-weight: 800; }
.result__providers:not(.v35 *) { display: grid; gap: 6px; margin-top: 11px; }
.provider:not(.v35 *) {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 42px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13px; font-weight: 700; text-align: start;
}
.provider:hover:not(.v35 *) { border-color: var(--accent-line); background: var(--accent-soft); }

/* ───────────────────────────── البروفايل ───────────────────────────── */

.profile:not(.v35 *) { display: grid; gap: 14px; }
.profile__banner:not(.v35 *) {
  height: 128px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, #241a3c, #0c0912);
  background-size: cover; background-position: center;
}
.profile__identity:not(.v35 *) { display: flex; align-items: flex-end; gap: 14px; margin-top: -44px; padding-inline: 4px; }
.profile__name:not(.v35 *) { font-size: 22px; font-weight: 900; }
.profile__user:not(.v35 *) { color: var(--muted); font-size: 13px; }
.profile__live:not(.v35 *) { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 13px; color: var(--text-dim); }
.profile__bio:not(.v35 *) { color: var(--text-dim); font-size: 14px; line-height: 1.7; }

.stats:not(.v35 *) { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stats__cell:not(.v35 *) {
  display: grid; gap: 4px; justify-items: center;
  padding: 15px 8px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
}
.stats__value:not(.v35 *) { font-size: 20px; font-weight: 900; }
.stats__label:not(.v35 *) { color: var(--muted); font-size: 11px; text-align: center; }

.list:not(.v35 *) { display: grid; gap: 7px; }
.list__row:not(.v35 *) {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px; text-align: start;
}
.list__row--unread:not(.v35 *) { border-color: var(--accent-line); background: var(--accent-soft); }

/* ───────────────────────────── صفحة العمل ───────────────────────────── */

.work:not(.v35 *) { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; }
.work__cover:not(.v35 *) { width: 100%; aspect-ratio: 2 / 3; border-radius: var(--r-md); object-fit: cover; background: var(--surface-2); }
.work__meta:not(.v35 *) { display: grid; gap: 12px; align-content: start; }
.work__title:not(.v35 *) { font-size: 20px; font-weight: 900; line-height: 1.35; }
.work__desc:not(.v35 *) { color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.work__actions:not(.v35 *) { display: flex; flex-wrap: wrap; gap: 7px; }
.work__actions .btn:not(.v35 *) { min-height: 40px; padding: 0 15px; font-size: 13px; }

.chapters:not(.v35 *) { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.chapter:not(.v35 *) {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 50px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); text-align: start;
}
.chapter:hover:not(.v35 *) { border-color: var(--accent-line); }
.chapter__name:not(.v35 *) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

/* ───────────────────────────── نماذج وألواح ───────────────────────────── */

.form:not(.v35 *) { display: grid; gap: 11px; }
.form__row:not(.v35 *) { display: grid; gap: 5px; }
.form__label:not(.v35 *) { color: var(--text-dim); font-size: 13px; }
.form__input:not(.v35 *) {
  min-height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  outline: none; transition: border-color .16s ease;
}
.form__input:focus:not(.v35 *) { border-color: var(--accent-line); }
.form__note:not(.v35 *) { color: var(--online); font-size: 13px; min-height: 18px; }

.sheet:not(.v35 *) { position: fixed; inset: 0; z-index: 95; display: grid; align-items: end; background: rgba(0, 0, 0, .64); backdrop-filter: blur(2px); }
.sheet__panel:not(.v35 *) {
  display: grid; gap: 13px;
  padding: 20px 18px calc(env(safe-area-inset-bottom, 0) + 20px);
  border-start-start-radius: var(--r-xl); border-start-end-radius: var(--r-xl);
  background: #08080b; border-top: 1px solid var(--line);
  animation: rise .24s cubic-bezier(.22, .61, .36, 1);
}
@keyframes rise { from { transform: translateY(14%); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheet__title:not(.v35 *) { font-size: 17px; font-weight: 800; }
.sheet__people:not(.v35 *) { display: grid; gap: 7px; }
.sheet__person:not(.v35 *) {
  display: flex; align-items: center; gap: 11px;
  min-height: 56px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); font-size: 15px; font-weight: 700; text-align: start;
}
.sheet__person:hover:not(.v35 *) { border-color: var(--accent-line); }

/* ───────────────────────────── القارئ ───────────────────────────── */

.reader:not(.v35 *) { min-height: 100dvh; background: #000; direction: rtl; }
.reader__flow:not(.v35 *) { width: min(100%, 980px); margin: 0 auto; direction: ltr; }
.reader-chapter:not(.v35 *) { display: block; width: 100%; }
.reader__frame:not(.v35 *) { position: relative; width: 100%; min-height: 60px; overflow: hidden; background-color: #030303; }
.reader__image:not(.v35 *) { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.reader__frame--error:not(.v35 *) { min-height: 180px; background: #100a0d; }
.reader__frame--error:not(.v35 *)::after {
  content: 'تعذّر تحميل الصفحة'; position: absolute; inset: 0;
  display: grid; place-items: center; color: #9b7580; direction: rtl;
}
.reader__hud:not(.v35 *) {
  position: fixed; top: 0; inset-inline: 0; z-index: 80;
  min-height: 58px;
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0) + 8px) 12px 8px;
  background: rgba(4, 3, 7, .88); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  transition: transform .18s ease, opacity .18s ease;
  direction: rtl;
}
.reader__hud--hidden:not(.v35 *) { transform: translateY(calc(-100% - 8px)); opacity: 0; pointer-events: none; }
.reader__back:not(.v35 *) { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); }
.reader__title:not(.v35 *) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.reader__page:not(.v35 *) { min-width: 38px; text-align: center; color: var(--muted); }

.divider:not(.v35 *) {
  min-height: 146px; display: grid; place-items: center; align-content: center; gap: 10px;
  padding: 30px 16px; direction: rtl; text-align: center;
  background: radial-gradient(circle, rgba(139, 92, 246, .14), transparent 64%), #000;
  border-block: 1px solid var(--line);
}
.divider__done:not(.v35 *) { color: var(--muted); font-size: 13px; }
.divider__next:not(.v35 *) { font-size: 21px; font-weight: 900; }

.reader__sentinel:not(.v35 *), .reader__end:not(.v35 *), .reader__retry:not(.v35 *) {
  min-height: 116px; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; direction: rtl; text-align: center; color: var(--muted);
}
.reader__sentinel--loading:not(.v35 *) { color: #b89bcf; }
.reader__retry:not(.v35 *) { flex-direction: column; }

/* ───────────────────────────── الشاشة الكبيرة ───────────────────────────── */

@media (min-width: 720px) {
  .page__body:not(.v35 *) { padding-inline: 22px; gap: 30px; }
  .rail__strip:not(.v35 *) { grid-auto-columns: 158px; margin-inline: -22px; padding-inline: 22px; }
  .friends:not(.v35 *) { margin-inline: -22px; padding-inline: 22px; }
  .hero__title:not(.v35 *) { font-size: 30px; }
  .work:not(.v35 *) { grid-template-columns: 158px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *:not(.v35 *)::before, *:not(.v35 *)::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ───────────────────────────── شريط التحديث ───────────────────────────── */

/* غير حاجب وفوق كل شيء: التطبيق يعمل، والتحديث اختيار */
.update:not(.v35 *) {
  position: fixed; z-index: 100;
  inset-inline: 12px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0) + 12px);
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--accent-line); border-radius: var(--r-md);
  background: rgba(14, 10, 24, .96); backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .5);
  animation: rise .26s cubic-bezier(.22, .61, .36, 1);
}
.update__text:not(.v35 *) { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.update .btn:not(.v35 *) { text-decoration: none; }
.update__later:not(.v35 *) { color: var(--muted); font-size: 13px; }

/* ───────────────────────── التنبيهات الجانبية ───────────────────────── */

/* أعلى الشاشة وفي الجانب: غير حاجب، ولا يغطي القارئ ولا شريط التنقل.
   `pointer-events: none` على الحاوية كي لا تسرق نقرة من الشاشة تحتها. */
.toasts:not(.v35 *) {
  position: fixed; z-index: 220;
  top: calc(env(safe-area-inset-top, 0) + 8px);
  left: 50%; transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  display: grid; gap: 8px;
  pointer-events: none;
}

/* بطاقة محايدة لا وهج بنفسجي: التنبيه إشارة تُقرأ بطرف العين وتذهب */
.toast:not(.v35 *) {
  display: grid; gap: 2px;
  padding: 11px 14px;
  border: 0; border-radius: 14px;
  background: rgba(24, 22, 31, .94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .08);
  color: #f3f4f8; text-align: start; font-family: inherit;
  opacity: 0; transform: translateY(-10px) scale(.98);
  transition: opacity .2s ease, transform .28s cubic-bezier(.16, 1, .3, 1);
  pointer-events: auto;
}
.toast--in:not(.v35 *) { opacity: 1; transform: none; }
.toast--out:not(.v35 *) { opacity: 0; transform: translateY(-10px) scale(.98); }
.toast__title:not(.v35 *) { font-size: 13.5px; font-weight: 700; }
.toast__copy:not(.v35 *) { display: grid; gap: 2px; min-width: 0; text-align: right; unicode-bidi: plaintext; }
/* تنبيه من شخص: وجهه وسطر واحد، على سطح التطبيق الداكن */
.toast--person:not(.v35 *) {
  grid-template-columns: 38px 1fr; align-items: center; gap: 12px;
  padding: 10px 14px 10px 12px; border-radius: 18px;
  background: rgba(24, 22, 31, .94);
  touch-action: pan-x;
}
.toast--person .toast__body:not(.v35 *) { -webkit-line-clamp: 1; }
.toast__face:not(.v35 *) {
  width: 38px; height: 38px; border-radius: 99px; object-fit: cover;
  display: grid; place-items: center;
  background: #211e2b; color: #bab6c6; font-weight: 700; font-size: 15px;
}
.toast__body:not(.v35 *) {
  font-size: 12.5px; color: #b7bdc9;
  /* سطران كحد أقصى: التنبيه إشارة لا رسالة */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ───────────────────────── كتلة إعدادات ───────────────────────── */

.settings__block:not(.v35 *) { display: grid; gap: 8px; margin-top: 18px; }
.settings__title:not(.v35 *) { font-size: 15px; font-weight: 800; }
.settings__hint:not(.v35 *) { font-size: 12px; color: var(--muted); line-height: 1.6; }

.switch:not(.v35 *) {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14px; cursor: pointer;
}
.switch input:not(.v35 *) { width: 18px; height: 18px; accent-color: var(--accent); }

/* ───────────────────────────── «فريم» ───────────────────────────── */

/* الصفحة الملتقطة تُعلَّم في مكانها: إطارٌ بلون VANTARA وشارة، لا تعتيم يُخفي القراءة */
.reader__frame--captured:not(.v35 *) { outline: 2px solid var(--accent); outline-offset: -2px; }
.reader__frame--captured:not(.v35 *)::before {
  content: 'فريم'; position: absolute; z-index: 2; inset-block-start: 10px; inset-inline-start: 10px;
  padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800; direction: rtl;
}

.frame-bar:not(.v35 *) {
  position: fixed; z-index: 40; inset-inline: 0;
  inset-block-end: calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: flex; justify-content: center; gap: 10px; pointer-events: none;
}
.frame-bar__shoot:not(.v35 *), .frame-bar__send:not(.v35 *) {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 800; color: #f7f7f9;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(10, 10, 14, .62); backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transition: transform .16s ease, background .16s ease;
}
.frame-bar__send:not(.v35 *) { background: var(--accent); border-color: transparent; }
.frame-bar__shoot:active:not(.v35 *), .frame-bar__send:active:not(.v35 *) { transform: scale(.97); }
.frame-bar__send[hidden]:not(.v35 *) { display: none; }

.frame-sheet:not(.v35 *) {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(8px);
}
.frame-sheet__panel:not(.v35 *) {
  width: min(100%, 520px); max-height: 78vh; overflow: auto;
  padding: 9px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0;
  background: var(--surface); box-shadow: 0 -24px 70px rgba(0, 0, 0, .52);
}
.frame-sheet__handle:not(.v35 *) { width: 34px; height: 4px; border-radius: 999px; background: #303846; margin: 0 auto 13px; }
.frame-sheet__title:not(.v35 *) { margin: 0 2px 10px; font-size: 16px; font-weight: 800; }
.frame-sheet__message:not(.v35 *) {
  width: 100%; resize: none; padding: 11px 12px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 14px;
}
.frame-sheet__message:focus:not(.v35 *) { outline: none; border-color: var(--accent-line); }
.frame-sheet__friends:not(.v35 *) { display: grid; gap: 7px; }
.frame-sheet__friend:not(.v35 *) {
  width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text); text-align: start;
}
.frame-sheet__friend:active:not(.v35 *) { background: var(--surface-3); }
.frame-sheet__avatar:not(.v35 *) {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--text); font-weight: 900;
}
.frame-sheet__avatar img:not(.v35 *) { width: 100%; height: 100%; object-fit: cover; }
.frame-sheet__name:not(.v35 *) { font-size: 15px; font-weight: 700; }

.frame-view:not(.v35 *) { width: min(100%, 980px); margin: 0 auto; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); }
.frame-view__head:not(.v35 *) { padding: 8px 16px 16px; display: grid; gap: 4px; }
.frame-view__from:not(.v35 *) { margin: 0; color: var(--accent); font-size: 13px; font-weight: 800; }
.frame-view__title:not(.v35 *) { margin: 0; font-size: 21px; font-weight: 800; }
.frame-view__chapter:not(.v35 *) { margin: 0; color: var(--text-dim); font-size: 13px; }
.frame-view__message:not(.v35 *) {
  margin: 10px 0 0; padding: 10px 12px; border-inline-start: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 14px;
}
.frame-view .reader__flow > .reader__frame + .reader__frame:not(.v35 *) { margin-top: 6px; }
.frame-view__full:not(.v35 *) {
  display: block; margin: 18px auto 0; min-height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text); font-weight: 800;
}

/* ───────────────────────── «يوجد تحديث جديد» ───────────────────────── */
.vupdate {
  position: fixed; z-index: 300;
  inset-inline: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  color: #f3f4f8;
  animation: rise 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.vupdate__card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 18px;
  background: rgba(18, 14, 30, 0.97);
  box-shadow: inset 0 0 0 1px rgba(143, 92, 255, 0.45), 0 18px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
}
.vupdate__copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vupdate__copy strong { font-size: 15px; font-weight: 750; }
.vupdate__copy span { font-size: 12.5px; color: #bab6c6; }
.vupdate__notes { margin: 6px 0 0; padding-inline-start: 16px; font-size: 12.5px; color: #d9d5e4; line-height: 1.5; }
.vupdate__notes li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vupdate .vupdate__go {
  flex: none; min-width: 84px; height: 42px; padding: 0 18px;
  border: 0; border-radius: 99px; background: #8f5cff; color: #fff; font-weight: 750; font-size: 14px;
}
.vupdate .vupdate__go:disabled { opacity: 0.8; }
.vupdate .vupdate__later {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: #85809a; font-size: 22px; line-height: 1;
}
/* إجباري: يغطي التطبيق حتى يُثبَّت. لا × ولا رجوع */
.vupdate--required {
  inset: 0; bottom: 0; z-index: 400;
  display: grid; place-items: center; padding: 24px;
  background: rgba(5, 4, 10, 0.92);
}
.vupdate--required .vupdate__card { flex-direction: column; align-items: stretch; text-align: center; width: min(360px, 100%); padding: 22px; gap: 16px; }
.vupdate--required .vupdate__notes { text-align: start; }
