/* =========================================================
   بوابة الفيزياء — ملف التنسيقات (تصميم "المخطط الهندسي")
   ---------------------------------------------------------
   الفكرة: ورق مخططات أزرق بشبكة خفيفة، وخطوط بيضاء رفيعة،
   ولون تمييز واحد فقط (الأصفر) يُستخدم للنتائج والعناصر النشطة.

   معاني الألوان (لا تُستخدم لغير معناها):
     --signal  أصفر  ← النتيجة، الإجابة، الزر الرئيسي، العنصر النشط
     --pos     وردي  ← الشحنة الموجبة (+)
     --neg     سماوي ← الشحنة السالبة (−)
     --ok/--bad      ← الإجابة الصحيحة / الخاطئة والتحذير فقط

   الترتيب: المتغيرات ← الأساسيات ← الشريط والقوائم ← القائمة الجانبية (الجوال)
            ← الصفحة الرئيسية ← لوحة الدرس ← الاختبار ← المعادلات
            ← مكونات الدروس ← الجداول ← الأشكال ← المحاكيات
            ← معاني كلاسات الألوان والأدوات المساعدة ← الشاشات الصغيرة
   ========================================================= */

:root {
    /* الورق والأسطح */
    --bg: #0B2747;            /* ورق المخطط */
    --bg-deep: #081D36;       /* الشريط العلوي والقوائم */
    --sheet: #0E3155;         /* لوحة الدرس */
    --screen: #071A30;        /* شاشات المحاكيات ومساحات الرسم */
    --inset: rgba(3, 14, 28, 0.38);
    --raise: rgba(255, 255, 255, 0.035);
    --hover: rgba(255, 255, 255, 0.06);

    /* الخطوط والشبكة */
    --line: rgba(214, 228, 243, 0.16);
    --line-strong: rgba(214, 228, 243, 0.36);
    --grid-minor: rgba(150, 190, 235, 0.06);
    --grid-major: rgba(150, 190, 235, 0.11);

    /* الحبر */
    --ink: #EAF1F8;
    --ink-soft: #C3D2E2;
    --ink-muted: #95ADC6;

    /* التمييز والمعاني */
    --signal: #FFC53D;
    --signal-hover: #FFD46E;
    --signal-ink: #0B2747;
    --signal-soft: rgba(255, 197, 61, 0.11);
    --pos: #FF8A80;
    --neg: #7CC7FF;
    --ok: #5FD39A;
    --bad: #FF7B7B;

    /* الخطوط (Fonts) */
    --font-display: 'Reem Kufi', 'Tajawal', sans-serif;
    --font-body: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Tajawal', ui-monospace, Menlo, monospace;

    /* المقاسات */
    --nav-h: 60px;
    --radius: 3px;
    --sheet-w: 1600px;        /* لوحة الدرس تملأ عرض الشاشة حتى هذا الحد */
    --shadow: 0 18px 40px rgba(2, 10, 22, 0.45);

    /* شبكة المخطط (طبقتان: مربعات صغيرة وكبيرة) */
    --grid-page:
        linear-gradient(var(--grid-major) 1px, transparent 1px) 0 0 / 120px 120px,
        linear-gradient(90deg, var(--grid-major) 1px, transparent 1px) 0 0 / 120px 120px,
        linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px) 0 0 / 24px 24px;
    --grid-fine:
        linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 16px 16px,
        linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px) 0 0 / 16px 16px;
}

/* =========================================================
   الأساسيات
   ========================================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
    background: var(--grid-page), var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
body.drawer-open { overflow: hidden; }

::selection { background: rgba(255, 197, 61, 0.35); color: #fff; }

/* خط العناوين (Reem Kufi) مسافاته بين الكلمات ضيقة، فنوسعها قليلاً */
.hero-text, .index-title, .lesson-title, .quiz-header h2, .drawer-title, :where(.lesson-content) h3 { word-spacing: 0.2em; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   الشريط العلوي والقوائم المنسدلة
   ========================================================= */
nav {
    position: fixed; top: 0; right: 0; left: 0; z-index: 1000;
    height: var(--nav-h);
    display: flex; justify-content: center; align-items: stretch;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--line);
}
.nav-container { display: flex; align-items: stretch; gap: 2px; list-style: none; height: 100%; }
.nav-item { position: relative; display: flex; }
.nav-link {
    position: relative; display: flex; align-items: center; gap: 8px;
    padding: 0 14px; color: var(--ink-soft); text-decoration: none;
    font-weight: 500; font-size: 0.98rem; white-space: nowrap;
    transition: color 0.15s, background-color 0.15s;
}
.nav-link::after {   /* خط سفلي يظهر عند المرور ويصبح أصفر للعنصر النشط */
    content: ""; position: absolute; right: 10px; left: 10px; bottom: -1px; height: 2px;
    background: var(--ink-muted); transform: scaleX(0); transition: transform 0.2s ease;
}
.nav-item:hover > .nav-link { color: var(--ink); background: var(--hover); }
.nav-item:hover > .nav-link::after { transform: scaleX(1); }
.nav-link.active { color: var(--ink); }
.nav-link.active::after { transform: scaleX(1); background: var(--signal); }
.nav-link svg { flex-shrink: 0; }

/* رابط الرئيسية: خط فاصل يميّزه عن الفصول */
.nav-home { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--line); }

/* شاشات الحاسوب الأصغر: مسافات أضيق لكي يتسع الشريط لعشرة عناصر */
@media (max-width: 1400px) {
    .nav-link { padding: 0 10px; font-size: 0.9rem; }
    .nav-home { margin-left: 4px; padding-left: 4px; }
}

/* القائمة الأولى (أقسام الفصل) */
.dropdown {
    position: absolute; top: 100%; right: 0; width: 240px;
    background: var(--bg-deep); border: 1px solid var(--line-strong); border-top-color: var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 8px; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.nav-item:hover .dropdown {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}
.dropdown-heading {
    font-size: 0.78rem; font-weight: 600; color: var(--ink-muted);
    padding: 2px 8px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.has-submenu { position: static; }   /* القائمة الفرعية تُحاذى مع أعلى القائمة الأولى */
.dropdown-item {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    color: var(--ink-soft); text-decoration: none; padding: 8px 10px; margin: 2px 0;
    border-radius: 2px; font-size: 0.9rem; transition: background-color 0.15s, color 0.15s;
}
.dropdown-item:hover { color: var(--ink); background: var(--hover); }
.dd-label { display: inline-flex; align-items: center; gap: 8px; }
.arrow { font-size: 0.65em; color: var(--ink-muted); transition: transform 0.15s; }
/* القائمة الفرعية تُفتح بكلاس open (يتحكم به js/app.js) بدلاً من :hover لمنع التبديل العرضي */
.has-submenu.open > .dropdown-item { color: var(--ink); background: var(--hover); box-shadow: inset -2px 0 0 var(--signal); }
.has-submenu.open .arrow { color: var(--signal); transform: translateX(-3px); }

/* الأقسام غير الجاهزة بعد */
.soon-badge {
    font-size: 0.68rem; line-height: 1.5; font-weight: 500; color: var(--ink-muted);
    border: 1px dashed var(--line-strong); border-radius: 2px; padding: 0 6px; white-space: nowrap;
}
.has-submenu.is-soon > .dropdown-item, .dropdown-item[data-soon] { color: var(--ink-muted); }
.has-submenu.is-soon .sub-dropdown-item { color: var(--ink-muted); }
.has-submenu.is-soon .sub-dropdown-item:hover { color: var(--ink-soft); border-right-color: var(--line-strong); }

/* القائمة الثانية (المواضيع) */
.sub-dropdown {
    position: absolute; top: -1px; right: 100%;
    width: 380px; max-height: calc(100vh - var(--nav-h) - 24px); overflow-y: auto;
    background: var(--bg-deep); border: 1px solid var(--line-strong); border-radius: var(--radius);
    padding: 8px; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden;
    transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}
.has-submenu.open .sub-dropdown { opacity: 1; visibility: visible; transition: opacity 0.15s ease, visibility 0s; }
.sub-dropdown-heading {
    font-size: 0.78rem; font-weight: 600; color: var(--ink-muted);
    padding: 2px 8px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.sub-dropdown-item {
    display: block; color: var(--ink-soft); text-decoration: none;
    padding: 7px 12px; margin: 2px 0; border-radius: 2px;
    font-size: 0.9rem; line-height: 1.6; border-right: 2px solid transparent;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.sub-dropdown-item:hover { color: var(--ink); background: var(--hover); border-right-color: var(--signal); }
.sub-dropdown-item.sub-item {   /* موضوع فرعي: يتفرع بخط متقطع كمخطط شجري */
    margin-right: 14px; padding-right: 12px; font-size: 0.84rem;
    color: var(--ink-muted); border-right: 1px dashed var(--line-strong);
}
.sub-dropdown-item.sub-item:hover { color: var(--ink); border-right: 1px solid var(--signal); }
/* في القسم الجاهز جزئياً: المواضيع المتاحة أوضح، وغير المتاحة باهتة */
.sub-dropdown-item[data-lesson] { color: var(--ink); font-weight: 500; }
.sub-dropdown-item[data-soon] { color: var(--ink-muted); }
.sub-dropdown-item.sub-item[data-lesson] { color: var(--ink-soft); font-weight: 400; }
.sub-dropdown-item.current { color: var(--signal); border-right-color: var(--signal); }

/* القائمة الفرعية تفتح لليمين عندما لا تتسع لها الشاشة على اليسار */
.has-submenu.open-right .sub-dropdown { right: auto; left: 100%; }
.has-submenu.open-right .arrow { transform: scaleX(-1); }
.has-submenu.open-right.open .arrow { transform: scaleX(-1) translateX(-3px); }

/* لوحة المفاتيح: التنقل بزر Tab يفتح القوائم */
.nav-item:has(:focus-visible) .dropdown { opacity: 1; visibility: visible; transform: none; transition: none; }
.has-submenu:has(:focus-visible) .sub-dropdown { opacity: 1; visibility: visible; transition: none; }

/* إغلاق القوائم مؤقتاً بعد اختيار درس */
nav.menus-closed .dropdown, nav.menus-closed .sub-dropdown { display: none; }

/* زر "الفصول" (يظهر على الشاشات الصغيرة فقط) */
.nav-toggle {
    display: none; align-items: center; gap: 8px;
    background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius);
    color: var(--ink); font-weight: 600; font-size: 0.92rem; padding: 0 14px; height: 38px;
}
.nav-toggle:hover { background: var(--hover); }

/* =========================================================
   القائمة الجانبية للجوال
   ========================================================= */
.drawer-backdrop {
    position: fixed; inset: 0; z-index: 1100; background: rgba(3, 12, 24, 0.6);
    opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0s linear 0.2s;
}
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1200;
    width: min(88vw, 380px); display: flex; flex-direction: column;
    background: var(--bg-deep); border-left: 1px solid var(--line-strong);
    transform: translateX(100%); visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
}
body.drawer-open .drawer { transform: none; visibility: visible; transition: transform 0.25s ease, visibility 0s; }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; transition: opacity 0.2s, visibility 0s; }
.drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: var(--nav-h); padding: 0 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.drawer-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.drawer-close {
    width: 38px; height: 38px; display: grid; place-items: center;
    background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink);
}
.drawer-body { overflow-y: auto; padding: 8px 0 24px; flex: 1; overscroll-behavior: contain; }
.dr-chapter { border-bottom: 1px solid var(--line); }
.dr-chapter > summary {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    cursor: pointer; list-style: none; font-weight: 600; color: var(--ink-soft);
}
.dr-chapter > summary::-webkit-details-marker { display: none; }
.dr-chapter > summary::after { content: "+"; margin-right: auto; font-family: var(--font-mono); color: var(--ink-muted); }
.dr-chapter[open] > summary::after { content: "−"; }
.dr-chapter[open] > summary { color: var(--ink); }
.dr-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-muted); min-width: 22px; }
.dr-chapter.is-ready .dr-num { color: var(--signal); }
.dr-topics { list-style: none; padding: 0 16px 14px; }
.dr-topic {
    display: block; padding: 9px 12px; color: var(--ink-soft); text-decoration: none;
    font-size: 0.92rem; line-height: 1.6; border-right: 2px solid var(--line); border-radius: 0 2px 2px 0;
}
a.dr-topic:hover, a.dr-topic:active { color: var(--ink); background: var(--hover); }
.dr-topic.sub { margin-right: 14px; font-size: 0.86rem; border-right-style: dashed; color: var(--ink-muted); }
.dr-topic.current { color: var(--signal); border-right-color: var(--signal); background: var(--signal-soft); }
.dr-topic.is-soon { color: var(--ink-muted); }
.dr-soon-note { padding: 0 16px 14px; color: var(--ink-muted); font-size: 0.85rem; }
.dr-note { margin: 16px 16px 0; padding: 12px; font-size: 0.85rem; color: var(--ink-muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* =========================================================
   الصفحة الرئيسية
   ========================================================= */
.home { display: block; padding-top: var(--nav-h); }

.hero {
    max-width: 1180px; margin: 0 auto; padding: 72px 32px 80px;
    display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 0.9rem; font-weight: 600; color: var(--ink-muted); margin-bottom: 18px;
}
.hero-eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--signal); }
.hero-text {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.15; color: var(--ink); margin: 0 0 18px;
}
.hero-sub { font-size: 1.2rem; line-height: 1.85; color: var(--ink-soft); max-width: 34ch; margin-bottom: 32px; }
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }

.hero-stats { display: flex; margin-top: 36px; border-top: 1px solid var(--line); padding-top: 18px; gap: 0; }
.hero-stats > div { flex: 1; padding-left: 16px; display: flex; flex-direction: column; justify-content: space-between; }   /* الأرقام على خط واحد وإن التفّ عنوان أحدها */
.hero-stats > div + div { padding-right: 16px; border-right: 1px solid var(--line); }
.hero-stats dt { font-size: 0.82rem; color: var(--ink-muted); }
.hero-stats dd { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 500; color: var(--ink); line-height: 1.3; }

/* رسم المتسعة الهندسي */
.hero-drawing { margin: 0; position: relative; }
.hero-drawing svg { display: block; width: 100%; height: auto; overflow: visible; direction: ltr; }
.hero-drawing figcaption {
    display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 10px;
    border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--ink-muted);
}
.hero-drawing figcaption span:first-child { font-family: var(--font-mono); }
.hd-plate { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.hd-hatch-fill { fill: url(#hd-hatch); pointer-events: none; }
.hd-hatch-line { stroke: var(--ink-muted); stroke-width: 1; }
.hd-wire { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; }
.hd-terminal { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; }
.hd-field { fill: none; stroke: var(--signal); stroke-width: 1.4; }
.hd-fringe { fill: none; stroke: var(--signal); stroke-width: 1.2; stroke-dasharray: 5 4; opacity: 0.75; }
.hd-arrowhead { fill: var(--signal); }
.hd-dim { fill: none; stroke: var(--ink-muted); stroke-width: 1; }
.hd-dim-head { fill: var(--ink-muted); }
.hd-center { fill: none; stroke: var(--ink-muted); stroke-width: 0.8; stroke-dasharray: 14 4 2 4; opacity: 0.7; }
.hd-text { fill: var(--ink-soft); font-family: var(--font-mono); font-size: 14px; }
.hd-var { fill: var(--ink); font-family: 'Times New Roman', serif; font-style: italic; font-size: 19px; }
.hd-pos { fill: var(--pos); font-family: var(--font-mono); font-size: 17px; font-weight: 500; }
.hd-neg { fill: var(--neg); font-family: var(--font-mono); font-size: 17px; font-weight: 500; }
.hd-box { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1; }
.hd-formula { fill: var(--ink); font-family: 'Times New Roman', serif; font-size: 17px; }
.hd-formula .i { font-style: italic; }

/* ظهور الرسم مرة واحدة عند التحميل */
.hd-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: hd-draw 1.1s ease-out forwards; animation-delay: var(--d, 0s); }
.hd-fade { opacity: 0; animation: hd-fade 0.6s ease-out forwards; animation-delay: var(--d, 0s); }
@keyframes hd-draw { to { stroke-dashoffset: 0; } }
@keyframes hd-fade { to { opacity: 1; } }

/* البحث */
.search-container { position: relative; width: 100%; max-width: 520px; display: flex; align-items: center; }
.search-input {
    width: 100%; height: 54px; padding: 0 18px 0 54px;
    background: var(--inset); border: 1px solid var(--line-strong); border-radius: var(--radius);
    color: var(--ink); font-family: var(--font-body); font-size: 1.05rem; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input::placeholder { color: var(--ink-muted); }
.search-input:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(255, 197, 61, 0.16); }
.search-btn {
    position: absolute; left: 6px; width: 42px; height: 42px; display: grid; place-items: center;
    background: transparent; border: none; border-radius: 2px; color: var(--ink-soft);
}
.search-btn:hover { color: var(--signal); background: var(--hover); }
.search-results {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 20;
    background: var(--bg-deep); border: 1px solid var(--line-strong); border-radius: var(--radius);
    padding: 6px; max-height: 320px; overflow-y: auto; display: none; box-shadow: var(--shadow);
}
.search-results.show { display: block; }
.search-result {
    display: block; width: 100%; text-align: right; background: transparent; border: none;
    border-right: 2px solid transparent; color: var(--ink); font-size: 1rem;
    padding: 9px 12px; border-radius: 2px; transition: background-color 0.15s;
}
.search-result:hover, .search-result:focus { background: var(--hover); border-right-color: var(--signal); outline: none; }
.search-result small { display: block; color: var(--ink-muted); font-size: 0.8rem; }
.search-empty { color: var(--ink-muted); padding: 10px 12px; }

/* فهرس الفصول */
.chapter-index { max-width: 1180px; margin: 0 auto; padding: 0 32px 96px; }
.index-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.index-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; }
.index-note { color: var(--ink-muted); font-size: 0.9rem; }
.index-list {   /* شبكة لوحات: الفواصل خطوط بعرض 1px */
    list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    background: var(--line); border: 1px solid var(--line);
}
.index-cell {
    display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 148px;
    padding: 20px 22px; background: var(--bg); color: var(--ink-soft); text-decoration: none;
    position: relative; transition: background-color 0.15s;
}
.ix-num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-muted); }
.ix-chapter { font-size: 0.85rem; color: var(--ink-muted); }
.ix-name { font-size: 1.2rem; font-weight: 700; color: var(--ink-soft); line-height: 1.5; }
.ix-meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--ink-muted); }
.ix-status { font-size: 0.75rem; border: 1px dashed var(--line-strong); border-radius: 2px; padding: 0 8px; white-space: nowrap; }
a.index-cell { background: var(--sheet); color: var(--ink); }
a.index-cell::before { content: ""; position: absolute; top: -1px; right: -1px; left: -1px; height: 3px; background: var(--signal); }
a.index-cell .ix-num, a.index-cell .ix-status { color: var(--signal); }
a.index-cell .ix-name { color: var(--ink); }
a.index-cell .ix-status { border: 1px solid var(--signal); }
a.index-cell:hover { background: #123A63; }
a.index-cell:hover .ix-status { background: var(--signal); color: var(--signal-ink); }

/* =========================================================
   لوحة الدرس
   ========================================================= */
#learning-area {
    display: none; min-height: 100vh;
    padding: calc(var(--nav-h) + 40px) 24px 64px;
    animation: fadeIn 0.35s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.lesson-panel {   /* إطار مزدوج مثل حدود لوحة الرسم الهندسي */
    max-width: var(--sheet-w); margin: 6px auto 30px;
    background: var(--sheet); border: 1px solid var(--line-strong);
    outline: 1px solid var(--line); outline-offset: 5px;
    padding: 44px 52px; box-shadow: var(--shadow);
}

/* مربع العنوان (مثل جدول بيانات اللوحة) */
.title-block { border: 1px solid var(--line-strong); margin-bottom: 40px; }
.lesson-title {
    font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; line-height: 1.45;
    color: var(--ink); padding: 18px 22px;
}
.tb-row { display: grid; grid-template-columns: 1fr 1.6fr auto; border-top: 1px solid var(--line-strong); }
.tb-cell { padding: 8px 14px; min-width: 0; }
.tb-cell + .tb-cell { border-right: 1px solid var(--line-strong); }
.tb-label { display: block; font-size: 0.72rem; color: var(--ink-muted); line-height: 1.6; }
.tb-value { display: block; font-size: 0.95rem; font-weight: 600; color: var(--ink-soft); line-height: 1.6; }
.tb-sheet .tb-value { white-space: nowrap; }
.tb-sheet .tb-value { font-family: var(--font-mono); color: var(--ink); direction: ltr; text-align: right; }
.tb-ruler { display: flex; gap: 3px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.tb-ruler span { flex: 1; height: 6px; border: 1px solid var(--line-strong); border-radius: 1px; }
.tb-ruler .done { background: var(--ink-muted); border-color: var(--ink-muted); }
.tb-ruler .current { background: var(--signal); border-color: var(--signal); }
.tb-ruler .soon { border-style: dashed; }

/* تبويبا الموضوع تحت مربع العنوان: «شرح وتبسيط» و«سين جيم» (ملتصقان بأسفل المربع) */
.section-tabs { display: flex; flex-wrap: wrap; margin: -41px 0 40px; border: 1px solid var(--line-strong); border-top: none; }
.section-tabs[hidden] { display: none; }
.st-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); text-decoration: none; border-left: 1px solid var(--line); }
a.st-tab:hover { color: var(--ink); background: var(--hover); }
.st-tab.active { background: var(--signal); color: var(--signal-ink); }
.st-tab.is-soon { color: var(--ink-muted); cursor: default; }
.st-tab small { font-size: 0.75rem; font-weight: 500; border: 1px dashed var(--line-strong); padding: 0 6px; border-radius: 2px; }
.st-count { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; opacity: 0.8; }

/* :where تجعل هذه القواعد بأقل أولوية، فتتغلب عليها كلاسات الألوان والمكونات */
.lesson-content { font-size: 1.125rem; line-height: 1.95; color: var(--ink-soft); margin-bottom: 40px; }
:where(.lesson-content) h3 {
    font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; line-height: 1.5;
    color: var(--ink); margin: 28px 0 12px;
}
:where(.lesson-content) h4 { font-size: 1.15rem; font-weight: 700; color: var(--ink); line-height: 1.6; }
:where(.lesson-content) h5 { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
:where(.lesson-content) b, :where(.lesson-content) strong { color: var(--ink); font-weight: 700; }
:where(.lesson-content) ul, :where(.lesson-content) ol { padding-right: 24px; margin-bottom: 20px; }
:where(.lesson-content) p { margin-bottom: 15px; }
:where(.lesson-content) li::marker { color: var(--ink-muted); }

.lesson-actions {
    display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap;
    border-top: 1px solid var(--line-strong); padding-top: 28px;
}

/* الأزرار */
.btn-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 46px; padding: 10px 20px; border-radius: var(--radius);
    font-family: var(--font-body); font-size: 1rem; font-weight: 600; line-height: 1.5;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn-action[hidden] { display: none; }
.btn-primary, .btn-quiz { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.btn-primary:hover, .btn-quiz:hover:not(:disabled) { background: var(--signal-hover); border-color: var(--signal-hover); }
.btn-next, .btn-prev { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-next:hover, .btn-prev:hover { border-color: var(--ink-soft); background: var(--hover); }
.btn-prev { color: var(--ink-soft); }
.btn-secondary { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-secondary:hover { background: var(--hover); color: var(--ink); }
.btn-secondary[hidden] { display: none; }

/* =========================================================
   الاختبار
   ========================================================= */
#quiz-area { display: none; }
.quiz-header {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
    padding-bottom: 16px; margin-bottom: 28px; border-bottom: 1px solid var(--line-strong);
}
.quiz-header h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; line-height: 1.3; }
.quiz-lesson { font-size: 0.9rem; color: var(--ink-muted); margin-top: 4px; }
.quiz-progress { font-size: 0.9rem; font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.question-text { font-size: 1.35rem; font-weight: 600; line-height: 1.8; color: var(--ink); margin-bottom: 24px; }

@counter-style abjad { system: alphabetic; symbols: "أ" "ب" "ج" "د" "هـ" "و"; suffix: ""; }
.options-grid { display: grid; gap: 10px; counter-reset: option; }
.option-btn {
    display: flex; align-items: center; gap: 14px; width: 100%;
    background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius);
    color: var(--ink-soft); padding: 13px 16px; font-size: 1.08rem; line-height: 1.7; text-align: right;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.option-btn::before {   /* ترقيم الخيارات: أ ب ج د */
    counter-increment: option; content: counter(option, abjad);
    flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center;
    border: 1px solid var(--line-strong); border-radius: 2px; font-size: 0.9rem; font-weight: 600; color: var(--ink-muted);
}
.option-btn:hover:not(:disabled) { border-color: var(--ink-soft); background: var(--hover); color: var(--ink); }
.option-btn:disabled { cursor: default; }
.option-btn.correct { border-color: var(--ok); background: rgba(95, 211, 154, 0.1); color: var(--ink); }
.option-btn.correct::before { border-color: var(--ok); background: var(--ok); color: var(--signal-ink); }
.option-btn.wrong { border-color: var(--bad); background: rgba(255, 123, 123, 0.1); color: var(--ink); }
.option-btn.wrong::before { border-color: var(--bad); background: var(--bad); color: var(--signal-ink); }
.explanation-box {
    margin-top: 22px; padding: 16px 18px; border-radius: var(--radius);
    font-size: 1.05rem; line-height: 1.8; color: var(--ink-soft); display: none; animation: fadeIn 0.25s ease-out;
}
.explanation-box b { display: inline-block; margin-bottom: 2px; }
.explanation-box.show-correct { display: block; background: rgba(95, 211, 154, 0.08); border-right: 3px solid var(--ok); }
.explanation-box.show-correct b { color: var(--ok); }
.explanation-box.show-wrong { display: block; background: rgba(255, 123, 123, 0.08); border-right: 3px solid var(--bad); }
.explanation-box.show-wrong b { color: var(--bad); }
.quiz-navigation {
    margin-top: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    border-top: 1px solid var(--line-strong); padding-top: 22px;
}
.nav-buttons-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* رسالة منبثقة (Toast) */
.toast {
    position: fixed; bottom: 28px; left: 50%; z-index: 2000; max-width: calc(100vw - 32px);
    transform: translateX(-50%) translateY(12px);
    background: var(--bg-deep); color: var(--ink); border: 1px solid var(--line-strong);
    border-right: 3px solid var(--signal); border-radius: var(--radius);
    padding: 12px 20px; font-size: 0.98rem; line-height: 1.7; box-shadow: var(--shadow);
    opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   المعادلات (KaTeX)
   ========================================================= */
.katex { direction: ltr; unicode-bidi: isolate; font-size: 1.05em; }
:is(h3, h4) .katex { white-space: nowrap; }   /* المعادلة القصيرة في العنوان لا تنقسم بين سطرين */
.katex-display { margin: 0.6em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 4px; direction: ltr; }   /* ltr: المعادلة العريضة تُمرَّر أفقياً بدل أن يُقص طرفها الأيمن، والحشوة الجانبية تستوعب بروز الأدلة السفلية */
.eq { color: var(--ink); }                   /* معادلة مستقلة في سطرها */
.eq.lg { font-size: 1.25em; }
.formula-box {                               /* القانون الرئيسي داخل إطار مزدوج */
    color: var(--ink); background: var(--inset);
    border: 1px solid var(--line-strong); outline: 1px solid var(--line); outline-offset: 3px;
    border-radius: 2px; padding: 10px 26px;
    width: max-content; max-width: calc(100% - 8px); margin: 24px auto; font-size: 1.35em;
}
.formula-box .katex-display { margin: 0; }
.formula-box.law-box { width: auto; max-width: 900px; font-size: 1.12rem; line-height: 1.9; text-align: center; padding: 14px 24px; }   /* نص قانون (كلمات لا معادلة) */
.law { color: var(--ink); margin: 0 10px; } /* قانون داخل السطر */
.en { white-space: nowrap; unicode-bidi: isolate; direction: ltr; }   /* مصطلح إنجليزي داخل نص عربي: لا ينقسم بين سطرين */
.ref { white-space: nowrap; }                                          /* مرجع شكل مثل 12-a (يضيفه app.js تلقائياً) */
.val { color: var(--ink); border-bottom: 1.5px solid rgba(255, 197, 61, 0.75); padding-bottom: 1px; } /* قيمة معطاة */

/* =========================================================
   مكونات الدروس
   (كلاسات accent-* مقبولة في المحتوى لكنها تُعرض بنمط موحّد هادئ)
   ========================================================= */

/* قائمة القواعد المرقمة في بداية كل درس */
.rule-list { list-style: none; padding: 0; margin-bottom: 0; }
:where(.lesson-content) .rule-list { padding-right: 0; }
.rule-list > li { padding: 14px 0; border-top: 1px dashed var(--line); }
.rule-list > li:first-child { border-top: none; padding-top: 0; }
.rule-title { display: block; color: var(--ink); font-weight: 700; font-size: 1.12rem; margin-bottom: 4px; }
.rule-list.divided { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-strong); }
.rule-list > li.highlight {
    background: var(--signal-soft); border: none; border-right: 3px solid var(--signal);
    padding: 14px 16px; margin: 6px 0; border-radius: 0 2px 2px 0;
}
.inner-list { margin-top: 8px; color: var(--ink-soft); }

/* شرح على اليمين ومحاكي على اليسار */
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 20px; }

/* مخطط شجري: عنصر رئيسي يتفرع إلى فرعين (مثل: قوة لورنتز ← القوة الكهربائية + المغناطيسية) */
.tree { margin: 28px 0 32px; text-align: center; }
.tree-root {
    position: relative; display: inline-block; padding: 8px 22px;
    background: var(--inset); border: 1px solid var(--line-strong); border-radius: 2px;
    font-weight: 700; color: var(--ink);
}
.tree-root::after { content: ""; position: absolute; top: 100%; left: 50%; height: 18px; border-left: 1px solid var(--line-strong); }
.tree-branches { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 36px; text-align: right; }
.tree-branches::before { content: ""; position: absolute; top: -18px; right: 25%; left: 25%; border-top: 1px solid var(--line-strong); }
.tree-branches > * { position: relative; margin: 0; }
.tree-branches > *::before { content: ""; position: absolute; bottom: 100%; right: 50%; height: 17px; border-right: 1px solid var(--line-strong); }
.tree-branches.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tree-branches.three::before { right: 16.66%; left: 16.66%; }

/* مخطط تدفق عمودي: خطوات متتالية بأسهم، ويمكن أن يتفرع ثم يلتقي
   <div class="flow"> .flow-step ... .flow-fork .flow-split(خطوتان) .flow-merge .flow-step </div> */
.flow { display: flex; flex-direction: column; align-items: center; margin: 28px 0 32px; }
.flow-step {
    position: relative; width: min(100%, 420px); padding: 10px 16px; text-align: center;
    background: var(--inset); border: 1px solid var(--line-strong); border-radius: 2px; color: var(--ink); line-height: 1.8;
}
.flow > .flow-step + .flow-step { margin-top: 28px; }
.flow > .flow-step + .flow-step::before { content: ""; position: absolute; bottom: 100%; left: 50%; height: 28px; border-left: 1px solid var(--line-strong); }
.flow > .flow-step:not(:first-child)::after, .flow-split > .flow-step::after {
    content: ""; position: absolute; top: -7px; left: calc(50% - 5px);
    border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--line-strong);
}
.flow-step.result { border-color: var(--signal); background: var(--signal-soft); font-weight: 700; }
.flow-fork, .flow-merge { position: relative; width: min(100%, 760px); height: 28px; }
.flow-fork::before { content: ""; position: absolute; top: 0; left: 50%; height: 14px; border-left: 1px solid var(--line-strong); }
.flow-fork::after { content: ""; position: absolute; top: 14px; left: 25%; right: 25%; height: 14px; border: 1px solid var(--line-strong); border-bottom: none; }
.flow-merge::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 14px; border: 1px solid var(--line-strong); border-top: none; }
.flow-merge::after { content: ""; position: absolute; top: 14px; left: 50%; height: 14px; border-left: 1px solid var(--line-strong); }
.flow-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; width: min(100%, 760px); }
.flow-split > .flow-step { width: 100%; }
/* مساران متوازيان بخطوات متقابلة (مثل مخطط حل مسائل العازل): .flow.two ثم .flow-split.rows
   العناصر بالترتيب صفاً صفاً (يمين ثم يسار)، فتتساوى ارتفاعات الخطوات المتقابلة */
.flow-split.rows { row-gap: 24px; }
.flow-split.rows > .flow-step:nth-child(n+3)::before { content: ""; position: absolute; bottom: 100%; left: 50%; height: 24px; border-left: 1px solid var(--line-strong); }
.flow-step.branch { border-color: var(--signal); background: var(--signal-soft); font-weight: 700; }
.flow-step .fs-t { display: block; color: var(--ink-soft); font-size: 0.92em; margin-bottom: 2px; }
.flow-step .fs-up { font-size: 0.85em; color: var(--signal); font-weight: 700; }
.flow-step .fs-l { display: block; line-height: 1.5; padding: 3px 0; }
.flow-step .fs-l + .fs-l { margin-top: 4px; }

/* حلقة مغلقة (تغذية راجعة): خطوات متتالية ثم سهم يعود من الأخيرة إلى الأولى
   <div class="cycle"> أربع .flow-step </div>  (و class="cycle three" لثلاث خطوات) */
.cycle { position: relative; display: flex; gap: 36px; margin: 28px 0 32px; padding-bottom: 30px; }
.cycle > .flow-step { flex: 1; width: auto; }   /* بلا flex داخل الخطوة: حتى لا ينفصل النص عن المعادلة */
.cycle > .flow-step + .flow-step::before { content: ""; position: absolute; top: 50%; left: 100%; width: 36px; border-top: 1px solid var(--line-strong); }
.cycle > .flow-step + .flow-step::after {
    content: ""; position: absolute; top: calc(50% - 5px); left: 100%;
    border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 7px solid var(--line-strong);
}
.cycle::before { content: ""; position: absolute; bottom: 8px; left: 12%; right: 12%; height: 22px; border: 1px solid var(--line-strong); border-top: none; }
.cycle::after {
    content: ""; position: absolute; bottom: 23px; right: calc(12% - 5px);
    border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 7px solid var(--line-strong);
}
.cycle.three::before { left: 16%; right: 16%; }
.cycle.three::after { right: calc(16% - 5px); }

/* أعمدة متجاورة لأي عناصر (بطاقات مثلاً): تتحول لعمود واحد تلقائياً على الشاشات الضيقة */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; margin-bottom: 28px; }
.cols > * { margin-bottom: 0; }
.cols.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.lc-cycle { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lc-cycle > .fig-panel { min-width: 0; }
.lc-cycle svg { width: 100%; max-width: 150px; height: auto; margin-inline: auto; display: block; }
@media (max-width: 700px) { .lc-cycle { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* عناوين الأقسام */
/* :where(h3) يبقي الأولوية منخفضة لكي تعمل معها أدوات الهوامش مثل mt-0 و mt-lg */
:where(h3).section { margin: 32px 0 18px; }
:where(h3).divider { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
:where(h3).underlined { margin-top: 30px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* بطاقة شرح */
.card {
    background: var(--raise); border: 1px solid var(--line);
    border-right: 2px solid var(--line-strong);
    border-radius: var(--radius); padding: 24px; margin-bottom: 28px;
}
.card > h4, .card > h3 { color: var(--ink); margin: 0 0 14px; font-size: 1.22rem; }
.card > h3 { font-size: 1.35rem; }
.card.compact { padding: 18px; margin-bottom: 0; }
.card ul:last-child, .card p:last-child { margin-bottom: 0; }

/* خطوات حل المثال: خط عمودي يربط المراحل */
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }   /* minmax(0) يمنع المعادلات الطويلة من توسيع العمود */
.steps.wide-gap { gap: 28px; }
.step {
    position: relative; background: var(--raise);
    border: 1px solid var(--line); border-right: 2px solid var(--ink-muted);
    border-radius: var(--radius); padding: 16px 20px;
}
.step.roomy { padding: 22px 24px; }
.step > h4 { color: var(--ink); margin: 0 0 10px; font-size: 1.12rem; }
.step.roomy > h4 { font-size: 1.25rem; margin-bottom: 14px; }
.step h5 { color: var(--ink); margin: 20px 0 8px; font-size: 1.05rem; }
.step h5:first-of-type { margin-top: 10px; }

/* نص المسألة */
.problem {
    background: var(--inset); padding: 20px 22px; border-radius: var(--radius);
    border: 1px solid var(--line); border-right: 2px solid var(--ink-soft); margin-bottom: 22px;
}
.problem > p:first-child { font-size: 1.1rem; line-height: 1.95; color: var(--ink); }
.problem ol { margin-right: 20px; color: var(--ink-soft); line-height: 1.9; margin-bottom: 20px; }
.problem ol:last-child { margin-bottom: 0; }

/* صندوق إبراز (ملاحظة / إجابة) */
.callout {
    background: var(--signal-soft); border-right: 3px solid var(--signal);
    padding: 14px 18px; border-radius: 0 2px 2px 0; margin: 20px 0; color: var(--ink);
}
.callout-title { color: var(--signal); font-weight: 700; }
.callout.thin { border-right-width: 2px; }
.callout.warn { background: rgba(255, 123, 123, 0.07); border-right-color: var(--bad); }   /* تحذير: نتيجة مستحيلة أو خاطئة */
.callout.warn .callout-title { color: var(--bad); }

/* إجابة مخفية تظهر عند الضغط (للأسئلة وفكّر) */
.reveal { margin-top: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.reveal > summary { display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer; list-style: none; color: var(--signal); font-weight: 600; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary::before { content: "+"; font-family: var(--font-mono); }
.reveal[open] > summary::before { content: "−"; }
.reveal > :not(summary) { padding: 0 14px; }
.reveal > :last-child:not(summary) { padding-bottom: 12px; margin-bottom: 0; }

/* قسم «سين جيم» */
.qa-intro { margin-bottom: 28px; }
.qa-lead { color: var(--ink-soft); line-height: 1.9; margin: 0 0 16px; }
.qa-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.qa-tools .sp-modes { margin: 0; flex: 0 1 420px; }
.qa-n { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; opacity: 0.75; }
.qa-toggle { min-height: 40px; padding: 8px 16px; }
.qa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.qa-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--raise); padding: 18px 20px; }
.qa-item[hidden] { display: none; }
.qa-item.is-min { border-right: 3px solid var(--signal); }
.qa-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.qa-num { font-family: var(--font-mono); font-weight: 600; color: var(--signal); margin-left: 4px; }
.qa-tag { font-size: 0.8rem; font-weight: 600; color: var(--ink); padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 2px; }
.qa-badge { font-size: 0.78rem; line-height: 1.7; padding: 1px 8px; border-radius: 2px; }
.qa-badge.min { color: var(--signal); background: var(--signal-soft); border: 1px solid rgba(255, 197, 61, 0.35); }
.qa-badge.book { color: var(--ink-muted); border: 1px dashed var(--line-strong); }
.qa-q { color: var(--ink); font-weight: 600; line-height: 1.95; }
.qa-opts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 6px 16px; font-weight: 500; }
.qa-opts li { color: var(--ink-soft); }
.qa-opt-l { font-family: var(--font-mono); color: var(--ink-muted); margin-left: 4px; }
.qa-alt { color: var(--ink-muted); font-size: 0.88rem; line-height: 1.8; margin: 8px 0 0; }
.qa-answer { margin-top: 12px; }
.qa-a { color: var(--ink-soft); line-height: 1.9; }
.qa-a > :first-child { margin-top: 12px; }
.qa-a ol, .qa-a ul { margin-bottom: 0; }
.qa-a .figure { margin: 12px auto; }
.qa-a .table-wrap { margin: 12px 0; }
.qa-empty { color: var(--ink-muted); text-align: center; padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* الحل المشروح خطوة بخطوة (أجوبة «سين جيم» الحسابية والفكرية) */
.sol > * + * { margin-top: 14px; }
.sol-answer {
    display: table; margin: 0; padding: 6px 14px; color: var(--ink); font-weight: 600;
    background: var(--signal-soft); border: 1px solid rgba(255, 197, 61, 0.4); border-right: 3px solid var(--signal); border-radius: 2px;
}
.sol-answer-l { color: var(--signal); margin-left: 6px; }
.sol-opt { font-family: var(--font-mono); font-weight: 600; }
.sol-given { margin: 0; padding: 2px 12px 2px 0; border-right: 2px solid var(--line-strong); color: var(--ink-soft); }
.sol-given b, .sol-part { color: var(--ink); }
.sol-part { margin: 0; font-weight: 700; padding-bottom: 6px; border-bottom: 1px dashed var(--line-strong); }
.sol-part + .sol-steps, .sol-part + .figure { margin-top: 12px; }
.sol-steps { list-style: none; margin: 0; padding: 0; counter-reset: sol-st; display: flex; flex-direction: column; gap: 12px; }
.sol { counter-reset: sol-st; }                 /* ترقيم الخطوات متصل في الحل كله حتى مع تقسيمه إلى أجزاء */
.sol .sol-steps { counter-reset: none; }
.sol-steps > li { counter-increment: sol-st; position: relative; padding-right: 36px; min-height: 26px; }
.sol-steps > li::before {
    content: counter(sol-st); position: absolute; right: 0; top: 4px; width: 24px; height: 24px;
    display: grid; place-items: center; border: 1px solid var(--signal); border-radius: 50%;
    color: var(--signal); background: var(--raise); font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; line-height: 1;
}
.sol-steps > li:not(:last-child)::after {   /* خط رفيع يصل أرقام الخطوات */
    content: ""; position: absolute; right: 12px; top: 30px; bottom: -10px; border-right: 1px solid var(--line-strong);
}
.sol-steps > li > p { margin: 0; }
.sol p .katex { white-space: nowrap; }   /* لا تنكسر المعادلة القصيرة داخل السطر بين سطرين */
.sol-steps b { color: var(--ink); }
.sol-steps .katex-display { margin: 0.35em 0 0; }
.sol-tip { margin: 0; padding: 8px 12px; border: 1px dashed rgba(255, 197, 61, 0.5); border-radius: 2px; font-size: 0.95em; }
.sol-tip b { color: var(--signal); }
.sol .figure { margin: 12px auto 0; }
/* صناديق المسألة المفصّلة: المعطيات والمطلوب والجواب النهائي، وتلوين معادلة الناتج */
.sol-kw { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.sol-box { margin: 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--inset); }
.sol-box-h { margin: 0 0 6px; font-weight: 700; color: var(--ink); font-size: 0.92em; }
.sol-box-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--ink-soft); }
.sol-box-list > li { position: relative; padding-right: 14px; }
.sol-box-list .katex { white-space: nowrap; }   /* لا تنقسم الكمية مع وحدتها بين سطرين */
.sol-box-list > li::before { content: ""; position: absolute; right: 2px; top: 0.75em; width: 5px; height: 5px; border-radius: 50%; background: var(--signal); }
.sol-box.final { border-color: rgba(255, 197, 61, 0.45); border-right: 3px solid var(--signal); background: var(--signal-soft); }
.sol-box.final .sol-box-h { color: var(--signal); }
.sol-box.final .sol-box-list { color: var(--ink); font-weight: 600; }
.eq.res { color: var(--signal); }
/* صناديق شرح المسألة: نفهم المسألة، وخطة الحل (القوانين ولماذا)، وماذا تعني النتيجة */
.sol-note { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--raise); }
.sol-note > p:not(.sol-box-h) { margin: 0; }
.sol-note.understand { border-right: 3px solid var(--ink-muted); }
.sol-note.plan { border-right: 3px solid var(--pos); }
.sol-note.meaning { border-right: 3px solid var(--ok); }
.sol-plan { margin: 0; padding-right: 20px; display: flex; flex-direction: column; gap: 6px; }
.sol-plan .katex, .sol-note .katex { white-space: nowrap; }
.sol-warn { border-color: rgba(255, 107, 107, 0.55); }
.sol-warn b { color: var(--bad); }

/* قسم «أسئلة الفصل»: أسئلة نهاية الفصل ومسائله بترقيم الكتاب */
.chq-group + .chq-group { margin-top: 40px; }
.chq-group[hidden] { display: none; }
.chq-title {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
    margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--signal);
    color: var(--ink); font-size: 1.2rem;
}
.chq-title small { color: var(--ink-muted); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; }
.chq-parts { list-style: none; margin: 4px 0 0; padding: 0; }
.chq-part { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.chq-part[hidden] { display: none; }
.chq-pn {
    font-family: var(--font-mono); font-weight: 700; color: var(--signal);
    min-width: 26px; padding: 0 6px; text-align: center; line-height: 1.7;
    border: 1px solid var(--signal); border-radius: 2px;
}
.qa-badge.topic { color: var(--ink-soft); border: 1px solid var(--line); text-decoration: none; }
.qa-badge.topic:hover, .qa-badge.topic:focus-visible { color: var(--signal); border-color: var(--signal); }
.qa-q .figure { margin: 14px auto 0; font-weight: 400; }
.chq-panels { gap: 12px; }
.chq-panels > .fig-panel { flex: 1 1 140px; min-width: 120px; }
.chq-panels .fig-caption { margin-top: 8px; font-family: var(--font-mono); }
.dr-chq {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin: 6px 16px 14px; padding: 10px 12px; text-decoration: none; font-weight: 600; color: var(--ink);
    background: var(--signal-soft); border: 1px solid rgba(255, 197, 61, 0.45); border-radius: var(--radius);
}
.dr-chq small { color: var(--ink-muted); font-family: var(--font-mono); font-weight: 400; font-size: 0.78rem; }
.dr-chq.current { border-color: var(--signal); box-shadow: inset -3px 0 0 var(--signal); }
.dropdown-item.current .dd-label { color: var(--signal); }
.dr-tabs { margin: 8px 16px 12px; }
.dr-tabs .sp-mode { padding: 8px 4px; font-size: 0.92rem; }

/* قسم «محاكيات»: المحاكي مع شرحه وقراءته المباشرة ومناقشة نتائجه
   على الحاسوب: الشرح يميناً والمحاكي يساراً ثابتاً في مكانه أثناء القراءة (مثل الدروس) */
.sg-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 22px; }
.sg-chips-label { font-size: 0.82rem; color: var(--ink-muted); margin-left: 6px; }
.sg-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
    font-size: 0.85rem; line-height: 1.7; color: var(--ink-soft); text-decoration: none;
    border: 1px solid var(--line-strong); border-radius: 2px;
}
a.sg-chip:hover, a.sg-chip:focus-visible { color: var(--ink); background: var(--hover); }
.sg-chip.current { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 700; }
.sg-chip-n { font-family: var(--font-mono); font-size: 0.76rem; opacity: 0.8; }
.sg-idea, .sg-summary { line-height: 1.95; }
.sg-idea { margin: 0 0 28px; }
.sg-shared { margin: -16px 0 24px; font-size: 0.92rem; color: var(--ink-muted); line-height: 1.9; }
.sg-shared a { color: var(--signal); }
.sg-summary { margin: 36px 0 0; }
.sg-idea .callout-title, .sg-summary .callout-title { display: block; margin-bottom: 4px; }
.sg-idea .eq { margin-top: 6px; }

.sg-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.sg-layout.is-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.sg-text { grid-column: 1; grid-row: 1; min-width: 0; }
.sg-sim-col {
    grid-column: 2; grid-row: 1; min-width: 0;
    position: sticky; top: calc(var(--nav-h) + 16px); z-index: 3;
    max-height: calc(100vh - var(--nav-h) - 32px); overflow-y: auto; scrollbar-width: thin;
    display: flex; flex-direction: column; gap: 14px;
}
.sg-sim-col .sim-panel { position: static; margin: 0; }
/* محاكيات عريضة (الفصل الثاني، layout: 'top'): المحاكي وقراءته في الأعلى بعرض الصفحة، والشرح تحتهما */
.sg-layout.is-top { grid-template-columns: minmax(0, 1fr); }
.sg-layout.is-top .sg-sim-col { grid-column: 1; grid-row: 1; position: static; max-height: none; overflow: visible; }
.sg-layout.is-top .sg-text { grid-column: 1; grid-row: 2; }
@media (min-width: 1101px) {
    .sg-layout.is-top .sg-sim-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: 20px; }
}
/* مختبرات الفصل السادس (layout: 'full'): المختبر بتخطيطه «شاشة واحدة» (.lx) بعرض الصفحة كله، ثم قراءته المباشرة، ثم الشرح */
.sg-layout.is-full { grid-template-columns: minmax(0, 1fr); }
.sg-layout.is-full .sg-sim-col { grid-column: 1; grid-row: 1; position: static; max-height: none; overflow: visible; }
.sg-layout.is-full .sg-text { grid-column: 1; grid-row: 2; }

/* القراءة المباشرة تحت المحاكي */
.sg-live { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--inset); padding: 14px 16px; }
.sg-live-title {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 12px;
    font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: var(--signal);
}
.sg-live-title small { font-size: 0.76rem; font-weight: 500; color: var(--ink-muted); }
.sg-live-body { font-size: 0.98rem; line-height: 1.85; color: var(--ink-soft); }
.sg-live-body > * + * { margin-top: 10px; }
.sg-live-body .sol-steps { gap: 10px; }
.sg-live-body .katex-display { margin: 0.25em 0 0; }
.sg-vals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); gap: 6px; margin: 0; }
.sg-vals > div { min-width: 0; padding: 4px 9px; background: var(--raise); border: 1px solid var(--line); border-radius: 2px; }
.sg-vals dt { font-size: 0.76rem; line-height: 1.6; color: var(--ink-muted); }
.sg-vals dd { margin: 0; text-align: right; font-family: var(--font-mono); font-weight: 500; font-size: 0.95rem; color: var(--ink); overflow-wrap: anywhere; }
.sg-vals .sig dd { color: var(--signal); }
.sg-vals .bad { border-color: rgba(255, 123, 123, 0.5); }
.sg-vals .bad dd { color: var(--bad); }
.sg-say { margin: 0; }
.sg-say.ok { color: var(--ok); }
.sg-say.bad { color: var(--ink); padding: 8px 12px; background: rgba(255, 123, 123, 0.08); border-right: 3px solid var(--bad); }
.sg-say.hint { color: var(--ink-muted); font-size: 0.9rem; }

/* أقسام الشرح: كيف تستعمل، مناقشة النتائج، جرّب وتوقّع، حدود المحاكي */
.sg-sec + .sg-sec { margin-top: 36px; }
.sg-h {
    display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding-bottom: 8px;
    border-bottom: 1px solid var(--line-strong);
}
.sg-h-n {
    flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 2px;
    background: var(--signal); color: var(--signal-ink); font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
}
.sg-lead { color: var(--ink-muted); margin: -4px 0 12px; font-size: 0.95em; }
.sg-use { margin: 0; }
.sg-use > div { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 2fr); gap: 2px 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.sg-use > div:first-child { padding-top: 0; }
.sg-use dt { color: var(--ink); font-weight: 700; }
.sg-use dd { margin: 0; }
.sg-results, .sg-try { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.sg-results { counter-reset: sg-r; }
.sg-results > li {
    counter-increment: sg-r; position: relative; padding: 14px 52px 14px 16px;
    background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius);
}
.sg-results > li::before {
    content: counter(sg-r); position: absolute; top: 14px; right: 14px; width: 26px; height: 26px;
    display: grid; place-items: center; border: 1px solid var(--signal); border-radius: 50%;
    color: var(--signal); font-family: var(--font-mono); font-size: 0.85rem; line-height: 1;
}
.sg-res-t { margin: 0 0 4px; font-size: 1.08rem; line-height: 1.7; color: var(--ink); }
.sg-see { margin: 6px 0 0; }
.sg-why { margin-top: 6px; }
.sg-k { font-weight: 700; color: var(--signal); margin-left: 4px; }
.sg-why .katex-display, .sg-try-a .katex-display { margin: 0.3em 0; }
.sg-why .table-wrap { margin: 10px 0; }
.sg-table { font-size: 0.92rem; }
.sg-table td, .sg-table th { text-align: center; }
.sg-try { counter-reset: sg-t; }
.sg-try > li { counter-increment: sg-t; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.sg-try-q::before { content: "تجربة " counter(sg-t) ": "; color: var(--signal); font-weight: 700; }
.sg-try-q { color: var(--ink); }
.sg-try .reveal { margin-top: 10px; }
.sg-try-a { padding-bottom: 4px; }
.sg-limits { margin: 0; padding-right: 20px; }
.sg-limits li + li { margin-top: 8px; }
.sg-limits li::marker { color: var(--ink-muted); }
.sg-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 0.9rem; color: var(--ink-muted); }

/* لغز / تحدي: إطار متقطع */
.puzzle {
    position: relative; background: transparent;
    border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 24px; margin-top: 40px;
}
.puzzle.soft-glow, .puzzle.no-glow { /* أسماء قديمة: لم يعد هناك توهج */ }
:where(.puzzle) .puzzle-title { color: var(--ink); margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
h4.puzzle-title { font-size: 1.25rem; }
.puzzle-icon { font-size: 1.35rem; }

/* بطاقة عريضة (نص + محاكي) */
.feature-card {
    background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; margin-bottom: 30px;
    display: flex; flex-wrap: wrap; gap: 30px; align-items: center;
}
.feature-text { flex: 1; min-width: min(100%, 300px); }
.feature-text > h3 { margin: 0 0 14px; font-size: 1.4rem; }

/* بلاطات متجاورة (حالات / قوانين) */
.tiles { display: flex; gap: 18px; flex-wrap: wrap; margin: 30px 0; }
.tiles.flush { margin-top: 0; }
.tile {
    flex: 1; min-width: min(100%, 250px); background: var(--raise);
    border: 1px solid var(--line); border-top: 2px solid var(--ink-muted);
    border-radius: var(--radius); padding: 20px;
}
.tile > h3, .tile > h4 { color: var(--ink); margin: 0 0 10px; font-size: 1.22rem; }
.tile.slim { background: var(--raise); }
.tile.side { min-width: min(100%, 200px); padding: 14px 16px; border: 1px solid var(--line); border-right: 2px solid var(--ink-muted); }
.tile.side > b:first-child { color: var(--ink); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; margin-bottom: 40px; }
.tile-grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 22px; }
.tile-icon { font-size: 2.2rem; text-align: center; margin-bottom: 12px; }
.tile-grid .tile > h3 { font-size: 1.22rem; margin-bottom: 14px; }
.tile-grid .tile.centered > h3 { text-align: center; }
.tile-grid .tile p, .tile-grid .tile li { color: var(--ink-soft); line-height: 1.85; font-size: 1.05rem; }
.tile ul.disc { list-style: disc; margin-right: 20px; padding: 0; }
.tile ul.plain { list-style: none; padding: 0; line-height: 1.85; }
.tile ul.plain li { margin-bottom: 8px; }

/* قائمة صناديق (أهداف / حالات) */
.box-list { list-style: none; padding: 0; line-height: 1.85; margin-bottom: 0; }
:where(.lesson-content) .box-list { padding-right: 0; }
.box-list > li { margin-bottom: 12px; background: var(--raise); border: 1px solid var(--line); padding: 14px 16px; border-radius: var(--radius); }
.box-list > li:last-child { margin-bottom: 0; }
.box-list > li[class*="accent-"] { border-right: 2px solid var(--ink-muted); }
.box-list.spaced > li { margin-bottom: 22px; }
.box-list.lit > li { margin-bottom: 10px; }
.box-title { color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.box-title.lg { font-size: 1.18rem; }

/* قوائم عامة */
.plain-list { list-style: none; padding: 0; line-height: 1.85; }
:where(.lesson-content) .plain-list, :where(.lesson-content) .law-list { padding-right: 0; }
.spaced-list { margin-right: 20px; line-height: 1.85; margin-bottom: 15px; }
.disc-list { list-style: disc; margin-right: 20px; color: var(--ink-soft); line-height: 1.85; }
.law-list { list-style: none; padding: 0; line-height: 2; margin-bottom: 0; }
.law-list > li { margin-bottom: 10px; }
.law-list > li:last-child { margin-bottom: 0; }
.circle-list { list-style: circle; margin-right: 20px; color: var(--ink-soft); margin-top: 5px; margin-bottom: 0; }
.inner-list.indent { margin-right: 20px; }

/* عناصر صغيرة مساعدة */
.pill {
    display: inline-block; color: var(--ink); background: var(--inset); border: 1px solid var(--line-strong);
    padding: 4px 14px; border-radius: 2px; margin: 0 10px; font-size: 1.2em;
}
.eq-line { display: inline-block; margin-top: 5px; color: var(--ink); }
.dark-box { background: var(--inset); border: 1px solid var(--line); padding: 14px; border-radius: var(--radius); margin-top: 20px; text-align: center; }
.dark-box.tight { padding: 10px; }
.dark-box.left { text-align: right; }
.banner { background: var(--inset); border: 1px solid var(--line); color: var(--ink); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 20px; }
.formula-pair { background: var(--inset); border: 1px solid var(--line); padding: 14px; border-radius: var(--radius); margin-top: 10px; color: var(--ink); }
.formula-pair > div + div { margin-top: 12px; }
.math-row { text-align: center; margin-top: 15px; background: var(--inset); border: 1px solid var(--line); padding: 10px; border-radius: var(--radius); color: var(--ink); font-size: 1.15em; }
.check-note { color: var(--ink-muted); font-size: 0.9rem; text-align: center; margin: 15px 0 0; border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.table-note { margin-top: -15px; margin-bottom: 30px; }

/* صناديق صغيرة متجاورة */
.mini-row { display: flex; gap: 16px; flex-wrap: wrap; }
.mini { flex: 1; min-width: min(100%, 220px); background: var(--inset); border: 1px solid var(--line); padding: 14px; border-radius: var(--radius); }
.mini.center { text-align: center; padding: 10px; }
.mini.edge { border-right: 2px solid var(--ink-muted); padding: 18px; min-width: min(100%, 250px); }
.mini h5 { color: var(--ink); margin-bottom: 10px; font-size: 1.08rem; }
.mini ul { list-style: none; padding: 0; color: var(--ink-soft); line-height: 1.85; margin: 0; }

/* صندوق حساب */
.calc { display: flex; flex-direction: column; align-items: center; background: var(--inset); border: 1px solid var(--line); padding: 14px; border-radius: var(--radius); margin-top: 15px; }
.calc-label { color: var(--ink-muted); font-size: 0.9rem; }
.boxed-result { text-align: center; padding: 10px; background: var(--inset); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.alert-box { text-align: center; padding: 14px; border-radius: var(--radius); margin-top: 15px; border: 1px dashed var(--bad); background: rgba(255, 123, 123, 0.06); }

/* =========================================================
   الجداول: خلايا بحدود كاملة مثل جداول المخططات
   ========================================================= */
.table-wrap { overflow-x: auto; margin-bottom: 30px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; text-align: right; font-size: 1.02rem; }
.data-table.nowrap-math .katex { white-space: nowrap; }   /* مدى قيم مثل 100 − 600 V لا ينقسم */
.data-table thead tr { background: var(--inset); }
.data-table th, .data-table td { border: 1px solid var(--line); }
.data-table tr > :first-child { border-right: none; }
.data-table tr > :last-child { border-left: none; }
.data-table thead tr:first-child > * { border-top: none; }
.data-table tbody tr:last-child > * { border-bottom: none; }
.data-table thead th { border-bottom: 1px solid var(--line-strong); }
:where(.data-table) th { padding: 12px 14px; color: var(--ink); font-weight: 700; }
.data-table td { padding: 12px 14px; color: var(--ink-soft); }
.data-table td small { display: block; color: var(--ink-muted); font-size: 0.85rem; }
.data-table th small { display: block; font-size: 0.8rem; font-weight: 500; color: var(--ink-muted); }
.data-table td.key { font-weight: 700; color: var(--ink); background: rgba(255, 255, 255, 0.02); }
.data-table .note { font-size: 0.95rem; }

/* =========================================================
   الأشكال التوضيحية (SVG): مساحة رسم بشبكة دقيقة
   ========================================================= */
.figure {
    background: var(--grid-fine), var(--screen);
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    padding: 20px; margin-bottom: 25px; text-align: center;
}
.figure svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.fig-board { background: transparent; }
.fig-row { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.fig-row > .fig-panel { flex: 1; min-width: min(100%, 250px); }
.fig-row.tight { gap: 12px; }
.fig-row.tight > .fig-panel { min-width: min(100%, 90px); }   /* رسوم صغيرة متجاورة داخل بطاقة */
.fig-row.tight.two > .fig-panel { min-width: min(100%, 170px); }   /* رسمان: متجاوران على الشاشة العريضة، وأحدهما فوق الآخر على الجوال */
.fig-row.panels > .figure { flex: 1; min-width: min(100%, 300px); margin-bottom: 0; }
.fig-subtitle { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 10px; line-height: 1.6; }
.fig-subtitle .tag { color: var(--ink-muted); font-family: var(--font-mono); }
.fig-caption {
    display: inline-block; margin-top: 16px; padding: 2px 12px;
    border: 1px solid var(--line-strong); border-radius: 2px;
    color: var(--ink); font-weight: 600; font-size: 0.95rem;
}
.fig-note { color: var(--ink-muted); font-size: 0.85rem; margin-top: 6px; }
.problem .figure { margin-top: 20px; }
.problem .figure:last-child { margin-bottom: 0; }

/* عناصر الرسم داخل SVG */
.wire { stroke: var(--ink-soft); stroke-width: 2; fill: none; }
.wire.light { stroke: var(--ink); }
.wire.cyan { stroke: var(--signal); }
.plate-pos { stroke: var(--pos); stroke-width: 4; }
.plate-neg { stroke: var(--neg); stroke-width: 4; }
.plate-plain { stroke: var(--ink); stroke-width: 4; }
.bat-pos { stroke: var(--ink); stroke-width: 4; }
.bat-neg { stroke: var(--ink-muted); stroke-width: 3; }
.bat-thin { stroke: var(--ink); stroke-width: 2; }
.bat-thick { stroke: var(--ink); stroke-width: 5; }
.halo { paint-order: stroke; stroke: var(--screen); stroke-width: 4px; stroke-linejoin: round; }
.dielectric { fill: rgba(255, 197, 61, 0.8); }
.dielectric.cyan { fill: rgba(255, 197, 61, 0.16); stroke: var(--signal); }
.t-label { fill: var(--ink); font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.t-ar { fill: var(--ink-soft); font-family: var(--font-body); font-size: 12px; }
.t-amber { fill: var(--signal); }
.t-red { fill: var(--pos); }                 /* إشارات الشحنة الموجبة */
.t-cyan { fill: var(--neg); }                /* إشارات الشحنة السالبة */
.t-label.t-red { fill: var(--signal); }      /* قيمة (مثل ΔV) وليست شحنة */
.t-muted { fill: var(--ink-muted); }
.t-dark { fill: var(--signal-ink); }
.meter-face { fill: var(--bg-deep); stroke: var(--ink-muted); stroke-width: 3; }
.meter-arc { fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-dasharray: 2 3; }
.meter-needle { stroke: var(--signal); stroke-width: 2; stroke-linecap: round; }
.bulb { fill: rgba(255, 197, 61, 0.16); stroke: var(--signal); stroke-width: 2; }
.bulb-filament { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.resistor { fill: var(--screen); stroke: var(--ink); stroke-width: 1.5; }
/* عناصر رسم عامة للأشكال الجديدة */
.fig-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.fig-solid { fill: var(--screen); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.fig-thin { fill: none; stroke: var(--ink-muted); stroke-width: 1; }
.fig-accent { fill: none; stroke: var(--signal); stroke-width: 2; }
.fig-field { fill: none; stroke: var(--signal); stroke-width: 1.5; stroke-dasharray: 3 2; }
.fig-arrowhead { fill: var(--ink-soft); }
/* متجهات وقوى وجسيمات (الفصل الثاني) */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }   /* تعريفات الأسهم المشتركة لأشكال الدرس */
.fig-vec { stroke: var(--ink); stroke-width: 2; fill: none; }               /* السرعة */
.fig-vec.soft { stroke: var(--ink-soft); }                                   /* المجال B */
.fig-force { stroke: var(--signal); stroke-width: 2.5; fill: none; }        /* القوة */
.fig-fieldline { stroke: var(--ink-muted); stroke-width: 1.2; fill: none; } /* خطوط المجال */
.fig-path { stroke: var(--ink-soft); stroke-width: 1.8; stroke-dasharray: 6 4; fill: none; }  /* مسار الجسيم */
.ah-ink { fill: var(--ink); }
.ah-soft { fill: var(--ink-soft); }
.ah-muted { fill: var(--ink-muted); }
.ah-signal { fill: var(--signal); }
.q-pos { fill: var(--screen); stroke: var(--pos); stroke-width: 2; }
.q-neg { fill: var(--screen); stroke: var(--neg); stroke-width: 2; }
.t-vec { fill: var(--ink); font-family: 'Times New Roman', serif; font-weight: 700; font-style: italic; font-size: 16px; }
.t-vec.sig { fill: var(--signal); }
.t-sub { font-size: 11px; }
.fig-tag { fill: var(--screen); stroke: var(--line-strong); stroke-width: 1; }
.fig-tag.sig { stroke: var(--signal); }
.fig-display { fill: #04101F; stroke: var(--line-strong); stroke-width: 1; }
.fig-digits { fill: var(--ink-muted); font-family: var(--font-mono); font-size: 18px; font-weight: 500; }
.fig-digits.on { fill: var(--signal); }
.mag-n { fill: rgba(234, 241, 248, 0.16); }
.fig-area { fill: rgba(255, 197, 61, 0.14); stroke: var(--ink); stroke-width: 2.5; }   /* سطح (مساحة) مظلل */
.fig-wind { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; }      /* لفات ملف */
.fig-needle { stroke: var(--signal); stroke-width: 2.5; stroke-linecap: round; }   /* مؤشر جهاز قياس */
.fig-needle.zero { stroke: var(--ink-soft); }
.fig-needle.ghost { stroke-dasharray: 3 3; opacity: 0.6; }
.fig-dot { fill: var(--ink-muted); }                                        /* مجال نحو خارج الصفحة */
.fig-shade { fill: rgba(255, 197, 61, 0.1); }                              /* مساحة مظللة (تتراكب فتغمق) */
.area-vec { stroke-width: 2.6; }                                            /* متجه المساحة */
.bind-vec { stroke: var(--signal); stroke-width: 4; fill: none; }          /* المجال المغناطيسي المحتث */
.eddy { fill: none; stroke: var(--signal); stroke-width: 1.6; }            /* مسار تيار دوامي */
.eddy.thin { stroke-width: 1.1; opacity: 0.75; }
.plate-sheet { fill: rgba(234, 241, 248, 0.1); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }   /* صفيحة فلزية رقيقة */
.pend-plate { fill: rgba(234, 241, 248, 0.18); stroke: var(--ink); stroke-width: 1.5; }   /* صفيحة بندول */
.slot { fill: var(--bg-deep); }                                             /* شق في صفيحة مقطعة */
.curve-phi { fill: none; stroke: var(--ink-soft); stroke-width: 2; }       /* منحنى الفيض */
.curve-emf { fill: none; stroke: var(--signal); stroke-width: 2.4; }       /* منحنى القوة الدافعة أو التيار */
.avg-line { stroke: var(--signal); stroke-width: 1.5; stroke-dasharray: 2 4; }   /* خط القيمة المتوسطة */
.q-dot { fill: var(--signal); }                                            /* علامة على أحد جانبي الملف */
.force-dot { fill: var(--signal); }                                       /* قوة نحو خارج الصفحة */
.core-cyl { fill: rgba(234, 241, 248, 0.07); stroke: var(--ink-muted); stroke-width: 1; }   /* قلب أسطواني لملف */
.head-core { fill: none; stroke: var(--ink-muted); stroke-width: 8; stroke-linejoin: round; opacity: 0.8; }   /* قلب رأس قراءة */
.water { fill: rgba(150, 190, 235, 0.16); }                                 /* ماء داخل إناء */
.pot-base { fill: rgba(234, 241, 248, 0.3); stroke: var(--ink); stroke-width: 1.5; }   /* قاعدة إناء معدني */
.glass-pot { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 5 3; }   /* إناء زجاجي */
.cooktop { fill: rgba(234, 241, 248, 0.08); stroke: var(--ink-muted); stroke-width: 1; }   /* السطح العلوي للطباخ */
.core-bar { fill: var(--ink-muted); opacity: 0.55; }                     /* قلب حديدي داخل ملف */
.coil-ring { fill: rgba(255, 197, 61, 0.08); stroke: var(--ink); stroke-width: 4; }   /* ملف دائري مائل */
.coil-band { fill: var(--screen); stroke: var(--ink-soft); stroke-width: 1.5; }   /* ملف ملفوف على قلب */
.closed-surface { fill: rgba(255, 197, 61, 0.06); stroke: var(--signal); stroke-width: 1.8; stroke-dasharray: 6 4; }
.rain { stroke: var(--ink-muted); stroke-width: 1.6; stroke-linecap: round; }
.rain.hit { stroke: var(--signal); }
.rain-frame { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }

/* =========================================================
   المحاكيات (المحتوى يولده js/sims.js)
   مثل "أجهزة قياس": شاشة داكنة بشبكة، وأرقام بخط ثابت العرض
   ========================================================= */
.sim-panel, .sim-wide, .sim-inline, .sim-showcase {
    background: var(--grid-fine), var(--screen);
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    padding: 24px; text-align: center;
}
.sim-panel { position: sticky; top: calc(var(--nav-h) + 20px); z-index: 3; }   /* فوق الرسوم المتحركة (.mo-fig) التي تمر تحته */
.lesson-content > .sim-panel { position: static; }   /* محاكٍ بعرض الدرس (لا بجانب نص): لا يُثبَّت، وإلا غطّى بقية الدرس كلها أثناء التمرير */
.sim-wide { margin: 40px 0; }
.sim-inline { flex: 1; min-width: min(100%, 280px); padding: 20px; }
.sim-showcase { margin: 40px auto; max-width: 600px; padding: 28px; }

.sim-title {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    color: var(--ink); font-weight: 700;
    font-size: 1.05rem; line-height: 1.6; margin-bottom: 20px;
}
.sim-title::before {   /* مؤشر "جهاز يعمل" */
    content: ""; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%;
    background: var(--signal); box-shadow: 0 0 0 3px rgba(255, 197, 61, 0.18);
}
.sim-title.center { text-align: center; }
.sim-label { color: var(--ink-soft); font-size: 0.98rem; display: block; margin-bottom: 10px; }
.sim-label .sim-range { display: block; margin: 12px auto 0; }
.sim-range { width: 90%; }
.sim-caption { color: var(--ink-muted); font-size: 0.88rem; margin-top: 14px; line-height: 1.8; }
.sim-note { color: var(--ink-muted); font-size: 0.82rem; margin: 0; line-height: 1.8; }
.sim-meters { display: flex; justify-content: space-around; gap: 8px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 14px; }
.sim-meters span { font-size: 0.85rem; color: var(--ink-muted); }
.sim-meters b, .sim-readout { direction: ltr; unicode-bidi: isolate; font-family: var(--font-mono); font-weight: 500; font-size: 1.2rem; color: var(--ink); }

/* شريط التمرير الموحد لكل المحاكيات */
:is(.sim-panel, .sim-wide, .sim-inline, .sim-showcase) input[type="range"] {
    -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer;
    accent-color: var(--signal);
}
:is(.sim-panel, .sim-wide, .sim-inline, .sim-showcase) input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--line-strong); border-radius: 2px; }
:is(.sim-panel, .sim-wide, .sim-inline, .sim-showcase) input[type="range"]::-moz-range-track { height: 4px; background: var(--line-strong); border-radius: 2px; }
:is(.sim-panel, .sim-wide, .sim-inline, .sim-showcase) input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px;
    background: var(--signal); border: 3px solid var(--screen); border-radius: 50%; box-shadow: 0 0 0 1px var(--signal);
}
:is(.sim-panel, .sim-wide, .sim-inline, .sim-showcase) input[type="range"]::-moz-range-thumb {
    width: 12px; height: 12px; background: var(--signal); border: 3px solid var(--screen); border-radius: 50%; box-shadow: 0 0 0 1px var(--signal);
}
:is(.sim-panel, .sim-wide, .sim-inline, .sim-showcase) input[type="range"]:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }

/* محاكي التجاذب (درس 1-2) */
.pa-stage { display: flex; justify-content: center; align-items: center; gap: 44px; margin: 24px 0; position: relative; height: 180px; }
.pa-plate {
    width: 22px; height: 100%; border-radius: 2px; display: flex; flex-direction: column;
    justify-content: space-evenly; align-items: center; font-family: var(--font-mono); font-weight: 500;
    transition: background-color 0.2s ease;
}
.pa-plate.pos { border: 2px solid var(--pos); color: var(--pos); font-size: 1.2rem; }
.pa-plate.neg { border: 2px solid var(--neg); color: var(--neg); font-size: 1.4rem; }
.pa-field { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 140px; display: flex; flex-direction: column; justify-content: space-evenly; opacity: 0; transition: opacity 0.2s ease; }
.pa-line { height: 1.5px; background: var(--signal); width: 100%; position: relative; }
.pa-line span { position: absolute; right: -6px; top: -10px; color: var(--signal); font-size: 0.8rem; }

/* محاكي الخزانات (درس 1-3) */
.wt-stage { display: flex; justify-content: space-around; align-items: flex-end; height: 190px; margin-bottom: 20px; border-bottom: 2px solid var(--line-strong); padding-bottom: 6px; }
.wt-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.wt-tank { height: 130px; border: 2px solid var(--ink-muted); border-top: none; position: relative; display: flex; align-items: flex-end; background: var(--raise); border-radius: 0 0 2px 2px; overflow: hidden; }
.wt-tank.narrow { width: 24px; }   /* عرض الخزانين بنسبة 1:5 مثل نسبة سعتيهما في المحاكي */
.wt-tank.wide { width: 120px; }
.wt-water {   /* تظليل مائل مثل "المقطع" في الرسم الهندسي */
    width: 100%; height: 0%; border-top: 2px solid var(--ink);
    background: repeating-linear-gradient(-45deg, rgba(195, 210, 226, 0.5) 0 2px, rgba(195, 210, 226, 0.12) 2px 7px);
    transition: height 0.2s ease-out;
}
.wt-name { margin-top: 10px; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); line-height: 1.6; }

/* محاكي الاستقطاب (درس 1-4) */
.dp-stage { display: flex; justify-content: space-between; align-items: center; margin: 32px 0; position: relative; height: 180px; padding: 0 20px; }
.dp-plate { width: 20px; height: 100%; border-radius: 2px; display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; font-family: var(--font-mono); font-weight: 500; }
.dp-plate.pos { background: rgba(255, 138, 128, 0.14); border: 2px solid var(--pos); color: var(--pos); }
.dp-plate.neg { background: rgba(124, 199, 255, 0.14); border: 2px solid var(--neg); color: var(--neg); }
.dp-slab { width: 120px; height: 140px; background: rgba(255, 197, 61, 0.05); border: 1px dashed var(--line-strong); border-radius: 2px; display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; position: relative; }
.dp-atom { width: 40px; height: 30px; background: var(--raise); border: 1px solid var(--ink-muted); border-radius: 50%; display: flex; justify-content: space-between; align-items: center; padding: 0 5px; font-family: var(--font-mono); transition: width 0.3s ease; }
.dp-electron { color: var(--neg); font-weight: 600; transition: transform 0.3s; }
.dp-nucleus { color: var(--pos); font-weight: 600; transition: transform 0.3s; }
.dp-arrow { position: absolute; height: 2px; }
.dp-arrow.original { top: -30px; left: 10px; width: 100px; background: var(--ink-soft); }
.dp-arrow.induced { bottom: -30px; left: 50%; width: 0; background: var(--signal); transition: width 0.3s, left 0.3s; }
.dp-arrow .head { position: absolute; top: -11px; font-size: 0.9rem; }
.dp-arrow.original .head { left: -6px; color: var(--ink-soft); }
.dp-arrow.induced .head { right: -6px; color: var(--signal); }
.dp-arrow .name { position: absolute; font-size: 0.78rem; white-space: nowrap; }
.dp-arrow.original .name { top: -24px; left: 20px; color: var(--ink-soft); }
.dp-arrow.induced .name { top: 8px; left: -10px; color: var(--signal); }

/* محاكي العوامل الثلاثة (درس 1-5) */
.cf-stage { display: flex; justify-content: center; align-items: center; position: relative; height: 180px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 2px; background: rgba(0, 0, 0, 0.18); overflow: hidden; }
.cf-dielectric {   /* العازل: تظليل مائل بلون التمييز، شفافيته تتبع k */
    position: absolute; width: 60px; height: 80px; opacity: 0; transition: all 0.2s;
    background: repeating-linear-gradient(-45deg, rgba(255, 197, 61, 0.8) 0 2px, rgba(255, 197, 61, 0.14) 2px 7px);
}
.cf-plate { position: absolute; width: 10px; height: 80px; border-radius: 1px; transition: all 0.2s; }
.cf-plate.pos { left: 30%; background: var(--pos); }
.cf-plate.neg { right: 30%; background: var(--neg); }
.cf-controls { text-align: right; font-size: 0.92rem; }
.cf-controls label { display: block; margin-bottom: 6px; color: var(--ink-soft); }
.cf-controls input { width: 100%; margin-bottom: 10px; }
.cf-total { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.cf-total span { font-size: 0.88rem; color: var(--ink-muted); }
.cf-total b { font-size: 1.8rem; color: var(--signal); }

/* محاكي التوالي والتوازي (درس 1-6) */
.sp-body { display: flex; gap: 20px; align-items: stretch; }
.sp-controls { flex: 1; min-width: 0; background: var(--raise); border: 1px solid var(--line); padding: 18px; border-radius: var(--radius); text-align: right; }
.sp-modes { display: flex; margin-bottom: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 3px; gap: 3px; }
.sp-mode { flex: 1; padding: 8px; background: transparent; color: var(--ink-soft); font-weight: 600; border: none; border-radius: 2px; transition: background-color 0.15s, color 0.15s; }
.sp-mode:hover { color: var(--ink); background: var(--hover); }
.sp-mode.active, .sp-mode.active:hover { background: var(--signal); color: var(--signal-ink); }
.sp-controls label { color: var(--ink-soft); font-size: 0.9rem; display: block; }
.sp-controls input { width: 100%; margin-bottom: 2px; }
.sp-value { text-align: left; font-family: var(--font-mono); font-weight: 500; direction: ltr; color: var(--ink); margin-bottom: 12px; }
.sp-screen { flex: 2; min-width: 0; position: relative; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.sp-diagram { width: 100%; max-width: 380px; }
.sp-diagram svg { display: block; width: 100%; height: auto; direction: ltr; overflow: visible; }
.sp-wire { fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-linejoin: round; }
.sp-bat { stroke: var(--ink); stroke-width: 2; }
.sp-bat.short { stroke-width: 4; }
.sp-plate { stroke: var(--ink); stroke-width: 3.5; }
.sp-q { fill: none; stroke-width: 1.6; stroke-linecap: round; }   /* إشارات الشحنة على صفيحتي المتسعة: عددها يتناسب مع Q */
.sp-q.pos { stroke: var(--pos); }
.sp-q.neg { stroke: var(--neg); }
.sp-name { fill: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; }
.sp-val { fill: var(--ink); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.sp-cap.over .sp-plate { stroke: var(--bad); }
.sp-cap.over .sp-val { fill: var(--bad); }
.sp-warning { display: none; order: -1; width: 100%; margin-bottom: 14px; background: var(--bad); color: #3A0B0B; padding: 8px 14px; border-radius: 2px; font-weight: 700; font-size: 0.92rem; line-height: 1.6; }
.sp-warning.show { display: block; }

/* محاكي تراكم الطاقة (درس 1-7) */
.ce-graph { width: 200px; height: 150px; border-left: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); position: relative; margin: 0 auto 32px auto; }
.ce-graph-inner { width: 100%; height: 100%; position: absolute; bottom: 0; left: 0; }
.ce-fill { position: absolute; bottom: 0; left: 0; width: 0%; height: 0%; background: repeating-linear-gradient(-45deg, rgba(255, 197, 61, 0.7) 0 2px, rgba(255, 197, 61, 0.22) 2px 6px); clip-path: polygon(0 100%, 100% 0, 100% 100%); transition: width 0.2s, height 0.2s; }
.ce-axis-x { position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%); color: var(--ink-soft); font-size: 0.85rem; white-space: nowrap; }
.ce-axis-y { position: absolute; left: -38px; top: 50%; transform: translateY(-50%) rotate(-90deg); color: var(--ink-soft); font-size: 0.85rem; white-space: nowrap; }
.ce-readout { margin-top: 15px; background: var(--inset); border: 1px solid var(--line); padding: 10px; border-radius: var(--radius); }
.ce-readout .row { display: flex; justify-content: space-around; margin-bottom: 6px; font-size: 0.9rem; color: var(--ink-soft); }
.ce-readout b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }
.ce-readout .m-pe { color: var(--signal); }

/* محاكي المتسعة الدوارة (درس 1-8) */
.rc-dial { position: relative; width: 160px; height: 80px; margin: 0 auto 30px auto; overflow: hidden; }
.rc-half { position: absolute; bottom: -80px; left: 0; width: 160px; height: 160px; border-radius: 50%; clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%); }
.rc-half.fixed { background: repeating-linear-gradient(0deg, rgba(195, 210, 226, 0.3) 0 2px, transparent 2px 8px); border: 2px solid var(--ink-soft); }
.rc-half.rotor { background: repeating-linear-gradient(90deg, rgba(255, 197, 61, 0.5) 0 2px, transparent 2px 8px); border: 2px solid var(--signal); transform-origin: center center; transform: rotate(-180deg); transition: transform 0.1s linear; }
.rc-axle { position: absolute; bottom: -6px; left: 74px; width: 12px; height: 12px; background: var(--ink); border-radius: 50%; z-index: 5; }
.rc-readout { margin-top: 15px; background: var(--inset); border: 1px solid var(--line); padding: 10px; border-radius: var(--radius); color: var(--ink-soft); }
.rc-readout b { font-size: 1.3rem; font-weight: 500; color: var(--signal); font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; }

/* محاكي دائرة RC (درس 1-9) */
.rcc-body { display: flex; gap: 20px; flex-wrap: wrap; }
.rcc-controls { flex: 1; min-width: min(100%, 250px); background: var(--raise); border: 1px solid var(--line); padding: 18px; border-radius: var(--radius); text-align: right; }
.rcc-controls label { font-size: 0.9rem; display: block; margin-bottom: 2px; color: var(--ink-soft); }
.rcc-controls input { width: 100%; margin-bottom: 12px; }
.rcc-buttons { display: flex; gap: 10px; margin-top: 8px; }
.rcc-buttons button { flex: 1; padding: 10px; font-weight: 700; border-radius: var(--radius); border: 1px solid transparent; transition: background-color 0.15s, border-color 0.15s; }
.rcc-charge { background: var(--signal); color: var(--signal-ink); }
.rcc-charge:hover { background: var(--signal-hover); }
.rcc-buttons .rcc-discharge { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.rcc-buttons .rcc-discharge:hover { background: var(--hover); }
.rcc-screen { flex: 2; min-width: min(100%, 300px); background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; justify-content: center; gap: 20px; text-align: right; }
.rcc-bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.rcc-bar-head .sim-readout { font-size: 1rem; }
.rcc-track { width: 100%; height: 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.rcc-bar { width: 0%; height: 100%; transition: width 0.05s linear; }
.rcc-bar.v-bar { background: var(--signal); }
.rcc-bar.i-bar { background: var(--ink-soft); }
.rcc-fig { width: 100%; height: auto; display: block; }
.rcc-tank { fill: none; stroke: var(--ink-soft); stroke-width: 1.4; }
.rcc-water { fill: rgba(124, 199, 255, 0.45); }
.rcc-pipe { fill: rgba(124, 199, 255, 0.45); stroke: var(--ink-soft); stroke-width: 1; }
.rcc-curve { fill: none; stroke: var(--signal); stroke-width: 2; }
.rcc-taul { stroke: var(--ink-muted); stroke-width: 1; }
.rcc-dot { fill: var(--signal); stroke: var(--screen); stroke-width: 1.5; }

/* محاكي قوة لورنتز (درس 2-2) */
.lf-body, .fc-body { display: flex; gap: 20px; align-items: stretch; text-align: right; }
.lf-controls, .fc-controls { flex: 1; min-width: 0; background: var(--raise); border: 1px solid var(--line); padding: 18px; border-radius: var(--radius); }
.lf-controls label, .fc-controls label { color: var(--ink-soft); font-size: 0.9rem; display: block; }
.lf-controls input, .fc-controls input[type="range"] { width: 100%; margin-bottom: 2px; }
.lf-fire { width: 100%; margin-top: 4px; padding: 9px; background: transparent; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius); font-weight: 600; }
.lf-fire:hover { background: var(--hover); }
.lf-screen, .fc-screen { flex: 2; min-width: 0; display: flex; flex-direction: column; gap: 12px; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.lf-screen svg, .fc-screen svg { display: block; width: 100%; height: auto; direction: ltr; }
.lf-bfield, .lf-plate { transition: opacity 0.2s; }
.lf-axis { stroke: var(--line-strong); stroke-dasharray: 4 5; }
.lf-trail { fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lf-dot { fill: var(--screen); stroke-width: 2.5; }
.lf-dot.pos { stroke: var(--pos); }
.lf-dot.neg { stroke: var(--neg); }
.lf-sign { font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.lf-sign.pos { fill: var(--pos); }
.lf-sign.neg { fill: var(--neg); }
.lf-force { stroke: var(--signal); stroke-width: 2.5; }
.lf-flabel { fill: var(--signal); font-family: 'Times New Roman', serif; font-weight: 700; font-style: italic; font-size: 14px; }
.lf-readout, .fc-readout { display: flex; justify-content: space-around; gap: 8px; flex-wrap: wrap; color: var(--ink-muted); font-size: 0.9rem; }
.lf-readout b, .fc-readout b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.lf-status, .fc-status { margin: 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.92rem; line-height: 1.8; color: var(--ink-soft); }
.lf-status.balanced { color: var(--signal); }

/* محاكي الحث الكهرومغناطيسي (درس 2-3) */
.fc-controls .fc-check { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; cursor: pointer; }
.fc-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--signal); }
.fc-buttons { display: flex; gap: 10px; }
.fc-buttons button { flex: 1; padding: 10px; font-weight: 700; border-radius: var(--radius); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); transition: background-color 0.15s; }
.fc-buttons button:hover { background: var(--hover); }
.fc-buttons .fc-primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.fc-buttons .fc-primary:hover { background: var(--signal-hover); }
.fc-scale { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; }
.fc-tick { stroke: var(--ink-muted); stroke-width: 1; }
.fc-needle { stroke: var(--signal); stroke-width: 2.5; stroke-linecap: round; }
.fc-pivot { fill: var(--ink); }
.fc-magnet { cursor: grab; touch-action: none; }
.fc-magnet.dragging { cursor: grabbing; }
.fc-core { transition: opacity 0.2s; }
.fc-flux { flex: 1; min-width: 120px; height: 10px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; align-self: center; }
.fc-flux > span { display: block; height: 100%; width: 0; background: var(--ink-soft); }
.fc-readout > span { display: flex; align-items: center; gap: 8px; }

/* مختبر الفيض (درس 2-4) */
.fx-field { transition: opacity 0.15s; }
.fx-loop { fill: var(--signal); stroke: var(--ink); stroke-width: 3; }
.fx-loop.back { stroke-dasharray: 6 4; }
.fx-turn { fill: none; stroke: var(--ink); stroke-width: 1.2; opacity: 0.75; }   /* لفات الحلقة الإضافية (N) */
.fx-turn.back { stroke-dasharray: 4 3; }
.fx-axis { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 8 3 2 3; }
.fx-frame { fill: rgba(0, 0, 0, 0.15); stroke: var(--line); }
.fx-zero { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.fx-phi { fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linejoin: round; }
.fx-emf { fill: none; stroke: var(--signal); stroke-width: 2.2; stroke-linejoin: round; }
.fx-legend-phi { fill: var(--ink-soft); font-family: 'Times New Roman', serif; font-style: italic; font-weight: 700; font-size: 15px; }
.fx-legend-emf { fill: var(--signal); font-family: 'Times New Roman', serif; font-style: italic; font-weight: 700; font-size: 15px; }
.fx-reset { width: 100%; margin-top: 8px; padding: 9px; background: transparent; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius); font-weight: 600; }
.fx-reset:hover { background: var(--hover); }

/* محاكي الساق على السكة والمصباح (درس 2-6) */
.rg-glow { fill: var(--signal); transition: opacity 0.1s; }
.rg-flow { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-dasharray: 6 12; stroke-linecap: round; }
.rg-table { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.rg-table > div { grid-column: span 2; }
.rg-table > .eq-pair { grid-column: span 3; }
.rg-table > div, .sim-table > div { background: var(--inset); border: 1px solid var(--line); border-radius: 2px; padding: 6px 10px; font-size: 0.85rem; color: var(--ink-muted); }
.rg-table b, .sim-table b { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 1.05rem; color: var(--ink); direction: ltr; text-align: right; }
.rg-table .eq-pair b { color: var(--signal); }

/* محاكي الفيض المغناطيسي (درس 2-8) */
.fm-line { stroke: var(--ink-muted); stroke-width: 1.2; }
.fm-line.hit { stroke: var(--signal); stroke-width: 1.6; }
.fm-ring { fill: rgba(234, 241, 248, 0.08); stroke: var(--ink); stroke-width: 2.5; }
.fm-proj { fill: var(--signal-soft); stroke: var(--ink); stroke-width: 2; }
.fm-dot { fill: var(--ink-muted); }
.fm-dot.hit { fill: var(--signal); }
.fm-bracket { fill: none; stroke: var(--signal); stroke-width: 1.5; }

/* محاكيا الحث الذاتي والحث المتبادل (درسا 2-15 و2-17) */
.si-neon { fill: rgba(255, 140, 90, 0.15); stroke: var(--ink); stroke-width: 1.5; }
.si-neon-glow { fill: #FF8A5C; }
.si-spark { fill: var(--signal); }
.mc-needle { stroke: var(--signal); stroke-width: 2.5; stroke-linecap: round; }

/* محاكيا المجال الكهربائي المحتث ومختبر التطبيقات (درسا 2-18 و2-19) */
.ie-faint { opacity: 0.5; }
.ia-nylon { stroke: var(--ink-muted); stroke-dasharray: 2 3; }

/* محاكي بندولي التيارات الدوامة (درس 2-11) */
.ep-heat { fill: var(--signal); opacity: 0; pointer-events: none; }
.ep-eddy { opacity: 0; }
.ep-field { transition: opacity 0.3s; }

/* محاكي "الكون الخيالي" (درس 2-7) */
.lz-law { margin: -8px 0 16px; font-size: 0.9rem; color: var(--ink-muted); }
.lz-law b { color: var(--signal); font-family: var(--font-mono); font-weight: 700; }
.lz-glow { fill: none; stroke: var(--signal); stroke-width: 9; }
.sim-table { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sim-table b.ok, .lz-ok { color: var(--ok); }
.sim-table b.bad, .lz-bad { color: var(--bad); }
.lz-energy { display: flex; flex-direction: column; gap: 6px; }
.lz-bar { position: relative; height: 16px; background: var(--inset); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.lz-bar > span { position: absolute; top: 0; bottom: 0; width: 0; }
.lz-bar > .lz-ke { right: 0; background: var(--ink-soft); }
.lz-bar > .lz-q { background: var(--signal); }
.lz-bar > .lz-e0 { position: absolute; top: 0; bottom: 0; width: 0; border-right: 2px dashed var(--ink); }
.lz-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.82rem; color: var(--ink-muted); }
.lz-legend i { display: inline-block; width: 10px; height: 10px; margin-left: 6px; vertical-align: -1px; }
.lz-legend i.k { background: var(--ink-soft); }
.lz-legend i.q { background: var(--signal); }
.lz-legend i.e0 { width: 0; height: 12px; border-right: 2px dashed var(--ink); margin-left: 8px; }

/* محاكي لوحة المفاتيح (درس 1-10) */
.kb-mech { position: relative; width: 120px; height: 160px; margin: 0 auto; border-bottom: 3px solid var(--line-strong); }
.kb-key { position: absolute; top: 0; left: 20px; width: 80px; height: 45px; background: var(--bg-deep); color: var(--ink); font-family: var(--font-mono); font-size: 1.4rem; font-weight: 500; line-height: 43px; text-align: center; border-radius: var(--radius) var(--radius) 0 0; border: 1px solid var(--line-strong); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35); user-select: none; touch-action: none; transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
.kb-stem { position: absolute; top: 45px; left: 52px; width: 16px; height: 35px; background: var(--ink-muted); transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
.kb-plate-top { position: absolute; top: 80px; left: 10px; width: 100px; height: 7px; background: var(--neg); border-radius: 1px; transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
.kb-plate-bottom { position: absolute; top: 120px; left: 10px; width: 100px; height: 7px; background: var(--pos); border-radius: 1px; }
.kb-signal { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); color: var(--signal); font-weight: 700; font-size: 1.05rem; opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
/* الساق تنزل مع المفتاح والصفيحة العلوية، فلا تغطي حرف المفتاح عند الضغط */
.kb-mech.pressed .kb-key, .kb-mech.pressed .kb-stem, .kb-mech.pressed .kb-plate-top { transform: translateY(25px); }
.kb-mech.pressed .kb-signal { opacity: 1; }
.kb-status { margin-top: 25px; font-size: 1rem; font-weight: 600; color: var(--ink-muted); background: var(--inset); border: 1px solid var(--line); padding: 10px; border-radius: var(--radius); transition: color 0.15s, border-color 0.15s; }
.kb-status.active { color: var(--signal); border-color: rgba(255, 197, 61, 0.55); }

/* =========================================================
   قسم «خريطة القوانين» (js/laws.js): مخطط رابط ← بطاقات ← مرشد اختيار القانون ← الوحدات
   الأصفر هنا للعنصر النشط والنتيجة فقط، والأحمر لعنوان «انتبه»
   ========================================================= */
.lw-hero { display: grid; gap: 18px; margin-bottom: 8px; }
.lw-intro { margin: 0; }
.lw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.lw-stats > div { padding: 10px 14px; display: flex; flex-direction: column-reverse; gap: 2px; }
.lw-stats > div + div { border-right: 1px solid var(--line); }
.lw-stats dd { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 500; color: var(--ink); line-height: 1.2; }
.lw-stats dt { font-size: 0.85rem; color: var(--ink-muted); }
.lw-jump { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lw-jump button {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: right;
    background: var(--inset); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius);
    font-weight: 600; font-size: 0.98rem; cursor: pointer; transition: border-color 0.15s, background-color 0.15s;
}
.lw-jump button span { font-family: var(--font-mono); color: var(--signal); font-size: 0.85rem; }
.lw-jump button:hover, .lw-jump button:focus-visible { border-color: var(--signal); background: var(--hover); }

.lw-sec { margin-top: 52px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.lw-h {
    display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding-bottom: 12px;
    border-bottom: 2px solid var(--signal); font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; color: var(--ink); line-height: 1.4;
}
.lw-hn { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 500; color: var(--signal-ink); background: var(--signal); padding: 1px 8px; border-radius: 2px; }
.lw-lead { color: var(--ink-soft); margin: 0 0 22px; }

/* المخطط الرابط: محطات على خط واحد (يمين الصفحة) */
.lw-metro { list-style: none; margin: 0; padding: 0; }
:where(.lesson-content) .lw-metro { padding-right: 0; }
.lw-stop { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding-bottom: 30px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.lw-stop::before { content: ""; position: absolute; right: 21px; top: 38px; bottom: 0; border-right: 2px solid var(--line-strong); }
.lw-stop:last-child { padding-bottom: 0; }
.lw-stop:last-child::before { display: none; }
.lw-stop-dot {
    width: 38px; height: 38px; display: grid; place-items: center; position: relative; z-index: 1;
    border: 2px solid var(--signal); border-radius: 50%; background: var(--sheet);
    font-family: var(--font-mono); font-weight: 500; color: var(--signal); font-size: 1.05rem;
}
.lw-stop-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 38px; }
:where(.lesson-content) .lw-stop-t { margin: 0; font-size: 1.3rem; }
.lw-ask { font-size: 0.9rem; color: var(--ink); border: 1px dashed var(--line-strong); padding: 2px 10px; border-radius: 2px; background: var(--raise); }
.lw-ask::before { content: "؟ "; color: var(--signal); font-weight: 700; }
.lw-stop-note { margin: 8px 0 12px; color: var(--ink-soft); font-size: 1rem; }
.lw-next { margin: 14px 0 0; font-size: 0.95rem; color: var(--ink-muted); }
.lw-next::before { content: "↓ "; color: var(--signal); font-weight: 700; }

.lw-nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.lw-nodes + .lw-nodes, .lw-cols + .lw-nodes, .lw-nodes + .lw-cols { margin-top: 12px; }
.lw-node {
    display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; min-width: 0; text-align: right;
    background: var(--inset); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius);
    font: inherit; cursor: pointer; transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.lw-node:hover, .lw-node:focus-visible { border-color: var(--signal); background: var(--hover); }
.lw-node-tag { font-size: 0.86rem; line-height: 1.5; color: var(--ink-muted); }
.lw-node-f { direction: ltr; text-align: center; font-size: 1.04rem; line-height: 1.6; overflow: hidden; }
.lw-nodes.lw-mini { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.lw-nodes.lw-mini .lw-node { padding: 6px 10px; gap: 2px; background: transparent; border-style: dashed; }
.lw-nodes.lw-mini .lw-node-f { font-size: 0.92rem; }
/* سلسلة: قوانين متتالية بينها أسهم (السهم يشير إلى اليسار، اتجاه القراءة) */
.lw-nodes.chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.lw-nodes.chain > .lw-node { flex: 1 1 190px; }
.lw-arr { flex: 0 0 18px; align-self: center; height: 12px; position: relative; }
.lw-arr::before { content: ""; position: absolute; inset: 5px 4px 5px 0; border-top: 2px solid var(--line-strong); }
.lw-arr::after { content: ""; position: absolute; left: 0; top: 1px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 7px solid var(--line-strong); }
.lw-nodes.chain.v { flex-direction: column; flex-wrap: nowrap; }
.lw-nodes.chain.v > .lw-node { flex: none; }
.lw-nodes.chain.v > .lw-arr, .lw-nodes.chain.v > .lw-arr { flex: 0 0 14px; width: 12px; height: 14px; }
.lw-nodes.chain.v > .lw-arr::before { inset: 0 5px 4px 5px; border-top: none; border-right: 2px solid var(--line-strong); }
.lw-nodes.chain.v > .lw-arr::after { left: 1px; top: auto; bottom: -2px; border-right: 5px solid transparent; border-left: 5px solid transparent; border-top: 7px solid var(--line-strong); border-bottom: none; }
.lw-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lw-col { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px; }
:where(.lesson-content) .lw-col-h { margin: 0 0 10px; font-size: 1.02rem; color: var(--ink); text-align: center; }

@keyframes lw-flash { 0% { box-shadow: 0 0 0 0 rgba(255, 197, 61, 0.7); } 100% { box-shadow: 0 0 0 14px rgba(255, 197, 61, 0); } }
.lw-flash { animation: lw-flash 1.1s ease-out 2; }
.lw-node.lw-flash { border-color: var(--signal); }

/* بطاقات القوانين */
.lw-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lw-fbtn, .lw-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; min-height: 34px;
    background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 2px;
    font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.lw-fbtn:hover, .lw-chip:hover { color: var(--ink); background: var(--hover); }
.lw-fbtn.active, .lw-fbtn.active:hover { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.lw-group { margin-top: 30px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.lw-group[hidden] { display: none; }
.lw-gh {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 14px; padding-bottom: 8px;
    border-bottom: 1px solid var(--line-strong); font-size: 1.15rem; font-weight: 700; color: var(--ink);
}
:where(.lesson-content) .lw-gh { font-family: var(--font-body); font-size: 1.15rem; margin: 0 0 14px; }
.lw-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.lw-card { position: relative; padding: 16px 18px; background: var(--raise); border: 1px solid var(--line-strong); border-radius: var(--radius); scroll-margin-top: calc(var(--nav-h) + 16px); min-width: 0; }
.lw-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lw-num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--signal); border: 1px solid rgba(255, 197, 61, 0.45); padding: 0 6px; border-radius: 2px; }
:where(.lesson-content) .lw-name { margin: 0; font-size: 1.12rem; flex: 1 1 200px; }
.lw-tomap { margin-inline-start: auto; background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-muted); font: inherit; font-size: 0.8rem; padding: 1px 8px; border-radius: 2px; cursor: pointer; }
.lw-tomap:hover, .lw-tomap:focus-visible { color: var(--signal); border-color: var(--signal); }
.lw-formula {
    margin: 14px auto 12px; padding: 4px 14px; width: max-content; max-width: 100%;
    background: var(--inset); border: 1px solid var(--line-strong); outline: 1px solid var(--line); outline-offset: 3px; border-radius: 2px;
    color: var(--ink); font-size: 1.18em;
}
.lw-formula .katex-display { margin: 0.35em 0; }
.lw-say { margin: 0 0 12px; }
.lw-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0 24px; }
.lw-block { margin-top: 10px; }
:where(.lesson-content) .lw-block h5 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 0.95rem; color: var(--ink); }
.lw-block h5::before { content: ""; width: 7px; height: 7px; background: var(--ink-muted); border-radius: 1px; }
.lw-notes h5 { color: var(--bad); }
:where(.lesson-content) .lw-notes h5 { color: var(--bad); }
.lw-notes h5::before { background: var(--bad); }
:where(.lesson-content) .lw-block ul { margin: 0; padding-right: 20px; font-size: 1rem; line-height: 1.85; }
.lw-syms dl, .lw-syms > dl { margin: 0; display: grid; gap: 2px; font-size: 0.98rem; }
.lw-sym { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.lw-sym:last-child { border-bottom: none; }
.lw-sym dt { flex: 0 0 auto; min-width: 54px; text-align: center; color: var(--ink); }
.lw-sym dd { margin: 0; flex: 1; color: var(--ink-soft); }
.lw-u { display: inline-block; font-size: 0.85em; color: var(--ink-muted); border: 1px solid var(--line); padding: 0 6px; border-radius: 2px; margin-inline-start: 4px; }
.lw-alts { display: flex; flex-wrap: wrap; gap: 8px; }
.lw-alt-f { direction: ltr; padding: 3px 10px; background: var(--inset); border: 1px solid var(--line); border-radius: 2px; color: var(--ink); max-width: 100%; overflow-x: auto; }
.lw-ex { margin-top: 14px; }
.lw-ex-q { margin: 6px 0 4px; }
.lw-ex-q .katex { white-space: nowrap; }   /* عدد مثل 4×10⁻³ لا ينقسم بين سطرين */
.lw-ex-l .katex-display, .lw-ex-r .katex-display { margin: 0.25em 0; }
.lw-ex-r .katex { color: var(--signal); }

/* مرشد اختيار القانون */
.lw-fd { padding: 18px; background: var(--inset); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.lw-fd-step + .lw-fd-step { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
:where(.lesson-content) .lw-fd-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 10px; font-size: 1.05rem; }
.lw-fd-h small { color: var(--ink-muted); font-weight: 500; font-size: 0.85rem; }
.lw-fd-n { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--signal); color: var(--signal); font-family: var(--font-mono); font-size: 0.85rem; }
.lw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lw-chip { font-weight: 500; }
.lw-chip-s { direction: ltr; color: var(--ink); }
.lw-chip-n { font-size: 0.84rem; }
.lw-chip.sit { font-weight: 600; }
.lw-chip.on { background: var(--signal-soft); border-color: var(--signal); color: var(--ink); }
.lw-chip.sit.on, .lw-chip.want.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.lw-chip.want.on .lw-chip-s, .lw-chip.sit.on .lw-chip-s { color: var(--signal-ink); }
.lw-chip:disabled { opacity: 0.35; cursor: default; }
.lw-chip.add { border-style: dashed; }
.lw-fd-hint { margin: 10px 0 0; font-size: 0.95rem; color: var(--ink-muted); }
.lw-fd-hint[hidden] { display: none; }
.lw-fd-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.lw-fd-btn { padding: 6px 14px; background: transparent; color: var(--signal); border: 1px solid var(--signal); border-radius: 2px; font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; }
.lw-fd-btn:hover { background: var(--signal-soft); }
.lw-fd-btn.ghost { color: var(--ink-muted); border-color: var(--line-strong); }
.lw-fd-btn[hidden] { display: none; }
.lw-fd-out { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.lw-out-h { margin: 0 0 10px; color: var(--ink); font-weight: 700; }
.lw-out-h small { color: var(--ink-muted); font-weight: 500; margin-inline-start: 6px; }
.lw-out-msg { margin: 0 0 10px; }
:where(.lesson-content) .lw-rels { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lw-rels li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.lw-rel-f { direction: ltr; color: var(--ink); max-width: 100%; }
.lw-ex-n { margin: 0; color: var(--ink-soft); }
.lw-miss { font-size: 0.88rem; color: var(--ink-muted); }
.lw-from { background: none; border: none; padding: 0; font: inherit; font-size: 0.85rem; color: var(--ink-muted); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.lw-from:hover, .lw-from:focus-visible { color: var(--signal); }
:where(.lesson-content) .lw-path { list-style: none; padding: 0; margin: 0; }
.lw-pstep { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
.lw-pstep::before { content: ""; position: absolute; right: 14px; top: 30px; bottom: 0; border-right: 1px dashed var(--line-strong); }
.lw-pstep:last-child::before { display: none; }
.lw-pn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--sheet); border: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink); }
.lw-pbody { min-width: 0; }
.lw-ph { margin: 2px 0 0; }
.lw-ph small { color: var(--ink-muted); }
.lw-pf .katex-display { margin: 0.3em 0; }
.lw-pstep:last-child .lw-pn { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.lw-done { margin-top: 6px; padding: 10px 14px; background: var(--signal-soft); border-right: 3px solid var(--signal); border-radius: 0 2px 2px 0; }
.lw-done b { color: var(--signal); }
:where(.lesson-content) .lw-done ul { margin: 6px 0 0; padding-right: 20px; font-size: 0.98rem; }
.lw-units td:first-child { direction: ltr; text-align: center; color: var(--ink); }

@media (min-width: 1200px) {
    .lw-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .lw-jump { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lw-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .lw-h { font-size: 1.25rem; }
    .lw-stats dd { font-size: 1.3rem; }
    .lw-stats > div { padding: 8px 10px; }
    .lw-stop { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
    .lw-stop::before { right: 15px; top: 32px; }
    .lw-stop-dot { width: 30px; height: 30px; font-size: 0.9rem; }
    .lw-stop-head { min-height: 30px; }
    :where(.lesson-content) .lw-stop-t { font-size: 1.15rem; }
    .lw-nodes, .lw-nodes.lw-mini { grid-template-columns: minmax(0, 1fr); }
    .lw-nodes.lw-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* السلسلة تصبح عمودية والسهم يشير إلى الأسفل */
    .lw-nodes.chain { flex-direction: column; flex-wrap: nowrap; }
    .lw-nodes.chain > .lw-node { flex: none; }
    .lw-nodes.chain > .lw-arr { flex: 0 0 14px; width: 12px; height: 14px; }
    .lw-nodes.chain > .lw-arr::before { inset: 0 5px 4px 5px; border-top: none; border-right: 2px solid var(--line-strong); }
    .lw-nodes.chain > .lw-arr::after { left: 1px; top: auto; bottom: -2px; border-right: 5px solid transparent; border-left: 5px solid transparent; border-top: 7px solid var(--line-strong); border-bottom: none; }
    .lw-card { padding: 14px 12px; }
    .lw-formula { font-size: 1.05em; padding: 2px 10px; }
    .lw-fd { padding: 14px 12px; }
}

/* =========================================================
   معاني كلاسات الألوان والأدوات المساعدة
   (تبقى في آخر الملف لتتغلب على الألوان الافتراضية للمكونات)
   ---------------------------------------------------------
   الكلاسات القديمة في المحتوى تُترجم إلى معنى بدل لون:
     c-red / c-green / c-amber   ← تمييز ونتيجة (أصفر)
     c-cyan / c-purple / c-white ← نص أساسي
     c-light / c-soft            ← نص ثانوي
     c-muted                     ← ملاحظة خافتة
   العناوين والجداول والتسميات تبقى محايدة دائماً.
   ========================================================= */
.c-red, .c-green, .c-amber { color: var(--signal); }
.c-cyan, .c-purple, .c-white { color: var(--ink); }
.c-light, .c-soft { color: var(--ink-soft); }
.c-muted { color: var(--ink-muted); }
:is(h1, h2, h3, h4, h5, th, td, label, .fig-caption, .fig-subtitle, .puzzle-title):is(.c-red, .c-green, .c-amber, .c-cyan, .c-purple) { color: var(--ink); }

.center { text-align: center; }
.nowrap { white-space: nowrap; }   /* عبارة قصيرة لا تنقسم بين سطرين */
.italic { font-style: italic; }
.bold   { font-weight: 700; }
.small  { font-size: 0.9rem; }
.tiny   { font-size: 0.85rem; }
.big    { font-size: 1.1rem; }
.mt-0   { margin-top: 0; }
.mt-sm  { margin-top: 10px; }
.mt     { margin-top: 20px; }
.mt-lg  { margin-top: 40px; }
.mb-0   { margin-bottom: 0; }
.mb-sm  { margin-bottom: 10px; }
.mb-md  { margin-bottom: 15px; }
.mb     { margin-bottom: 20px; }
.mb-lg  { margin-bottom: 30px; }

/* =========================================================
   الشاشات الصغيرة
   ========================================================= */

/* =========================================================
   العرض العريض (1200px فأكثر): الدرس يملأ عرض الشاشة
   والمكونات تتوزع على أعمدة بدل أن تتراص فوق بعضها
   ========================================================= */
@media (min-width: 1200px) {
    .lesson-content { font-size: 1.16rem; }
    .lesson-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 44px; }

    /* خطوات الحل: عمودان، والخطوة الأخيرة المنفردة تأخذ السطر كاملاً */
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps > :last-child:nth-child(odd) { grid-column: 1 / -1; }

    /* المسألة: النص والمطاليب يميناً، والشكل بجانبها يساراً */
    .problem:has(> .figure) {
        display: grid; grid-template-columns: minmax(0, 1fr) fit-content(55%);   /* الشكل بعرضه الطبيعي */
        grid-template-rows: auto auto auto 1fr; column-gap: 32px; align-items: start;
    }
    .problem:has(> .figure) > * { grid-column: 1; }
    .problem:has(> .figure) > .figure { grid-column: 2; grid-row: 1 / -1; margin: 0; }

    /* القوائم الموضوعة مباشرة في الدرس: عمودان */
    .lesson-content > .rule-list:has(> li + li), .lesson-content > .box-list:has(> li + li) {   /* عند وجود عنصرين فأكثر */
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; row-gap: 12px;
    }
    .lesson-content > .box-list.three-up:has(> li + li) { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* ثلاثة عناصر قصيرة في سطر واحد */
    .lesson-content > .rule-list > li:nth-child(2) { border-top: none; padding-top: 0; }
    .lesson-content > .box-list > li { margin-bottom: 0; }

    /* الاختبار: الخيارات في شبكة 2×2 */
    .options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* الحاسوب الصغير والأجهزة اللوحية: قائمة جانبية بدل القوائم المنسدلة */
@media (max-width: 1100px) {
    nav { justify-content: space-between; align-items: center; padding: 0 16px; }
    .nav-container { height: 100%; }
    .nav-item:not(.nav-home) { display: none; }
    .nav-home { margin: 0; padding: 0; border: none; }
    .nav-home .nav-link { padding: 0 6px; }
    .nav-toggle { display: inline-flex; }
}
@media (min-width: 1101px) {
    .drawer, .drawer-backdrop { display: none; }
}

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 36px; min-height: 0; padding: 40px 24px 56px; }
    .hero-drawing { max-width: 520px; width: 100%; margin: 0 auto; }
    .hero-sub { max-width: none; }
    .search-container { max-width: none; }
    .chapter-index { padding: 0 24px 72px; }
    .index-list { grid-template-columns: repeat(2, 1fr); }

    #learning-area { padding: calc(var(--nav-h) + 24px) 16px 48px; }
    .lesson-panel { padding: 32px 28px; }
    .lesson-grid { grid-template-columns: 1fr; gap: 24px; }
    .sim-panel { position: static; }
    /* قسم «محاكيات»: عمود واحد، المحاكي وقراءته أولاً ثم الشرح */
    .sg-layout, .sg-layout.is-wide { grid-template-columns: 1fr; gap: 28px; }
    .sg-sim-col, .sg-text { grid-column: auto; grid-row: auto; }
    .sg-sim-col { position: static; max-height: none; overflow: visible; }
    .tb-row { grid-template-columns: 1fr auto; }
    .tb-brand { display: none; }
    .tb-cell + .tb-cell { border-right: none; }
    .tb-row .tb-sheet { border-right: 1px solid var(--line-strong); }

    /* التفرع الثلاثي يصبح عمودياً: الأعمدة الثلاثة أضيق من معادلاتها */
    .tree-branches.three { grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }
    .tree-branches.three::before, .tree-branches.three > *::before { display: none; }

    /* الحلقة المغلقة تصبح عمودية، وسهم العودة على الجانب الأيسر */
    .cycle { flex-direction: column; gap: 28px; padding-bottom: 0; padding-left: 30px; }
    .cycle > .flow-step + .flow-step::before { top: auto; bottom: 100%; left: 50%; width: 0; height: 28px; border-top: none; border-left: 1px solid var(--line-strong); }
    .cycle > .flow-step + .flow-step::after {
        top: -7px; left: calc(50% - 5px);
        border-top: 7px solid var(--line-strong); border-bottom: none; border-left: 5px solid transparent; border-right: 5px solid transparent;
    }
    .cycle::before, .cycle.three::before { top: 11%; bottom: 11%; left: 8px; right: auto; width: 22px; height: auto; border: 1px solid var(--line-strong); border-right: none; }
    .cycle::after, .cycle.three::after {
        top: calc(11% - 5px); bottom: auto; left: 23px; right: auto;
        border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid var(--line-strong); border-right: none;
    }
}

@media (max-width: 600px) {
    :root { --nav-h: 56px; }
    body { font-size: 0.97rem; }
    .hero { padding: 28px 16px 44px; gap: 28px; }
    .hero-eyebrow { font-size: 0.82rem; margin-bottom: 12px; }
    .hero-sub { font-size: 1.05rem; margin-bottom: 24px; }
    .hero-actions .btn-action { width: 100%; }
    .hero-stats { margin-top: 28px; }
    .hero-stats > div { padding-left: 8px; }
    .hero-stats > div + div { padding-right: 10px; }
    .hero-stats dt { font-size: 0.74rem; }
    .hero-stats dd { font-size: 1.3rem; }
    .hero-drawing figcaption { flex-direction: column; gap: 2px; }
    .chapter-index { padding: 0 16px 56px; }
    .index-title { font-size: 1.4rem; }
    .index-head { flex-direction: column; gap: 2px; }
    .index-list { grid-template-columns: 1fr; }
    .index-cell { min-height: 0; padding: 16px; }

    #learning-area { padding: calc(var(--nav-h) + 12px) 10px 40px; }
    .lesson-panel { padding: 22px 16px; outline: none; margin-top: 0; }
    .title-block { margin-bottom: 28px; }
    .section-tabs { margin: -29px 0 28px; }
    .st-tab { flex: 1; justify-content: center; padding: 9px 10px; }
    .qa-item { padding: 14px; }
    .qa-tools .sp-modes { flex: 1 1 100%; }
    .qa-toggle { width: 100%; }
    .qa-a .katex-display > .katex { font-size: 0.95em; }   /* أصغر قليلاً على الجوال لتتسع خطوات الحل */
    .sol-steps > li { padding-right: 32px; }
    .sol-answer { display: block; }
    .sg-results > li { padding: 12px; }
    .sg-results > li::before { position: static; float: right; margin: 2px 0 2px 10px; }
    .sg-use > div { grid-template-columns: 1fr; }
    .sg-chips { gap: 6px 5px; }
    .sg-chips-label { flex: 1 1 100%; margin: 0; }
    .sg-chip:not(.current) .sg-chip-t { display: none; }
    .sg-chip:not(.current) .sg-chip-n { font-size: 0.85rem; opacity: 1; }
    .sg-chip { padding: 3px 9px; }
    .sg-live { padding: 12px; }
    .sg-live-body .katex-display > .katex, .sg-why .katex-display > .katex, .sg-try-a .katex-display > .katex { font-size: 0.95em; }
    .sg-try > li { padding: 12px; }
    .lesson-title { font-size: 1.55rem; padding: 14px 14px; }
    .tb-cell { padding: 7px 12px; }
    .tb-ruler { padding: 8px 12px 10px; }
    .lesson-content { font-size: 1.05rem; line-height: 1.9; }
    :where(.lesson-content) h3 { font-size: 1.25rem; }
    :where(.lesson-content) ul, :where(.lesson-content) ol { padding-right: 18px; }
    .card, .step, .step.roomy, .problem, .puzzle, .feature-card { padding: 16px; }
    .formula-box { font-size: 1.15em; padding: 8px 14px; }
    .figure { padding: 14px 10px; }
    .sim-panel, .sim-wide, .sim-inline, .sim-showcase { padding: 16px 12px; }
    .sp-body { flex-direction: column; }
    .lf-body, .fc-body { flex-direction: column; }
    .tree-branches, .tree-branches.three { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
    .flow-split { grid-template-columns: 1fr; gap: 14px; }
    .flow-fork::after, .flow-merge::before { display: none; }
    .flow-fork::before, .flow-merge::after { top: 0; height: 100%; }
    .flow-split > .flow-step::after { display: none; }
    /* المساران المتقابلان يبقيان جنباً إلى جنب على الجوال (المقارنة هي الغاية) */
    .flow.two .flow-split { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; row-gap: 24px; }
    .flow.two .flow-fork::after, .flow.two .flow-merge::before { display: block; }
    .flow.two .flow-fork::before { top: 0; height: 14px; }
    .flow.two .flow-merge::after { top: 14px; height: 14px; }
    .flow.two .flow-split > .flow-step::after { display: block; }
    .flow.two .flow-split > .flow-step { padding: 8px 6px; font-size: 0.92rem; }
    .sim-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tree-branches::before, .tree-branches > *::before, .tree-root::after { display: none; }
    .sp-screen { padding: 12px; }
    .rcc-screen { min-width: 0; }
    .dp-stage { padding: 0 4px; }
    .dp-slab { width: 100px; }
    .data-table { font-size: 0.92rem; }
    :where(.data-table) th, .data-table td { padding: 10px; }

    .lesson-actions { flex-direction: column; align-items: stretch; }
    .lesson-actions .btn-action { width: 100%; }
    .lesson-actions .btn-quiz { order: -1; }
    .quiz-header h2 { font-size: 1.45rem; }
    .question-text { font-size: 1.15rem; }
    .option-btn { font-size: 1rem; padding: 11px 12px; }
    .quiz-navigation { flex-direction: column-reverse; align-items: stretch; }
    .quiz-navigation > div, .nav-buttons-group { width: 100%; }
    .nav-buttons-group { flex-direction: column-reverse; }
    .quiz-navigation .btn-action { width: 100%; }
}

/* تقليل الحركة لمن يفضّل ذلك */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .hd-draw { stroke-dashoffset: 0; }
    .hd-fade { opacity: 1; }
}

/* جزيء عازل (دايبول) في رسوم درس 1-4 */
.dipole { fill: rgba(255, 197, 61, 0.14); stroke: var(--ink-soft); stroke-width: 1.2; }

/* الجواب الكلامي المبسّط في «سين جيم» و«أسئلة الفصل»: الفكرة ببساطة ← الشرح خطوة بخطوة ← الجواب النموذجي */
.va { display: flex; flex-direction: column; gap: 14px; }
.va-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: var(--raise); line-height: 1.95; }
.va-h { margin: 0 0 8px; font-weight: 700; color: var(--ink); }
.va-h small { font-weight: 400; color: var(--ink-muted); font-size: 0.85em; }
.va-idea { border-right: 3px solid var(--signal); }
.va-model { border-right: 3px solid var(--ink-soft); background: var(--inset); }
.va-body > :last-child, .va-steps > li > :last-child { margin-bottom: 0; }
/* داخل الأجوبة: عنصر mb-0 ليس الأخير (قائمة يتبعها استنتاج مثلاً) يحتفظ بمسافة تحته */
.va-body > .mb-0:not(:last-child), .qa-a > .mb-0:not(:last-child), .va-steps > li > .mb-0:not(:last-child) { margin-bottom: 10px; }
.va-steps { margin: 0; padding-right: 22px; }
.va-steps > li { margin-bottom: 8px; }
.va-steps > li:last-child { margin-bottom: 0; }
.va-steps .katex-display { margin: 0.3em 0; }
/* الفكرة ببساطة والشرح خطوة بخطوة مطويّان تحت الجواب النموذجي: الطالب يفتحهما بالضغط */
.va-sec.va-more { padding: 0; }
.va-more > summary.va-h { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; margin: 0; padding: 10px 16px 10px 40px; cursor: pointer; list-style: none; border-radius: var(--radius); }
.va-more > summary .va-mt, .va-more > summary small { white-space: nowrap; }
.va-more > summary::-webkit-details-marker { display: none; }
.va-more > summary::after { content: "+"; position: absolute; left: 16px; top: 10px; font-family: var(--font-mono); font-weight: 700; color: var(--signal); }
.va-more[open] > summary::after { content: "−"; }
.va-more[open] > summary small { display: none; }
.va-more > summary:hover, .va-more > summary:focus-visible { color: var(--signal); }
.va-more > summary:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.va-more[open] > summary.va-h { padding-bottom: 6px; }
.va-more > .va-body { padding: 0 16px 12px; }
.va-more > .va-steps { padding: 0 38px 12px 16px; }
@media (max-width: 600px) {
    .va-more > summary.va-h { padding: 10px 12px 10px 34px; }
    .va-more > summary::after { left: 12px; }
    .va-more > .va-body { padding: 0 12px 10px; }
    .va-more > .va-steps { padding: 0 30px 10px 12px; }
}
@media (max-width: 600px) {
    .va { gap: 10px; }
    .va-sec { padding: 10px 12px; }
    .va-model { padding: 10px 8px; }
    .va-steps { padding-right: 18px; }
}

/* =========================================================
   محاكيات الفصل الثالث (التيار المتناوب) — js/sims-ac.js
   الفولطية بالأصفر، والتيار بالسماوي، والقدرة بالوردي
   ========================================================= */
.ac-v { fill: none; stroke: var(--signal); stroke-width: 2.4; stroke-linejoin: round; }
.ac-i { fill: none; stroke: var(--neg); stroke-width: 2.2; stroke-linejoin: round; }
.ac-p { fill: none; stroke: var(--pos); stroke-width: 2; stroke-linejoin: round; }
.ac-parea.pos { fill: rgba(255, 138, 128, 0.2); }
.ac-parea.neg { fill: rgba(124, 199, 255, 0.16); }
.ac-circle { fill: none; stroke: var(--line-strong); stroke-dasharray: 3 4; }
.ac-arc { fill: none; stroke: var(--ink-muted); stroke-width: 1.4; }
.ac-arc.sig { stroke: var(--signal); }
.ac-rot { fill: none; stroke: var(--ink-muted); stroke-width: 1.4; }
.ac-proj { stroke-width: 1; stroke-dasharray: 3 4; }
.ac-proj.v { stroke: var(--signal); opacity: 0.7; }
.ac-proj.i { stroke: var(--neg); opacity: 0.7; }
.ac-vec-v { stroke: var(--signal); stroke-width: 3.2; }
.ac-vec-i { stroke: var(--neg); stroke-width: 3; }
.ac-vec-r { stroke: var(--ink); stroke-width: 3; }
.ac-vec-x { stroke: var(--pos); stroke-width: 3; }
.ac-vec-s { stroke: var(--ink-soft); stroke-width: 2.4; }
.ac-dot-v { fill: var(--signal); }
.ac-dot-i { fill: var(--neg); }
.ac-dot-p { fill: var(--pos); }
.ac-cursor { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 2 3; }
.ac-tri { fill: var(--signal-soft); stroke: none; }
.ac-band { fill: rgba(255, 197, 61, 0.08); }
.ah-cyan { fill: var(--neg); }
.ah-pink { fill: var(--pos); }
.ah-soft { fill: var(--ink-soft); }
.t-ac { font-family: 'Times New Roman', serif; font-style: italic; font-weight: 700; font-size: 16px; fill: var(--ink); }
.t-ac.t-v, .t-label.t-v { fill: var(--signal); }
.t-ac.t-i, .t-label.t-i { fill: var(--neg); }
.t-ac.t-p, .t-label.t-p { fill: var(--pos); }
.t-ac.t-muted { fill: var(--ink-muted); }
.ac-pair { display: flex; flex-wrap: wrap; gap: 10px; }
.ac-pair > svg { flex: 1 1 250px; min-width: 0; }
.fc-controls .fc-buttons + .fc-buttons { margin-top: 8px; }
.fc-controls .fc-buttons { margin-top: 10px; }
.ac-pair > svg.ac-side { flex: 0 1 190px; margin-inline: auto; }
.rh-glow { fill: var(--pos); opacity: 0.2; }
.rh-bar { fill: var(--pos); }
.rh-dc { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 4; }
.rl-meter { fill: var(--screen); stroke: var(--ink); stroke-width: 1.5; }
.sim-table b.ar { font-family: var(--font-body); font-weight: 700; direction: rtl; text-align: right; }
.rn-faint { fill: none; stroke: var(--ink-muted); stroke-width: 1.2; opacity: 0.6; }

/* =========================================================
   الفصل الرابع (الموجات الكهرومغناطيسية): أشكال الدروس ومحاكيات js/sims-em.js
   المجال الكهربائي E بالأصفر، والمجال المغناطيسي B بالسماوي
   ========================================================= */
.em-e { fill: none; stroke: var(--signal); stroke-width: 2.2; stroke-linejoin: round; }
.em-b { fill: none; stroke: var(--neg); stroke-width: 2; stroke-linejoin: round; }
.em-e-thin { stroke: var(--signal); stroke-width: 1.2; opacity: 0.75; fill: none; }
.em-b-thin { stroke: var(--neg); stroke-width: 1.1; opacity: 0.7; fill: none; }
.em-e-vec { stroke: var(--signal); stroke-width: 4; }
.em-b-vec { stroke: var(--neg); stroke-width: 4; }
.em-b-mark { fill: var(--screen); stroke: var(--neg); stroke-width: 1.4; }
.em-b-dot { fill: var(--neg); }
.em-b-x { stroke: var(--neg); stroke-width: 1.4; }
.em-rod { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.em-rod.p { stroke: var(--pos); }
.em-rod.n { stroke: var(--neg); }
.em-ray { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; }
.em-ray.sig { stroke: var(--signal); }
.em-spark { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linejoin: round; }
.em-gap { fill: var(--screen); stroke: none; }
.em-earth { fill: rgba(150, 190, 235, 0.08); stroke: var(--ink-soft); stroke-width: 1.5; }
.em-iono { fill: rgba(255, 197, 61, 0.06); stroke: var(--line-strong); stroke-width: 1.2; stroke-dasharray: 5 4; }
.em-iono.f { fill: rgba(124, 199, 255, 0.07); }
.em-band { stroke: var(--screen); stroke-width: 1; }
.em-band.b1 { fill: rgba(124, 199, 255, 0.42); }
.em-band.b2 { fill: rgba(124, 199, 255, 0.3); }
.em-band.b3 { fill: rgba(255, 138, 128, 0.32); }
.em-band.vis { fill: none; }
.em-band.b5 { fill: rgba(190, 150, 255, 0.32); }
.em-band.b6 { fill: rgba(214, 228, 243, 0.26); }
.em-band.b7 { fill: rgba(214, 228, 243, 0.16); }
.em-band-t { fill: var(--ink); font-weight: 700; }
.em-msg { fill: none; stroke: var(--ink-soft); stroke-width: 2; }
.em-car { fill: none; stroke: var(--ink-muted); stroke-width: 1.2; }
.em-mod { fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linejoin: round; }
.em-env { fill: none; stroke: var(--ink-soft); stroke-width: 1.2; stroke-dasharray: 4 4; }
.em-box { fill: var(--screen); stroke: var(--ink); stroke-width: 1.5; }
.em-box.sig { stroke: var(--signal); }
.em-v-dist { fill: none; stroke: var(--signal); stroke-width: 2; }
.em-i-dist { fill: none; stroke: var(--neg); stroke-width: 2; }
.em-e-text { color: var(--signal); }
.em-b-text { color: var(--neg); }

/* =========================================================
   طبقة التدريس (الفصل الرابع): دورة التعلم الخماسية 5E
   tl-journey: رحلة الإشارة (منظِّم متقدّم) — tl-hook: سؤال البداية والعودة إليه
   tl-idea: الفكرة في جملة — tl-poe: توقّع ثم جرّب (أزرار راديو بلا JavaScript)
   tl-amap: التشبيه المنظَّم وحدوده — tl-myth: خطأ شائع — tl-life: من حياتك — tl-memo: حيلة للحفظ
   ========================================================= */
.tl-k { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; color: var(--signal-ink); background: var(--signal); padding: 2px 10px; border-radius: 2px; margin-bottom: 10px; }
.tl-journey { border: 1px solid var(--line); border-radius: var(--radius); background: var(--inset); padding: 14px 14px 10px; margin: 0 0 22px; }
.tl-j-title { font-size: 0.86rem; font-weight: 700; color: var(--ink-muted); margin-bottom: 10px; }
.tl-journey ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; counter-reset: tl; }
.tl-journey li { counter-increment: tl; position: relative; }
.tl-journey li span.tl-st { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-muted); text-decoration: none; font-size: 0.8rem; font-weight: 600; line-height: 1.3; text-align: center; height: 100%; }
.tl-journey li span.tl-st::before { content: counter(tl); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); }
.tl-journey li.is-on span.tl-st { color: var(--ink); border-color: var(--signal); background: var(--signal-soft); }
.tl-journey li.is-on span.tl-st::before { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.tl-here { margin: 10px 0 0; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.8; }
.tl-here b { color: var(--signal); }
@media (max-width: 700px) { .tl-journey ol { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 400px) { .tl-journey li span.tl-st { padding-inline: 0; font-size: 0.76rem; } }   /* كلمة طويلة مثل «المغناطيس» كانت أعرض من خانتها بـ 2px على شاشة 360px */

.tl-hook { border: 1px dashed var(--signal); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 22px; background: rgba(255, 197, 61, 0.04); }
.tl-hook .tl-q { font-size: 1.14rem; font-weight: 600; color: var(--ink); line-height: 1.9; margin: 0 0 6px; }
.tl-hook .tl-note { margin: 0; font-size: 0.9rem; color: var(--ink-muted); }
.tl-hook.tl-back { border-style: solid; border-color: var(--ok); background: rgba(95, 211, 154, 0.05); margin-top: 30px; }
.tl-hook.tl-back .tl-k { background: var(--ok); }
.tl-hook.tl-back .tl-q { font-size: 1rem; color: var(--ink-soft); }
.tl-hook.tl-back p:last-child { margin-bottom: 0; }

.tl-idea { display: flex; gap: 12px; align-items: baseline; border-right: 3px solid var(--signal); padding: 4px 14px 4px 0; margin: 0 0 26px; }
.tl-idea b { flex: none; color: var(--signal); font-size: 0.9rem; }
.tl-idea p { margin: 0; font-size: 1.08rem; color: var(--ink); line-height: 1.85; }
@media (max-width: 600px) { .tl-idea { flex-direction: column; gap: 2px; } }

.tl-poe { position: relative; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raise); padding: 16px 18px; margin: 0 0 18px; }
.tl-poe .tl-q { color: var(--ink); font-weight: 600; line-height: 1.9; margin: 0 0 12px; }
.tl-poe input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tl-poe label { display: block; padding: 10px 14px; margin: 0 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; color: var(--ink-soft); line-height: 1.7; transition: background-color 0.15s, border-color 0.15s; }
.tl-poe label:hover { background: var(--hover); color: var(--ink); }
.tl-poe input:focus-visible + label { outline: 2px solid var(--signal); outline-offset: 2px; }
.tl-poe input.ok:checked + label { border-color: var(--ok); background: rgba(95, 211, 154, 0.1); color: var(--ink); }
.tl-poe input.no:checked + label { border-color: var(--bad); background: rgba(255, 123, 123, 0.08); color: var(--ink); }
.tl-poe:has(input:checked) input.ok + label { border-color: var(--ok); }
.tl-poe .tl-fb, .tl-poe .tl-why { display: none; }
.tl-poe .tl-fb { font-weight: 700; margin: 12px 0 4px; }
.tl-poe .tl-fb.ok { color: var(--ok); }
.tl-poe .tl-fb.no { color: var(--bad); }
.tl-poe input.ok:checked ~ .tl-fb.ok, .tl-poe input.no:checked ~ .tl-fb.no, .tl-poe input:checked ~ .tl-why { display: block; }
.tl-poe .tl-why { color: var(--ink-soft); line-height: 1.85; }
.tl-poe .tl-why p { margin: 0 0 6px; }
.tl-poe .tl-go { display: block; margin-top: 6px; color: var(--signal); font-weight: 600; }
.tl-poe .tl-wait { margin: 6px 0 0; font-size: 0.88rem; color: var(--ink-muted); }
.tl-poe input:checked ~ .tl-wait { display: none; }

.tl-amap { border: 1px solid var(--line); border-right: 3px solid var(--neg); border-radius: var(--radius); background: var(--raise); padding: 16px 18px; margin: 22px 0; }
.tl-amap .tl-k { background: var(--neg); }
.tl-amap > h4 { margin: 0 0 8px; color: var(--ink); font-size: 1.15rem; }
.tl-amap > p { color: var(--ink-soft); line-height: 1.9; }
.tl-amap .table-wrap { margin: 12px 0; }
.tl-amap .data-table th:first-child { width: 42%; }
.tl-amap .tl-limit { margin: 0; padding: 10px 14px; background: var(--inset); border-radius: var(--radius); color: var(--ink-soft); line-height: 1.85; }
.tl-amap .tl-limit b { color: var(--signal); }

.tl-myth { border: 1px solid var(--line); border-right: 3px solid var(--bad); border-radius: var(--radius); background: var(--raise); padding: 16px 18px; margin: 22px 0; }
.tl-myth .tl-k { background: var(--bad); color: #2a0b0b; }
.tl-myth .tl-wrong, .tl-myth .tl-right { position: relative; padding-right: 28px; margin: 0 0 8px; line-height: 1.85; }
.tl-myth .tl-wrong { color: var(--ink-muted); }
.tl-myth .tl-right { color: var(--ink); font-weight: 600; }
.tl-myth .tl-wrong::before, .tl-myth .tl-right::before { position: absolute; right: 0; top: 0; font-weight: 700; font-family: var(--font-mono); }
.tl-myth .tl-wrong::before { content: "✗"; color: var(--bad); }
.tl-myth .tl-right::before { content: "✓"; color: var(--ok); }
.tl-myth .tl-why2 { margin: 0; color: var(--ink-soft); font-size: 0.97rem; line-height: 1.85; }
.tl-myth + .tl-myth { margin-top: -10px; }

.tl-life { margin: 22px 0; }
.tl-life-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.tl-life-grid > div { border: 1px solid var(--line); border-top: 2px solid var(--ok); border-radius: var(--radius); padding: 12px 14px; background: var(--raise); }
.tl-life-grid b { display: block; color: var(--ink); margin-bottom: 4px; }
.tl-life-grid span { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.75; }
.tl-life .tl-k { background: var(--ok); }

.tl-memo { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 14px 18px; margin: 22px 0; background: var(--inset); color: var(--ink-soft); line-height: 1.9; }
.tl-memo .tl-k { background: var(--ink-soft); }
.tl-memo p:last-child { margin-bottom: 0; }
.tl-memo b { color: var(--ink); }

.tl-map { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; counter-reset: tlm; }
.tl-map li { counter-increment: tlm; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--raise); }
.tl-map li::before { content: counter(tlm); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--signal); color: var(--signal-ink); font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem; }
.tl-map b { color: var(--ink); }
.tl-map span { color: var(--ink-soft); line-height: 1.8; }
.tl-map a { color: var(--signal); font-size: 0.9rem; margin-inline-start: 4px; white-space: nowrap; unicode-bidi: isolate; }
.tl-mapbox { border: 1px solid var(--line); border-radius: var(--radius); background: var(--raise); padding: 16px 18px 6px; margin: 0 0 26px; }
.tl-mapbox > p { color: var(--ink-soft); line-height: 1.85; }
.tl-mapbox .tl-map { margin-bottom: 16px; }
.tl-mapbox .tl-memo { margin: 0 0 12px; }

/* =========================================================
   مسار التعلم (1): بطاقة «الخطوة التالية» في آخر كل صفحة
   ns-main: الخطوة الطبيعية التالية بضغطة واحدة، وns-chip: بدائل قريبة
   ========================================================= */
.next-step { margin: 0 0 32px; padding: 20px 22px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--inset); }
.next-step[hidden] { display: none; }
.ns-done { display: flex; align-items: baseline; gap: 8px; margin: 0 0 14px; color: var(--ink-soft); font-size: 1rem; line-height: 1.7; }
.ns-done b { color: var(--ink); font-weight: 700; }
.ns-tick { color: var(--ok); font-weight: 700; flex-shrink: 0; }
.ns-main {
    display: flex; align-items: center; gap: 16px; padding: 14px 20px;
    border-radius: var(--radius); background: var(--signal); color: var(--signal-ink);
    text-decoration: none; transition: background-color 0.15s;
}
.ns-main:hover { background: var(--signal-hover); }
.ns-main:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ns-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ns-k { font-size: 0.8rem; font-weight: 700; opacity: 0.75; }
.ns-t { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; line-height: 1.55; }
.ns-meta { font-size: 0.9rem; font-weight: 500; opacity: 0.85; line-height: 1.6; }
.ns-arrow { font-size: 1.25rem; flex-shrink: 0; }
.ns-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ns-or { font-size: 0.9rem; color: var(--ink-muted); margin-inline-end: 4px; }
.ns-chip {
    display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 14px;
    border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink-soft);
    text-decoration: none; font-size: 0.93rem; font-weight: 600; line-height: 1.5;
}
.ns-chip:hover { color: var(--ink); background: var(--hover); border-color: var(--ink-muted); }

/* =========================================================
   مسار التعلم (2): شريط الأقسام الذكي — نسخة مثبتة من تبويبات الموضوع تحت الشريط العلوي
   مخفية عند النزول للقراءة، وتنزلق من تحت الشريط العلوي عند السحب للأعلى (is-shown)
   ========================================================= */
:root { --tf-h: 46px; }
.tabs-float {
    position: fixed; top: var(--nav-h); right: 0; left: 0; z-index: 990;
    background: var(--bg-deep); border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 8px 18px rgba(2, 10, 22, 0.35);
    transform: translateY(-110%); visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
.tabs-float.is-shown { transform: none; visibility: visible; transition: transform 0.22s ease; }
.tf-inner { max-width: var(--sheet-w); margin: 0 auto; padding: 0 30px; display: flex; align-items: stretch; gap: 18px; min-height: var(--tf-h); }
.tf-topic { flex: 1 1 auto; min-width: 0; align-self: center; font-weight: 700; color: var(--ink); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-tabs { display: flex; align-items: stretch; flex-shrink: 0; }
.tf-tab {
    display: inline-flex; align-items: center; gap: 6px; padding: 0 14px;
    color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.93rem; white-space: nowrap;
    border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
a.tf-tab:hover { color: var(--ink); background: var(--hover); }
.tf-tab.active { color: var(--signal); border-bottom-color: var(--signal); }
.tf-short { display: none; }
/* المحاكي المثبت (على الشاشات العريضة فقط) يترك مكان الشريط حين يظهر */
@media (min-width: 901px) {
    .tf-on .sim-panel { top: calc(var(--nav-h) + var(--tf-h) + 20px); }
    .tf-on .sg-layout:not(.is-top) .sg-sim-col { top: calc(var(--nav-h) + var(--tf-h) + 16px); max-height: calc(100vh - var(--nav-h) - var(--tf-h) - 32px); }
}
@media (max-width: 900px) {
    .tf-inner { padding: 0 16px; }
    .tf-topic { display: none; }
    .tf-tabs { flex: 1; justify-content: center; }
}
@media (max-width: 600px) {
    .next-step { padding: 16px 14px; margin-bottom: 26px; }
    .ns-main { padding: 12px 14px; gap: 10px; }
    .ns-t { font-size: 1.06rem; }
    .ns-or { flex: 1 1 100%; }
    .ns-chip { flex: 1 1 auto; }
    .tf-inner { padding: 0 4px; gap: 0; }
    .tf-tabs { justify-content: space-between; }
    .tf-tab { flex: 1 1 auto; justify-content: center; padding: 0 4px; font-size: 0.86rem; }
    .tf-full { display: none; }
    .tf-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
    .tabs-float, .tabs-float.is-shown { transition: none; }
}

/* جداول الأجوبة في «سين جيم» و«أسئلة الفصل» على الجوال: حشوة أصغر حتى تتسع الأعمدة ضمن عرض الشاشة */
@media (max-width: 600px) {
    .qa-a .data-table th, .qa-a .data-table td { padding: 8px 6px; }
}

/* =========================================================
   الفصل الخامس (البصريات الفيزيائية): أدوات التبسيط وألوان الأشكال
   tl-words: «كلمات الدرس ببساطة» — المصطلح ومعناه بكلمات يومية
   tl-cra: شارة درجة الفهم في عناوين الشرح: نرى (الظاهرة) ← نرسم (الصورة) ← نحسب (القانون)
   op-*: الضوء في الأشكال (الأشعة وجبهات الموجة بالأصفر، والموجة الثانية بالسماوي)
   ========================================================= */
.tl-words { border: 1px solid var(--line); border-radius: var(--radius); background: var(--raise); padding: 14px 16px 6px; margin: 0 0 26px; }
.tl-words .tl-k { background: var(--neg); }
.tl-words dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 8px 18px; margin: 0; }
.tl-words dl > div { padding: 6px 0 8px; border-bottom: 1px dashed var(--line); }
.tl-words dt { color: var(--ink); font-weight: 700; margin-bottom: 2px; }
.tl-words dd { margin: 0; color: var(--ink-soft); line-height: 1.8; font-size: 0.98rem; }
.tl-cra { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 0 10px; height: 28px; margin-inline-end: 8px; border-radius: 14px; font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; vertical-align: middle; border: 1px solid; }
.tl-cra.see { color: var(--ok); border-color: var(--ok); }
.tl-cra.draw { color: var(--neg); border-color: var(--neg); }
.tl-cra.calc { color: var(--signal); border-color: var(--signal); }
.op-ray { stroke: var(--signal); stroke-width: 2; fill: none; stroke-linecap: round; }
.op-ray.b { stroke: var(--neg); }
.op-ray.p { stroke: var(--pos); }
.op-ray.thin { stroke-width: 1.3; }
.op-front { stroke: var(--signal); stroke-width: 1.6; fill: none; opacity: 0.85; }
.op-front.b { stroke: var(--neg); }
.op-trough { stroke: var(--ink-muted); stroke-width: 1.2; fill: none; stroke-dasharray: 4 4; opacity: 0.8; }
.op-barrier { fill: var(--ink-muted); opacity: 0.55; }
.op-screen { fill: rgba(234, 241, 248, 0.06); stroke: var(--ink-soft); stroke-width: 1.4; }
.op-glass { fill: rgba(124, 199, 255, 0.12); stroke: var(--ink-muted); stroke-width: 1; }
.op-film { fill: rgba(124, 199, 255, 0.22); stroke: var(--neg); stroke-width: 1.2; }
.op-dash { fill: none; stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.op-bright { fill: var(--signal); }
.op-dot-b { fill: var(--signal); }
.op-dot-d { fill: var(--screen); stroke: var(--ink-muted); stroke-width: 1.2; }

/* =========================================================
   طريقة «الغوص» في دروس الفصل الخامس (dv-*):
   على السطح (اللغز) ← نغوص (نفكك المفاهيم قاعدةً قاعدة) ← في القاع (الفكرة الكبيرة)
   ← نصعد (نقرأ كلام الكتاب ونترجمه) ← على الشاطئ (نثبّت للامتحان)
   ========================================================= */
.dv-gauge { margin: 0 0 24px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: linear-gradient(180deg, rgba(124, 199, 255, 0.05), rgba(3, 14, 28, 0.35)); }
.dv-gauge ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dv-gauge li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 4px; border-radius: 2px; }
.dv-gauge .dv-ic { font-size: 1.4rem; line-height: 1.3; }
.dv-gauge b { color: var(--ink); font-size: 0.92rem; }
.dv-gauge small { color: var(--ink-muted); font-size: 0.76rem; line-height: 1.55; }
.dv-gauge .dv-surface { background: rgba(124, 199, 255, 0.06); }
.dv-gauge .dv-down { background: rgba(124, 199, 255, 0.11); }
.dv-gauge .dv-bottom { background: rgba(124, 199, 255, 0.18); }
.dv-gauge .dv-up { background: rgba(124, 199, 255, 0.11); }
.dv-gauge .dv-shore { background: rgba(255, 197, 61, 0.09); }
@media (max-width: 640px) {
    .dv-gauge ol { grid-template-columns: 1fr; }
    .dv-gauge li { flex-direction: row; flex-wrap: wrap; text-align: right; gap: 2px 8px; padding: 6px 10px; }
    .dv-gauge small { flex-basis: 100%; padding-right: 32px; }
}
.dv-h .dv-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; vertical-align: middle; color: var(--ink); }
.dv-h.dv-surface .dv-tag { background: rgba(124, 199, 255, 0.14); }
.dv-h.dv-down .dv-tag { background: rgba(124, 199, 255, 0.24); }
.dv-h.dv-bottom .dv-tag { background: rgba(124, 199, 255, 0.36); }
.dv-h.dv-up .dv-tag { background: rgba(95, 211, 154, 0.24); }
.dv-h.dv-shore .dv-tag { background: rgba(255, 197, 61, 0.22); }
.dv-brick { margin: 18px 0; border: 1px solid var(--line-strong); border-right: 3px solid var(--neg); border-radius: var(--radius); background: var(--raise); padding: 14px 16px; }
.dv-bh { display: flex; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dv-n { flex: none; font-size: 0.78rem; font-weight: 700; color: var(--screen); background: var(--neg); padding: 2px 8px; border-radius: 2px; }
.dv-bh h4 { margin: 0; color: var(--ink); font-size: 1.06rem; }
.dv-bb > :last-child { margin-bottom: 0; }
.dv-bb .figure { margin-top: 12px; margin-bottom: 12px; }
.dv-check { margin-top: 12px; }
.dv-chat { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.dv-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; }
.dv-msg p { margin: 0; }
.dv-s { align-self: flex-start; background: rgba(124, 199, 255, 0.09); border: 1px solid rgba(124, 199, 255, 0.35); border-top-right-radius: 3px; }
.dv-t { align-self: flex-end; background: rgba(255, 197, 61, 0.07); border: 1px solid rgba(255, 197, 61, 0.35); border-top-left-radius: 3px; }
.dv-who { display: block; font-size: 0.78rem; font-weight: 700; margin-bottom: 2px; }
.dv-s .dv-who { color: var(--neg); }
.dv-t .dv-who { color: var(--signal); }
.dv-book { margin: 16px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dv-book h4 { grid-column: 1 / -1; margin: 0; color: var(--ink); }
.dv-bq, .dv-bp { padding: 10px 14px; border-radius: 2px; }
.dv-bq { background: var(--inset); border: 1px solid var(--line-strong); }
.dv-bq p { color: var(--ink-soft); }
.dv-bp { background: rgba(95, 211, 154, 0.06); border: 1px solid rgba(95, 211, 154, 0.4); }
.dv-bq p, .dv-bp p { margin: 0; }
.dv-bl { display: block; font-size: 0.78rem; font-weight: 700; margin-bottom: 4px; color: var(--ink-muted); }
.dv-bp .dv-bl { color: var(--ok); }
@media (max-width: 700px) { .dv-book { grid-template-columns: 1fr; } }
.dv-exam { margin: 22px 0; padding: 14px 16px; border: 1px solid var(--signal); border-radius: var(--radius); background: rgba(255, 197, 61, 0.04); }
.dv-exam ul { margin: 0; padding-right: 20px; display: flex; flex-direction: column; gap: 6px; }
.nm-exam .nm-exhint { margin: 4px 0 10px; font-size: 0.88rem; color: var(--ink-muted); }
.nm-exam .nm-exq summary { cursor: pointer; list-style: none; }
.nm-exam .nm-exq summary::-webkit-details-marker { display: none; }
.nm-exam .nm-exq summary::after { content: ' ▾ الجواب'; font-size: 0.8rem; color: var(--signal); white-space: nowrap; }
.nm-exam .nm-exq[open] summary::after { content: ' ▴'; }
.nm-exam .nm-exa { margin: 6px 0 4px; padding: 6px 10px; border-inline-start: 2px solid var(--signal); }
.nm-bqw .nm-bqsrc { margin-top: 2px; }
.nm-bqw .nm-bqsrc summary { cursor: pointer; list-style: none; }
.nm-bqw .nm-bqsrc summary::-webkit-details-marker { display: none; }
.nm-bqw .nm-bqsrc summary::after { content: ' ▾ اعرضها'; font-size: 0.8rem; color: var(--signal); }
.nm-bqw .nm-bqsrc[open] summary::after { content: ' ▴'; }
.dv-fun { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; padding: 10px 14px; border-radius: var(--radius); background: rgba(255, 138, 128, 0.07); border: 1px dashed rgba(255, 138, 128, 0.5); }
.dv-fun p { margin: 0; }
.dv-fun .dv-fi { font-size: 1.3rem; line-height: 1.5; }
.dv-fun b { color: var(--pos); }
/* الرسوم المتحركة الصغيرة في القواعد (SMIL داخل SVG) */
.dv-fan { fill: var(--ink-soft); }
.dv-fan.me { fill: var(--signal); }
.dv-body { stroke: var(--ink-soft); stroke-width: 3; stroke-linecap: round; }
.dv-body.me { stroke: var(--signal); }
.dv-foot-r { fill: var(--signal); }
.dv-foot-l { fill: var(--neg); }
.dv-ring { fill: none; stroke: var(--ok); stroke-width: 2; }
.dv-ring.bad { stroke: var(--pos); }
.dv-brick .katex, .dv-book .katex, .dv-chat .katex, .dv-exam .katex { white-space: nowrap; }   /* المعادلة القصيرة لا تنقسم بين سطرين */
/* جواب «اختبر فهمك»، والحل الرقمي المرتب calc(): خطوات مرقمة، كل معادلة في سطر مستقل، والناتج مميز، ثم «المعنى» */
.dv-ans { padding: 0 14px 10px; }
.dv-ans > :last-child { margin-bottom: 0; }
.dv-ans > p + p, .dv-ans > p + .dv-calc, .dv-ans > .dv-calc + p { margin-top: 8px; }
.dv-calc { display: grid; gap: 8px; margin: 6px 0 2px; }
.dv-cs { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 0 10px; align-items: start; }
.dv-ci { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); border: 1px solid var(--line-strong); background: var(--inset); }
.dv-cb { min-width: 0; }
.dv-cl { margin: 1px 0 0; font-weight: 700; color: var(--ink-soft); line-height: 1.6; }
.dv-ce { overflow-x: auto; }
.dv-ce .katex-display { margin: 4px 0 0; }
.dv-cr .dv-ci { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.dv-cr .dv-ce { border: 1px solid var(--signal); border-radius: var(--radius); background: var(--signal-soft); padding: 2px 8px; margin-top: 4px; }
.dv-cr .dv-ce .katex-display { margin: 2px 0; }
.dv-cn { margin: 2px 0 0; line-height: 1.8; }
@media (max-width: 640px) {
    /* على الهاتف: القاعدة أضيق حشواً، والرسم داخلها يمتد إلى حافتيها، كي لا تصغر كتابة الأشكال العريضة */
    .dv-brick { padding: 12px 10px; }
    .dv-bb .figure { margin-inline: -8px; padding-inline: 4px; }
}

/* =========================================================
   المشاهد ثلاثية الأبعاد (js/sims-3d.js) والجولة الموجهة «خطوة بخطوة»
   ========================================================= */
.s3-host { position: relative; }
.s3-wrap { position: relative; height: var(--s3-h, 360px); max-height: 70vh; border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: radial-gradient(120% 90% at 50% 35%, rgba(124, 199, 255, 0.08), transparent 60%), var(--screen); overflow: hidden; }
@media (max-width: 600px) { .s3-wrap { height: min(var(--s3-h, 360px), 78vw); } }
.s3-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.s3-canvas:active { cursor: grabbing; }
.s3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.s3-label { position: absolute; left: 0; top: 0; padding: 1px 6px; border-radius: 2px; font-size: 0.8rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
    color: var(--ink); background: rgba(7, 26, 48, 0.72); border: 1px solid var(--line); }
.s3-label.sig { color: var(--signal); border-color: rgba(255, 197, 61, 0.45); }
.s3-label.cy { color: #7CC7FF; border-color: rgba(124, 199, 255, 0.45); }
.s3-label.pk { color: #FF9EC8; border-color: rgba(255, 126, 182, 0.45); }
.s3-label.ok { color: var(--ok); border-color: rgba(95, 211, 154, 0.45); }
.s3-label.plain { background: none; border: none; }
.s3-tools { position: absolute; bottom: 8px; left: 8px; display: flex; gap: 3px; }
.s3-tools button { width: 28px; height: 28px; padding: 0; border-radius: 2px; border: 1px solid var(--line-strong); background: rgba(7, 26, 48, 0.8); color: var(--ink); font-size: 0.95rem; line-height: 1; cursor: pointer; }
.s3-tools button:hover, .s3-tools button:focus-visible { border-color: var(--signal); color: var(--signal); }
.s3-hint { position: absolute; top: 6px; right: 10px; left: 10px; margin: 0; font-size: 0.72rem; color: var(--ink-muted); pointer-events: none; text-align: right; }
@media (max-width: 600px) { .s3-hint { display: none; } .s3-tools button { width: 26px; height: 26px; font-size: 0.85rem; } }
.s3-loading, .s3-fail { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--ink-muted); font-size: 0.9rem; }
.s3-host > .s3-fail { position: static; min-height: 120px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.s3-steps { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raise); }
.s3-sbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.s3-sbar button { white-space: nowrap; padding: 6px 12px; border-radius: 2px; border: 1px solid var(--line-strong); background: var(--inset); color: var(--ink); font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; }
.s3-sbar .s3-next { border-color: var(--signal); color: var(--signal); }
.s3-sbar button:disabled { opacity: 0.4; cursor: default; }
.s3-count { font-size: 0.85rem; color: var(--ink-muted); font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) { .s3-sbar button { padding: 5px 9px; font-size: 0.85rem; } .s3-count { font-size: 0.78rem; } }
.s3-dots { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.s3-dots button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--inset); color: var(--ink-muted); font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer; padding: 0; }
.s3-dots button.done { color: var(--ink); border-color: var(--ok); }
.s3-dots button.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 700; }
.s3-card { margin-top: 8px; }
.s3-t { margin: 0 0 4px; font-size: 1rem; color: var(--signal); }
.s3-d { margin: 0; line-height: 1.9; }

/* الفصل السادس: شريط رحلة من 12 محطة، و«تجربة فكرية» (مختبر الخيال) */
.tl-journey.tl-j12 ol { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 700px) { .tl-journey.tl-j12 ol { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tl-think { margin: 18px 0; padding: 14px 16px; border: 1px solid rgba(178, 140, 255, 0.45); border-right: 3px solid #B28CFF; border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(178, 140, 255, 0.08), rgba(178, 140, 255, 0.02)); }
.tl-think .tl-k { background: #B28CFF; color: #160c2e; }
.tl-think h4 { margin: 6px 0 6px; color: var(--ink); }
.tl-think > p:last-child, .tl-think > ol:last-child, .tl-think > ul:last-child { margin-bottom: 0; }
@media (max-width: 400px) { .tl-journey.tl-j12 li span.tl-st { font-size: 0.7rem; } }
.tl-journey.tl-j10 ol { grid-template-columns: repeat(5, minmax(0, 1fr)); }   /* الفصل السابع: 10 محطات في صفين */
@media (max-width: 700px) { .tl-journey.tl-j10 ol { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; } }
@media (max-width: 400px) { .tl-journey.tl-j10 li span.tl-st { font-size: 0.62rem; } }   /* «الترانزستور» في خانة من خمس على شاشة 360px */   /* «الكهروضوئية» في شريط الفصل السادس (12 محطة، 4 أعمدة) */
.tl-journey.tl-j15 ol { grid-template-columns: repeat(5, minmax(0, 1fr)); }   /* الفصل الثامن: 15 محطة في ثلاثة صفوف */
@media (max-width: 700px) { .tl-journey.tl-j15 ol { gap: 4px; } }
@media (max-width: 400px) { .tl-journey.tl-j15 li span.tl-st { font-size: 0.62rem; } }   /* «الهيدروجين» و«المنظومات» في خانة من خمس على شاشة 360px */
/* ---------- تخطيط موحّد لمختبرات الفصل السادس (.lx): المشهد والقراءات وأدوات التحكم في شاشة واحدة ----------
   .lx > .lx-view  (.lx-stage = المشهد + .lx-hud القراءات السريعة، ثم .lx-more رسم ثانٍ اختياري، ثم .lx-status، ثم .lx-note)
       > .lx-side  (.lx-tour الجولة، ثم .lx-ctl أدوات التحكم، ثم .lx-table جدول القراءات الكامل)
   - الحاسوب (≥1000px): عمودان؛ عمود المشهد ثابت أثناء التمرير، فكل أداة تحكم تُرى مع المشهد ونتيجتها.
   - الهاتف واللوحي: عمود واحد؛ المشهد مع قراءاته السريعة مثبّت أعلى الشاشة، والجولة والشرح والأدوات تمر تحته.
     إن ظهر رسم ثانٍ (.lx-more داخل .lx-stage) فإنه يأخذ مكان المشهد في الجزء المثبّت حتى يُخفى. */
.lx { --lx-h: clamp(180px, 34vh, 280px); display: flex; flex-direction: column; gap: 12px; text-align: right; }
@supports (height: 1svh) { .lx { --lx-h: clamp(180px, 34svh, 280px); } }
@supports (height: 1svh) { @media (max-width: 640px) { .lx { --lx-h: clamp(170px, 32svh, 270px); } } }
.lx-view, .lx-side { display: contents; }
.lx { overflow-anchor: none; }   /* لا «تثبيت تمرير» تلقائي: تغيّر طول نص الحالة أو الجولة لا يحرّك الصفحة تحت يد الطالب */
.lx-hud[hidden], .lx-hud > span[hidden] { display: none; }
.lx-stage { position: relative; }
.lx .s3-wrap { height: var(--lx-h); max-height: none; }
.lx-hud { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 6px; }
.lx-hud > span { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 2px;
    background: var(--inset); color: var(--ink-muted); font-size: 0.78rem; line-height: 1.8; white-space: nowrap; }
.lx-hud b { margin-right: 6px; font-family: var(--font-mono); font-weight: 600; font-size: 0.86rem; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.lx-hud b.ar { font-family: var(--font-body); font-weight: 700; direction: rtl; }
.lx-hud b.ar bdi { font-family: var(--font-mono); }   /* أرقام بأسس (10⁴) داخل قيمة عربية */
.lx-hud > span[hidden] { display: none; }
.lx-hud b.hot { color: var(--signal); }
.lx-hud b.ok { color: var(--ok); }
.lx-hud b.bad { color: var(--bad); }
.lx-more[hidden] { display: none; }
.lx-x { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--inset);
    color: var(--ink-soft); font: inherit; font-size: 0.78rem; cursor: pointer; }
.lx-x:hover, .lx-x:focus-visible { border-color: var(--signal); color: var(--signal); }
.lx .fc-status { margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raise); }
.lx-note { margin: 0; font-size: 0.8rem; color: var(--ink-muted); line-height: 1.7; }
.lx .s3-steps { margin: 0; }
.lx .s3-d { font-size: 0.94rem; line-height: 1.85; }
.lx .s3-d bdi, .lx .fc-status bdi { white-space: nowrap; }   /* معادلة قصيرة مثل p = h/λ لا تنقسم بين سطرين */
.lx .fc-controls { padding: 14px; }
.lx-table.sim-table { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lx-table.sim-table > div { padding: 5px 9px; }
.lx-table.sim-table b { font-size: 0.98rem; overflow-wrap: anywhere; }
/* شريط تمرير مضغوط: العنوان وقيمته في سطر واحد، والشريط تحتهما */
.lx-sl { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 10px; margin-bottom: 8px; }
.lx-sl > label { grid-column: 1; grid-row: 1; margin: 0; }
.lx-sl > .sp-value { grid-column: 2; grid-row: 1; margin: 0; color: var(--signal); font-size: 0.92rem; white-space: nowrap; }
.lx-sl > input[type="range"] { grid-column: 1 / -1; grid-row: 2; margin: 2px 0 0; }
.lx-sl > :not(label):not(.sp-value):not(input) { grid-column: 1 / -1; }
.lx-h { margin: 12px 0 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 0.8rem; font-weight: 700; color: var(--ink-muted); }
.lx-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.lx-2d > svg, .lx-2d > canvas { display: block; width: 100%; height: auto; max-height: var(--lx-h); margin-inline: auto; }
.lx-sw { display: none; }
@media (max-width: 999px) {
    .lx-sw { display: flex; gap: 4px; margin: 0 0 6px; }
    .lx-sw button { flex: 1; height: 30px; line-height: 1; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--inset); color: var(--ink-soft);
        font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
    .lx-sw button.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
    .lx-stage:not([data-v="more"]) > .lx-more.lx-alt { display: none; }
    .lx-stage[data-v="more"] > .lx-more.lx-alt { top: 42px; }   /* 6px حشوة + 30px المبدّل + 6px */
}
@media (max-width: 640px) {
    .lx { --lx-h: clamp(170px, 32vh, 270px); }
    .lx-hud { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
    .lx-hud > span { display: block; padding: 0 6px; font-size: 0.72rem; }   /* الاسم يميناً والقيمة يساراً (الاسم قد يكون نصاً و<bdi> معاً) */
    .lx-hud b { float: left; margin-right: 4px; font-size: 0.8rem; }
    .lx-hud > .lx-wide { grid-column: 1 / -1; }   /* قيمة طويلة (مثل 2.6×10⁻³⁴ kg·m/s) تأخذ سطراً كاملاً */
}
@media (max-width: 999px) {
    .lx-view > *, .lx-side > * { order: 5; }   /* عنصر بلا كلاس ترتيب: بعد أدوات التحكم (لا يقفز فوق المشهد المثبّت) */
    .lx-stage { order: 1; position: sticky; top: var(--nav-h); z-index: 4; margin-inline: -12px; padding: 6px 12px 7px; background: var(--screen);
        border-bottom: 1px solid var(--line-strong); box-shadow: 0 12px 14px -12px rgba(0, 0, 0, 0.75); }
    .lx-tour { order: 2; } .lx-status { order: 3; } .lx-ctl { order: 4; } .lx-table { order: 5; } .lx-note { order: 6; } .lx-after { order: 7; }
    .lx-stage > .lx-more:not([hidden]) { position: absolute; z-index: 3; top: 6px; left: 12px; right: 12px; height: var(--lx-h); overflow: auto;
        display: flex; flex-direction: column; justify-content: center; padding: 6px; background: var(--screen); border: 1px solid var(--line-strong); border-radius: var(--radius); }
    .lx-stage > .lx-more svg { max-height: calc(var(--lx-h) - 44px); width: 100%; }
}
@media (min-width: 641px) and (max-width: 999px) { .lx { --lx-h: clamp(220px, 38vh, 380px); } .lx-stage { margin-inline: -24px; padding-inline: 24px; } .lx-stage > .lx-more:not([hidden]) { left: 24px; right: 24px; } }
@media (max-width: 999px) {   /* شريط الأقسام العائم يظهر عند السحب للأعلى: ينزل المشهد المثبّت تحته */
    .lx-stage { transition: top 0.22s ease; }
    .tf-on .lx-stage { top: calc(var(--nav-h) + var(--tf-h)); }
}
@media (max-width: 999px) and (max-height: 560px) { .lx-stage { position: relative; } }   /* هاتف أفقي: لا مساحة لتثبيت المشهد */
@media (min-width: 1000px) {
    .lx { --lx-h: clamp(260px, calc(100vh - var(--nav-h) - 300px), 470px); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
    .lx-view { display: flex; flex-direction: column; gap: 10px; min-width: 0; position: sticky; top: calc(var(--nav-h) + 12px);
        max-height: calc(100vh - var(--nav-h) - 24px); overflow-y: auto; scrollbar-width: thin; }
    .lx-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
    .lx-stage:has(> .lx-more:not([hidden])) .s3-wrap { height: calc(var(--lx-h) * 0.62); }
    .lx-stage > .lx-more { margin-top: 8px; }
    .lx-stage > .lx-more svg { max-height: calc(var(--lx-h) * 0.5); }
    .tf-on .lx-view { top: calc(var(--nav-h) + var(--tf-h) + 12px); max-height: calc(100vh - var(--nav-h) - var(--tf-h) - 24px); }
}

/* =========================================================
   حركة الرسوم (js/fig-motion.js): الرسم يتحرك حركته الفيزيائية عند مرور المؤشر عليه (وعلى الهاتف: لمسة تشغّل ولمسة توقف)
   ========================================================= */
.mo-fig { position: relative; }
.mo-fig:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.mo-only { visibility: hidden; }
.mo-fig.is-playing .mo-only { visibility: visible; }
/* العلامة تجلس على الحافة العليا للرسم (نصفها فوق الإطار) فلا تغطي شيئاً من الرسم نفسه */
.mo-badge { position: absolute; top: -10px; left: 10px; z-index: 2; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--screen);
    color: var(--ink-muted); font-size: 0.7rem; line-height: 1.8; pointer-events: none; transition: opacity 0.2s; }
.mo-fig.is-playing .mo-badge { color: var(--signal); border-color: rgba(255, 197, 61, 0.45); }
@media (hover: hover) and (pointer: fine) { .mo-fig.is-playing .mo-badge { opacity: 0; } }
.mo-badge--icon { top: -10px; left: 6px; width: 20px; height: 20px; padding: 0; text-align: center; line-height: 18px; font-size: 0.68rem; }
@media (max-width: 640px) { .mo-badge:not(.mo-badge--icon) { font-size: 0.66rem; } }
@media (prefers-reduced-motion: reduce) { .mo-badge { display: none; } }


/* new method (شرح وتبسيط): shared components */
.nm-card { border: 1px solid var(--line-strong); border-right: 3px solid var(--signal); border-radius: var(--radius); background: var(--inset); padding: 14px 18px; margin: 0 0 22px; line-height: 1.9; color: var(--ink-soft); }
.nm-card b { color: var(--ink); }
.nm-card p { margin: 0 0 10px; }
.nm-card ol { margin: 0 0 12px; padding-right: 22px; display: flex; flex-direction: column; gap: 4px; }
.nm-card .nm-how { margin: 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.nm-pn { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--screen); background: var(--neg); padding: 2px 8px; border-radius: 2px; margin-left: 8px; vertical-align: 3px; font-family: var(--font-body); }
.nm-done { margin: 8px 0 0; padding: 8px 14px; color: var(--ok); background: rgba(95, 211, 154, 0.06); border: 1px solid rgba(95, 211, 154, 0.35); border-radius: var(--radius); font-weight: 600; line-height: 1.8; }
.nm-bq { margin: 14px 0 0; padding: 10px 14px; border: 1px solid var(--signal); border-radius: 2px; background: rgba(255, 197, 61, 0.05); }
.nm-bql { display: block; font-size: 0.8rem; font-weight: 700; color: var(--signal); margin-bottom: 4px; }
.nm-bq p { margin: 0 0 6px; color: var(--ink); line-height: 1.9; }
.nm-bq p:last-child { margin-bottom: 0; }
.nm-bqa .nm-bqq { margin: 0 0 8px; padding-bottom: 7px; border-bottom: 1px dashed var(--signal); color: var(--ink); font-size: 0.95rem; line-height: 1.8; }
.nm-bqa .nm-bqq b { color: var(--signal); }
.nm-bqw .nm-bqans { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--signal) 12%, transparent); border-inline-start: 3px solid var(--signal); color: var(--ink); line-height: 1.9; }
.nm-bqw .nm-bqans b { color: var(--signal); }
.nm-bqw .nm-bqans-blk .table-wrap { margin-bottom: 6px; background: var(--sheet); }
.nm-bqw .nm-bqans-blk .table-wrap b { color: inherit; }
.nm-bqw .nm-bqans-blk > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {   /* الجدول داخل إطارين: نضيّق الحواشي لئلا يصير أعرض من الشاشة */
    .nm-bqw .nm-bqans-blk { padding: 8px 5px 6px; }
    .nm-bqw .nm-bqans-blk .data-table { font-size: 0.88rem; }
    .nm-bqw .nm-bqans-blk .data-table th, .nm-bqw .nm-bqans-blk .data-table td { padding: 6px 5px; }
}
.nm-fold { margin-top: 10px; }
.nm-fold > summary { color: var(--ink-soft); font-size: 0.93rem; }
.nm-fold > div > :last-child { margin-bottom: 0; }
.nm-math > summary { color: var(--neg); }
.nm-warn { margin: 12px 0 0; padding: 8px 12px; border-right: 3px solid var(--signal); background: var(--signal-soft); border-radius: 2px; line-height: 1.9; color: var(--ink-soft); }
.nm-warn b { color: var(--ink); }
.nm-words { text-align: center; font-size: 1.06rem; padding: 8px 10px; margin: 6px 0 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--inset); color: var(--ink); }
.nm-chain { margin: 10px 0 12px; padding: 0; list-style: none; counter-reset: nm; display: flex; flex-direction: column; gap: 6px; }
.nm-chain > li { counter-increment: nm; position: relative; padding: 8px 46px 8px 12px; background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.85; color: var(--ink-soft); }
.nm-chain > li::before { content: counter(nm); position: absolute; right: 10px; top: 9px; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: var(--neg); color: var(--screen); font-weight: 700; font-size: 0.85rem; font-family: var(--font-mono); }
.nm-chain > li b { color: var(--ink); }
.nm-tag { margin: 6px 0 12px; font-size: 0.9rem; color: var(--ink-muted); }
.nm-tag.key { color: var(--signal); font-weight: 600; }
.nm-ex { direction: ltr; text-align: center; margin: 4px 0 12px; }
.nm-ld td, .nm-ld th { text-align: center; padding: 6px 5px; font-size: 0.88rem; }
.nm-deep { margin-top: 30px; }
.nm-deep h4 { margin-top: 18px; }
/* new method css: chapter 5 */
/* 2-5: جدول القسمة الطويلة داخل جواب «اختبر فهمك» أضيق قليلاً على الهاتف */
.m41n-ld .data-table th, .m41n-ld .data-table td { padding: 8px 5px; }
/* new method css: chapter 9 */
/* ----- 8_0 «1-9 مقدمة»: رسوم الدرس ومختبر النواة (atom-zoom-lab) ----- */
/* النيوكليونات بعرف الفصل التاسع (كـ m82-p وm82-n): البروتون أحمر عليه +، والنيوترون رمادي بلا علامة؛ والإلكترون سماوي (سالب) */
.m80-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.9; }
.m80-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.9; }
.m80-hl { fill: rgba(255, 255, 255, 0.2); pointer-events: none; }
.m80-plus { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m80-e { fill: #7CC7FF; }
.m80-nuc { fill: #F2685A; stroke: #FFC4BC; stroke-width: 1; }
.t-ar.m80-tp { fill: #FF9A8E; font-weight: 700; }
.t-ar.m80-tn { fill: #C3CEDA; font-weight: 700; }
.m80-orb { fill: none; stroke: rgba(124, 199, 255, 0.5); stroke-width: 1.2; }
.m80-orb2 { fill: none; stroke: rgba(124, 199, 255, 0.32); stroke-width: 1; stroke-dasharray: 3 4; }
.m80-thom { fill: rgba(255, 138, 128, 0.16); stroke: rgba(255, 138, 128, 0.6); stroke-width: 1.2; }
.t-label.m80-tplus { fill: #FF9A8E; }
/* المفاعل والسحابة */
.m80-ground { stroke: var(--ink-muted); stroke-width: 1.4; }
.m80-dome { fill: #D9E1EA; stroke: #FFFFFF; stroke-width: 1; }
.m80-bld { fill: #AEBBCB; }
.m80-tower { fill: #9AAABD; stroke: #C9D4E0; stroke-width: 1; }
.m80-steamS { fill: none; stroke: rgba(235, 242, 250, 0.55); stroke-width: 5; stroke-linecap: round; }
.m80-steam { fill: rgba(235, 242, 250, 0.6); }
.m80-lamp { fill: var(--signal); filter: drop-shadow(0 0 4px var(--signal)); }
.m80-lampb { fill: var(--ink-muted); }
.m80-stem { fill: #D9773E; }
.m80-base { fill: rgba(217, 119, 62, 0.45); }
.m80-cap { fill: #E8914A; }
.m80-cap2 { fill: #FFC46B; }
.m80-cap3 { fill: rgba(140, 70, 40, 0.55); }
.m80-flash { fill: rgba(255, 236, 170, 0.55); }
/* مركبات اليورانيوم والإشعاع */
.m80-rock { fill: #A9B84E; stroke: #E2EA98; stroke-width: 1.2; stroke-linejoin: round; }
.m80-rock2 { fill: rgba(240, 250, 170, 0.35); }
.m80-dish { fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-linecap: round; }
.m80-ray { fill: none; stroke: rgba(214, 240, 120, 0.7); stroke-width: 1.6; stroke-dasharray: 5 4; }
.m80-rp { fill: #D6F078; }
.t-ar.m80-tray { fill: #D6F078; font-weight: 700; }
/* مسار الزمن */
.m80-tl { stroke: var(--ink-muted); stroke-width: 1.6; }
.m80-tlp { fill: var(--signal); }
.m80-fld { fill: rgba(255, 197, 61, 0.1); stroke: var(--signal); stroke-width: 1.2; }
.m80-fldi { fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* المختبر */
.m80-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m80-main { background: radial-gradient(circle at 50% 50%, rgba(124, 199, 255, 0.05), transparent 70%); }
.m80-markl { stroke: var(--signal); stroke-width: 1; stroke-dasharray: 3 3; }
.t-ar.m80-tmk { fill: var(--signal); }
.t-ar.m80-zt { fill: var(--ink-muted); }
.m80-ray .m80-rayp { fill: none; stroke: #D6F078; stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 3px #D6F078); }
.m80-foil { fill: rgba(255, 197, 61, 0.06); stroke: rgba(255, 197, 61, 0.3); stroke-width: 1; stroke-dasharray: 4 4; }
.m80-rat { fill: none; stroke: rgba(150, 190, 235, 0.18); stroke-width: 1; }
.m80-alpha { fill: #FF8AB6; stroke: #FFD0E2; stroke-width: 0.8; }
.m80-trail { fill: none; stroke: rgba(255, 138, 182, 0.55); stroke-width: 1.3; stroke-linejoin: round; }
.m80-trail.dv { stroke: rgba(255, 197, 61, 0.8); stroke-width: 1.6; }
.m80-trail.bk { stroke: #FFC53D; stroke-width: 2.2; }
.t-ar.m80-ta { fill: #FF8AB6; font-weight: 700; }
.fc-controls .fc-buttons.m80-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m80-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.fc-controls .fc-buttons.m80-two button { flex: 1 1 45%; }
.fc-controls .fc-buttons.m80-els5 button { flex: 1 1 30%; }
.fc-controls .fc-buttons.m80-btns button.on { background: var(--signal-soft); border-color: var(--signal); color: var(--signal); }
.m80-lab .lx-table.sim-table > .m80-w { grid-column: 1 / -1; }
.m80-lab .lx-table.sim-table b.ar { font-family: var(--font-body); font-weight: 700; direction: rtl; text-align: right; }
/* ----- 8_1 «2-9 تركيب النواة وخصائصها»: رسوم الدرس ومختبر النواة (nucleus-build-lab) ----- */
/* النيوكليونات بعرف الفصل التاسع (كـ m82-p وm82-n): البروتون أحمر عليه +، والنيوترون رمادي بلا علامة */
.m81-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.9; }
.m81-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.9; }
.m81-hl { fill: rgba(255, 255, 255, 0.2); pointer-events: none; }
.m81-plus { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m81-nb { fill: rgba(242, 104, 90, 0.06); stroke: rgba(255, 196, 188, 0.45); stroke-width: 1; stroke-dasharray: 4 3; }
.t-ar.m81-tp { fill: #FF9A8E; font-weight: 700; }
.t-ar.m81-tn { fill: #C3CEDA; font-weight: 700; }
.m81-brace { fill: none; stroke: var(--signal); stroke-width: 1.4; }
.t-label.m81-nsym { fill: var(--ink); font-family: var(--font-body); font-weight: 600; }
.t-label.m81-big { fill: var(--ink); font-family: var(--font-body); font-weight: 700; }
.t-label.m81-bigA, .t-ar.m81-tA { fill: var(--signal); font-weight: 700; }
.t-label.m81-bigZ, .t-ar.m81-tZ { fill: #FF9A8E; font-weight: 700; }
/* استطارة جسيمات ألفا */
.m81-au { fill: #F2685A; stroke: #FFC4BC; stroke-width: 1.2; }
.t-label.m81-plusd { fill: #3A0C08; font-weight: 700; }
.m81-alpha { fill: #FF8AB6; stroke: #FFD0E2; stroke-width: 0.8; }
.m81-path { fill: none; stroke-width: 1.4; stroke-dasharray: 5 4; }
.m81-pa { stroke: rgba(255, 138, 182, 0.6); }
.m81-pd { stroke: rgba(255, 197, 61, 0.75); }
.m81-pb { stroke: var(--signal); stroke-width: 1.8; }
.t-ar.m81-ta { fill: #FF8AB6; font-weight: 700; }
.t-ar.m81-tdv { fill: rgba(255, 197, 61, 0.9); }
/* الشكل (7) */
.m81-dash { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.m81-c { fill: var(--signal); }
/* معادلات الفيرمي (نص عربي مع صيغة) */
.m81-eq, .m81-eqs p { text-align: center; margin: 4px 0 10px; }
.m81-eqs { margin: 4px 0 6px; }
/* المختبر */
.m81-svg, .m81-csvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m81-rl { stroke: var(--signal); stroke-width: 2; }
.m81-dim { stroke: var(--signal); stroke-width: 1.2; }
.t-label.m81-rt { fill: var(--signal); font-weight: 700; }
.m81-sb { stroke: var(--ink-muted); stroke-width: 2; }
.t-label.m81-sA { fill: var(--signal); font-family: var(--font-body); font-weight: 700; }
.t-label.m81-sZ { fill: #FF9A8E; font-family: var(--font-body); font-weight: 700; }
.t-label.m81-sX { fill: var(--ink); font-family: var(--font-body); font-weight: 700; }
.t-ar.m81-nm { fill: var(--ink); font-weight: 700; }
.t-ar.m81-cnt { fill: var(--ink-soft); }
.t-label.m81-eqA { fill: var(--ink-soft); }
.m81-chart svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.m81-gl { stroke: rgba(150, 190, 235, 0.1); stroke-width: 1; }
.m81-ax { stroke: var(--ink-muted); stroke-width: 1.4; }
.m81-curve { fill: none; stroke: #7CC7FF; stroke-width: 2.2; }
.m81-bk { fill: var(--ink-muted); }
.m81-cur { stroke: var(--signal); stroke-width: 1; stroke-dasharray: 3 3; }
.m81-now { fill: var(--signal); stroke: #FFF0B8; stroke-width: 1.2; }
.t-label.m81-nowt { fill: var(--signal); font-weight: 700; }
.fc-controls .fc-buttons.m81-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m81-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.fc-controls .fc-buttons.m81-btns button:disabled { opacity: 0.4; cursor: not-allowed; }
.fc-controls .fc-buttons.m81-four button { flex: 1 1 45%; }
.fc-controls .fc-buttons.m81-pre button { flex: 1 1 45%; }
.fc-controls .fc-buttons.m81-li button { flex: 1 1 28%; font-size: 1rem; }
.fc-controls .fc-buttons.m81-btns button.on { background: var(--signal-soft); border-color: var(--signal); color: var(--signal); }
.m81-lab .lx-table.sim-table > .m81-w { grid-column: 1 / -1; }
.m81-lab .lx-table.sim-table b.ar { font-family: var(--font-body); font-weight: 700; direction: rtl; text-align: right; }
/* الحاسوب: النواة فوق منحني نصف القطر في عمود المشهد، وكلاهما مع القراءات ضمن الشاشة */
@media (min-width: 1000px) {
    .m81-lab .m81-main > svg { max-height: calc(var(--lx-h) * 0.56); }
    .m81-lab .m81-chart svg { max-height: calc(var(--lx-h) * 0.44); }
    .m81-lab .lx-stage > .m81-chart { margin-top: 4px; }
}
/* الهاتف: حين يختار الطالب «منحني نصف القطر» يحل المنحني محل النواة في الجزء المثبّت */
@media (max-width: 999px) {
    .m81-lab .lx-stage[data-v="more"] > .m81-main { display: none; }
    .m81-lab .lx-stage[data-v="more"] > .m81-chart.lx-more { position: static; height: auto; margin: 0; padding: 0; border: 0; background: none; display: block; }
    .m81-lab .lx-stage > .m81-chart svg { max-height: var(--lx-h); }
}
/* 8-9 مخاطر وفوائد الاشعاع النووي: رسوم الدرس ومختبر الوقاية (rad-safety-lab). الإشعاع النووي برتقالي (لون أشعة كاما في الفصل)،
   والإلكترون سماوي، والمصدر المشع نجمة حمراء عليها علامة الإشعاع، والحاجز رصاصي رمادي، والمنطقة الآمنة صفراء باهتة */
.m810-star { fill: #F2685A; stroke: #FFC4BC; stroke-width: 1; stroke-linejoin: round; }
.m810-trek { fill: #3A0C08; }
.m810-tre { fill: var(--signal); }
.m810-gam { fill: none; stroke: #FFB347; stroke-width: 2; stroke-linecap: round; }
.m810-gamh { fill: #FFB347; }
.m810-path { stroke: rgba(255, 179, 71, 0.28); stroke-width: 1; stroke-dasharray: 3 4; }
.m810-mot { stroke: var(--ink-muted); stroke-width: 1.1; stroke-dasharray: 3 3; }
.m810-man, .m810-man circle, .m810-man path { fill: #7F93AA; }
.m810-mans circle, .m810-mans path { fill: #C3D2E2; }
.m810-sky { fill: rgba(3, 10, 22, 0.55); }
.m810-starlet { fill: #EAF1F8; opacity: 0.8; }
.m810-ground { fill: #4A3A2C; }
.m810-rock { fill: #6E5A47; stroke: #8E7660; stroke-width: 1; }
.m810-rockh { fill: #6E5A47; stroke: #FFB347; stroke-width: 1.4; }
.m810-hot { fill: #FFB347; }
.m810-dev { fill: #3F5068; stroke: var(--ink-muted); stroke-width: 1; }
.m810-bed { fill: #8C9BAE; }
.m810-leg { stroke: #8C9BAE; stroke-width: 3; }
.m810-blanket { fill: #3F8A5C; stroke: #6CC08C; stroke-width: 1; }
.m810-skin { fill: #E8C9A0; stroke: #A27B5A; stroke-width: 1; }
.m810-arch { fill: none; stroke: #C3D2E2; stroke-width: 6; stroke-linecap: round; }
.m810-beam { stroke: rgba(255, 179, 71, 0.55); stroke-width: 1.4; }
.m810-head { fill: #EAF1F8; stroke: #3F5068; stroke-width: 1; }
.m810-target { fill: #FFB347; }
.m810-cell { fill: rgba(242, 167, 160, 0.08); stroke: rgba(242, 167, 160, 0.55); stroke-width: 1.5; }
.m810-orb { fill: none; stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.m810-nucl { fill: #F2685A; stroke: #FFC4BC; stroke-width: 1; }
.m810-e { fill: #7CC7FF; }
.m810-hole { fill: none; stroke: #7CC7FF; stroke-width: 1.2; stroke-dasharray: 2 2; }
.t-ar.m810-cy { fill: #7CC7FF; }
.t-ar.m810-red { fill: #FF8A80; }
.t-ar.m810-ok { fill: var(--ok); }
.t-ar.m810-bad { fill: var(--bad); }
.m810-safe { fill: rgba(255, 220, 90, 0.16); stroke: rgba(255, 220, 90, 0.4); stroke-width: 1; }
.m810-arc { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.m810-axis { stroke: var(--ink-soft); stroke-width: 1.4; }
.m810-tick { stroke: var(--ink-soft); stroke-width: 1.2; }
.m810-band { fill: rgba(242, 104, 90, 0.22); stroke: rgba(242, 104, 90, 0.5); stroke-width: 1; }
.m810-disc { fill: #F2EDE4; stroke: #8C9BAE; stroke-width: 1; }
.m810-rarr { stroke: #FF7EB6; stroke-width: 3; }
.m810-wall { fill: #5B6573; stroke: #AEB8C4; stroke-width: 1.2; }
.m810-lead { stroke: var(--ink-muted); stroke-width: 1; }
.m810-clock { fill: none; stroke: var(--ink-soft); stroke-width: 1.4; }
.m810-ctick { fill: var(--ink-soft); }
.m810-hand { stroke: var(--signal); stroke-width: 1.8; stroke-linecap: round; }
.m810-tray { fill: rgba(95, 211, 154, 0.12); stroke: #5FD39A; stroke-width: 2; }
.m810-berry { fill: #E8413A; stroke: #FF8A80; stroke-width: 0.6; }
.m810-berryb { fill: #7A3A3E; stroke: #9C6A6A; stroke-width: 0.6; }
.m810-leaf { fill: #4CB06A; }
.m810-leafb { fill: #6E7A50; }
.m810-seed { fill: #FFE08A; }
.m810-mold { fill: rgba(240, 244, 248, 0.75); }
.m810-space { fill: #050E1C; stroke: var(--line); stroke-width: 1; }
.m810-dish { fill: #C3D2E2; stroke: #EAF1F8; stroke-width: 1; }
.m810-strut { stroke: #D9B45A; stroke-width: 2; }
.m810-body { fill: #D9B45A; stroke: #F2D68A; stroke-width: 1; }
.m810-water { fill: rgba(38, 112, 176, 0.35); stroke: var(--line); stroke-width: 1; }
.m810-hull { fill: #24405E; stroke: #7CA6CF; stroke-width: 1.2; }
.m810-prop { fill: #AEB8C4; }
.m810-bub { fill: none; stroke: #BFE3FF; stroke-width: 1; }

/* المختبر: الوقاية من الإشعاع النووي الخارجي */
.m810-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m810-floor { stroke: var(--ink-muted); stroke-width: 1.4; }
.m810-pot { fill: #3A3F47; stroke: #AEB8C4; stroke-width: 1; }
.m810-ray { fill: #FFB347; }
.m810-rayb { fill: #FFB347; opacity: 0.55; }
.m810-hit { fill: none; stroke: #FF7B7B; stroke-width: 2; }
.m810-dial { fill: rgba(255, 255, 255, 0.03); stroke: var(--ink-soft); stroke-width: 1.4; }
.m810-fill { fill: rgba(255, 197, 61, 0.28); }
.m810-meter { fill: rgba(255, 255, 255, 0.04); stroke: var(--line-strong); stroke-width: 1; }
.m810-mbar { fill: #FF7B7B; }
.fc-controls .fc-buttons.m810-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m810-btns button { flex: 1 1 45%; padding: 7px 4px; font-size: 0.84rem; min-width: 0; line-height: 1.25; }
.m810-lab .lx-table .m810-w { grid-column: 1 / -1; }
.m810-log { margin: 0; padding: 0; list-style: none; font-size: 0.82rem; }
.m810-log li { padding: 2px 0; border-bottom: 1px dashed var(--line); }
.m810-log li:last-child { border-bottom: 0; }
.m810-log em { font-style: normal; font-weight: 700; color: var(--signal); }
/* 3-9 طاقة الربط النووية: رسوم الدرس ومختبر الميزان (binding-energy-lab) — البروتون أحمر عليه +، والنيوترون رمادي مزرق،
   والقوة النووية صفراء، والتنافر الكهربائي وردي، والطاقة المتحررة موجة صفراء فاتحة */
.m82-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.9; }
.m82-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.9; }
.m82-pt { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m82-hl { stroke: var(--signal); stroke-width: 2.6; }
.m82-att { stroke: var(--signal); stroke-width: 2.6; fill: none; }
.m82-rep { stroke: var(--pos); stroke-width: 1.7; fill: none; }
.m82-repd { stroke: var(--pos); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.7; }
.m82-en { fill: none; stroke: #FFF0B8; stroke-width: 2; stroke-linecap: round; }
.m82-enh { fill: #FFF0B8; }
.m82-str { stroke: var(--ink-muted); stroke-width: 1; }
.m82-pan { fill: #6E7C8E; stroke: var(--ink-soft); stroke-width: 1; }
.m82-beam { stroke: var(--ink-soft); stroke-width: 4; stroke-linecap: round; }
.m82-stand { fill: #8C6A4A; stroke: #C9A27A; stroke-width: 1.2; stroke-linejoin: round; }
.m82-pivot { fill: #C9A27A; stroke: var(--screen); stroke-width: 1.5; }
.m82-grid { stroke: rgba(150, 190, 235, 0.1); stroke-width: 1; }
.m82-ax { stroke: var(--ink-muted); stroke-width: 1.4; }
.m82-curve { fill: none; stroke: #6FB8F0; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.m82-dot { fill: var(--ink); stroke: var(--screen); stroke-width: 1; }
.m82-arr { fill: none; stroke: var(--signal); stroke-width: 2; stroke-dasharray: 6 4; }
.m82-mv { fill: var(--signal); }
.m82-svg, .m82-csvg { direction: ltr; user-select: none; -webkit-user-select: none; }
/* المختبر */
.m82-sel { stroke: var(--signal); stroke-width: 2; stroke-dasharray: 4 3; fill: none; }
.m82-selc { fill: var(--signal); stroke: var(--screen); stroke-width: 1.5; }
.m82-band { fill: rgba(255, 197, 61, 0.07); }
.m82-strip { fill: rgba(255, 255, 255, 0.025); stroke: var(--line); stroke-width: 1; }
.m82-chart svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.fc-controls .fc-buttons.m82-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m82-btns button { padding: 6px 4px; font-size: 0.84rem; min-width: 0; line-height: 1.25; }
.fc-controls .fc-buttons.m82-nucs button { flex: 1 1 30%; }
.fc-controls .fc-buttons.m82-two button { flex: 1 1 45%; }
.m82-nucs button small { display: block; font-size: 0.7rem; color: var(--ink-muted); }
.m82-nucs button.fc-primary small { color: inherit; }
.m82-lab .lx-table .m82-w { grid-column: 1 / -1; }
/* الحاسوب: الميزان فوق المنحني في عمود المشهد */
@media (min-width: 1000px) {
    .m82-lab .m82-main > svg { max-height: calc(var(--lx-h) * 0.62); }
    .m82-lab .m82-chart svg { max-height: calc(var(--lx-h) * 0.45); }
    .m82-lab .lx-stage > .m82-chart { margin-top: 4px; }
}
/* الهاتف: حين يختار الطالب «المنحني» يحل محل الميزان في الجزء المثبّت */
@media (max-width: 999px) {
    .m82-lab .lx-stage[data-v="more"] > .m82-main { display: none; }
    .m82-lab .lx-stage[data-v="more"] > .m82-chart.lx-more { position: static; height: auto; margin: 0; padding: 0; border: 0; background: none; display: block; }
    .m82-lab .lx-stage > .m82-chart svg { max-height: var(--lx-h); }
}
.m82-att2 { stroke-width: 3.4; }
/* 4-9 الانحلال الاشعاعي: رسوم الدرس ومختبر «رف النوى» (radio-decay-lab). البروتون أحمر عليه + والنيوترون رمادي (اصطلاح الفصل كما في m82-)،
   وجسيمة بيتا السالبة سماوية والموجبة وردية، وأشعة كاما برتقالية، والنواة غير المستقرة تحيط بها حلقة متقطعة صفراء في المختبر */
.m83-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.9; }
.m83-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.9; }
.m83-pt { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m83-beta { fill: #7CC7FF; }
.m83-pos { fill: #FF7EB6; }
.m83-gam { fill: none; stroke: #FFB347; stroke-width: 2; stroke-linecap: round; }
.m83-gamh { fill: #FFB347; }
.m83-mot { stroke: var(--ink-muted); stroke-width: 1.2; stroke-dasharray: 3 3; fill: none; }
.m83-nl text { fill: var(--ink); font-family: 'Times New Roman', serif; }
.m83-nl.t-amber text { fill: var(--signal); }
.t-ar.m83-ok, .t-label.m83-ok { fill: var(--ok); }
.t-ar.m83-bad { fill: var(--bad); }
.m83-div { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.m83-table { stroke: var(--ink-muted); stroke-width: 2; }
.m83-pencil { fill: #F2C14E; stroke: #A27B1E; stroke-width: 1; }
.m83-pline { stroke: #C99A2E; stroke-width: 1; }
.m83-wood { fill: #E8C9A0; stroke: #A27B1E; stroke-width: 0.8; }
.m83-lead { fill: #3A3F47; }
.m83-eraser { fill: #FF8FA3; stroke: #C9566C; stroke-width: 0.8; }
.m83-ring { fill: none; stroke: var(--signal); stroke-width: 1.4; stroke-dasharray: 4 4; }
.m83-halo { fill: rgba(255, 179, 71, 0.16); stroke: rgba(255, 179, 71, 0.7); stroke-width: 1.2; }
.m83-flash { fill: none; stroke: #FFFFFF; stroke-width: 1.6; }
.m83-nlg { fill: var(--ink); font-family: 'Times New Roman', serif; font-style: italic; }
.m83-bar { stroke: var(--ink); stroke-width: 1.2; }
.t-ar.m83-big { fill: var(--signal); font-weight: 700; }

/* المختبر */
.m83-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.fc-controls .fc-buttons.m83-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m83-shelf button { padding: 5px 2px; font-size: 0.8rem; line-height: 1.3; min-width: 0; }
.m83-shelf button bdi { display: block; font-family: 'Times New Roman', serif; font-size: 1.02rem; font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.m83-shelf button small { display: block; font-weight: 500; font-size: 0.7rem; color: var(--ink-muted); }
.m83-shelf button.on { background: var(--signal-soft); border-color: var(--signal); color: var(--signal); }
.m83-shelf button.on small { color: var(--signal); }
.fc-controls .fc-buttons.m83-one { margin: 0 0 6px; }
.fc-controls .fc-buttons.m83-one button { padding: 8px 6px; font-size: 0.86rem; }
.m83-lab .lx-table .m83-w { grid-column: 1 / -1; }
.m83-lab .lx-hud b.h-n { font-family: 'Times New Roman', serif; font-size: 1rem; }
@media (max-width: 400px) { .fc-controls .fc-buttons.m83-shelf button { font-size: 0.74rem; } .m83-shelf button bdi { font-size: 0.95rem; } }
/* 1-4-9 انحلال الفا: رسوم الدرس ومختبر «انحلال الفا» (alpha-decay-lab). البروتون أحمر عليه + والنيوترون رمادي (اصطلاح الفصل كما في m82-) (كما في درس الانحلال الاشعاعي)،
   وفي رسم المثال (4) الراديوم أخضر والرادون أزرق وجسيمة الفا حمراء كما في الكتاب؛ والميزان صورة طاقة الانحلال */
.m84-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.9; }
.m84-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.9; }
.m84-pt { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m84-mot { stroke: var(--ink-muted); stroke-width: 1.2; stroke-dasharray: 3 3; fill: none; }
.m84-nl text { fill: var(--ink); font-family: 'Times New Roman', serif; }
.m84-nl.m84-dark text { fill: #0B2747; font-weight: 700; }
.m84-sym { fill: var(--ink); font-family: 'Times New Roman', serif; font-style: italic; }
.m84-sym.t-amber { fill: var(--signal); }
.m84-shell { fill: rgba(255, 255, 255, 0.04); stroke: var(--ink-muted); stroke-width: 1.2; }
.m84-arw { stroke: #7CC7FF; stroke-width: 2.2; fill: none; }
.m84-dn { stroke: var(--ink-muted); stroke-width: 1.6; }
.m84-ra { fill: #6FCF6F; stroke: #B9F0B9; stroke-width: 1; }
.m84-rn { fill: #6FA8FF; stroke: #BBD5FF; stroke-width: 1; }
.m84-al { fill: #FF5C5C; stroke: #FFB3B3; stroke-width: 1; }
.m84-stand { fill: #2A3F5C; stroke: var(--line-strong); stroke-width: 1; }
.m84-base { stroke: var(--ink-muted); stroke-width: 2.4; }
.m84-beam { stroke: #C9D6E3; stroke-width: 4; stroke-linecap: round; }
.m84-piv { fill: var(--signal); }
.m84-str { stroke: var(--ink-muted); stroke-width: 1; }
.m84-pan { fill: rgba(201, 214, 227, 0.18); stroke: #C9D6E3; stroke-width: 1.2; }
.t-ar.m84-ok { fill: var(--ok); }
.t-ar.m84-bad { fill: var(--bad); }

/* معادلة الكتاب بأسماء حدودها (داخل إطار عبارة الكتاب) */
.m84-eq { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 4px 6px;
    margin: 6px 0 10px; padding: 10px 8px; border-radius: var(--radius); background: rgba(255, 170, 90, 0.12); text-align: center; }
.m84-eqc { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.m84-eqs { font-size: 1.2rem; }
.m84-eqo { padding-top: 4px; font-size: 1.1rem; }
.m84-eql { direction: rtl; font-size: 0.8rem; line-height: 1.5; color: var(--ink-soft); }

/* علاقة طاقة الانحلال داخل إطار الكتاب: مظللة كما في الكتاب */
.nm-ex.m84-law { padding: 8px 6px; border-radius: var(--radius); background: rgba(190, 230, 120, 0.12); font-size: 1.12rem; }
/* الحساب العمودي باليد (الجمع والطرح) */
.m84-cols { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; margin: 6px 0 10px; }
.m84-col { font-family: var(--font-mono); font-size: 0.98rem; line-height: 1.55; white-space: pre; direction: ltr; text-align: right; color: var(--ink); }
.m84-col span { display: block; }
.m84-col .m84-ln { border-top: 1px solid var(--ink-muted); }
.m84-col .m84-res { color: var(--signal); }

/* المختبر */
.m84-ring { fill: none; stroke: var(--signal); stroke-width: 1.4; stroke-dasharray: 4 4; }
.m84-varw { stroke: #7CC7FF; stroke-width: 2.2; }
.m84-ahp { fill: #7CC7FF; }
.t-ar.m84-phase { fill: var(--ink); font-weight: 700; }
.t-ar.m84-phase.m84-bad { fill: var(--bad); }
.m84-svg, .m84-bsvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m84-chart svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.fc-controls .fc-buttons.m84-pre { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m84-pre button { padding: 5px 2px; font-size: 0.8rem; line-height: 1.3; min-width: 0; }
.m84-pre button bdi { display: block; font-family: 'Times New Roman', serif; font-size: 1.02rem; font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.m84-pre button small { display: block; font-weight: 500; font-size: 0.7rem; color: var(--ink-muted); }
.m84-pre button.on { background: var(--signal-soft); border-color: var(--signal); color: var(--signal); }
.m84-pre button.on small { color: var(--signal); }
.fc-controls .fc-buttons.m84-one { margin: 0 0 6px; }
.fc-controls .fc-buttons.m84-one button { padding: 8px 6px; font-size: 0.86rem; }
.m84-lab .lx-table .m84-w { grid-column: 1 / -1; }
.m84-lab .lx-hud b.h-d { font-family: 'Times New Roman', serif; font-size: 1rem; }
.m84-steps { margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raise); }
.m84-steps h5 { margin: 0 0 6px; font-size: 0.86rem; color: var(--ink-muted); }
.m84-steps ol { margin: 0; padding-inline-start: 20px; }
.m84-steps li { margin: 3px 0; font-size: 0.9rem; line-height: 1.7; }
.m84-steps bdi { font-family: var(--font-mono); font-size: 0.86rem; white-space: nowrap; }
.m84-steps .ok { color: var(--ok); font-weight: 700; }
.m84-steps .bad { color: var(--bad); font-weight: 700; }
@media (min-width: 1000px) {
    .m84-lab .m84-main > svg { max-height: calc(var(--lx-h) * 0.56); }
    .m84-lab .m84-chart svg { max-height: calc(var(--lx-h) * 0.5); }
    .m84-lab .lx-stage > .m84-chart { margin-top: 4px; }
}
@media (max-width: 999px) {
    .m84-lab .lx-stage[data-v="more"] > .m84-main { display: none; }
    .m84-lab .lx-stage[data-v="more"] > .m84-chart.lx-more { position: static; height: auto; margin: 0; padding: 0; border: 0; background: none; display: block; }
    .m84-lab .lx-stage > .m84-chart svg { max-height: var(--lx-h); }
}
@media (max-width: 400px) { .fc-controls .fc-buttons.m84-pre button { font-size: 0.74rem; } .m84-steps bdi { white-space: normal; } }
/* 2-4-9 انحلال بيتا: رسوم الدرس (f85_) ومختبر النواة (beta-lab). البروتون أحمر عليه «+» والنيوترون رمادي (ألوان الفصل كله)،
   والإلكترون سماوي كما في المنصة كلها، والبوزترون بنفسجي، والنيوترينو برتقالي، ومضاد النيوترينو أخضر */
.m85-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.9; }
.m85-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.9; }
.m85-pt, .m85l-pt { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m85l-b { stroke-width: 0.9; }
.m85l-lb { stroke-width: 1.2; }
.m85-em, .m85l-em { fill: #7CC7FF; stroke: #CFEAFF; stroke-width: 1; }
.m85-ep, .m85l-ep { fill: #C58CFF; stroke: #E9D6FF; stroke-width: 1; }
.m85-nu, .m85l-nu { fill: #FFB347; }
.m85-anu, .m85l-anu { fill: #6EE7A8; }
.t-label.m85-sg, .t-label.m85l-sg { fill: var(--signal-ink); font-weight: 700; }
.m85-bar, .m85l-bar { stroke: var(--ink); stroke-width: 1.3; }
.m85-arr { stroke: var(--ink-muted); stroke-width: 2.2; }
.m85-sep { stroke: var(--line); stroke-width: 1; }
.m85-trk { stroke: rgba(124, 199, 255, 0.55); stroke-width: 1.4; stroke-dasharray: 6 4; }
.m85-trkp { stroke: rgba(197, 140, 255, 0.6); stroke-width: 1.4; stroke-dasharray: 6 4; }
.m85-zoomc { fill: none; stroke: var(--signal); stroke-width: 1.6; stroke-dasharray: 5 4; }
.m85-orb { fill: none; stroke: var(--ink-muted); stroke-width: 1.1; stroke-dasharray: 4 4; }
.m85-cap { fill: none; stroke: #7CC7FF; stroke-width: 1.4; stroke-dasharray: 3 3; }
.t-label.m85-top { fill: var(--signal); font-weight: 600; }
.t-label.m85-bot { fill: #7CC7FF; font-weight: 600; }
.t-label.m85-ok { fill: var(--ok); font-weight: 700; }
.m85-row { fill: var(--inset); stroke: var(--line); stroke-width: 1; }
.m85-rowt { stroke: rgba(255, 197, 61, 0.45); }
.m85-rowb { stroke: rgba(124, 199, 255, 0.45); }
.m85-tab td, .m85-tab th { vertical-align: middle; }
/* المختبر */
.m85l-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m85l-orb { fill: none; stroke: var(--ink-muted); stroke-width: 1.1; stroke-dasharray: 4 4; }
.m85l-ring { fill: none; stroke: var(--signal); stroke-width: 2.2; }
.m85l-lensc { fill: rgba(7, 26, 48, 0.9); stroke: var(--signal); stroke-width: 1.4; }
.m85l-lensl { stroke: rgba(255, 197, 61, 0.45); stroke-width: 1; stroke-dasharray: 3 3; }
.t-ar.m85l-lt { fill: var(--signal); }
.t-label.m85l-lbt { fill: var(--signal-ink); font-weight: 700; }
.t-ac.m85l-tag { fill: var(--ink); }
.t-label.m85l-op { fill: var(--ink-soft); }
.t-label.m85l-unk { fill: var(--signal); }
.t-label.m85l-new { fill: var(--signal); }
.t-label.m85l-st { fill: var(--signal); }
.t-label.m85l-sb { fill: #7CC7FF; }
.t-ar.m85l-name { fill: var(--ink-soft); }
.fc-controls .fc-buttons.m85l-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m85l-btns button { padding: 7px 4px; font-size: 0.86rem; min-width: 0; }
.fc-controls .fc-buttons.m85l-pre button { flex: 1 1 22%; }
.fc-controls .fc-buttons.m85l-two button { flex: 1 1 45%; }
.m85l-pre button.on { background: var(--signal-soft); border-color: var(--signal); color: var(--signal); }
.m85l-pre bdi { font-family: var(--font-mono); }
.m85l-guess { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 8px; }
.m85l-gs { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 2px; background: var(--inset); font-size: 0.8rem; color: var(--ink-muted); }
.m85l-gs span { flex: 1 1 auto; min-width: 0; }
.m85l-gs button { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--raise); color: var(--ink); font: inherit; font-size: 1rem; cursor: pointer; }
.m85l-gs button:hover, .m85l-gs button:focus-visible { border-color: var(--signal); color: var(--signal); }
.m85l-gs b { min-width: 30px; text-align: center; font-family: var(--font-mono); font-size: 0.95rem; color: var(--signal); }
.m85l-lab .lx-table .m85l-w { grid-column: 1 / -1; }
@media (max-width: 400px) { .m85l-guess { grid-template-columns: 1fr; } }
/* 3-4-9 انحلال كاما: رسوم الدرس (f86_) ومختبر النواة (gamma-lab). البروتون أحمر عليه «+» والنيوترون رمادي (ألوان الفصل كله)،
   وأشعة كاما خط متموج برتقالي ذهبي كما في الشكل (16-b)، وسلّم طاقة النواة كسلّم الطاقة في الفصل الثامن */
.m86-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.9; }
.m86-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.9; }
.m86-pt { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m86-cone { fill: rgba(200, 210, 225, 0.16); stroke: rgba(200, 210, 225, 0.45); stroke-width: 1; }
.m86-gw { fill: none; stroke: #FFC857; stroke-width: 1.8; stroke-linejoin: round; }
.m86-gw2 { fill: none; stroke: #FFB347; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.m86-faint { opacity: 0.45; }
.t-label.m86-gt { fill: #FFC857; font-family: 'Times New Roman', serif; font-style: italic; font-weight: 700; }
.m86-glow { fill: rgba(255, 200, 87, 0.12); stroke: rgba(255, 200, 87, 0.55); stroke-width: 1.4; stroke-dasharray: 4 3; }
.m86-sep { stroke: var(--line); stroke-width: 1; }
.m86-rec { stroke: #7CC7FF; stroke-width: 3; }
.m86-garr { stroke: #FFB347; stroke-width: 2; }
.m86-rail { stroke: var(--ink-muted); stroke-width: 2.4; }
.m86-rung { stroke: var(--ink); stroke-width: 3; }
.m86-rung2 { stroke: var(--ink-muted); stroke-width: 1.4; stroke-dasharray: 3 3; }
.m86-axis { stroke: var(--ink-muted); stroke-width: 1.2; }
.m86-drop { stroke: var(--signal); stroke-width: 1.8; stroke-dasharray: 5 4; }
.m86-dot { fill: var(--signal); stroke: #FFF3CF; stroke-width: 1.2; }
.m86-eq { width: auto; margin: 0 auto; border-collapse: collapse; }
.m86-eq td { padding: 2px 6px; text-align: center; vertical-align: middle; border: 0; }
.m86-eq .m86-eql td { font-size: 0.78rem; line-height: 1.5; color: var(--ink-soft); vertical-align: top; direction: rtl; }
@media (max-width: 400px) { .m86-eq td { padding: 2px 3px; } .m86-eq .m86-eql td { font-size: 0.72rem; } }
/* المختبر */
.m86l-svg, .m86l-rsvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m86l-glow { fill: rgba(255, 200, 87, 0); stroke: rgba(255, 200, 87, 0); stroke-width: 1.4; stroke-dasharray: 4 3; transition: fill 0.3s, stroke 0.3s; }
.m86l-ng.ex .m86l-glow { fill: rgba(255, 200, 87, 0.12); stroke: rgba(255, 200, 87, 0.6); }
.m86l-jit.on { animation: m86l-shake 0.45s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes m86l-shake { 0% { transform: translate(0, 0); } 25% { transform: translate(1.4px, -1px); } 50% { transform: translate(-1.2px, 1.2px); } 75% { transform: translate(1px, 1.3px); } 100% { transform: translate(0, 0); } }
@media (prefers-reduced-motion: reduce) { .m86l-jit.on { animation: none; } }
.m86l-rec { stroke: #7CC7FF; stroke-width: 3; }
.m86l-ahp { fill: #7CC7FF; }
.m86l-wave { fill: none; stroke: #FFB347; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.t-ac.m86l-gt { fill: #FFC857; }
.m86l-rail { stroke: var(--ink-muted); stroke-width: 2.4; }
.m86l-rung { stroke: var(--ink); stroke-width: 3; }
.m86l-gap { stroke: var(--signal); stroke-width: 1.6; stroke-dasharray: 4 3; }
.t-ac.m86l-et { fill: var(--signal); }
.m86l-dot { fill: var(--signal); stroke: #FFF3CF; stroke-width: 1.2; }
.t-label.m86l-op { fill: var(--ink-soft); }
.t-label.m86l-ex, .t-ar.m86l-exw { fill: var(--signal); }
.t-ar.m86l-okw { fill: var(--ok); }
.t-label.m86l-st { fill: var(--signal); }
.t-label.m86l-sb { fill: #7CC7FF; }
.m86l-rbg { fill: rgba(255, 255, 255, 0.04); stroke: var(--line-strong); stroke-width: 1; }
.m86l-xb { fill: rgba(230, 236, 244, 0.28); }
.m86l-tk { stroke: var(--ink-muted); stroke-width: 1; }
.t-label.m86l-tkt { fill: var(--ink-muted); }
.m86l-mk { stroke: var(--signal); stroke-width: 2; }
.m86l-mkh { fill: var(--signal); }
.t-label.m86l-mkt { fill: var(--signal); }
.m86l-rul svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.fc-controls .fc-buttons.m86l-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m86l-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.fc-controls .fc-buttons.m86l-two button { flex: 1 1 45%; }
.fc-controls .fc-buttons.m86l-pre button { flex: 1 1 30%; }
.m86l-btns button.on { background: var(--signal-soft); border-color: var(--signal); color: var(--signal); }
.m86l-btns bdi { font-family: var(--font-mono); }
.m86l-lab .lx-table .m86l-w { grid-column: 1 / -1; }
@media (min-width: 1000px) {
    .m86l-lab .m86l-main > svg { max-height: calc(var(--lx-h) * 0.7); }
    .m86l-lab .lx-stage > .m86l-rul { margin-top: 4px; }
    .m86l-lab .m86l-rul svg { max-height: calc(var(--lx-h) * 0.3); }
}
@media (max-width: 999px) {
    .m86l-lab .lx-stage[data-v="more"] > .m86l-main { display: none; }
    .m86l-lab .lx-stage[data-v="more"] > .m86l-rul.lx-more { position: static; height: auto; margin: 0; padding: 0; border: 0; background: none; display: block; }
}
/* 5-9 التفاعلات النووية: رسوم الدرس ومختبر «مسرّع القذائف» (reaction-lab). اصطلاح الفصل: البروتون أحمر عليه + والنيوترون رمادي؛
   والأعداد العلوية (الكتلية) صفراء والسفلية (الذرية) سماوية؛ وفي رسوم الأشعة: الفا وردية حمراء، وبيتا السالبة سماوية، وكاما صفراء */
.m87-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.9; }
.m87-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.9; }
.m87-pt { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m87-nl text { fill: var(--ink); font-family: 'Times New Roman', serif; }
.m87-nl.m87-hl .m87-A { fill: var(--signal); font-weight: 700; }
.m87-nl.m87-hl .m87-Z { fill: var(--neg); font-weight: 700; }
.m87-op { fill: var(--ink-soft); font-family: var(--font-mono); font-size: 20px; }
.m87-rarr { stroke: #FF6B5E; stroke-width: 4; stroke-linecap: round; }
.m87-rarh { fill: #FF6B5E; }
.m87-hit { fill: rgba(255, 197, 61, 0.22); stroke: var(--signal); stroke-width: 1.6; }
.m87-gs { fill: var(--signal); font-family: 'Times New Roman', serif; font-style: italic; font-size: 19px; }
.m87-gw { fill: none; stroke: var(--signal); stroke-width: 2.2; stroke-linecap: round; }
.m87-gh { fill: var(--signal); }
.m87-sum { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.m87-sum.m87-a { fill: var(--signal); }
.m87-sum.m87-z { fill: var(--neg); }
.m87-ga { fill: rgba(255, 197, 61, 0.2); stroke: var(--signal); stroke-width: 1.4; }
.m87-gx { fill: rgba(133, 151, 173, 0.32); stroke: #C9D6E3; stroke-width: 1.2; }
.m87-let { fill: var(--ink); font-family: 'Times New Roman', serif; font-style: italic; font-weight: 700; font-size: 16px; }
.m87-sym { fill: var(--signal); font-family: 'Times New Roman', serif; font-style: italic; font-size: 15px; }
.m87-str { stroke: var(--ink-muted); stroke-width: 1; }
.m87-pan { fill: rgba(201, 214, 227, 0.18); stroke: #C9D6E3; stroke-width: 1.2; }
.m87-pl { fill: var(--ink); font-family: 'Times New Roman', serif; font-style: italic; font-size: 13px; }
.m87-stand { fill: #2A3F5C; stroke: var(--line-strong); stroke-width: 1; }
.m87-beam { stroke: #C9D6E3; stroke-width: 4; stroke-linecap: round; }
.m87-piv { fill: var(--signal); }
.m87-paper { fill: rgba(255, 255, 255, 0.06); stroke: #E6EEF6; stroke-width: 1; }
.m87-al { fill: #A9B6C4; stroke: #D9E2EC; stroke-width: 0.8; }
.m87-pb { fill: #4E5B6A; stroke: #8796A6; stroke-width: 0.8; }
.m87-ra { fill: none; stroke: #FF8A80; stroke-width: 2.4; }
.m87-rb { fill: none; stroke: #7CC7FF; stroke-width: 2.4; }
.m87-rg { fill: none; stroke: var(--signal); stroke-width: 2.4; }
.m87-faint { opacity: 0.4; stroke-dasharray: 5 4; }
.m87-adot { fill: #FF8A80; }
.m87-bdot { fill: #7CC7FF; }
.m87-gdot { fill: var(--signal); }
.t-label.m87-ta { fill: #FF8A80; font-family: 'Times New Roman', serif; font-style: italic; }
.t-label.m87-tb { fill: #7CC7FF; font-family: 'Times New Roman', serif; font-style: italic; }
.t-label.m87-tg { fill: var(--signal); font-family: 'Times New Roman', serif; font-style: italic; }
.m87-field { fill: rgba(124, 199, 255, 0.05); stroke: #7CC7FF; stroke-width: 1.2; stroke-dasharray: 5 4; }
.m87-x { fill: #7CC7FF; font-family: var(--font-mono); font-size: 14px; }
.m87-lead { fill: #1B232D; stroke: #8796A6; stroke-width: 1; }
.m87-src { fill: var(--signal); }
.m87-path { fill: none; stroke: var(--ink-muted); stroke-width: 1.3; stroke-dasharray: 4 4; }
.m87-rep { stroke: var(--pos); stroke-width: 2; fill: none; }

/* معادلة الكتاب بأسماء حدودها (داخل إطار عبارة الكتاب، وفي حل المثال (5)) */
.m87-eq { display: grid; align-items: start; gap: 4px 4px; margin: 6px 0 10px; padding: 10px 6px; border-radius: var(--radius);
    background: rgba(255, 170, 90, 0.12); text-align: center; }
.m87-eq7 { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); }
.m87-eqc { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.m87-eqs { font-size: 1.15rem; }
.m87-eqo { padding-top: 4px; font-size: 1.05rem; }
.m87-eql { direction: rtl; font-size: 0.76rem; line-height: 1.45; color: var(--ink-soft); overflow-wrap: normal; word-break: normal; }
/* الشاشة الضيقة: لا تُقطع كلمة في وسطها؛ تنتقل الحدود إلى سطر ثانٍ بعد السهم أو الإشارة عند الحاجة */
@media (max-width: 560px) {
    .m87-eq, .m87-eq7 { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 8px 6px; }
    .m87-eqc { flex: 0 1 auto; max-width: 7.6em; }
    .m87-eqo { flex: 0 0 auto; }
}
.nm-ex.m87-law { padding: 8px 4px; border-radius: var(--radius); background: rgba(190, 230, 120, 0.12); font-size: 0.94rem; }
/* الحساب العمودي باليد (الجمع والطرح) */
.m87-cols { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; margin: 6px 0 10px; }
.m87-col { font-family: var(--font-mono); font-size: 0.96rem; line-height: 1.55; white-space: pre; direction: ltr; text-align: right; color: var(--ink); }
.m87-col span { display: block; }
.m87-col .m87-ln { border-top: 1px solid var(--ink-muted); }
.m87-col .m87-res { color: var(--signal); font-weight: 600; }
/* جدول الجسيمات الشائعة في المعادلات */
.data-table.m87-parts th, .data-table.m87-parts td { padding: 6px 4px; text-align: center; font-size: 0.86rem; }
/* المختبر: مسرّع القذائف (reaction-lab) */
.m87-svg, .m87-bsvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m87-tube { fill: #2A3F5C; stroke: var(--line-strong); stroke-width: 1; }
.fc-controls .fc-buttons.m87-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m87-btns button { padding: 6px 4px; font-size: 0.84rem; min-width: 0; line-height: 1.25; }
.fc-controls .fc-buttons.m87-rxs button { flex: 1 1 30%; }
.fc-controls .fc-buttons.m87-two button { flex: 1 1 45%; }
.fc-controls .fc-buttons.m87-one button { flex: 1 1 100%; }
.m87-rxs button small { display: block; font-size: 0.7rem; color: var(--ink-muted); }
.m87-rxs button.fc-primary small { color: inherit; }
.m87-lab .lx-table .m87-w { grid-column: 1 / -1; }
/* الحاسوب: المشهد فوق ميزان الكتل في عمود المشهد */
@media (min-width: 1000px) {
    .m87-lab .m87-main > svg { max-height: calc(var(--lx-h) * 0.62); }
    .m87-lab .m87-bal svg { max-height: calc(var(--lx-h) * 0.42); }
    .m87-lab .lx-stage > .m87-bal { margin-top: 4px; }
}
/* الهاتف: حين يختار الطالب «ميزان الكتل» يحل محل المشهد في الجزء المثبّت */
@media (max-width: 999px) {
    .m87-lab .lx-stage[data-v="more"] > .m87-main { display: none; }
    .m87-lab .lx-stage[data-v="more"] > .m87-bal.lx-more { position: static; height: auto; margin: 0; padding: 0; border: 0; background: none; display: block; }
    .m87-lab .lx-stage > .m87-bal svg { max-height: var(--lx-h); }
}
.m87-lab .lx-table b.m87-nu { font-family: 'Times New Roman', serif; font-weight: 600; font-size: 1.12rem; direction: ltr; unicode-bidi: isolate; }

/* جدول الجسيمات: صف الكرات وحيلة الحفظ */
.data-table.m87-parts tr.m87-balls td { padding: 2px 4px 6px; }
.m87-bsv { display: block; margin: 0 auto; }
.m87-trick { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; margin: 10px 0 12px; background: rgba(255, 255, 255, 0.03); }
.m87-trick ul { margin: 0; padding-inline-start: 1.2em; }
.m87-trick li { margin-bottom: 4px; }
/* 6-9 الانشطار النووي: رسوم الدرس ومختبر الانشطار والتفاعل المتسلسل (fission-chain-lab) — البروتون أحمر عليه +، والنيوترون رمادي مزرق
   (كما في m82-p وm82-n)، والطاقة المتحررة وميض أصفر، وقضبان السيطرة زرقاء، والكرافيت داكن */
.m88-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.8; }
.m88-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.8; }
.m88-pt { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m88-arr { stroke: var(--ink-muted); stroke-width: 1.3; fill: none; }
.m88-esc { stroke: var(--ink-muted); stroke-width: 1.3; stroke-dasharray: 5 4; fill: none; }
.m88-arrn { stroke: var(--pos); stroke-width: 1.8; fill: none; }
.m88-step { fill: #4EA3E0; }
.m88-flash { fill: #FFE27A; stroke: #FFB648; stroke-width: 1.2; stroke-linejoin: round; }
.m88-burst { fill: rgba(255, 226, 122, 0.28); stroke: rgba(255, 182, 72, 0.6); stroke-width: 0.8; }
.m88-glow { fill: rgba(255, 226, 122, 0.35); }
.m88-fragdot { fill: #C77E78; stroke: #FFC4BC; stroke-width: 0.8; }
.m88-rod { fill: #4E86C2; stroke: #9CC5EE; stroke-width: 1; }
.m88-dot { fill: var(--signal); }
/* الشكل (23) */
.m88-night { fill: #05070B; }
.m88-hz { fill: #E8761E; }
.m88-fire1 { fill: #C8321E; }
.m88-fire2 { fill: #F08A24; }
.m88-fire3 { fill: #FFE45C; }
/* الشكل (24) */
.m88-brickrow { fill: #1E2228; stroke: #59616C; stroke-width: 1; }
.m88-joint { stroke: #59616C; stroke-width: 1; }
.m88-fsq { fill: #EDEFF2; }
.m88-fdot { fill: #E2483B; }
/* الشكل (25-a) و(25-b) */
.m88-ground { stroke: var(--ink-muted); stroke-width: 1.4; }
.m88-tower { fill: #9AAABD; stroke: #C9D4E0; stroke-width: 1; }
.m88-cloud { fill: rgba(235, 242, 250, 0.55); }
.m88-steam { fill: rgba(235, 242, 250, 0.6); }
.m88-elw { fill: none; stroke: var(--signal); stroke-width: 1.4; stroke-dasharray: 3 3; opacity: 0.8; }
.m88-dome { fill: rgba(150, 190, 235, 0.06); stroke: var(--ink-soft); stroke-width: 1.4; }
.m88-pipe { fill: none; stroke: #6E8BA8; stroke-width: 4; stroke-linejoin: round; }
.m88-hotp { stroke: #B5655A; }
.m88-cw { fill: none; stroke: #4E86C2; stroke-width: 3; }
.m88-vessel { fill: #2E4F70; stroke: #9CC5EE; stroke-width: 1.2; }
.m88-fuel { fill: #0B0D10; stroke: #8597AD; stroke-width: 0.6; }
.m88-crod { stroke: #CFE3F7; stroke-width: 2; }
.m88-sg { fill: #35607F; stroke: #9CC5EE; stroke-width: 1.2; }
.m88-utube { fill: none; stroke: #CFE3F7; stroke-width: 1.4; }
.m88-pump { fill: #E0B040; stroke: #FFE27A; stroke-width: 1; }
.m88-turb { fill: #C9B26A; stroke: #FFE27A; stroke-width: 1; }
.m88-spoke { stroke: #5A4A18; stroke-width: 1.6; }
.m88-shaft { stroke: var(--ink-soft); stroke-width: 3; }
.m88-gen { fill: #8F9BA8; stroke: #D6E0EB; stroke-width: 1; }
.m88-pylon { fill: none; stroke: var(--ink-soft); stroke-width: 1.4; }
.m88-bld { fill: #4FA37A; stroke: #9BE0BC; stroke-width: 0.8; }
.m88-cond { fill: #35607F; stroke: #9CC5EE; stroke-width: 1.2; }
/* المختبر */
.m88-svg, .m88-csvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m88-u { fill: #B8645B; stroke: #F2A79F; stroke-width: 1; }
.m88-uin { fill: #8597AD; opacity: 0.85; }
.m88-gone { fill: none; stroke: rgba(242, 104, 90, 0.25); stroke-width: 1; stroke-dasharray: 2 3; }
.m88-pos { fill: #FF9A8E; stroke: #FFE0DB; stroke-width: 0.8; }
.m88-ring { fill: none; stroke: #FFE27A; stroke-width: 2; }
.m88-boom { fill: rgba(255, 214, 110, 0.0); pointer-events: none; }
.m88-rep { stroke: var(--pos); stroke-width: 1.8; fill: none; }
.m88-bar { fill: var(--signal); }
.m88-bar2 { fill: #6FB8F0; }
.m88-bar3 { fill: #F2685A; }
.m88-ax { stroke: var(--ink-muted); stroke-width: 1.2; }
.m88-strip { fill: rgba(255, 255, 255, 0.025); stroke: var(--line); stroke-width: 1; }
.m88-chart svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.fc-controls .fc-buttons.m88-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m88-btns button { padding: 6px 4px; font-size: 0.84rem; min-width: 0; line-height: 1.25; flex: 1 1 30%; }
.fc-controls .fc-buttons.m88-two button { flex: 1 1 45%; }
.fc-controls .fc-buttons.m88-four button { flex: 1 1 20%; }
.m88-btns button small { display: block; font-size: 0.7rem; color: var(--ink-muted); direction: ltr; }
.m88-btns button.fc-primary small { color: inherit; }
.m88-lab .lx-table .m88-w { grid-column: 1 / -1; }
@media (min-width: 1000px) {
    .m88-lab .m88-main > svg { max-height: calc(var(--lx-h) * 0.66); }
    .m88-lab .m88-chart svg { max-height: calc(var(--lx-h) * 0.4); }
    .m88-lab .lx-stage > .m88-chart { margin-top: 4px; }
}
@media (max-width: 999px) {
    .m88-lab .lx-stage[data-v="more"] > .m88-main { display: none; }
    .m88-lab .lx-stage[data-v="more"] > .m88-chart.lx-more { position: static; height: auto; margin: 0; padding: 0; border: 0; background: none; display: block; }
    .m88-lab .lx-stage > .m88-chart svg { max-height: var(--lx-h); }
}
.t-label.m88-blab { fill: #0B1420; font-weight: 700; }
/* 7-9 الاندماج النووي: رسوم الدرس ومختبر الاندماج (fusion-lab) — البروتون أحمر عليه +، والنيوترون رمادي مزرق، والبوزترون بنفسجي،
   والنيوترينو برتقالي، وأشعة كاما صفراء؛ والتنافر الكهربائي وردي، والطاقة المتحررة موجة صفراء فاتحة، ولحظة الاندماج نجمة صفراء */
.m89-p { fill: #F2685A; stroke: #FFC4BC; stroke-width: 0.9; }
.m89-n { fill: #8597AD; stroke: #D6E0EB; stroke-width: 0.9; }
.m89-pt { fill: #3A0C08; font-family: var(--font-mono); font-weight: 700; pointer-events: none; }
.m89-ep { fill: #C58CFF; stroke: #E9D6FF; stroke-width: 1; }
.t-label.m89-gt { fill: #FFC857; font-family: 'Times New Roman', serif; font-style: italic; font-weight: 700; }
.t-label.m89-nut { fill: #FFB347; font-family: 'Times New Roman', serif; font-style: italic; font-weight: 700; }
.m89-en { fill: none; stroke: #FFF0B8; stroke-width: 2; stroke-linecap: round; }
.m89-enh { fill: #FFF0B8; }
.m89-star { fill: #FFE35A; stroke: #FFB800; stroke-width: 1; stroke-linejoin: round; }
.m89-star-s { stroke-width: 0.6; }
.m89-rep { stroke: var(--pos); stroke-width: 2.2; fill: none; }
/* الميزان */
.m89-str { stroke: var(--ink-muted); stroke-width: 1; }
.m89-pan { fill: #6E7C8E; stroke: var(--ink-soft); stroke-width: 1; }
.m89-beam { stroke: var(--ink-soft); stroke-width: 4; stroke-linecap: round; }
.m89-stand { fill: #8C6A4A; stroke: #C9A27A; stroke-width: 1.2; stroke-linejoin: round; }
.m89-pivot { fill: #C9A27A; stroke: var(--screen); stroke-width: 1.5; }
/* الشمس */
.m89-ray { stroke: #FFD36B; stroke-width: 2; stroke-linecap: round; opacity: 0.8; }
.m89-core { fill: #FFF6CF; opacity: 0.85; stroke: #FFE08A; stroke-width: 1.4; stroke-dasharray: 3 3; }
.m89-inset { fill: rgba(255, 197, 61, 0.05); stroke: rgba(255, 197, 61, 0.45); stroke-width: 1; }
.m89-conn { fill: none; stroke: rgba(255, 197, 61, 0.5); stroke-width: 1; stroke-dasharray: 3 3; }
/* القنبلة */
.m89-sky { fill: rgba(3, 14, 28, 0.55); }
.m89-ground { stroke: #8C6A4A; stroke-width: 2; }
/* حالات المادة */
.m89-box { fill: rgba(255, 255, 255, 0.03); stroke: var(--line-strong); stroke-width: 1; }
.m89-atom { fill: rgba(124, 199, 255, 0.18); stroke: #7CC7FF; stroke-width: 1; }
.m89-atn { fill: #F2685A; }
.m89-el { fill: #7CC7FF; }
/* التوكاماك */
.m89-tk { fill: rgba(40, 56, 78, 0.82); stroke: #5A6E88; stroke-width: 1.2; fill-rule: evenodd; }
.m89-pl { fill: none; stroke: #FF7A3D; stroke-width: 16; opacity: 0.45; }
.m89-pl2 { fill: none; stroke: #FFD08A; stroke-width: 4; opacity: 0.9; }
.m89-hel { fill: none; stroke: #FF5A4A; stroke-width: 1.1; opacity: 0.9; }
.m89-coil { fill: none; stroke: #4FA3FF; stroke-width: 3.2; }
/* مخطط المفاعل الاندماجي */
.m89-blk { fill: rgba(46, 160, 160, 0.2); stroke: #3FBFBF; stroke-width: 1.2; }
.m89-dome { fill: rgba(255, 140, 80, 0.12); stroke: #FF9A5A; stroke-width: 1.6; }
.m89-li { fill: none; stroke: #E0546A; stroke-width: 1.4; stroke-dasharray: 5 3; }
.m89-pipe { fill: none; stroke: #E0546A; stroke-width: 2.4; }
.m89-pipe2 { fill: none; stroke: var(--ink-muted); stroke-width: 1.6; }
.m89-big { stroke: #E0546A; stroke-width: 5; }
.m89-bigh { fill: #E0546A; }
.t-ar.m89-red { fill: #FF8A8A; }
/* دورة الكاربون */
.m89-cyc { fill: none; stroke: var(--ink-muted); stroke-width: 1.3; }
.m89-cin { stroke: var(--ink-muted); stroke-width: 1; }
.m89-trace { fill: var(--signal); opacity: 0.85; }

/* المختبر */
.m89l-svg, .m89l-rsvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m89l-band { fill: #FF7A3D; }
.m89l-hole { fill: var(--screen); }
.m89l-wall { fill: none; stroke-width: 8; }
.m89l-fl { fill: none; stroke: rgba(124, 199, 255, 0.4); stroke-width: 1; stroke-dasharray: 4 5; }
.m89l-mag line { stroke: #4FA3FF; stroke-width: 5; stroke-linecap: round; }
.m89l-rep { stroke: var(--pos); stroke-width: 2.2; fill: none; }
.m89l-spark { fill: #FFE7A0; }
.m89l-flash { fill: rgba(255, 227, 90, 0.18); }
.m89l-plab { font-family: var(--font-mono); font-weight: 700; fill: var(--signal); paint-order: stroke; stroke: var(--screen); stroke-width: 3px; }
.m89l-hl { fill: rgba(255, 197, 61, 0.14); }
.m89l-more svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.fc-controls .fc-buttons.m89l-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m89l-btns button { flex: 1 1 22%; padding: 6px 4px; font-size: 0.84rem; min-width: 0; line-height: 1.25; }
.m89l-lab .lx-table .m89l-w { grid-column: 1 / -1; }
/* الحاسوب: الحاوية فوق لوحة التفاعل في عمود المشهد */
@media (min-width: 1000px) {
    .m89l-lab .m89l-main > svg { max-height: calc(var(--lx-h) * 0.68); }
    .m89l-lab .lx-stage > .m89l-more { margin-top: 4px; }
    .m89l-lab .m89l-more svg { max-height: calc(var(--lx-h) * 0.3); }
}
/* الهاتف: حين يختار الطالب «التفاعل» تحل لوحته محل الحاوية في الجزء المثبّت */
@media (max-width: 999px) {
    .m89l-lab .lx-stage[data-v="more"] > .m89l-main { display: none; }
    .m89l-lab .lx-stage[data-v="more"] > .m89l-more.lx-more { position: static; height: auto; margin: 0; padding: 0; border: 0; background: none; display: block; }
    .m89l-lab .lx-stage > .m89l-more svg { max-height: var(--lx-h); }
}
/* dive lesson css: chapter 6 */
/* ---------- درس 1-6: «خريطة العوالم» (worlds-lab) ورسوم الدرس ---------- */
.m50-map { display: block; direction: ltr; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.m50-map .m50-probe { cursor: grab; touch-action: none; outline: none; }
.m50-map .m50-probe:focus-visible circle:nth-child(2) { stroke: var(--ink); }
.m50-map .m50-dot { cursor: pointer; }
.m50-fade { transition: opacity 0.45s; }
.m50-status b { color: var(--ink); }
.m50-lw { font-style: normal; }
.m50-table.sim-table b { font-size: 0.98rem; overflow-wrap: anywhere; }
.m50-win { display: block; width: 100%; height: auto; margin: 0 auto; direction: ltr; }
.m50-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 4px; }
.m50-chips button { padding: 6px 4px; font: inherit; font-size: 0.82rem; line-height: 1.35; border-radius: var(--radius); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; transition: background-color 0.15s; min-width: 0; }
.m50-chips button:hover { background: var(--hover); }
.m50-chips button.fc-primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 700; }
.m50-ctl .fc-buttons button { padding: 8px 6px; }
/* رسوم الدرس وجداوله */
.m50-tpk { fill: #FF9EC8; }
.m50-quad th, .m50-quad td { text-align: center; vertical-align: middle; }
.m50-quad td small { display: block; color: var(--ink-muted); font-size: 0.8rem; margin-top: 2px; }
.m50-quad .m50-c1 { color: #5FD39A; font-weight: 700; }
.m50-quad .m50-c2 { color: #7CC7FF; font-weight: 700; }
.m50-quad .m50-c3 { color: #FF8FC0; font-weight: 700; }
.m50-quad .m50-c4 { color: #C3A6FF; font-weight: 700; }
/* الحاسوب: الخريطة فوق «النافذة» في عمود المشهد؛ نحدّ عرض كل منهما (فيتبعه ارتفاعه) ليبقى العمود كله مع القراءات وسطر الحالة ضمن الشاشة،
   ويصغران قليلاً حين يضيق العمود (1024px) لأن سطر الحالة يطول فيه */
@media (min-width: 1000px) {
    .m50-main, .m50-wbox { container-type: inline-size; }
    .m50-lx .lx-2d > svg.m50-map { max-height: none; max-width: calc(min(var(--lx-h) * 0.84, 58cqw) * 340 / 308); }
    .m50-lx .lx-stage > .lx-more svg.m50-win { max-height: none; max-width: calc(min(var(--lx-h) * 0.31, 22cqw) * 340 / 124); }
}
/* الهاتف: الحجم والسرعة في سطر، وكل من الساعة والفيزياء المطلوبة في سطر كامل (lx-wide) */
@media (max-width: 640px) {
    /* ثلاثة أسطر من القراءات ومبدّل العرض: نقصّر الخريطة قليلاً ليبقى الجزء المثبّت دون نصف الشاشة تقريباً */
    .lx.m50-lx { --lx-h: clamp(165px, 31vh, 262px); }
    .m50-lw { display: none; }   /* «السرعة» تُختصر إلى v حتى تتسع القيمة الطويلة (0.999999991c) في نصف سطر */
    .m50-chips { gap: 4px; }
    .m50-chips button { font-size: 0.76rem; padding: 5px 2px; }
}
/* الهاتف و«الحركة والساعتان» ظاهرة: طبقة النافذة تبدأ عند 40px (ثابت مشترك) بينما تبدأ الخريطة تحت شريط المبدّل عند 45px تقريباً،
   فنزيد ارتفاع الطبقة قليلاً حتى لا يطل أسفل الخريطة من تحتها */
@media (max-width: 999px) { .m50-lx .lx-stage[data-v="more"] > .lx-more.lx-alt { height: calc(var(--lx-h) + 5px); } }
/* القراءات السريعة (مؤقتاً حتى يُصلح في style.css): القيمة LTR فـ margin-inline-start يقع على يسارها، أما الفراغ المطلوب فبينها وبين الاسم على يمينها */
@media (min-width: 641px) { .lx-hud.m50-hud b { margin-left: 0; margin-right: 6px; } }
/* ---------- 2-6 مختبر الجسم الأسود (blackbody-lab) ---------- */
.m51-chart { background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px 4px; }
.m51-chart svg { display: block; width: 100%; height: auto; direction: ltr; }
.m51-hide { display: none !important; }
.m51-presets { flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.m51-presets button { flex: 1 1 30%; min-width: 0; padding: 7px 4px; font-size: 0.85rem; line-height: 1.35; }
.m51-presets.m51-four button { flex-basis: 45%; }
.m51-presets small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 0.72rem; opacity: 0.8; direction: ltr; }
.fc-controls .m51-view { margin: 0 0 10px; }
.m51-view button { padding: 8px 6px; font-size: 0.9rem; }
.m51-lab { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.m51-sw { display: inline-block; width: 0.95em; height: 0.95em; border-radius: 2px; border: 1px solid var(--line-strong); vertical-align: -0.12em; margin-inline-end: 6px; }
.m51-g-spec, .m51-g-lad { margin-bottom: 4px; }
.m51-t-spec bdi, .m51-t-lad bdi { white-space: nowrap; }
/* على الحاسوب العريض: الجسم والمنحني جنباً إلى جنب في عمود المشهد (المنحني بمقياسه الطبيعي تقريباً فتُقرأ كتاباته)، والقراءات السريعة تحتهما؛
   وعلى الحاسوب الأضيق يبقى التخطيط الموحد (المنحني تحت الجسم) لأن نصف العمود يضيق عنهما */
@media (min-width: 1240px) {
    .lx-stage.m51-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 8px; align-items: center; }
    .lx-stage.m51-duo > .lx-hud { grid-column: 1 / -1; }
    .lx-stage.m51-duo > .lx-more { margin-top: 0; }
    .lx .lx-stage.m51-duo .s3-wrap { height: calc(var(--lx-h) * 0.66); }
    .lx-stage.m51-duo > .lx-more svg { max-height: calc(var(--lx-h) * 0.66 - 12px); }
}
/* الحاسوب الأضيق (المنحني تحت الجسم): نصغّرهما قليلاً حتى يتسع عمود المشهد للقراءات وسطر الحالة دون تمرير داخلي */
@media (min-width: 1000px) and (max-width: 1239px) {
    .lx .lx-stage.m51-duo .s3-wrap { height: calc(var(--lx-h) * 0.56); }
    .lx-stage.m51-duo > .lx-more svg { max-height: calc(var(--lx-h) * 0.48); }
}
/* الهاتف: درجة الحرارة ظاهرة أصلاً في لافتة المشهد وعلى المنحني وبجانب الشريط، فنخفي رقاقتها ونعطي الشدة (أطول قيمة) سطراً كاملاً */
@media (max-width: 640px) {
    .lx-hud > .m51-hT { display: none; }
    .lx-hud > .m51-hI { grid-column: 1 / -1; }
}
/* 3-6 الظاهرة الكهروضوئية: رسوم الدرس ومختبر الخلية الكهروضوئية (photo-lab) */
.m52-metal { fill: rgba(170, 186, 206, 0.22); stroke: var(--ink-soft); stroke-width: 1.5; }
.m52-metal.dark { fill: rgba(8, 18, 32, 0.9); stroke: var(--ink-muted); }
.m52-glass { fill: rgba(124, 199, 255, 0.07); stroke: var(--ink-soft); stroke-width: 1.4; }
.m52-ring-c { fill: none; stroke: var(--ink-soft); stroke-width: 3; }
.m52-anode { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.m52-cath { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.m52-pin { stroke: var(--ink-soft); stroke-width: 3; fill: none; stroke-linecap: round; }
.m52-el { fill: var(--screen); stroke: var(--neg); stroke-width: 1.5; }
.m52-ev { stroke: var(--neg); stroke-width: 2; fill: none; }
.m52-ph { fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linejoin: round; }
.m52-photon { stroke: var(--signal); stroke-width: 5; stroke-linecap: round; }
.m52-meter { fill: var(--signal); stroke: var(--ink); stroke-width: 1.2; }
.m52-hi { fill: none; stroke: var(--signal); stroke-width: 2.6; }
.m52-lo { fill: none; stroke: var(--neg); stroke-width: 2.4; }
.m52-line { stroke: var(--pos); stroke-width: 2.6; fill: none; }
.m52-line.dash { stroke-width: 2; stroke-dasharray: 3 4; }
.m52-bell { fill: rgba(255, 197, 61, 0.22); stroke: var(--signal); stroke-width: 1.8; }
.m52-bell-rim { fill: var(--signal); stroke: var(--signal); stroke-width: 2.4; }
.m52-pp { fill: #F4F7FB; stroke: var(--ink-muted); stroke-width: 1; }
.m52-steel { fill: #9AA7B6; stroke: var(--ink); stroke-width: 1.5; }
.m52-ring { fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linecap: round; }
.m52-sun { fill: var(--signal); }
.m52-sunray { stroke: var(--signal); stroke-width: 2; stroke-linecap: round; }
.m52-panel { fill: #1D3E73; stroke: var(--ink-soft); stroke-width: 1.5; }
.m52-grid { stroke: rgba(214, 228, 243, 0.45); stroke-width: 1; }
.m52-lamp { fill: var(--ink-soft); }
.m52-glow { fill: rgba(255, 197, 61, 0.22); }
.m52-lens { fill: rgba(124, 199, 255, 0.12); stroke: var(--ink-soft); stroke-width: 1.5; }
.m52-px { fill: var(--signal); }

/* «تذكر» من الكتاب: ثلاث حالات */
.m52-rem { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raise); }
.m52-rem-row { display: grid; grid-template-columns: 70px 18px minmax(0, 1fr); align-items: center; gap: 6px; margin-top: 8px; }
.m52-rem-c { border: 1px solid var(--neg); border-radius: 2px; padding: 3px 4px; text-align: center; background: var(--inset); }
.m52-rem-a { color: var(--ink-muted); text-align: center; }
.m52-rem-r { border: 1px solid rgba(255, 197, 61, 0.5); border-radius: 2px; padding: 4px 8px; background: var(--signal-soft); line-height: 1.7; }
.m52-rem-n { margin: 10px 0 0; font-size: 0.9rem; color: var(--ink-soft); }

/* الجدول (1-6) */
.m52-tab { margin: 10px 0 12px; }
.m52-tab-cap { margin: 0 0 6px; font-weight: 700; color: var(--ink-soft); text-align: center; }
.m52-tab .data-table td, .m52-tab .data-table th { text-align: center; padding: 5px 4px; }
.m52-tab .data-table td:first-child { text-align: right; }
.m52-tab.ext .data-table { font-size: 0.92rem; }
.m52-tab tr.m52-hl td { background: var(--signal-soft); }
.m52-tab td.m52-uv, .m52-tab-note .m52-uv { color: #C7A6FF; font-weight: 700; }
.m52-tab td.m52-vis, .m52-tab-note .m52-vis { color: var(--ok); font-weight: 700; }
.m52-tab-note { margin: 6px 0 0; font-size: 0.88rem; color: var(--ink-muted); line-height: 1.7; }

/* المختبر */
.m52-metals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 0 0 4px; }
.m52-metals button { padding: 5px 2px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-size: 0.78rem; line-height: 1.35; cursor: pointer; min-width: 0; }
.m52-metals button b { display: block; font-weight: 700; white-space: nowrap; }
.m52-metals button small { display: block; font-family: var(--font-mono); color: var(--ink-muted); direction: ltr; font-size: 0.72rem; }
.m52-metals button:hover { background: var(--hover); }
.m52-metals button.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.m52-metals button.on small { color: var(--signal-ink); }
.m52-col { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 0.85rem; color: var(--ink-soft); }
.m52-sw { width: 26px; height: 12px; border-radius: 2px; border: 1px solid var(--line-strong); flex: none; }
.m52-sub { margin: 2px 0 0; font-size: 0.8rem; color: var(--ink-muted); }
.fc-controls .fc-buttons.m52-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.fc-controls .fc-buttons.m52-btns button { padding: 7px 4px; font-size: 0.82rem; min-width: 0; }
.m52-chart svg { display: block; width: 100%; max-width: 470px; margin: 0 auto; height: auto; direction: ltr; }
.m52-chart-cap .lx-x { vertical-align: middle; }
.m52-chart[hidden] { display: none; }
.m52-gal { display: block; height: 8px; margin-top: 5px; border-radius: 2px; background: var(--inset); border: 1px solid var(--line); overflow: hidden; }
.m52-gal i { display: block; height: 100%; width: 0; background: var(--signal); transition: width 0.25s; }
.sim-table b.m52-off { color: var(--ink-muted); font-family: var(--font-body); direction: rtl; font-size: 0.95rem; }
.m52-cur { stroke: var(--signal); stroke-width: 2.6; fill: none; }
.m52-half { stroke: var(--neg); stroke-width: 2; fill: none; stroke-dasharray: 5 4; }
.m52-dot { fill: var(--signal); stroke: var(--screen); stroke-width: 1.5; }
.m52-dot.off { fill: var(--screen); stroke: var(--signal); stroke-width: 2; }
.m52-trail { fill: var(--pos); opacity: 0.8; }
.m52-oth { stroke: var(--ink-muted); stroke-width: 1; opacity: 0.55; fill: none; }
.m52-axis { stroke: var(--ink-soft); stroke-width: 1.4; fill: none; }
.m52-gridl { stroke: var(--line); stroke-width: 1; }
@media (max-width: 640px) {
    .m52-metals { gap: 4px; }
    .m52-metals button { font-size: 0.7rem; padding: 5px 0; }
    .m52-rem-row { grid-template-columns: 62px 14px minmax(0, 1fr); }
}
.sim-table .m52-gcell { grid-column: 1 / -1; }
.m52-chart-cap { margin: 0 0 4px; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); line-height: 1.6; text-align: center; }
/* القاعدة 11: جدول تقابل الرموز، و«ثلاث معلومات نقرؤها من الخط» */
.m52-map { margin: 4px 0 14px; }
.m52-map .data-table td, .m52-map .data-table th { text-align: center; padding: 6px 8px; }
.m52-map .data-table td:last-child { text-align: right; }
.m52-read3 { margin: 0 22px 12px 0; padding: 0; color: var(--ink-soft); line-height: 1.95; }
.m52-read3 > li { margin-bottom: 10px; padding-right: 4px; }
.m52-read3 > li::marker { color: var(--signal); font-weight: 700; }
.m52-read3 .formula-box { margin: 8px auto; }
/* ⁦4-6⁩ الجسيمات (الدقائق) والموجات: رسوم الدرس ومختبر duality-lab */
.m53-cyl { fill: rgba(255, 197, 61, 0.16); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.m53-cyl-top { fill: rgba(255, 197, 61, 0.34); stroke: var(--ink); stroke-width: 1.5; }
.m53-wall { fill: rgba(234, 241, 248, 0.07); stroke: var(--ink-soft); stroke-width: 1.2; }
.m53-shadow { fill: rgba(3, 14, 28, 0.9); stroke: var(--ink-muted); stroke-width: 1; }
/* بلا WebGL: لوح الشاشة نفسه رسماً مسطحاً مكان المشهد */
.m53-scene:has(> canvas.m53-flat) > .s3-fail { min-height: 0; padding: 6px 10px; font-size: 0.78rem; }   /* رسالة مختصرة فوق اللوح المسطح */
.m53-scene > canvas.m53-flat { display: block; width: 100%; height: auto; max-height: var(--lx-h); object-fit: contain; margin: 8px auto 0; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.m53-rtl { direction: rtl; text-align: right; font-family: var(--font-body); }
.lx-sl > .sp-value.m53-rtl { text-align: left; }
.m53-count { margin: 8px 0 0; font-size: 0.88rem; font-weight: 700; color: var(--signal); }
.fc-controls .fc-buttons.m53-btns { flex-wrap: wrap; gap: 6px; margin: 0; }
.fc-controls .fc-buttons.m53-btns button { flex: 1 1 auto; padding: 8px 10px; font-size: 0.86rem; white-space: nowrap; }
.m53-rh { margin: 0 0 -6px; font-size: 0.9rem; color: var(--ink-soft); font-weight: 700; }
.m53-table b { font-size: 0.95rem; overflow-wrap: anywhere; }
.m53-table b small { font-size: 0.8em; color: var(--ink-soft); }
.m53-swatch { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 50%; vertical-align: -0.1em; margin-inline-start: 6px; border: 1px solid var(--line-strong); }
.m53-table .m53-f { display: block; direction: ltr; text-align: right; white-space: nowrap; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); margin-top: 2px; }
/* الحاسوب: الجهاز عريض، فلا نجعل المشهد أقرب إلى المربع حين يضيق عموده (1024px): ارتفاعه لا يزيد على 72% من عرضه */
@media (min-width: 1000px) { .m53-scene { container-type: inline-size; } .lx .m53-scene .s3-wrap { height: min(var(--lx-h), 72cqw); } }
/* القراءات السريعة (مؤقتاً حتى يُصلح في style.css): القيمة LTR فـ margin-inline-start يقع على يسارها، أما الفراغ المطلوب فبينها وبين الاسم على يمينها */
@media (min-width: 641px) { .lx-hud.m53-hud b { margin-left: 0; margin-right: 6px; } }
/* 5-6 الموجات المادية: مختبر دي برولي (debroglie-lab) */
.m54-pick { flex-wrap: wrap; }
.m54-pick button { flex: 1 1 28%; min-width: 0; padding: 8px 4px; }
.fc-controls .m54-pick + .m54-sub { margin-top: 8px; }
.m54-sub { margin: 4px 0 12px; font-size: 0.85rem; color: var(--ink-muted); }
.m54-sub bdi { font-family: var(--font-mono); color: var(--ink); }
.lx-sl > .m54-sub { margin: 4px 0 0; }
.m54-ml { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.fc-controls .m54-mode { margin: 6px 0 12px; }
.m54-modebox[hidden], .m54-pre[hidden], .m54-sub[hidden] { display: none; }
.m54-mode button, .m54-pre button { padding: 8px 4px; }
.fc-controls .m54-pre { margin-top: 6px; }
/* سلّم الأطوال: بعد أدوات التحكم مباشرة، فيُرى مع شريط الانطلاق (والمشهد وقراءاته مثبّتة) */
.m54-scale { padding: 10px 12px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.18); }
.m54-cap { margin: 0 0 4px; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.7; }
.m54-bar { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto; direction: ltr; overflow: visible; }
.m54-lab sup, .m54-tour sup { font-size: 0.68em; line-height: 0; vertical-align: 0.55em; }
@media (max-width: 999px) { .m54-scale { order: 4; } }
/* الهاتف: طول الموجة والزخم قيمتان طويلتان (بالصيغة العلمية) فلكل منهما سطر */
@media (max-width: 640px) { .lx-hud > .m54-hw { grid-column: 1 / -1; } }
@media (max-width: 380px) { .m54-lw { display: none; } }   /* «λ ÷ ذرة» على أضيق الهواتف */
/* ⁦6-6⁩ مختبر «ألف صورة لإلكترون ذرة الهيدروجين» (cloud-lab) في التخطيط الموحد .lx:
   مخطط الأبعاد رسم ثانٍ ظاهر دائماً (.lx-alt)، واللوحة الثانية (الرزمة الموجية) تأخذ مكانه عند الطلب */
.m55-lx .fc-buttons { flex-wrap: wrap; gap: 8px; }
.m55-lx .fc-buttons + .fc-buttons { margin-top: 8px; }
.m55-lx .fc-buttons + .lx-sl, .m55-lx .lx-sl + .fc-buttons { margin-top: 10px; }
.m55-lx .fc-buttons button { flex: 1 1 0; min-width: 0; padding: 7px 4px; font-size: 0.88rem; line-height: 1.45; }
.m55-lx .fc-buttons button:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 400px) { .m55-lx .fc-buttons button { padding: 7px 2px; font-size: 0.8rem; } }
.m55-lx .m55-go { border-color: var(--signal); color: var(--signal); }
.m55-lx .fc-check { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--ink-soft); font-size: 0.88rem; cursor: pointer; }
.m55-lx .lx-hud[hidden] { display: none; }
.m55-lx .lx-hud b { margin: 0 6px 0 0; }   /* القيمة اتجاهها ltr: «margin-inline-start» المشتركة تقع على جهتها اليسرى، فتلتصق القيمة بالاسم */
.m55-sub { margin: 2px 0 0; font-size: 0.8rem; color: var(--ink-muted); }
.m55-hist, .m55-psi { display: block; width: 100%; height: auto; direction: ltr; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); border-radius: var(--radius); }
.m55-cap { margin: 0 0 4px; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); line-height: 1.6; text-align: center; }
.m55-cap .lx-x { vertical-align: middle; }
.m55-flow { margin: 0 0 16px; padding-inline-start: 22px; line-height: 2; }
@media (max-width: 999px) {
    /* لا مرساة تمرير داخل المختبر: الحالة قبل الجولة في ترتيب الصفحة وبعدها على الشاشة، والمشهد المثبّت قد يطول؛ فلو ثبّت المتصفح عنصراً
       تحتهما لقفزت الصفحة عند كل خطوة من الجولة وانزلق زر «التالي» تحت المشهد */
    .m55-lx { overflow-anchor: none; }
    .m55-lx .lx-stage > .lx-more .m55-hist, .m55-lx .lx-stage > .lx-more .m55-psi { border: 0; background: none; }
    /* اللوحة الثانية تغطي المبدّل والمشهد معاً (المبدّل يعيد الذرة أو المخطط) */
    .m55-lx .lx-stage > .m55-psiv:not([hidden]) { height: calc(var(--lx-h) + 34px); }
    .m55-lx .lx-stage > .m55-psiv svg { max-height: calc(var(--lx-h) - 8px); }
}
@media (min-width: 1000px) {
    /* اللوحة الثانية أطول من مخطط الأبعاد: يصغر المشهد قليلاً ما دامت ظاهرة، فيبقى عمود المشهد كله في الشاشة */
    .m55-lx .lx-stage:has(> .m55-psiv:not([hidden])) .s3-wrap { height: calc(var(--lx-h) * 0.52); }
    .m55-lx .lx-stage > .m55-histv svg { max-height: calc(var(--lx-h) * 0.42); }
}
/* ---------- درس 7-6: مختبر الخيال «مجهر هايزنبرك» في التخطيط الموحد .lx، واللوحة الثانية (الرزمة الموجية) رسم يظهر عند الطلب ---------- */
.m56-lx .lx-hud[hidden] { display: none; }
.m56-lx .lx-hud b { margin: 0 6px 0 0; }   /* القيمة اتجاهها ltr: «margin-inline-start» المشتركة تقع على جهتها اليسرى، فتلتصق القيمة بالاسم */
.m56-lx .fc-buttons.m56-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.m56-lx .fc-buttons.m56-btns button { flex: 1 1 0; min-width: 0; padding: 7px 4px; font-size: 0.86rem; line-height: 1.45; }
.m56-lx .fc-check { margin: 0 0 2px; }
.m56-lx .fc-buttons.m56-b4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 1000px) and (max-width: 1199px), (max-width: 480px) { .m56-lx .fc-buttons.m56-b4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.m56-pk > .lx-h:first-child { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.m56-cmp { grid-column: 1 / -1; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--inset); font-size: 0.88rem; line-height: 1.9; color: var(--ink-soft); }
.m56-cmp b { color: var(--ok); }
.m56-hl { outline: 2px solid var(--signal); outline-offset: 3px; }
.lx-hud > span.m56-hl { outline-offset: 1px; }
.m56-lead { margin: 0 0 8px; font-size: 0.82rem; line-height: 1.8; color: var(--ink-muted); }
.m56-cap { margin: 0 0 4px; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); line-height: 1.6; text-align: center; }
.m56-cap .lx-x { vertical-align: middle; }
.m56-comp { fill: none; stroke-width: 1.2; opacity: 0.9; }
.m56-psi { fill: none; stroke: var(--signal); stroke-width: 1.5; stroke-linejoin: round; }
.m56-env { fill: none; stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.m56-pd { fill: rgba(255, 138, 128, 0.18); stroke: var(--pos); stroke-width: 1.6; stroke-linejoin: round; }
.m56-bar { stroke: var(--ink); stroke-width: 1.6; }
.m56-ok { fill: var(--ok); }
.m56-pksvg { display: block; width: 100%; height: auto; direction: ltr; margin: 0 auto; }
@media (max-width: 999px) {
    /* لا مرساة تمرير داخل المختبر: الحالة قبل الجولة في ترتيب الصفحة وبعدها على الشاشة، والمشهد المثبّت قد يطول؛ فلو ثبّت المتصفح عنصراً
       تحتهما لقفزت الصفحة عند كل خطوة من الجولة وانزلق زر «التالي» تحت المشهد */
    .m56-lx { overflow-anchor: none; }
}
/* اللوحة الثانية رسم طويل (الموجات ثم مجموعها ثم توزيع الزخم): تحت مشهد مصغّر تصير كتابتها أصغر من أن تُقرأ،
   فعلى الحاسوب العريض تظهر بجانب المشهد (والمشهد بارتفاعه كاملاً)، وعلى الأضيق تأخذ مكانه،
   وعلى الهاتف يطول الجزء المثبّت قليلاً ما دامت ظاهرة */
@media (min-width: 1000px) {
    .m56-lx .lx-stage > .m56-pkv { margin-top: 0; }
}
@media (min-width: 1200px) {
    .m56-lx .lx-stage:has(> .m56-pkv:not([hidden])) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; align-items: center; }
    .m56-lx .lx-stage:has(> .m56-pkv:not([hidden])) > .lx-hud { grid-column: 1 / -1; }
    .m56-lx .lx-stage:has(> .m56-pkv:not([hidden])) .s3-wrap { height: var(--lx-h); }
    .m56-lx .lx-stage > .m56-pkv svg { max-height: calc(var(--lx-h) - 34px); }
}
@media (min-width: 1000px) and (max-width: 1199px) {   /* العمود أضيق من أن يتسع للاثنين: تأخذ اللوحة مكان المشهد كما على الهاتف حتى تُغلق */
    .m56-lx .lx-stage:has(> .m56-pkv:not([hidden])) > .m56-stage { display: none; }
    .m56-lx .lx-stage > .m56-pkv svg { max-height: calc(var(--lx-h) * 0.8); }
}
@media (max-width: 640px) {
    .m56-lx .lx-stage:has(> .m56-pkv:not([hidden])) .s3-wrap, .m56-lx .lx-stage > .m56-pkv:not([hidden]) { height: calc(var(--lx-h) + 32px); }
    .m56-lx .lx-stage > .m56-pkv svg { max-height: calc(var(--lx-h) - 12px); }
}
/* 8-6 النظرية النسبية: مختبر «كرة في قطار» (frames-lab) — التخطيط في .lx (style.css) */
.fc-controls .fc-buttons.m57-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m57-btns button { padding: 8px 4px; font-size: 0.86rem; min-width: 0; }
.lx-ctl .fc-check { margin: 4px 0 6px; font-size: 0.9rem; }
.sim-table .m57-relc { grid-column: 1 / -1; }
.sim-table b.m57-rel { font-size: 0.9rem; text-align: left; }
@media (max-width: 400px) { .m57-scene .s3-label { font-size: 0.7rem; padding: 0 4px; } }
.m57-nw { white-space: nowrap; }
/* 9-6 فرضيتا اينشتين: مختبر «مركبة تطلق ضوءاً وكرة» (lightspeed-lab) — التخطيط في .lx (style.css) */
.fc-controls .fc-buttons.m58-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m58-btns button { padding: 8px 4px; font-size: 0.86rem; min-width: 0; }
.m58-scene ~ .lx-hud .m58-off { opacity: 0.4; }
.lx-ctl .fc-check { margin: 4px 0 8px; font-size: 0.9rem; }
.m58-wrap { background: var(--inset); }
.m58-tab { font-size: 0.88rem; }
.m58-tab th, .m58-tab td { padding: 7px 8px; vertical-align: middle; }
.m58-tab thead th { font-size: 0.8rem; color: var(--ink-soft); text-align: center; line-height: 1.5; }
.m58-tab tbody th { font-size: 0.85rem; text-align: right; line-height: 1.5; }
.m58-tab td { text-align: center; }
.m58-tab td b { display: block; font-family: var(--font-mono); font-weight: 600; font-size: 1rem; color: var(--ink); }
.m58-tab td small { margin-top: 2px; font-size: 0.74rem; line-height: 1.5; }
.m58-tab tr.m58-off { opacity: 0.35; }
.m58-nw { display: inline-block; white-space: nowrap; }
@media (max-width: 400px) {
    .m58-tab th, .m58-tab td { padding: 6px 4px; }
    .m58-scene .s3-label { font-size: 0.7rem; padding: 0 4px; }
}
/* ---------- 10-6 تحويلات لورنتز: جدول قيم γ الطويلة في الدرس، ومختبر lorentz-lab ---------- */
.m59-long { font-family: var(--font-mono); font-size: 0.86rem; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.fc-controls .fc-buttons.m59-pre { flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.fc-controls .fc-buttons.m59-pre button { flex: 1 1 28%; padding: 7px 4px; font-size: 0.86rem; min-width: 0; }
.m59-pre button.on { background: var(--signal-soft); border-color: var(--signal); color: var(--signal); }
.m59-curve, .m59-scene { touch-action: pan-y; }
.m59-hit { cursor: ew-resize; }
.m59-cap { margin: 0; font-size: 0.8rem; line-height: 1.7; color: var(--ink-muted); }
.m59-books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.m59-bk { background: var(--inset); border: 1px solid var(--line); border-right: 3px solid var(--ink-muted); border-radius: 2px; padding: 6px 10px; font-size: 0.82rem; color: var(--ink-muted); }
.m59-bk.m59-s { border-right-color: var(--signal); }
.m59-bk.m59-l { border-right-color: var(--neg); }
.m59-bk.m59-off, .lx-hud > span.m59-off { opacity: 0.35; }
.m59-bh { display: block; font-weight: 700; color: var(--ink-soft); margin-bottom: 2px; }
.m59-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.m59-v { font-family: var(--font-mono); font-size: 0.98rem; color: var(--ink); direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.m59-stw { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--screen); }
.m59-stw[hidden] { display: none; }
.m59-stw svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
.m59-tbl { grid-template-columns: 1.5fr 1fr 1fr; }
.m59-tbl > .m59-w:last-child { grid-column: 1 / -1; }
/* الدفاتر الثلاثة بعضها تحت بعض (عمود الأدوات أضيق من أن تتسع فيه جنباً إلى جنب): «أين؟» و«متى؟» في سطر واحد */
.m59-lx .m59-books { grid-template-columns: 1fr; gap: 6px; }
.m59-lx .m59-bk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.m59-lx .m59-bh { grid-column: 1 / -1; }
@media (max-width: 600px) {
    .m59-lx .m59-bk { display: block; padding: 5px 9px; }
    .m59-tbl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .m59-tbl > .m59-w { grid-column: span 2; }
}
/* الرسمان في عمود المشهد على الحاسوب: المنحنى فوق مشهد الصاروخ، وكلاهما مع القراءات وسطر الحالة ضمن ارتفاع الشاشة */
@media (min-width: 1000px) {
    .m59-main, .m59-sc { container-type: inline-size; }   /* حين يضيق العمود (1024px) يصغر الرسمان قليلاً ليبقى سطر الحالة الطويل ضمن الشاشة */
    .m59-lx .lx-2d > svg { max-height: min(calc(var(--lx-h) * 0.62), 50cqw); }
    .m59-lx .lx-stage > .lx-more svg { max-height: min(calc(var(--lx-h) * 0.42), 33cqw); width: 100%; }
}
/* الهاتف: الرسم المختار في المبدّل يظهر وحده في مكانه
   (لا نغطي المنحنى بطبقة بارتفاع ‎--lx-h‎ لأن المنحنى أقصر منها فتغطي الطبقة القراءات تحته) */
@media (max-width: 999px) {
    .m59-lx .lx-stage[data-v="more"] > .lx-2d { display: none; }
    .m59-lx .lx-stage[data-v="more"] > .lx-more.lx-alt { position: static; height: auto; padding: 0; border: 0; background: none; display: block; }
}
/* القراءات السريعة (مؤقتاً حتى يُصلح في style.css): القيمة LTR فـ margin-inline-start يقع على يسارها، أما الفراغ المطلوب فبينها وبين الاسم على يمينها */
@media (min-width: 641px) { .lx-hud.m59-hud b { margin-left: 0; margin-right: 6px; } }
/* درس 11-6: مختبر النسبية (relativity-lab) — التخطيط في .lx (style.css) */
.m510-pre { margin: 0 0 8px; gap: 6px; }
.fc-controls .m510-pre { margin-top: 0; }
.m510-pre button { padding: 7px 2px; font-family: var(--font-mono); font-weight: 600; min-width: 0; }
.fc-controls .fc-buttons.m510-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m510-btns button { padding: 8px 4px; font-size: 0.86rem; min-width: 0; }
.lx-ctl .m510-trichk { margin: 4px 0 6px; font-size: 0.9rem; }
.m510-hud > span[hidden] { display: none; }
.m510-proof .figure { margin-inline: 0; }   /* رسم داخل «لمن يحب البرهان» لا يمتد خارج حدوده على الجوال */
/* درس 12-6 تكافؤ الكتلة والطاقة: مختبر «حوّل قطعة من المادة إلى طاقة» (js/sims-modern.js: emc2-lab) — التخطيط في .lx (style.css) */
.fc-controls .fc-buttons.m511-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.m511-btns button { flex: 1 1 28%; min-width: 0; padding: 8px 6px; font-size: 0.86rem; }
.lx-ctl .fc-check { margin: 4px 0 6px; font-size: 0.9rem; }
.m511-sub { margin: 2px 0 0; font-size: 0.78rem; color: var(--ink-muted); }
.m511-fnote { margin: 0; font-size: 0.78rem; }
.m511-fine { color: var(--ink-muted); font-size: 0.88em; }
.m511-table.sim-table > div { line-height: 1.6; }
.m511-table.sim-table b { font-family: var(--font-body); font-weight: 700; font-size: 1rem; }
.m511-scene ~ .lx-hud b.ar bdi { font-family: var(--font-mono); font-weight: 600; }   /* الأس (⁴) بخط الأرقام لا بخط النص العربي */
@media (max-width: 640px) { .lx-hud > .m511-hh { grid-column: 1 / -1; } }   /* مدة البيت قد تطول (3.24×10⁻⁵ ثانية): سطر كامل على الهاتف */

/* dive lesson css: chapter 7 */
/* ---------- درس 1-7: مقدمة — رسوم الدرس (الشكل 1، الأهداف، المصطلحات) ومختبر «من الجهاز إلى الذرة» (chip-zoom-lab) ---------- */
.m60-pcb { fill: #1E5A3C; stroke: #2E7A52; stroke-width: 1.5; }
.m60-trace { fill: none; stroke: #C9A45C; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.m60-can { fill: #AEB8C4; stroke: #E6ECF2; stroke-width: 1.2; }
.m60-can-top { fill: #CBD3DC; stroke: #8E99A6; stroke-width: 1; }
.m60-res { fill: #D9C39A; stroke: #8C7350; stroke-width: 1; }
.m60-cap-r { fill: #C8463C; stroke: #7A2620; stroke-width: 1; }
.m60-cap-b { fill: #3C6FC8; stroke: #22427A; stroke-width: 1; }
.m60-cap-cyl { fill: #2F5FB0; stroke: #9DB8E8; stroke-width: 1.2; }
.m60-scope { fill: rgba(205, 214, 224, 0.14); stroke: var(--ink-soft); stroke-width: 1.5; }
.m60-screen { fill: #12305A; stroke: var(--ink-muted); stroke-width: 1.2; }
.m60-grid { stroke: rgba(160, 200, 255, 0.28); stroke-width: 1; }
.m60-wave { fill: none; stroke: #9DFF8A; stroke-width: 2; }
.m60-spot { fill: #E8FFE0; stroke: #9DFF8A; stroke-width: 2; }
.m60-knob { fill: var(--screen); stroke: var(--ink-soft); stroke-width: 1.4; }
.m60-knob-l { stroke: var(--ink-soft); stroke-width: 1.4; }
.m60-btn { fill: rgba(234, 241, 248, 0.22); stroke: var(--ink-muted); stroke-width: 1; }
.m60-cable { fill: none; stroke: var(--ink-muted); stroke-width: 3.5; stroke-linecap: round; }
.m60-handle { fill: none; stroke: var(--ink-muted); stroke-width: 3; stroke-linecap: round; }

/* الأهداف السلوكية */
.m60-goals { margin: 10px 0 14px; padding: 12px 14px 10px; border: 1px solid rgba(255, 197, 61, 0.35); border-radius: var(--radius); background: var(--signal-soft); }
.m60-goals-h { margin: 0 0 8px; font-weight: 700; color: var(--ink); }
.m60-goals ol { margin: 0; padding-inline-start: 24px; display: grid; gap: 3px; }
.m60-goals li { color: var(--ink-soft); line-height: 1.75; }
.m60-goals li > span { margin-inline-end: 8px; }
.m60-goals li > a { color: var(--signal); font-family: var(--font-mono); font-size: 0.88rem; white-space: nowrap; unicode-bidi: isolate; }
/* المصطلحات وجداول الدرس */
.m60-terms .data-table { font-size: 0.95rem; }
.m60-terms th:nth-child(3), .m60-terms td:nth-child(3) { text-align: center; white-space: nowrap; }
.m60-terms td:nth-child(2) { text-align: left; }
.m60-terms .en { white-space: normal; }
@media (max-width: 640px) { .m60-terms .data-table, .m60-devs .data-table { font-size: 0.86rem; } .m60-terms th, .m60-terms td, .m60-devs th, .m60-devs td { padding: 6px 5px; } }
.m60-terms td a { color: var(--signal); font-family: var(--font-mono); font-size: 0.9rem; }
.m60-devs .data-table, .m60-size .data-table { font-size: 0.95rem; }
.m60-devs td:first-child { font-weight: 700; color: var(--ink); }
.m60-size td:nth-child(2), .m60-size td:nth-child(3), .m60-size th:nth-child(2), .m60-size th:nth-child(3) { text-align: center; }

/* المختبر */
.m60-zsvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m60-zbg { fill: #08182C; }
.m60-zframe { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.m60-flow { fill: none; stroke-linecap: round; }
.m60-tgt { fill: none; stroke: var(--signal); stroke-width: 1.6; stroke-dasharray: 4 3; }
.m60-wall { fill: #0D2340; }
.m60-table { fill: #4A3424; }
.m60-radio { fill: #7A4E32; stroke: #C79A6E; stroke-width: 2; }
.m60-ant { stroke: var(--ink-soft); stroke-width: 2.4; stroke-linecap: round; }
.m60-ant-tip { fill: var(--ink-soft); }
.m60-grille { fill: #E2D2B4; stroke: #9C7B55; stroke-width: 1.5; }
.m60-hole { fill: #6B4A30; }
.m60-dial { fill: #F1E6C8; stroke: #9C7B55; stroke-width: 1.2; }
.m60-tick { stroke: #5A4632; stroke-width: 1; }
.m60-needle { stroke: #D2382E; stroke-width: 2; }
.m60-cut { fill: #071A12; stroke: var(--signal); stroke-width: 1; stroke-dasharray: 3 3; }
.m60-snd { fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; }
.m60-dark { fill: #08182C; }
.m60-leg { stroke: #C3CCD6; stroke-width: 4; stroke-linecap: round; }
.m60-hdr { fill: #C7CFD8; stroke: #EEF3F8; stroke-width: 1.2; }
.m60-hdr-side { fill: #8994A1; stroke: none; }
.m60-glass { fill: #DDEBF5; stroke: #9FB4C6; stroke-width: 1; }
.m60-post { fill: #F2D06B; stroke: #A88A2C; stroke-width: 0.8; }
.m60-bond { fill: none; stroke: #F2C14E; stroke-width: 1.3; }
.m60-die { fill: #5E5A7A; stroke: #C8C2EA; stroke-width: 0.8; }
.m60-die-s { fill: #3C3952; }
.m60-lead { stroke: var(--ink-muted); stroke-width: 1; }
.m60-nreg { fill: #26476E; stroke: #6F9AD0; stroke-width: 1.2; }
.m60-nreg2 { fill: #3A6AA8; stroke: #9CC4F2; stroke-width: 1; }
.m60-preg { fill: #7A3E46; stroke: #E09AA4; stroke-width: 1; }
.m60-metal { fill: #C9D3DD; stroke: #F2F6FA; stroke-width: 1; }
.m60-dot { fill: #F2C14E; }
.m60-here line { stroke: var(--signal); stroke-width: 1.6; }
.m60-here circle { fill: var(--signal); }
.m60-bondl { stroke: rgba(150, 175, 205, 0.45); stroke-width: 1.2; }
.m60-be { fill: #7CC7FF; }
.m60-si { fill: #8E9AA8; stroke: #DCE3EA; stroke-width: 1.2; }
.m60-sit { fill: #0B1A2C; font-weight: 700; }
.m60-lbl { fill: rgba(8, 24, 44, 0.88); stroke: var(--line-strong); stroke-width: 1; }
.m60-shell { fill: none; stroke: rgba(150, 175, 205, 0.55); stroke-width: 1.2; }
.m60-shell.val { stroke: var(--signal); stroke-width: 2.2; }
.m60-el { fill: #7CC7FF; stroke: #071A30; stroke-width: 1; }
.m60-el.val { stroke: var(--signal); stroke-width: 1.8; }
.m60-nuc { fill: #FFB35C; stroke: #FFE0B3; stroke-width: 1.2; }
.m60-sbg { fill: rgba(5, 16, 30, 0.82); }
.m60-sl { stroke: var(--ink); stroke-width: 2; }
.m60-st { fill: var(--ink); }
.m60-rbg { fill: var(--inset); stroke: var(--line); stroke-width: 1; }
.m60-axis { stroke: var(--ink-muted); stroke-width: 1.2; }
.m60-rdot { fill: var(--ink-soft); }
.m60-ptr path { fill: var(--signal); }
.m60-ptr line { stroke: var(--signal); stroke-width: 2; }
.m60-ptrt { fill: var(--signal); font-weight: 700; }
.m60-lv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 0 0 10px; }
.m60-lv button { padding: 6px 4px; font: inherit; font-size: 0.82rem; line-height: 1.35; border-radius: var(--radius); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; min-width: 0; }
.m60-lv button:hover { background: var(--hover); }
.m60-lv button.fc-primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 700; }
.m60-go button { padding: 8px 6px; }
.m60-table.sim-table .m60-wide { grid-column: 1 / -1; }
.m60-table.sim-table b.ar { font-size: 0.95rem; line-height: 1.7; }
@media (max-width: 640px) { .m60-lv button { font-size: 0.76rem; padding: 5px 2px; } }
.m60-n { white-space: nowrap; }
/* ---------- درس 2-7: المدارات الالكترونية ومستويات الطاقة — رسوم الدرس ومختبر «الذرة وسُلّم طاقتها» (levels-lab) ---------- */
.m61-el { fill: #7CC7FF; stroke: #071A30; stroke-width: 1; }
.m61-el.val { stroke: var(--signal); stroke-width: 1.8; }
.m61-minus { fill: #071A30; font-weight: 700; }
.m61-pr { fill: #FF8A80; stroke: #FFD0CB; stroke-width: 0.8; }
.m61-nt { fill: #8E9AA8; stroke: #DCE3EA; stroke-width: 0.8; }
.m61-plus { fill: #3A0E0A; font-weight: 700; }
.m61-frame { fill: rgba(255, 179, 92, 0.05); stroke: var(--line-strong); stroke-width: 1; }
.m61-zone { fill: rgba(200, 215, 235, 0.06); }
.m61-orb1 { fill: none; stroke: #C0566A; stroke-width: 2; }
.m61-orb2 { fill: none; stroke: rgba(255, 197, 61, 0.55); stroke-width: 12; }
.m61-shell { fill: none; stroke: rgba(150, 175, 205, 0.55); stroke-width: 1.2; }
.m61-shell.val { stroke: var(--signal); stroke-width: 2.2; }
.m61-nuc { fill: #FFB35C; stroke: #FFE0B3; stroke-width: 1.2; }
.m61-row > .fig-panel { min-width: min(100%, 150px); }
.m61-bar { fill: rgba(255, 138, 128, 0.75); }
.m61-bar.val { fill: var(--signal); }
.m61-zero { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 5 4; }
.m61-lvl { stroke: var(--ink-soft); stroke-width: 1.6; }
.m61-gnd { stroke: #FF6B5E; stroke-width: 3.2; }
.m61-up { stroke: var(--signal); stroke-width: 2.4; }

/* المختبر */
.m61-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m61-bg { fill: #08182C; stroke: var(--line-strong); stroke-width: 1; }
.m61-ah-ink { fill: var(--ink-soft); }
.m61-ah-sig { fill: var(--signal); }
.m61-ah-mu { fill: var(--ink-muted); }
.m61-ah-bad { fill: var(--bad); }
.m61-ax { stroke: var(--ink-soft); stroke-width: 1.3; }
.m61-ll { stroke: rgba(150, 175, 205, 0.8); stroke-width: 2.4; stroke-linecap: round; }
.m61-ll.val { stroke: var(--signal); }
.m61-ll.sel { stroke-width: 4; }
.m61-sh { fill: none; stroke: rgba(150, 175, 205, 0.5); stroke-width: 1.2; }
.m61-sh.val { stroke: var(--signal); stroke-width: 2.2; }
.m61-e { fill: #7CC7FF; stroke: #071A30; stroke-width: 1; }
.m61-e.val { stroke: var(--signal); stroke-width: 1.8; }
.m61-e.sel { stroke: #FF8A80; stroke-width: 2.2; }
.m61-pull { stroke: #FF8A80; stroke-linecap: round; opacity: 0.9; }
.m61-flyA, .m61-fly, .m61-fly2, .m61-eb, .m61-ea { fill: #7CC7FF; stroke: #DFF2FF; stroke-width: 1.2; }
.m61-freez { fill: rgba(95, 211, 154, 0.08); }
.m61-lv { stroke: var(--ink-soft); stroke-width: 1.6; }
.m61-gap { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.m61-orb { fill: none; stroke: rgba(150, 175, 205, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.m61-orb.on { stroke: var(--ink-soft); stroke-dasharray: none; stroke-width: 1.4; }
.m61-garr { stroke: var(--signal); stroke-width: 2.6; }
.m61-garr.bad { stroke: var(--bad); stroke-dasharray: 4 3; }
.m61-gtx { fill: var(--signal); font-weight: 700; }
.m61-gtx.bad { fill: var(--bad); }
.m61-x { fill: var(--bad); font-weight: 700; }
.m61-atoms, .m61-ns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0 0 8px; }
.m61-ns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.m61-shells { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 6px; }
.m61-atoms button, .m61-ns button, .m61-shells button, .m61-qb button { padding: 6px 6px; font: inherit; font-size: 0.84rem; line-height: 1.35; border-radius: var(--radius); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; min-width: 0; }
.m61-shells button { flex: 1 1 auto; }
.m61-atoms button:hover, .m61-ns button:hover, .m61-shells button:hover { background: var(--hover); }
.m61-atoms button.fc-primary, .m61-ns button.fc-primary, .m61-shells button.fc-primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 700; }
.m61-qb { margin: 0 0 4px; flex-wrap: wrap; }
.m61-qb button { flex: 1 1 auto; font-size: 0.8rem; }
.m61-mode button { padding: 8px 6px; }
.m61-table.sim-table .m61-wide { grid-column: 1 / -1; }
.m61-table.sim-table b.ar { font-size: 0.95rem; line-height: 1.7; }
.m61-n { white-space: nowrap; }
@media (max-width: 640px) { .m61-atoms button, .m61-ns button, .m61-shells button { font-size: 0.78rem; padding: 5px 3px; } }
.m61-mode button, .m61-ca .fc-buttons button, .m61-cb .fc-buttons button { padding: 7px 6px; font-size: 0.88rem; line-height: 1.45; }
.m61-ca, .m61-cb { margin-top: 12px; }
/* ---------- درس 3-7: الموصلات والعوازل وأشباه الموصلات — رسوم الدرس و«مختبر الرقاقة» (conduct-lab) ---------- */
.m62-e { fill: #7CC7FF; }
.m62-eb { fill: rgba(124, 199, 255, 0.62); }
.m62-at { fill: #8E99A6; stroke: rgba(234, 241, 248, 0.35); stroke-width: 0.8; }
.m62-at.cu { fill: #C98A5E; }
.m62-at.gl { fill: #8FB3C9; opacity: 0.85; }
.m62-slab { fill: rgba(170, 186, 206, 0.07); stroke: var(--line-strong); stroke-width: 1.2; }
.m62-plus { fill: rgba(255, 107, 107, 0.28); stroke: #FF6B6B; stroke-width: 1.4; }
.m62-minus { fill: rgba(78, 168, 255, 0.28); stroke: #4EA8FF; stroke-width: 1.4; }
.t-label.m62-tp, .t-ar.m62-tp { fill: #FF6B6B; font-weight: 700; }
.t-label.m62-tn, .t-ar.m62-tn { fill: #4EA8FF; font-weight: 700; }
.t-label.m62-ti { fill: var(--signal); font-weight: 700; }
/* سلك الشاحن */
.m62-plug { fill: #3A4A5E; stroke: var(--ink-soft); stroke-width: 1.2; }
.m62-pin { stroke: var(--ink-soft); stroke-width: 3; stroke-linecap: round; }
.m62-pin2 { stroke: var(--ink-muted); stroke-width: 1.6; }
.m62-jacket { fill: #4A5D73; stroke: var(--ink-soft); stroke-width: 1.2; }
.m62-cut { fill: rgba(7, 26, 48, 0.78); stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.m62-core { fill: #8A5634; stroke: #C98A5E; stroke-width: 1; }
.m62-phone { fill: #0E2440; stroke: var(--ink-soft); stroke-width: 1.5; }
.m62-screen { fill: rgba(124, 199, 255, 0.06); stroke: var(--line); stroke-width: 1; }
.m62-chip { fill: #2B3644; stroke: var(--ink-soft); stroke-width: 1.2; }
/* الذرة في الموصل والعازل */
.m62-orb { fill: none; stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.m62-cloud { fill: rgba(124, 199, 255, 0.07); stroke: var(--line); stroke-width: 1; }
.m62-nuc { fill: var(--signal); stroke: var(--ink); stroke-width: 1; }
/* قطعة المقاومة النوعية */
.m62-bar { fill: rgba(201, 138, 94, 0.22); stroke: var(--ink-soft); stroke-width: 1.4; }
.m62-bar-top { fill: rgba(201, 138, 94, 0.32); stroke: var(--ink-soft); stroke-width: 1.2; }
.m62-bar-end { fill: rgba(255, 197, 61, 0.3); stroke: var(--signal); stroke-width: 1.4; }
/* مسطرة المقاومة النوعية: الموصلات أخضر، وأشباه الموصلات كهرماني، والعوازل أحمر */
.m62-bc { fill: rgba(95, 211, 154, 0.55); }
.m62-bs { fill: rgba(255, 197, 61, 0.5); }
.m62-bi { fill: rgba(255, 123, 123, 0.5); }
.m62-bq { fill: rgba(149, 173, 198, 0.14); stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 2; }
.t-ar.m62-bt { fill: var(--ink); font-weight: 700; }
.m62-mk { fill: var(--ink); }
.m62-mk path { fill: var(--ink); }

/* المختبر */
.m62-sc { direction: ltr; }
.m62-w { fill: none; stroke: var(--ink-soft); stroke-width: 1.8; }
.m62-flow { fill: none; stroke: #7CC7FF; stroke-width: 3.6; stroke-linecap: round; stroke-dasharray: 0.01 12; animation: m62-run 1s linear infinite; }
@keyframes m62-run { from { stroke-dashoffset: 12; } to { stroke-dashoffset: 0; } }
.m62-paused .m62-flow { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .m62-flow { animation: none; } }
.m62-amm { fill: var(--signal); stroke: var(--ink); stroke-width: 1.2; }
.m62-glow { fill: #FFD25A; opacity: 0; filter: blur(2px); }
.m62-bulb { fill: rgba(255, 255, 255, 0.06); stroke: var(--ink-soft); stroke-width: 1.4; }
.m62-bulb.on { fill: rgba(255, 226, 140, 0.85); stroke: var(--signal); }
.m62-fil { stroke: var(--ink-muted); stroke-width: 1.2; fill: none; }
.m62-disp { fill: #04101F; stroke: var(--line-strong); stroke-width: 1; }
.t-ar.m62-dt, .t-label.m62-dt { fill: var(--signal); font-family: var(--font-mono); }
.m62-bp { stroke: #FF6B6B; stroke-width: 2.4; }
.m62-bn { stroke: #4EA8FF; stroke-width: 5; }
.m62-conv line { stroke: var(--signal); stroke-width: 2.2; }
.m62-conv path { fill: var(--signal); }
.m62-lx .lx-hud i { font-style: normal; }
.m62-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 0 0 4px; }
.m62-pick1, .m62-pick2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m62-pick button { padding: 7px 2px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-size: 0.84rem; line-height: 1.35; cursor: pointer; min-width: 0; }
.m62-pick button bdi { font-family: var(--font-mono); color: var(--ink-muted); font-size: 0.78rem; }
.m62-pick button:hover { background: var(--hover); }
.m62-pick button.fc-primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 700; }
.m62-pick button.fc-primary bdi { color: var(--signal-ink); }
.fc-controls .fc-buttons.m62-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.fc-controls .fc-buttons.m62-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.m62-table.sim-table b.ar { font-family: var(--font-body); direction: rtl; }
/* جدول المقارنة في الدرس */
.m62-cmp .data-table td, .m62-cmp .data-table th { vertical-align: top; }
.m62-cmp .data-table td:first-child { font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) {
    .m62-pick { gap: 4px; }
    .m62-pick button { font-size: 0.76rem; padding: 6px 1px; }
}
/* نصوص الدرس */
.m62-aside { color: var(--ink-muted); font-size: 0.9em; }
.m62-ol { margin: 0 0 10px; padding-inline-start: 22px; line-height: 1.9; }
.m62-ol li { margin-bottom: 4px; }
.m62-src { margin: 8px 0 0; font-size: 0.88rem; color: var(--ink-muted); }
/* ---------- درس 4-7: حزم الطاقة في المواد الصلبة — رسوم الدرس و«مختبر الرقاقة» (bands-lab) ----------
   حزمة التكافؤ كهرمانية، وحزمة التوصيل فيروزية، والثغرة فارغة؛ الإلكترون نقطة سماوية، والمكان الفارغ دائرة وردية مفرغة */
.m63-e { fill: #7CC7FF; }
.m63-hole { fill: none; stroke: #FF7A9A; stroke-width: 1.6; }
.m63-at { fill: #8E99A6; stroke: rgba(234, 241, 248, 0.4); stroke-width: 0.9; }
.m63-vb { fill: rgba(255, 179, 71, 0.26); stroke: #FFB347; stroke-width: 1.3; }
.m63-cb { fill: rgba(64, 201, 190, 0.18); stroke: #40C9BE; stroke-width: 1.3; }
.m63-gapz { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.m63-strC { stroke: rgba(64, 201, 190, 0.6); stroke-width: 1.2; }
.m63-strV { stroke: rgba(255, 179, 71, 0.6); stroke-width: 1.2; }
.m63-gapl { stroke: var(--neg); stroke-width: 1.4; }
.m63-lvl { stroke: var(--ink); stroke-width: 2; }
.m63-lvl.thin { stroke: rgba(64, 201, 190, 0.85); stroke-width: 1; }
.m63-ovl { stroke: #E879C6; stroke-width: 3; }
.m63-fanU { fill: none; stroke: rgba(64, 201, 190, 0.85); stroke-width: 1.3; }
.m63-fanL { fill: none; stroke: rgba(255, 179, 71, 0.9); stroke-width: 1.3; }
.m63-dash { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.m63-cut { stroke: var(--signal); stroke-width: 2; stroke-dasharray: 5 4; }
.m63-try { stroke: var(--ink-muted); stroke-width: 1.4; stroke-dasharray: 3 3; }
.m63-try.ok { stroke: var(--ok); }
.m63-ghost { fill: none; stroke: #7CC7FF; stroke-width: 1.4; stroke-dasharray: 2 2; }
.m63-ghost.ok { stroke: var(--ok); }
.t-label.m63-tx { fill: var(--bad); font-weight: 700; }
.t-label.m63-tok { fill: var(--ok); font-weight: 700; }
.m63-pk { fill: none; stroke: var(--signal); stroke-width: 2.2; stroke-linecap: round; }
.t-ar.m63-tgap { fill: var(--neg); font-weight: 700; }
.t-label.m63-tgap { fill: var(--neg); }
.t-ar.m63-tov { fill: #E879C6; font-weight: 700; }
.t-ar.m63-tb { fill: var(--ink-soft); }
.m63-row3 { flex-wrap: nowrap; gap: 8px; }
.m63-row3 > .fig-panel { min-width: 0; flex: 1 1 0; }
@media (max-width: 640px) {
    .m63-row3 { gap: 4px; }
    .m63-row3 .fig-caption { font-size: 0.78rem; }
}

/* المختبر */
.m63-sc { direction: ltr; }
.m63-mode { display: flex; gap: 4px; margin: 0 0 6px; }
.m63-mode button { flex: 1; height: 30px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--inset); color: var(--ink-soft);
    font: inherit; font-size: 0.84rem; font-weight: 700; cursor: pointer; }
.m63-mode button.fc-primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.m63-ax { stroke: var(--ink-soft); stroke-width: 1.4; }
.m63-ax-h { fill: var(--ink-soft); }
.m63-gp { stroke: var(--neg); stroke-width: 1.4; }
.m63-gp-h { fill: var(--neg); }
.m63-r0 { stroke: var(--ink); stroke-width: 1.4; }
.m63-fu { fill: none; stroke: rgba(64, 201, 190, 0.9); stroke-width: 1.4; }
.m63-fl { fill: none; stroke: rgba(255, 179, 71, 0.95); stroke-width: 1.4; }
.m63-fu.thin, .m63-fl.thin { stroke-width: 0.7; opacity: 0.8; }
.m63-fu-fill { fill: rgba(64, 201, 190, 0.16); }
.m63-fl-fill { fill: rgba(255, 179, 71, 0.2); }
.m63-cutl { stroke: var(--signal); stroke-width: 1.8; stroke-dasharray: 5 4; }
.t-label.m63-tcut { fill: var(--signal); }
.m63-lv { stroke: var(--ink-soft); stroke-width: 1.3; }
.m63-pkh { fill: none; stroke: #FF9F5A; stroke-width: 2; stroke-linecap: round; }
.m63-pkl { fill: none; stroke: var(--signal); stroke-width: 2.2; stroke-linecap: round; }
.m63-pkl-h { fill: var(--signal); stroke: none; }
.m63-pkf { stroke: var(--pos); stroke-width: 2.2; }
.m63-pkf-h { fill: var(--pos); stroke: none; }
.t-label.m63-pkf-t { fill: var(--pos); stroke: none; }
.t-ar.m63-ft { font-weight: 700; fill: var(--ink-muted); }
.t-ar.m63-ft.ok { fill: var(--ok); }
.t-ar.m63-ft.bad { fill: var(--bad); }
.m63-sub { margin: 4px 0 4px; font-size: 0.8rem; color: var(--ink-muted); }
.m63-seg { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.m63-seg button { flex: 1 1 0; min-width: 0; padding: 6px 3px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink);
    font: inherit; font-size: 0.82rem; line-height: 1.35; cursor: pointer; }
.m63-seg button bdi { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-muted); }
.m63-seg button:hover { background: var(--hover); }
.m63-seg button.fc-primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 700; }
.m63-seg button.fc-primary bdi { color: var(--signal-ink); }
.fc-controls .fc-buttons.m63-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.fc-controls .fc-buttons.m63-btns button { padding: 8px 4px; font-size: 0.86rem; min-width: 0; }
.m63-table.sim-table b.ar { font-family: var(--font-body); direction: rtl; }
.m63-lx .fc-status b { color: var(--ink); }
@media (max-width: 640px) {
    .m63-mode button { font-size: 0.78rem; }
    .m63-seg button { font-size: 0.76rem; padding: 6px 1px; }
}
/* نصوص الدرس */
.m63-ol { margin: 0 0 10px; padding-inline-start: 22px; line-height: 1.9; }
.m63-ol li { margin-bottom: 4px; }
.m63-pink li, .m63-pinkq { color: #FF9CC8; }
.m63-tab .data-table td, .m63-tab .data-table th { text-align: center; }
.m63-tab .data-table td:first-child { text-align: right; font-weight: 700; }
.m63-sep { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
/* ---------- درس 5-7: أشباه الموصلات النقية — «مختبر الرقاقة» (intrinsic-lab) ومحرك البلورة المسطّحة (يستعمله مختبر 6-7 أيضاً) ورسوم الدرس ---------- */
.m64-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
/* الدائرة الخارجية والبطارية */
.m64-wire { fill: none; stroke: var(--ink-soft); stroke-width: 2; }
.m64-circ line { stroke: var(--ink); stroke-width: 2.4; }
.m64-circ line.long { stroke-width: 2.4; }
.m64-circ.off .m64-wire, .m64-circ.off line { opacity: 0.28; }
.m64-circ.off .m64-bp, .m64-circ.off .m64-bm { opacity: 0.35; }
.m64-bp { fill: #FF7B7B; font-weight: 700; }
.m64-bm { fill: #6EA8FF; font-weight: 700; }
.m64-plus { fill: #FF7B7B; font-weight: 700; }
.m64-minus { fill: #6EA8FF; font-weight: 700; }
.m64-ef { fill: none; stroke: #7CC7FF; stroke-width: 3.6; stroke-linecap: round; stroke-dasharray: 0.01 14; }
.m64-iarr { fill: var(--signal); }
.m64-iI { fill: var(--signal); font-weight: 700; }
.m64-plate { fill: #8A97A8; stroke: var(--ink-soft); stroke-width: 1; }
.m64-fl { stroke: #FF7A9A; stroke-width: 1.2; stroke-dasharray: 5 5; opacity: 0.55; }
.m64-fE { fill: #FF7A9A; font-family: 'Times New Roman', serif; font-style: italic; font-weight: 700; }
/* الذرات والأواصر والحوامل */
.m64-gl { stroke: rgba(195, 210, 226, 0.13); stroke-width: 9; stroke-linecap: round; }
.m64-gl.m64-stub { stroke: rgba(195, 210, 226, 0.08); }
.m64-gl.imp { stroke: rgba(255, 179, 92, 0.12); }
.m64-be { fill: #C3D2E2; }
.m64-be.m64-stubd { opacity: 0.45; }
.m64-atom { fill: #4E5C6D; stroke: #93A5B9; stroke-width: 1.4; }
.m64-atom.d { fill: #FFB35C; stroke: #FFD9A8; }
.m64-atom.a { fill: #B48CFF; stroke: #DCCBFF; }
.m64-sym { fill: #EAF1F8; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; }
.m64-atom.d + .m64-sym, .m64-atom.a + .m64-sym { fill: #0B2747; }
.m64-ion circle { fill: #FFB35C; stroke: var(--screen); stroke-width: 1.2; }
.m64-ion text { fill: #0B2747; font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.m64-ion.a circle { fill: #B48CFF; }
.m64-fe { fill: #7CC7FF; stroke: rgba(124, 199, 255, 0.35); stroke-width: 4; }
.m64-fe.b { stroke-width: 2.5; }
.m64-tr { stroke: rgba(124, 199, 255, 0.55); stroke-width: 2; stroke-dasharray: 2 3; }
.m64-hole { fill: var(--screen); stroke: #FF7A9A; stroke-width: 2; }
.m64-hole.bound { stroke-dasharray: 2.5 2; stroke-width: 2.4; r: 5.6px; fill: rgba(255, 122, 154, 0.14); }
.m64-hole.b { fill: #3B2C18; stroke-width: 1.8; }
.m64-spark { fill: none; stroke-width: 2.2; }
.m64-spark.heat { stroke: #FFB35C; }
.m64-spark.rec { stroke: #7CC7FF; }
.m64-trail { fill: none; stroke: #FF7A9A; stroke-width: 2; stroke-dasharray: 4 3; opacity: 0.85; stroke-linejoin: round; }
.m64-trk { fill: none; stroke: var(--signal); stroke-width: 2; }
/* مخطط الحزم تحت البلورة */
.m64-ax { stroke: var(--ink-muted); stroke-width: 1.4; }
.m64-cb { fill: rgba(69, 196, 184, 0.24); stroke: #45C4B8; stroke-width: 1.2; }
.m64-vb { fill: rgba(232, 163, 61, 0.30); stroke: #E8A33D; stroke-width: 1.2; }
.m64-vbe { fill: #C9A06A; }
.m64-fermi { stroke: #9CC3FF; stroke-width: 1.6; stroke-dasharray: 1.5 3; stroke-linecap: round; }
.m64-lev { stroke-width: 2; stroke-dasharray: 7 4; }
.m64-dlev { stroke: #FFB35C; }
.m64-alev { stroke: #B48CFF; }
.m64-bst { fill: var(--screen); stroke-width: 1.6; }
.m64-bst.d { stroke: #FFB35C; }
.m64-bst.a { stroke: #B48CFF; }
.m64-bst.a.ion { fill: #B48CFF; }
.m64-bsg { fill: #FFD9A8; font-family: var(--font-mono); font-size: 9px; font-weight: 700; }
.m64-bst.a.ion + .m64-bsg { fill: #0B2747; }
/* أدوات المختبر */
.fc-controls .fc-buttons.m64-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m64-btns button { padding: 7px 4px; font-size: 0.82rem; min-width: 0; }
.m64-tot { grid-column: 1 / -1; }
.m64-bar { display: flex; height: 9px; margin-top: 6px; border-radius: 2px; background: var(--inset); border: 1px solid var(--line); overflow: hidden; direction: ltr; }
.m64-bar i { display: block; height: 100%; width: 0; transition: width 0.3s; }
.m64-bar .m64-be2 { background: #7CC7FF; }
.m64-bar .m64-bh2 { background: #FF7A9A; }

/* ---------- رسوم الدرس ---------- */
.m64-orb { fill: none; stroke: #E8C05A; stroke-width: 1.6; }
.m64-orb.soft { stroke-opacity: 0.5; }
.m64-at { fill: #4E5C6D; stroke: #93A5B9; stroke-width: 1.4; }
.m64-at4 { fill: #EAF1F8; font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.m64-ve { fill: #FF8FB0; }
.m64-ve.c { fill: #7CC7FF; }
.m64-bandC { fill: rgba(69, 196, 184, 0.24); stroke: #45C4B8; stroke-width: 1.2; }
.m64-bandV { fill: rgba(232, 163, 61, 0.30); stroke: #E8A33D; stroke-width: 1.2; }
.m64-bandI { fill: rgba(149, 173, 198, 0.16); stroke: var(--ink-muted); stroke-width: 1; }
.m64-nuc { fill: #6E8FB0; stroke: var(--ink-soft); stroke-width: 1; }
.m64-heat { fill: none; stroke: #FFB35C; stroke-width: 1.8; stroke-linecap: round; }
.m64-fhole { fill: var(--screen); stroke: #FF7A9A; stroke-width: 2; }
.m64-ftail { fill: none; stroke: #FF8FB0; stroke-width: 2.4; stroke-linecap: round; opacity: 0.7; }
.m64-pair { fill: none; stroke: var(--ink-soft); stroke-width: 1.2; stroke-dasharray: 4 3; }
.m64-ferm { stroke: #9CC3FF; stroke-width: 2; stroke-dasharray: 2 4; stroke-linecap: round; }
.m64-lvlE { stroke: #45C4B8; stroke-width: 1.6; }
.m64-lvlF { stroke: #E8A33D; stroke-width: 1.6; }
.m64-tag { fill: rgba(255, 197, 61, 0.10); stroke: rgba(255, 197, 61, 0.55); stroke-width: 1; }
.m64-field { stroke: #FF7A9A; stroke-width: 2.4; }
.m64-chair { fill: #3A4A5E; stroke: var(--ink-muted); stroke-width: 1.2; }
.m64-chair.empty { fill: none; stroke: #FF7A9A; stroke-width: 1.8; stroke-dasharray: 3 2; }
.m64-head { fill: #FFC9A6; }
.m64-body { fill: #6EA8FF; }
.m64-cmp td:first-child { font-weight: 700; color: var(--ink); }
.m64-cmp .data-table td, .m64-cmp .data-table th { text-align: center; }
.m64-cmp .data-table td:first-child { text-align: right; }
.m64-red { margin: 14px 0; padding: 12px 14px; border: 1.5px solid #FF7B7B; border-radius: var(--radius); background: rgba(255, 123, 123, 0.06); }
.m64-red p { margin: 0; color: #FFB3B3; font-weight: 600; line-height: 1.9; }
.m64-red ol { margin: 6px 0 0; padding-inline-start: 22px; color: #FFD0D0; }
/* ---------- درس 6-7: أشباه الموصلات المُطَعَّمة — «مختبر الرقاقة» (doping-lab، يستعمل محرك البلورة وأنماط .m64- من درس 5-7) ورسوم الدرس ---------- */
.m65-dops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin: 0 0 10px; }
.m65-dops button { padding: 6px 2px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-size: 0.78rem; line-height: 1.35; cursor: pointer; min-width: 0; }
.m65-dops button b { display: block; font-weight: 700; }
.m65-dops button b bdi { font-family: var(--font-mono); }
.m65-dops button small { display: block; color: var(--ink-muted); font-size: 0.68rem; }
.m65-dops button:hover { background: var(--hover); }
.m65-dops button.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.m65-dops button.on small { color: var(--signal-ink); }
.m65-dops button[data-d="Sb"] { border-color: rgba(255, 179, 92, 0.6); }
.m65-dops button[data-d="B"], .m65-dops button[data-d="Al"], .m65-dops button[data-d="In"] { border-color: rgba(180, 140, 255, 0.55); }
.m65-wide { grid-column: 1 / -1; }
.m65-lx input[type="range"]:disabled { opacity: 0.4; }
@media (max-width: 640px) {
    .m65-dops { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* رسوم الدرس */
.m65-at { fill: #4E5C6D; stroke: #93A5B9; stroke-width: 1.4; }
.m65-at.d { fill: #FFB35C; stroke: #FFD9A8; }
.m65-at.a { fill: #B48CFF; stroke: #DCCBFF; }
.m65-at4 { fill: #EAF1F8; font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.m65-at4.d, .m65-at4.a { fill: #0B2747; }
.m65-orb { fill: none; stroke: #E8C05A; stroke-width: 1.5; stroke-opacity: 0.6; }
.m65-orb.d { stroke: #FFB35C; stroke-opacity: 1; stroke-width: 1.8; }
.m65-orb.a { stroke: #B48CFF; stroke-opacity: 1; stroke-width: 1.8; }
.m65-ve { fill: #C3D2E2; }
.m65-fe { fill: #7CC7FF; stroke: rgba(124, 199, 255, 0.35); stroke-width: 3; }
.m65-ho { fill: var(--screen); stroke: #FF7A9A; stroke-width: 2; }
.m65-tail { fill: none; stroke: #7CC7FF; stroke-width: 2.4; stroke-linecap: round; opacity: 0.55; stroke-dasharray: 3 4; }
.m65-badge { stroke: var(--screen); stroke-width: 1.2; }
.m65-badge.d { fill: #FFB35C; }
.m65-badge.a { fill: #B48CFF; }
.m65-bt { fill: #0B2747; font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.m65-cb { fill: rgba(69, 196, 184, 0.22); stroke: #45C4B8; stroke-width: 1.2; }
.m65-vb { fill: rgba(232, 163, 61, 0.26); stroke: #E8A33D; stroke-width: 1.2; }
.m65-lev { stroke-width: 2.4; stroke-dasharray: 8 4; }
.m65-lev.d { stroke: #FFB35C; }
.m65-lev.a { stroke: #B48CFF; }
.m65-ferm { stroke: #9CC3FF; stroke-width: 2; stroke-dasharray: 2 4; stroke-linecap: round; }
.m65-lf { fill: #9CC3FF; }
.m65-ld { fill: #FFB35C; }
.m65-la { fill: #C9AEFF; }
.m65-banner.n { fill: rgba(69, 140, 200, 0.28); stroke: #6EA8FF; }
.m65-banner.p { fill: rgba(255, 140, 110, 0.22); stroke: #FF9A80; }
.m65-bn { fill: var(--signal); font-weight: 700; }
/* «تذكر» من الكتاب، وجدول المقارنة */
.m65-rem { margin: 14px 0; padding: 12px 14px; border: 1px solid rgba(180, 140, 255, 0.55); border-radius: var(--radius); background: rgba(180, 140, 255, 0.08); }
.m65-rem h5 { margin: 0 0 6px; color: #C9AEFF; font-size: 1rem; }
.m65-rem p { margin: 0 0 6px; }
.m65-rem ul { margin: 0; padding-inline-start: 20px; }
.m65-rem li { margin: 3px 0; }
.m65-cmp .data-table td, .m65-cmp .data-table th { text-align: center; }
.m65-cmp .data-table td:first-child { text-align: right; font-weight: 700; color: var(--ink); }
.m65-n { color: #8CC0FF; }
.m65-p { color: #FFB09A; }
/* 7-7 الثنائي pn: رسوم الدرس ومختبر الرقاقة (junction-lab) — إلكترون سماوي، فجوة وردية مفرغة، أيون موجب برتقالي، أيون سالب بنفسجي */
.m66-e { fill: #7CC7FF; }
.m66-h { fill: none; stroke: #FF7A9A; stroke-width: 1.8; }
.m66-ip circle { fill: rgba(255, 179, 92, 0.16); stroke: #FFB35C; stroke-width: 1.4; }
.m66-ip text { fill: #FFB35C; font-family: var(--font-mono); font-weight: 700; }
.m66-in circle { fill: rgba(180, 140, 255, 0.16); stroke: #B48CFF; stroke-width: 1.4; }
.m66-in text { fill: #B48CFF; font-family: var(--font-mono); font-weight: 700; }
.m66-p { fill: rgba(255, 150, 90, 0.11); }
.m66-n { fill: rgba(110, 170, 255, 0.11); }
.m66-xt { fill: none; stroke: var(--ink-muted); stroke-width: 1.3; }
.m66-cap { fill: #7D8A9B; stroke: var(--ink-muted); stroke-width: 1; }
.m66-lead { stroke: #B9C4D2; stroke-width: 2.4; }
.m66-leg { stroke: #B9C4D2; stroke-width: 1.6; stroke-linecap: round; }
.m66-jn { stroke: var(--ink-soft); stroke-width: 1.2; stroke-dasharray: 4 3; }
.m66-dep { fill: rgba(225, 235, 248, 0.1); stroke: rgba(225, 235, 248, 0.45); stroke-width: 1; stroke-dasharray: 3 3; }
.m66-fld { stroke: #FF6B6B; stroke-width: 1.8; }
.m66-fah { fill: #FF6B6B; }
.m66-ev { stroke: #7CC7FF; stroke-width: 2; fill: none; }
.m66-hv { stroke: #FF7A9A; stroke-width: 2; fill: none; }
.m66-burst { fill: none; stroke: #FFE6A0; stroke-width: 2; }
.m66-ground { fill: rgba(150, 190, 235, 0.12); stroke: var(--ink-soft); stroke-width: 2; stroke-linejoin: round; }
/* مفتاح الرموز (HTML) */
.m66-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 10px 0 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--inset); font-size: 0.9rem; color: var(--ink-soft); }
.m66-key span { display: inline-flex; align-items: center; gap: 6px; }
.m66-key svg { flex: none; }

/* المختبر */
.m66-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m66-lab .m66-ion { opacity: 0.3; transition: opacity 0.35s; }
.m66-lab .m66-ion.on { opacity: 1; }
.m66-lab .m66-ion.on circle { stroke-width: 2; }
.m66-lab.m66-noions .m66-ion:not(.on) { opacity: 0; }
.m66-edge { stroke: rgba(225, 235, 248, 0.32); stroke-width: 1; stroke-dasharray: 2 4; }
.m66-svg:not(.m66-has) .m66-edge { opacity: 0; }
.m66-dlab { transition: opacity 0.3s; }
.m66-base { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.m66-hill { fill: none; stroke: #7CC7FF; stroke-width: 2.2; stroke-linejoin: round; }
.m66-hdim { stroke: var(--signal); stroke-width: 1.4; }
.m66-vlab { fill: var(--signal); }
.m66-pdot { fill: #7CC7FF; stroke: var(--screen); stroke-width: 1.5; }
.fc-controls .fc-buttons.m66-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.fc-controls .fc-buttons.m66-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.fc-controls .fc-buttons.m66-btns button:disabled { opacity: 0.45; cursor: default; }
/* 8-7 فولطية الانحياز للثنائي pn: رسوم الدرس ومختبر الرقاقة (bias-lab) */
.m67-e { fill: #7CC7FF; }
.m67-h { fill: none; stroke: #FF7A9A; stroke-width: 1.8; }
.m67-ip circle { fill: rgba(255, 179, 92, 0.16); stroke: #FFB35C; stroke-width: 1.3; }
.m67-ip text { fill: #FFB35C; font-family: var(--font-mono); font-weight: 700; }
.m67-in circle { fill: rgba(180, 140, 255, 0.16); stroke: #B48CFF; stroke-width: 1.3; }
.m67-in text { fill: #B48CFF; font-family: var(--font-mono); font-weight: 700; }
.m67-p { fill: rgba(255, 150, 90, 0.11); }
.m67-n { fill: rgba(110, 170, 255, 0.11); }
.m67-xt { fill: none; stroke: var(--ink-muted); stroke-width: 1.3; }
.m67-cap { fill: #7D8A9B; stroke: var(--ink-muted); stroke-width: 1; }
.m67-jn { stroke: var(--ink-soft); stroke-width: 1.2; stroke-dasharray: 4 3; }
.m67-dep { fill: rgba(225, 235, 248, 0.1); stroke: rgba(225, 235, 248, 0.45); stroke-width: 1; stroke-dasharray: 3 3; }
.m67-res { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.m67-tp { fill: #FF8A80; }
.m67-tn { fill: #7CC7FF; }
.m67-bp { fill: rgba(255, 107, 107, 0.2); stroke: #FF8A80; stroke-width: 1.4; }
.m67-bn { fill: rgba(80, 140, 255, 0.2); stroke: #7CC7FF; stroke-width: 1.4; }
.m67-tri { fill: #FF8A80; stroke: #FF8A80; stroke-width: 1.2; stroke-linejoin: round; }
.m67-bar { stroke: #7CC7FF; stroke-width: 3.2; }
.m67-wp { stroke: #FF8A80; stroke-width: 2.4; }
.m67-wn { stroke: #7CC7FF; stroke-width: 2.4; }
.m67-cur { stroke: var(--signal); stroke-width: 2.6; fill: none; }
.m67-cur.thin { stroke-width: 1.8; }
.m67-ev { stroke: #7CC7FF; stroke-width: 2; fill: none; }
.m67-hv { stroke: #FF7A9A; stroke-width: 2; fill: none; }
.m67-ivf { fill: none; stroke: var(--signal); stroke-width: 2.4; stroke-linejoin: round; }
.m67-ivr { fill: none; stroke: var(--signal); stroke-width: 2.4; stroke-linejoin: round; }
.m67-grid { stroke: rgba(150, 190, 235, 0.09); stroke-width: 1; }
.m67-vm { fill: #12355E; stroke: var(--ink-muted); stroke-width: 1.4; }
.m67-symtab td, .m67-symtab th { text-align: center; vertical-align: middle; }

/* المختبر */
.m67-svg, .m67-csvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m67-lab .m67-ion { opacity: 0.28; transition: opacity 0.3s; }
.m67-lab .m67-ion.on { opacity: 1; }
.m67-lab .m67-ion.on circle { stroke-width: 1.9; }
.m67-we { fill: #7CC7FF; opacity: 0.85; }
.m67-amm { fill: var(--signal); stroke: var(--ink); stroke-width: 1.2; }
.m67-curm { fill: none; stroke: var(--signal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.m67-burst { fill: none; stroke: #FFE6A0; stroke-width: 2; }
.m67-fb { stroke: #FF6B6B; stroke-width: 2.4; }
.m67-fah { fill: #FF6B6B; }
.m67-fa { stroke: #5FD39A; stroke-width: 2.4; }
.m67-aah { fill: #5FD39A; }
.m67-fbl { fill: #FF8A80; }
.m67-fal { fill: #5FD39A; }
.m67-sub { margin: -4px 0 10px; font-size: 0.82rem; color: var(--ink-muted); }
.m67-cap-t { margin: 0 0 4px; font-size: 0.8rem; color: var(--ink-soft); text-align: center; }
.m67-gl { stroke: rgba(150, 190, 235, 0.1); stroke-width: 1; }
.m67-ax { stroke: var(--ink-muted); stroke-width: 1.4; }
.m67-v0 { stroke: var(--signal); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.7; }
.m67-simple { fill: none; stroke: var(--signal); stroke-width: 2.6; stroke-linejoin: round; }
.m67-real { fill: none; stroke: #7CC7FF; stroke-width: 2; stroke-dasharray: 5 4; }
.m67-dot { fill: #FFFFFF; stroke: var(--signal); stroke-width: 2.5; }
.m67-chart svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.fc-controls .fc-buttons.m67-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m67-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
/* الحاسوب: الدائرة فوق المنحني في عمود المشهد؛ نحدّ ارتفاع كل منهما ليبقى العمود كله مع القراءات وسطر الحالة ضمن الشاشة */
@media (min-width: 1000px) {
    .m67-lab .m67-main > svg { max-height: calc(var(--lx-h) * 0.62); }
    .m67-lab .m67-chart svg { max-height: calc(var(--lx-h) * 0.46); }
    .m67-lab .lx-stage > .m67-chart { margin-top: 4px; }
}
/* الهاتف: حين يختار الطالب «المنحني» يحلّ محل الدائرة في الجزء المثبّت (بارتفاعه الطبيعي)، وتبقى القراءات السريعة تحته ظاهرة */
@media (max-width: 999px) {
    .m67-lab .lx-stage[data-v="more"] > .m67-main { display: none; }
    .m67-lab .lx-stage[data-v="more"] > .m67-chart.lx-more { position: static; height: auto; margin: 0; }
}
/* 9-7 بعض أنواع الثنائيات: رسوم الدرس ومختبر الثنائيات الأربعة (diodes-lab) */
/* البلورة: المنطقة p دافئة، المنطقة n باردة، منطقة الاستنزاف فاتحة بحد منقّط */
.m68-p { fill: rgba(255, 150, 90, 0.17); }
.m68-n { fill: rgba(100, 165, 255, 0.17); }
.m68-dep { fill: rgba(234, 241, 248, 0.06); stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.m68-box { fill: none; stroke: var(--ink-soft); stroke-width: 1.4; }
.m68-metal { fill: #9AA7B6; stroke: var(--ink-soft); stroke-width: 1; }
.m68-el { fill: #7CC7FF; }
.m68-ho { fill: var(--screen); stroke: #FF7A9A; stroke-width: 1.8; }
.m68-ip { fill: #FFB35C; }
.m68-in { fill: #B48CFF; }
.m68-ion-t { fill: #0B2747; font-family: var(--font-mono); font-weight: 700; font-size: 12px; }
.m68-fld { stroke: #FF7A9A; stroke-width: 1.6; fill: none; }
.m68-atom { fill: #5B6B7D; stroke: var(--ink-muted); stroke-width: 1; }
.m68-atom-t { fill: var(--ink); font-family: var(--font-mono); font-weight: 700; font-size: 10px; }
.m68-bond { fill: var(--ink-soft); }
.m68-heat { fill: none; stroke: #FF8A50; stroke-width: 1.6; stroke-linecap: round; }
.m68-flash { fill: none; stroke: var(--signal); stroke-width: 2; }
/* عناصر الدوائر */
.m68-bp { stroke: #FF7A7A; stroke-width: 2.4; }            /* القطب الموجب: خط طويل رفيع أحمر */
.m68-bn { stroke: #7CC7FF; stroke-width: 5.5; }            /* القطب السالب: خط قصير سميك أزرق */
.m68-dsym { fill: var(--ink); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.m68-dbar { stroke: var(--ink); stroke-width: 2.6; }
.m68-res { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.m68-coil { fill: none; stroke: #FFB35C; stroke-width: 1.8; }
.m68-core { stroke: var(--ink-soft); stroke-width: 2; }
.m68-gnd { stroke: var(--ink-soft); stroke-width: 1.6; }
.m68-term { fill: var(--screen); stroke: var(--ink-soft); stroke-width: 1.4; }
.m68-meter { fill: var(--screen); stroke: var(--ink); stroke-width: 1.5; }
.m68-needle { stroke: var(--signal); stroke-width: 2.2; stroke-linecap: round; }
.m68-lamp { fill: #6E7C8C; stroke: var(--ink-soft); stroke-width: 1; }
.m68-beam { fill: rgba(255, 220, 110, 0.24); }
.m68-ph { fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linejoin: round; }
.m68-lt { stroke: #FF7A7A; stroke-width: 2; }
.m68-cur { stroke: var(--signal); stroke-width: 2.2; fill: none; }
.m68-inw { fill: none; stroke: #4FB8FF; stroke-width: 2; stroke-linejoin: round; }
.m68-outw { fill: none; stroke: #5FD39A; stroke-width: 2.2; stroke-linejoin: round; }
.m68-sun { fill: var(--signal); }
.m68-ray { stroke: var(--signal); stroke-width: 2; stroke-linecap: round; }
.m68-bulb { fill: rgba(255, 197, 61, 0.16); stroke: var(--ink-soft); stroke-width: 1.4; }
.m68-fil { fill: none; stroke: var(--signal); stroke-width: 1.4; }
.m68-glow { fill: rgba(255, 197, 61, 0.3); }
.m68-cell { fill: #1D3E73; stroke: var(--ink-soft); stroke-width: 1.2; }
.m68-cgrid { stroke: rgba(214, 228, 243, 0.4); stroke-width: 1; }
.m68-seg-off { fill: rgba(234, 241, 248, 0.06); stroke: var(--ink-muted); stroke-width: 1; }
.m68-seg-on { fill: #FF4FA0; stroke: #FF9CCB; stroke-width: 1; }
.m68-scope { fill: #04121F; stroke: var(--line-strong); stroke-width: 1; }
.m68-gridl { stroke: rgba(124, 199, 255, 0.14); stroke-width: 1; }
.m68-zero { stroke: rgba(234, 241, 248, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.m68-cond { fill: rgba(95, 211, 154, 0.16); }

/* جداول الدرس */
.m68-tab .data-table td, .m68-tab .data-table th { vertical-align: middle; }
.m68-tab .data-table td:first-child { font-weight: 700; color: var(--ink); }
.m68-tab .data-table td.m68-c { text-align: center; font-family: var(--font-mono); direction: ltr; }

/* المختبر */
.m68-lx [hidden] { display: none !important; }
.m68-lx .lx-2d > svg { direction: ltr; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.m68-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 4px; }
.m68-tabs button, .m68-digits button { padding: 7px 4px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink);
    font: inherit; font-size: 0.86rem; font-weight: 700; line-height: 1.35; cursor: pointer; min-width: 0; }
.m68-tabs button:hover, .m68-digits button:hover { background: var(--hover); }
.m68-tabs button.on, .m68-digits button.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.m68-tabs bdi { font-family: var(--font-mono); font-weight: 600; }
.m68-digits { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin: 0 0 6px; direction: ltr; }
.m68-digits button { font-family: var(--font-mono); font-size: 0.95rem; padding: 5px 0; }
.fc-controls .fc-buttons.m68-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m68-btns button { flex: 1 1 40%; padding: 7px 4px; font-size: 0.82rem; min-width: 0; }
.m68-sub { margin: 2px 0 6px; font-size: 0.8rem; color: var(--ink-muted); line-height: 1.6; }
.m68-lx input[type="range"]:disabled { opacity: 0.4; }
.m68-col { display: inline-block; width: 22px; height: 11px; margin-inline-start: 6px; vertical-align: middle; border: 1px solid var(--line-strong); border-radius: 2px; }
@media (max-width: 640px) {
    .m68-tabs button { font-size: 0.8rem; padding: 6px 2px; }
    .fc-controls .fc-buttons.m68-btns button { font-size: 0.78rem; }
}
/* ---------- 10-7 الترانزستور: رسوم الدرس ومختبر transistor-lab ---------- */
/* البلورات: p دافئ و n بارد؛ شدة اللون تدل على نسبة الشوائب (hi عالية، lo قليلة) */
.m69-p { fill: rgba(255, 138, 128, 0.17); stroke: var(--ink-soft); stroke-width: 1.4; }
.m69-p.hi { fill: rgba(255, 138, 128, 0.3); }
.m69-n { fill: rgba(124, 199, 255, 0.17); stroke: var(--ink-soft); stroke-width: 1.4; }
.m69-n.lo { fill: rgba(124, 199, 255, 0.1); }
.m69-p.lo { fill: rgba(255, 138, 128, 0.1); }
.m69-n.hi { fill: rgba(124, 199, 255, 0.3); }
.m69-dep { fill: rgba(4, 12, 24, 0.5); stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 2 2; }
.m69-hole { fill: var(--screen); stroke: #FF7A9A; stroke-width: 1.6; }
.m69-el { fill: #7CC7FF; }
.m69-flash { fill: none; stroke: var(--signal); stroke-width: 2; }
.m69-cur { stroke: var(--signal); stroke-width: 2.2; fill: none; }
.m69-term { fill: var(--screen); stroke: var(--ink); stroke-width: 1.4; }
.m69-tr { fill: rgba(255, 197, 61, 0.08); stroke: var(--ink); stroke-width: 1.5; }
.m69-bar { stroke: var(--ink); stroke-width: 3.6; stroke-linecap: round; fill: none; }
.m69-leg { stroke: var(--ink); stroke-width: 1.9; fill: none; }
.m69-ah { fill: var(--ink); }
.m69-res { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.m69-src { fill: var(--screen); stroke: var(--ink); stroke-width: 1.5; }
.t-label.m69-plus { fill: var(--pos); font-weight: 700; }
.t-label.m69-minus { fill: var(--neg); font-weight: 700; }
.m69-cap { fill: #8A97A8; stroke: var(--ink-muted); stroke-width: 1; }
.m69-band { fill: none; stroke: rgba(255, 197, 61, 0.22); stroke-width: 14; stroke-linecap: butt; }
.m69-band.thin { stroke-width: 2.4; stroke: rgba(255, 197, 61, 0.45); }
.m69-di { fill: var(--ink); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.m69-dibar { stroke: var(--ink); stroke-width: 2.6; }
.m69-scr { fill: #0B2A4A; stroke: var(--line-strong); stroke-width: 1.2; }
.m69-grid { stroke: rgba(214, 228, 243, 0.16); stroke-width: 1; }
.m69-trace { fill: none; stroke: #F4F7FB; stroke-width: 2.2; stroke-linejoin: round; }

/* جدول المقارنة بين المضخمين، وجدول الأرباح */
.m69-cmp th, .m69-cmp td { text-align: center; vertical-align: middle; }
.m69-cmp td:first-child { font-weight: 700; color: var(--ink); }

/* ---------- المختبر ---------- */
.m69-lx svg { direction: ltr; }
.m69-scene, .m69-scope { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.m69-scene .m69-wire { stroke: var(--ink-soft); stroke-width: 2; fill: none; }
.m69-scene .m69-curv { font-family: var(--font-mono); font-size: 12.5px; fill: var(--signal); }
.m69-scene .m69-region { transition: fill 0.3s; }
.m69-scene .m69-hlr, .m69-scene .m69-hlb { fill: none; stroke: var(--signal); stroke-width: 2; stroke-dasharray: 5 4; opacity: 0; transition: opacity 0.3s; }
.m69-scene[data-hl="regions"] .m69-hlr, .m69-scene[data-hl="bias"] .m69-hlb { opacity: 1; }
.m69-scope .m69-tin { fill: none; stroke: #F4F7FB; stroke-width: 2; stroke-linejoin: round; }
.m69-scope .m69-tout { fill: none; stroke: var(--signal); stroke-width: 2.2; stroke-linejoin: round; }
.m69-scope .m69-mk { stroke: var(--screen); stroke-width: 1.5; }
.m69-scope .m69-mk.in { fill: #F4F7FB; }
.m69-scope .m69-mk.out { fill: var(--signal); }
.m69-scope .m69-zero { stroke: rgba(214, 228, 243, 0.35); stroke-width: 1; }
.fc-controls .fc-buttons.m69-seg { gap: 6px; margin: 0 0 6px; }
.fc-controls .fc-buttons.m69-seg button { flex: 1 1 40%; padding: 7px 4px; font-size: 0.9rem; min-width: 0; }
.fc-controls .fc-buttons.m69-pre { flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.fc-controls .fc-buttons.m69-pre button { flex: 1 1 28%; padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.m69-seg button.on, .m69-pre button.on { background: var(--signal-soft); border-color: var(--signal); color: var(--signal); }
.m69-sub { margin: 2px 0 0; font-size: 0.78rem; color: var(--ink-muted); line-height: 1.6; }
.m69-tbl .m69-w { grid-column: 1 / -1; }
/* الرسمان في عمود المشهد على الحاسوب: البلورات والدائرة فوق شاشتي راسم الذبذبات، وكلاهما مع القراءات وسطر الحالة ضمن ارتفاع الشاشة */
@media (min-width: 1000px) {
    .m69-main, .m69-sc { container-type: inline-size; }
    .m69-lx .lx-2d > svg { max-height: min(calc(var(--lx-h) * 0.7), 57cqw); }
    .m69-lx .lx-stage > .lx-more svg { max-height: min(calc(var(--lx-h) * 0.4), 30cqw); width: 100%; }
}
/* الهاتف: الرسم المختار في المبدّل يظهر وحده في مكانه */
@media (max-width: 999px) {
    .m69-lx .lx-stage[data-v="more"] > .lx-2d { display: none; }
    .m69-lx .lx-stage[data-v="more"] > .lx-more.lx-alt { position: static; height: auto; padding: 0; border: 0; background: none; display: block; }
    .m69-lx .lx-stage > .lx-more svg { max-height: var(--lx-h); }
}
@media (min-width: 641px) { .lx-hud.m69-hud b { margin-left: 0; margin-right: 6px; } }

/* dive lesson css: chapter 8 */
/* ---------- درس 1-8: مقدمة — رسوم الدرس (صفحة الفصل، نماذج الذرة، البصمات، الأهداف، المصطلحات) ومختبر «الغاز المتوهج» (glow-lab) ---------- */
.m70-n { white-space: nowrap; }
.m70-e { fill: #7CC7FF; }
.m70-nuc { fill: #FF8A3D; stroke: #FFD2A8; stroke-width: 1.2; }
.t-label.m70-nt { fill: #3A1600; font-weight: 700; }
.m70-orb { fill: none; stroke: rgba(150, 175, 205, 0.5); stroke-width: 1.1; }
/* صفحة الفصل */
.m70-photo { fill: #050D18; stroke: var(--line); stroke-width: 1; }
.m70-white { fill: none; stroke: #FFFFFF; stroke-width: 3; stroke-linecap: round; }
.m70-prism { fill: rgba(200, 225, 255, 0.16); stroke: rgba(220, 235, 255, 0.85); stroke-width: 1.4; stroke-linejoin: round; }
.m70-inray { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 2.4; }
.m70-ray { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.m70-film { fill: #0B1118; stroke: #3B4A5C; stroke-width: 1; }
.m70-xr { fill: none; stroke: rgba(225, 235, 248, 0.22); stroke-width: 1.2; stroke-dasharray: 3 4; }
.m70-skin { fill: rgba(150, 165, 185, 0.32); }
.m70-bone { fill: rgba(236, 242, 250, 0.9); }
.m70-xtube { fill: rgba(200, 220, 240, 0.18); stroke: #C9D6E4; stroke-width: 1.4; }
.m70-xspot { fill: #E8EEF6; }
.m70-head { fill: #8E99A6; stroke: #D8DFE7; stroke-width: 1.2; }
.m70-head2 { fill: #5C6672; }
.m70-metal { fill: #6E7884; stroke: #B9C3CE; stroke-width: 1.2; }
.m70-seam { stroke: #1D232A; stroke-width: 2.4; }
.m70-beam { stroke: #FF4D4D; stroke-width: 2.4; }
.m70-beamg { stroke: rgba(255, 77, 77, 0.3); stroke-width: 8; stroke-linecap: round; }
.m70-hot { fill: #FFF6D8; stroke: #FFC53D; stroke-width: 2; }
.m70-spark { stroke: #FFD27A; stroke-width: 1.6; stroke-linecap: round; }
.m70-sparkd { fill: #FFE7A8; }
/* نماذج الذرة */
.m70-dalton { fill: #8A7A66; stroke: #C9B79C; stroke-width: 1.4; }
.m70-shine { fill: rgba(255, 255, 255, 0.18); }
.m70-thom { fill: rgba(255, 120, 120, 0.2); stroke: #FF8A80; stroke-width: 1.4; }
.t-label.m70-plus { fill: #FF8A80; font-weight: 700; }
.t-label.m70-minus { fill: #0B2747; font-weight: 700; }
.m70-row4 > .fig-panel { min-width: min(100%, 140px); flex: 1 1 140px; }
.m70-row3 > .fig-panel { min-width: min(100%, 160px); flex: 1 1 160px; }
.m70-row4 .fig-caption, .m70-row3 .fig-caption { font-size: 0.85rem; }
/* البصمات */
.m70-strip { fill: #03080F; stroke: var(--line-strong); stroke-width: 0.8; }
/* الأهداف السلوكية والمصطلحات والجداول */
.m70-goals { margin: 10px 0 14px; padding: 12px 14px 10px; border: 1px solid rgba(255, 197, 61, 0.35); border-radius: var(--radius); background: var(--signal-soft); }
.m70-goals-h { margin: 0 0 8px; font-weight: 700; color: var(--ink); }
.m70-goals ol { margin: 0; padding-inline-start: 24px; display: grid; gap: 3px; }
.m70-goals li { color: var(--ink-soft); line-height: 1.75; }
.m70-goals li > span { margin-inline-end: 8px; }
.m70-goals li > a { color: var(--signal); font-family: var(--font-mono); font-size: 0.88rem; white-space: nowrap; unicode-bidi: isolate; margin-inline-end: 4px; }
.m70-terms .data-table { font-size: 0.95rem; }
.m70-terms th:nth-child(3), .m70-terms td:nth-child(3) { text-align: center; white-space: nowrap; }
.m70-terms td:nth-child(2) { text-align: left; }
.m70-terms .en { white-space: normal; }
.m70-terms td a { color: var(--signal); font-family: var(--font-mono); font-size: 0.9rem; }
.m70-models .data-table { font-size: 0.93rem; }
.m70-models td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
@media (max-width: 640px) {
    .m70-terms .data-table, .m70-models .data-table { font-size: 0.85rem; }
    .m70-terms th, .m70-terms td, .m70-models th, .m70-models td { padding: 6px 5px; }
}

/* المختبر */
.m70-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m70-psu { fill: #12305A; stroke: var(--ink-muted); stroke-width: 1.2; }
.t-label.m70-vtxt { fill: var(--signal); font-weight: 600; }
.t-label.m70-tn { fill: #7CC7FF; font-weight: 700; }
.t-label.m70-tp { fill: #FF8A80; font-weight: 700; }
.m70-glass { fill: rgba(190, 215, 240, 0.07); stroke: rgba(220, 235, 250, 0.75); stroke-width: 1.6; }
.m70-tglow { opacity: 0; transition: fill 0.3s; }
.m70-elec { fill: #9AA6B4; stroke: #DCE3EA; stroke-width: 0.8; }
.m70-flash { fill: #FFFFFF; }
.m70-mag { fill: none; stroke: var(--signal); stroke-width: 1.4; stroke-dasharray: 3 2; }
.m70-magl { stroke: rgba(255, 197, 61, 0.45); stroke-width: 1; stroke-dasharray: 3 3; }
.m70-zbg { fill: #061325; }
.m70-zring { fill: none; stroke: var(--signal); stroke-width: 1.4; }
.m70-zorb { fill: none; stroke: rgba(150, 175, 205, 0.32); stroke-width: 1; }
.m70-zglow { opacity: 0; }
.m70-ze { fill: #7CC7FF; stroke: #DFF1FF; stroke-width: 1; }
.m70-zfree { fill: #7CC7FF; opacity: 0; }
.m70-zph { color: #FFFFFF; }
.m70-phw { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.m70-pha { fill: currentColor; }
.m70-lbeam { stroke-width: 5; stroke-linecap: round; opacity: 0; }
.m70-prismL { fill: rgba(200, 225, 255, 0.14); stroke: rgba(220, 235, 255, 0.8); stroke-width: 1.2; stroke-linejoin: round; }
.m70-svg .m70-ray { stroke-width: 1; }
.t-label.m70-nmt { fill: var(--ink-soft); }
.m70-mkp { stroke: #FFFFFF; stroke-width: 0.8; }
.fc-controls .fc-buttons.m70-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m70-btns button { flex: 1 1 30%; padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.m70-sel { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--ink-soft); font-size: 0.9rem; }
.m70-sel select { flex: 1; min-width: 0; padding: 5px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--inset); color: var(--ink); font: inherit; font-size: 0.88rem; }
/* ---------- درس 2-8: مستويات الطاقة وأنموذج بور — رسوم الدرس (الأشكال 1–6، المنحدر والدرج، سلّم الطاقة) ومختبر «من ذرة رذرفورد إلى ذرة بور» (bohr-lab) ---------- */
.m71-e { fill: #7CC7FF; stroke: #DFF1FF; stroke-width: 0.8; }
.m71-nuc { fill: #FF8A3D; stroke: #FFD2A8; stroke-width: 1.2; }
.t-label.m71-nt { fill: #3A1600; font-weight: 700; }
.m71-ph { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.m71-sph { fill: rgba(90, 150, 230, 0.13); stroke: rgba(150, 195, 255, 0.55); stroke-width: 1.2; }
.m71-orb { fill: none; stroke: rgba(150, 190, 240, 0.6); stroke-width: 1.2; }
.m71-orb3 { fill: none; stroke: rgba(200, 215, 235, 0.55); stroke-width: 1.3; }
.m71-spiral { fill: none; stroke: rgba(150, 190, 240, 0.55); stroke-width: 1.3; }
.m71-ghost { fill: rgba(124, 199, 255, 0.35); }
.m71-vg { stroke: var(--ink-muted); stroke-width: 1.3; stroke-dasharray: 3 2; }
.m71-v { stroke: var(--signal); stroke-width: 2.4; }
.m71-a { stroke: var(--pos); stroke-width: 2.4; }
.m71-v6 { stroke: var(--pos); stroke-width: 2.4; }
.m71-f { stroke: var(--neg); stroke-width: 2.4; }
.t-label.m71-tpk { fill: var(--pos); font-weight: 700; }
.mo-fig.is-playing .m71-hp { visibility: hidden; }   /* أسماء الأسهم التي تدور مع الإلكترون تُخفى أثناء الحركة */
.m71-strip { fill: #03080F; stroke: var(--line-strong); stroke-width: 0.8; }
.m71-ramp { fill: rgba(150, 175, 205, 0.18); stroke: var(--ink-muted); stroke-width: 1.4; stroke-linejoin: round; }
.m71-ball { fill: var(--signal); stroke: #FFF1C4; stroke-width: 1.2; }
.t-label.m71-tn { fill: #9CC8FF; font-style: italic; }
.m71-lvl { stroke: #D9B45C; stroke-width: 2; }
.m71-gnd { stroke: #D9B45C; stroke-width: 3; }
.m71-zero { stroke: var(--ink-muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
.m71-glowc { fill: rgba(255, 197, 61, 0.28); stroke: rgba(255, 197, 61, 0.7); stroke-width: 1.4; }
.m71-slot { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; }
.m71-big { stroke-width: 1.4; }
.m71-up, .m71-dn { stroke: var(--signal); stroke-width: 2; }
.m71-dash { fill: none; stroke: var(--ink-muted); stroke-width: 1.3; stroke-dasharray: 5 4; }
.m71-rad { stroke: rgba(149, 173, 198, 0.55); stroke-width: 1; stroke-dasharray: 3 3; }
.m71-sw { fill: none; stroke: #7CC7FF; stroke-width: 2.2; }
.m71-row3 > .fig-panel { min-width: min(100%, 110px); flex: 1 1 110px; }
.m71-cmp td:first-child, .m71-post td:first-child { font-weight: 700; color: var(--ink); }
.m71-post td:first-child { text-align: center; font-family: var(--font-mono); }
.m71-sym td:first-child, .m71-sym th:first-child, .m71-sym td:last-child, .m71-sym th:last-child { text-align: center; white-space: nowrap; }
@media (max-width: 640px) { .m71-cmp .data-table, .m71-post, .m71-sym { font-size: 0.86rem; } .m71-post th, .m71-post td, .m71-cmp th, .m71-cmp td { padding: 6px 5px; } }

/* المختبر */
.m71-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m71-aglow { fill: rgba(255, 197, 61, 0.22); stroke: rgba(255, 197, 61, 0.55); stroke-width: 1.2; }
.m71-lorb { fill: none; stroke: rgba(170, 195, 225, 0.38); stroke-width: 1; }
.m71-spg { fill: none; stroke: rgba(150, 190, 240, 0.22); stroke-width: 1; }
.m71-rph, .m71-pin, .m71-pout { color: #FFFFFF; }
.m71-lpw { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.m71-lpa { fill: currentColor; }
.m71-boom { fill: rgba(255, 220, 140, 0.35); stroke: #FFC53D; stroke-width: 2; }
.m71-le { fill: #7CC7FF; stroke: #E6F4FF; stroke-width: 1.2; }
.m71-zl { stroke: var(--ink-muted); stroke-width: 1.1; stroke-dasharray: 4 3; }
.m71-ll { stroke: #D9B45C; stroke-width: 1.8; }
.m71-ll.g { stroke-width: 3; }
.m71-lup, .m71-ldn { stroke: var(--signal); stroke-width: 2; }
.m71-mk { fill: var(--signal); }
.m71-ld { fill: #7CC7FF; stroke: #E6F4FF; stroke-width: 1; }
.m71-ax { stroke: var(--ink-muted); stroke-width: 1.3; }
.m71-ecurve { fill: none; stroke: #FF8A80; stroke-width: 2.6; stroke-linejoin: round; }
.m71-frm { fill: var(--signal); }
.m71-mid { stroke: var(--line-strong); stroke-width: 1; }
.m71-box { fill: rgba(255, 255, 255, 0.03); stroke: var(--line-strong); stroke-width: 1; transition: fill 0.4s; }
.m71-box.uv.on { fill: rgba(185, 160, 255, 0.28); stroke: #B9A0FF; }
.m71-box.ir.on { fill: rgba(168, 66, 63, 0.35); stroke: #D06A66; }
.m71-box.flash { animation: m71-flash 0.9s ease-out; }
@keyframes m71-flash { 0% { fill: rgba(255, 255, 255, 0.75); } 100% { } }
@media (prefers-reduced-motion: reduce) { .m71-box.flash { animation: none; } }
.fc-controls .fc-buttons.m71-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m71-btns button { flex: 1 1 30%; padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.fc-controls .fc-buttons.m71-btns button:disabled { opacity: 0.5; cursor: default; }
.m71-cr { margin: 4px 0 6px; }
.m71-rs { width: 100%; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.m71-rs:hover { background: var(--hover); }
.m71-sub { margin: -4px 0 8px; font-size: 0.82rem; color: var(--ink-muted); }
.lx-hud .hk1, .lx-hud .hk2, .lx-hud .hk3, .lx-hud .hk4, .lx-hud .hk5 { color: inherit; }
/* 3-8 طيف ذرة الهيدروجين: رسوم الدرس ومختبر hydrogen-lab */
.m72-lv { stroke: var(--ink-soft); stroke-width: 1.6; }
.m72-lv.g { stroke: var(--ink); stroke-width: 2.4; }
.m72-zero { stroke: var(--ink-muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
.m72-e { fill: #7CC7FF; }
.m72-ring { fill: none; stroke: #7CC7FF; stroke-width: 1.6; opacity: 0.75; }
.m72-nuc { fill: #FF7A45; stroke: #FFB35C; stroke-width: 1; }
.m72-orb { fill: none; stroke: var(--ink-muted); stroke-width: 1; opacity: 0.65; }
.m72-dash { stroke: var(--ink-muted); stroke-width: 1.4; stroke-dasharray: 4 3; fill: none; }
.m72-ph { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.m72-need { stroke: var(--signal); stroke-width: 1.4; fill: none; }
.m72-well { fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linejoin: round; }
.m72-rail { stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; }
.m72-rung { stroke: var(--ink-soft); stroke-width: 1.6; }
.m72-base { stroke: var(--ink-muted); stroke-width: 1; }
.m72-sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-left: 4px; }
.m72-tab td, .m72-tab th, .m72-etab td, .m72-etab th { text-align: center; vertical-align: middle; }


/* المختبر */
.m72-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m72-lab .m72-lv { stroke-width: 1.4; }
.m72-lab .m72-lv.g { stroke-width: 2.2; }
.m72-lab .m72-lv.on { stroke: var(--signal); }
.m72-strip { fill: #050B14; stroke: var(--line-strong); stroke-width: 1; }
.m72-tk { stroke: var(--ink-muted); stroke-width: 1; }
.m72-cur { fill: var(--signal); }
.fc-controls .fc-buttons.m72-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m72-btns button { padding: 6px 4px; font-size: 0.84rem; min-width: 0; flex: 1 1 auto; }
.fc-controls .fc-buttons.m72-btns button:disabled { opacity: 0.35; cursor: not-allowed; }
.m72-lab .lx-table b bdi { font-family: var(--font-mono); }
@media (max-width: 640px) {
    .m72-tab td, .m72-tab th, .m72-etab td, .m72-etab th { padding: 8px 6px; font-size: 0.92rem; }
}
.m72-nw { white-space: nowrap; }
/* 4-8 الأطياف: رسوم الدرس ومختبر spectroscope-lab */
.m73-dark { fill: #03070D; stroke: var(--line-strong); stroke-width: 0.8; }
.m73-sun { fill: #FFD66B; stroke: #FFB020; stroke-width: 1.2; }
.m73-sunr { stroke: #FFD66B; stroke-width: 2; stroke-linecap: round; }
.m73-white { stroke: #FFFFFF; stroke-width: 3; opacity: 0.9; }
.m73-glass { fill: rgba(150, 210, 255, 0.16); stroke: rgba(190, 225, 255, 0.85); stroke-width: 1.4; stroke-linejoin: round; }
.m73-screen { stroke: var(--ink-soft); stroke-width: 3; }
.m73-box { fill: #2A3A4E; stroke: var(--ink-muted); stroke-width: 1.2; }
.m73-disp { fill: #1A0A0A; stroke: var(--ink-muted); stroke-width: 0.8; }
.m73-sock { fill: #E04848; }
.m73-sock.b { fill: #222; stroke: var(--ink-muted); }
.m73-tube { fill: rgba(200, 225, 255, 0.08); stroke: rgba(200, 225, 255, 0.7); stroke-width: 1.3; }
.m73-el { stroke: var(--ink-soft); stroke-width: 2.4; }
.m73-bar { fill: var(--ink-soft); }
.m73-coll { fill: rgba(124, 199, 255, 0.12); stroke: var(--ink-soft); stroke-width: 1.2; }
.m73-table { fill: rgba(255, 197, 61, 0.05); stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.m73-tick { stroke: var(--ink-muted); stroke-width: 1; }
.m73-eye { fill: #F4F7FA; stroke: var(--ink-muted); }
.m73-bulb { fill: rgba(255, 226, 168, 0.18); stroke: #FFE2A8; stroke-width: 1.3; }
.m73-cap { fill: #7D8A9B; }
.m73-fil { fill: none; stroke: #FFC53D; stroke-width: 2; stroke-linejoin: round; }
.m73-atom { fill: #FF8AD8; }
.m73-tab td, .m73-tab th { vertical-align: middle; }
@media (max-width: 640px) {
    .m73-tab td, .m73-tab th { padding: 8px 6px; font-size: 0.92rem; }
}

/* المختبر */
.m73-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m73-lab .m73-beam { stroke-width: 6; opacity: 0.22; stroke-linecap: round; }
.m73-lab .m73-beamf { stroke-width: 2.4; opacity: 0.95; }
.m73-lab .m73-fl { stroke-dasharray: 4 6; stroke-linecap: round; animation: m73-flow 0.8s linear infinite; }
.m73-lab .m73-ef { stroke: #7CC7FF; stroke-width: 2.8; stroke-dasharray: 0.01 7; animation: m73-flow 0.9s linear infinite; }
@keyframes m73-flow { to { stroke-dashoffset: -10; } }
.m73-lab .m73-gas { animation: m73-glow 2.4s ease-in-out infinite; }
@keyframes m73-glow { 50% { opacity: 0.72; } }
.m73-lab.m73-pause .m73-fl, .m73-lab.m73-pause .m73-ef, .m73-lab.m73-pause .m73-gas { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .m73-lab .m73-fl, .m73-lab .m73-ef, .m73-lab .m73-gas { animation: none; } }
.m73-lab .m73-bulb { fill: rgba(255, 226, 168, 0.05); stroke: var(--ink-muted); stroke-width: 1.2; }
.m73-lab .m73-bulb.on { fill: rgba(255, 226, 168, 0.3); stroke: #FFE2A8; }
.m73-lab .m73-fil { stroke: var(--ink-muted); stroke-width: 1.6; }
.m73-lab .m73-fil.on { stroke: #FFD66B; stroke-width: 2.2; }
.m73-led { fill: #3A2222; stroke: var(--ink-muted); stroke-width: 0.8; }
.m73-led.on { fill: #5FD39A; }
.m73-dv { fill: #FF6B6B; }
.m73-eyebg { fill: #02050A; }
.m73-eyer { fill: none; stroke: var(--ink-soft); stroke-width: 2; }
.m73-cross { stroke: rgba(255, 255, 255, 0.55); stroke-width: 0.8; }

.m73-xm, .m73-xm2 { fill: var(--signal); }
.fc-controls .fc-buttons.m73-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m73-btns button { padding: 6px 4px; font-size: 0.84rem; min-width: 0; flex: 1 1 auto; }
.fc-controls .fc-buttons.m73-btns button:disabled { opacity: 0.4; cursor: not-allowed; }
.m73-nw { white-space: nowrap; }
/* ---------- 5-8 انواع الاطياف: رسوم الدرس (f74_) ومختبر الأطياف (spectra-lab) ---------- */
/* الشاشة والطيف: شاشة سوداء، وشريط الطيف بألوان أطواله الموجية */
.m74-scr { fill: #02060C; }
.m74-scrbox { fill: #02060C; stroke: var(--line-strong); stroke-width: 1; }
.m74-frame { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.m74-dark { fill: #02060C; opacity: 0.9; }
/* المقعد الضوئي: حاجز الشق، الموشور الزجاجي، الحزمة، المروحة الملونة */
.m74-plate { fill: #5E6E82; stroke: var(--ink-muted); stroke-width: 1; }
.m74-stand { stroke: var(--ink-muted); stroke-width: 2; }
.m74-beam { stroke: rgba(255, 244, 214, 0.5); stroke-width: 2; }
.m74-glass { fill: rgba(150, 205, 255, 0.18); stroke: rgba(190, 225, 255, 0.75); stroke-width: 1.4; stroke-linejoin: round; }
.m74-wedge, .m74-fan { fill: rgba(255, 255, 255, 0.07); stroke: rgba(255, 255, 255, 0.22); stroke-width: 0.8; }
/* المصادر: نجمة متوهجة، بخار متوهج (برتقالي)، بخار غير متوهج (أزرق باهت)، أنبوبة تفريغ */
.m74-star { fill: #FFD84D; stroke: #FFB020; stroke-width: 1; }
.m74-starc { fill: #FFF6C8; }
.m74-hot { fill: rgba(255, 120, 60, 0.5); stroke: #FF8A50; stroke-width: 1.2; }
.m74-cool, .m74-vap { fill: rgba(150, 200, 255, 0.14); stroke: rgba(170, 215, 255, 0.65); stroke-width: 1.2; }
.m74-atom { fill: #9FB4CC; }
.m74-atom.hot { fill: #FFE0B0; }
.m74-tube, .m74-tglass { fill: none; stroke: rgba(234, 241, 248, 0.6); stroke-width: 1.4; }
.m74-tubeg { fill: rgba(224, 123, 216, 0.75); }
.m74-elec, .m74-tel { fill: #8A97A8; }
.m74-src, .m74-ac { fill: var(--screen); stroke: var(--ink); stroke-width: 1.4; }
/* الذرة: النواة برتقالية، الإلكترون سماوي، المستويات خطوط أفقية */
.m74-ring { fill: none; stroke-width: 2.2; }
.m74-ring.g { stroke: var(--ink-muted); }
.m74-nuc { fill: #FF7043; stroke: #FFB199; stroke-width: 1; }
.m74-e { fill: #7CC7FF; }
.m74-kick { fill: none; stroke: var(--signal); stroke-width: 1.6; }
.m74-lvl { stroke: var(--ink-soft); stroke-width: 2; }
.m74-lvl.thin { stroke-width: 1; opacity: 0.7; }
.m74-jump { stroke-width: 2.2; }
.m74-bandf { fill: rgba(255, 197, 61, 0.1); }
.m74-same { stroke: var(--signal); stroke-width: 1.2; stroke-dasharray: 3 3; }
.m74-tab td, .m74-tab th { vertical-align: middle; }
.m74-ol { margin: 0 0 0.6rem; padding-inline-start: 1.4rem; }
.m74-ol li { margin-bottom: 4px; }

/* ---------- مختبر الأطياف ---------- */
.m74-svg, .m74-asvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m74-lab [hidden] { display: none !important; }
.m74-bulb { fill: rgba(255, 246, 214, 0.16); stroke: rgba(234, 241, 248, 0.6); stroke-width: 1.3; }
.m74-coil { fill: none; stroke: #FFF2C0; stroke-width: 2; stroke-linejoin: round; filter: drop-shadow(0 0 3px #FFD27A); }
.m74-base { fill: #8A97A8; }
.m74-tglow { opacity: 0.8; }
.m74-sun { fill: #FFD447; filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.6)); }
.m74-atm { fill: rgba(255, 180, 90, 0.14); stroke: rgba(255, 190, 110, 0.4); stroke-width: 1; }
.m74-scrbar { fill: #02060C; stroke: var(--line-strong); stroke-width: 1; }
.m74-sbox { fill: #02060C; stroke: var(--line-strong); stroke-width: 1; }
.m74-ph path { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m74-at { fill: #9FB4CC; }
.m74-ag { fill: #FFE6A0; }
.m74-fl { fill: #FFFFFF; }
.m74-sttl { fill: var(--ink-muted); }
.m74-cl1, .m74-cl2 { fill: #EAF1F8; paint-order: stroke; stroke: #02060C; stroke-width: 3px; }
.m74-fltxt { fill: #FFFFFF; font-family: var(--font-mono); font-size: 9px; font-weight: 700; paint-order: stroke; stroke: #02060C; stroke-width: 2.5px; }
.m74-lv { stroke: var(--ink-soft); stroke-width: 1.6; }
.m74-lv.thin { stroke-width: 0.8; opacity: 0.6; }
.m74-brk { fill: none; stroke: var(--ink-muted); stroke-width: 1.2; }
.m74-tr { stroke-width: 2.2; opacity: 0.45; transition: opacity 0.2s, stroke-width 0.2s; }
.m74-tr.on { opacity: 1; stroke-width: 3.4; }
.m74-tr.uv { stroke: #8E7CC3; stroke-dasharray: 4 3; opacity: 0.6; }
.m74-tr + .m74-trh { fill: none; stroke-width: 2; opacity: 0.6; }
.m74-tr.on + .m74-trh { opacity: 1; }
.m74-bandr { fill: rgba(255, 197, 61, 0.09); }
.m74-aph path { fill: none; stroke-width: 2; stroke-linecap: round; }
.m74-cap { margin: 0 0 4px; font-size: 0.76rem; color: var(--ink-soft); text-align: center; line-height: 1.6; }
.m74-atomv svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.m74-sub { margin: -2px 0 8px; font-size: 0.8rem; color: var(--ink-muted); }
.fc-controls .fc-buttons.m74-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m74-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.fc-controls .fc-buttons.m74-two button { flex: 1 1 45%; }
.fc-controls .fc-buttons.m74-gas button { flex: 1 1 14%; font-family: var(--font-mono); }
.m74-lab .lx-table .m74-w { grid-column: 1 / -1; }
/* الحاسوب: المقعد والطيف فوق «داخل الذرة» في عمود المشهد، وكلاهما مع القراءات وسطر الحالة ضمن الشاشة */
@media (min-width: 1000px) {
    .m74-lab .m74-main > svg { max-height: calc(var(--lx-h) * 0.64); }
    .m74-lab .m74-atomv svg { max-height: calc(var(--lx-h) * 0.42); }
    .m74-lab .lx-stage > .m74-atomv { margin-top: 4px; }
}
/* الهاتف: «داخل الذرة» يحل محل المقعد في الجزء المثبّت حين يختاره الطالب */
@media (max-width: 999px) {
    .m74-lab .lx-stage[data-v="more"] > .m74-main { display: none; }
    .m74-lab .lx-stage[data-v="more"] > .m74-atomv.lx-more { position: static; height: auto; margin: 0; padding: 0; border: 0; background: none; display: block; }
    .m74-lab .lx-stage > .m74-atomv svg { max-height: calc(var(--lx-h) - 40px); }
}
/* ---------- 6-8 الأشعة السينية: رسوم الدرس (f75_) ومختبر الأنبوبة (xray-lab) ---------- */
/* الإلكترونات سماوية، والأشعة السينية رمادية بيضاء، والنواة برتقالية، والهدف نحاسي اللون */
.m75-e { fill: #7CC7FF; }
.m75-ea { stroke: #7CC7FF; stroke-width: 1.6; }
.m75-glass { fill: rgba(150, 205, 255, 0.07); stroke: rgba(190, 225, 255, 0.6); stroke-width: 1.5; }
.m75-anode { fill: #8C6A4A; stroke: #C9A27A; stroke-width: 1.2; stroke-linejoin: round; }
.m75-face { fill: #C9A27A; }
.m75-tface { stroke: #FFD27A; stroke-width: 2.4; }
.m75-lead { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; }
.m75-fil { fill: none; stroke: #FF9F43; stroke-width: 3; filter: drop-shadow(0 0 3px #FF9F43); }
.m75-xray { fill: none; stroke: #E6ECF4; stroke-width: 1.6; opacity: 0.85; }
.m75-ruler { fill: rgba(255, 255, 255, 0.04); stroke: var(--line-strong); stroke-width: 1; }
.m75-xb { fill: rgba(230, 236, 244, 0.28); }
.m75-uvb { fill: rgba(142, 124, 195, 0.35); }
.m75-area { fill: rgba(255, 107, 90, 0.32); }
.m75-curve { fill: none; stroke: #FF7B6B; stroke-width: 2.2; stroke-linejoin: round; }
.m75-cv { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.m75-c1 { stroke: #7CC7FF; fill: #7CC7FF; }
.m75-c2 { stroke: #5FD39A; fill: #5FD39A; }
.m75-c3 { stroke: #FFC53D; fill: #FFC53D; }
polyline.m75-c1, polyline.m75-c2, polyline.m75-c3, line.m75-c1, line.m75-c2, line.m75-c3 { fill: none; }
.m75-ax { stroke: var(--ink-muted); stroke-width: 1.4; }
.m75-gl { stroke: rgba(150, 190, 235, 0.1); stroke-width: 1; }
.m75-lmin { stroke: var(--signal); stroke-width: 1.4; stroke-dasharray: 4 3; }
.m75-path { fill: none; stroke: rgba(124, 199, 255, 0.45); stroke-width: 1.4; stroke-dasharray: 4 4; }
.m75-nuc { fill: #FF7043; stroke: #FFB199; stroke-width: 1; }
.m75-nucg { fill: rgba(255, 112, 67, 0.12); stroke: rgba(255, 112, 67, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.m75-shell { fill: none; stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.8; }
.m75-hole { fill: none; stroke: var(--signal); stroke-width: 1.4; stroke-dasharray: 2 2; }
.m75-metal { fill: #6E7C8E; stroke: var(--ink-muted); stroke-width: 1; }
.m75-src { fill: #3A4A5E; stroke: var(--ink-muted); stroke-width: 1.2; }
.m75-tissue { fill: rgba(255, 170, 150, 0.16); stroke: rgba(255, 170, 150, 0.5); stroke-width: 1.2; }
.m75-bone { fill: #E8E2D0; stroke: #FFFFFF; stroke-width: 1; }
.m75-ray { stroke: rgba(230, 236, 244, 0.3); stroke-width: 1.2; stroke-dasharray: 3 4; }
.m75-film { fill: #1B2430; stroke: var(--line-strong); stroke-width: 1; }
.m75-filmb { fill: #E8EEF6; }
.m75-bagb { fill: rgba(255, 120, 60, 0.22); stroke: #FF9A5C; stroke-width: 1.6; }
.m75-bagh { fill: none; stroke: #FF9A5C; stroke-width: 4; stroke-linejoin: round; }
.m75-obj { fill: rgba(255, 190, 120, 0.3); stroke: #FFC08A; stroke-width: 1.2; }
.m75-obj.hi { fill: rgba(255, 235, 200, 0.7); }
.m75-objl { stroke: #FFE6C8; stroke-width: 1.6; }
.m75-tube { fill: rgba(150, 205, 255, 0.08); stroke: rgba(190, 225, 255, 0.6); stroke-width: 1.4; }
.m75-graph { fill: #3A3F47; stroke: var(--ink-muted); stroke-width: 1.2; }
.m75-tab td, .m75-tab th { vertical-align: middle; }

/* ---------- مختبر الأنبوبة ---------- */
.m75-svg, .m75-csvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m75-window { stroke: #BFE3FF; stroke-width: 4; opacity: 0.7; }
.m75-cup { fill: none; stroke: #8A97A8; stroke-width: 3; }
.m75-coil { fill: none; stroke: #FF9F43; stroke-width: 2.4; stroke-linejoin: round; filter: drop-shadow(0 0 3px #FF9F43); }
.m75-hot { fill: #FF6A2A; filter: drop-shadow(0 0 4px #FF6A2A); }
.m75-fin { stroke: #8C6A4A; stroke-width: 3; }
.m75-le { fill: #7CC7FF; }
.m75-lph path, .m75-lsph path { fill: none; stroke: #E6ECF4; stroke-width: 1.8; stroke-linecap: round; }
.m75-lph.ch path, .m75-lsph.ch path { stroke: #FFF0B8; }
.m75-lheat { fill: #FF9F43; }
.m75-lensc { fill: rgba(7, 26, 48, 0.88); stroke: var(--signal); stroke-width: 1.4; }
.m75-lensl { fill: none; stroke: rgba(255, 197, 61, 0.45); stroke-width: 1; stroke-dasharray: 3 3; }
.m75-lt2 { fill: var(--signal); }
.m75-saved { fill: none; stroke: #7CC7FF; stroke-width: 1.8; stroke-dasharray: 5 4; }
.m75-lminS { stroke: #7CC7FF; stroke-width: 1.2; stroke-dasharray: 3 3; }
.m75-svl { fill: #7CC7FF; }
.m75-chart svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.fc-controls .fc-buttons.m75-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m75-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.fc-controls .fc-buttons.m75-two button { flex: 1 1 45%; }
.fc-controls .fc-buttons.m75-pre button { flex: 1 1 30%; }
.m75-pre button.on { background: var(--signal-soft); border-color: var(--signal); color: var(--signal); }
.m75-lab .lx-table .m75-w { grid-column: 1 / -1; }
/* الحاسوب: الأنبوبة فوق منحني الطيف في عمود المشهد، وكلاهما مع القراءات وسطر الحالة ضمن الشاشة */
@media (min-width: 1000px) {
    .m75-lab .m75-main > svg { max-height: calc(var(--lx-h) * 0.6); }
    .m75-lab .m75-chart svg { max-height: calc(var(--lx-h) * 0.48); }
    .m75-lab .lx-stage > .m75-chart { margin-top: 4px; }
}
/* الهاتف: حين يختار الطالب «الطيف» يحل المنحني محل الأنبوبة في الجزء المثبّت */
@media (max-width: 999px) {
    .m75-lab .lx-stage[data-v="more"] > .m75-main { display: none; }
    .m75-lab .lx-stage[data-v="more"] > .m75-chart.lx-more { position: static; height: auto; margin: 0; padding: 0; border: 0; background: none; display: block; }
    .m75-lab .lx-stage > .m75-chart svg { max-height: var(--lx-h); }
}
/* 7-8 تأثير كومبتن: رسوم الدرس ومختبر الاستطارة (compton-lab) — فوتون الأشعة السينية أبيض رمادي، والإلكترون سماوي، والهدف كرافيت رمادي */
.m76-xr { fill: none; stroke: #E6EDF5; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m76-xr.mv { stroke-width: 2.6; }
.m76-xrh { fill: #E6EDF5; }
.m76-e { fill: #7CC7FF; }
.m76-tg { fill: var(--screen); stroke: var(--ink); stroke-width: 1.6; }
.m76-dash { fill: none; stroke: var(--ink-muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
.m76-arc { fill: none; stroke: var(--signal); stroke-width: 1.5; }
.m76-flash { fill: none; stroke: #FFE6A0; stroke-width: 2; }
.m76-bw { fill: #F4F7FB; stroke: #9AA7B8; stroke-width: 1.2; }
.m76-bw.ghost { fill: none; stroke: #C3D2E2; stroke-dasharray: 3 3; }
.m76-br { fill: #FF8A80; stroke: #FFB3AC; stroke-width: 1.2; }
.m76-cell { fill: rgba(255, 255, 255, 0.02); stroke: var(--line); stroke-width: 1; }
.m76-grid { stroke: rgba(150, 190, 235, 0.1); stroke-width: 1; }
.m76-curve { fill: none; stroke: var(--signal); stroke-width: 2.6; stroke-linejoin: round; }
.m76-dot { fill: #FFFFFF; stroke: var(--signal); stroke-width: 2.2; }
.m76-barx { fill: rgba(230, 237, 245, 0.85); }
.m76-barv { fill: #5FD39A; }
.m76-plus { fill: var(--signal); }
.m76-ebar { fill: rgba(230, 237, 245, 0.85); }
.m76-kbar { fill: #7CC7FF; }

/* المختبر */
.m76-svg, .m76-gsvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m76-gr { fill: #39414D; stroke: #6B7686; stroke-width: 1.2; }
.m76-c { fill: #59636F; }
.m76-prot { fill: none; stroke: rgba(150, 190, 235, 0.28); stroke-width: 1.2; stroke-dasharray: 2 4; }
.m76-tick { stroke: rgba(150, 190, 235, 0.45); stroke-width: 1.2; }
.m76-det { fill: #4C5A6B; stroke: var(--ink-soft); stroke-width: 1.2; }
.m76-path { fill: none; stroke: rgba(230, 237, 245, 0.3); stroke-width: 1.2; stroke-dasharray: 4 4; }
.m76-epath { fill: none; stroke: rgba(124, 199, 255, 0.45); stroke-width: 1.2; stroke-dasharray: 4 4; }
.m76-pv { stroke-width: 3; stroke-linecap: round; fill: none; }
.m76-pv.pin, .m76-pv.pout { stroke: var(--signal); }
.m76-pv.pe { stroke: #7CC7FF; }
.m76-pah { fill: var(--signal); }
.m76-pah.e { fill: #7CC7FF; }
.m76-cap-t { margin: 0 0 4px; font-size: 0.8rem; color: var(--ink-soft); text-align: center; }
.m76-chart svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.fc-controls .fc-buttons.m76-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m76-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
@media (min-width: 1000px) {
    .m76-lab .m76-main > svg { max-height: calc(var(--lx-h) * 0.76); }
    .m76-lab .m76-chart svg { max-height: calc(var(--lx-h) * 0.32); }
    .m76-lab .lx-stage > .m76-chart { margin-top: 4px; }
}
@media (max-width: 999px) {
    .m76-lab .lx-stage[data-v="more"] > .m76-main { display: none; }
    .m76-lab .lx-stage[data-v="more"] > .m76-chart.lx-more { position: static; height: auto; margin: 0; }
}
/* 8-8 الليزر والميزر: رسوم الدرس ومختبر الحروف (maser-laser-lab) — الذرة المتهيجة تتوهج، وضوء ليزر الياقوت أحمر، والموجات الدقيقة رمادية زرقاء (غير مرئية) */
.m77-tile { fill: rgba(255, 255, 255, 0.04); stroke: var(--line-strong); stroke-width: 1.2; }
.m77-tile.diff { fill: rgba(255, 197, 61, 0.1); stroke: var(--signal); }
.m77-L { fill: #FF6B6B; font-weight: 700; }
.m77-atombox { fill: rgba(255, 255, 255, 0.03); stroke: var(--line); stroke-width: 1; }
.m77-lv { stroke: var(--ink-soft); stroke-width: 2; }
.m77-el { fill: #7CC7FF; }
.m77-glow { fill: rgba(255, 170, 80, 0.16); stroke: rgba(255, 190, 110, 0.45); stroke-width: 1; }
.m77-tube { fill: rgba(255, 120, 120, 0.05); stroke: var(--line-strong); stroke-width: 1.2; }
.m77-atom { fill: #6B7686; stroke: #95A3B5; stroke-width: 1.2; }
.m77-atom.on { fill: #FFB35C; stroke: #FFE0A8; }
.m77-r0 { fill: #4A5D7A; } .m77-r1 { fill: #6E86A8; } .m77-r2 { fill: #8E5A5A; } .m77-r4 { fill: #7A5AA8; } .m77-r5 { fill: #9AA7B8; }
.m77-mk { stroke-width: 1.4; } .m77-mk.m77-tmaser, .m77-mkd.m77-tmaser { stroke: #9FB4CC; fill: #9FB4CC; } .m77-mk.m77-tlaser, .m77-mkd.m77-tlaser { stroke: #FF6B6B; fill: #FF6B6B; }
.t-ar.m77-tmaser { fill: #BFD0E4; } .t-ar.m77-tlaser { fill: #FF8A80; }
.m77-brace { fill: none; stroke: var(--signal); stroke-width: 1.4; }
.m77-node { fill: var(--screen); stroke: var(--signal); stroke-width: 2; }

/* المختبر */
.m77-svg, .m77-ssvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m77-ltile { fill: rgba(255, 255, 255, 0.04); stroke: var(--line-strong); stroke-width: 1.2; transition: fill 0.2s, stroke 0.2s; }
.m77-ltile.on { fill: rgba(255, 197, 61, 0.18); stroke: var(--signal); stroke-width: 2; }
.m77-lt { fill: var(--ink); font-family: var(--font-mono); font-weight: 700; }
.m77-lt.first { fill: #FF6B6B; }
.m77-mir { fill: #C9D3DE; stroke: #EEF3F8; stroke-width: 1; }
.m77-mir.part { fill: rgba(201, 211, 222, 0.45); stroke-dasharray: 3 2; }
.m77-ph { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.m77-ring { fill: none; stroke: #FFE6A0; stroke-width: 1.8; }
.m77-beam { stroke-width: 6; stroke-linecap: round; opacity: 0.35; }
.m77-wtxt tspan.on { fill: var(--signal); font-weight: 700; }
.m77-cap-t { margin: 0 0 4px; font-size: 0.8rem; color: var(--ink-soft); text-align: center; }
.m77-chart svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.fc-controls .fc-buttons.m77-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m77-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.fc-controls .fc-buttons.m77-let { direction: ltr; }
.fc-controls .fc-buttons.m77-let button { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; min-width: 0; padding: 6px 2px; }
@media (min-width: 1000px) {
    .m77-lab .m77-main > svg { max-height: calc(var(--lx-h) * 0.7); }
    .m77-lab .m77-chart svg { max-height: calc(var(--lx-h) * 0.3); }
    .m77-lab .lx-stage > .m77-chart { margin-top: 4px; }
}
@media (max-width: 999px) {
    .m77-lab .lx-stage[data-v="more"] > .m77-main { display: none; }
    .m77-lab .lx-stage[data-v="more"] > .m77-chart.lx-more { position: static; height: auto; margin: 0; }
}
.m77-phrase { margin: 4px 0 12px; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; direction: ltr; font-family: var(--font-mono); font-size: 0.92rem; color: var(--signal); overflow-wrap: anywhere; }
.m77-tab td, .m77-tab th { text-align: center; vertical-align: middle; }
.m77-en { unicode-bidi: isolate; direction: ltr; }   /* عبارة إنجليزية طويلة داخل نص عربي: تنقسم بين سطرين عند الحاجة */
.lx-table.sim-table b.r-full { overflow-wrap: normal; word-break: normal; font-size: 0.8rem; direction: ltr; text-align: left; }
/* 9-8 خصائص أشعة الليزر: رسوم الدرس ومختبر الخصائص (props-lab) — المصباح الاعتيادي أصفر دافئ، والليزر بلون طوله الموجي */
.m78-pane { fill: #0F3A2C; stroke: var(--line); stroke-width: 1; }
.m78-pane.wine { fill: #3A1630; }
.m78-wv { fill: none; stroke: #FFD34D; stroke-width: 2; stroke-linecap: round; }
.m78-bulbf { fill: rgba(255, 211, 77, 0.22); stroke: #FFD34D; stroke-width: 1.6; }
.m78-arr { stroke: #E9EEF4; stroke-width: 1.6; fill: none; }
.m78-lboxf { fill: #F2D9B8; stroke: #C9A97E; stroke-width: 1; }
.m78-earth { fill: #2E6FB5; stroke: #8EC0F0; stroke-width: 1.2; }
.m78-moonf { fill: #B9BFC8; stroke: #E4E8EE; stroke-width: 1; }
.m78-ospot { fill: rgba(255, 211, 77, 0.18); stroke: #FFD34D; stroke-width: 1.4; stroke-dasharray: 4 3; }
.m78-cone2 { fill: rgba(255, 211, 77, 0.08); stroke: rgba(255, 211, 77, 0.45); stroke-width: 1; }
.m78-hand { fill: #2B2F36; stroke: #59606B; stroke-width: 1.2; }
.m78-grid { stroke: rgba(150, 190, 235, 0.1); stroke-width: 1; }

/* المختبر */
.m78-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m78-lane { fill: rgba(255, 255, 255, 0.025); stroke: var(--line); stroke-width: 1; }
.m78-bulb { fill: rgba(255, 211, 77, 0.25); stroke: #FFD34D; stroke-width: 1.6; }
.m78-fil { fill: none; stroke: #FFE9A0; stroke-width: 1.4; }
.m78-cap { fill: #7D8A9B; }
.m78-lbox { fill: #F2D9B8; stroke: #C9A97E; stroke-width: 1; }
.m78-prism { fill: rgba(190, 220, 255, 0.14); stroke: #BFD6EE; stroke-width: 1.4; stroke-linejoin: round; }
.m78-beam { stroke: #FFF6D8; stroke-width: 3; opacity: 0.8; }
.m78-lbeam { stroke-width: 2.4; opacity: 0.9; }
.m78-lray { stroke-width: 2; opacity: 0.9; }
.m78-scr { fill: #05101E; stroke: var(--line-strong); stroke-width: 1; }
.m78-w { fill: none; stroke-width: 1.6; opacity: 0.85; }
.m78-res { fill: none; stroke: #FFE9A0; stroke-width: 2.4; stroke-linejoin: round; }
.m78-axis { stroke: var(--ink-muted); stroke-width: 1; opacity: 0.6; }
.m78-ray { stroke: #FFE9A0; stroke-width: 1.5; }
.m78-cone { fill: rgba(255, 211, 77, 0.07); stroke: rgba(255, 211, 77, 0.35); stroke-width: 1; }
.m78-moon { fill: rgba(185, 191, 200, 0.18); stroke: #C9D0DA; stroke-width: 1.2; stroke-dasharray: 4 3; }
.m78-spot.o { fill: rgba(255, 211, 77, 0.22); stroke: #FFD34D; stroke-width: 1.2; }
.m78-spot.o.dim { fill: rgba(255, 211, 77, 0.12); }
.m78-mark { fill: none; stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 2 2; }
.m78-star { stroke: #FFFFFF; stroke-width: 1.5; }
.m78-glare { stroke-width: 1.4; opacity: 0.8; }
.m78-ibar.o { fill: #FFD34D; }
.m78-ibar.l { fill: #FF8A80; }
.m78-dot { visibility: hidden; }
.lx-hud .m78-hl { font-style: normal; }
.m78-tl { display: inline; }
.fc-controls .fc-buttons.m78-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m78-btns button { padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
@media (min-width: 1000px) {
    .m78-lab .m78-main > svg { max-height: calc(var(--lx-h) * 0.98); }
}
/* 10-8 الية عمل الليزر: رسوم الدرس (f79_…) ومختبر الفوتون (emission-lab) */
/* المستويات خطوط أفقية، والإلكترون نقطة سماوية، والذرة المتهيجة تتوهج، والفوتون موجة ملونة بلون طوله الموجي */
.m79-lv { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.m79-lv.thin { stroke-width: 1.8; }
.m79-e { fill: #7CC7FF; }
.m79-e.ghost { fill: none; stroke: #7CC7FF; stroke-width: 1.4; stroke-dasharray: 2 2; opacity: 0.7; }
.m79-wv { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.m79-wv.thick { stroke-width: 2.6; }
.m79-box { fill: none; stroke: var(--ink-muted); stroke-width: 1.2; }
.m79-cell { fill: rgba(120, 160, 220, 0.06); stroke: var(--ink-muted); stroke-width: 1.2; }
.m79-big { fill: rgba(255, 179, 92, 0.85); stroke: var(--ink-soft); stroke-width: 1.2; }
.m79-step { fill: #F2994A; }
.m79-step-t { fill: var(--signal-ink); font-family: var(--font-body); font-weight: 700; }
.m79-ax { fill: rgba(255, 140, 90, 0.2); stroke: #FF8A5C; stroke-width: 1.6; }
.m79-ax.cold { fill: rgba(255, 255, 255, 0.03); stroke: var(--ink-muted); stroke-width: 1.2; }
.m79-axt { fill: var(--ink); font-family: 'Times New Roman', serif; font-style: italic; font-weight: 700; }
.m79-halo { opacity: 0.55; }
.m79-up-f { stroke: var(--signal); stroke-width: 2.2; fill: none; }
.m79-brace { fill: none; stroke: var(--ink-muted); stroke-width: 1.2; }
.m79-ok { fill: var(--ok); }
.m79-bad { fill: var(--bad); }
.m79-tab td, .m79-tab th { vertical-align: middle; }
.m79-en { margin: 0 0 10px; text-align: center; font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink); }
.m79-lab bdi { white-space: nowrap; }
@media (max-width: 480px) { .m79-tab th, .m79-tab td { padding-inline: 5px; font-size: 0.86rem; } }

/* المختبر */
.m79-svg { direction: ltr; user-select: none; -webkit-user-select: none; --m79-ph: rgb(255, 60, 0); }
.m79-atom { fill: rgba(255, 255, 255, 0.025); stroke: var(--ink-muted); stroke-width: 1.2; }
.m79-glow { opacity: 0; transition: opacity 0.35s; }
.m79-one.is-ex .m79-glow { opacity: 1; }
.m79-dim { stroke: var(--ink-muted); stroke-width: 1; }
.m79-dh { fill: var(--ink-muted); }
.m79-up, .m79-dn { stroke: var(--signal); stroke-width: 2.4; transition: opacity 0.3s; }
.m79-ah { fill: var(--signal); }
.m79-ev { fill: var(--signal); font-weight: 700; transition: opacity 0.4s; }
.m79-hd { stroke: none; }
.m79-ray { stroke-width: 1.2; stroke-dasharray: 3 5; opacity: 0.4; }
.m79-med { fill: rgba(120, 160, 220, 0.05); stroke: var(--ink-muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
.m79-axis { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 7 5; opacity: 0.55; }
.m79-a .c { fill: rgba(255, 255, 255, 0.03); stroke: var(--ink-muted); stroke-width: 1; }
.m79-a .gl { fill: var(--m79-ph); opacity: 0; transition: opacity 0.3s; }
.m79-a.on .gl { opacity: 0.5; }
.m79-a.on .c { stroke: var(--ink-soft); }
.m79-a line { stroke: var(--ink-soft); stroke-width: 1.2; }
.m79-a .du, .m79-a .dd { fill: #7CC7FF; }
.m79-a .du { opacity: 0; }
.m79-a.on .du { opacity: 1; }
.m79-a.on .dd { opacity: 0; }
.m79-burst { fill: none; stroke: #FFE6A0; stroke-width: 2; }
.m79-burst.dim { stroke: var(--ink-muted); }
.m79-hl { font-style: normal; }
.m79-lab .fc-buttons.m79-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.m79-lab .fc-buttons.m79-btns button { padding: 7px 6px; font-size: 0.84rem; min-width: 0; }
.m79-lab .fc-buttons.m79-btns button[hidden], .m79-lab .lx-sl[hidden], .m79-lab .fc-check[hidden], .m79-lab .fc-buttons[hidden] { display: none; }
/* 11-8 توزيع بولتزمان والتوزيع المعكوس: رسوم الدرس (f710_…) ومختبر بولتزمان (boltzmann-lab) */
.m710-lv { stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.m710-lv.green { stroke: #5FD39A; }
.m710-lv3 { stroke: var(--ink-muted); stroke-width: 1.6; stroke-dasharray: 6 4; }
.m710-at { fill: #FF8A5C; }
.m710-at.cold { fill: #FF8A5C; opacity: 0.9; }
.m710-ax { stroke: var(--ink-muted); stroke-width: 1.4; fill: none; }
.m710-ah { fill: var(--ink-muted); }
.m710-bar { fill: var(--ink); opacity: 0.85; }
.m710-bar.inv { fill: var(--signal); opacity: 1; }
.m710-curve, .m710-curve8 { fill: none; stroke: #7CC7FF; stroke-width: 1.8; stroke-dasharray: 5 4; }
.m710-sep { stroke: var(--line); stroke-width: 1; }
.m710-pump { stroke: #B48CFF; stroke-width: 3; }
.m710-pah { fill: #B48CFF; }
.m710-pt { fill: #B48CFF; font-weight: 700; }
.m710-fast { stroke: var(--ink-muted); stroke-width: 1.4; stroke-dasharray: 3 3; }
.m710-ph { fill: none; stroke: rgb(255, 60, 0); stroke-width: 1.8; stroke-linecap: round; }
.m710-l8 { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.m710-en { fill: #FF8A80; }
.m710-c8 { fill: var(--ink-soft); }
.m710-cell { fill: rgba(255, 255, 255, 0.03); stroke: var(--ink-muted); stroke-width: 1.2; }
.m710-svg, .m710-csvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m710-cap { margin: 0 0 4px; font-size: 0.8rem; color: var(--ink-soft); text-align: center; }
.m710-gl { stroke: rgba(150, 190, 235, 0.1); stroke-width: 1; }
.m710-c1 { fill: none; stroke: var(--signal); stroke-width: 2.4; stroke-linejoin: round; }
.m710-c2 { fill: none; stroke: #7CC7FF; stroke-width: 2; stroke-dasharray: 5 4; }
.m710-tc1 { fill: var(--signal); }
.m710-tc2 { fill: #7CC7FF; }
.m710-one { stroke: var(--bad); stroke-width: 1.4; stroke-dasharray: 6 4; }
.m710-tone { fill: var(--bad); }
.m710-room { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 2 3; }
.m710-dot { fill: #FFFFFF; stroke: var(--signal); stroke-width: 2.5; }
.m710-dot.hot { fill: var(--signal); stroke: #FFFFFF; stroke-width: 1.5; }
.m710-chart svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.m710-hl { font-style: normal; }
.m710-lab bdi { white-space: nowrap; }
.m710-lab .fc-buttons.m710-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.m710-lab .fc-buttons.m710-btns button { padding: 7px 6px; font-size: 0.84rem; min-width: 0; }
.m710-lab [data-show][hidden] { display: none; }
.m710-tab td, .m710-tab th { text-align: center; vertical-align: middle; }
@media (max-width: 480px) { .m710-tab th, .m710-tab td { padding-inline: 5px; font-size: 0.86rem; } }
/* الحاسوب: المستويات فوق المخطط في عمود المشهد */
@media (min-width: 1000px) {
    .m710-lab .m710-main > svg { max-height: calc(var(--lx-h) * 0.64); }
    .m710-lab .m710-chart svg { max-height: calc(var(--lx-h) * 0.4); }
    .m710-lab .lx-stage > .m710-chart { margin-top: 4px; }
}
/* الهاتف: «المخطط» يحل محل المستويات في الجزء المثبّت */
@media (max-width: 999px) {
    .m710-lab .lx-stage[data-v="more"] > .m710-main { display: none; }
    .m710-lab .lx-stage[data-v="more"] > .m710-chart.lx-more { position: static; height: auto; margin: 0; }
}
/* 12-8 مكونات جهاز الليزر: رسوم الدرس */
.m711-ph { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m711-train { fill: none; stroke-width: 1.3; stroke-linejoin: round; }
.m711-a0 { fill: #7D93AE; }
.m711-ax { fill: #FFB35C; }
.m711-halo { fill: rgba(255, 179, 92, 0.24); }
.m711-halo2 { fill: rgba(255, 210, 140, 0.45); }
.m711-mir { fill: #C9D3DE; stroke: #EAF1F8; stroke-width: 1; }
.m711-mirp { fill: rgba(201, 211, 222, 0.3); stroke: #C9D3DE; stroke-width: 1.3; stroke-dasharray: 4 3; }
.m711-med { fill: rgba(235, 70, 90, 0.42); stroke: #FF8A80; stroke-width: 1.2; }
.m711-med36 { fill: rgba(200, 214, 232, 0.13); stroke: var(--ink-muted); stroke-width: 1; }
.m711-rod { fill: rgba(255, 92, 130, 0.2); stroke: rgba(255, 150, 175, 0.75); stroke-width: 1.2; }
.m711-rod2 { fill: rgba(200, 214, 232, 0.1); stroke: var(--ink-muted); stroke-width: 1.1; }
.m711-glass { fill: rgba(170, 205, 255, 0.06); stroke: var(--ink-muted); stroke-width: 1.3; }
.m711-pbox { fill: #E3B03A; stroke: var(--signal); stroke-width: 1.2; }
.m711-parr { fill: rgba(255, 197, 61, 0.62); stroke: var(--signal); stroke-width: 1; stroke-linejoin: round; }
.m711-hollow { fill: none; stroke: var(--signal); stroke-width: 1.3; stroke-linejoin: round; }
.m711-axis { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 6 4; }
.m711-lev { stroke: var(--ink); stroke-width: 2; }
.m711-lamp { fill: none; stroke: #DCE7FF; stroke-width: 2.4; stroke-linecap: round; }
.m711-lampb { fill: none; stroke: rgba(220, 231, 255, 0.32); stroke-width: 2.2; stroke-linecap: round; }
.m711-lab .m711-lampb { stroke: rgba(220, 231, 255, 0.2); stroke-width: 1.6; }
.m711-lampf { fill: none; stroke: #FFFFFF; stroke-width: 4.2; stroke-linecap: round; }
.m711-tube { fill: rgba(220, 231, 255, 0.12); stroke: #DCE7FF; stroke-width: 1.6; }
.m711-tubef { fill: #F4F8FF; }
.m711-term { fill: var(--ink-soft); }
.m711-el { fill: #A9B7C8; stroke: var(--ink-soft); stroke-width: 0.8; }
.m711-e { fill: #7CC7FF; }
.m711-ev { stroke: #7CC7FF; stroke-width: 2; fill: none; }
.m711-hv { fill: var(--inset); stroke: var(--ink-muted); stroke-width: 1.2; }
.m711-ray { stroke: #FF3B3B; stroke-width: 2; }
.m711-pipe { fill: none; stroke: var(--ink-muted); stroke-width: 1.4; }
.m711-ra { fill: #C8F06A; }
.m711-rb { fill: #EAF1F8; }
.m711-burst { fill: #FFE07A; stroke: #FFF4CF; stroke-width: 0.8; }
.t-label.m711-tp, .t-ar.m711-tp { fill: #FF8A80; font-weight: 700; }
.t-label.m711-tn, .t-ar.m711-tn { fill: #7CC7FF; font-weight: 700; }
.t-ar.m711-tw { fill: #FFFFFF; font-weight: 700; }
.t-ar.m711-tdk { fill: #2B2000; font-weight: 700; }
.m711-ol { margin: 0 0 14px; padding-inline-start: 22px; line-height: 1.95; }
.m711-ol li { margin-bottom: 4px; }
.m711-cmp td, .m711-cmp th { vertical-align: middle; }
/* 12-8 مختبر الفوتون: ركّب ليزراً (build-laser-lab) — ثلاث طبقات فوق بعضها: SVG خلفي، ولوح canvas، وSVG أمامي */
.m711-box { position: relative; width: 100%; max-width: calc(var(--lx-h) * 380 / 236); aspect-ratio: 380 / 236; margin-inline: auto; }
.m711-box > svg, .m711-box > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; direction: ltr; user-select: none; -webkit-user-select: none; }
.m711-box > .m711-front { pointer-events: none; }
.m711-chartbox { position: relative; width: 100%; max-width: calc(var(--lx-h) * 0.36 * 380 / 128); aspect-ratio: 380 / 128; margin-inline: auto; }
.m711-chartbox > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.m711-cap-t { margin: 0 0 4px; font-size: 0.78rem; color: var(--ink-soft); text-align: center; }
.m711-mir0 { fill: none; stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.6; }
.m711-empty { fill: none; stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 5 4; }
.m711-dye { fill: rgba(255, 170, 60, 0.16); }
.m711-gas { fill: rgba(255, 120, 90, 0.07); }
.m711-sheet { fill: rgba(80, 230, 90, 0.22); transition: opacity 0.3s; }
.m711-plbox { fill: #1E5B2E; stroke: #5FD39A; stroke-width: 1.2; }
.m711-lab .m711-lf { opacity: 0.32; stroke-width: 1.8; }
.m711-lab .m711-lf.lit { opacity: 0.62; stroke: #F4F8FF; animation: m711-flick 0.9s steps(3) infinite; }
@keyframes m711-flick { 0% { opacity: 0.62; } 33% { opacity: 0.38; } 66% { opacity: 0.55; } 100% { opacity: 0.62; } }
@media (prefers-reduced-motion: reduce) { .m711-lab .m711-lf.lit { animation: none; } }
.lx-ctl .fc-buttons.m711-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lx-ctl .fc-buttons.m711-btns.m711-one { grid-template-columns: minmax(0, 1fr); }
.lx-ctl .fc-buttons.m711-btns button { padding: 6px 4px; font-size: 0.86rem; line-height: 1.4; min-width: 0; }
@media (min-width: 1000px) {
    .m711-lab .lx-stage .m711-box { max-width: calc(var(--lx-h) * 0.6 * 380 / 236); }
}
@media (max-width: 999px) {
    .m711-lab .lx-stage > .m711-more .m711-chartbox { max-width: calc((var(--lx-h) - 64px) * 380 / 128); }
}
/* 13-8 منظومات مستويات الليزر: رسوم الدرس (الألوان كما في الشكلين 38 و39) */
.m712-lev { stroke: var(--ink); stroke-width: 2.2; }
.m712-pump { stroke: #5B8CFF; stroke-width: 4; }
.m712-pump-h { fill: #5B8CFF; }
.m712-fast { stroke: #F2913A; stroke-width: 4; }
.m712-fast-h { fill: #F2913A; }
.m712-las { stroke: #FF4747; stroke-width: 4; }
.m712-las-h { fill: #FF4747; }
.m712-ph { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.m712-heat { fill: none; stroke: #F2913A; stroke-width: 1.8; stroke-linejoin: round; }
.m712-e { fill: #7CC7FF; }
.m712-eg { fill: rgba(124, 199, 255, 0.28); }
.m712-a0 { fill: #7D93AE; }
.m712-ax { fill: #FFB35C; }
.m712-halo { fill: rgba(255, 179, 92, 0.25); }
.m712-ax2 { stroke: var(--ink-muted); stroke-width: 1.2; }
.m712-bu { fill: #FFB35C; }
.m712-bl { fill: #7D93AE; }
.m712-bo { fill: rgba(150, 175, 205, 0.45); }
.m712-cmp td, .m712-cmp th { vertical-align: middle; }
.m712-ol { margin: 0 0 14px; padding-inline-start: 22px; line-height: 1.95; }
.m712-ol li { margin-bottom: 4px; }
/* 13-8 مختبر الفوتون: منظومات المستويات (levels-system-lab) — SVG ثابت تحته لوح canvas للذرات والفوتونات */
.m712-box { position: relative; width: 100%; max-width: calc(var(--lx-h) * 400 / 250); aspect-ratio: 400 / 250; margin-inline: auto; }
.m712-box > svg, .m712-box > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; direction: ltr; user-select: none; -webkit-user-select: none; }
.m712-chartbox { position: relative; width: 100%; max-width: calc(var(--lx-h) * 0.36 * 380 / 150); aspect-ratio: 380 / 150; margin-inline: auto; }
.m712-chartbox > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.m712-cap-t { margin: 0 0 4px; font-size: 0.78rem; color: var(--ink-soft); text-align: center; }
.lx-ctl .fc-buttons.m712-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lx-ctl .fc-buttons.m712-btns.m712-one { grid-template-columns: minmax(0, 1fr); }
.lx-ctl .fc-buttons.m712-btns button { padding: 6px 4px; font-size: 0.86rem; line-height: 1.4; min-width: 0; }
@media (min-width: 1000px) {
    .m712-lab .lx-stage .m712-box { max-width: calc(var(--lx-h) * 0.6 * 400 / 250); }
}
@media (max-width: 999px) {
    .m712-lab .lx-stage > .m712-more .m712-chartbox { max-width: calc((var(--lx-h) - 64px) * 380 / 150); }
}
.m712-bar0 { stroke: var(--line-strong); stroke-width: 1; }
.t-ar.m712-tpump { fill: #7FA6FF; font-weight: 700; }
/* 14-8 انواع الليزر: رسوم الدرس ومختبر أنواع الليزر (laser-types-lab) */
/* المرآتان: العاكسة كلياً فضية، والعاكسة جزئياً شبه شفافة بحد متقطع */
.m713-mf { fill: #C9D3DE; stroke: #F2F6FA; stroke-width: 0.8; }
.m713-mp { fill: rgba(201, 211, 222, 0.38); stroke: #C9D3DE; stroke-width: 1; stroke-dasharray: 3 2; }
/* الأوساط الفعالة */
.m713-ruby { fill: rgba(224, 40, 80, 0.3); stroke: #FF5C7A; stroke-width: 1.3; }
.m713-ndc { fill: rgba(190, 160, 255, 0.16); stroke: #C8B4FF; stroke-width: 1.3; }
.m713-host { fill: rgba(234, 241, 248, 0.3); }
.m713-cr { fill: #FF4D6A; }
.m713-tube { fill: rgba(150, 200, 255, 0.07); stroke: rgba(200, 225, 250, 0.7); stroke-width: 1.4; }
.m713-he { fill: #B8C4D2; }
.m713-ne { fill: #FF9A4D; }
.m713-dyec { fill: rgba(255, 150, 70, 0.18); stroke: #FFB27A; stroke-width: 1.3; }
.m713-mol { fill: #FF8C5A; opacity: 0.85; }
.m713-flowc { fill: rgba(170, 220, 160, 0.07); stroke: rgba(200, 235, 190, 0.6); stroke-width: 1.3; }
.m713-p { fill: rgba(255, 150, 90, 0.17); }
.m713-n { fill: rgba(100, 165, 255, 0.17); }
.m713-act { fill: rgba(255, 90, 90, 0.32); }
.m713-chip { fill: none; stroke: var(--ink-soft); stroke-width: 1.4; }
.m713-face { stroke: #E3EAF2; stroke-width: 3.2; }
.m713-facep { stroke: rgba(227, 234, 242, 0.55); stroke-width: 3; stroke-dasharray: 3 2; }
.m713-metal { fill: #9AA7B6; }
/* الجسيمات والإلكترونات والفجوات */
.m713-e, .m713-el { fill: #7CC7FF; }
.m713-hole { fill: none; stroke: #FF7A9A; stroke-width: 1.8; }
.m713-burst { fill: #FFE6A0; }
.m713-kr { fill: rgba(120, 200, 255, 0.25); stroke: #8FD0FF; stroke-width: 1.5; }
.m713-f { fill: rgba(170, 255, 140, 0.25); stroke: #A8F08C; stroke-width: 1.5; }
.m713-glow { fill: rgba(190, 150, 255, 0.28); stroke: #B28CFF; stroke-width: 1.2; stroke-dasharray: 3 2; }
.m713-d, .m713-dd { fill: #E8EEF5; }
.m713-fl { fill: #C8F07A; }
.m713-dglow { fill: rgba(255, 236, 150, 0.32); }
.m713-o { fill: #FF7B7B; }
.m713-c { fill: #8D98A6; }
.m713-ng { fill: rgba(120, 200, 255, 0.3); stroke: #8FD0FF; stroke-width: 1.3; }
.m713-hal { fill: rgba(170, 255, 140, 0.35); stroke: #A8F08C; stroke-width: 1.2; }
.m713-react { fill: #B9C9DA; }
/* أجزاء الأجهزة */
.m713-lv { stroke: var(--ink); stroke-width: 2; }
.m713-dn { stroke: #FF7A9A; stroke-width: 2; }
.m713-lamp { fill: none; stroke: #FFF2B8; stroke-width: 2.2; }
.m713-lampb { fill: none; stroke: rgba(255, 242, 184, 0.32); stroke-width: 2; }
.m713-flash { fill: rgba(255, 250, 220, 0.35); }
.m713-lglow { fill: rgba(255, 248, 210, 0.42); }
.m713-box { fill: #12355E; stroke: var(--ink-muted); stroke-width: 1.3; }
.m713-elec { fill: #9AA7B6; stroke: var(--ink-soft); stroke-width: 1; }
.m713-plate { fill: #9AA7B6; }
.m713-spark { fill: none; stroke: #9FDBFF; stroke-width: 1.6; stroke-linejoin: round; }
.m713-prism { fill: rgba(200, 230, 255, 0.18); stroke: #DCEBFA; stroke-width: 1.4; }
.m713-pipe { fill: none; stroke: var(--ink-muted); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.5; }
.m713-noz { fill: #7D8A9B; }
.m713-axis { stroke: rgba(234, 241, 248, 0.18); stroke-width: 1; stroke-dasharray: 4 4; }
/* جدول الأنواع الستة: يتسع لشاشة الهاتف */
.m713-tab th, .m713-tab td { padding: 9px 8px; vertical-align: middle; }
@media (max-width: 480px) { .m713-tab th, .m713-tab td { padding: 7px 5px; font-size: 0.86rem; } }

/* ---------- المختبر ---------- */
.m713-lab [hidden] { display: none !important; }
.m713-svg, .m713-ssvg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m713-pa .m713-halo { fill: rgba(255, 236, 150, 0.5); opacity: 0; transition: opacity 0.15s; }
.m713-pa.ex .m713-halo { opacity: 1; }
.m713-kr .m713-core { fill: #FF4D6A; }
.m713-kn .m713-core { fill: #B79BFF; }
.m713-pa.ex .m713-core { fill: #FFF1B0; }
.m713-neon { fill: #FF9A4D; }
.m713-dmol { fill: #FF8C5A; }
.m713-site { fill: rgba(255, 140, 140, 0.55); }
.m713-pa .m713-bond { display: none; }
.m713-pa.ex .m713-bond { display: inline; }
.m713-pa.ex .m713-apart { display: none; }
.m713-phg .w { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.m713-phg .hd { fill: currentColor; }
.m713-out { fill: none; stroke-width: 3; stroke-dasharray: 9 5; stroke-linecap: round; }
.m713-out.inv { stroke-dasharray: 4 5; }
.m713-uv { fill: rgba(165, 123, 255, 0.35); }
.m713-ir { fill: rgba(192, 71, 90, 0.3); }
.m713-tk { stroke: var(--ink-muted); stroke-width: 1; }
.m713-cap { margin: 0 0 2px; font-size: 0.8rem; color: var(--ink-soft); text-align: center; }
.m713-spec svg { display: block; width: 100%; height: auto; margin-inline: auto; }
.m713-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 4px; }
.m713-tabs button { padding: 7px 3px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-size: 0.84rem; cursor: pointer; }
.m713-tabs button:hover { background: var(--hover); }
.m713-tabs button.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.fc-controls .fc-buttons.m713-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m713-btns button { flex: 1 1 30%; padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
.m713-btns bdi { font-family: var(--font-mono); }
/* الحاسوب: الجهاز فوق شريط الطيف في عمود المشهد */
@media (min-width: 1000px) {
    .m713-lab .m713-main > svg { max-height: calc(var(--lx-h) * 0.66); }
    .m713-lab .m713-spec svg { max-height: calc(var(--lx-h) * 0.26); }
    .m713-lab .lx-stage > .m713-spec { margin-top: 2px; }
}
/* الهاتف: «شريط الطيف» يحل محل الجهاز في الجزء المثبّت حين يختاره الطالب */
@media (max-width: 999px) {
    .m713-lab .lx-stage[data-v="more"] > .m713-main { display: none; }
    .m713-lab .lx-stage[data-v="more"] > .m713-spec.lx-more { position: static; height: auto; margin: 0; }
    .m713-tabs button, .fc-controls .fc-buttons.m713-btns button { font-size: 0.8rem; }
}
/* 15-8 بعض تطبيقات الليزر: رسوم الدرس ومختبر التطبيقات (laser-apps-lab) */
.m714-dev { fill: #12355E; stroke: var(--ink-muted); stroke-width: 1.3; }
.m714-lens { fill: rgba(200, 230, 255, 0.22); stroke: #DCEBFA; stroke-width: 1.2; }
.m714-board { fill: rgba(60, 140, 90, 0.45); stroke: #6FBF8E; stroke-width: 1.1; }
.m714-comp { fill: #3B4E66; stroke: var(--ink-soft); stroke-width: 1; }
.m714-hot { fill: #C2533A; stroke: #FFB27A; stroke-width: 1.2; }
.m714-spot { fill: #FFF6D8; }
.m714-sp { fill: #FFE6A0; }
.m714-torch { fill: #7D8A9B; stroke: var(--ink-soft); stroke-width: 1; }
.m714-flame { fill: rgba(255, 150, 50, 0.85); stroke: #FFD27A; stroke-width: 1.2; }
.m714-heat { fill: rgba(255, 120, 40, 0.3); }
.m714-ok { fill: var(--ok); }
.m714-bad { fill: var(--bad); }
.m714-head { fill: #9AA7B6; stroke: var(--ink-soft); stroke-width: 1.2; }
.m714-ring { stroke: #6E7B8B; stroke-width: 2; }
.m714-metal { fill: #8F9CAB; stroke: #C9D3DE; stroke-width: 1.2; }
.m714-metalend { fill: #A9B5C3; stroke: #C9D3DE; stroke-width: 1.2; }
.m714-strip { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.4; }
.m714-flash { fill: #FFFBEA; }
.m714-ray { fill: none; stroke: #FFF2B8; stroke-width: 1.6; stroke-linecap: round; }
.m714-hair { fill: rgba(170, 120, 70, 0.35); stroke: #C79A6A; stroke-width: 1.5; }
.m714-holec { fill: #071A30; stroke: #FFB27A; stroke-width: 1; }
.m714-wall { fill: rgba(150, 190, 235, 0.08); stroke: var(--ink-muted); stroke-width: 1; }
.m714-floor { fill: rgba(150, 190, 235, 0.04); stroke: var(--ink-muted); stroke-width: 1; }
.m714-deck { fill: none; stroke: var(--ink-soft); stroke-width: 4; stroke-linecap: round; }
.m714-staff { stroke: #E8EEF5; stroke-width: 2.4; stroke-dasharray: 3 2; }
.m714-earth { fill: rgba(70, 140, 230, 0.35); stroke: #7CC7FF; stroke-width: 1.4; }
.m714-moon { fill: #C9CFD8; stroke: #EEF2F6; stroke-width: 1; }
.m714-crater { fill: rgba(80, 90, 105, 0.35); }
.m714-chim { fill: #5C6878; stroke: var(--ink-muted); stroke-width: 1; }
.m714-plume { fill: rgba(170, 180, 195, 0.22); stroke: rgba(200, 210, 222, 0.35); stroke-width: 1; }
.m714-mol { fill: #7CC7FF; }
.m714-tower { stroke: var(--ink-muted); stroke-width: 2.4; }
.m714-mf { fill: #C9D3DE; stroke: #F2F6FA; stroke-width: 0.8; }
.m714-absf { fill: #FFE6A0; }
.m714-plate { fill: rgba(200, 220, 240, 0.25); stroke: #DCEBFA; stroke-width: 1.2; }
.m714-grey { fill: rgba(200, 205, 212, 0.5); }
.m714-bright { fill: #F4F7FA; }
.m714-dark { fill: #1A2533; stroke: var(--ink-muted); stroke-width: 1; }
.m714-ow { fill: none; stroke: #FF6B6B; stroke-width: 2; }
.m714-rw { fill: none; stroke: #FFD27A; stroke-width: 1.6; stroke-dasharray: 4 3; }
.m714-split { stroke: #DCEBFA; stroke-width: 3; opacity: 0.7; }
.m714-mir { stroke: #C9D3DE; stroke-width: 4; }
.m714-obj { fill: none; stroke: #8FD0FF; stroke-width: 1.6; stroke-linejoin: round; }
.m714-fr { stroke: #FFE0E0; stroke-width: 1.6; }
.m714-virt { fill: none; stroke: #FFD27A; stroke-width: 1.8; stroke-dasharray: 4 3; stroke-linejoin: round; }
.m714-eye path, .m714-eye { fill: #EAF1F8; stroke: var(--ink-muted); stroke-width: 1; }
.m714-eye circle { fill: #0B2747; }
.m714-photo { fill: rgba(255, 255, 255, 0.04); stroke: var(--ink-muted); stroke-width: 1.2; }
.m714-tab th, .m714-tab td { padding: 9px 8px; vertical-align: middle; }
@media (max-width: 480px) { .m714-tab th, .m714-tab td { padding: 7px 5px; font-size: 0.86rem; } }

/* ---------- المختبر ---------- */
.m714-lab [hidden] { display: none !important; }
.m714-svg { direction: ltr; user-select: none; -webkit-user-select: none; }
.m714-ti, .m714-ti.m714-front { fill: #8F9CAB; stroke: #C9D3DE; stroke-width: 1.1; }
.m714-rub { fill: rgba(224, 40, 80, 0.45); stroke: #FF7A94; stroke-width: 1.1; }
.m714-dia { fill: rgba(190, 235, 255, 0.28); stroke: #E6F7FF; stroke-width: 1.1; }
.m714-front { filter: brightness(0.82); }
.m714-side { filter: brightness(0.66); }
.m714-seam { stroke: #071A30; stroke-width: 1.4; stroke-dasharray: 5 3; }
.m714-kerf { stroke: #071A30; stroke-linecap: round; }
.m714-bead { stroke: #FFC88A; stroke-linecap: round; }
.m714-heatg { fill: rgba(255, 120, 40, 0.45); }
.m714-heatg.melt { fill: rgba(255, 245, 210, 0.95); }
.m714-nb { fill: #3B4E66; stroke: var(--ink-soft); stroke-width: 1; }
.m714-nb.hot { fill: #C2533A; stroke: #FFB27A; }
.m714-inset { fill: rgba(3, 14, 28, 0.5); stroke: var(--line-strong); stroke-width: 1; }
.m714-chan { fill: #071A30; }
.m714-board2 { fill: #E8EEF5; opacity: 0.85; }
.m714-tick { stroke: #0B2747; stroke-width: 1.2; }
.m714-lampc { fill: rgba(255, 210, 100, 0.16); stroke: rgba(255, 210, 100, 0.35); stroke-width: 1; }
.m714-pulse { fill: #FFE0E0; stroke: #FF6B6B; stroke-width: 1.5; }
.m714-meterf { fill: none; stroke: var(--ink-muted); stroke-width: 1; }
.m714-meter { fill: #FF8A80; }
.m714-gh .m714-mol { fill: #7CC7FF; }
.m714-gc .m714-mol { fill: #B9C4D0; }
.m714-gp .m714-mol { fill: #F2D45C; }
.m714-mols .m714-mol.fl { fill: #FFF6D8; r: 4.5; }
.m714-phg .w { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.m714-phg .hd { fill: currentColor; }
.m714-hray { fill: none; stroke: #FF6B6B; stroke-width: 1.8; }
.m714-hray.thin { stroke-width: 1; opacity: 0.55; }
.m714-spread { fill: rgba(255, 107, 107, 0.2); }
.m714-dot { fill: #FFE0E0; }
.m714-fog { fill: #C9CFD8; }
.m714-refc { fill: rgba(255, 107, 107, 0.15); }
.m714-sight { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 4; }
.m714-pupil { fill: #0B2747; }
.m714-photof { fill: rgba(255, 255, 255, 0.05); stroke: var(--ink-muted); stroke-width: 1.2; }
.m714-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 4px; }
.m714-tabs button { padding: 7px 3px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; font-size: 0.86rem; cursor: pointer; }
.m714-tabs button:hover { background: var(--hover); }
.m714-tabs button.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.fc-controls .fc-buttons.m714-btns { flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.fc-controls .fc-buttons.m714-btns button { flex: 1 1 30%; padding: 7px 4px; font-size: 0.84rem; min-width: 0; }
@media (min-width: 1000px) { .m714-lab .m714-main > svg { max-height: calc(var(--lx-h) * 0.86); } }
@media (max-width: 999px) { .m714-tabs button, .fc-controls .fc-buttons.m714-btns button { font-size: 0.8rem; } }

/* =========================================================
   قسم «اختبارات» (js/exam.js): ورقة بنمط الوزاري، عدّ تنازلي، درجة من 100، إرشاد، أجوبة
   ========================================================= */
.ex { display: flex; flex-direction: column; gap: 18px; }
.ex-intro { font-size: 1.08rem; color: var(--ink); margin-bottom: 14px; }
.ex-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: var(--radius); margin: 0 0 14px; }
.ex-stats > div { padding: 10px 14px; display: flex; flex-direction: column-reverse; gap: 2px; }
.ex-stats > div + div { border-right: 1px solid var(--line); }
.ex-stats dd { margin: 0; font-family: var(--font-mono); font-size: 1.6rem; font-weight: 500; color: var(--ink); line-height: 1.2; }
.ex-stats dd small { font-family: var(--font-body); font-size: 0.85rem; color: var(--ink-muted); }
.ex-stats dt { font-size: 0.85rem; color: var(--ink-muted); }
.ex-plan { margin: 0 0 14px; padding-inline-start: 1.3em; display: grid; gap: 6px; }
.ex-plan small { color: var(--ink-muted); }
.ex-how { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px 14px; background: var(--raise); margin-bottom: 12px; }
.ex-warn { color: var(--signal); font-weight: 600; }
.ex-rec { color: var(--ink-soft); }
.ex-go { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); min-width: 220px; font-size: 1.1rem; }
.ex-go:hover { background: var(--signal-hover); }

.ex-bar {
    position: sticky; top: calc(var(--nav-h) + 6px); z-index: 50;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 8px 12px; background: var(--bg-deep); border: 1px solid var(--line-strong); border-radius: var(--radius);
    box-shadow: 0 8px 18px rgba(2, 10, 22, 0.35);
}
.ex-timer { font-size: 1.1rem; color: var(--ink); }
.ex-timer b { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 600; letter-spacing: 0.04em; }
.ex-bar.is-low .ex-timer b { color: var(--signal); }
.ex-bar.is-out .ex-timer b { color: var(--bad); }
.ex-prog { color: var(--ink-muted); font-size: 0.92rem; flex: 1 1 auto; }
.ex-submit { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); min-height: 40px; padding: 6px 16px; }
.ex-submit:hover { background: var(--signal-hover); }
.ex-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.ex-ghost:hover { background: var(--hover); border-color: var(--ink-soft); }

.ex-paper { display: flex; flex-direction: column; gap: 22px; }
.ex-sec { border-top: 1px solid var(--line-strong); padding-top: 14px; }
.ex-sh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-family: var(--font-display); font-size: 1.35rem; margin: 0 0 4px; }
.ex-sh small { font-family: var(--font-body); font-size: 0.9rem; color: var(--ink-muted); font-weight: 600; white-space: nowrap; }
.ex-st { color: var(--ink-soft); margin-bottom: 12px; }
.ex-list, .ex-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ex-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--raise); }
.ex-item.is-ok { border-color: rgba(95, 211, 154, 0.55); }
.ex-item.is-bad { border-color: rgba(255, 123, 123, 0.55); }
.ex-ih { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ex-ih:empty { display: none; }
.ex-n { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 50%; background: var(--inset); border: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: 0.85rem; }
.ex-mk { font-size: 0.82rem; color: var(--ink-muted); border: 1px solid var(--line); border-radius: 20px; padding: 1px 9px; white-space: nowrap; }
.ex-mk.ok { color: var(--ok); border-color: rgba(95, 211, 154, 0.5); }
.ex-mk.bad { color: var(--bad); border-color: rgba(255, 123, 123, 0.5); }
.ex-src { font-size: 0.78rem; color: var(--ink-muted); border: 1px dashed var(--line-strong); border-radius: 20px; padding: 1px 8px; }
.ex-src.src-min { color: var(--signal); border-color: rgba(255, 197, 61, 0.45); }
.ex-q { font-size: 1.05rem; line-height: 1.8; color: var(--ink); margin-bottom: 10px; }
.ex-opts { display: grid; gap: 8px; }
.ex-opt {
    display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; cursor: pointer;
    border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--inset); color: var(--ink-soft);
    transition: border-color 0.15s, background-color 0.15s;
}
.ex-opt:hover { border-color: var(--ink-soft); background: var(--hover); color: var(--ink); }
.ex-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ex-ol { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink-soft); }
.ex-ot { flex: 1 1 auto; min-width: 0; line-height: 1.7; }
.ex-opt:has(input:checked) { border-color: var(--signal); background: var(--signal-soft); color: var(--ink); }
.ex-opt:has(input:checked) .ex-ol { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.ex-opt:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.ex-opt:has(input:disabled) { cursor: default; }
.ex-opt.is-right { border-color: var(--ok); background: rgba(95, 211, 154, 0.1); color: var(--ink); }
.ex-opt.is-right .ex-ol { background: var(--ok); border-color: var(--ok); color: var(--signal-ink); }
.ex-opt.is-wrong { border-color: var(--bad); background: rgba(255, 123, 123, 0.1); color: var(--ink); }
.ex-opt.is-wrong .ex-ol { background: var(--bad); border-color: var(--bad); color: var(--signal-ink); }
.ex-otag { flex: 0 0 auto; align-self: center; font-size: 0.78rem; font-weight: 700; border-radius: 20px; padding: 1px 8px; white-space: nowrap; }
.ex-otag.ok { color: var(--ok); border: 1px solid rgba(95, 211, 154, 0.5); }
.ex-otag.bad { color: var(--bad); border: 1px solid rgba(255, 123, 123, 0.5); }

.ex-prob .ex-q { border-inline-start: 3px solid var(--signal); padding-inline-start: 12px; }
.ex-parts { counter-reset: part; }
.ex-part { counter-increment: part; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--inset); }
.ex-part.is-ok { border-color: rgba(95, 211, 154, 0.55); }
.ex-part.is-bad { border-color: rgba(255, 123, 123, 0.55); }
.ex-ph { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ex-pl { color: var(--ink); line-height: 1.7; }
.ex-pl::before { content: counter(part) ". "; font-family: var(--font-mono); color: var(--ink-muted); }
.ex-num-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ex-num, .ex-exp {
    font-family: var(--font-mono); font-size: 1.1rem; color: var(--ink); background: var(--screen);
    border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 8px 10px; direction: ltr; text-align: left;
}
.ex-num { width: 9.5em; max-width: 100%; }
.ex-exp { width: 4.6em; }
.ex-num:focus, .ex-exp:focus { outline: 2px solid var(--signal); outline-offset: 1px; border-color: var(--signal); }
.ex-num-row.is-invalid .ex-num, .ex-num-row.is-invalid .ex-exp { border-color: var(--bad); }
.ex-x { font-family: var(--font-mono); color: var(--ink-soft); }
.ex-unit { color: var(--ink-soft); }
.ex-cmp { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.ex-part.is-bad .ex-cmp { color: var(--ink); }
.ex-foot { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; font-size: 0.95rem; }
.ex-empty { color: var(--bad); margin-bottom: 4px; }
.ex-why { color: var(--ink-soft); margin-bottom: 4px; }
.ex-links { margin: 0; color: var(--ink-muted); }
.ex-link { color: var(--signal); text-decoration: none; border-bottom: 1px dashed rgba(255, 197, 61, 0.5); margin-inline-end: 10px; }
.ex-link:hover { color: var(--signal-hover); }
.ex-end { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.ex-submit-end { min-height: 50px; font-size: 1.08rem; }
.ex-confirm { border: 1px solid var(--signal); border-radius: var(--radius); background: var(--signal-soft); padding: 12px 14px; }
.ex-confirm p { margin: 0 0 10px; color: var(--ink); }
.ex-cbtns { display: flex; gap: 10px; flex-wrap: wrap; }
.ex-cbtns .btn-action:first-child { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }

.ex-result { display: flex; flex-direction: column; gap: 12px; }
.ex-timeup { color: var(--signal); font-weight: 700; }
.ex-score { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ex-big { font-family: var(--font-mono); line-height: 1; }
.ex-big b { font-size: 4rem; font-weight: 600; color: var(--signal); }
.ex-big small { font-size: 1.5rem; color: var(--ink-muted); }
.ex-grade { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 4px 14px; }
.ex-adv { font-size: 1.08rem; color: var(--ink); margin: 0; }
.ex-time { color: var(--ink-muted); margin: 0; }
.ex-table { max-width: 720px; }
.ex-table th, .ex-table td { text-align: center; }
.ex-h { font-family: var(--font-display); font-size: 1.35rem; margin: 10px 0 0; }
.ex-lead { color: var(--ink-soft); margin: 0; }
.ex-weaks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ex-weak { border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--bad); border-radius: var(--radius); padding: 10px 14px; background: var(--raise); }
.ex-wh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ex-wt { font-weight: 700; color: var(--ink); }
.ex-wl { font-family: var(--font-mono); color: var(--bad); white-space: nowrap; direction: ltr; }
.ex-wd { margin: 4px 0; color: var(--ink-soft); }
.ex-wa { margin: 0; }
.ex-strong { color: var(--ink-soft); }
.ex-again { display: flex; gap: 10px; flex-wrap: wrap; }
.ex-again .btn-action:first-child { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.ex-review { display: flex; flex-direction: column; gap: 18px; }
.ex-review[hidden] { display: none; }
.ex-all { display: flex; flex-direction: column; gap: 18px; }
body.ex-running #next-step, body.ex-running .lesson-actions { display: none !important; }
@media (max-width: 640px) {
    .ex-item, .ex-part { padding: 10px; }
    .ex-opt { padding: 8px 9px; gap: 8px; }
    .ex-big b { font-size: 3.2rem; }
    .ex-stats dd { font-size: 1.3rem; }
    .ex-bar { gap: 8px; padding: 6px 8px; }
    .ex-prog { font-size: 0.85rem; }
    .ex-num { width: 6.6em; font-size: 1.05rem; padding: 7px 8px; }
    .ex-exp { width: 3.6em; font-size: 1.05rem; padding: 7px 6px; }
    .ex-num-row { gap: 6px; }
    .ex-table th, .ex-table td { padding: 6px 4px; font-size: 0.85rem; }
    .ex-opt { flex-wrap: wrap; }
    .ex-otag { order: 3; margin-inline-start: 34px; }
}

/* =========================================================
   الحسابات والاشتراك (js/account.js) — النسخة المنشورة فقط
   ========================================================= */
/* القفل على روابط الأجزاء التي لا يفتحها الحساب الحالي */
.is-locked::after { content: "🔒"; font-size: 0.72em; margin-inline-start: 6px; opacity: 0.75; font-weight: 400; }
.search-result.is-locked::after { content: none; }
.ns-main.is-locked::after { content: none; }
.ns-main.is-locked .ns-t::after { content: "🔒"; font-size: 0.72em; margin-inline-start: 6px; opacity: 0.75; }

/* زر الحساب في الشريط العلوي */
.nav-acc .nav-acc-link { gap: 6px; color: var(--ink); }
.nav-acc .nav-acc-link svg { flex: none; }
.nav-acc .nav-acc-link.is-sub { color: var(--signal); }
.nav-acc .nav-acc-link span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* البطاقات والنماذج */
.acc-wrap { display: grid; gap: 20px; max-width: 560px; margin: 8px auto 0; }
.acc-card {
    background: var(--raise); border: 1px solid var(--line-strong); border-radius: var(--radius);
    padding: 22px 22px 18px; display: grid; gap: 14px;
}
.acc-h { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); margin: 0; }
.acc-lead { color: var(--ink-soft); margin: 0; line-height: 1.8; }
.acc-field { display: grid; gap: 6px; }
.acc-label { font-weight: 600; color: var(--ink); }
.acc-field input {
    width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 1.05rem;
    color: var(--ink); background: var(--inset); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.acc-field input[dir="ltr"] { text-align: left; font-family: var(--font-mono); letter-spacing: 0.04em; }
.acc-field input:focus { outline: 2px solid var(--signal); outline-offset: 1px; border-color: var(--signal); }
.acc-hint { color: var(--ink-muted); font-size: 0.85rem; }
.acc-check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 0.92rem; cursor: pointer; justify-self: start; }
.acc-check input { width: 18px; height: 18px; accent-color: var(--signal); }
.acc-err { margin: 0; padding: 10px 12px; border: 1px solid var(--bad); border-right-width: 4px; color: var(--ink); background: rgba(255, 123, 123, 0.08); border-radius: var(--radius); line-height: 1.7; }
.acc-err:focus { outline: none; }
.acc-submit { width: 100%; }
.acc-submit:disabled { opacity: 0.7; cursor: progress; }
.acc-alt { margin: 0; color: var(--ink-soft); line-height: 1.8; }
.acc-alt a, .acc-hero a:not(.btn-action), .acc-state a { color: var(--signal); }
.acc-note { margin: 0; color: var(--ink-muted); font-size: 0.88rem; line-height: 1.7; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.acc-me { display: grid; gap: 10px; margin: 0; }
.acc-me div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.acc-me dt { color: var(--ink-muted); }
.acc-me dd { margin: 0; font-weight: 600; color: var(--ink); }
.acc-state { margin: 0; padding: 10px 12px; border-right: 4px solid var(--line-strong); background: var(--inset); line-height: 1.8; color: var(--ink-soft); }
.acc-state.ok { border-right-color: var(--ok); color: var(--ink); }

/* بطاقة الاشتراك */
.acc-sub { border-color: var(--signal); box-shadow: inset 0 3px 0 var(--signal); }
.acc-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--ink-soft); line-height: 1.7; }
.acc-price { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--signal); }
.acc-period { margin: 0; color: var(--ink); line-height: 1.8; }
.acc-wa { background: #25D366; color: #06331c; border-color: #25D366; width: 100%; }
.acc-wa:hover { background: #3ee07b; }
.acc-warn { margin: 0; color: var(--bad); }
.acc-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; color: var(--ink-muted); font-size: 0.9rem; line-height: 1.7; }

/* صفحات «للمشتركين» و«سجّل دخولك» */
.acc-gate { max-width: 560px; margin: 8px auto 20px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.acc-gate p { margin: 0; color: var(--ink-soft); line-height: 1.85; }
.acc-gate-icon { font-size: 2.2rem; line-height: 1; }
.acc-gate-h { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); margin: 0; }
.acc-gate .acc-actions { justify-content: center; }
.acc-gate + .acc-sub { max-width: 560px; margin: 0 auto; }
.acc-free { width: 100%; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; }
.acc-free-l { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.acc-free-l a { color: var(--ink); text-decoration: none; border: 1px solid var(--line-strong); padding: 6px 12px; border-radius: var(--radius); }
.acc-free-l a:hover { border-color: var(--signal); color: var(--signal); }
.acc-loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink-soft); padding: 48px 0; margin: 0; }
.acc-spin { width: 20px; height: 20px; border: 2px solid var(--line-strong); border-top-color: var(--signal); border-radius: 50%; animation: acc-spin 0.8s linear infinite; }
@keyframes acc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .acc-spin { animation-duration: 2.4s; } }

/* الصفحة الرئيسية */
.acc-hero { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); display: grid; gap: 10px; }
.acc-hero p { margin: 0; color: var(--ink-soft); line-height: 1.8; }

/* تنبيه: دخل الحساب من جهاز آخر */
.acc-notice {
    position: fixed; z-index: 2000; top: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%);
    width: min(520px, calc(100vw - 32px)); padding: 16px 18px; display: grid; gap: 10px;
    background: var(--bg-deep); border: 1px solid var(--signal); border-radius: var(--radius); box-shadow: var(--shadow);
}
.acc-notice[hidden] { display: none; }
.acc-notice p { margin: 0; line-height: 1.8; color: var(--ink-soft); }
.acc-notice b { color: var(--ink); }

@media (max-width: 1100px) {
    .nav-item.nav-acc { display: flex; }
    .nav-container { gap: 0; }
    .nav-acc .nav-acc-link { padding: 0 8px; }
}
@media (max-width: 560px) {
    .acc-card { padding: 18px 14px 14px; }
    .acc-actions .btn-action { flex: 1 1 100%; }
    .nav-acc .nav-acc-link span { max-width: 6em; }
}

/* =========================================================
   لوحة الإدارة (admin.html)
   ========================================================= */
.adm-body { background: var(--bg); min-height: 100vh; }
.adm-nav { justify-content: space-between; align-items: center; padding: 0 20px; gap: 12px; }
.adm-home { color: var(--ink); text-decoration: none; font-family: var(--font-display); font-size: 1.1rem; }
.adm-title { color: var(--signal); font-weight: 700; }
.adm-out { min-height: 36px; padding: 4px 14px; }
.adm-main { max-width: 980px; margin: 0 auto; padding: calc(var(--nav-h) + 24px) 16px 48px; display: grid; gap: 20px; }
.adm-sec { gap: 16px; }
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.adm-stat { background: var(--raise); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.adm-stat-v { font-family: var(--font-display); font-size: 1.5rem; color: var(--signal); }
.adm-stat-k { color: var(--ink-muted); font-size: 0.9rem; }
.adm-search { display: flex; gap: 10px; }
.adm-search input { flex: 1; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--inset); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.adm-search input:focus { outline: 2px solid var(--signal); outline-offset: 1px; }
.adm-list { display: grid; gap: 12px; }
.adm-st { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; background: var(--inset); }
.adm-st-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.adm-st-n { color: var(--ink); font-size: 1.05rem; }
.adm-st-p { color: var(--ink-soft); font-family: var(--font-mono); text-decoration: none; border-bottom: 1px dashed var(--line-strong); }
.adm-st-p:hover { color: #25D366; border-color: #25D366; }
.adm-st-m { margin: 0; color: var(--ink-muted); font-size: 0.88rem; }
.adm-tag { font-size: 0.82rem; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--ink-soft); }
.adm-tag.ok { border-color: var(--ok); color: var(--ok); }
.adm-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-acts .btn-action { min-height: 38px; padding: 6px 14px; font-size: 0.92rem; }
.adm-acts .btn-action.is-armed, .adm-link.is-armed { background: var(--bad); border-color: var(--bad); color: #2b0606; }
.adm-form { display: grid; gap: 12px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.adm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.adm-done { display: grid; gap: 10px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.adm-done p { margin: 0; color: var(--ink); }
.adm-done b { font-family: var(--font-mono); font-size: 1.2rem; color: var(--signal); letter-spacing: 0.06em; }
.adm-hist summary { cursor: pointer; color: var(--ink-soft); font-size: 0.92rem; }
.adm-hist ul { margin: 8px 0 0; padding-inline-start: 18px; display: grid; gap: 6px; color: var(--ink-soft); font-size: 0.9rem; }
.adm-hist li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adm-hist li.is-off { color: var(--ink-muted); text-decoration: line-through; }
.adm-link { background: none; border: 1px solid var(--line-strong); color: var(--ink-soft); font: inherit; font-size: 0.85rem; padding: 2px 10px; border-radius: var(--radius); cursor: pointer; }
.adm-link.danger:hover { border-color: var(--bad); color: var(--bad); }
.adm-settings { display: grid; gap: 14px; }
.adm-free summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.adm-chs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.adm-ch { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 6px; margin: 0; }
.adm-ch legend { color: var(--ink-soft); font-size: 0.9rem; padding: 0 6px; }
.adm-ch .acc-check { font-size: 0.88rem; }
@media (max-width: 560px) {
    .adm-search { flex-direction: column; }
    .adm-acts .btn-action { flex: 1 1 100%; }
}
/* صفحات الحساب: مربع العنوان بلا صف «الفصل/الموضوع» */
.title-block.is-plain .tb-row, .title-block.is-plain .tb-ruler { display: none; }
.adm-top { grid-column: 1 / -1; }
.adm-top ol { margin: 6px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; color: var(--ink-soft); font-size: 0.92rem; }
.adm-top .adm-link { color: var(--ink); }
.adm-warn { border-color: var(--bad); }
.adm-warn > .adm-stat-k, .adm-warn-t { color: var(--bad); }
