/* ==========================================================================
   رنينة — نظام التصميم «المحتوى أولًا»
   عمود محتوى واضح، بطاقات بسطح محايد واحد وحدّ رفيع، لون مميز واحد يُستخدم بتقشّف
   (العنصر النشط، الزر الأساسي، خط التبويب النشط، الروابط الصغيرة، أيقونات رؤوس البطاقات).
   عربي أولًا (RTL).
   ========================================================================== */

/* ---------- الخطوط: مستضافة محليًا (assets/fonts، رخصة OFL) ----------
   ثنائية الهوية: «ريدكس برو» للعناوين والأرقام (خط كلمة الشعار نفسه، ملف متغيّر واحد 200–700)،
   و«بلكس سانس عربي» لنص القراءة. تجوّل خيار في الإعدادات. unicode-range يجعل المتصفح يحمّل
   ملف الحروف العربية وحده ما لم تظهر حروف لاتينية، ولا يُحمَّل وزن لا تستعمله الصفحة. */
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 200 700; font-display: swap; src: url("../fonts/readex-pro-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 200 700; font-display: swap; src: url("../fonts/readex-pro-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@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+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@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+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/plex-arabic-600.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700 800; font-display: swap; src: url("../fonts/plex-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@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+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@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+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/plex-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700 800; font-display: swap; src: url("../fonts/plex-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 300 400; font-display: swap; src: url("../fonts/tajawal-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("../fonts/tajawal-arabic-500.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/tajawal-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 800 900; font-display: swap; src: url("../fonts/tajawal-arabic-800.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 300 400; font-display: swap; src: url("../fonts/tajawal-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("../fonts/tajawal-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/tajawal-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 800 900; font-display: swap; src: url("../fonts/tajawal-latin-800.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- الاتجاه: الواجهة مكتوبة للعربية (RTL)، فاليمين الفيزيائي هو البداية واليسار هو النهاية ----------
   في الإنجليزية (html[dir=ltr]) تنقلب الرموز: linear-gradient(to var(--end), …) بدل to left، و--flip لإزاحات translateX،
   و--doc-dir اتجاه المستند يرثه ما بداخل حاوية dir="ltr" (تلميحات الرسوم البيانية). */
:root { --flip: 1; --start: right; --end: left; --doc-dir: rtl; }
:root[dir="ltr"] { --flip: -1; --start: left; --end: right; --doc-dir: ltr; }

/* ---------- الرموز (Tokens) ----------
   لوحة الألوان ثابتة كما طلبها المستخدم. كل لون معرّف مرة واحدة: light-dark(فاتح, داكن).
   السمة تختار النظام عبر color-scheme فقط:
     light → فاتح، dark → داكن، auto → يتبع الجهاز، بلا تكرار أي قاعدة لكل مكوّن.
   حيث فشل لون من اللوحة في نسبة 4.5:1 للنص عُدّل بأقل قدر (مذكور بجانبه). */
:root {
  color-scheme: light;
  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Readex Pro", "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs: clamp(17.5px, 0.95vw + 5px, 20.5px);

  /* سلّم الكتابة (نسبة 1.2 تقريبًا): العناوين بخط العرض، والنص بخط القراءة */
  --fs-display: clamp(2.5rem, 1.6rem + 3.2vw, 4.2rem);
  --fs-h1: 1.85rem;     /* عنوان الصفحة */
  --fs-h2: 1.35rem;     /* عنوان قسم أو بطاقة كبيرة */
  --fs-h3: 1.125rem;    /* عنوان بطاقة */
  --fs-sm: .91rem;
  --fs-xs: .82rem;

  /* أنصاف الأقطار: أربعة فقط */
  --r-sm: 10px;     /* الحقول، الأزرار، البلاطات الصغيرة، الوسائط داخل البطاقات */
  --r: 16px;        /* البطاقات، المنشورات، اللوحات، الفقاعات */
  --r-lg: 24px;     /* النوافذ، بطاقة اللحظة، الأوراق السفلية */
  --r-pill: 999px;  /* التبويبات، الرقائق */

  /* الحركة: انتقال قصير للحالات، وأطول قليلًا للظهور. تُلغى كلها مع تقليل الحركة */
  --dur: .18s;
  --dur-2: .32s;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* المسافات: مكبّرة لتتناسب مع الخط الأكبر وإغلاق المساحات الفارغة */
  --gap: clamp(14px, 1.1vw, 20px);
  --pad: clamp(18px, 1.4vw, 26px);

  /* الهيكل: ترويسة علوية (views/partials/nav.php) بستة أشكال (layouts.css)، ثم المحتوى بكامل عرض الشاشة وبخط مكبّر يغلق المساحات الفارغة */
  --main-w: 100%;
  --side-w: clamp(320px, 24vw, 400px);
  --home-w: 100%;
  --shell-gap: 20px;
  --pad-x: clamp(14px, 2vw, 32px);
  --top-h: 72px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* ثيمات الوضع الداكن العشرة (1 إلى 10): القيم الافتراضية لثيم 1 (#000000 OLED) وتتبدّل عبر html[data-dark="1..10"] */
  --d-bg:        #000000;
  --d-surface:   #030304;
  --d-surface-2: #060608;
  --d-surface-3: #0B0C0E;
  --d-border:    #131519;
  --d-line:      #23272E;
  --d-mist:      #08090B;
  --d-glass:     rgb(0 0 0 / .94);
  --d-veil:      rgb(0 0 0 / .68);
  --d-chip:      rgb(0 0 0 / .78);

  /* اللوحة — فاتح: كتان، ورق، أزرق مخضرّ، مساعد، ضباب، حبر، نص ثانوي، رمل
              داكن: ثيمات الدارك مود (1–10) من #000000 إلى #1B1D21، نص أساسي #E7E9EA، نص ثانوي #8B9097، وأزرار بيضاء #FFFFFF بنص أسود #000000 */
  --bg:         light-dark(#F3EEE6, var(--d-bg));
  --surface:    light-dark(#FBF8F3, var(--d-surface));   /* كل البطاقات: سطح محايد واحد */
  --surface-2:  light-dark(#F6F1EA, var(--d-surface-2)); /* تعبئة الحقول والاقتباسات (مشتق) */
  --surface-3:  light-dark(#ECE5D9, var(--d-surface-3)); /* المسارات والرموز (مشتق / السطح الثانوي) */
  --border:     light-dark(#E6DED2, var(--d-border));    /* حدّ رفيع للبطاقات (مشتق) */
  --line:       light-dark(#8F897D, var(--d-line));      /* حافة الحقول والأزرار المحددة: 3:1 على الأقل على كل الأسطح */
  --border-strong: var(--line);
  --text:       light-dark(#2F3D3E, #E7E9EA);
  --text-2:     light-dark(#455354, #8B9097);
  --muted:      light-dark(#5E6968, #8B9097);
  --mist:       light-dark(#D6E3E0, var(--d-mist));
  --panel:      var(--mist);
  --panel-2:    var(--surface-3);
  --hover:      light-dark(rgb(47 61 62 / .05), rgb(231 233 234 / .06));

  /* اللون المميز: في الداكن أبيض ناصع للأزرار والتبويبات النشطة وأسود للنص عليها */
  --accent:     light-dark(#5B8687, #FFFFFF);
  --accent-2:   light-dark(#8FB3B0, #D1D5DB);
  --accent-ink: light-dark(#486A6B, #FFFFFF);
  --btn:        light-dark(#567D7E, #FFFFFF);
  --on-accent:  light-dark(#FFFFFF, #000000);
  --accent-soft: light-dark(rgb(91 134 135 / .12), rgb(255 255 255 / .11));
  --ring:       var(--accent);   /* حلقة تركيز الحقول: صلبة 2px */
  --nav-on:     light-dark(#D6E3E0, #FFFFFF);   /* العنصر النشط: حبّة ضباب في الفاتح، حبّة بيضاء ناصعة في الداكن */
  --on-nav-on:  light-dark(#2F3D3E, #000000);
  --grad: var(--accent);

  /* أسطح خاصة */
  --inverse:    light-dark(#2F3D3E, #FFFFFF);   /* التنبيهات المنبثقة */
  --on-inverse: light-dark(#FBF8F3, #000000);
  --bubble-mine: light-dark(#D6E3E0, var(--d-surface-3));
  --on-bubble-mine: var(--text);
  --av-bg:      light-dark(#D6E3E0, var(--d-surface-3));   /* الصور الرمزية المولّدة: محايدة بلا ألوان متعددة */
  --on-av:      var(--text);

  /* الحالات (خارج اللوحة، للضرورة فقط) */
  --danger:     light-dark(#A4483E, #E59A8F);
  --on-danger:  light-dark(#FFFFFF, #000000);
  --ok:         light-dark(#3B7152, #8FC9A5);
  --warn:       light-dark(#8E5C0F, #E3B45F);

  /* الطبقات: ظلّان فقط. في الداكن: البطاقات بالحدّ وحده */
  --shadow-1: 0 1px 2px light-dark(rgb(47 61 62 / .05), transparent);
  --shadow-2: 0 10px 30px -12px light-dark(rgb(31 41 42 / .25), rgb(0 0 0 / .85));
  --shadow: var(--shadow-1);
  --shadow-lg: var(--shadow-2);
  --shadow-hover: var(--shadow-2);   /* بطاقة تفاعلية تحت المؤشر (تُعاد كتابته بعد كتل اللوحات) */
  --border-hover: var(--line);
  --glass: light-dark(rgb(243 238 230 / .92), var(--d-glass));
  --scrim: light-dark(rgb(23 28 28 / .45), rgb(0 0 0 / .72));

  /* أسطح تتبدّل مع لوحة الألوان:
     الشريط العميق في الاستكشاف، تدرّج الوسائط (بديل صورة المسرح)، والمسرح الداكن دائمًا (الشورت وعارض اللحظات) */
  --band: light-dark(#2F3D3E, var(--d-surface)); --band-ink: #E7E9EA; --band-hl: light-dark(#8FB3B0, #FFFFFF);
  --media-from: light-dark(#4F7374, #0A0B0D); --media-to: light-dark(#2F3D3E, #000000);
  --shp-bg: var(--d-bg); --shp-surface: var(--d-surface); --shp-ink: #E7E9EA; --shp-accent: #FFFFFF;
  --shp-veil: var(--d-veil); --shp-chip: var(--d-chip);
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="auto"] { color-scheme: light dark; }

/* ---------- ثيمات الدارك مود العشرة (1 إلى 10): html[data-dark="1..10"] ----------
   1: #000000 · 2: #020203 · 3: #040506 · 4: #070708 · 5: #0B0C0D · 6: #0E0F11 · 7: #111315 · 8: #15171A · 9: #181A1D · 10: #1B1D21
   لون النص الأساسي: #E7E9EA · لون النص الثانوي: #8B9097 */
:root[data-dark="1"] {
  --d-bg: #000000; --d-surface: #030304; --d-surface-2: #060608; --d-surface-3: #0B0C0E;
  --d-border: #131519; --d-line: #23272E; --d-mist: #08090B;
  --d-glass: rgb(0 0 0 / .94); --d-veil: rgb(0 0 0 / .68); --d-chip: rgb(0 0 0 / .78);
}
:root[data-dark="2"] {
  --d-bg: #020203; --d-surface: #050507; --d-surface-2: #08090B; --d-surface-3: #0E0F12;
  --d-border: #15171C; --d-line: #262A32; --d-mist: #0A0B0D;
  --d-glass: rgb(2 2 3 / .93); --d-veil: rgb(2 2 3 / .66); --d-chip: rgb(2 2 3 / .76);
}
:root[data-dark="3"] {
  --d-bg: #040506; --d-surface: #07080A; --d-surface-2: #0B0C0E; --d-surface-3: #111316;
  --d-border: #181A1F; --d-line: #292E36; --d-mist: #0D0E10;
  --d-glass: rgb(4 5 6 / .93); --d-veil: rgb(4 5 6 / .64); --d-chip: rgb(4 5 6 / .74);
}
:root[data-dark="4"] {
  --d-bg: #070708; --d-surface: #0B0C0D; --d-surface-2: #111315; --d-surface-3: #181A1D;
  --d-border: #1B1D21; --d-line: #2E333B; --d-mist: #15171A;
  --d-glass: rgb(7 7 8 / .92); --d-veil: rgb(7 7 8 / .62); --d-chip: rgb(7 7 8 / .72);
}
:root[data-dark="5"] {
  --d-bg: #0B0C0D; --d-surface: #0E0F11; --d-surface-2: #15171A; --d-surface-3: #1B1D21;
  --d-border: #1F2227; --d-line: #31363F; --d-mist: #181A1D;
  --d-glass: rgb(11 12 13 / .92); --d-veil: rgb(11 12 13 / .62); --d-chip: rgb(11 12 13 / .72);
}
:root[data-dark="6"] {
  --d-bg: #0E0F11; --d-surface: #111315; --d-surface-2: #181A1D; --d-surface-3: #1F2227;
  --d-border: #23272D; --d-line: #353A44; --d-mist: #1B1D21;
  --d-glass: rgb(14 15 17 / .92); --d-veil: rgb(14 15 17 / .62); --d-chip: rgb(14 15 17 / .72);
}
:root[data-dark="7"] {
  --d-bg: #111315; --d-surface: #15171A; --d-surface-2: #1B1D21; --d-surface-3: #22262C;
  --d-border: #262A31; --d-line: #393F49; --d-mist: #1E2227;
  --d-glass: rgb(17 19 21 / .92); --d-veil: rgb(17 19 21 / .62); --d-chip: rgb(17 19 21 / .72);
}
:root[data-dark="8"] {
  --d-bg: #15171A; --d-surface: #181A1D; --d-surface-2: #1E2126; --d-surface-3: #262A31;
  --d-border: #2A2E36; --d-line: #3E444F; --d-mist: #22262C;
  --d-glass: rgb(21 23 26 / .92); --d-veil: rgb(21 23 26 / .62); --d-chip: rgb(21 23 26 / .72);
}
:root[data-dark="9"] {
  --d-bg: #181A1D; --d-surface: #1B1D21; --d-surface-2: #22252B; --d-surface-3: #2A2E36;
  --d-border: #2E333B; --d-line: #434955; --d-mist: #262A31;
  --d-glass: rgb(24 26 29 / .92); --d-veil: rgb(24 26 29 / .62); --d-chip: rgb(24 26 29 / .72);
}
:root[data-dark="10"] {
  --d-bg: #1B1D21; --d-surface: #202328; --d-surface-2: #262A31; --d-surface-3: #2F343D;
  --d-border: #333842; --d-line: #484F5C; --d-mist: #2B3038;
  --d-glass: rgb(27 29 33 / .92); --d-veil: rgb(27 29 33 / .62); --d-chip: rgb(27 29 33 / .72);
}

/* متصفحات قديمة بلا light-dark(): الفاتح كاملًا ويُخفى زر التبديل */
@supports not (color: light-dark(#000, #fff)) {
  :root, :root[data-theme] {
    color-scheme: light;
    --bg: #F3EEE6; --surface: #FBF8F3; --surface-2: #F6F1EA; --surface-3: #ECE5D9; --border: #E6DED2; --line: #8F897D;
    --text: #2F3D3E; --text-2: #455354; --muted: #5E6968; --mist: #D6E3E0; --hover: rgb(47 61 62 / .05);
    --accent: #5B8687; --accent-2: #8FB3B0; --accent-ink: #486A6B; --btn: #567D7E; --on-accent: #fff; --accent-soft: rgb(91 134 135 / .12);
    --nav-on: #D6E3E0; --on-nav-on: #2F3D3E; --inverse: #2F3D3E; --on-inverse: #FBF8F3; --bubble-mine: #D6E3E0; --av-bg: #D6E3E0;
    --danger: #A4483E; --on-danger: #fff; --ok: #3B7152; --warn: #8E5C0F;
    --shadow-1: 0 1px 2px rgb(47 61 62 / .05); --shadow-2: 0 10px 30px -12px rgb(31 41 42 / .25);
    --glass: rgb(243 238 230 / .92); --scrim: rgb(23 28 28 / .45);
    --band: #2F3D3E; --band-hl: #8FB3B0;
  }
  .theme-form { display: none; }
}

/* ---------- لوحات الألوان: html[data-palette] ----------
   «ضباب» هي رموز :root أعلاه (data-palette="dabab"). كل لوحة هنا تعيد تعريف الرموز الفاتحة والمميزة بـ light-dark(فاتح, داكن)
   مع ربط الداكن بمتغيرات ثيمات الدارك مود (--d-*) والنص (#E7E9EA / #8B9097). */
/* واحة — واحة النخيل: أخضر سعف النخيل على ورق مريمية فاتح، وبُنّي التمر لونًا مساعدًا. */
:root[data-palette="waha"] {
  --bg: light-dark(#E1F4EB, var(--d-bg));
  --surface: light-dark(#F4FBF8, var(--d-surface));
  --surface-2: light-dark(#E9F6F0, var(--d-surface-2));
  --surface-3: light-dark(#D5EDE1, var(--d-surface-3));
  --border: light-dark(#CFE6DA, var(--d-border));
  --line: light-dark(#848B82, var(--d-line));
  --text: light-dark(#2C3C35, #E7E9EA);
  --text-2: light-dark(#485750, #8B9097);
  --muted: light-dark(#5C6963, #8B9097);
  --mist: light-dark(#D3E8D9, var(--d-mist));
  --accent: light-dark(#3F8F6F, #65B092);
  --accent-2: light-dark(#D1A882, #D3B090);
  --accent-ink: light-dark(#237153, #6FB699);
  --btn: light-dark(#2E8060, #65B092);
  --on-accent: light-dark(#FCFEFC, var(--d-bg));
  --nav-on: light-dark(#D3E8D9, #65B092);
  --on-nav-on: light-dark(#2C3C35, var(--d-bg));
  --inverse: light-dark(#2C3C35, #E7E9EA);
  --on-inverse: light-dark(#F4FBF8, var(--d-bg));
  --bubble-mine: light-dark(#D3E8D9, var(--d-mist));
  --av-bg: light-dark(#D3E8D9, var(--d-mist));
  --danger: light-dark(#AB423B, #E39289);
  --on-danger: light-dark(#FFFFFF, var(--d-bg));
  --ok: light-dark(#596D30, #A4BB7C);
  --warn: light-dark(#915A0A, #E2AB70);
  --hover: light-dark(rgb(44 60 53 / 0.05), rgb(231 233 234 / 0.055));
  --accent-soft: light-dark(rgb(63 143 111 / 0.12), rgb(101 176 146 / 0.16));
  --glass: light-dark(rgb(225 244 235 / 0.92), var(--d-glass));
  --scrim: light-dark(rgb(16 28 23 / 0.45), rgb(0 0 0 / .65));
  --band: light-dark(#223C30, var(--d-surface));
  --band-ink: #E7E9EA;
  --band-hl: light-dark(#D7AF88, #D3B090);
  --shadow-1: 0 1px 2px light-dark(rgb(44 60 53 / 0.05), transparent);
  --shadow-2: 0 10px 30px -12px light-dark(rgb(27 42 35 / 0.25), rgb(0 0 0 / .7));
  --shp-bg: var(--d-bg);
  --shp-surface: var(--d-surface);
  --shp-ink: #E7E9EA;
  --shp-accent: #65B092;
  --shp-veil: var(--d-veil);
  --shp-chip: var(--d-chip);
  --media-from: #3C6F59;
  --media-to: #20362C;
}
/* زيتون — بساتين الزيتون: ورقة زيتون خضراء مصفرّة على ورق رقّ دافئ، وذهب الزيت لونًا مساعدًا. */
:root[data-palette="zaytoun"] {
  --bg: light-dark(#EBF2E0, var(--d-bg));
  --surface: light-dark(#F8FAF4, var(--d-surface));
  --surface-2: light-dark(#F0F4E9, var(--d-surface-2));
  --surface-3: light-dark(#E2EAD5, var(--d-surface-3));
  --border: light-dark(#DBE2CE, var(--d-border));
  --line: light-dark(#8C887A, var(--d-line));
  --text: light-dark(#353A2E, #E7E9EA);
  --text-2: light-dark(#505549, #8B9097);
  --muted: light-dark(#63675D, #8B9097);
  --mist: light-dark(#E0E5CE, var(--d-mist));
  --accent: light-dark(#748849, #97A764);
  --accent-2: light-dark(#C4B071, #C8B782);
  --accent-ink: light-dark(#586B30, #9DAD6E);
  --btn: light-dark(#65793A, #97A764);
  --on-accent: light-dark(#FEFDFB, var(--d-bg));
  --nav-on: light-dark(#E0E5CE, #97A764);
  --on-nav-on: light-dark(#353A2E, var(--d-bg));
  --inverse: light-dark(#353A2E, #E7E9EA);
  --on-inverse: light-dark(#F8FAF4, var(--d-bg));
  --bubble-mine: light-dark(#E0E5CE, var(--d-mist));
  --av-bg: light-dark(#E0E5CE, var(--d-mist));
  --danger: light-dark(#AB423B, #E39289);
  --on-danger: light-dark(#FFFFFF, var(--d-bg));
  --ok: light-dark(#287353, #7AC3A0);
  --warn: light-dark(#915A0A, #E2AB70);
  --hover: light-dark(rgb(53 58 46 / 0.05), rgb(231 233 234 / 0.055));
  --accent-soft: light-dark(rgb(116 136 73 / 0.12), rgb(151 167 100 / 0.16));
  --glass: light-dark(rgb(235 242 224 / 0.92), var(--d-glass));
  --scrim: light-dark(rgb(24 27 16 / 0.45), rgb(0 0 0 / .65));
  --band: light-dark(#313924, var(--d-surface));
  --band-ink: #E7E9EA;
  --band-hl: light-dark(#CBB677, #C8B782);
  --shadow-1: 0 1px 2px light-dark(rgb(53 58 46 / 0.05), transparent);
  --shadow-2: 0 10px 30px -12px light-dark(rgb(36 40 29 / 0.25), rgb(0 0 0 / .7));
  --shp-bg: var(--d-bg);
  --shp-surface: var(--d-surface);
  --shp-ink: #E7E9EA;
  --shp-accent: #97A764;
  --shp-veil: var(--d-veil);
  --shp-chip: var(--d-chip);
  --media-from: #5B6A40;
  --media-to: #2D3321;
}
/* عسل — عسل السدر وكهرمان الصحراء: ذهبي عسلي على قشدة دافئة، وحبر بنّي. */
:root[data-palette="asal"] {
  --bg: light-dark(#F9EDDD, var(--d-bg));
  --surface: light-dark(#FDF9F3, var(--d-surface));
  --surface-2: light-dark(#F9F1E7, var(--d-surface-2));
  --surface-3: light-dark(#F3E4D1, var(--d-surface-3));
  --border: light-dark(#EBDDCB, var(--d-border));
  --line: light-dark(#908775, var(--d-line));
  --text: light-dark(#44362C, #E7E9EA);
  --text-2: light-dark(#5E5147, #8B9097);
  --muted: light-dark(#6F645C, #8B9097);
  --mist: light-dark(#EEE1C5, var(--d-mist));
  --accent: light-dark(#A9772B, #C3964A);
  --accent-2: light-dark(#C3B16D, #C6B77F);
  --accent-ink: light-dark(#885B09, #C89C56);
  --btn: light-dark(#996816, #C3964A);
  --on-accent: light-dark(#FFFDFA, var(--d-bg));
  --nav-on: light-dark(#EEE1C5, #C3964A);
  --on-nav-on: light-dark(#44362C, var(--d-bg));
  --inverse: light-dark(#44362C, #E7E9EA);
  --on-inverse: light-dark(#FDF9F3, var(--d-bg));
  --bubble-mine: light-dark(#EEE1C5, var(--d-mist));
  --av-bg: light-dark(#EEE1C5, var(--d-mist));
  --danger: light-dark(#B03D45, #EC8A92);
  --on-danger: light-dark(#FFFFFF, var(--d-bg));
  --ok: light-dark(#397247, #87C293);
  --warn: light-dark(#9B522D, #EDA381);
  --hover: light-dark(rgb(68 54 44 / 0.05), rgb(231 233 234 / 0.055));
  --accent-soft: light-dark(rgb(169 119 43 / 0.12), rgb(195 150 74 / 0.16));
  --glass: light-dark(rgb(249 237 221 / 0.92), var(--d-glass));
  --scrim: light-dark(rgb(31 25 15 / 0.45), rgb(0 0 0 / .65));
  --band: light-dark(#43321B, var(--d-surface));
  --band-ink: #E7E9EA;
  --band-hl: light-dark(#C9B773, #C6B77F);
  --shadow-1: 0 1px 2px light-dark(rgb(68 54 44 / 0.05), transparent);
  --shadow-2: 0 10px 30px -12px light-dark(rgb(48 36 26 / 0.25), rgb(0 0 0 / .7));
  --shp-bg: var(--d-bg);
  --shp-surface: var(--d-surface);
  --shp-ink: #E7E9EA;
  --shp-accent: #C3964A;
  --shp-veil: var(--d-veil);
  --shp-chip: var(--d-chip);
  --media-from: #7D5C2D;
  --media-to: #3C2D1A;
}
/* فخّار — فخّار مشويّ في الشمس: طين أحمر برتقالي على رمل فاتح، وخوخ رملي مساعد. */
:root[data-palette="fakhar"] {
  --bg: light-dark(#FEEAE3, var(--d-bg));
  --surface: light-dark(#FEF7F5, var(--d-surface));
  --surface-2: light-dark(#FDEFEB, var(--d-surface-2));
  --surface-3: light-dark(#F9E0D8, var(--d-surface-3));
  --border: light-dark(#F1D9D2, var(--d-border));
  --line: light-dark(#92867A, var(--d-line));
  --text: light-dark(#433530, #E7E9EA);
  --text-2: light-dark(#5E504B, #8B9097);
  --muted: light-dark(#6F635F, #8B9097);
  --mist: light-dark(#F3DDD0, var(--d-mist));
  --accent: light-dark(#BD694F, #D18A71);
  --accent-2: light-dark(#D0A97D, #D2B18B);
  --accent-ink: light-dark(#9A4E36, #D69179);
  --btn: light-dark(#AE5B41, #D18A71);
  --on-accent: light-dark(#FFFDFB, var(--d-bg));
  --nav-on: light-dark(#F3DDD0, #D18A71);
  --on-nav-on: light-dark(#433530, var(--d-bg));
  --inverse: light-dark(#433530, #E7E9EA);
  --on-inverse: light-dark(#FEF7F5, var(--d-bg));
  --bubble-mine: light-dark(#F3DDD0, var(--d-mist));
  --av-bg: light-dark(#F3DDD0, var(--d-mist));
  --danger: light-dark(#9E174B, #EE79A1);
  --on-danger: light-dark(#FFFFFF, var(--d-bg));
  --ok: light-dark(#397147, #87C293);
  --warn: light-dark(#8A5C00, #DDAE6C);
  --hover: light-dark(rgb(67 53 48 / 0.05), rgb(231 233 234 / 0.055));
  --accent-soft: light-dark(rgb(189 105 79 / 0.12), rgb(209 138 113 / 0.16));
  --glass: light-dark(rgb(254 234 227 / 0.92), var(--d-glass));
  --scrim: light-dark(rgb(33 22 18 / 0.45), rgb(0 0 0 / .65));
  --band: light-dark(#4A2D24, var(--d-surface));
  --band-ink: #E7E9EA;
  --band-hl: light-dark(#D7AF83, #D2B18B);
  --shadow-1: 0 1px 2px light-dark(rgb(67 53 48 / 0.05), transparent);
  --shadow-2: 0 10px 30px -12px light-dark(rgb(48 35 30 / 0.25), rgb(0 0 0 / .7));
  --shp-bg: var(--d-bg);
  --shp-surface: var(--d-surface);
  --shp-ink: #E7E9EA;
  --shp-accent: #D18A71;
  --shp-veil: var(--d-veil);
  --shp-chip: var(--d-chip);
  --media-from: #8A5241;
  --media-to: #422921;
}
/* ورد — الورد الطائفي: وردي مغبرّ هادئ على عاجيّ مورّد، ومشمشي خفيف مساعد. */
:root[data-palette="ward"] {
  --bg: light-dark(#FDE8EF, var(--d-bg));
  --surface: light-dark(#FEF7F9, var(--d-surface));
  --surface-2: light-dark(#FCEEF2, var(--d-surface-2));
  --surface-3: light-dark(#F8DFE7, var(--d-surface-3));
  --border: light-dark(#F0D8E0, var(--d-border));
  --line: light-dark(#928583, var(--d-line));
  --text: light-dark(#44343A, #E7E9EA);
  --text-2: light-dark(#5E4F55, #8B9097);
  --muted: light-dark(#6F6266, #8B9097);
  --mist: light-dark(#F2DBE2, var(--d-mist));
  --accent: light-dark(#B26A86, #C58B9E);
  --accent-2: light-dark(#D7A395, #D8ABA0);
  --accent-ink: light-dark(#904F69, #CA92A4);
  --btn: light-dark(#A35D78, #C58B9E);
  --on-accent: light-dark(#FFFDFD, var(--d-bg));
  --nav-on: light-dark(#F2DBE2, #C58B9E);
  --on-nav-on: light-dark(#44343A, var(--d-bg));
  --inverse: light-dark(#44343A, #E7E9EA);
  --on-inverse: light-dark(#FEF7F9, var(--d-bg));
  --bubble-mine: light-dark(#F2DBE2, var(--d-mist));
  --av-bg: light-dark(#F2DBE2, var(--d-mist));
  --danger: light-dark(#AF3E30, #F5886C);
  --on-danger: light-dark(#FFFFFF, var(--d-bg));
  --ok: light-dark(#397147, #87C293);
  --warn: light-dark(#845F01, #D7B16A);
  --hover: light-dark(rgb(68 52 58 / 0.05), rgb(231 233 234 / 0.055));
  --accent-soft: light-dark(rgb(178 106 134 / 0.12), rgb(197 139 158 / 0.16));
  --glass: light-dark(rgb(253 232 239 / 0.92), var(--d-glass));
  --scrim: light-dark(rgb(33 21 25 / 0.45), rgb(0 0 0 / .65));
  --band: light-dark(#462D36, var(--d-surface));
  --band-ink: #E7E9EA;
  --band-hl: light-dark(#DDA99C, #D8ABA0);
  --shadow-1: 0 1px 2px light-dark(rgb(68 52 58 / 0.05), transparent);
  --shadow-2: 0 10px 30px -12px light-dark(rgb(48 34 39 / 0.25), rgb(0 0 0 / .7));
  --shp-bg: var(--d-bg);
  --shp-surface: var(--d-surface);
  --shp-ink: #E7E9EA;
  --shp-accent: #C58B9E;
  --shp-veil: var(--d-veil);
  --shp-chip: var(--d-chip);
  --media-from: #835364;
  --media-to: #3F2931;
}
/* خزامى — حقل خزامى عند الغروب في الفاتح، وفي الداكن أسود حالك وأزرار وتبويبات بيضاء ناصعة */
:root[data-palette="khuzama"] {
  --bg: light-dark(#EFECFD, var(--d-bg));
  --surface: light-dark(#F9F8FE, var(--d-surface));
  --surface-2: light-dark(#F3F0FC, var(--d-surface-2));
  --surface-3: light-dark(#E8E3F9, var(--d-surface-3));
  --border: light-dark(#E0DCF0, var(--d-border));
  --line: light-dark(#8B8691, var(--d-line));
  --text: light-dark(#3A3646, #E7E9EA);
  --text-2: light-dark(#545160, #8B9097);
  --muted: light-dark(#676472, #8B9097);
  --mist: light-dark(#E5DEF4, var(--d-mist));
  --accent: light-dark(#8678AF, #FFFFFF);
  --accent-2: light-dark(#C8A4C3, #D1D5DB);
  --accent-ink: light-dark(#695C8F, #FFFFFF);
  --btn: light-dark(#786AA1, #FFFFFF);
  --on-accent: light-dark(#FEFDFF, #000000);
  --nav-on: light-dark(#E5DEF4, #FFFFFF);
  --on-nav-on: light-dark(#3A3646, #000000);
  --inverse: light-dark(#3A3646, #FFFFFF);
  --on-inverse: light-dark(#F9F8FE, #000000);
  --bubble-mine: light-dark(#E5DEF4, var(--d-surface-3));
  --av-bg: light-dark(#E5DEF4, var(--d-surface-3));
  --danger: light-dark(#AB4143, #E3918E);
  --on-danger: light-dark(#FFFFFF, #000000);
  --ok: light-dark(#33724C, #82C298);
  --warn: light-dark(#8F5A04, #E1AC6E);
  --hover: light-dark(rgb(58 54 70 / 0.05), rgb(231 233 234 / 0.06));
  --accent-soft: light-dark(rgb(134 120 175 / 0.12), rgb(255 255 255 / 0.11));
  --glass: light-dark(rgb(239 236 253 / 0.92), var(--d-glass));
  --scrim: light-dark(rgb(26 23 33 / 0.45), rgb(0 0 0 / .72));
  --band: light-dark(#363245, var(--d-surface));
  --band-ink: #E7E9EA;
  --band-hl: light-dark(#CEAACA, #FFFFFF);
  --shadow-1: 0 1px 2px light-dark(rgb(58 54 70 / 0.05), transparent);
  --shadow-2: 0 10px 30px -12px light-dark(rgb(39 36 51 / 0.25), rgb(0 0 0 / .85));
  --shp-bg: var(--d-bg);
  --shp-surface: var(--d-surface);
  --shp-ink: #E7E9EA;
  --shp-accent: #FFFFFF;
  --shp-veil: var(--d-veil);
  --shp-chip: var(--d-chip);
  --media-from: light-dark(#655D82, #0A0B0D);
  --media-to: light-dark(#312D3E, #000000);
}

/* متصفحات بلا light-dark(): الفاتح كاملًا (مثل كتلة ضباب الاحتياطية في app.css) */
@supports not (color: light-dark(#000, #fff)) {
  :root[data-palette="waha"], :root[data-palette="waha"][data-theme] { --bg: #E1F4EB; --surface: #F4FBF8; --surface-2: #E9F6F0; --surface-3: #D5EDE1; --border: #CFE6DA; --line: #848B82; --text: #2C3C35; --text-2: #485750; --muted: #5C6963; --mist: #D3E8D9; --accent: #3F8F6F; --accent-2: #D1A882; --accent-ink: #237153; --btn: #2E8060; --on-accent: #FCFEFC; --nav-on: #D3E8D9; --on-nav-on: #2C3C35; --inverse: #2C3C35; --on-inverse: #F4FBF8; --bubble-mine: #D3E8D9; --av-bg: #D3E8D9; --danger: #AB423B; --on-danger: #FFFFFF; --ok: #596D30; --warn: #915A0A; --hover: rgb(44 60 53 / 0.05); --accent-soft: rgb(63 143 111 / 0.12); --glass: rgb(225 244 235 / 0.92); --scrim: rgb(16 28 23 / 0.45); --band: #223C30; --band-ink: #EBEBE4; --band-hl: #D7AF88; --shadow-1: 0 1px 2px rgb(44 60 53 / 0.05); --shadow-2: 0 10px 30px -12px rgb(27 42 35 / 0.25); }
  :root[data-palette="zaytoun"], :root[data-palette="zaytoun"][data-theme] { --bg: #EBF2E0; --surface: #F8FAF4; --surface-2: #F0F4E9; --surface-3: #E2EAD5; --border: #DBE2CE; --line: #8C887A; --text: #353A2E; --text-2: #505549; --muted: #63675D; --mist: #E0E5CE; --accent: #748849; --accent-2: #C4B071; --accent-ink: #586B30; --btn: #65793A; --on-accent: #FEFDFB; --nav-on: #E0E5CE; --on-nav-on: #353A2E; --inverse: #353A2E; --on-inverse: #F8FAF4; --bubble-mine: #E0E5CE; --av-bg: #E0E5CE; --danger: #AB423B; --on-danger: #FFFFFF; --ok: #287353; --warn: #915A0A; --hover: rgb(53 58 46 / 0.05); --accent-soft: rgb(116 136 73 / 0.12); --glass: rgb(235 242 224 / 0.92); --scrim: rgb(24 27 16 / 0.45); --band: #313924; --band-ink: #ECEBE2; --band-hl: #CBB677; --shadow-1: 0 1px 2px rgb(53 58 46 / 0.05); --shadow-2: 0 10px 30px -12px rgb(36 40 29 / 0.25); }
  :root[data-palette="asal"], :root[data-palette="asal"][data-theme] { --bg: #F9EDDD; --surface: #FDF9F3; --surface-2: #F9F1E7; --surface-3: #F3E4D1; --border: #EBDDCB; --line: #908775; --text: #44362C; --text-2: #5E5147; --muted: #6F645C; --mist: #EEE1C5; --accent: #A9772B; --accent-2: #C3B16D; --accent-ink: #885B09; --btn: #996816; --on-accent: #FFFDFA; --nav-on: #EEE1C5; --on-nav-on: #44362C; --inverse: #44362C; --on-inverse: #FDF9F3; --bubble-mine: #EEE1C5; --av-bg: #EEE1C5; --danger: #B03D45; --on-danger: #FFFFFF; --ok: #397247; --warn: #9B522D; --hover: rgb(68 54 44 / 0.05); --accent-soft: rgb(169 119 43 / 0.12); --glass: rgb(249 237 221 / 0.92); --scrim: rgb(31 25 15 / 0.45); --band: #43321B; --band-ink: #EFEAE0; --band-hl: #C9B773; --shadow-1: 0 1px 2px rgb(68 54 44 / 0.05); --shadow-2: 0 10px 30px -12px rgb(48 36 26 / 0.25); }
  :root[data-palette="fakhar"], :root[data-palette="fakhar"][data-theme] { --bg: #FEEAE3; --surface: #FEF7F5; --surface-2: #FDEFEB; --surface-3: #F9E0D8; --border: #F1D9D2; --line: #92867A; --text: #433530; --text-2: #5E504B; --muted: #6F635F; --mist: #F3DDD0; --accent: #BD694F; --accent-2: #D0A97D; --accent-ink: #9A4E36; --btn: #AE5B41; --on-accent: #FFFDFB; --nav-on: #F3DDD0; --on-nav-on: #433530; --inverse: #433530; --on-inverse: #FEF7F5; --bubble-mine: #F3DDD0; --av-bg: #F3DDD0; --danger: #9E174B; --on-danger: #FFFFFF; --ok: #397147; --warn: #8A5C00; --hover: rgb(67 53 48 / 0.05); --accent-soft: rgb(189 105 79 / 0.12); --glass: rgb(254 234 227 / 0.92); --scrim: rgb(33 22 18 / 0.45); --band: #4A2D24; --band-ink: #F0E9E2; --band-hl: #D7AF83; --shadow-1: 0 1px 2px rgb(67 53 48 / 0.05); --shadow-2: 0 10px 30px -12px rgb(48 35 30 / 0.25); }
  :root[data-palette="ward"], :root[data-palette="ward"][data-theme] { --bg: #FDE8EF; --surface: #FEF7F9; --surface-2: #FCEEF2; --surface-3: #F8DFE7; --border: #F0D8E0; --line: #928583; --text: #44343A; --text-2: #5E4F55; --muted: #6F6266; --mist: #F2DBE2; --accent: #B26A86; --accent-2: #D7A395; --accent-ink: #904F69; --btn: #A35D78; --on-accent: #FFFDFD; --nav-on: #F2DBE2; --on-nav-on: #44343A; --inverse: #44343A; --on-inverse: #FEF7F9; --bubble-mine: #F2DBE2; --av-bg: #F2DBE2; --danger: #AF3E30; --on-danger: #FFFFFF; --ok: #397147; --warn: #845F01; --hover: rgb(68 52 58 / 0.05); --accent-soft: rgb(178 106 134 / 0.12); --glass: rgb(253 232 239 / 0.92); --scrim: rgb(33 21 25 / 0.45); --band: #462D36; --band-ink: #F1E8E6; --band-hl: #DDA99C; --shadow-1: 0 1px 2px rgb(68 52 58 / 0.05); --shadow-2: 0 10px 30px -12px rgb(48 34 39 / 0.25); }
  :root[data-palette="khuzama"], :root[data-palette="khuzama"][data-theme] { --bg: #EFECFD; --surface: #F9F8FE; --surface-2: #F3F0FC; --surface-3: #E8E3F9; --border: #E0DCF0; --line: #8B8691; --text: #3A3646; --text-2: #545160; --muted: #676472; --mist: #E5DEF4; --accent: #8678AF; --accent-2: #C8A4C3; --accent-ink: #695C8F; --btn: #786AA1; --on-accent: #FEFDFF; --nav-on: #E5DEF4; --on-nav-on: #3A3646; --inverse: #3A3646; --on-inverse: #F9F8FE; --bubble-mine: #E5DEF4; --av-bg: #E5DEF4; --danger: #AB4143; --on-danger: #FFFFFF; --ok: #33724C; --warn: #8F5A04; --hover: rgb(58 54 70 / 0.05); --accent-soft: rgb(134 120 175 / 0.12); --glass: rgb(239 236 253 / 0.92); --scrim: rgb(26 23 33 / 0.45); --band: #363245; --band-ink: #ECE9F0; --band-hl: #CEAACA; --shadow-1: 0 1px 2px rgb(58 54 70 / 0.05); --shadow-2: 0 10px 30px -12px rgb(39 36 51 / 0.25); }
}

/* الطبقات في كل اللوحات: ظل من حبر اللوحة ومسحة من لونها المميز (فاتح)، وعمق أسود ناعم (داكن).
   بعد كتل اللوحات وبنفس وزنها فيتقدّم عليها؛ والمتصفحات بلا light-dark() تبقى على قيم الكتل أعلاه. */
@supports (color: light-dark(#000, #fff)) {
  :root, :root[data-palette] {
    --shadow-1: inset 0 1px 0 light-dark(transparent, rgb(255 255 255 / .035)), 0 1px 2px light-dark(color-mix(in srgb, var(--text) 6%, transparent), rgb(0 0 0 / .22)),
      0 6px 18px -14px light-dark(color-mix(in srgb, var(--accent) 45%, transparent), rgb(0 0 0 / .55));
    --shadow-2: 0 2px 6px -2px light-dark(color-mix(in srgb, var(--text) 10%, transparent), rgb(0 0 0 / .4)),
      0 20px 44px -20px light-dark(color-mix(in srgb, var(--accent) 50%, var(--text) 10%), rgb(0 0 0 / .8));
    --shadow-hover: 0 1px 2px light-dark(color-mix(in srgb, var(--text) 7%, transparent), rgb(0 0 0 / .25)),
      0 12px 28px -16px light-dark(color-mix(in srgb, var(--accent) 60%, transparent), rgb(0 0 0 / .7));
    --border-hover: color-mix(in srgb, var(--accent) 35%, var(--border));
  }
}

[data-size="sm"] { --fs: clamp(16px, 0.8vw + 4.5px, 18px); }
[data-size="lg"] { --fs: clamp(19px, 1.05vw + 5.5px, 22px); }
[data-size="xl"] { --fs: clamp(20.5px, 1.15vw + 6px, 24px); }
[data-font="readex"] { --font: "Readex Pro", "Noto Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif; }
[data-font="plex"] { --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif; }
[data-font="tajawal"] { --font: "Tajawal", "Noto Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif; }
/* خط الجهاز: بلا أي خط من الموقع، حتى للعناوين */
[data-font="system"] { --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, "Geeza Pro", sans-serif; --font-display: var(--font); }
[data-density="compact"] { --gap: 8px; --pad: 12px; }

/* ---------- الأساسيات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: var(--fs); -webkit-text-size-adjust: 100%; /* مسافة الترويسة: scroll-margin على المحتوى في layouts.css */
  background: var(--bg); scrollbar-color: color-mix(in srgb, var(--text) 28%, transparent) transparent;
}
body {
  position: relative; isolation: isolate;
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; overflow-x: hidden;
}
/* لا انتقالات لونية متقطعة لحظة التبديل بين الفاتح والداكن */
html.theme-swap *, html.theme-swap *::before, html.theme-swap *::after { transition: none !important; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; font-family: var(--font-display); text-wrap: balance; }
h3, h4 { font-weight: 600; }
/* الأرقام البارزة بخط العرض وأرقام بعرض ثابت */
.num-display { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
p { margin: 0 0 .6em; }
code, kbd {
  font-family: var(--mono); font-size: .86em; color: var(--text);
  background: var(--surface-3); padding: .1em .45em; border-radius: 6px; unicode-bidi: plaintext;
}
pre code { direction: ltr; unicode-bidi: isolate; }
pre { background: var(--surface-3); color: var(--text); border-radius: var(--r-sm); padding: 10px 12px; overflow: auto; }
blockquote { margin: .6em 0; padding: .4em 1em; border-inline-start: 3px solid var(--border); color: var(--text-2); }
kbd { border: 1px solid var(--border); border-bottom-width: 2px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1em 0; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); }
::placeholder { color: var(--muted); opacity: 1; }
/* حقل dir="auto" فارغ يُحسب LTR فينحاز نصه التلميحي العربي يسارًا: اتجاه الصفحة حتى يكتب العضو (ثم يعود auto) */
:is(textarea, input)[dir="auto"]:placeholder-shown { direction: var(--doc-dir); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr, .hp {
  position: absolute !important; inset-inline-start: 0; top: 0; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; margin: 0; padding: 0; border: 0;
}

.i { width: 1.3em; height: 1.3em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.3em; }
/* أيقونات الاتجاه (back و chev و arrow، يضيف لها icon() الصنف i-dir) تنعكس في الإنجليزية؛
   أما الأسهم المدوّرة عموديًا فلا تنعكس (الانعكاس يسبق التدوير، فيقلب اتجاهها) */
:root[dir="ltr"] .i-dir { scale: -1 1; }
:root[dir="ltr"] :is(.top-me-chev, .cr-devs-chev, .hn-chev, .nw-sum-chev, .hdr-fold .i, .shp-nav .i) { scale: none; }
.i-sm { width: 1em; height: 1em; }
/* شارة التوثيق: درع رنينة الفيروزي الموحّد للوضعين الفاتح والداكن (لون 1 مميز وغير مشابه لمنصة X) */
.seal {
  --seal-color: #0FA99A;
  width: 1.14em; height: 1.14em; color: var(--seal-color); flex: none;
  vertical-align: -.18em; margin-inline-start: .22em;
  filter: drop-shadow(0 1px 2px rgb(15 169 154 / .28));
}
.seal-bg { fill: var(--seal-color); stroke: none; }
.seal-ring { fill: none; stroke: rgb(255 255 255 / .34); stroke-width: 1.05; }
.seal-dot { fill: #FFFFFF; stroke: none; }
.seal-tick { fill: none; stroke: #FFFFFF; stroke-width: 2.15; stroke-linecap: round; stroke-linejoin: round; }
.btn-verify {
  background: color-mix(in srgb, #0FA99A 14%, var(--surface));
  border-color: color-mix(in srgb, #0FA99A 45%, var(--border));
  color: light-dark(#0B7B6F, #3CE0CE);
  border-radius: var(--r-pill);
}
.btn-verify:hover {
  background: color-mix(in srgb, #0FA99A 24%, var(--surface));
  border-color: #0FA99A;
  color: light-dark(#085E55, #6BF0E0);
}
.btn-verify .seal { margin-inline-start: 0; width: 1.1em; height: 1.1em; vertical-align: 0; }
/* شعار رنينة «حلقات الرنين»: العلامة وحدها بلا اسم. تتبع اللوحة النشطة، وتُتجاوز محليًا بـ --rn-ink و--rn-echo (مثل العارض الداكن) */
.logo { flex: none; overflow: visible; }
.logo .rn-echo { stroke: var(--rn-echo, color-mix(in srgb, var(--accent-2) 88%, var(--accent-ink))); }
.logo .rn-ring { stroke: var(--rn-ink, var(--accent-ink)); }
.logo .rn-dot { fill: var(--rn-ink, var(--accent-ink)); }
.rn-mono { --rn-ink: currentColor; --rn-echo: currentColor; }

.skip { position: absolute; top: -60px; inset-inline-start: 12px; background: var(--btn); color: var(--on-accent); padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { top: 12px; color: var(--on-accent); }

.muted { color: var(--muted); }
.small { font-size: .86em; }
.center { text-align: center; justify-content: center; }
.pad { padding: var(--pad); }
.grow { flex: 1; }
.inline { display: inline-flex; }
.danger { color: var(--danger) !important; }
.danger-soft { color: var(--danger); }
.mono { font-family: var(--mono); letter-spacing: .05em; }
.linklike { color: var(--accent-ink); font-weight: 500; }
.linklike:hover { text-decoration: underline; }
.new {
  font-style: normal; font-size: .72em; font-weight: 600; padding: .1em .55em; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); vertical-align: .15em; margin-inline-start: .3em; white-space: nowrap;
}

/* ---------- الصور الرمزية ---------- */
.av { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); }
.av-gen {
  display: inline-grid; place-items: center; color: var(--on-av); font-weight: 700; user-select: none; font-family: var(--font-display);
  background: var(--av-bg); background-image: linear-gradient(150deg, color-mix(in srgb, var(--av-bg) 72%, var(--surface)), color-mix(in srgb, var(--av-bg) 86%, var(--accent)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
.av-xs { width: 24px; height: 24px; font-size: 11px; }
.av-sm { width: 36px; height: 36px; font-size: 15px; }
.av-md { width: 44px; height: 44px; font-size: 18px; }
.av-lg { width: 56px; height: 56px; font-size: 23px; }
.av-xl { width: 96px; height: 96px; font-size: 38px; }
/* الحساب الرسمي بلا صورة: علامة رنينة على مسحة اللون المميّز (تتبع اللوحة والسمة) */
.av-brand { display: inline-grid; place-items: center; background: var(--accent-soft); background-image: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.av-brand .logo { width: 70%; height: 70%; }

/* ---------- الأزرار والحقول ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em; white-space: nowrap;
  padding: .6em 1.15em; border-radius: var(--r-sm); font-weight: 700; font-size: .906rem; line-height: 1.2;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: background-color var(--dur), border-color var(--dur), color var(--dur), opacity var(--dur), box-shadow var(--dur), transform .12s var(--ease);
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline-offset: 3px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
/* الأساسي: تدرّج خفيف نحو الأعمق (يزيد التباين ولا ينقصه) ولمعة علوية رفيعة وظل ملوّن هادئ */
.btn-primary {
  background-color: var(--btn); background-image: linear-gradient(180deg, var(--btn), color-mix(in srgb, var(--btn) 86%, var(--text)));
  border-color: transparent; color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), 0 1px 2px light-dark(color-mix(in srgb, var(--btn) 30%, transparent), rgb(0 0 0 / .3)),
    0 6px 16px -8px light-dark(color-mix(in srgb, var(--btn) 70%, transparent), rgb(0 0 0 / .6));
}
.btn-primary:hover {
  background-color: color-mix(in srgb, var(--btn) 90%, var(--text)); color: var(--on-accent);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--btn) 94%, var(--text)), color-mix(in srgb, var(--btn) 80%, var(--text)));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), 0 1px 2px light-dark(color-mix(in srgb, var(--btn) 30%, transparent), rgb(0 0 0 / .3)),
    0 10px 22px -10px light-dark(color-mix(in srgb, var(--btn) 80%, transparent), rgb(0 0 0 / .7));
}
.btn-primary:active:not(:disabled) { box-shadow: inset 0 1px 2px rgb(0 0 0 / .14); }
.btn-sm.btn-primary, .btn-sm.btn-primary:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), 0 1px 2px light-dark(color-mix(in srgb, var(--btn) 35%, transparent), rgb(0 0 0 / .3)); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--text); }
.btn-outline:hover { background: var(--hover); border-color: var(--text-2); color: var(--text); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--danger); border-color: transparent; color: var(--on-danger); }
.btn-danger:hover { color: var(--on-danger); background: color-mix(in srgb, var(--danger) 88%, var(--text)); }
.btn-sm { padding: .42em .9em; font-size: .84rem; }
.btn-lg { padding: .75em 1.6em; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .6em; width: 2.6em; height: 2.6em; }
.btn .i { width: 1.15em; height: 1.15em; vertical-align: 0; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); color: var(--text-2);
  transition: background-color var(--dur), color var(--dur), transform .12s var(--ease); flex: none; list-style: none; cursor: pointer;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.bordered { border: 1px solid var(--line); background: transparent; width: 40px; height: 40px; }
.icon-btn .i { width: 1.25em; height: 1.25em; }

.input, .input-prefix {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s; min-width: 0;
}
.input { padding: .65em .9em; outline: none; }
.input:hover:not(:focus), .input-prefix:hover:not(:focus-within) { border-color: color-mix(in srgb, var(--line) 65%, var(--text)); }
.input:focus, .input-prefix:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 2px var(--ring); }
textarea.input { resize: vertical; line-height: 1.6; }
select.input { cursor: pointer; }
.input-prefix { display: flex; align-items: center; padding-inline-start: .8em; }
.input-prefix b { color: var(--muted); font-weight: 500; }
.input-prefix .input { border: 0; background: transparent; box-shadow: none; padding-inline-start: .3em; }
.emoji-input { width: 4.2em; text-align: center; font-size: 1.2em; padding: .45em; flex: none; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span:first-child, .field legend { font-weight: 600; font-size: .9em; color: var(--text); padding: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .input { flex: 1; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions.center { justify-content: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: flex; gap: .5em; align-items: center; cursor: pointer; font-size: .94em; }
.check input, .radio-row input { width: 1.1em; height: 1.1em; }
.check a { color: var(--accent-ink); text-decoration: underline; }
.radio-list { display: grid; gap: 6px; }
.radio-row { display: flex; gap: .6em; align-items: center; padding: .55em .8em; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid transparent; cursor: pointer; }
.radio-row:has(input:checked) { background: var(--surface); border-color: var(--accent); color: var(--text); font-weight: 600; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: .9em; color: var(--muted); }
.inline-field .input { width: auto; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { color: var(--muted); font-size: .85em; }
.switch {
  appearance: none; width: 46px; height: 27px; border-radius: var(--r-pill); background: var(--surface-3); position: relative;
  cursor: pointer; transition: background .2s; flex: none; border: 1px solid var(--line); margin: 0;
}
.switch::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: transform .2s var(--ease);
}
.switch:checked { background: var(--btn); border-color: var(--btn); }
.switch:checked::after { transform: translateX(-19px); background: var(--on-accent); box-shadow: none; }
[dir="ltr"] .switch:checked::after { transform: translateX(19px); }

.strength { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }

.chip {
  display: inline-flex; align-items: center; gap: .35em; padding: .32em .85em; border-radius: var(--r-pill); font-size: .86em;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; cursor: pointer; list-style: none;
}
.chip::-webkit-details-marker { display: none; }
.chip { transition: border-color var(--dur), background-color var(--dur), color var(--dur); }
.chip:hover { border-color: var(--line); color: var(--text); }
.chip.on { background: var(--mist); border-color: transparent; color: var(--text); font-weight: 700; }
.chip .i { width: 1em; height: 1em; }
.chip-soft { background: var(--surface-3); border-color: transparent; font-size: .76em; padding: .15em .6em; cursor: default; color: var(--text-2); }
.chip-soft:hover { border-color: transparent; color: var(--text-2); }
.chip-danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-color: transparent; }
.chip-lg { font-size: .95em; padding: .45em 1em; }
.chip-add { border-style: dashed; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips-row.center { justify-content: center; }
.chip.muted { opacity: .55; }

/* ---------- البطاقات ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-1); padding: var(--pad); }
.card-title { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; display: flex; align-items: center; gap: .45em; margin-bottom: .6em; }
.card-title .i { color: var(--accent); }
.section-title { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 600; margin: 28px 2px 14px; color: var(--text); display: flex; gap: .45em; align-items: center; }
.section-title .i { color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.notice { padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: .92em; display: flex; gap: .5em; align-items: center; margin-bottom: var(--gap); }
.notice a { color: var(--accent-ink); font-weight: 600; }
.notice .i { color: var(--muted); }

/* ---------- الهيكل: ترويسة علوية واحدة (views/partials/nav.php) ثم المسرح: المحتوى + عمود جانبي هادئ ----------
   لا عمود تنقل جانبي: الشكل العلوي يختاره html[data-layout] في layouts.css، والمحتوى يأخذ عرض الصفحة.
   عرض الصفحة على <html data-wide> لتتبعه الترويسة أيضًا (--hdr-max في layouts.css): 1360px افتراضيًا، والرئيسية 1400px
   (الخلاصة نحو 1000px بجانب عمود الشورت كما على شاشة 1366، فلا تمتد الأسطر على الشاشات العريضة)، والاستكشاف 1800px لشبكته،
   وصفحات التركيز 920px للمحتوى وحده (الترويسة تبقى بعرض الصفحات العادية). */
:root { --page-w: 100%; }
:root[data-wide="home"] { --page-w: 100%; }
:root[data-wide="explore"] { --page-w: 100%; }
.shell { width: 100%; max-width: var(--page-max, var(--page-w)); margin: 0 auto; padding: 18px var(--pad-x) 0; }
.shell.is-focus { --page-max: 100%; }
.stage { min-width: 0; }
.stage-body { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: var(--shell-gap); align-items: start; }
.shell.is-wide .stage-body { grid-template-columns: minmax(0, 1fr); }
.shell.is-focus .main { width: 100%; max-width: 100%; margin-inline: auto; }
.main { min-width: 0; padding-bottom: 64px; }

.ic {
  position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: var(--text-2); background: transparent; border: 1px solid transparent; transition: background .15s, color .15s; list-style: none; cursor: pointer;
}
.ic::-webkit-details-marker { display: none; }
.ic:hover { background: var(--hover); color: var(--text); }
.ic .badge { position: absolute; top: 4px; inset-inline-end: 4px; }
.badge.badge-dot { min-width: 0; width: 9px; height: 9px; padding: 0; font-size: 0; border: 2px solid var(--bg); box-sizing: content-box; }
.top-me > summary { display: flex; align-items: center; gap: 4px; padding: 2px; border-radius: var(--r-pill); cursor: pointer; list-style: none; color: var(--muted); }
.top-me > summary::-webkit-details-marker { display: none; }
.top-me > summary:hover { background: var(--hover); }
.top-me-chev { width: 1em; height: 1em; transform: rotate(-90deg); }
.top-me-head { display: flex; flex-direction: column; padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); line-height: 1.4; }
.top-me-head small { color: var(--muted); text-align: end; }
:root[dir="ltr"] .top-me-head small { text-align: start; } /* المعرّف تحت الاسم في الجهتين (الوسم نفسه dir="ltr") */
.theme-form { display: contents; }
.theme-ctrl {
  display: inline-flex; align-items: center; border-radius: var(--r-pill); flex: none;
  transition: background .2s, border-color .2s, padding .2s, gap .2s, box-shadow .2s;
}
.dk-mini {
  display: inline-flex; align-items: center; gap: 5px; max-width: 0; opacity: 0; overflow: hidden; pointer-events: none;
  transition: max-width .28s var(--ease), opacity .2s var(--ease), padding .28s var(--ease);
}
.dk-mini-bar {
  position: relative; width: 82px; height: 18px; border-radius: 99px; padding: 2px;
  background: #000000; border: 1px solid var(--line); display: flex; align-items: center; flex: none;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / .75);
}
.dk-mini-rail {
  position: absolute; inset: 2px; border-radius: 99px; overflow: hidden;
  display: grid; grid-template-columns: repeat(10, 1fr); pointer-events: none;
}
.dk-mini-seg { border-inline-end: 1px solid rgb(255 255 255 / .08); }
.dk-mini-seg:last-child { border-inline-end: 0; }
.dk-mini-range {
  position: relative; z-index: 2; width: 100%; height: 100%; margin: 0;
  background: transparent; appearance: none; -webkit-appearance: none; cursor: grab;
}
.dk-mini-range:active { cursor: grabbing; }
.dk-mini-range::-webkit-slider-runnable-track { height: 100%; background: transparent; border: 0; }
.dk-mini-range::-moz-range-track { height: 100%; background: transparent; border: 0; }
.dk-mini-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: #FFFFFF; border: 2px solid #000000;
  box-shadow: 0 0 0 1px #FFFFFF, 0 1px 4px rgb(0 0 0 / .85); cursor: grab; transition: transform .12s;
}
.dk-mini-range::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #FFFFFF; border: 2px solid #000000;
  box-shadow: 0 0 0 1px #FFFFFF, 0 1px 4px rgb(0 0 0 / .85); cursor: grab; transition: transform .12s;
}
.dk-mini-range:hover::-webkit-slider-thumb, .dk-mini-range:active::-webkit-slider-thumb { transform: scale(1.18); }
.dk-mini-range:hover::-moz-range-thumb, .dk-mini-range:active::-moz-range-thumb { transform: scale(1.18); }
.dk-mini-num {
  font-size: .72rem; font-weight: 700; color: #FFFFFF; min-width: 1.5ch; text-align: center; user-select: none;
}
:root[data-theme="dark"] .theme-ctrl {
  background: var(--surface); border: 1px solid var(--border); padding-inline-end: 8px; gap: 2px;
}
:root[data-theme="dark"] .theme-ctrl .theme-toggle { border-color: transparent; background: transparent; }
:root[data-theme="dark"] .dk-mini { max-width: 124px; opacity: 1; pointer-events: auto; padding-inline-start: 2px; }
/* زر اللغة (lang_switch() و nav.php): نموذج POST بلا غلاف مرئي؛ نصّه اسم اللغة الأخرى بلغتها */
.lang-form { display: contents; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lang-btn .i { width: 1.15em; height: 1.15em; }
.lang-btn.ic { display: grid; border-color: var(--border); background: var(--surface); }
.lang-btn.ic .i { width: 1.3em; height: 1.3em; }
.lang-btn.ic > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lang-pill { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font-size: .9em; font-weight: 500; }
.lang-pill:hover { background: var(--hover); color: var(--text); }
.lang-link { color: inherit; font-size: inherit; font-weight: inherit; }
.lang-link:hover { color: var(--text); text-decoration: underline; }
.foot-links .lang-link { color: var(--text-2); }
/* زر الوضع الداكن: قمر في الفاتح، شمس في الداكن */
.theme-toggle { border-color: var(--border); background: var(--surface); }
.theme-toggle .tt-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme-toggle .tt-moon { display: none; }
  :root[data-theme="auto"] .theme-toggle .tt-sun { display: block; }
  :root[data-theme="auto"] .theme-ctrl { background: var(--surface); border: 1px solid var(--border); padding-inline-end: 8px; gap: 2px; }
  :root[data-theme="auto"] .theme-ctrl .theme-toggle { border-color: transparent; background: transparent; }
  :root[data-theme="auto"] .dk-mini { max-width: 124px; opacity: 1; pointer-events: auto; padding-inline-start: 2px; }
}

/* شعار الصفحات بلا ترويسة (الهبوط والدخول): العلامة وحدها في دائرة نقر 44px، وحلقة التركيز دائرية حولها */
.brand { display: inline-grid; place-items: center; flex: none; padding: 2px; margin-inline-start: -2px; border-radius: var(--r-pill); line-height: 0; }
.brand .logo { width: 40px; height: 40px; }
/* حلقة تركيز الشعار بلون النص لا المميز: حلقة بلون العلامة تُقرأ حلقةً رابعة من حلقاتها لا تركيزًا */
:is(.brand, .foot-brand):focus-visible { outline-color: var(--text); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--danger); color: var(--on-danger);
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; font-style: normal;
}

/* العمود الجانبي: أهدأ من المحتوى — بلا ظل ولا تعبئة */
.side {
  position: sticky; top: calc(var(--stick-top, var(--top-h)) + 16px); display: flex; flex-direction: column; gap: 12px; padding-bottom: 32px;
  transition: top .45s var(--ease);
  max-height: calc(100vh - var(--top-h) - 16px); overflow-y: auto; scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }
.widget { background: transparent; border: 1px solid var(--border); border-radius: var(--r); padding: 14px; }
.widget h3 { font-size: 1rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: .45em; margin-bottom: 10px; }
.widget-more { display: inline-block; color: var(--accent-ink); font-size: .86rem; font-weight: 600; margin-top: 8px; }
.widget-more:hover { text-decoration: underline; }
.w-join p { color: var(--text-2); font-size: .92em; }
.w-join .btn { margin-top: 8px; }
.trend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.trend-list a { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-sm); }
.trend-list a:hover { background: var(--hover); color: inherit; }
.trend-n { width: 22px; text-align: center; font-family: var(--font-display); font-size: .82rem; font-weight: 600; color: var(--accent-ink); flex: none; font-variant-numeric: tabular-nums; }
.trend-tx { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.trend-tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .94rem; }
.trend-tx small { color: var(--muted); font-size: .8rem; }
.mini-people { display: flex; flex-direction: column; gap: 10px; }
.mini-person { display: flex; align-items: center; gap: 10px; }
.mini-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.mini-tx small { color: var(--muted); font-size: .8rem; text-align: start; }
/* عناوين قصيرة باتجاهها (dir="auto" أو dir_attr()) في عمود flex تمتد بعرض الصف: نص بلغة أخرى يبقى باتجاهه لكنه يصطفّ مع بداية الواجهة كسطره التابع.
   النصوص متعددة الأسطر (نص المنشور، النبذة، وصف الملتقى في البطاقة) تبقى بمحاذاتها الطبيعية. */
:is(.mini-tx, .trend-tx, .x-card-body, .x-row-tx, .hub-card-tx, .x-hub-tx) > [dir]:not(small) { text-align: var(--start); }
.mini-name { display: flex; align-items: center; min-width: 0; font-size: .94rem; }
.mini-name .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mini-hubs { display: flex; flex-direction: column; gap: 6px; }
.mini-hub { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-sm); }
.mini-hub:hover { background: var(--hover); color: inherit; }
.side-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 6px; font-size: .8rem; color: var(--muted); }
.side-foot a:hover, .side-foot button:hover { color: var(--text); text-decoration: underline; }
.side-foot button { color: inherit; font-size: inherit; font-weight: 400; }

/* أيقونة الملتقى: المكان الوحيد الذي يظهر فيه لون الملتقى (16٪) */
.hub-ic {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); flex: none; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
}
.hub-ic .i { width: 1.2em; height: 1.2em; }
.hub-dot { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; color: var(--text-2); background: var(--surface-2); }
.hub-dot .i { width: .95em; height: .95em; }

/* ترويسة الصفحة: عنوان واحد واضح */
.page-head { display: flex; align-items: center; gap: 12px; padding: 6px 2px; margin: 0 0 18px; min-height: 48px; }
.page-head-tabs { flex-wrap: wrap; }
.page-head-tabs .page-title, .page-head-tabs .search-bar, .page-head-tabs .tabs { flex: 1 1 100%; }
.page-head-ctx { margin-bottom: 8px; }
.page-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-title h1 { font-size: var(--fs-h1); font-weight: 700; line-height: 1.25; }
.page-title small { color: var(--muted); font-size: .9rem; margin-top: 3px; line-height: 1.5; }
.page-head-ctx .page-title small { font-size: .84rem; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* التبويبات: نص مع خط مميز تحت النشط */
.tabs, .wall-chips {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.tabs::-webkit-scrollbar, .wall-chips::-webkit-scrollbar { display: none; }
.tabs a, .wall-chips a {
  position: relative; flex: 0 0 auto; padding: 10px 14px 12px; color: var(--muted); font-weight: 600; font-size: .906rem; white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0; transition: color .15s, background .15s; display: inline-flex; align-items: center; gap: .35em;
}
.tabs a:hover, .wall-chips a:hover { color: var(--text); background: var(--hover); }
.tabs a.active, .wall-chips a.on { color: var(--text); font-weight: 700; }
.tabs a.active::after, .wall-chips a.on::after {
  content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent);
}
.tabs .tab-add, .wall-chips .chip-add { padding-inline: 10px; color: var(--muted); }
.tabs-solo, .wall-chips { margin: 16px 0 var(--gap); }
/* تلاشٍ عند الطرف الذي فيه تبويبات أخرى (يضبطه app.js؛ الاتجاه من اليمين لليسار) */
.tabs.more-end, .wall-chips.more-end, .trend-grid.more-end { mask-image: linear-gradient(to var(--start), transparent, #000 32px); }
.tabs.more-start, .wall-chips.more-start, .trend-grid.more-start { mask-image: linear-gradient(to var(--end), transparent, #000 32px); }
.tabs.more-start.more-end, .wall-chips.more-start.more-end, .trend-grid.more-start.more-end { mask-image: linear-gradient(to var(--start), transparent, #000 32px, #000 calc(100% - 32px), transparent); }

/* تنبيه «بدأت مكالمة» أعلى الصفحات (views/partials/call_banner.php، ويحدّثه app.js) */
.call-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 12px; padding-inline: 12px 8px; margin: 0 0 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-1); animation: menu-in .25s var(--ease);
}
.call-banner .cb-ic {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--btn); color: var(--on-accent);
}
.call-banner .cb-ic::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: cb-echo 2s var(--ease) infinite; }
@keyframes cb-echo { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }
.call-banner .cb-tx { flex: 1; min-width: 0; font-weight: 700; font-size: .94rem; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .call-banner .cb-ic::after { animation: none; } }

.announce {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin: 0 0 16px; border-radius: var(--r);
  background: var(--surface); color: var(--text); font-weight: 500; font-size: .92em; border: 1px solid var(--border);
}
.announce .i { color: var(--accent); }
.announce a { color: var(--text); text-decoration: underline; }

/* ---------- المنشور: النص هو البطل ---------- */
.feed { display: flex; flex-direction: column; gap: var(--gap); }
.post {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-1);
  padding: var(--pad); position: relative; cursor: pointer; outline: none;
  transition: border-color var(--dur), background-color var(--dur), box-shadow var(--dur-2) var(--ease-out);
}
.post:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.post:focus-within { z-index: 6; }
.post.is-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.post.is-new { animation: fade-in .4s var(--ease); }
@keyframes fade-in { from { opacity: 0; } }
.post-ctx { display: flex; align-items: center; gap: .4em; font-size: .84rem; color: var(--muted); font-weight: 600; margin: -2px 0 8px; padding-inline-start: 52px; }
.post-ctx .i { width: 1.05em; height: 1.05em; }
.post-ctx a:hover { text-decoration: underline; color: var(--text-2); }
.post-grid { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; }
.post-av { position: relative; }
.post .post-av .av { width: 46px; height: 46px; font-size: 18px; }
.post-body { min-width: 0; }
.post-head { display: flex; align-items: center; gap: 8px; min-height: 26px; flex-wrap: nowrap; font-size: 1rem; line-height: 1.45; }
.post-who { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.uname { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uname:hover { text-decoration: underline; color: var(--text); }
.ustatus { font-size: .95em; margin-inline-start: .15em; }
.ustatus .i { width: 1em; height: 1em; color: var(--muted); vertical-align: -.15em; }
.handle { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.post-time { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.post-time::before { content: "·"; margin-inline-end: 6px; }
.post-time:hover { text-decoration: underline; color: var(--text-2); }
.post-flags { display: inline-flex; gap: 4px; align-items: center; margin-inline-start: auto; }
.flag { display: inline-flex; align-items: center; gap: 3px; font-size: .82rem; color: var(--muted); background: var(--surface-2); border-radius: var(--r-pill); padding: .1em .55em; white-space: nowrap; }
.flag .i { width: 1.05em; height: 1.05em; }
.flag-eph { background: var(--surface-2); color: var(--muted); }
.post-menu summary { width: 32px; height: 32px; }
.post-head .post-menu { margin-inline-start: 0; }
.post-flags:empty + .post-menu { margin-inline-start: auto; }
.post-menu > summary { color: var(--muted); }
.reply-ctx { font-size: .9rem; color: var(--muted); margin-top: 2px; }
.reply-ctx a { color: var(--accent-ink); }
.post-text { margin-top: 8px; font-size: 1.125rem; line-height: 1.8; color: var(--text); overflow-wrap: anywhere; white-space: normal; }
.post-text a, .quote-text a, .profile-bio a, .msg-bubble a { color: var(--accent-ink); }
.post-text a:hover { text-decoration: underline; }
.post-text code { font-size: .85em; }
.mention, .tag { font-weight: 600; color: var(--accent-ink); }
.ext { unicode-bidi: isolate; }
mark, .hit { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.tag mark, .mention mark, .tag .hit, .mention .hit { color: var(--text); }

/* المنشور الرئيسي في صفحته: النص بعرض البطاقة كاملًا */
.post-main { cursor: default; padding: 22px; }
.post-main .post-grid { grid-template-columns: minmax(0, 1fr); gap: 0; position: relative; }
.post-main .post-av { position: absolute; top: 0; inset-inline-start: 0; z-index: 1; }
.post-main .post-av .av { width: 52px; height: 52px; font-size: 20px; }
.post-main .post-head { min-height: 52px; padding-inline-start: 64px; }
.post-main .handle { display: inline; }
.post-main .post-text { font-size: 1.25rem; line-height: 1.82; margin-top: 14px; }
.post-main .reply-ctx { padding-inline-start: 60px; margin-top: -14px; margin-bottom: 8px; }
.post-main .post-ctx { padding-inline-start: 0; }

.media { display: grid; gap: 3px; margin-top: 12px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); }
.media-1 { grid-template-columns: 1fr; }
.media-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-3 .media-item:first-child { grid-row: span 2; }
.media-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-item { display: block; overflow: hidden; background: var(--surface-3); min-height: 0; }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-1 .media-item img { max-height: 560px; height: auto; margin-inline: auto; }

.spoiler { margin-top: 8px; }
.spoiler summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .55em; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px dashed var(--line); color: var(--text-2);
}
.spoiler summary .i { color: var(--muted); }
.spoiler summary::-webkit-details-marker { display: none; }
.spoiler summary em { font-style: normal; margin-inline-start: auto; color: var(--accent-ink); font-weight: 600; font-size: .9em; }
.spoiler[open] summary { padding: 4px 10px; background: transparent; border-style: solid; border-color: var(--border); font-size: .85em; }
.spoiler[open] summary em { display: none; }

.qa-card { margin: 8px 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.qa-label { display: flex; align-items: center; gap: .4em; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.qa-card p { margin: 0; font-weight: 600; color: var(--text); }

.quote { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface); cursor: pointer; transition: background .15s; }
.quote:hover { background: var(--surface-2); }
.quote-head { display: flex; align-items: center; gap: 6px; font-size: .9em; min-width: 0; }
.quote-head .post-time::before { content: "·"; }
.quote-text { font-size: .97rem; margin-top: 4px; color: var(--text-2); line-height: 1.7; }
.quote-img { margin-top: 8px; border-radius: var(--r-sm); max-height: 200px; width: 100%; object-fit: cover; background: var(--surface-3); }
.quote-gone { color: var(--muted); font-size: .9em; cursor: default; display: flex; gap: .4em; align-items: center; }

.hub-chip { display: inline-flex; align-items: center; gap: .35em; margin-top: 10px; padding: .2em .7em; border-radius: var(--r-pill); font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.hub-chip .i { width: 1.05em; height: 1.05em; color: var(--muted); }
.hub-chip:hover { color: var(--text); }

.poll { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.poll form { display: flex; flex-direction: column; gap: 6px; }
.poll-opt {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); overflow: hidden; text-align: start; width: 100%; font-weight: 500; color: var(--text);
}
button.poll-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.poll-opt.is-result { border-color: var(--border); background: var(--surface); }
.poll-bar { position: absolute; inset-block: 0; inset-inline-start: 0; background: color-mix(in srgb, var(--accent) 16%, transparent); transition: width .6s var(--ease); }
.poll-opt.mine .poll-bar, .poll-opt.win .poll-bar { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.poll-t, .poll-opt b { position: relative; display: inline-flex; align-items: center; gap: .3em; }
.poll-opt.win { font-weight: 700; }
.poll-meta { font-size: .82em; color: var(--muted); }

.post-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: .88em; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.post-meta .i { width: 1.1em; height: 1.1em; }
.rx-sum:hover { color: var(--accent-ink); }
.edit-history { margin-top: 10px; font-size: .88em; }
.edit-history summary { cursor: pointer; color: var(--muted); display: inline-flex; gap: .3em; align-items: center; }
.edit-v { padding: 8px 12px; margin-top: 6px; border-inline-start: 3px solid var(--border); background: var(--surface-2); border-radius: 0; border-start-start-radius: var(--r-sm); border-end-start-radius: var(--r-sm); }
.edit-v time { display: block; font-size: .85em; color: var(--muted); }
.reply-policy { margin-top: 8px; font-size: .85em; color: var(--muted); display: flex; gap: .3em; align-items: center; }

/* شريط الإجراءات: هادئ حتى التمرير أو التركيز */
.post-actions { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 8px; margin-inline-start: -8px; max-width: 420px; }
.post-actions > * { display: flex; }
.post-actions .react-main { flex: 1; display: flex; }
.post-actions .react-main .act { flex: 1; }
.post-main .post-actions { max-width: none; margin-inline: 0; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.act {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; border-radius: var(--r-sm); color: var(--muted);
  font-size: .84rem; min-height: 36px; min-width: 40px; transition: background .15s, color .15s; list-style: none; cursor: pointer; background: transparent;
}
.act::-webkit-details-marker { display: none; }
.act .i { width: 1.2em; height: 1.2em; }
.act .count:empty { display: none; }
.act:hover, .act:focus-visible { background: var(--surface-2); color: var(--text); }
.act:active { transform: scale(.94); }
.act { transition: background-color var(--dur), color var(--dur), transform .12s var(--ease); }
/* نبضة صغيرة عند التفاعل أو الحفظ (تُلغى مع تقليل الحركة) */
.act.is-pop .rx-ic, .act.is-pop > .i { animation: act-pop .38s var(--ease-out); }
@keyframes act-pop { 0% { transform: scale(.7); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
.act-react.on, .act-repost.on { color: var(--accent-ink); }
.act-save.on { color: var(--text); }
.act-save.on .i, .act-react.on .rx-love { fill: currentColor; }
.act-react.on .rx-ic .rx { fill: none; }
.act-react.on .rx-ic .rx-love { fill: currentColor; }
.act-disabled { opacity: .5; cursor: not-allowed; }
.rx-ic { display: inline-grid; place-items: center; min-width: 1.2em; line-height: 1; }
.rx { fill: none; }
.rx { color: inherit; }

.react { position: relative; }
.react-pick {
  position: absolute; bottom: calc(100% + 4px); inset-inline-start: -24px; display: flex; gap: 2px; padding: 6px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2); z-index: 15;
  opacity: 0; visibility: hidden; scale: 0; transition: opacity .15s, visibility 0s .15s, scale 0s .15s; /* scale: المخفي لا يمدّ الصفحة أفقيًا */
}
.react-pick::after { content: ""; position: absolute; top: 100%; inset-inline: 0; height: 10px; }
.react:hover .react-pick, .react:has(:focus-visible) .react-pick, .react.show .react-pick { opacity: 1; visibility: visible; scale: 1; transition-delay: .25s, 0s, 0s; }
.react-pick button { width: 2.2em; height: 2.2em; border-radius: 50%; display: grid; place-items: center; transition: background .15s; }
.react-pick button .i { width: 1.3em; height: 1.3em; }
.react-pick button:hover { background: var(--surface-2); }
.react-pick button.on { background: var(--accent-soft); }

.post-gone { cursor: default; }
.gone { color: var(--muted); font-size: .92em; display: flex; align-items: center; gap: .5em; }

/* سلسلة المنشورات: حواف متطابقة وخط في مساره الخاص */
.thread { display: flex; flex-direction: column; margin-bottom: var(--gap); }
.thread .post { border-radius: 0; border-bottom-width: 0; box-shadow: none; }
.thread .post:first-child { border-radius: var(--r) var(--r) 0 0; }
.thread .post:last-child { border-radius: 0 0 var(--r) var(--r); border-bottom-width: 1px; box-shadow: var(--shadow-1); }
.thread .post:only-child { border-radius: var(--r); }
.has-thread .post-av::after {
  content: ""; position: absolute; top: 46px; bottom: calc(-1 * var(--pad) - 14px); inset-inline-start: 19px; width: 2px;
  background: var(--border); border-radius: 2px;
}
.post-main.has-thread .post-av::after, .replies .post .post-av::after { display: none; }
.replies-empty { padding: 16px; }

/* القوائم المنبثقة */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-2); padding: 6px; z-index: 40; display: flex; flex-direction: column; animation: menu-in .15s var(--ease);
}
.act-menu .menu-pop { inset-inline-end: auto; inset-inline-start: 0; }
.menu-pop.menu-up { top: auto; bottom: calc(100% + 6px); inset-inline-start: 0; inset-inline-end: 0; }
.menu-pop.wide { min-width: 290px; }
.menu-pop form { display: block; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--r-sm); font-size: .93em; text-align: start; color: var(--text);
}
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item .i { width: 1.15em; height: 1.15em; color: var(--muted); }
.menu-item.danger .i { color: var(--danger); }

/* ---------- المحرر ---------- */
.composer-card { padding: 14px var(--pad); margin-bottom: var(--gap); }
.composer { position: relative; }
.cmp-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
.cmp-av .av { width: 40px; height: 40px; font-size: 16px; }
.composer-reply .cmp-av .av { width: 36px; height: 36px; }
.cmp-items { display: flex; flex-direction: column; gap: 8px; }
.cmp-item { position: relative; }
.cmp-item + .cmp-item { padding-top: 8px; border-top: 1px dashed var(--border); }
.cmp-item textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 1.0625rem; line-height: 1.7; padding: 7px 0;
  min-height: 2.6em; color: var(--text);
}
.dlg-compose .cmp-item textarea { min-height: 5em; }
.composer-reply .cmp-item textarea { font-size: 1rem; }
.cmp-item .cmp-remove { position: absolute; top: 8px; inset-inline-end: 0; }
.cmp-previews { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cmp-prev { position: relative; width: 96px; height: 96px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); }
.cmp-prev img { width: 100%; height: 100%; object-fit: cover; }
.cmp-prev button { position: absolute; top: 4px; inset-inline-end: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgb(0 0 0 / .65); color: #fff; display: grid; place-items: center; }
.cmp-prev button .i { width: 14px; height: 14px; }
.cmp-poll { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-sm); padding: 12px; margin: 10px 0; display: grid; gap: 8px; }
.cmp-poll legend { font-weight: 600; font-size: .9em; padding: 0 6px; display: flex; gap: .3em; align-items: center; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-chips:not(:empty) { margin-top: 8px; }
.cmp-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
/* مؤشر التركيز للحقل (الحقل نفسه بلا إطار): الفاصل يصير خطًّا صلبًا بسماكة 2px (الحد + ظل داخلي بلا إزاحة للمحتوى) */
.composer:has(.cmp-item textarea:focus-visible) .cmp-bar { border-top-color: var(--ring); box-shadow: inset 0 1px 0 var(--ring); }
.cmp-tools { display: flex; align-items: center; gap: 2px; }
.tool { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); color: var(--muted); cursor: pointer; list-style: none; }
.tool::-webkit-details-marker { display: none; }
.tool:hover { background: var(--hover); color: var(--text); }
.tool-pop { position: relative; }
.tool-pop > summary { list-style: none; }
.tool-pop > summary::-webkit-details-marker { display: none; }
.pop {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 45; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-2); padding: 12px; animation: menu-in .15s var(--ease);
}
.emoji-grid { display: grid; grid-template-columns: repeat(6, 38px); gap: 2px; }
.emoji-grid button { font-size: 1.35em; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; }
.emoji-grid button:hover { background: var(--surface-2); }
.cmp-opts { width: min(320px, 80vw); display: flex; flex-direction: column; gap: 10px; }
.cmp-opts label { display: flex; flex-direction: column; gap: 4px; }
.cmp-opts label > span { font-size: .84em; font-weight: 600; color: var(--text-2); display: flex; gap: .35em; align-items: center; }
.cmp-opts .input { padding: .5em .7em; font-size: .92em; }
.cmp-send { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.cmp-draft span { display: inline; }
.ring { position: relative; width: 30px; height: 30px; display: inline-grid; place-items: center; }
.ring svg { width: 30px; height: 30px; transform: rotate(-90deg); position: absolute; inset: 0; }
.ring circle { fill: none; stroke: var(--surface-3); stroke-width: 3; }
.ring .ring-v { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset .15s, stroke .15s; }
.ring.warn .ring-v { stroke: var(--warn); }
.ring.over .ring-v { stroke: var(--danger); }
.ring b { font-size: .68em; font-weight: 600; color: var(--muted); position: relative; }
.ring.over b { color: var(--danger); }
.mention-box { position: absolute; z-index: 50; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 5px; }
.mention-box button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border-radius: var(--r-sm); text-align: start; }
.mention-box button.on, .mention-box button:hover { background: var(--surface-2); }
.mention-box small { color: var(--muted); }

/* ---------- الأشخاص ---------- */
.people { display: flex; flex-direction: column; padding: 0; }
.people.card { padding: 4px 0; }
.person { display: flex; gap: 12px; padding: 12px var(--pad); align-items: flex-start; }
.person + .person, [data-row] + [data-row] .person { border-top: 1px solid var(--border); }
.person-tx { flex: 1; min-width: 0; }
.person-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.person-handle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .86rem; }
.person-bio { margin: 4px 0 0; color: var(--text-2); font-size: .94rem; }
.person-act { flex: none; align-self: center; }
.rx-badge { font-size: 1.1em; }
.rx-badge .i { width: 1.2em; height: 1.2em; }
.follow-btn { border-radius: var(--r-pill); padding-inline: 1.15em; min-width: 5.2em; font-weight: 700; }
.follow-btn[data-state="following"]:hover span, .follow-btn[data-state="requested"]:hover span { display: none; }
.follow-btn[data-state="following"]:hover::after { content: attr(data-unfollow); } /* النص من follow_button() بلغة الواجهة */
.follow-btn[data-state="requested"]:hover::after { content: attr(data-uncancel); }
.follow-btn[data-state]:not([data-state="none"]):hover { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.people-strip { padding: 10px; margin-bottom: var(--gap); }
.people-strip .card-title { padding: 6px 10px 0; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--gap); margin-bottom: 24px; }
.person-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 20px 14px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.person-card h4 { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 2px; max-width: 100%; }
.person-card small { color: var(--muted); }
.person-card p { color: var(--text-2); font-size: .9em; margin: 4px 0 0; }
.person-card .btn, .person-card form { margin-top: 10px; }

/* ---------- الملف الشخصي ---------- */
.profile { padding: 0; overflow: hidden; }
.cover { height: 140px; position: relative; overflow: hidden; background: var(--mist); }
.cover img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.profile-top { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 20px; margin-top: -48px; position: relative; z-index: 2; }
.profile-av .av { border: 4px solid var(--surface); }
.profile-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 4px; }
.profile-info { padding: 10px 20px 18px; }
.profile-name { font-size: 1.625rem; font-weight: 700; display: flex; align-items: center; gap: .25em; flex-wrap: wrap; line-height: 1.3; }
.profile-handle { color: var(--muted); display: flex; gap: 8px; align-items: center; font-size: .94rem; }
.profile-status { display: inline-flex; gap: .4em; align-items: center; margin-top: 8px; padding: .3em .9em; border-radius: var(--r-pill); background: var(--surface-2); font-size: .9em; border: 1px solid var(--border); }
.profile-status .i { color: var(--muted); }
.profile-bio { margin: 10px 0 6px; white-space: pre-line; font-size: 1.02rem; line-height: 1.7; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9em; margin-top: 8px; }
.profile-meta > * { display: inline-flex; align-items: center; gap: 4px; }
.profile-meta a { color: var(--accent-ink); }
.profile-meta .i { width: 1.1em; height: 1.1em; }
.profile-stats { display: flex; gap: 18px; margin-top: 10px; font-size: .95em; color: var(--muted); }
.profile-stats b { color: var(--text); font-weight: 600; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.profile-stats a:hover { text-decoration: underline; color: var(--muted); }
.mutuals { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); }
.notif-avs { display: inline-flex; }
.notif-avs .av { border: 2px solid var(--surface); margin-inline-start: -7px; }
.notif-avs .av:first-child { margin-inline-start: 0; }
.achievements { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ach { display: inline-flex; align-items: center; gap: .35em; padding: .2em .7em; border-radius: var(--r-pill); font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); cursor: help; }
.ach .i { width: 1.05em; height: 1.05em; color: var(--muted); }
.private-note { margin: 0 20px 18px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.private-note summary { cursor: pointer; font-size: .9em; color: var(--text-2); display: flex; align-items: center; gap: .4em; flex-wrap: wrap; }
.private-note form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; align-items: flex-start; }
.ask-box { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--gap); }
.ask-head { display: flex; align-items: center; gap: 10px; }
.ask-emo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); }

/* ---------- الإشعارات: الصورة الرمزية أولًا ونص المنشور واضح ---------- */
.notif-list, .feed.notifs { padding: 0; display: flex; flex-direction: column; gap: 0; overflow: hidden; }
.notif { display: flex; gap: 12px; padding: 14px var(--pad); position: relative; color: inherit; }
.notif + .notif { border-top: 1px solid var(--border); }
.notif:hover { background: var(--hover); color: inherit; }
.notif-lead { position: relative; flex: none; width: 36px; height: 36px; }
.notif-lead .av { width: 36px; height: 36px; font-size: 15px; }
.notif-ic {
  position: absolute; bottom: -4px; inset-inline-end: -6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--muted); box-shadow: 0 0 0 1px var(--border);
}
.notif-ic .i { width: 13px; height: 13px; stroke-width: 2; }
.notif-solo { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notif-tx { font-size: .94rem; color: var(--text-2); }
.notif-tx b { color: var(--text); }
.notif.unread .notif-tx { font-weight: 600; color: var(--text); }
.notif.unread::after { content: ""; position: absolute; top: 20px; inset-inline-end: var(--pad); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.notif.unread .notif-body { padding-inline-end: 16px; }
.notif-quote { color: var(--text-2); font-size: .95rem; line-height: 1.65; }
.notif-time { color: var(--muted); font-size: .8rem; }
.notif-avs .av { width: 22px; height: 22px; }
.quick-links { display: grid; gap: 8px; margin-bottom: var(--gap); }
.quick { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.quick span { flex: 1; }
.quick > .i { color: var(--muted); }

/* ---------- المحفوظات / المسودات / الأسئلة ---------- */
.bm-bar { display: flex; flex-direction: column; gap: 12px; margin-bottom: var(--gap); }
.bm { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-1); background: var(--surface); }
.bm .post { border: 0; border-radius: 0; box-shadow: none; }
.bm-meta { background: var(--surface); border-top: 1px solid var(--border); padding: 10px var(--pad); }
.bm-meta summary { cursor: pointer; display: flex; align-items: center; gap: .5em; color: var(--muted); font-size: .88em; list-style: none; }
.bm-meta summary::-webkit-details-marker { display: none; }
.bm-note { color: var(--text-2); font-style: italic; flex: 1; }
.bm-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.draft { display: flex; flex-direction: column; gap: 10px; }
.draft-text { white-space: pre-line; overflow-wrap: anywhere; font-size: 1.02rem; }
.draft-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sched-when { display: flex; align-items: center; gap: .45em; font-weight: 600; color: var(--text-2); flex-wrap: wrap; }
.ask-intro { display: flex; gap: 14px; align-items: flex-start; margin-bottom: var(--gap); }
.question { display: flex; flex-direction: column; gap: 10px; }
.q-text { display: flex; gap: 12px; align-items: flex-start; }
.q-text p { font-size: 1.06rem; font-weight: 600; margin: 0; }
.q-mark { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-weight: 800; font-size: 1.1em; flex: none; }
.q-answer { display: flex; flex-direction: column; gap: 8px; }

/* ---------- الملتقيات والقوائم ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.hub-card { display: flex; flex-direction: column; gap: 10px; }
.hub-card-head { display: flex; align-items: center; gap: 12px; }
.hub-card-head .hub-ic { width: 44px; height: 44px; }
.hub-card-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.hub-card-tx small { color: var(--muted); font-size: .82rem; }
.hub-name { font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-card-desc { margin: 0; color: var(--text-2); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip-hub { padding-inline-start: .35em; }
.hub-hero { padding: 0; overflow: hidden; }
.hub-banner { height: 96px; background: var(--mist); }
.hub-hero-body { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 6px; }
.hub-ic-xl { width: 64px; height: 64px; margin-top: -32px; border: 4px solid var(--surface); border-radius: var(--r); background: var(--surface-2); }
.hub-ic-xl .i { width: 1.7em; height: 1.7em; }
.hub-hero-body h1 { font-size: 1.625rem; font-weight: 700; margin-top: 4px; }
.hub-hero-body p { color: var(--text-2); margin: 0; }
.hub-hero-body > [dir] { text-align: var(--start); }
.hub-hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hub-hero-foot a:not(.btn) { color: var(--accent-ink); }
.rules { margin: 0; padding-inline-start: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.list-grid { display: grid; gap: 8px; }
.list-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.list-ic { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.list-ic.big { width: 64px; height: 64px; border-radius: var(--r); }
.list-ic.big .i { width: 1.8em; height: 1.8em; }
.list-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.list-tx small { color: var(--muted); font-size: .85em; }
.list-hero { display: flex; gap: 14px; align-items: flex-start; }
.list-hero > div:nth-child(2) { flex: 1; }
.form.pad { padding: 8px; }
.create-box { margin-bottom: var(--gap); }
.create-box summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: .4em; color: var(--text); list-style: none; }
.create-box summary::-webkit-details-marker { display: none; }
.create-box summary .i { color: var(--muted); }
.create-box[open] summary { margin-bottom: 12px; }
.feed-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.feed-info { display: flex; gap: 8px; align-items: center; padding: 10px 14px; margin-bottom: var(--gap); border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); font-size: .88em; color: var(--muted); }
.feed-info span { flex: 1; }
.feed-info a { color: var(--accent-ink); font-weight: 600; }

/* ---------- الاستكشاف والبحث ---------- */
.search-bar {
  display: flex; align-items: center; gap: 10px; padding: 0; padding-inline-start: 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.search-bar input { flex: 1; border: 0; outline: 0; background: transparent; padding: 11px 0; min-width: 0; color: var(--text); }
.search-bar.slim { background: var(--surface-2); }
.trend-row { margin-bottom: 8px; }
.trend-row .section-title { margin-top: 0; }
.trend-grid { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.trend-grid::-webkit-scrollbar { display: none; }
.trend-chip { flex: none; gap: .5em; padding: .4em .95em; font-size: .9rem; }
.trend-chip b { font-weight: 600; color: var(--text); }
.trend-chip small { color: var(--muted); font-size: .8rem; }
.search-help ul.op-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.search-help li { color: var(--text-2); font-size: .94em; }

/* ---------- صفحات متفرقة ---------- */
/* الحالات الفارغة: خلفية فنية شفافة مختلفة لكل بطاقة + صورة تجريدية مضيئة وسطها */
.empty {
  position: relative; overflow: hidden; isolation: isolate;
  text-align: center; padding: 44px 24px 40px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background-image: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--text) 4%, transparent), transparent 72%);
}
.empty-bg-art {
  position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important;
  z-index: -1; pointer-events: none; opacity: light-dark(.08, .11);
  filter: grayscale(1) contrast(.82);
  /* تتلاشى الخلفية تمامًا عند منطقة النص السفلية فلا تتشابك مع العنوان والوصف */
  -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0 / .85) 0%, rgb(0 0 0 / .35) 42%, transparent 78%);
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / .85) 0%, rgb(0 0 0 / .35) 42%, transparent 78%);
}
.empty-ic {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px; color: var(--accent-ink);
  background: linear-gradient(160deg, var(--surface), var(--mist)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent),
    0 0 0 10px color-mix(in srgb, var(--accent) 7%, transparent);
}
.empty-ic .i { width: 1.6em; height: 1.6em; stroke-width: 1.6; }
.empty h3 { font-size: 1.22rem; font-weight: 700; position: relative; z-index: 1; text-shadow: 0 1px 10px var(--surface); }
.empty p { color: var(--text-2); max-width: 440px; margin: 0; line-height: 1.75; text-wrap: pretty; position: relative; z-index: 1; text-shadow: 0 1px 8px var(--surface); }
.empty .btn { margin-top: 12px; position: relative; z-index: 1; }
/* «بلا اتصال» باللغة الأخرى تحت النص الأساسي (views/static/offline.php) */
.empty-alt { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); width: min(400px, 100%); }
.empty-alt h3 { font-size: 1rem; }
.empty-alt p { font-size: .92em; }
.load-more { display: block; text-align: center; padding: 11px; margin-top: var(--gap); border-radius: var(--r-sm); background: transparent; border: 1px solid var(--border); color: var(--accent-ink); font-weight: 600; }
.load-more:hover { background: var(--hover); }
.load-more.loading { opacity: .6; pointer-events: none; }
.digest-banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: var(--gap); border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.digest-banner:hover { color: var(--text); border-color: color-mix(in srgb, var(--line) 55%, var(--border)); }
.digest-banner.m-only { display: none; }
.digest-banner > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.digest-banner b { font-size: .97rem; }
.digest-banner small { color: var(--muted); font-size: .84rem; }
.digest-banner > .i { color: var(--muted); }
.digest-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); color: var(--accent); display: grid; place-items: center; flex: none; }
.digest-ic.big { width: 52px; height: 52px; }
.digest-ic.big .i { width: 1.6em; height: 1.6em; }
.digest-hero { display: flex; gap: 16px; align-items: flex-start; margin-bottom: var(--gap); }
.digest-hero h2 { font-size: 1.125rem; margin-bottom: 4px; }
.digest-hero p { margin: 0; color: var(--text-2); }
.tips ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; color: var(--text-2); font-size: .94em; }
.error-card { text-align: center; padding: 48px 24px; margin-top: 32px; }
.error-code { font-family: var(--font-display); font-size: clamp(4rem, 3rem + 4vw, 6rem); font-weight: 600; color: var(--accent-ink); line-height: 1; font-variant-numeric: tabular-nums; }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .error-code { background: linear-gradient(100deg, var(--accent-ink), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.error-card h1 { font-size: var(--fs-h1); margin: 12px 0 8px; }
.prose { line-height: 1.85; }
.prose h2 { font-size: 1.3rem; }
.prose h3 { margin: 1.1em 0 .4em; font-size: 1.125rem; }
.prose ul { padding-inline-start: 1.3em; display: grid; gap: 4px; }
.prose a { color: var(--accent-ink); text-decoration: underline; }
/* العلامة كبيرة وحدها، وسطر الهوية بجانبها (لا اسم مرسوم) */
.about-hero { display: flex; gap: 14px 22px; align-items: center; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.about-mark { width: 72px; height: 72px; }
.about-id { display: grid; gap: 4px; min-width: 0; }
.about-tag { margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.45; color: var(--text); }
.about-id small { justify-self: start; }
@media (max-width: 560px) {
  .about-hero { gap: 14px 16px; }
  .about-mark { width: 56px; height: 56px; }
  .about-tag { font-size: 1.12rem; }
}
.faq { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
/* سهم الصف كما في الإعدادات (يشير إلى الأمام في RTL)، وينزل إلى الأسفل حين يُفتح الجواب */
.faq-chev { flex: none; width: 18px; height: 18px; margin-inline-start: auto; color: var(--muted); transition: rotate .25s var(--ease); }
.faq-item[open] .faq-chev { rotate: -90deg; }
:root[dir="ltr"] .faq-item[open] .faq-chev { rotate: 90deg; } /* السهم منعكس (i-dir) قبل التدوير */
.faq-item p { margin: 10px 0 0; color: var(--text-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: .92em; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* الإعدادات */
.settings-grid { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.settings-grid .set-tile { border: 0; border-radius: 0; box-shadow: none; }
.settings-grid .set-tile + .set-tile { border-top: 1px solid var(--border); }
.set-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--text); }
.set-tile:hover { background: var(--hover); color: var(--text); }
.set-ic {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--accent-ink);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
.set-tx { flex: 1; display: flex; flex-direction: column; }
.set-tx small { color: var(--muted); font-size: .86em; }
.set-tile > .i:last-child { color: var(--muted); }
.set-media { position: relative; margin: -16px -16px 50px; }
.set-media .cover { border-radius: var(--r) var(--r) 0 0; height: 140px; }
.set-av { position: absolute; bottom: -46px; inset-inline-start: 20px; z-index: 2; }
.set-av .av { border: 4px solid var(--surface); }
.upload-btn {
  position: absolute; z-index: 3; bottom: 12px; inset-inline-end: 12px; display: inline-flex; gap: .4em; align-items: center; padding: .4em .9em;
  border-radius: var(--r-pill); background: rgb(0 0 0 / .6); color: #fff; font-size: .85em; cursor: pointer; backdrop-filter: blur(6px);
}
.upload-btn.small { bottom: 4px; inset-inline-end: 4px; padding: .45em; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--r); border: 1px solid var(--border); cursor: pointer; font-size: .9em; text-align: center; }
.theme-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); font-weight: 700; }
.theme-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-opt input, .swatch input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
/* معاينات السمات: بألوان اللوحة المختارة (فئة .pal-<id> على الحاوية تعرّف --pv-*) */
.t-swatch { width: 100%; height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.t-auto .t-swatch { background: linear-gradient(90deg, var(--pv-l) 0 25%, var(--pv-l2) 25% 50%, var(--pv-d2) 50% 75%, var(--pv-d) 75%); }
.t-light .t-swatch { background: linear-gradient(var(--pv-l) 50%, var(--pv-l2) 50%); }
.t-dark .t-swatch, .t-dusk .t-swatch { background: linear-gradient(var(--pv-d2) 50%, var(--pv-d) 50%); }
/* معاينات منتقي اللوحة في /settings/display: تعرض لوحة الفاتح + الثيم الداكن المختار (1–10) */
.pal-dabab { --pv-l: #FBF8F3; --pv-l2: #F3EEE6; --pv-a: #567D7E; --pv-d: var(--d-bg, #000000); --pv-d2: var(--d-surface, #030304); --pv-ad: #FFFFFF; }
.pal-waha { --pv-l: #F4FBF8; --pv-l2: #E1F4EB; --pv-a: #2E8060; --pv-d: var(--d-bg, #000000); --pv-d2: var(--d-surface, #030304); --pv-ad: #FFFFFF; }
.pal-zaytoun { --pv-l: #F8FAF4; --pv-l2: #EBF2E0; --pv-a: #65793A; --pv-d: var(--d-bg, #000000); --pv-d2: var(--d-surface, #030304); --pv-ad: #FFFFFF; }
.pal-asal { --pv-l: #FDF9F3; --pv-l2: #F9EDDD; --pv-a: #996816; --pv-d: var(--d-bg, #000000); --pv-d2: var(--d-surface, #030304); --pv-ad: #FFFFFF; }
.pal-fakhar { --pv-l: #FEF7F5; --pv-l2: #FEEAE3; --pv-a: #AE5B41; --pv-d: var(--d-bg, #000000); --pv-d2: var(--d-surface, #030304); --pv-ad: #FFFFFF; }
.pal-ward { --pv-l: #FEF7F9; --pv-l2: #FDE8EF; --pv-a: #A35D78; --pv-d: var(--d-bg, #000000); --pv-d2: var(--d-surface, #030304); --pv-ad: #FFFFFF; }
.pal-khuzama { --pv-l: #F9F8FE; --pv-l2: #EFECFD; --pv-a: #786AA1; --pv-d: var(--d-bg, #000000); --pv-d2: var(--d-surface, #030304); --pv-ad: #FFFFFF; }
.pal-swatch { height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: radial-gradient(circle at 25% 50%, var(--pv-a) 0 7px, transparent 7.5px), radial-gradient(circle at 75% 50%, var(--pv-ad) 0 7px, transparent 7.5px),
    linear-gradient(90deg, var(--pv-l) 0 25%, var(--pv-l2) 25% 50%, var(--pv-d) 50% 75%, var(--pv-d2) 75%); }
/* شريط سحب ثيمات الوضع الداكن (1 – 10) */
.dk-slider {
  display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface-2);
}
.dk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dk-head-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dk-pill {
  display: inline-flex; align-items: center; gap: 2px; padding: .2em .65em; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.dk-name { font-size: .98rem; color: var(--text); }
.dk-desc { font-size: .84rem; color: var(--muted); }
.dk-meta { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dk-hex {
  padding: .22em .6em; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; font-weight: 700; color: var(--text);
}
.dk-tx-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: .2em .55em; border-radius: var(--r-pill);
  background: #000000; color: #E7E9EA; border: 1px solid #2A2F37;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem;
}
.dk-tx-chip i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .25); flex: none; }
.dk-bar-wrap {
  position: relative; height: 48px; border-radius: var(--r); padding: 4px;
  background: #000000; border: 1px solid var(--line); box-shadow: inset 0 2px 6px rgb(0 0 0 / .6);
  display: flex; align-items: center;
}
.dk-rail {
  position: absolute; inset: 4px; border-radius: calc(var(--r) - 3px); overflow: hidden;
  display: grid; grid-template-columns: repeat(10, 1fr); pointer-events: none;
}
.dk-seg {
  display: flex; align-items: center; justify-content: center;
  border-inline-end: 1px solid rgb(255 255 255 / .08);
  font-size: .76rem; font-weight: 700; color: #8B9097; font-variant-numeric: tabular-nums; user-select: none;
}
.dk-seg:last-child { border-inline-end: 0; }
.dk-seg i { font-style: normal; opacity: .85; }
.dk-range {
  position: relative; z-index: 2; width: 100%; height: 100%; margin: 0;
  background: transparent; appearance: none; -webkit-appearance: none; cursor: grab;
}
.dk-range:active { cursor: grabbing; }
.dk-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r-sm); }
.dk-range::-webkit-slider-runnable-track { height: 100%; background: transparent; border: 0; }
.dk-range::-moz-range-track { height: 100%; background: transparent; border: 0; }
.dk-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 38px; height: 38px; border-radius: 10px;
  background: #FFFFFF; border: 3px solid #000000;
  box-shadow: 0 0 0 2px #FFFFFF, 0 3px 12px rgb(0 0 0 / .75);
  cursor: grab; transition: transform .12s ease, box-shadow .12s ease;
}
.dk-range::-moz-range-thumb {
  width: 38px; height: 38px; border-radius: 10px;
  background: #FFFFFF; border: 3px solid #000000;
  box-shadow: 0 0 0 2px #FFFFFF, 0 3px 12px rgb(0 0 0 / .75);
  cursor: grab; transition: transform .12s ease, box-shadow .12s ease;
}
.dk-range:hover::-webkit-slider-thumb, .dk-range:active::-webkit-slider-thumb {
  transform: scale(1.07);
  box-shadow: 0 0 0 3px #FFFFFF, 0 4px 16px rgb(0 0 0 / .9);
}
.dk-range:hover::-moz-range-thumb, .dk-range:active::-moz-range-thumb {
  transform: scale(1.07);
  box-shadow: 0 0 0 3px #FFFFFF, 0 4px 16px rgb(0 0 0 / .9);
}
.dk-stops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 760px) { .dk-stops { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dk-stop {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px;
  border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.dk-stop:hover { border-color: var(--line); transform: translateY(-1px); }
.dk-stop input { position: absolute; opacity: 0; pointer-events: none; }
.dk-stop.is-on, .dk-stop:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dk-stop:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-swatch {
  display: flex; flex-direction: column; justify-content: center; gap: 5px; height: 38px; padding: 0 9px;
  border-radius: 6px; background: var(--stop-bg, #000000); border: 1px solid rgb(255 255 255 / .12);
  box-shadow: inset 0 1px 3px rgb(0 0 0 / .5);
}
.dk-sw-line1 { display: block; width: 72%; height: 4px; border-radius: 2px; background: #E7E9EA; }
.dk-sw-line2 { display: block; width: 48%; height: 3px; border-radius: 2px; background: #8B9097; }
.dk-stop-tx { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; min-width: 0; }
.dk-stop-tx b { font-size: .82rem; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--text); }
.dk-stop-tx b i {
  font-style: normal; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); color: var(--text-2);
  font-size: .72rem; font-weight: 700; flex: none;
}
.dk-stop.is-on .dk-stop-tx b i, .dk-stop:has(input:checked) .dk-stop-tx b i { background: var(--accent); color: var(--on-accent); }
.dk-stop-tx small { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; color: var(--muted); }
.hp-dark-bar {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 8px;
}
.hp-dark-lbl { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--text-2); }
.hp-dark-lbl .ico { width: 15px; height: 15px; color: var(--accent); }
.dk-slider-compact { padding: 10px; gap: 8px; background: var(--surface); }
.dk-slider-compact .dk-bar-wrap { height: 38px; }
.dk-slider-compact .dk-range::-webkit-slider-thumb { width: 30px; height: 30px; border-radius: 8px; }
.dk-slider-compact .dk-range::-moz-range-thumb { width: 30px; height: 30px; border-radius: 8px; }
.dk-slider-compact .dk-stops { display: none; }
/* منتقيا «ألوان الموقع» و«شكل التصفح» */
.look-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.look-pick-lay { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.look-opt {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.look-opt:hover { border-color: var(--line); }
.look-opt input { position: absolute; opacity: 0; pointer-events: none; }
.look-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.look-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.look-tx { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.look-tx b { font-size: .95rem; display: flex; align-items: center; gap: 6px; }
.look-tx small { color: var(--muted); font-size: .8rem; }
.look-def {
  font-style: normal; font-size: .72rem; font-weight: 600; line-height: 1.5; padding: 0 .55em; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap;
}
.look-opt:has(input:checked) .look-tx b::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none;
}
.look-sk { display: block; width: 100%; height: auto; aspect-ratio: 120 / 72; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--border); }
:root[dir="ltr"] .look-sk { scale: -1 1; } /* المخططات مرسومة من اليمين: الشعار والبداية يسارًا في الإنجليزية */
.look-sk .sk-bar { fill: var(--surface); stroke: var(--line); stroke-width: .8; }
.look-sk .sk-card { fill: var(--surface); stroke: var(--border); stroke-width: .8; }
.look-sk .sk-ink { fill: var(--line); }
.look-sk .sk-soft { fill: var(--surface-3); }
.look-sk .sk-on { fill: var(--accent); }
.look-sk .sk-line { stroke: var(--accent); stroke-width: 1.6; fill: none; stroke-linecap: round; }
.look-sk .sk-rule { stroke: var(--line); stroke-width: .8; fill: none; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { cursor: pointer; position: relative; }
.swatch span { display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); border: 2px solid transparent; }
.swatch input:checked + span { border-color: var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.seg label { flex: 1; cursor: pointer; }
.seg span, .seg a { display: block; text-align: center; padding: .42em .9em; border-radius: 7px; font-size: .88rem; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.seg input:checked + span, .seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), 0 0 0 1px var(--border); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.seg a:hover { color: var(--text); }
.preview-post { display: flex; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.preview-post p { margin: 4px 0 0; font-size: 1.0625rem; line-height: 1.75; }
.usage { padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-2); font-size: .9em; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone .card-title { color: var(--danger); }
.recovery { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; border-radius: var(--r); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border)); margin: 14px 0; text-align: start; }
.code-box { font-size: 1.25em; letter-spacing: .12em; padding: .5em 1em; background: var(--surface); border: 1px dashed var(--line); user-select: all; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-opt { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; color: var(--text-2); }
.icon-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.icon-opt:hover { color: var(--text); }
.icon-opt:has(input:checked) { background: var(--mist); border-color: var(--accent); color: var(--text); }
.icon-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.feature-emo .i { width: 1.35em; height: 1.35em; color: inherit; }
.break-ic .i { width: 2.2em; height: 2.2em; color: var(--muted); }

/* الإدارة */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-ic { display: none; }
.stat b { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: .84rem; }
.notice-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--gap); }
.admin-table { padding: 0; overflow: hidden; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px 14px; padding: 12px var(--pad); align-items: center; }
.admin-row + .admin-row { border-top: 1px solid var(--border); }
.admin-row .row-actions { grid-column: 1 / -1; }
.admin-user { display: flex; gap: 10px; align-items: center; min-width: 0; }
.admin-user > span:not(.av) { display: flex; flex-direction: column; min-width: 0; }
.admin-user small { color: var(--muted); font-size: .8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: end; }
.admin-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.report { display: flex; flex-direction: column; gap: 10px; }
.report-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.report-note { margin: 0; color: var(--text-2); }
.report-target { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: .92em; }
.report-target a { color: var(--accent-ink); }
.mod-status { display: grid; gap: 14px; }
.mod-row { display: flex; gap: 12px; align-items: flex-start; }
.mod-row code { font-size: .88em; }
.mod-stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mod-media { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.mod-media img, .mod-media video { max-width: 200px; max-height: 200px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--border); background: var(--surface-2); }

/* ---------- الرسوم البيانية (الإحصاءات) ---------- */
.chart-card { margin-bottom: var(--gap); }
.charts-2 { gap: var(--gap); }
.colchart { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 14px; }
.colchart-y { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: .74em; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; transform: translateY(.6em); }
.colchart-plot { position: relative; min-width: 0; }
.colchart-grid { position: absolute; inset: 0 0 auto; height: 200px; display: flex; flex-direction: column-reverse; justify-content: space-between; pointer-events: none; }
.colchart-grid i { display: block; height: 1px; background: var(--border); }
.colchart-cols { position: relative; height: 200px; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; align-items: end; }
.col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.col-bar { width: min(24px, 70%); min-height: 0; background: var(--accent); border-radius: 4px 4px 0 0; transition: opacity .15s; }
.col:hover .col-bar, .col:focus-visible .col-bar { opacity: .8; }
.col-val { position: absolute; transform: translateY(-4px); font-size: .74em; color: var(--text); font-weight: 600; white-space: nowrap; }
.colchart-x { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 2px; font-size: .72em; color: var(--muted); margin-top: 6px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* التسمية أعرض من عمودها (90 يومًا على 390): تتوسطه وتفيض على جانبيه دون أن توسّعه، والأولى والأخيرة تلتصقان بطرفي الرسم */
.colchart-x > span { display: flex; justify-content: center; min-width: 0; }
.colchart-x > span:first-child { justify-content: flex-start; }
.colchart-x > span:last-child { justify-content: flex-end; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 20; pointer-events: none;
  background: var(--inverse); color: var(--on-inverse); font-size: .78rem; padding: .35em .7em; border-radius: 8px; white-space: nowrap; direction: var(--doc-dir); font-weight: 500;
}
.col[data-tip]:hover::after { bottom: auto; top: -2px; transform: translate(-50%, -100%); }
.table-view { margin-top: 14px; font-size: .9em; }
.table-view summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 6px 10px; text-align: start; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 600; font-size: .9em; }
.hbars { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.hbar { display: grid; grid-template-columns: 6.5em 1fr 2.5em; gap: 10px; align-items: center; font-size: .92em; outline: none; }
.hbar-label { white-space: nowrap; color: var(--text-2); }
.hbar-label .i { width: 1.1em; height: 1.1em; }
.hbar-track { height: 12px; border-radius: 0; border-start-start-radius: 4px; border-end-start-radius: 4px; position: relative; background: var(--surface-2); }
.hbar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--accent); border-radius: 0; border-start-end-radius: 4px; border-end-end-radius: 4px; min-width: 0; }
.hbar-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar:hover .hbar-fill { opacity: .8; }
.best-hour { font-size: 1.02em; }
.best-hour b { color: var(--accent-ink); }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-top: 12px; }
.hour { height: 34px; border-radius: 4px; background: color-mix(in srgb, var(--accent) calc(var(--v) * 100%), var(--surface-2)); outline: none; }
.hour.best { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.hours-axis { display: flex; justify-content: space-between; font-size: .72em; color: var(--muted); margin-top: 6px; }
.scale-legend { display: flex; align-items: center; gap: 8px; font-size: .76em; color: var(--muted); margin-top: 10px; justify-content: flex-end; }
.scale-legend i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(to var(--end), color-mix(in srgb, var(--accent) 12%, var(--surface-2)), var(--accent)); }

/* ---------- النوافذ والتنبيهات ---------- */
.dlg {
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 0; width: min(600px, calc(100% - 24px));
  box-shadow: var(--shadow-2); max-height: calc(100vh - 40px);
}
.dlg[open] { animation: dlg-in .2s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px); } }
.dlg::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.dlg-link { color: var(--accent-ink); font-weight: 600; font-size: .9em; padding: 0 8px; }
.dlg-compose { overflow: visible; }
.dlg-compose .composer { padding: 14px 16px; }
.keys { padding: 12px 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.key-row { display: flex; align-items: center; gap: 10px; font-size: .92em; padding: 4px 0; }
.key-row kbd { min-width: 64px; text-align: center; }
.break { text-align: center; padding: 30px 24px; }
.break h2 { margin: 8px 0; }
.break p { color: var(--text-2); }
.break .row-actions { justify-content: center; margin-top: 16px; }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast {
  pointer-events: auto; background: var(--inverse); color: var(--on-inverse); padding: 11px 20px; border-radius: var(--r-sm); box-shadow: var(--shadow-2);
  font-weight: 500; font-size: .94em; animation: toast-in .25s var(--ease), toast-out .4s 5s forwards; text-align: center;
}
.toast-err, .toast-error { background: var(--danger); color: var(--on-danger); }
.toast a { color: inherit; text-decoration: underline; margin-inline-start: .5em; font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }
/* العارض المكبّر داكن في السمتين */
.lightbox { position: fixed; inset: 0; z-index: 150; background: color-mix(in srgb, var(--shp-bg) 94%, black); display: grid; place-items: center; padding: 20px; animation: menu-in .2s; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 40px); border-radius: var(--r-sm); object-fit: contain; }
.lb-close { position: absolute; top: 16px; inset-inline-end: 16px; color: #fff; background: rgb(255 255 255 / .12); }
.lb-close:hover { color: #fff; background: rgb(255 255 255 / .2); }

/* ---------- رؤوس البطاقات (أيقونة مميزة + عنوان + رابط صغير) ---------- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 1.06rem; font-weight: 700; }
.card-head h2 .i { color: var(--accent); width: 1.25em; height: 1.25em; }
.card-link { color: var(--accent-ink); font-size: .84rem; font-weight: 600; }
.card-link:hover { color: var(--accent-ink); text-decoration: underline; }
.card-go {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); color: var(--text-2); flex: none;
}
.card-go:hover { background: var(--hover); color: var(--text); }
.card-go .i { width: 1.05em; height: 1.05em; }

/* ---------- الرئيسية ---------- */
.home-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.hero { position: relative; padding: 0; overflow: hidden; min-height: 190px; display: flex; align-items: center; }
.hero-art { position: absolute; inset: 0; --art-pos: 25% 55%; }
:root[dir="ltr"] .hero-art { --art-pos: 75% 55%; } /* التحية يسارًا في الإنجليزية: تفاصيل الصورة يمينًا */
.hero::after {
  content: ""; position: absolute; inset: 0;
  /* ستار واقٍ كثيف تحت النص لمنع أي تشابك لوني أو صعوبة قراءة فوق الصورة بالأبيض والأسود */
  background: linear-gradient(to var(--end),
    color-mix(in srgb, var(--shp-bg) 94%, transparent) 0%, color-mix(in srgb, var(--shp-bg) 88%, transparent) 62%,
    color-mix(in srgb, var(--shp-bg) 56%, transparent) 84%, color-mix(in srgb, var(--shp-bg) 28%, transparent));
}
.hero-tx { position: relative; z-index: 1; padding: 24px 28px; color: var(--shp-ink); max-width: 82%; text-shadow: 0 1px 10px rgb(0 0 0 / .55); }
.hero-tx h2 { font-size: 1.8rem; font-weight: 700; line-height: 1.3; }
.hero-tx p { margin: 6px 0 10px; font-size: 1.02rem; color: var(--shp-ink); }
.hero-tx small { font-size: .88rem; color: color-mix(in srgb, var(--shp-ink) 94%, var(--shp-bg)); }

.sbar { margin: 0; display: flex; flex-direction: column; }
.sbar-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; flex: 1; align-items: flex-start; }
.sbar-row::-webkit-scrollbar { display: none; }
.sbar-it { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; width: 66px; color: var(--text); }
.sbar-it:hover { color: var(--text); }
.sbar-it small { font-size: .82rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
:root[dir="ltr"] .sbar-it:has(> .sbar-ring.mine) { width: auto; min-width: 66px; } /* «Your moments» أعرض من 62px: يتسع عنصر صاحب الحساب وحده */
.sbar-ring { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; padding: 2px; box-shadow: inset 0 0 0 1px var(--border); }
.sbar-ring .av { width: 100% !important; height: 100% !important; border: 2px solid var(--surface); }
.sbar-ring.unseen { box-shadow: inset 0 0 0 2px var(--accent); }
.sbar-ring.mine { box-shadow: inset 0 0 0 2px var(--accent-2); }
.sbar-plus { background: var(--btn); color: var(--on-accent); box-shadow: none; }
.sbar-plus .i { width: 22px; height: 22px; }
.sbar-add:hover .sbar-plus { background: color-mix(in srgb, var(--btn) 88%, var(--text)); }
/* لا لحظات بعد: دعوة بجانب زر الإضافة بدل فراغ في البطاقة */
.sbar-empty { align-self: center; display: grid; gap: 4px; min-width: 0; padding-inline-start: 6px; margin-top: -18px; }
.sbar-empty b { font-weight: 700; font-size: 1.04rem; line-height: 1.4; }
.sbar-empty span { color: var(--text-2); font-size: .92rem; line-height: 1.55; max-width: 42ch; text-wrap: pretty; }

.home-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.mini-card { display: flex; flex-direction: column; padding: 18px; }
.mini-card .card-head { margin-bottom: 10px; }
.mini-card .card-head h2 { font-size: 1.08rem; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-list li + li { border-top: 1px solid var(--border); }
.mini-list a { display: flex; align-items: center; gap: 10px; padding: 9px 4px; color: var(--text); border-radius: var(--r-sm); }
.mini-list a:hover { color: var(--text); background: var(--hover); }
.mini-list .hub-ic { width: 40px; height: 40px; }
.mini-list .av { width: 38px; height: 38px; font-size: 15px; }
.mini-list .mini-tx b { font-size: .98rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .mini-tx small { font-size: .84rem; }
.mini-empty { margin: 6px 2px 0; color: var(--muted); font-size: .95rem; }

.wall-card { padding: 20px 22px; }
.wall-title { font-size: 1.35rem; font-weight: 800; margin-bottom: 14px; }
.wall-card .cmp-item textarea { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 16px; min-height: 60px; font-size: 1.125rem; }
.wall-card .cmp-item textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.wall-card .cmp-bar { border-top: 0; padding-top: 4px; }
/* هنا الحقل نفسه يحمل حلقة التركيز، والشريط بلا فاصل: لا خط إضافي فوقه */
.wall-card .composer:has(.cmp-item textarea:focus-visible) .cmp-bar { box-shadow: none; }
.wall-chips { margin-top: 24px; }
.wall-chips .chip-add { margin-inline-start: auto; border: 0; border-radius: var(--r-sm); align-self: center; padding: 8px 10px; }
.wall-chips .chip-add::after { display: none; }

/* ---------- البحث ---------- */
body:has(.sx) .hdr-search { visibility: hidden; }
.sx-bar {
  max-width: 100%; margin-inline: auto;
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 5px; padding-inline-start: 18px; color: var(--muted);
}
.sx-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.sx-bar > .i { width: 1.25em; height: 1.25em; }
.sx-bar input[type=search] { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 1.04rem; padding: 6px 0; color: var(--text); }
.sx-go { padding: .55em 1.1em; border-radius: var(--r-pill); }
.sx-fbtn { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); color: var(--text-2); place-items: center; flex: none; }
.sx-wrap { display: grid; grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr); gap: var(--shell-gap); margin-top: 20px; }
.sx-side { position: sticky; top: calc(var(--stick-top, var(--top-h)) + 8px); transition: top .45s var(--ease); align-self: start; background: transparent; border: 1px solid var(--border); border-radius: var(--r); padding: 14px; }
.sx-side h3 { font-size: .84rem; margin: 16px 6px 6px; color: var(--muted); font-weight: 700; }
.sx-side h3:first-child { margin-top: 0; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); font-weight: 500; color: var(--text-2); font-size: .94rem; }
.opt:hover { background: var(--hover); color: var(--text); }
.opt .i { width: 1.1em; height: 1.1em; color: var(--muted); }
.opt .box { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.opt.on { background: var(--nav-on); color: var(--on-nav-on); font-weight: 700; }
.opt.on .i { color: inherit; }
.opt.on .box { border-color: currentColor; }
.opt.on .box::after { content: ""; width: 8px; height: 8px; background: currentColor; border-radius: 50%; }
.opt em { margin-inline-start: auto; font-style: normal; font-size: .8em; color: inherit; }
.sx-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.sx-head h1 { font-size: var(--fs-h1); font-weight: 700; }
.sx-head small { color: var(--muted); }
.sx-sub { font-size: 1.06rem; font-weight: 700; margin: 0 2px 10px; }
.sx-people { padding: 4px 0 12px; margin-bottom: 24px; }
.sx-people .sx-sub { padding: 12px var(--pad) 0; }
.sx-people .widget-more { margin-inline-start: var(--pad); }
.masonry { columns: 2 220px; column-gap: var(--gap); margin-bottom: 16px; }
.sx-card { break-inside: avoid; margin-bottom: var(--gap); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; }
.sx-card p { margin: 8px 0 0; line-height: 1.8; }
.sx-card code { white-space: nowrap; } /* الأمر كتلة واحدة: لا ينكسر «until:2026-12-31» وسطه */
.kind { display: inline-flex; gap: 5px; align-items: center; font-size: .78rem; font-weight: 700; color: var(--text-2); }
.kind .i { width: 1.1em; height: 1.1em; color: var(--accent); }
.sx-main .hub-grid { margin-top: 0; }

/* ---------- الاستكشاف ---------- */
body:has(.explore-head) .hdr-search { visibility: hidden; }

/* ---------- الرسائل: قائمة المحادثات + المحادثة ---------- */
.dmx-head { margin-bottom: 12px; }
.dmx-wrap { display: grid; grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr); gap: var(--gap); align-items: start; }
.dmx-inbox { padding: 0; display: flex; flex-direction: column; overflow: hidden; height: calc(100vh - var(--top-h) - 90px - var(--banner-h, 0px)); min-height: 460px; }
.dmx-search { display: none; align-items: center; gap: 8px; margin: 10px; padding: 0; padding-inline-start: 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); }
.dmx-search.show, html:not(.js) .dmx-search, .has-q .dmx-search { display: flex; }
.dmx-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.dmx-search input { flex: 1; border: 0; background: none; font: inherit; color: var(--text); outline: none; padding: 8px 0; min-width: 0; }
.dmx-list-head { display: flex; flex-direction: column; padding: 4px 14px 8px; border-bottom: 1px solid var(--border); }
.dmx-list-head small { color: var(--muted); font-size: .8rem; }
.dmx-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.dmx-list .empty { box-shadow: none; border: 0; background: none; }
.dmx-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r-sm); position: relative; color: var(--text); }
.dmx-item:hover { background: var(--hover); color: var(--text); }
.dmx-item.on { background: var(--nav-on); color: var(--on-nav-on); }
.dmx-item.on .dmx-item-last, .dmx-item.on time { color: inherit; opacity: .9; } /* ضباب الداكن: 4.85:1 (كانت .85 = 4.49) */
.dmx-item-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dmx-item-top { display: flex; align-items: center; gap: 4px; min-width: 0; }
.dmx-item-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmx-item-top time { margin-inline-start: auto; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.dmx-lk .i { width: .95em; height: .95em; color: var(--muted); }
.dmx-item.on .dmx-lk .i { color: inherit; }
.dmx-item-last { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.dmx-item-last .i { width: 14px; height: 14px; }
/* نص المعاينة عنصر واحد (فيه <bdi> لعزل اتجاه الرسالة): هو الذي يُقص بنقاط الحذف داخل الصف المرن */
.dmx-last-tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmx-item.unread .dmx-item-last { color: inherit; font-weight: 700; } /* يرث لون الصف: --text عادةً و--on-nav-on في الصف المحدد (كان --text على تعبئة --nav-on في الداكن: 2.0–2.4:1) */
.dot-unread { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
/* ارتفاع المحادثة يطرح تنبيه المكالمة إن ظهر فوقها (--banner-h)، فيبقى حقل الكتابة في الشاشة */
.dmx-letter { padding: 0; display: flex; flex-direction: column; overflow: hidden; height: calc(100vh - var(--top-h) - 90px - var(--banner-h, 0px)); min-height: 460px; }
.dmx-lhead { display: flex; gap: 6px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.dmx-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); }
.dmx-who:hover { color: var(--text); }
.dmx-who > span:not(.av) { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.dmx-who .st { font-size: .8rem; color: var(--muted); }
.dmx-sec-menu > summary.is-on { color: var(--accent); }
.dmx-lhead { position: relative; }
.dmx-sec-menu { position: static; }
.dmx-sec-pop { top: calc(100% + 4px); inset-inline-start: auto; inset-inline-end: 12px; width: min(340px, calc(100% - 24px)); max-height: 70vh; overflow-y: auto; padding: 12px; gap: 10px; }
.dm-back { display: none; }
.dm-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.dm-intro { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 20px; text-align: center; }
.dm-intro small { color: var(--muted); }
.dm-day { text-align: center; margin: 10px 0; }
.dm-day span { font-size: .76rem; color: var(--muted); background: var(--surface-2); padding: .25em .9em; border-radius: var(--r-pill); border: 1px solid var(--border); }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 72%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg:not(.mine) { align-self: flex-start; }
.msg-bubble { padding: 9px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; font-size: 1rem; line-height: 1.7; color: var(--text); }
/* زاوية الذيل من اتجاه الصفحة لا من اتجاه نص الفقاعة (dir="auto"): رسالة عربية في الواجهة الإنجليزية تبقى بذيلها في جهتها */
:root[dir="ltr"] .msg:not(.mine) .msg-bubble, :root[dir="rtl"] .msg.mine .msg-bubble { border-top-left-radius: 6px; }
:root[dir="rtl"] .msg:not(.mine) .msg-bubble, :root[dir="ltr"] .msg.mine .msg-bubble { border-top-right-radius: 6px; }
.msg.mine .msg-bubble { background: var(--bubble-mine); border-color: transparent; color: var(--on-bubble-mine); }
.msg.mine .msg-bubble a { color: inherit; text-decoration: underline; }
.dmx-thread .msg:target .msg-bubble { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg-time { font-size: .74rem; color: var(--muted); padding: 2px 6px 4px; }
.msg.is-new { animation: fade-in .3s var(--ease); }
.dm-send { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); }
.dm-send textarea { border-radius: var(--r); resize: none; max-height: 160px; }
.dmx-composer .send { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--btn); color: var(--on-accent); flex: none; }
.dmx-composer .send:hover { background: color-mix(in srgb, var(--btn) 88%, var(--text)); }
.dmx-letter > .notice { margin: 12px; }
.dmx-empty { margin: auto; text-align: center; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 420px; }
.dmx-empty h2 { font-size: 1.125rem; }
.dmx-facts { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; text-align: start; color: var(--text-2); font-size: .9rem; }
.dmx-facts li { display: flex; gap: 8px; align-items: flex-start; }
.dmx-facts .i { color: var(--muted); flex: none; margin-top: .15em; }
.dmx-facts.small { font-size: .82rem; margin: 6px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.dmx-panel { display: flex; flex-direction: column; gap: 10px; }
.dmx-panel h4 { font-size: .97rem; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.dmx-panel h4 span { display: inline-flex; align-items: center; gap: 6px; }
.dmx-panel h4 .i { color: var(--accent); }
.dmx-panel h4 small { color: var(--muted); font-weight: 500; }
.dmx-panel form .btn, .dmx-fold > summary { width: 100%; justify-content: center; }
.dmx-fold > summary { list-style: none; cursor: pointer; }
.dmx-fold > summary::-webkit-details-marker { display: none; }
.dmx-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.dmx-form label { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; color: var(--text-2); }
.dmx-code { margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; }
.dmx-code output { font-size: 1.7em; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--text); }
.dmx-note { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 12px; font-size: .84rem; display: flex; gap: 6px; align-items: center; }
.dmx-locked { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 40px 24px; }
.dmx-locked h2 { font-size: 1.25rem; }
.dmx-code-form { display: flex; gap: 8px; width: min(360px, 100%); }
.dmx-code-in { text-align: center; letter-spacing: .2em; font-weight: 700; }
.dmx-share-alt { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border); width: min(360px, 100%); }

/* ==========================================================================
   اللحظات (القصص): الجدار والإنشاء والعارض الغامر
   ========================================================================== */
/* خلفيات اللحظات النصية محتوى يختاره المستخدم: ثابتة في السمتين ولا تتبع اللوحة.
   الصورة («ساعة الخزامى»: ضباب، كتان، بحر هادئ، رمل، غسق، نعناع) من --art-sbg-N إن وُلّدت (gen_css_vars في helpers.php)،
   وتحتها تدرّج احتياطي بالدرجات نفسها؛ النص ≥7:1 على طرفي كل تدرّج. --sbg-sw قصّة مربعة صغيرة لأزرار الاختيار. */
.sbg-0 { --sbg-veil: rgb(249 248 254 / .38); --sbg: linear-gradient(160deg, #F9F8FE, #E5DEF4); --sbg-img: var(--art-sbg-0, none); --sbg-sw: var(--art-sbg-0-sw, none); --sbg-halo: rgb(249 248 254 / .55); color: #3A3646; }
.sbg-1 { --sbg-veil: rgb(249 248 254 / .38); --sbg: linear-gradient(160deg, #F6F1EA, #E9DCC8); --sbg-img: var(--art-sbg-1, none); --sbg-sw: var(--art-sbg-1-sw, none); --sbg-halo: rgb(246 241 234 / .55); color: #3A3646; }
.sbg-2 { --sbg-veil: rgb(26 23 33 / .38); --sbg: linear-gradient(160deg, #2B2740, #4A4360); --sbg-img: var(--art-sbg-2, none); --sbg-sw: var(--art-sbg-2-sw, none); --sbg-halo: rgb(26 23 33 / .5); color: #F9F8FE; }
.sbg-3 { --sbg-veil: rgb(249 248 254 / .38); --sbg: linear-gradient(160deg, #F3E9DA, #E2D2BB); --sbg-img: var(--art-sbg-3, none); --sbg-sw: var(--art-sbg-3-sw, none); --sbg-halo: rgb(243 233 218 / .55); color: #3A3646; }
.sbg-4 { --sbg-veil: rgb(26 23 33 / .38); --sbg: linear-gradient(180deg, #1A1721, #363245 70%, #5A4B6A); --sbg-img: var(--art-sbg-4, none); --sbg-sw: var(--art-sbg-4-sw, none); --sbg-halo: rgb(26 23 33 / .5); color: #F9F8FE; }
.sbg-5 { --sbg-veil: rgb(249 248 254 / .38); --sbg: linear-gradient(160deg, #F1F5F1, #DCE8E0); --sbg-img: var(--art-sbg-5, none); --sbg-sw: var(--art-sbg-5-sw, none); --sbg-halo: rgb(241 245 241 / .55); color: #3A3646; }
.sbg-0, .sbg-1, .sbg-2, .sbg-3, .sbg-4, .sbg-5 { background: var(--sbg-img) center / cover no-repeat, var(--sbg); }
.st-text p, .mo-preview:not(.has-media) .mo-preview-tx { text-shadow: 0 0 1.4em var(--sbg-halo, transparent); }
/* غلالة بلون عكس النص فوق الصورة: تبقي النص ≥4.5:1 ولو خرجت الصورة المولّدة عن حدود درجاتها (مثل #7F8F85 من 3.4 إلى 5.0) */
.st-text::before, .mo-preview:not(.has-media)::before { content: ""; position: absolute; inset: 0; background: var(--sbg-veil, transparent); pointer-events: none; }
.mo-bgs .sbg-0, .mo-bgs .sbg-1, .mo-bgs .sbg-2, .mo-bgs .sbg-3, .mo-bgs .sbg-4, .mo-bgs .sbg-5 { --sbg-img: var(--sbg-sw); }
/* مقاطع اللحظات بلا غلاف: خلفية المسرح الداكن (صورة الضوء الضبابي إن وُجدت) */
.st-stage { background: var(--art-stage, none) center / cover no-repeat, linear-gradient(160deg, var(--media-from), var(--media-to)); color: var(--shp-ink); }
.st-media { display: block; width: 100%; height: 100%; object-fit: cover; }
img.st-media, video.st-media { background: var(--surface-3); }
.st-text { position: relative; display: grid; place-items: center; padding: 24px; text-align: center; }
.st-text p { position: relative; font-size: clamp(18px, 2.4vw, 24px); font-weight: 700; line-height: 1.7; overflow-wrap: anywhere; max-height: 100%; overflow: hidden; margin: 0; }
.st-video-thumb { display: grid; place-items: center; min-height: 220px; }
.st-video-thumb .i { width: 46px; height: 46px; padding: 12px; border-radius: 50%; background: color-mix(in srgb, var(--shp-ink) 90%, transparent); color: var(--shp-bg); fill: currentColor; }

/* جدار اللحظات: شبكة صفوف متساوية */
.mo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.mo-head .page-title { flex: 1 1 auto; }
.mo-seg { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; flex: 1 1 100%; border-bottom: 1px solid var(--border); }
.mo-seg a { flex: none; white-space: nowrap; }
.mo-seg a { position: relative; padding: 10px 14px 12px; font-weight: 600; color: var(--muted); font-size: .906rem; }
.mo-seg a:hover { color: var(--text); }
.mo-seg a.on { color: var(--text); font-weight: 700; }
.mo-seg a.on::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.mo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--gap); }
.mo-tile { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; position: relative; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); color: var(--text); }
.mo-tile:hover { color: var(--text); border-color: color-mix(in srgb, var(--line) 55%, var(--border)); }
.mo-ph { display: block; aspect-ratio: 9 / 14; overflow: hidden; background: var(--surface-3); }
.mo-ph > *, .mo-ph img.st-media, .mo-ph .st-text { width: 100%; height: 100%; }
.mo-ph .st-text p { font-size: 17px; }
.mo-ft { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.mo-ft b { display: block; font-size: .92rem; }
.mo-ft small { color: var(--muted); font-size: .78rem; display: block; }
.mo-av .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.mo-av.unseen .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.mo-count { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; font-size: 12px; padding: 3px 9px; border-radius: var(--r-pill); font-weight: 700; background: color-mix(in srgb, var(--shp-bg) 72%, transparent); color: var(--shp-ink); }

/* نموذج لحظة جديدة */
.mo-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.mo-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.mo-form legend { font-weight: 700; margin-bottom: 8px; width: 100%; }
.mo-kinds label, .mo-aud label { cursor: pointer; }
.mo-kinds input, .mo-aud input, .mo-bgs input { position: absolute; opacity: 0; pointer-events: none; }
.mo-kinds span, .mo-aud span { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border); font-weight: 600; color: var(--text-2); }
.mo-kinds span .i, .mo-aud span .i { width: 18px; height: 18px; }
.mo-kinds input:checked + span, .mo-aud input:checked + span { background: var(--nav-on); border-color: transparent; color: var(--on-nav-on); }
.mo-kinds input:focus-visible + span, .mo-aud input:focus-visible + span, .mo-bgs input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.mo-bgs label { cursor: pointer; }
.mo-bgs span { display: block; width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.mo-bgs input:checked + span { box-shadow: 0 0 0 2px var(--accent); }
.mo-preview { position: relative; width: min(260px, 100%); aspect-ratio: 9 / 16; margin-inline: auto; border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center; border: 1px solid var(--border); }
.mo-preview img, .mo-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mo-preview-tx { position: relative; padding: 18px; text-align: center; font-weight: 700; font-size: 18px; line-height: 1.7; overflow-wrap: anywhere; z-index: 1; margin: 0; }
/* بلا ملف بعد (نوع صورة أو مقطع): إطار متقطع هادئ بأيقونة وتلميح، على لون السطح في السمتين */
.mo-preview-ic { display: none; }
.mo-preview.is-empty { place-content: center; gap: 12px; background: var(--surface-2); border: 1.5px dashed var(--line); color: var(--muted); }
.mo-preview.is-empty .mo-preview-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.mo-preview.is-empty .mo-preview-ic .i { width: 28px; height: 28px; }
.mo-preview.is-empty .mo-preview-tx { padding: 0 24px; font-weight: 500; font-size: 15px; line-height: 1.7; text-wrap: balance; }
.mo-preview.has-media .mo-preview-tx { align-self: end; width: 100%; font-size: 14px; font-weight: 500; color: var(--shp-ink); background: linear-gradient(transparent, color-mix(in srgb, var(--shp-bg) 85%, transparent)); }
.mo-file { display: grid; gap: 6px; padding: 16px; border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.mo-file > span { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--text); }
.mo-file > span .i { color: var(--accent); }
.mo-file small { color: var(--muted); }
.mo-file input { max-width: 100%; }
.mo-file input[type=file] { font: inherit; font-size: .88rem; color: var(--muted); }
.mo-file input[type=file]::file-selector-button {
  font: inherit; margin-inline-end: 10px; padding: .45em 1em; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
/* اختيار ملف بواجهة عربية: الحقل الأصلي («Choose File / No file chosen» بلغة المتصفح) شفاف فوق المنطقة كلها فيبقى
   قابلًا للنقر والتركيز، واسم الملف المختار يكتبه app.js في [data-file-name]. بلا JS يبقى الحقل الأصلي ظاهرًا */
.file-pick { position: relative; }
.file-pick-name { display: none; font-size: .88rem; font-weight: 600; color: var(--text-2); overflow-wrap: anywhere; }
.js .file-pick-name { display: block; }
.js .file-pick input[type=file]:not([hidden]) { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.js .file-pick:has(input:focus-visible) { outline: 3px solid var(--accent-ink); outline-offset: 2px; }
.file-pick-btn { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; border-radius: var(--r-pill); }
.file-pick-btn .file-pick-name { font-weight: 500; color: var(--muted); }
.js .file-pick-btn .file-pick-name { display: inline; }
.cmp-hint { font-size: .78em; color: var(--muted); line-height: 1.5; }
.mo-actions { display: flex; gap: 10px; justify-content: flex-end; }
.js .mo-form[data-kind="text"] [data-mo-file] { display: none; }
.js .mo-form:not([data-kind="text"]) [data-mo-bgs] { display: none; }

/* العارض الغامر: داكن في السمتين (مسرح للوسائط) */
.sv-body { margin: 0; background: var(--shp-bg); color: var(--shp-ink); font-family: var(--font); overflow: hidden; min-height: 100vh; color-scheme: dark; }
.sv { position: fixed; inset: 0; overflow: hidden; }
.sv-blur { position: absolute; inset: -60px; background: var(--shp-bg); filter: blur(40px) brightness(.45); background-size: cover; background-position: center; transition: background-image .5s; }
.sv-top { position: absolute; top: 0; inset-inline: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 14px 5vw; }
.sv-brand { display: inline-grid; place-items: center; flex: none; padding: 2px; border-radius: var(--r-pill); line-height: 0; margin-inline-end: auto; }
/* العارض داكن دائمًا: العلامة بلون حبر المسرح ومميّزه */
.sv-brand .logo { width: 36px; height: 36px; --rn-ink: color-mix(in srgb, var(--shp-accent) 55%, var(--shp-ink)); --rn-echo: color-mix(in srgb, var(--shp-accent) 80%, var(--shp-bg)); }
.sv-brand:focus-visible { outline-color: var(--shp-ink); }
.sv-pill { display: inline-flex; gap: 6px; align-items: center; background: color-mix(in srgb, var(--shp-bg) 55%, transparent); border: 1px solid color-mix(in srgb, var(--shp-ink) 22%, transparent); color: var(--shp-ink); border-radius: var(--r-pill); padding: 8px 16px; font-weight: 700; font-size: 14px; }
.sv-pill:hover { color: var(--shp-ink); background: color-mix(in srgb, var(--shp-bg) 62%, transparent); }
.sv-pill .i { width: 16px; height: 16px; }
.sv-x { padding: 8px; }
.sv-track { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.sv-card { position: absolute; width: min(380px, 92vw); height: min(660px, calc(100vh - 150px)); border-radius: var(--r-lg); overflow: hidden; background: var(--shp-surface); box-shadow: 0 30px 60px -20px rgb(0 0 0 / .7); transition: transform .5s var(--ease), opacity .5s; display: none; }
.sv-card.is-on { display: block; z-index: 20; }
.js .sv-card { display: block; cursor: pointer; }
.js .sv-card.is-on { cursor: default; }
/* ظل الرأس: ≥70% من --shp-bg حتى 72px (الاسم والوقت ≥4.5:1 ولو فوق لحظة فاتحة أو صورة بيضاء) ثم يذوب عند 150px */
.sv-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 150px; background: linear-gradient(color-mix(in srgb, var(--shp-bg) 78%, transparent), color-mix(in srgb, var(--shp-bg) 70%, transparent) 72px, transparent 150px); z-index: 5; pointer-events: none; }
.sv-card:not(.is-on) .sv-foot, .sv-card:not(.is-on) .sv-tools, .sv-card:not(.is-on) .sv-tap { visibility: hidden; }
.sv-bars { position: absolute; top: 10px; inset-inline: 12px; display: flex; gap: 4px; z-index: 6; }
.sv-bars i { flex: 1; height: 3px; background: rgb(255 255 255 / .33); border-radius: 3px; overflow: hidden; }
.sv-bars b { display: block; height: 100%; width: 0; background: var(--shp-ink); }
.sv-bars i.done b { width: 100%; }
.sv-head { position: absolute; top: 22px; inset-inline: 14px; display: flex; align-items: center; gap: 8px; z-index: 6; }
.sv-who { display: flex; gap: 8px; align-items: center; color: var(--shp-ink); margin-inline-end: auto; text-shadow: 0 1px 4px rgb(0 0 0 / .5); }
.sv-who:hover { color: var(--shp-ink); }
.sv-who .av { box-shadow: 0 0 0 2px color-mix(in srgb, var(--shp-ink) 80%, transparent); }
.sv-who b { display: block; font-size: 15px; }
.sv-who small { display: block; font-size: 12.5px; }
.sv-tools { display: flex; gap: 6px; }
.sv-ic { width: 36px; height: 36px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--shp-bg) 50%, transparent); color: var(--shp-ink); display: grid; place-items: center; cursor: pointer; }
.sv-ic .i { width: 18px; height: 18px; }
.sv-stage { position: absolute; inset: 0; }
.sv-slide { position: absolute; inset: 0; margin: 0; display: none; }
.sv-slide.is-cur { display: block; }
.sv-slide .st-text p { font-size: clamp(22px, 6vw, 30px); line-height: 1.6; }
.sv-slide figcaption { position: absolute; bottom: 150px; inset-inline: 0; padding: 30px 18px 12px; font-size: 16px; line-height: 1.6; background: linear-gradient(transparent, color-mix(in srgb, var(--shp-bg) 74%, transparent) 28px, color-mix(in srgb, var(--shp-bg) 86%, transparent)); color: var(--shp-ink); overflow-wrap: anywhere; }
.sv-tap { position: absolute; top: 70px; bottom: 150px; width: 34%; z-index: 4; }
.sv-tap-prev { inset-inline-start: 0; }
.sv-tap-next { inset-inline-end: 0; }
.sv-foot { position: absolute; bottom: 0; inset-inline: 0; z-index: 6; padding: 40px 14px 14px; background: linear-gradient(transparent, color-mix(in srgb, var(--shp-bg) 92%, transparent) 40%); }
.sv-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sv-qr { border: 1px solid color-mix(in srgb, var(--shp-ink) 35%, transparent); background: color-mix(in srgb, var(--shp-bg) 35%, transparent); color: var(--shp-ink); border-radius: var(--r-pill); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.sv-reply { display: flex; gap: 8px; }
.sv-reply input { flex: 1; min-width: 0; background: color-mix(in srgb, var(--shp-ink) 10%, transparent); border: 1px solid color-mix(in srgb, var(--shp-ink) 35%, transparent); border-radius: var(--r-pill); padding: 10px 14px; color: var(--shp-ink); font: inherit; font-size: 14px; }
.sv-reply input::placeholder { color: color-mix(in srgb, var(--shp-ink) 72%, transparent); }
.sv-reply button { background: var(--shp-accent); border: 0; border-radius: 50%; width: 42px; height: 42px; color: var(--shp-bg); cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.sv-reply button .i { width: 18px; height: 18px; }
.sv-mute { margin-top: 8px; text-align: center; }
.sv-link { background: none; border: 0; color: color-mix(in srgb, var(--shp-ink) 78%, transparent); font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.sv-link .i { width: 14px; height: 14px; }
.sv-own { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sv-own form { margin-inline-start: auto; }
.sv-chip { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--shp-ink) 14%, transparent); color: var(--shp-ink); border: 0; font: inherit; font-size: 13.5px; cursor: pointer; }
.sv-chip:hover { color: var(--shp-ink); background: color-mix(in srgb, var(--shp-ink) 20%, transparent); }
.sv-chip .i, .sv-aud .i { width: 16px; height: 16px; }
.sv-danger { background: color-mix(in srgb, var(--danger) 25%, transparent); }
.sv-aud { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; color: color-mix(in srgb, var(--shp-ink) 85%, transparent); }
.sv-dock { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--shp-surface); border: 1px solid color-mix(in srgb, var(--shp-ink) 9%, var(--shp-surface)); border-radius: var(--r-lg); padding: 8px; display: none; gap: 6px; max-width: 92vw; overflow-x: auto; }
.js .sv-dock { display: flex; }
.sv-dk { flex: 0 0 auto; opacity: .55; transition: opacity .3s; border-radius: 50%; }
.sv-dk .av { width: 44px; height: 44px; }
.sv-dk.unseen { opacity: .85; }
.sv-dk.on { opacity: 1; outline: 2px solid var(--shp-accent); outline-offset: 2px; }
.sv-sheet { position: absolute; inset: 0; z-index: 40; background: rgb(0 0 0 / .55); display: grid; place-items: end center; }
.sv-sheet[hidden] { display: none; }
.sv-sheet-box { width: min(420px, 100%); max-height: 70vh; overflow: auto; background: var(--surface); color: var(--text); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 16px; }
.sv-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sv-sheet-head .sv-ic { background: var(--surface-3); color: var(--text); }
.sv-vlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sv-vlist li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); background: var(--surface-2); }
.sv-vlist a { display: flex; gap: 10px; align-items: center; color: inherit; margin-inline-end: auto; }
.sv-vlist small, .sv-vlist time { display: block; font-size: 12.5px; color: var(--muted); }
.sv-empty { color: var(--muted); text-align: center; padding: 20px; }
.sv-body .toasts { z-index: 60; }
.sv.paused .sv-card.is-on .sv-bars b { opacity: .6; }
.sv-card[data-mine="1"] .sv-slide figcaption { bottom: 64px; }
.sv-card[data-mine="1"] .sv-tap { bottom: 70px; }
/* لحظة نصية على خلفية فاتحة (ضباب، كتان، رمل، نعناع): ستار فاتح وحبر داكن بدل ظلال المسرح الداكنة التي تتّسخ فوقها.
   الصور والمقاطع والخلفيتان الداكنتان (بحر هادئ، غسق) تبقى على ظلال المسرح */
.sv-card:has(> .sv-stage > .sv-slide.is-cur > .st-text:is(.sbg-0, .sbg-1, .sbg-3, .sbg-5)) { --shp-ink: #3A3646; color-scheme: light; }
.sv-card:has(> .sv-stage > .sv-slide.is-cur > .st-text:is(.sbg-0, .sbg-1, .sbg-3, .sbg-5))::before { background: linear-gradient(rgb(249 248 254 / .75), transparent 120px); }
.sv-card:has(> .sv-stage > .sv-slide.is-cur > .st-text:is(.sbg-0, .sbg-1, .sbg-3, .sbg-5)) .sv-foot { background: linear-gradient(transparent, rgb(249 248 254 / .9) 40%); }
.sv-card:has(> .sv-stage > .sv-slide.is-cur > .st-text:is(.sbg-0, .sbg-1, .sbg-3, .sbg-5)) .sv-who { text-shadow: none; }
.sv-card:has(> .sv-stage > .sv-slide.is-cur > .st-text:is(.sbg-0, .sbg-1, .sbg-3, .sbg-5)) .sv-bars i { background: rgb(58 54 70 / .2); }
.sv-card:has(> .sv-stage > .sv-slide.is-cur > .st-text:is(.sbg-0, .sbg-1, .sbg-3, .sbg-5)) :is(.sv-ic, .sv-qr) { background: rgb(255 255 255 / .6); }
@media (max-width: 560px) {
  .sv-card { width: 100vw; height: calc(100vh - 84px); border-radius: var(--r); top: 64px; }
  .sv-top { padding: 10px 12px; }
  .sv-dock { display: none !important; }
}

/* ---------- الصفحات بدون شريط (الهبوط والدخول) ---------- */
.bare-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 100%; margin: 0 auto; padding: 16px var(--pad-x); }
.bare-links { display: flex; align-items: center; gap: 16px; font-weight: 500; color: var(--text-2); }
.bare-links > a:not(.btn) { color: var(--text-2); }
.bare-links > a:not(.btn):hover { color: var(--text); }
/* عمود بارتفاع الشاشة: التذييل في القاع دائمًا، والمحتوى يملأ ما بينهما (الهبوط أطول من الشاشة فلا يتغير) */
body.bare { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.bare > :is(.bare-top, .bare-main, .bare-foot) { width: 100%; }
.bare-main { flex: 1 0 auto; max-width: 100%; margin: 0 auto; padding: 0 var(--pad-x) 40px; }
/* الدخول والتسجيل والاستعادة: النموذج ولوح الهوية في منتصف المساحة عموديًا */
.bare-main:has(> .auth-split) { display: grid; align-content: center; }
.bare-main > .auth-split { width: 100%; }
.bare-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px;
  max-width: 100%; margin: 0 auto; padding: 26px var(--pad-x) 30px; border-top: 1px solid var(--border); color: var(--muted); font-size: .88em;
}
.bare-foot a:hover { color: var(--text); }
.foot-brand { display: inline-grid; place-items: center; padding: 4px; margin-inline-start: -4px; border-radius: var(--r-pill); line-height: 0; }
.foot-brand .logo { width: 32px; height: 32px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { color: var(--text-2); }
.foot-copy { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .bare-foot { flex-direction: column; justify-content: center; text-align: center; }
  .foot-brand { margin-inline-start: 0; }
  .foot-links { justify-content: center; }
}
/* الحشوة متغيرات تستعملها اللافتات الممتدة حتى حافة البطاقة (.welcome-art) فلا يفترق الرقمان */
.auth { --auth-pt: 36px; --auth-px: 32px; max-width: 460px; margin: 24px auto; padding: var(--auth-pt) var(--auth-px) 30px; text-align: center; }
.auth h1 { font-size: var(--fs-h1); font-weight: 700; margin: 14px 0 6px; }
.auth > .muted { margin: 0 auto; max-width: 34ch; line-height: 1.7; }
.auth .form { text-align: start; margin-top: 20px; }
.auth > h1:first-child { margin-top: 0; }
.auth-links { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; font-size: .92em; color: var(--muted); }
.auth-links a { color: var(--accent-ink); font-weight: 600; }
.welcome .auth { max-width: 560px; }
.welcome-h { text-align: start; margin: 20px 0 6px; font-size: 1em; }
.welcome .people { text-align: start; padding: 0; }
.welcome .person { padding-inline: 0; }
.welcome .mini-hubs { text-align: start; }
.welcome .row-actions { margin-top: 22px; }

.hero-land { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; min-height: 64vh; padding: 28px 0 48px; }
.hero-land h1 { font-size: var(--fs-display); font-weight: 700; line-height: 1.18; margin: 18px 0 16px; }
.hero-land p { font-size: 1.15rem; line-height: 1.8; color: var(--text-2); max-width: 520px; text-wrap: pretty; }
/* كلمة الهوية في العنوان: تدرّج من حبر اللون المميز إلى المميز (كلاهما ≥3:1 للنص الكبير في كل لوحة) */
.grad { color: var(--accent-ink); }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .hero-land .grad {
    background: linear-gradient(100deg, var(--accent-ink) 10%, var(--accent) 90%); -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding-block: .06em;
  }
}
@media (forced-colors: active) { .hero-land .grad { background: none; color: CanvasText; } }
.hero-kicker {
  display: inline-flex; align-items: center; gap: .45em; padding: .35em 1em; border-radius: var(--r-pill); font-weight: 600; font-size: .88rem;
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  color: var(--accent-ink); box-shadow: var(--shadow-1);
}
.hero-kicker .i { color: var(--accent); }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.hero-stats { display: flex; gap: 0; margin-top: 32px; color: var(--muted); font-size: .94rem; }
.hero-stats > span { display: inline-flex; align-items: baseline; gap: .35em; padding-inline: 22px; }
.hero-stats > span:first-child { padding-inline-start: 0; }
.hero-stats > span + span { border-inline-start: 1px solid var(--border); }
.hero-stats b { color: var(--text); font-size: 1.6em; font-weight: 600; line-height: 1; }
.hero-art-land { position: relative; height: 420px; display: grid; place-items: center; }
.float-card {
  position: absolute; width: 210px; padding: 14px 16px; border-radius: var(--r); font-size: .9em; z-index: 3;
  background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid color-mix(in srgb, var(--surface) 60%, var(--border)); box-shadow: var(--shadow-2);
}
.float-card p { margin: 6px 0; color: var(--text); line-height: 1.7; }
.fc-head { display: flex; align-items: center; gap: 8px; }
.fc-rx { font-size: .95em; color: var(--text-2); } /* فوق زجاج البطاقة العائمة على الصورة: --muted يهبط دون 4.5:1 */
.fc-0 { top: 10px; inset-inline-start: 0; }
.fc-1 { bottom: 10px; inset-inline-end: 0; }
.features { padding: 48px 0 32px; }
/* رأس أقسام الصفحة الأولى: سطر تعريفي صغير بلون مميز، ثم العنوان، ثم سطر شارح */
.land-head { text-align: center; display: grid; justify-items: center; gap: 8px; margin-bottom: 28px; }
.land-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 700; }
.land-head p { margin: 0; max-width: 52ch; color: var(--text-2); line-height: 1.75; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent-ink); font-weight: 600; font-size: .86rem;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 18px; height: 1px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { padding: 22px 22px 20px; }
.feature-emo {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 14px; color: var(--accent-ink);
  background: linear-gradient(160deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 14%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.feature h3 { font-size: 1.0625rem; margin-bottom: 6px; }
.feature p { color: var(--text-2); margin: 0; font-size: .95em; line-height: 1.75; }
.landing-trends { padding: 40px 0 24px; }
.cta-band { text-align: center; padding: 44px 24px; margin: 40px 0 32px; }
.cta-band h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 700; }
.cta-band p { color: var(--text-2); margin: 10px 0 22px; }

/* ==========================================================================
   التجاوب
   ========================================================================== */
.tabbar, .scrim { display: none; }

@media (max-width: 1100px) {
  /* بلا عمود جانبي: عمود محتوى واحد يتسع لأبعاد الجهاز بلا فراغ كبير */
  .stage-body { grid-template-columns: minmax(0, 1fr); }
  .shell:not(.is-wide) .main { width: 100%; max-width: 100%; margin-inline: auto; }
  .side { display: none; }
  .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-cards > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  .sx-wrap { grid-template-columns: minmax(0, 1fr); }
  .sx-bar { max-width: none; }
  .sx-fbtn { display: grid; }
  html.js .sx-side { display: none; }
  html.js .sx-side.show { display: block; position: static; margin-bottom: var(--gap); }
  .dmx-wrap { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .home-top { grid-template-columns: minmax(0, 1fr); }
  .dmx-wrap { grid-template-columns: minmax(0, 1fr); }
  .dmx.has-conv .dmx-inbox, .dmx.has-conv .dmx-head { display: none; }
  .dmx:not(.has-conv) .dmx-letter { display: none; }
  .dmx.has-q .dmx-inbox { display: flex; }
  .dmx-inbox { height: auto; min-height: 0; }
  .dmx .dm-back { display: grid; }
  .dmx-letter { height: calc(100vh - var(--top-h) - 120px - var(--banner-h, 0px)); height: calc(100dvh - var(--top-h) - 120px - var(--banner-h, 0px)); }
}
@media (max-width: 760px) {
  :root { --gap: 12px; --pad: 14px; --top-h: 60px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .shell { padding: 12px 12px 0; }
  .top-me-chev { display: none; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 40; justify-content: space-around; align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--shadow-2);
  }
  .tb { position: relative; display: grid; place-items: center; width: 52px; height: 44px; border-radius: var(--r-sm); color: var(--muted); }
  .tb:hover { color: var(--text); }
  .tb .i { width: 1.45em; height: 1.45em; }
  .tb.active { color: var(--text); background: var(--nav-on); color: var(--on-nav-on); }
  .tb.active .i { stroke-width: 2.2; }
  /* مثبّت من حافة بدايته بجانب الأيقونة: يكبر بعيدًا عنها مع خانة ثانية («10») فلا يغطي رسمها */
  .tb .badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 5px); border: 2px solid var(--surface); }
  .tb .badge[data-wide] { padding: 0 4px; font-size: 10px; }
  .tb-fab { background: var(--btn); color: var(--on-accent); width: 48px; height: 48px; border-radius: 50%; }
  .tb-fab:hover { color: var(--on-accent); }
  .toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 12px; }
  .page-title h1, .sx-head h1, .hub-hero-body h1, .profile-name { font-size: 1.375rem; }
  /* الجوال: المحتوى أولًا — الترحيب والبطاقات الثلاث تُطوى، ويبقى شريط اللحظات وتنبيه «ما فاتك» */
  .hero, .home-cards { display: none; }
  .wall-card { display: none; } /* الإنشاء على الجوال من زر «+» في الشريط السفلي */
  .wall-chips { margin-top: 4px; }
  .home-top { margin-bottom: var(--gap); }
  .digest-banner.m-only { display: flex; }
  .post { padding: var(--pad); }
  .post-main { padding: 16px; }
  .post-actions { max-width: none; margin-inline-start: -6px; }
  .act { padding: 6px; }
  .handle { display: none; }
  .post-main .handle { display: inline; }
  .grid-2, .charts-2 { grid-template-columns: 1fr; }
  .cover { height: 110px; }
  .av-xl { width: 84px; height: 84px; font-size: 32px; }
  .profile-top { margin-top: -42px; padding: 0 14px; }
  .profile-info { padding: 10px 14px 14px; }
  .hero-land { grid-template-columns: 1fr; min-height: 0; padding-top: 10px; text-align: center; }
  .hero-land p { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .hero-art-land { height: auto; display: grid; gap: 12px; place-items: stretch; }
  .float-card { position: static; width: auto; text-align: start; font-size: .82em; }
  .feature-grid { grid-template-columns: 1fr; }
  .bare-links > a:not(.btn) { display: none; }
  .theme-pick { grid-template-columns: repeat(3, 1fr); }
  .keys { grid-template-columns: 1fr; }
  .cmp-draft span { display: none; }
  /* نوافذ أدوات المحرر تُثبَّت إلى المحرر نفسه لا إلى زرها الصغير: «خيارات النشر» بعرض المحرر، فلا تتجاوز حافة الشاشة
     وتدفع الصفحة جانبيًا */
  .composer .tool-pop { position: static; }
  .composer .tool-pop > .pop { inset-inline-start: 0; max-width: 100%; }
  .composer .tool-pop > .cmp-opts { inset-inline: 0; width: auto; }
  .admin-row { grid-template-columns: 1fr; }
  .dlg { max-height: calc(100vh - 20px); }
  .hub-grid { grid-template-columns: 1fr; }
  .masonry { columns: 1; }
  .person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msg { max-width: 85%; }
  .dmx-letter { border-radius: var(--r); }
  .wall-card { padding: 14px; }
}
@media (min-width: 761px) and (max-width: 980px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-land { grid-template-columns: 1fr; text-align: center; }
  .hero-land p { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
}

/* ---------- الهدوء وتقليل الحركة ---------- */
[data-hidecounts="1"] .count, [data-calm="1"] .count { display: none !important; }
[data-calm="1"] .w-trends .mini-list { display: none; }
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .toast { animation: none; }
}
@media (forced-colors: active) {
  .col-bar, .hbar-fill, .hour { forced-color-adjust: none; background: CanvasText; }
  .tabs a.active, .wall-chips a.on, .look-opt:has(input:checked) { outline: 2px solid CanvasText; }
}
@media print {
  .hdr, .side, .tabbar, .scrim, .post-actions, .composer-card, .home-top, .home-cards { display: none !important; }
  .shell { display: block; max-width: none; }
}

/* ==========================================================================
   الشورت: بطاقات عمودية، عمود الرئيسية، الشريط الأفقي، والمشغّل الكامل
   المسرح داكن في السمتين (لون خلفية الوضع الداكن ونصّه من اللوحة) كأي مشغّل مقاطع.
   ========================================================================== */
/* رموز المسرح (--shp-*) و--media-from/--media-to في :root أعلاه وفي كل لوحة ألوان */
.sh-card {
  position: relative; display: block; aspect-ratio: 9 / 16; min-width: 0; overflow: hidden; border-radius: var(--r);
  background: var(--art-stage, none) center / cover no-repeat, linear-gradient(160deg, var(--media-from), var(--media-to)); color: var(--shp-ink); isolation: isolate;
  box-shadow: var(--shadow-1); transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.sh-card:hover { color: var(--shp-ink); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.sh-card:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; }
.sh-ph, .sh-ph > img, .sh-ph > video, .sh-ph > .sh-cap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-ph { z-index: -1; }
.sh-card::after { /* تظليل سفلي ليبقى النص مقروءًا فوق أي لقطة */
  content: ""; position: absolute; inset: 38% 0 0; z-index: -1;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--shp-bg) 74%, transparent) 50%, color-mix(in srgb, var(--shp-bg) 90%, transparent));
}
.sh-play {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; background: var(--shp-chip); backdrop-filter: blur(4px);
}
.sh-play .i { width: 20px; height: 20px; fill: currentColor; margin-inline-start: 2px; }
.sh-dur {
  position: absolute; top: 8px; inset-inline-end: 8px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--shp-chip); font-size: 12px; font-weight: 700; direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums;
}
.sh-meta { position: absolute; inset-inline: 10px; bottom: 10px; display: grid; gap: 2px; }
.sh-meta b { font-size: .9rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-meta small { display: flex; gap: 10px; font-size: 12px; opacity: .92; }
.sh-meta small span { display: inline-flex; align-items: center; gap: 3px; }
.sh-meta .i { width: 13px; height: 13px; }
.sh-card video.sh-frame { opacity: 0; }

/* البطاقة الجانبية في الرئيسية */
.sh-rail .card-head h2 .i { color: var(--accent); }
.sh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sh-empty {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; justify-items: center; gap: 8px; text-align: center; padding: 22px 14px 20px; border-radius: var(--r-sm);
  background: radial-gradient(100% 70% at 50% 0%, var(--accent-soft), transparent 75%), var(--surface-2); border: 1px solid var(--border);
}
.sh-empty p { margin: 0; display: grid; gap: 4px; position: relative; z-index: 1; }
.sh-empty small { color: var(--muted); }
.sh-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 10px) / 3.15); gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px;
}
@media (min-width: 1101px) {
  .sh-track { grid-auto-columns: calc((100% - 4 * 12px) / 5.2); gap: 12px; }
}
.sh-track::-webkit-scrollbar { display: none; }
.sh-track > * { scroll-snap-align: start; }
.sh-track:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; border-radius: var(--r-sm); }
.sh-strip { display: block; margin-bottom: var(--gap); }
/* الشريط بلا مقاطع: سطر واحد بمقاييس ملخص «أخبار اليوم» (.nw-sum) */
.sh-strip.is-empty { padding: 0; }
.sh-sum { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 14px; padding-inline-start: 12px; }
.sh-sum-lab { flex: none; margin: 0; font-size: .96rem; font-weight: 800; line-height: 1.4; }
.sh-sum-tx {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-inline-start: 10px; border-inline-start: 1px solid var(--border); font-size: .9rem; color: var(--muted);
}
.sh-sum .btn { flex: none; }

/* تخطيط الرئيسية: عمود واحد عريض بكامل الشاشة بدون عمود يسار للشورت والأخبار */
.home-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--shell-gap); align-items: start;
}
.home-main { min-width: 0; width: 100%; }
.home-side { display: none !important; }
.home-side .sh-rail { padding: 16px; }

/* صفحة الشورت */
.sh-head { display: flex; align-items: center; gap: 12px; }
.sh-head .page-title { flex: 1; }
.sh-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }

/* الشورت داخل بطاقة المنشور */
.media-video { display: block; background: var(--shp-bg); }
.media-video video { display: block; width: 100%; max-width: 100%; height: min(620px, 70vh); object-fit: contain; background: var(--art-stage-wide, none) center / cover no-repeat, linear-gradient(160deg, var(--media-from), var(--media-to)); }

/* محرر النشر: معاينة المقطع */
.cmp-prev.cmp-prev-v { aspect-ratio: 9 / 16; width: 140px; height: auto; }
.cmp-prev-v video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--shp-bg); }
.cmp-prev-v .cmp-prev-dur { position: absolute; bottom: 6px; inset-inline-start: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--shp-chip); color: var(--shp-ink); font-size: 12px; direction: ltr; }

/* لقطة اللحظة المرئية */
.st-video-thumb { position: relative; overflow: hidden; }
.st-video-thumb > img, .st-video-thumb > video, .st-video-thumb > .sh-cap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-video-thumb > video { opacity: 0; }
.st-video-thumb > .i { position: relative; z-index: 1; }

/* ---------- المشغّل ---------- */
html.shp-lock, html.shp-lock body { overflow: hidden; }
.shp { position: fixed; inset: 0; z-index: 90; background: var(--shp-bg); color: var(--shp-ink); }
.shp[hidden] { display: none; }
.shp-feed { position: absolute; inset: 0; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.shp-feed::-webkit-scrollbar { display: none; }
.shp-slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; }
.shp-stage { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; overflow: hidden; background: #000; }
.shp-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--art-stage, none) center / cover no-repeat, linear-gradient(160deg, var(--media-from), var(--media-to)); }
.shp-tap { position: absolute; inset: 0; background: none; border: 0; cursor: pointer; }
.shp-tap:focus-visible { outline: 3px solid var(--shp-ink); outline-offset: -6px; }
.shp-state {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%; display: grid; place-items: center; pointer-events: none;
  width: 64px; height: 64px; border-radius: 50%; background: var(--shp-chip); opacity: 0; transition: opacity .2s;
}
.shp-slide.paused .shp-state { opacity: 1; }
.shp-state .i { width: 28px; height: 28px; fill: currentColor; }
.shp-info {
  position: absolute; inset-inline: 0; bottom: 0; padding: 60px 16px calc(18px + env(safe-area-inset-bottom)); padding-inline-end: 76px;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--shp-bg) 76%, transparent) 56px, color-mix(in srgb, var(--shp-bg) 88%, transparent)); pointer-events: none;
}
.shp-info a { pointer-events: auto; color: var(--shp-ink); display: inline-flex; gap: 8px; align-items: baseline; font-weight: 700; }
.shp-info a span { font-weight: 400; font-size: .88em; color: color-mix(in srgb, var(--shp-ink) 84%, var(--shp-bg)); }
.shp-info p { margin: 6px 0 0; font-size: .95rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.shp-acts { position: absolute; inset-inline-end: 10px; bottom: calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 14px; justify-items: center; }
.shp-act, .shp-btn {
  display: grid; justify-items: center; gap: 3px; color: var(--shp-ink); background: none; border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700;
}
.shp-act:hover, .shp-btn:hover { color: var(--shp-ink); }
/* العدّادات وتسمية «مشاركة» على رقاقة: تبقى مقروءة فوق أي لقطة فاتحة */
.shp-act > span:not(:empty) { padding: 1px 7px; border-radius: var(--r-pill); background: var(--shp-chip); }
.shp-act > .i, .shp-btn > .i { box-sizing: content-box; width: 22px; height: 22px; padding: 11px; border-radius: 50%; background: var(--shp-chip); backdrop-filter: blur(4px); }
.shp-act[aria-pressed="true"] > .i { background: var(--shp-ink); color: var(--shp-bg); fill: currentColor; }
.shp-act:focus-visible, .shp-btn:focus-visible { outline: 3px solid var(--shp-ink); outline-offset: 2px; border-radius: var(--r-sm); }
.shp-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); inset-inline: 12px; display: flex; justify-content: space-between; z-index: 2; pointer-events: none; }
.shp-top > * { pointer-events: auto; }
.shp-nav { position: absolute; inset-inline-start: 18px; top: 50%; translate: 0 -50%; display: grid; gap: 12px; z-index: 2; }
.shp-nav .shp-btn:first-child .i { rotate: 90deg; }
.shp-nav .shp-btn:last-child .i { rotate: -90deg; }
.shp-btn:disabled { opacity: .35; cursor: default; }
.shp-count { align-self: center; padding: 4px 10px; border-radius: var(--r-pill); background: var(--shp-chip); font-size: 12px; font-weight: 700; direction: ltr; }

@media (max-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-main { max-width: var(--home-w); width: 100%; margin-inline: auto; }
  .home-side { display: none; }
  .sh-strip { display: block; }
}
@media (min-width: 600px) and (max-width: 1100px) {
  .sh-track { grid-auto-columns: calc((100% - 3 * 10px) / 4.2); }
}
@media (max-width: 760px) {
  .sh-strip { padding: 14px; }
  .sh-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .shp-stage { aspect-ratio: auto; width: 100%; }
  .shp-stage video { object-fit: cover; }
  .shp-nav { display: none; }
  .sh-meta small span + span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sh-card:hover { transform: none; }
  .shp-feed { scroll-behavior: auto; }
}
[data-motion="reduce"] .sh-card:hover { transform: none; }
@media (forced-colors: active) {
  .sh-card, .shp-act > .i, .shp-btn > .i { border: 1px solid CanvasText; }
}

/* ==========================================================================
   «أخبار اليوم» — views/partials/news.php (بطاقة جانبية، شريط قابل للطي، ممر الاستكشاف)
   وصفحة /news ولوحة /admin/news. لا ألوان جديدة: كل شيء من رموز اللوحة، فتعمل مع اللوحات السبع
   في الوضعين ومع أشكال التصفح الستة. السلسلة الزمنية: خط مميز رفيع ونقاط، والأحدث نقطة ممتلئة
   (تنبض بهدوء إن كان خلال الساعة الأخيرة، إلا مع تقليل الحركة أو الوضع الهادئ).
   ========================================================================== */
.nw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; position: relative; }
.nw-list::before {
  content: ""; position: absolute; inset-block: 18px 22px; inset-inline-start: 6px; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 12%, transparent));
}
.nw-it { position: relative; }
.nw-it::before {
  content: ""; position: absolute; z-index: 1; inset-inline-start: 2px; top: 14px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); pointer-events: none;
}
.nw-it:first-child::before { background: var(--accent); }
.nw-it.is-new::before { animation: nw-pulse 2.6s var(--ease) infinite; }
@keyframes nw-pulse {
  0% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%, 100% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.nw-a {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; padding-inline-start: 22px;
  border-radius: var(--r-sm); color: var(--text);
}
.nw-a:hover { color: var(--text); background: var(--hover); }
.nw-a:hover .nw-title { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.nw-a:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 0; }
.nw-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.nw-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .8rem; line-height: 1.5; color: var(--muted); }
.nw-src { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-ink); font-weight: 700; }
.nw-meta time { flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nw-meta time::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .8; }
.nw-title {
  font-size: .94rem; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.nw-th { flex: none; width: 48px; height: 48px; margin-top: 2px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); border: 1px solid var(--border); }
.nw-th-ph { display: grid; place-items: center; color: var(--muted); }
.nw-th-ph .i { width: 20px; height: 20px; }

/* البطاقة الجانبية (الرئيسية، تحت الشورت) */
.nw-card { padding: 14px 14px 10px; container-type: inline-size; }
.nw-head { margin-bottom: 6px; }
.nw-head h2 { font-size: 1rem; }
/* العمود الجانبي ينكمش حتى 300px (1366×768، 1280×720، المرسى على 1920): الرأس سطر واحد دائمًا، ويُطوى التاريخ حين يضيق */
.nw-head :is(h2, .card-link) { white-space: nowrap; }
@container (max-width: 330px) { .nw-head .nw-date { display: none; } }
.nw-date {
  margin-inline-end: auto; padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: .74rem; font-weight: 600; white-space: nowrap;
}

/* حالة فارغة (للمشرف وحده): بطاقة وصورة ظلامية داكنة أنيقة عالية التباين */
.nw-empty {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; justify-items: center; gap: 12px; text-align: center; padding: 26px 18px; margin: 4px 0 6px;
  border-radius: var(--r-sm);
  background: radial-gradient(90% 70% at 50% 0%, rgb(255 255 255 / .03), transparent 75%), #050507;
  color: #E7E9EA;
  border: 1px solid #181A1D;
}
.nw-empty > :not(.empty-bg-art) { position: relative; z-index: 1; }
.nw-empty .empty-bg-art { opacity: .14; filter: grayscale(1) brightness(.65) contrast(1.15); }
.nw-empty .nw-empty-art {
  width: 180px; border-radius: 16px; background: #000000;
  box-shadow: 0 10px 28px -10px rgb(0 0 0 / .9), inset 0 0 0 1px rgb(255 255 255 / .07);
}
.nw-empty p { margin: 0; display: grid; gap: 5px; color: #E7E9EA; }
.nw-empty small { color: #8B9097; font-size: .88rem; line-height: 1.65; max-width: 54ch; }
.nw-empty .btn-outline { border-color: #2E333B; color: #E7E9EA; background: rgb(255 255 255 / .04); }
.nw-empty .btn-outline:hover { background: #FFFFFF; border-color: #FFFFFF; color: #000000; }

/* الشريط القابل للطي: سطر واحد بعنوان يتبدّل، يتفتّح عن القائمة في العمود الرئيسي */
.nw-strip { display: none; padding: 0; margin-bottom: var(--gap); overflow: hidden; }
.home-main > .nw-strip { display: block; }
.nw-sum {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 14px; padding-inline-start: 12px;
  cursor: pointer; list-style: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.nw-sum::-webkit-details-marker { display: none; }
.nw-sum::marker { content: ""; }
.nw-sum:hover { background: var(--hover); }
.nw-sum:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: -3px; border-radius: var(--r); }
.nw-sum-ic { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--mist); color: var(--text); }
.nw-sum-ic .i { width: 18px; height: 18px; }
.nw-sum-ic.is-live::after {
  content: ""; position: absolute; top: 1px; inset-inline-end: 1px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface); animation: nw-dot 2.6s var(--ease) infinite;
}
@keyframes nw-dot { 50% { opacity: .35; } }
.nw-sum-lab { flex: none; font-weight: 800; font-size: .96rem; }
.nw-sum-tick {
  flex: 1; min-width: 0; overflow: hidden; padding-inline-start: 10px; border-inline-start: 1px solid var(--border);
  font-size: .9rem; color: var(--text-2); transition: opacity .25s;
}
.nw-sum-tx { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity .3s var(--ease), translate .3s var(--ease); }
.nw-sum-tx.is-out { opacity: 0; translate: 0 -45%; }
.nw-sum-tx.is-in { opacity: 0; translate: 0 45%; transition: none; }
.nw-sum-n {
  flex: none; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-size: .76rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.nw-sum-chev { flex: none; width: 18px; height: 18px; color: var(--muted); rotate: -90deg; transition: rotate .3s var(--ease); }
.nw-strip[open] .nw-sum-chev { rotate: 90deg; }
.nw-strip[open] .nw-sum-tick { opacity: 0; }
.nw-strip[open] .nw-sum { border-bottom: 1px solid var(--border); }
.nw-drop { padding: 8px 10px 10px; }
.nw-strip[open] .nw-drop { animation: nw-open .3s var(--ease); }
@keyframes nw-open { from { opacity: 0; translate: 0 -6px; } }
.nw-drop .nw-th { width: 44px; height: 44px; }
.nw-all {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 2px 0; padding: 9px;
  border-radius: var(--r-sm); background: var(--surface-2); color: var(--accent-ink); font-size: .86rem; font-weight: 700;
}
.nw-all:hover { color: var(--accent-ink); background: var(--hover); }
.nw-all .i { width: 1em; height: 1em; }
.nw-strip .nw-empty { margin: 6px 4px 4px; }

/* ممر الاستكشاف */
.nw-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 6px 8px; }

/* الأماكن: الشريط في الرئيسية، والممر/الشريط في الاستكشاف */
@media (max-width: 820px) {
  .x-explore > .nw-strip { display: block; margin-top: 14px; }
  .x-two.has-news > .nw-lane { display: none; }
}
@media (min-width: 1101px) {
  .x-two.has-news { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 821px) and (max-width: 1100px) {
  /* الممر بعرض الصف تحت العمودين: العناوين في عمودين (النقاط تبقى، والخط الواصل يُخفى) */
  .x-two.has-news > .nw-lane { grid-column: 1 / -1; }
  .nw-lane .nw-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  .nw-lane .nw-list::before { display: none; }
}

/* عمود الرئيسية مع الأخبار: يحافظ على الأبعاد المتقاربة بين اليمين واليسار */
.home-grid.has-news {
  --side-reserve: 430px;
  --side-avail: calc(100vh - var(--hdr-full, var(--top-h)) - var(--banner-h, 0px));
  --sh-col: minmax(380px, 0.88fr);
}
body:has([data-call-banner]:not([hidden])) { --banner-h: 76px; }
@media (max-width: 760px) {
  body:has([data-call-banner]:not([hidden])) { --banner-h: 112px; }
}
/* ما لا يتسع عند التحميل رغم الدرجات أدناه (يحسبه app.js): صف الشورت الثاني ثم آخر العناوين */
.home-side .is-fit-out { display: none !important; }
@media (max-height: 1059px) {
  .home-grid.has-news .home-side .sh-grid > :nth-child(n+3) { display: none; }
}
@media (max-height: 820px) {
  .home-grid.has-news { --side-reserve: 362px; }
  .home-side .nw-card .nw-it:nth-child(n+5) { display: none; }
}
@media (max-height: 700px) {
  .home-grid.has-news { --side-reserve: 300px; }
  .home-side .nw-card .nw-it:nth-child(n+4) { display: none; }
}
@media (min-height: 1060px) {
  .home-grid.has-news { --sh-col: minmax(380px, 0.88fr); }
}
@media (max-height: 762px) {
  [data-layout="masthead"] .home-grid.has-news { --side-reserve: 300px; }
  [data-layout="masthead"] .home-side .nw-card .nw-it:nth-child(n+4) { display: none; }
}

/* صفحة «كل الأخبار» */
.nw-day + .nw-day { margin-top: 22px; }
.nw-day-h { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 10px; font-size: 1.02rem; font-weight: 800; }
.nw-day-h small { color: var(--muted); font-weight: 500; font-size: .84rem; }
.nw-stories { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nw-story { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; scroll-margin-top: calc(var(--top-h) + 16px); }
.nw-story:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nw-story-th { flex: none; order: 2; width: 112px; height: 84px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); border: 1px solid var(--border); }
.nw-story-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nw-story h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.55; overflow-wrap: anywhere; }
.nw-story h3 a { color: var(--text); }
.nw-story h3 a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.nw-story p { margin: 0; color: var(--text-2); font-size: .92rem; line-height: 1.7; overflow-wrap: anywhere; }
.nw-story-src { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .8rem; }
.nw-story-src .i { width: 14px; height: 14px; }
.nw-story .nw-meta { font-size: .8rem; }

/* لوحة الإدارة */
.nw-admin { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.nw-admin .nw-form { grid-row: span 2; }
.nw-form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.nw-form-img { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nw-form-img img { width: 72px; height: 72px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--border); }
.nw-form-img .input { flex: 1; min-width: 200px; }
.nw-check { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.nw-ad-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nw-ad-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.nw-ad-row + .nw-ad-row { border-top: 1px solid var(--border); }
.nw-ad-row.is-editing { background: var(--accent-soft); border-radius: var(--r-sm); padding-inline: 8px; }
.nw-ad-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nw-ad-tx b { font-weight: 700; overflow-wrap: anywhere; }
.nw-ad-tx small { color: var(--muted); font-size: .8rem; line-height: 1.7; }
.nw-ad-tx .chip { font-size: .72rem; padding: .05em .6em; vertical-align: 1px; }
.nw-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.nw-err { color: var(--danger); }
p.nw-err { margin: 10px 0 4px; font-size: .9rem; }
.nw-rejected { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nw-rejected li { padding: 4px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); font: .8rem/1.6 var(--mono); color: var(--text-2); overflow-wrap: anywhere; text-align: left; }
.nw-refresh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.nw-help { margin-top: 12px; font-size: .9rem; color: var(--text-2); }
.nw-help summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; }
.nw-help p { margin: 8px 0; line-height: 1.7; }
.nw-help pre { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; font: .82rem/1.6 var(--mono); text-align: left; }

@media (max-width: 980px) {
  .nw-admin { grid-template-columns: minmax(0, 1fr); }
  .nw-admin .nw-form { grid-row: auto; }
}
@media (max-width: 560px) {
  .nw-form-row { grid-template-columns: minmax(0, 1fr); }
  .nw-story { padding: 12px 14px; gap: 12px; }
  .nw-story-th { width: 84px; height: 64px; }
  .nw-ad-row { flex-wrap: wrap; }
  .nw-ad-row .row-actions { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .nw-it.is-new::before, .nw-sum-ic.is-live::after, .nw-strip[open] .nw-drop { animation: none; }
  .nw-sum-tx, .nw-sum-chev { transition: none; }
}
[data-motion="reduce"] .nw-it.is-new::before, [data-motion="reduce"] .nw-sum-ic.is-live::after, [data-motion="reduce"] .nw-strip[open] .nw-drop,
[data-calm="1"] .nw-it.is-new::before, [data-calm="1"] .nw-sum-ic.is-live::after { animation: none; }
@media (forced-colors: active) {
  .nw-list::before, .nw-it::before { background: CanvasText; }
  .nw-sum-n { border: 1px solid CanvasText; }
}

/* ==========================================================================
   صور «ساعة الخزامى» — gen_img() في app/helpers.php، والملفات في assets/img/gen (تولّدها tools/raneena-images)
   تصوير تحريري ناعم بدل الرسوم المرسومة. كل صورة داخل غلاف .art يحمل بديلها: تدرّج هادئ من رموز اللوحة
   (فيتبع اللوحات السبع والوضعين) بحبيبات خفيفة، يظهر حين تغيب الصورة أو قبل أن تُحمَّل.
   نسختا الفاتح والداكن تُرسمان معًا ويختار بينهما data-theme و prefers-color-scheme (light-dark() لا تبدّل الصور).
   ========================================================================== */
:root {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
/* :where() يجعل القاعدة الأساسية بلا وزن، فتغلبها قواعد المكوّنات (مثل .hero-art المطلقة) أينما كُتبت */
:where(.art) {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  background-color: var(--art-base, transparent); background-image: var(--art-bg, none); background-size: cover;
}
.art > picture { display: block; width: 100%; height: 100%; }
.art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--art-pos, 50% 50%); filter: grayscale(1); }
.art > .art-d { display: none; }
:root[data-theme="dark"] .art > .art-l { display: none; }
:root[data-theme="dark"] .art > .art-d { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .art > .art-l { display: none; }
  :root[data-theme="auto"] .art > .art-d { display: block; }
}
@supports not (color: light-dark(#000, #fff)) {
  :root[data-theme] .art > .art-l { display: block; }
  :root[data-theme] .art > .art-d { display: none; }
}
/* البديل: حبيبات خفيفة فوق التدرّج، و«موجات الرنين» (حلقات متراكزة رفيعة تخفت مبتعدة عن مصدرها، صدى علامة الشعار)
   في الألواح الكبيرة، وأيقونة خطية في وسام حين تُطلب. --rn-x/--rn-y مصدر الموجات لكل شكل. */
.art.is-missing::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--grain) 0 0 / 160px; opacity: .22; mix-blend-mode: soft-light;
}
.art.is-missing:is(.art-fb-sky, .art-fb-dusk, .art-fb-cover)::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-radial-gradient(circle at var(--rn-x, 22%) var(--rn-y, 60%), transparent 0 36px, var(--rn-wave) 36px 37px, transparent 37px 58px);
  -webkit-mask-image: radial-gradient(64% 84% at var(--rn-x, 22%) var(--rn-y, 60%), #000 6%, transparent 74%);
  mask-image: radial-gradient(64% 84% at var(--rn-x, 22%) var(--rn-y, 60%), #000 6%, transparent 74%);
}
.art { --rn-wave: light-dark(rgb(255 255 255 / .36), color-mix(in srgb, var(--accent-2) 22%, transparent)); }
.art-fb-dusk { --rn-wave: color-mix(in srgb, var(--band-ink) 14%, transparent); --rn-x: 12%; --rn-y: 100%; }
.art-fb-cover { --rn-x: 18%; --rn-y: 112%; }
.hero-art.is-missing { --rn-wave: color-mix(in srgb, var(--band-ink) 15%, transparent); --rn-x: 16%; --rn-y: 62%; }
.art-ic { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; color: var(--accent-ink); }
.art-ic .i {
  box-sizing: content-box; width: 28px; height: 28px; padding: 16px; stroke-width: 1.6; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent), 0 0 0 12px color-mix(in srgb, var(--surface) 22%, transparent), var(--shadow-1);
}

/* أشكال البديل */
.art-fb-sky {   /* أفق «ساعة الخزامى»: سماء ليلكية ووهج شمس دافئ يسارًا؛ وفي الداكن ليل باذنجاني ووهج قمر خافت */
  --art-base: var(--mist);
  --art-bg:
    radial-gradient(34% 58% at 22% 60%, light-dark(rgb(255 248 236 / .9), color-mix(in srgb, var(--accent) 36%, transparent)), transparent 72%),
    radial-gradient(70% 70% at 90% -10%, light-dark(color-mix(in srgb, var(--accent-2) 40%, transparent), color-mix(in srgb, var(--accent) 18%, transparent)), transparent 70%),
    linear-gradient(176deg,
      light-dark(color-mix(in srgb, var(--mist) 80%, #fff), color-mix(in srgb, var(--accent) 10%, var(--bg))) 0%,
      light-dark(color-mix(in srgb, var(--accent-2) 48%, var(--mist)), color-mix(in srgb, var(--accent) 24%, var(--surface))) 54%,
      light-dark(color-mix(in srgb, var(--accent) 62%, var(--mist)), color-mix(in srgb, var(--accent) 40%, var(--bg))) 80%,
      light-dark(color-mix(in srgb, var(--accent-ink) 70%, var(--accent)), color-mix(in srgb, var(--accent) 34%, var(--bg))) 100%);
}
.art-fb-vig {   /* هالة ناعمة بلا إطار تذوب في البطاقة (مكان صورة الطبيعة الصامتة) */
  --art-bg:
    radial-gradient(closest-side at 44% 40%, color-mix(in srgb, light-dark(#fff, var(--accent-2)) 55%, transparent), transparent 70%),
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--accent-2) 16%, transparent) 62%, transparent);
}
.art-fb-dusk {  /* الشريط العميق: لون الشريط ووهجان خافتان */
  --art-base: var(--x-band, var(--band));
  --art-bg:
    radial-gradient(55% 120% at 10% 115%, color-mix(in srgb, var(--accent-2) 42%, transparent), transparent 70%),
    radial-gradient(45% 100% at 70% -20%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%);
}
.art-fb-cover { /* الأغلفة واللافتات: كثبان ليلكية مسطّحة بلا رسم */
  --art-base: var(--mist);
  --art-bg:
    radial-gradient(60% 140% at 18% 125%, color-mix(in srgb, var(--accent-2) 55%, transparent), transparent 70%),
    radial-gradient(50% 120% at 85% -30%, color-mix(in srgb, light-dark(#fff, var(--accent)) 45%, transparent), transparent 70%),
    linear-gradient(100deg, var(--mist), color-mix(in srgb, var(--accent-2) 34%, var(--mist)) 55%, color-mix(in srgb, var(--accent) 30%, var(--mist)));
}
@supports not (color: light-dark(#000, #fff)) {
  .art-fb-sky { --art-bg: radial-gradient(34% 58% at 22% 60%, rgb(255 248 236 / .9), transparent 72%), linear-gradient(176deg, var(--mist), var(--accent-2) 54%, var(--accent)); }
  .art-fb-vig { --art-bg: radial-gradient(closest-side at 50% 54%, var(--accent-soft), transparent); }
}

/* الحالات الفارغة: صورة جمالية تذوب حوافها في البطاقة */
.empty-art {
  width: 220px; aspect-ratio: 4 / 3; flex: none; border-radius: 18px;
  -webkit-mask-image: radial-gradient(closest-side, #000 78%, transparent 100%); mask-image: radial-gradient(closest-side, #000 78%, transparent 100%);
}
/* بلا صورة: «وسام الرنين» — أيقونة في قرص، وحولها حلقتان رفيعتان تخفتان (الخارجية تتنفّس ببطء).
   ويلبسه أيضًا إطارا صفحة الخطأ والمساعد غير المتاح بدل لوح فارغ كبير (مقاسهما بعد مقاسات الوسام أدناه) */
:is(.empty-art, .error-art, .as-off-art).is-missing {
  width: 120px; aspect-ratio: 1; overflow: visible; background: none; -webkit-mask-image: none; mask-image: none; margin-bottom: 8px;
}
:is(.empty-art, .error-art, .as-off-art).is-missing::before, :is(.empty-art, .error-art, .as-off-art).is-missing::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none; mix-blend-mode: normal; opacity: 1;
}
:is(.empty-art, .error-art, .as-off-art).is-missing::before {
  inset: 0; border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 9%, transparent), transparent);
  animation: rn-breathe 4.8s var(--ease) infinite;
}
:is(.empty-art, .error-art, .as-off-art).is-missing::after { inset: 13%; border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); background: none; }
:is(.empty-art, .error-art, .as-off-art).is-missing .art-ic { inset: 26%; border-radius: 50%; }
:is(.empty-art, .error-art, .as-off-art).is-missing .art-ic .i {
  width: 46%; height: 46%; padding: 27%; box-sizing: content-box; position: absolute; inset: 0; margin: auto;
  background: linear-gradient(160deg, var(--surface), var(--mist)); backdrop-filter: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 8px 18px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
@keyframes rn-breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .55; } }
[data-calm="1"] :is(.empty-art, .error-art, .as-off-art).is-missing::before { animation: none; }
.empty.has-art { padding-top: 26px; gap: 6px; }
.empty.has-art .empty-art { margin-bottom: 4px; }
.empty-art.dmx-empty-art { width: 280px; }
.empty-art.dmx-lock-art { width: 220px; }
.empty-art.sh-empty-art { width: 148px; } /* عمود الرئيسية: تبقى بطاقة «أخبار اليوم» تحته داخل الشاشة حتى ارتفاع 657px */
.empty-art.nw-empty-art { width: 156px; }
.nw-empty-art .art-ic .i { width: 24px; height: 24px; }
.cl-empty .empty-art, .cr-gone .empty-art, .cr-end .empty-art { margin-bottom: -4px; }
@media (max-width: 760px) {
  .empty-art, .empty-art.dmx-empty-art { width: 176px; }
  .empty-art.dmx-lock-art { width: 176px; }
  .empty-art.sh-empty-art { width: 136px; }
  .empty-art.nw-empty-art { width: 136px; }
}
/* مقاسات الوسام (بعد مقاسات الصور أعلاه فيتقدّم عليها) */
.empty-art.is-missing, .empty-art.is-missing.dmx-empty-art { width: 120px; }
.empty-art.is-missing.dmx-lock-art { width: 132px; }
.empty-art.is-missing:is(.sh-empty-art, .nw-empty-art) { width: 96px; }
:is(.error-art, .as-off-art).is-missing { width: 132px; height: auto; aspect-ratio: 1; margin: 6px auto 12px; outline: 0; border-radius: 50%; }
/* لافتة «عن رنينة» بلا صورة تُطوى (الشعار تحتها يحمل الهوية)، وكذلك صورة الصفحة الأولى على الجوال (البطاقتان العائمتان تكفيان) */
.about-art.is-missing { display: none; }
@media (max-width: 760px) { .land-art.is-missing { display: none; } }

/* ترحيب الرئيسية: --art-pos في .hero-art (التفاصيل يسارًا، والتحية يمينًا فوق ستار .hero::after).
   بلا صورة: غسق من لون الشريط العميق يمينًا (التحية ≥9:1 عليه) إلى وهج خزامى يسارًا، فلا يلزم الستار */
.hero-art.is-missing {
  --art-base: var(--band);
  --art-bg:
    radial-gradient(30% 70% at 16% 62%, color-mix(in srgb, light-dark(#FFF6EA, var(--accent-2)) 55%, transparent), transparent 75%),
    radial-gradient(60% 120% at 30% 120%, color-mix(in srgb, var(--accent-2) 55%, transparent), transparent 70%),
    linear-gradient(to var(--end), var(--band) 0%, color-mix(in srgb, var(--band) 82%, var(--accent)) 48%, color-mix(in srgb, var(--accent) 62%, var(--band)) 100%);
}
:root[dir="ltr"] .hero-art.is-missing { /* الوهج وموجات الرنين في جهة النهاية (يمينًا) بعيدًا عن التحية */
  --rn-x: 84%;
  --art-bg:
    radial-gradient(30% 70% at 84% 62%, color-mix(in srgb, light-dark(#FFF6EA, var(--accent-2)) 55%, transparent), transparent 75%),
    radial-gradient(60% 120% at 70% 120%, color-mix(in srgb, var(--accent-2) 55%, transparent), transparent 70%),
    linear-gradient(to var(--end), var(--band) 0%, color-mix(in srgb, var(--band) 82%, var(--accent)) 48%, color-mix(in srgb, var(--accent) 62%, var(--band)) 100%);
}
.hero:has(> .hero-art.is-missing)::after { display: none; }

/* الصفحة الأولى: صورة بقوس علوي تتراكب عليها بطاقتا المنشورين */
.hero-art-land { height: 500px; }
.land-art {
  width: min(380px, 76%); height: 475px; border-radius: 999px 999px var(--r-lg) var(--r-lg); --art-pos: 50% 60%;
  box-shadow: var(--shadow-2); outline: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 8px;
}
.cta-band { position: relative; overflow: hidden; isolation: isolate; padding: 64px 24px; }
.cta-art { position: absolute; inset: 0; z-index: -2; }
.cta-band::before { /* ستار شعاعي كثيف من لون البطاقة في الوسط لمنع أي تشابك لوني مع العنوان والوصف */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(68% 86% at 50% 50%, color-mix(in srgb, var(--surface) 95%, transparent) 42%,
    color-mix(in srgb, var(--surface) 78%, transparent) 78%, color-mix(in srgb, var(--surface) 38%, transparent));
}

/* الدخول والتسجيل والاستعادة: النموذج يمينًا ولوح الهوية يسارًا (من 980px)، وشريط فوق النموذج على الأضيق.
   اللوح: صورة الباب النجدي أو غسق اللوحة، وستار سفلي من --shp-bg يبقي السطر والقائمة الفاتحة ≥4.5:1 فوق أي بكسل */
.auth-split { display: grid; gap: 16px; max-width: 460px; margin: 20px auto; }
.auth-split .auth { margin: 0; max-width: none; }
.auth-aside {
  order: -1; position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end;
  min-height: 132px; border-radius: var(--r-lg); box-shadow: var(--shadow-1); color: var(--band-ink);
}
.auth-art { position: absolute; inset: 0; z-index: -2; --art-pos: 50% 50%; }
/* بلا صورة: غسق باذنجاني بوهجين (ليلكي أعلى البداية، وخزامى أسفل النهاية) وموجات رنين من الوهج العلوي */
.auth-art.is-missing {
  --rn-x: 24%; --rn-y: 26%; --rn-wave: color-mix(in srgb, var(--band-ink) 13%, transparent);
  --art-base: var(--band);
  --art-bg:
    radial-gradient(48% 42% at 24% 26%, color-mix(in srgb, var(--accent-2) 52%, transparent), transparent 72%),
    radial-gradient(62% 50% at 86% 46%, color-mix(in srgb, var(--accent) 50%, transparent), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--band) 72%, var(--accent)), var(--band) 62%);
}
.auth-aside::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--shp-bg) 94%, transparent), color-mix(in srgb, var(--shp-bg) 86%, transparent) 52%,
    color-mix(in srgb, var(--shp-bg) 56%, transparent) 78%, color-mix(in srgb, var(--shp-bg) 22%, transparent));
}
.auth-aside-tx { display: flex; align-items: center; gap: 12px; padding: 18px 20px; text-shadow: 0 1px 10px rgb(0 0 0 / .55); }
/* الشريط فوق النموذج (أضيق من 980px) بلا علامة: شعار الترويسة فوقه مباشرة، فعلامة واحدة فوق الطيّة */
.auth-aside-tx .logo { display: none; flex: none; width: 36px; height: 36px; color: var(--band-ink); }
.auth-aside-h { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.auth-aside-list { display: none; }
@media (min-width: 980px) {
  .auth-split { grid-template-columns: minmax(0, 460px) minmax(0, 480px); max-width: 964px; align-items: stretch; justify-content: center; gap: 24px; margin-top: 24px; }
  .auth-aside { order: 0; min-height: 100%; }
  .auth-aside-tx { flex-direction: column; align-items: flex-start; gap: 14px; padding: 40px 36px 36px; }
  .auth-aside-tx .logo { display: block; width: 52px; height: 52px; margin-bottom: 4px; }
  .auth-aside-h { font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 700; line-height: 1.3; }
  .auth-aside-list { display: grid; gap: 10px; list-style: none; margin: 6px 0 0; padding: 18px 0 0; border-top: 1px solid color-mix(in srgb, var(--band-ink) 22%, transparent); }
  .auth-aside-list li { display: flex; align-items: center; gap: 10px; font-size: .95rem; line-height: 1.5; color: color-mix(in srgb, var(--band-ink) 92%, var(--shp-bg)); }
  .auth-aside-list .i {
    flex: none; box-sizing: content-box; width: 16px; height: 16px; padding: 7px; border-radius: 50%; color: var(--band-ink);
    background: color-mix(in srgb, var(--band-ink) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--band-ink) 18%, transparent);
  }
}

/* ترحيب ما بعد التسجيل: لافتة الضيافة أعلى البطاقة */
.welcome-art { margin: calc(-1 * var(--auth-pt)) calc(-1 * var(--auth-px)) 0; aspect-ratio: 7 / 3; border-radius: var(--r) var(--r) 0 0; }
/* علامة رنينة في قرص يتداخل مع حافة اللافتة */
.welcome-mark {
  position: relative; z-index: 1; display: grid; place-items: center; width: 76px; height: 76px; margin: -38px auto 6px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 6px var(--surface), 0 10px 24px -12px color-mix(in srgb, var(--accent) 60%, transparent);
}
.welcome-mark .logo { width: 48px; height: 48px; }

/* الغلاف الافتراضي ولافتات الملتقيات */
.cover-art { position: absolute; inset: 0; }
.hub-banner { height: 140px; position: relative; overflow: hidden; }
.hub-hero-body .hub-ic-xl { position: relative; z-index: 1; }
.hub-banner-art { position: absolute; inset: 0; }
@media (max-width: 760px) { .hub-banner { height: 110px; } }

/* صفحة الخطأ: صورة مؤطرة فوق الرمز */
.error-art {
  width: min(520px, 100%); aspect-ratio: 16 / 9; margin: 0 auto 20px; border-radius: var(--r);
  outline: 1px solid color-mix(in srgb, var(--text) 8%, transparent); outline-offset: -1px;
}
.error-art .art-ic .i { width: 40px; height: 40px; }
.error-card { padding-top: 24px; }

/* عن رنينة: صورة المشاركة لافتةً أعلى البطاقة */
.about-card { overflow: hidden; }
.about-art { margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 20px; aspect-ratio: 76 / 30; }

@media (max-width: 760px) {
  .cta-band::before { background: color-mix(in srgb, var(--surface) 92%, transparent); }
  .hero-art-land { height: auto; }
  .land-art { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: var(--r-lg); outline: 0; }
  .cta-band { padding: 48px 18px; }
}

/* ==========================================================================
   الإعلانات الذكية (Google AdSense + بطاقات مقترحة غير متكررة) — app/Ads.php
   ========================================================================== */
.rn-ad {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px var(--pad); display: flex; flex-direction: column; gap: 8px;
}
.rn-ad-side { padding: 12px 14px; }
.rn-ad-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .76rem; color: var(--muted); }
.rn-ad-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; color: var(--muted);
}
.rn-ad-topic { font-size: .74rem; color: var(--muted); }
.rn-ad-body { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; text-decoration: none; color: var(--text); }
.rn-ad-body:hover { color: var(--text); }
.rn-ad-tx { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; }
.rn-ad-tx b { font-size: .98rem; font-weight: 700; color: var(--text); }
.rn-ad-tx p { margin: 0; font-size: .88rem; color: var(--text-2); line-height: 1.6; }
.rn-ad-slot { width: 100%; min-height: 90px; overflow: hidden; display: grid; place-items: center; }

/* ==========================================================================
   التشطيب: حركة هادئة، وضبط الجوال لما سبق
   ========================================================================== */
/* ظهور ناعم للمحتوى عند فتح الصفحة (شفافية فقط: لا تحريك ولا إزاحة تخطيط) */
.main, .bare-main { animation: page-in .26s var(--ease-out) backwards; }
@keyframes page-in { from { opacity: 0; } }
/* البطاقات القابلة للنقر: ترتفع ظلالها وحدودها تحت المؤشر */
.set-tile, .mini-hub, .trend-list a, .menu-item, .tabs a, .wall-chips a { transition: background-color var(--dur), color var(--dur); }
.hub-card, .person-card, .list-card, .sx-card { transition: border-color var(--dur), box-shadow var(--dur-2) var(--ease-out); }
.hub-card:hover, .person-card:hover, .list-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.notice .i { color: var(--accent); }
@media (max-width: 760px) {
  :root { --fs-h1: 1.5rem; }
  .hero-stats > span, .hero-stats > span:first-child { padding-inline: 16px; }
  .land-head { margin-bottom: 20px; }
  /* الميزات على الجوال: أيقونة بجانب النص بدل بطاقة طويلة لكل ميزة */
  .feature-grid { gap: 10px; }
  .feature { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; padding: 16px; align-items: start; }
  .feature-emo { grid-row: span 2; margin: 2px 0 0; }
  .feature h3 { margin-bottom: 2px; }
  .features { padding-top: 32px; }
  .auth { --auth-pt: 28px; --auth-px: 22px; padding-bottom: 24px; }
}
[data-motion="reduce"] .main, [data-motion="reduce"] .bare-main { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .main, .bare-main, :is(.empty-art, .error-art, .as-off-art).is-missing::before { animation: none; }
  .btn:active:not(:disabled), .icon-btn:active, .act:active { transform: none; }
}
