/* lexa-theme.css — هويّةُ ليكسا الموحّدة داخل المنصّة (بروحِ الصفحةِ الرئيسيّة وصفحةِ الدخول)
   ليلٌ نجديٌّ للإطار (القائمةُ الجانبيّة: حبرٌ داكن + نقشُ المثلّثات)، وورقٌ دافئٌ للمحتوى، ولونُ ليكسا الطينيّ للفعل.
   الأقسامُ تُعطي «ليكسا.» لونَ نقطتِها (LEXA_SECTION_ACCENT) — والإطارُ يقرأُ الصنفَ من data-section. */

:root {
  --lx-ink: #0d1412; --lx-ink2: #14201c; --lx-ink3: #1b2a25;
  --lx-sand: #efe7d6; --lx-sand2: #c9c2b3; --lx-mute: #8f9a94;
  --lx-clay: #c96442; --lx-clay-hi: #e07a52; --lx-clay-s: #f6e7df;
  --lx-paper: #faf8f3; --lx-paper2: #f3efe6; --lx-line: rgba(20,20,19,.09);
  --lx-accent: #c96442;
}

/* ── القائمة الجانبيّة ───────────────────────────────── */
.lx-side { background: #0a100e !important; border-left: 0 !important; position: relative; color: var(--lx-sand); }
.lx-side::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6; background:
  linear-gradient(135deg, transparent 48%, rgba(239,231,214,.03) 48% 52%, transparent 52%) 0 0/40px 40px,
  linear-gradient(45deg, transparent 48%, rgba(239,231,214,.03) 48% 52%, transparent 52%) 0 0/40px 40px,
  radial-gradient(420px 300px at 100% 0%, rgba(224,122,82,.14), transparent 70%); }
.lx-side > * { position: relative; }
.lx-side-head { border-bottom: 1px solid rgba(239,231,214,.08) !important; }
.lx-side-btn { background: rgba(239,231,214,.07) !important; color: var(--lx-sand2) !important; }
.lx-side-btn:hover { background: rgba(239,231,214,.14) !important; color: var(--lx-sand) !important; }
.lx-nav-label { color: rgba(239,231,214,.38) !important; }
.lx-side nav button { color: var(--lx-sand2) !important; position: relative; }
.lx-side nav button:hover { background: rgba(239,231,214,.07) !important; color: var(--lx-sand) !important; }
.lx-side nav button[data-active="true"] { background: rgba(224,122,82,.14) !important; color: #ffd9c7 !important; }
.lx-side nav button[data-active="true"]::after { content: ""; position: absolute; top: 8px; bottom: 8px; right: 0; width: 3px; border-radius: 3px; background: var(--lx-accent); }
.lx-side nav button[data-active="true"] svg { color: var(--lx-accent); }
.lx-side-user { border-top: 1px solid rgba(239,231,214,.08) !important; }
.lx-side-user > div > button:first-child { background: rgba(239,231,214,.05) !important; border-color: rgba(239,231,214,.1) !important; }
.lx-side-user > div > button:first-child:hover { background: rgba(239,231,214,.1) !important; }
.lx-side-user > div > button:first-child div { color: var(--lx-sand) !important; }
.lx-side-user > div > button:first-child div + div { color: var(--lx-mute) !important; }
.lx-side-user > div > button:first-child > svg { color: var(--lx-mute) !important; }
/* desk1: روابطُ ثانويّةٌ هادئةٌ أسفلَ القائمة (بدلَ بطاقةِ الترويج) — «تحديثات الأنظمة» · «من نحن» */
.lx-side-links { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px 8px; flex-shrink: 0; }
.lx-side-links button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 14px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font: 400 12.5px/1.5 'IBM Plex Sans Arabic', sans-serif; color: rgba(239,231,214,.5); text-align: right; transition: color .15s, background .15s; }
.lx-side-links button:hover { color: var(--lx-sand); background: rgba(239,231,214,.05); }
.lx-side-links button svg { width: 15px; height: 15px; flex-shrink: 0; }
.lx-side-links--mini button { justify-content: center; padding: 9px 0; }

/* ── الشريط العلويّ والمحتوى ─────────────────────────── */
.lx-topbar { background: rgba(15,23,21,.86) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(239,231,214,.08) !important; position: relative; z-index: 5; }
.lx-topbar-title { font-family: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', sans-serif !important; font-weight: 700 !important; letter-spacing: -.01em; }
.lx-topbar-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lx-accent); margin-inline-end: 9px; vertical-align: 2px; transition: background .4s; }
.lx-main { background: #0f1715; color: #efe7d6; }
html, body { background: #0f1715 !important; color-scheme: dark; }

/* ── لمساتٌ عامّة ──────────────────────────────────── */
::selection { background: rgba(201,100,66,.22); }
:focus-visible { outline: 2px solid var(--lx-clay); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: rgba(239,231,214,.16) transparent; }
input, textarea, select { color-scheme: dark; }
.lx-side * { scrollbar-color: rgba(239,231,214,.15) transparent; }

/* ══ وضعُ التطبيق (PWA) — html.lx-app: شاشةٌ ≤ 768px أو مُثبَّتٌ على جهازٍ لمسيّ ════════════════
   يُضبَطُ الوسمُ في رأسِ Platform.html قبل الرسم. سطحُ المكتب لا يتأثّرُ بشيءٍ ممّا يلي. */
:root { --lx-tabbar-h: 58px; --lx-tick-h: 34px; --lx-top-h: 52px;
        --lx-safe-t: env(safe-area-inset-top, 0px); --lx-safe-b: env(safe-area-inset-bottom, 0px); }

html.lx-app, html.lx-app body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* شريطُ حالةِ iOS الشفّاف (black-translucent): المحتوى يبدأ تحتَه */
html.lx-app #root { padding-top: var(--lx-safe-t); background: #0f1715; }
html.lx-app .lx-scroll { overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }

/* الشريطُ العلويّ: مضغوطٌ، والعلامةُ «ليكسا.» بنقطةِ لونِ القسم */
html.lx-app .lx-topbar { height: var(--lx-top-h) !important; padding: 0 14px !important; }
html.lx-app .lx-topbar-title { font-family: 'IBM Plex Sans Arabic', sans-serif !important; font-weight: 500 !important; }
html.lx-app .lx-topbar-title::before { width: 1px; height: 14px; border-radius: 0; background: rgba(239,231,214,.18); margin-inline: 2px 10px; vertical-align: -2px; }

/* المدخلاتُ ≥ 16px — لا تكبيرَ تلقائيّاً في iOS عند التركيز */
html.lx-app :is(input, textarea, select) { font-size: 16px; }
html.lx-app :is(input, textarea, select):is([style*="font-size: 1px"], [style*="font-size: 9"], [style*="font-size: 10"], [style*="font-size: 11"], [style*="font-size: 12"], [style*="font-size: 13"], [style*="font-size: 14"], [style*="font-size: 15"]) { font-size: 16px !important; }

/* لمسةُ الضغط */
html.lx-app button, html.lx-app [role="button"], html.lx-app a { touch-action: manipulation; }
html.lx-app button:active, html.lx-app [role="button"]:active { opacity: .78; transform: scale(.97); }

/* شريطُ التحديثِ الحيّ: أنحفُ، وفوقَ شريطِ التبويب مباشرة */
html.lx-app .lxt { height: var(--lx-tick-h); font-size: 12px; }
html.lx-app .lxt-lbl { padding: 0 10px; gap: 6px; }

/* ── شريطُ التبويبِ السفليّ ── */
.lx-tabbar { display: none; }
html.lx-app .lx-tabbar {
  display: flex; flex-shrink: 0; align-items: stretch; position: relative; z-index: 20;
  height: calc(var(--lx-tabbar-h) + var(--lx-safe-b)); padding: 0 6px var(--lx-safe-b);
  background: rgba(10,16,14,.97); border-top: 1px solid rgba(239,231,214,.08);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.lx-btab {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; cursor: pointer; position: relative; color: #8f9a94;
  font: 500 11px/1.2 'IBM Plex Sans Arabic', sans-serif; transition: color .18s;
}
.lx-btab-ico { display: flex; align-items: center; justify-content: center; width: 54px; height: 30px; border-radius: 15px; transition: background .2s, transform .15s; }
.lx-btab[data-active="true"] { color: #efe7d6; font-weight: 600; }
.lx-btab[data-active="true"] .lx-btab-ico { background: color-mix(in srgb, var(--lx-accent) 20%, transparent); color: var(--lx-accent); }
html.lx-app .lx-btab:active { transform: none; opacity: 1; }
html.lx-app .lx-btab:active .lx-btab-ico { transform: scale(.88); background: rgba(239,231,214,.08); }
.lx-btab-lbl { white-space: nowrap; }

/* ── زرُّ الدعم العائم: فوقَ الشريطين، ولوحتُه بعرضِ الشاشة ── */
html.lx-app .lx-support-fab {
  left: 14px !important; width: 46px !important; height: 46px !important; z-index: 900 !important;
  bottom: calc(var(--lx-tabbar-h) + var(--lx-tick-h) + var(--lx-safe-b) + 14px) !important;
}
html.lx-app:has(.lx-install:not(.lx-install--float)) .lx-support-fab { bottom: calc(var(--lx-tabbar-h) + var(--lx-tick-h) + var(--lx-safe-b) + 92px) !important; }
html.lx-app .lx-support-fab[data-open="true"] { display: none !important; }
html.lx-app .lx-support-panel { width: 100vw !important; max-width: none !important; padding-top: var(--lx-safe-t); padding-bottom: var(--lx-safe-b); }
/* في المساعد: صندوقُ الكتابةِ أسفلَ الشاشة — الدعمُ متاحٌ من «المزيد» */
html.lx-app body:has(.lx-shell[data-view="assistant"]) .lx-support-fab { display: none !important; }

/* ── الورقةُ السفليّة (المزيد / التثبيت) ── */
.lx-sheet-wrap { position: fixed; inset: 0; z-index: 7400; background: rgba(4,7,6,.62); display: flex; align-items: flex-end; justify-content: center;
  animation: lxFade .18s ease both; direction: rtl; }
/* au1: محصورٌ بورقة «المزيد» — كان يصطدمُ بـ.lx-sheet في قارئ الأنظمة (عرضُ النصّ 560px، والورقةُ شفّافة بلا تمرير) */
.lx-sheet-wrap > .lx-sheet {
  width: 100%; max-width: 560px; max-height: calc(100% - var(--lx-safe-t) - 28px); overflow-y: auto; overscroll-behavior: contain;
  background: #16211d; color: #efe7d6; border-radius: 22px 22px 0 0; border: 1px solid rgba(239,231,214,.08); border-bottom: 0;
  padding: 8px 14px calc(16px + var(--lx-safe-b)); box-shadow: 0 -18px 50px rgba(0,0,0,.45);
  font-family: 'IBM Plex Sans Arabic', sans-serif; animation: lxSheetUp .28s cubic-bezier(.16,1,.3,1) both;
}
@keyframes lxFade { from { opacity: 0 } }
@keyframes lxSheetUp { from { transform: translateY(100%) } }
.lx-sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: rgba(239,231,214,.2); margin: 2px auto 12px; }
.lx-sheet-title { font: 700 16px/1.4 'Noto Kufi Arabic', sans-serif; text-align: center; margin: 0 0 14px; }
.lx-acct { display: flex; align-items: center; gap: 12px; padding: 6px 4px 14px; }
.lx-acct-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lx-acct-txt b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-acct-txt small { font-size: 12px; color: #8f9a94; direction: ltr; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-chip { margin-inline-start: 6px; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: rgba(224,122,82,.16); color: #e07a52; vertical-align: 2px; }
.lx-group-lbl { font-size: 11px; font-weight: 700; color: rgba(239,231,214,.42); letter-spacing: .04em; padding: 12px 6px 6px; }
.lx-group { background: rgba(239,231,214,.035); border: 1px solid rgba(239,231,214,.07); border-radius: 14px; overflow: hidden; }
.lx-row {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 14px; border: 0; background: none; cursor: pointer;
  color: #efe7d6; text-align: right; font: 500 15px/1.4 'IBM Plex Sans Arabic', sans-serif;
}
.lx-row + .lx-row { border-top: 1px solid rgba(239,231,214,.06); }
html.lx-app .lx-row:active { transform: none; opacity: 1; background: rgba(239,231,214,.06); }
.lx-row-ico { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(239,231,214,.06); color: #c9c2b3; }
.lx-row-ico svg { width: 18px; height: 18px; }
.lx-row-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lx-row-txt small { font-size: 11.5px; color: #8f9a94; font-weight: 400; }
.lx-row-chev { color: rgba(239,231,214,.3); display: flex; }
.lx-row-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lx-accent, #c96442); }
.lx-row--danger { color: #ff8a8a; }
.lx-row--danger .lx-row-ico { background: rgba(255,138,138,.1); color: #ff8a8a; }
.lx-sheet-foot { text-align: center; font-size: 11.5px; color: #8f9a94; padding: 16px 0 2px; font-family: 'Noto Kufi Arabic', sans-serif; }
.lx-sheet-foot span { color: var(--lx-accent, #c96442); }

/* تعليماتُ التثبيت */
.lx-howto { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 4px 4px; }
.lx-howto img { border-radius: 16px; box-shadow: 0 6px 22px rgba(0,0,0,.4); }
.lx-howto ol { list-style: none; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.lx-howto li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(239,231,214,.04); font-size: 14px; line-height: 1.7; color: #c9c2b3; }
.lx-howto li b { color: #efe7d6; font-weight: 600; }
.lx-howto li > span { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(224,122,82,.16); color: #e07a52; font-weight: 700; font-size: 13px; }
.lx-btn-primary { width: 100%; padding: 13px; border: 0; border-radius: 12px; background: #c96442; color: #efe7d6; font: 600 15px 'IBM Plex Sans Arabic', sans-serif; cursor: pointer; }

/* بطاقةُ «ثبّت التطبيق» */
.lx-install {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin: 0 10px 8px; padding: 10px 10px 10px 8px;
  background: #1d2a25; border: 1px solid rgba(239,231,214,.1); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  direction: rtl; font-family: 'IBM Plex Sans Arabic', sans-serif; animation: lxSheetUp .35s cubic-bezier(.16,1,.3,1) both;
}
.lx-install--float { position: fixed; left: 0; right: 0; bottom: calc(10px + var(--lx-safe-b)); z-index: 7300; max-width: 520px; margin: 0 auto; width: calc(100% - 20px); }
.lx-install img { border-radius: 10px; flex-shrink: 0; }
.lx-install-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lx-install-txt b { font: 700 13.5px/1.5 'Noto Kufi Arabic', sans-serif; color: #efe7d6; }
.lx-install-txt small { font-size: 12px; line-height: 1.5; color: #c9c2b3; }
.lx-install-go { flex-shrink: 0; border: 0; border-radius: 10px; padding: 9px 13px; background: #c96442; color: #efe7d6; font: 600 13px 'IBM Plex Sans Arabic', sans-serif; cursor: pointer; white-space: nowrap; }
.lx-install-x { flex-shrink: 0; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(239,231,214,.07); color: #8f9a94; display: flex; align-items: center; justify-content: center; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .lx-sheet, .lx-sheet-wrap, .lx-install { animation: none; } }

/* ══ calm1 — وضعُ التطبيق أهدأ: شريطٌ سفليٌّ رفيع، لا زرَّ عائماً، لافتةُ تثبيتٍ نحيفة، رأسٌ بالعلامةِ وحدها ══════
   كلُّ ما يلي محصورٌ في html.lx-app (عدا أصنافٍ جديدةٍ لا وجودَ لها على سطح المكتب: .lx-upd*) */
html.lx-app { --lx-tabbar-h: 54px; }
html.lx-app .lx-topbar { box-shadow: none !important; background: #0f1715 !important; backdrop-filter: none; -webkit-backdrop-filter: none; }
html.lx-app .lx-topbar-title { display: none; }

/* شريطُ التبويب: أيقوناتٌ وتسمياتٌ صغيرة، والنشطُ لمسةٌ طينيّةٌ خفيفة — لا «حبّة» كبيرة */
html.lx-app .lx-tabbar { background: #0f1715; border-top: 1px solid rgba(239,231,214,.06); backdrop-filter: none; -webkit-backdrop-filter: none; padding-inline: 4px; }
html.lx-app .lx-btab { gap: 2px; color: #9a9384; font-size: 10.5px; font-weight: 500; }
html.lx-app .lx-btab-ico { width: 40px; height: 26px; border-radius: 13px; }
html.lx-app .lx-btab-ico svg { width: 21px; height: 21px; }
html.lx-app .lx-btab[data-active="true"] { color: #e07a52; font-weight: 600; }
html.lx-app .lx-btab[data-active="true"] .lx-btab-ico { background: rgba(224,122,82,.10); color: #e07a52; }
html.lx-app .lx-btab:active .lx-btab-ico { background: rgba(239,231,214,.06); }

/* لا زرَّ دعمٍ عائماً في وضع التطبيق (الدعمُ من «المزيد») */
html.lx-app .lx-support-fab:not([data-open="true"]) { display: none !important; }

/* «ثبّت التطبيق»: لافتةٌ نحيفةٌ تُغلَق، لا بطاقة */
html.lx-app .lx-install:not(.lx-install--float) { margin: 0; padding: 6px 12px; gap: 10px; border-radius: 0; border: 0; border-top: 1px solid rgba(239,231,214,.06);
  background: #16211d; box-shadow: none; animation: lxFade .25s ease both; }
html.lx-app .lx-install img { width: 24px; height: 24px; border-radius: 6px; }
html.lx-app .lx-install-txt { flex-direction: row; align-items: baseline; gap: 6px; overflow: hidden; }
html.lx-app .lx-install-txt b { font: 600 13px/1.4 'IBM Plex Sans Arabic', sans-serif; white-space: nowrap; }
html.lx-app .lx-install-txt small { font-size: 11.5px; color: #9a9384; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.lx-app .lx-install-go { padding: 5px 12px; border-radius: 99px; font-size: 12.5px; background: transparent; color: #e07a52; box-shadow: inset 0 0 0 1px rgba(224,122,82,.4); }
html.lx-app .lx-install-x { width: 26px; height: 26px; background: transparent; }

/* ورقةُ «المزيد»: حدودٌ أقلّ */
html.lx-app .lx-group { border: 0; background: rgba(239,231,214,.03); }
html.lx-app .lx-row + .lx-row { border-top-color: rgba(239,231,214,.045); }
html.lx-app .lx-row-ico { background: transparent; }

/* «التحديثات»: قائمةٌ بسيطة (بياناتُ /api/laws/latest) */
.lx-upd { display: flex; flex-direction: column; padding: 0 2px 4px; }
.lx-upd-ago { font-size: 11.5px; color: #9a9384; text-align: center; margin: -6px 0 8px; }
.lx-upd-h { font-size: 11.5px; font-weight: 700; color: rgba(239,231,214,.42); padding: 12px 4px 4px; }
.lx-upd-i { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: right; border: 0; background: none; cursor: pointer; padding: 11px 4px;
  font-family: 'IBM Plex Sans Arabic', sans-serif; color: #efe7d6; border-bottom: 1px solid rgba(239,231,214,.05); }
.lx-upd-i b { font-size: 14.5px; font-weight: 500; line-height: 1.6; }
.lx-upd-i small { font-size: 12px; color: #9a9384; }
.lx-upd-i small .soon { color: #e07a52; font-weight: 600; }
.lx-upd-empty { padding: 22px 8px; text-align: center; font-size: 13.5px; color: #9a9384; }

/* ══ إصلاحاتٌ عامّة قبل العرض (fx1) — تسري على كلّ الشاشات ══════════════════════════════ */

/* ① iOS: لا تكبيرَ تلقائيّاً عند التركيز — كلُّ حقلٍ ≥ 16px على الشاشاتِ الضيّقةِ واللمسيّة
      (حقولُ رمزِ التحقّقِ الكبيرة مستثناةٌ بالصنف .lx-otp-in لأنّها أكبرُ أصلاً) */
@media (max-width: 767px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not(.lx-otp-in),
  textarea, select { font-size: 16px !important; }
}

/* ② الكلماتُ الطويلة (روابط، أرقامُ مراسيم، نصوصٌ لاتينيّة) لا تدفعُ الصفحةَ أفقيّاً */
.lx-main, .lx-root, .lxa-card, .lx-support-panel, .lx-sheet { overflow-wrap: anywhere; }
html, body { max-width: 100%; overflow-x: hidden; }

/* ③ أدواتٌ تظهرُ بالمرورِ فقط → ظاهرةٌ دائماً على اللمس */
@media (hover: none) {
  .lx-art-act, .nb-acts { opacity: 1 !important; transform: none !important; }
}

/* ④ المناطقُ الآمنة (viewport-fit=cover): يمين/يسار الشاشة في الوضع الأفقيّ، وأسفلُها خارجَ وضعِ التطبيق */
#root { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
html:not(.lx-app) .lxt { height: calc(40px + env(safe-area-inset-bottom, 0px)) !important; padding-bottom: env(safe-area-inset-bottom, 0px); }
html:not(.lx-app) .lx-support-fab { bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important; }
.lx-support-panel { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ⑤ (أُزيل: الظلالُ صارت تدرّجاتٍ شفّافة — يبقى نصُّها رمليّاً كما تضبطُه lexa-notebook.jsx/MyFilesView.jsx) */

/* ⑥ طبقاتُ النوافذ والأدراج: سِتارٌ داكنٌ لا كريميّ */
.lx-sheet-wrap { background: rgba(5,10,8,.66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* ⑦ زرُّ الدعم العائم: لا يغطّي صندوقَ الكتابة في المساعد على أيِّ عرض (الدعمُ متاحٌ من القائمة) */
body:has(.lx-shell[data-view="assistant"]) .lx-support-fab:not([data-open="true"]) { display: none !important; }
/* لوحتُه المفتوحة على الهاتف بعرضِ الشاشة (خارجَ وضعِ التطبيق أيضاً) */
@media (max-width: 520px) {
  .lx-support-panel { width: 100vw !important; max-width: none !important; }
  .lx-support-fab[data-open="true"] { display: none !important; }
}

/* ⑧ شاشةُ التحميل (قبل أن يُركَّبَ React) */
.lx-boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #0f1715; color: #efe7d6; direction: rtl; z-index: 1; }
.lx-boot-mark { font: 700 clamp(44px, 9vw, 72px)/1 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', sans-serif; letter-spacing: -.01em; animation: lxBootPulse 1.6s ease-in-out infinite; }
.lx-boot-mark b { color: #c96442; }
.lx-boot-sub { font: 400 13px/1.6 'IBM Plex Sans Arabic', sans-serif; color: #8f9a94; }
@keyframes lxBootPulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .lx-boot-mark { animation: none; } }

/* ══ desk1 — سطحُ المكتب بروحِ التطبيق (html:not(.lx-app) فقط — وضعُ التطبيق لا يتأثّر) ══════════════════════
   أهدأ: لا وهجَ طينيّاً في القائمة، شريطٌ علويٌّ بلا زجاج، النوافذُ السفليّةُ تصيرُ نوافذَ في الوسط */
html:not(.lx-app) .lx-side::before { opacity: .35; background:
  linear-gradient(135deg, transparent 48%, rgba(239,231,214,.03) 48% 52%, transparent 52%) 0 0/40px 40px,
  linear-gradient(45deg, transparent 48%, rgba(239,231,214,.03) 48% 52%, transparent 52%) 0 0/40px 40px; }
html:not(.lx-app) .lx-side-head, html:not(.lx-app) .lx-side-user { border-color: rgba(239,231,214,.05) !important; }
html:not(.lx-app) .lx-side nav button[data-active="true"] { background: rgba(239,231,214,.07) !important; color: var(--lx-sand) !important; }
html:not(.lx-app) .lx-topbar { background: #0f1715 !important; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 1px 0 rgba(239,231,214,.05) !important; }
html:not(.lx-app) .lx-topbar-title { font-size: 15px !important; font-weight: 600 !important; }

/* ورقةُ «المستندات» و«التحديثات» على سطح المكتب: نافذةٌ في الوسط بدلَ ورقةٍ سفليّة */
html:not(.lx-app) .lx-sheet-wrap { align-items: center; padding: 24px; }
html:not(.lx-app) .lx-sheet-wrap > .lx-sheet { max-width: 520px; max-height: min(78vh, 720px); border-radius: 18px; border-bottom: 1px solid rgba(239,231,214,.08);
  padding: 18px 18px 16px; box-shadow: 0 24px 70px rgba(0,0,0,.5); animation: lxDeskPop .18s ease both; }
html:not(.lx-app) .lx-sheet-grip { display: none; }
/* زرُّ إغلاقٍ ظاهرٌ وعنوانُ «المستندات» — لسطح المكتب فقط (في التطبيق: سحبٌ/نقرٌ خارجَ الورقة كما كان) */
.lx-sheet-x, .lx-sheet-title--desk { display: none; }
html:not(.lx-app) .lx-sheet-wrap > .lx-sheet { position: relative; }
html:not(.lx-app) .lx-sheet-x { display: flex; position: absolute; top: 12px; left: 12px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  align-items: center; justify-content: center; background: transparent; color: #8f9a94; cursor: pointer; }
html:not(.lx-app) .lx-sheet-x:hover { background: rgba(239,231,214,.07); color: #efe7d6; }
html:not(.lx-app) .lx-sheet-title--desk { display: block; }
@keyframes lxDeskPop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { html:not(.lx-app) .lx-sheet-wrap > .lx-sheet { animation: none; } }

/* زرُّ الدعم العائم لا يظهرُ داخل المنصّة (الدعمُ من القائمة) — ولا نسختُه «إغلاق» بجانبِ اللوحةِ المفتوحة (لها زرُّ إغلاقٍ خاصّ) */
html:not(.lx-app) .lx-support-fab[data-open="true"] { display: none !important; }

/* ══ desk2 — محرّكُ البحث أهدأ على سطح المكتب: بلا لوحةٍ مزخرفة، اقتراحاتٌ أقلّ، والأرقامُ في الرئيسيّة وحدها ══ */
html:not(.lx-app) .lx-hero-dark { background: transparent !important; box-shadow: none !important; padding-top: 18px !important; }
html:not(.lx-app) .lx-hero-dark::before { display: none !important; }
html:not(.lx-app) .lx-hero-dark h1 { font-size: 26px !important; }
html:not(.lx-app) .lx-hero-dark p { font-size: 14px !important; }
html:not(.lx-app) .lx-hero-dark .lx-sfield { box-shadow: 0 0 0 1px rgba(239,231,214,.10) !important; }
html:not(.lx-app) .lx-hero-dark .lx-sfield:focus-within { box-shadow: 0 0 0 1px rgba(224,122,82,.55) !important; }
html:not(.lx-app) .lx-hero-dark .lx-chip { background: transparent !important; box-shadow: 0 0 0 1px rgba(239,231,214,.08) !important; color: #a8a69e !important; }
html:not(.lx-app) .lx-hero-dark .lx-chip:hover { background: transparent !important; box-shadow: 0 0 0 1px rgba(239,231,214,.22) !important; color: #efe7d6 !important; }
html:not(.lx-app) .lx-hero-dark .lx-chips .lx-chip:nth-child(n+7) { display: none; }
html:not(.lx-app) .lx-hero-dark .lx-stats-line { display: none; }
html:not(.lx-app) .lx-recent-strip { background: transparent !important; box-shadow: none !important; border-bottom: 1px solid rgba(239,231,214,.06); border-radius: 0 !important; }
html:not(.lx-app) .lx-cat { background: transparent !important; box-shadow: 0 0 0 1px rgba(239,231,214,.07) !important; }
html:not(.lx-app) .lx-cat:hover { box-shadow: 0 0 0 1px rgba(239,231,214,.2) !important; transform: none !important; }
html:not(.lx-app) .lx-cat .ic { font-size: 18px !important; opacity: .8; }

/* حركةٌ موحّدةٌ هادئة: من يفضّل تقليلَ الحركة لا يرى شيئاً منها */
@media (prefers-reduced-motion: reduce) {
  html:not(.lx-app) *, html:not(.lx-app) *::before, html:not(.lx-app) *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ══ calm2 — وضعُ التطبيق: حركةٌ أقلّ وأسرع ══════════════════════════════════════════════
   المحتوى (الشاشات، البطاقات، الرسائل) يظهرُ فوراً بلا حركةِ دخول؛ اللوحاتُ السفليّةُ تنزلقُ في 0.2ث فقط؛
   وشاشةُ التحميل ثابتةٌ بلا نبض (بعد شاشةِ البدءِ من النظام مباشرةً) */
html.lx-app .lxc, html.lx-app .hdc-wrap > *, html.lx-app .lxs-it, html.lx-app .lnd-rise, html.lx-app .lnd-steps span,
html.lx-app .lxa-card, html.lx-app [style*="fadeIn"], html.lx-app [style*="authScIn"] { animation: none !important; }
html.lx-app .lx-sheet-wrap > .lx-sheet, html.lx-app .lx-install, html.lx-app .lxas { animation-duration: .2s !important; }
html.lx-app .lx-sheet-wrap, html.lx-app .lxas-bd { animation-duration: .12s !important; }
html.lx-app .lx-boot-mark { animation: none; }
html.lx-app .lx-boot-sub { visibility: hidden; }
