/* ==========================================================
   البحث وتأمين المصادر المشعة — أنماط الموقع
   اتجاه «الدرع» · خط Cairo · RTL
   ========================================================== */

:root {
  --navy: #0A2E3B;
  --navy-2: #0d3a4a;
  --petrol: #0F5E66;
  --petrol-light: #5fa9ad;
  --yellow: #F4C21B;
  --warn-bg: #FFF6D6;
  --red: #B3261E;
  --red-bg: #FDECEA;
  --ink: #1C2226;
  --ink-soft: #4a545a;
  --cream: #FAF7F0;
  --ivory: #EFE9DB;
  --line: #ddd5c3;
  --info-bg: #E6F1F1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(10, 46, 59, .06), 0 4px 14px rgba(10, 46, 59, .06);
  --content: 46rem;
  --font: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.125rem;         /* 18px */
  line-height: 1.85;
  color: var(--ink);
  background: var(--cream);
}

img, svg { max-width: 100%; display: block; }
a { color: var(--petrol); text-underline-offset: 3px; }
a:hover { color: var(--navy); }

h1, h2, h3 { color: var(--navy); line-height: 1.4; margin: 0 0 .6em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 1.15rem + .9vw, 1.7rem); font-weight: 800; margin-top: 2.2em; }
h3 { font-size: 1.2rem; font-weight: 700; margin-top: 1.6em; }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
strong { font-weight: 700; color: var(--navy); }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 100;
  background: var(--yellow); color: var(--navy); font-weight: 700;
  padding: .5rem 1rem; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: .75rem; }

.container { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .6rem 1.5rem;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  border-radius: 10px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--petrol); color: #fff; }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-outline { background: transparent; color: var(--petrol); border-color: var(--petrol); }
.btn-outline:hover { background: var(--petrol); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--ivory); color: var(--navy); }

/* ==========================================================
   صفحة الدخول
   ========================================================== */
.splash {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(15, 94, 102, .45), transparent 65%),
    var(--navy);
  color: var(--cream);
  padding: 2rem 1.25rem;
  text-align: center;
}
.splash-inner { width: min(100%, 30rem); }
.splash-shield { width: 96px; height: 96px; margin: 0 auto .75rem; }
.splash h1 {
  color: #fff; font-size: clamp(1.6rem, 1.2rem + 2.4vw, 2.4rem);
  line-height: 1.35; margin: 0 0 .25rem;
}
.splash-sub { color: #cfe3e2; font-size: .95rem; margin: 0 0 2rem; }

.orgs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.25rem; align-items: start;
  margin: 0 auto 2.25rem; max-width: 22rem;
}
.org-logo { height: 72px; display: flex; align-items: center; justify-content: center; }
.org-logo img { width: 72px; height: 72px; object-fit: contain; }
.org-name {
  /* مساحة متساوية بارتفاع سطرين، والاسم في وسطها */
  height: 3em; line-height: 1.5;
  display: flex; align-items: center; justify-content: center;
  margin-top: .5rem; font-size: .8rem; color: var(--cream);
}
.splash .btn { width: 100%; max-width: 22rem; background: var(--petrol); border-color: var(--petrol-light); color: #fff; }
.splash .btn:hover { background: #12707a; }

@media (min-width: 768px) {
  .splash-inner { width: min(100%, 44rem); }
  .splash-row {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: start; gap: 2.5rem; margin-bottom: 1.5rem;
  }
  .splash-row .splash-shield { width: 120px; height: 120px; margin: 0; }
  .splash-row .org-logo { height: 120px; }
  .splash-row .org-logo img { width: 88px; height: 88px; }
  .orgs-mobile { display: none; }
  .org-name { font-size: .9rem; }
  .splash .btn { width: auto; min-width: 16rem; }
}
@media (max-width: 767.98px) {
  .splash-row .org { display: none; }
}

/* ==========================================================
   الرأس والتنقل
   ========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.header-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  min-height: 64px; padding-block: .5rem;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  color: #fff; text-decoration: none; min-width: 0;
}
.brand img { width: 42px; height: 42px; flex: none; }
.brand-name {
  font-weight: 800; font-size: 1.05rem; line-height: 1.3;
  /* الاسم كاملًا دائمًا: يلتف إلى سطرين بدل أن يُقص */
  white-space: normal; overflow: visible;
}
.brand:hover { color: var(--yellow); }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  flex: none; min-width: 48px; min-height: 48px; padding: 0 .75rem;
  background: transparent; color: #fff; font: inherit; font-size: .9rem; font-weight: 700;
  border: 1.5px solid rgba(255, 255, 255, .35); border-radius: 10px; cursor: pointer;
}
.nav-toggle:hover { border-color: #fff; }
.nav-toggle .bars { width: 20px; height: 14px; position: relative; }
.nav-toggle .bars span {
  position: absolute; inset-inline: 0; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle .bars span:nth-child(1) { top: 0; }
.nav-toggle .bars span:nth-child(2) { top: 6px; }
.nav-toggle .bars span:nth-child(3) { top: 12px; }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; color: #e7f0ef; text-decoration: none; font-weight: 700; font-size: .95rem;
  padding: .7rem 1rem; border-radius: 8px; line-height: 1.5;
}
.site-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.site-nav a[aria-current="page"] { color: var(--navy); background: var(--yellow); }
.site-nav .num { opacity: .7; font-weight: 400; margin-inline-end: .35rem; }
.site-nav .nav-exit a {
  border: 1.5px solid rgba(255, 255, 255, .32);
  color: #fff;
}
.site-nav .nav-exit a:hover {
  background: rgba(255, 255, 255, .14);
  border-color: var(--yellow);
  color: var(--yellow);
}

@media (max-width: 1023.98px) {
  .site-nav {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding: .5rem 0 1rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav .nav-exit { margin-top: .45rem; }
  .site-nav .nav-exit a { text-align: center; }
}
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .header-bar { flex-wrap: nowrap; }
  .site-nav { display: block !important; }
  .site-nav ul { display: flex; align-items: center; gap: .15rem; }
  .site-nav a { padding: .45rem .65rem; font-size: .88rem; white-space: nowrap; }
  .site-nav .nav-exit { margin-inline-start: .35rem; }
  .site-nav .num { display: none; }
  .header-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
}

/* ==========================================================
   الرئيسية
   ========================================================== */
.hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--cream); padding: 3rem 0 3.5rem;
}
.hero h1 { color: #fff; }
.hero p { font-size: 1.15rem; max-width: 40rem; color: #dbe8e7; }
.hero .btn { margin-top: .5rem; }

.section { padding: 3rem 0; }
.section-title { margin-top: 0; }

.lesson-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1rem; grid-template-columns: 1fr;
}
@media (min-width: 768px) { .lesson-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .lesson-grid { grid-template-columns: repeat(3, 1fr); } }

.lesson-card {
  position: relative; height: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.1rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .4rem;
  transition: border-color .15s, transform .15s;
}
.lesson-card:hover { border-color: var(--petrol); transform: translateY(-2px); }
.lesson-card:focus-within { border-color: var(--petrol); }
.lesson-card h3 { margin: 0; font-size: 1.2rem; }
.lesson-card h3 a { color: var(--navy); text-decoration: none; }
.lesson-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.lesson-card p { margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.75; }
.lesson-card .go { margin-top: auto; padding-top: .4rem; font-weight: 700; color: var(--petrol); font-size: .95rem; }

.badge {
  display: inline-block; align-self: flex-start;
  font-size: .78rem; font-weight: 700; line-height: 1;
  color: var(--petrol); background: var(--info-bg);
  padding: .4rem .65rem; border-radius: 999px;
}

.rules {
  background: var(--ivory); border-radius: var(--radius); padding: 1.5rem;
}
.rules h2 { margin-top: 0; }
.rules ol {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: .75rem; grid-template-columns: 1fr;
  counter-reset: rule;
}
@media (min-width: 768px) { .rules ol { grid-template-columns: repeat(4, 1fr); } }
.rules li {
  counter-increment: rule; margin: 0;
  background: #fff; border-radius: 10px; padding: .9rem 1rem;
  border-inline-start: 4px solid var(--petrol);
  font-weight: 700; color: var(--navy); line-height: 1.6;
}
.rules li::before {
  content: counter(rule); display: inline-grid; place-items: center;
  width: 1.7em; height: 1.7em; margin-inline-end: .5rem; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: .85em;
}

/* ==========================================================
   صفحة الدرس
   ========================================================== */
.lesson-head { background: var(--ivory); padding: 2rem 0 1.75rem; border-bottom: 1px solid var(--line); }
.lesson-head h1 { margin: .5rem 0 0; }
.breadcrumb { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .5rem; }
.breadcrumb a { color: var(--ink-soft); }

.lesson-layout { display: grid; gap: 2rem; padding: 2rem 0 3rem; }
@media (min-width: 1024px) {
  .lesson-layout { grid-template-columns: 16rem minmax(0, 1fr); gap: 3rem; align-items: start; }
  .lesson-aside { position: sticky; top: 88px; }
  .toc-mobile { display: none; }
}
@media (max-width: 1023.98px) { .lesson-aside { display: none; } }

.lesson-body { max-width: var(--content); }
.lesson-body > h2:first-of-type { margin-top: 1.5em; }

.toc { font-size: .95rem; }
.toc-title { font-weight: 800; color: var(--navy); margin: 0 0 .5rem; font-size: 1rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--line); }
.toc li { margin: 0; }
.toc a {
  display: block; padding: .35rem .9rem; color: var(--ink-soft); text-decoration: none;
  border-inline-start: 2px solid transparent; margin-inline-start: -2px; line-height: 1.6;
}
.toc a:hover { color: var(--petrol); }
.toc a.is-active { color: var(--petrol); border-inline-start-color: var(--petrol); font-weight: 700; }

.toc-mobile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  margin: 0 0 1.5rem;
}
.toc-mobile summary {
  cursor: pointer; list-style: none; padding: .8rem 1rem; min-height: 48px;
  font-weight: 700; color: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary .chev { width: 18px; height: 18px; transition: transform .2s; }
.toc-mobile[open] summary .chev { transform: rotate(180deg); }
.toc-mobile .toc { padding: 0 1rem 1rem; }

/* ---------- الصناديق ---------- */
.box {
  border-radius: var(--radius); padding: 1rem 1.15rem; margin: 1.5rem 0;
  border-inline-start: 5px solid; background: #fff;
}
.box > :last-child { margin-bottom: 0; }
.box-label {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 800; margin-bottom: .35rem; font-size: 1rem;
}
.box-label svg { width: 22px; height: 22px; flex: none; }
.box-goal { background: var(--info-bg); border-color: var(--petrol); }
.box-goal .box-label { color: var(--petrol); }
.box-info { background: var(--info-bg); border-color: var(--petrol); }
.box-info .box-label { color: var(--petrol); }
.box-warn { background: var(--warn-bg); border-color: var(--yellow); }
.box-warn .box-label { color: #6b5200; }
.box-danger { background: var(--red-bg); border-color: var(--red); }
.box-danger .box-label { color: var(--red); }
.box-team { background: var(--ivory); border-color: var(--navy); }
.box-team .box-label { color: var(--navy); }
.box-supp { background: #fff; border: 1px dashed var(--petrol-light); border-inline-start: 5px solid var(--petrol-light); }
.box-supp .box-label { color: var(--petrol); }
.box-supp .source { font-size: .88rem; color: var(--ink-soft); margin-top: .5rem; }

.summary-box { background: var(--navy); color: var(--cream); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin-top: 2.5rem; }
.summary-box h2 { color: #fff; margin-top: 0; }
.summary-box li::marker { color: var(--yellow); }
.summary-box strong { color: #fff; }

.role-list { list-style: none; padding: 0; display: grid; gap: .65rem; }
@media (min-width: 640px) { .role-list { grid-template-columns: 1fr 1fr; } }
.role-list li {
  margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem 1rem; line-height: 1.7; font-size: 1rem;
}
.role-list strong { display: block; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
  counter-increment: step; position: relative;
  padding-inline-start: 2.75rem; margin-bottom: 1rem;
}
.steps > li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: .15rem;
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--petrol); color: #fff; font-weight: 700; font-size: .95rem;
}

.cat-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 1rem; background: #fff; }
.cat-table th, .cat-table td { text-align: start; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.7; }
.cat-table th { background: var(--navy); color: #fff; font-weight: 700; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.table-wrap .cat-table { margin: 0; }

.sources { font-size: .9rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2rem; }

/* ---------- السابق والتالي ---------- */
.pager {
  display: grid; gap: .75rem; grid-template-columns: 1fr 1fr;
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.pager a {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; text-decoration: none; color: var(--navy); line-height: 1.5;
}
.pager a:hover { border-color: var(--petrol); }
.pager small { color: var(--ink-soft); font-size: .82rem; }
.pager strong { font-size: .98rem; }
.pager .next { text-align: end; grid-column: 2; }
.pager .prev { grid-column: 1; }

/* ==========================================================
   المحاكاة
   ========================================================== */
.sim {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden; margin: 1.5rem 0;
}
.sim-head {
  background: var(--navy); color: #fff; padding: .9rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.sim-head .role { font-size: .9rem; color: #cfe3e2; }
.sim-progress { display: flex; gap: .35rem; }
.sim-progress span { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); }
.sim-progress span.done { background: var(--petrol-light); }
.sim-progress span.current { background: var(--yellow); }
.sim-body { padding: 1.25rem 1.2rem 1.5rem; }
.sim-step-label { font-size: .85rem; font-weight: 700; color: var(--petrol); margin: 0 0 .2rem; }
.sim-body h3 { margin: 0 0 .6rem; }
.sim-scene { background: var(--cream); border-radius: 10px; padding: .9rem 1rem; margin-bottom: 1rem; }
.sim-options { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.sim-options li { margin: 0; }
.sim-option {
  width: 100%; text-align: start; font: inherit; font-size: 1.02rem; line-height: 1.65;
  min-height: 52px; padding: .75rem 1rem; cursor: pointer;
  background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 10px;
  display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: flex-start;
}
.sim-option .txt { flex: 1 1 12rem; min-width: 0; }
.sim-option:hover:not([disabled]) { border-color: var(--petrol); }
.sim-option .letter {
  flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--ivory); font-weight: 700; font-size: .9rem;
}
.sim-option[disabled] { cursor: default; }
.sim-option.is-correct { border-color: var(--petrol); background: var(--info-bg); }
.sim-option.is-correct .letter { background: var(--petrol); color: #fff; }
.sim-option.is-wrong { border-color: var(--red); background: var(--red-bg); }
.sim-option.is-wrong .letter { background: var(--red); color: #fff; }
.sim-option .tag { margin-inline-start: auto; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.sim-option.is-correct .tag { color: var(--petrol); }
.sim-option.is-wrong .tag { color: var(--red); }

.sim-feedback { border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; border-inline-start: 5px solid; }
.sim-feedback.ok { background: var(--info-bg); border-color: var(--petrol); }
.sim-feedback.no { background: var(--red-bg); border-color: var(--red); }
.sim-feedback .verdict { font-weight: 800; margin-bottom: .25rem; }
.sim-feedback.ok .verdict { color: var(--petrol); }
.sim-feedback.no .verdict { color: var(--red); }
.sim-feedback p:last-child { margin-bottom: 0; }

.sim-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.order-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.order-list li {
  margin: 0; display: flex; align-items: center; gap: .6rem;
  background: var(--cream); border: 2px solid var(--line); border-radius: 10px; padding: .5rem .75rem;
}
.order-list li .pos {
  flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 700; font-size: .9rem;
}
.order-list li .txt { flex: 1; font-weight: 700; color: var(--navy); line-height: 1.5; }
.order-list li .mv { display: flex; gap: .3rem; }
.order-list li .mv button {
  width: 44px; height: 44px; border-radius: 8px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--navy);
}
.order-list li .mv button:hover:not([disabled]) { border-color: var(--petrol); }
.order-list li .mv button[disabled] { opacity: .35; cursor: default; }
.order-list li .mv svg { width: 18px; height: 18px; }
.order-list.checked li.ok { border-color: var(--petrol); background: var(--info-bg); }
.order-list.checked li.bad { border-color: var(--red); background: var(--red-bg); }

.sim-result { text-align: center; padding: .5rem 0 1rem; }
.sim-result .score { font-size: 2.4rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.sim-result ul { text-align: start; }

.noscript-note { background: var(--warn-bg); padding: 1rem; border-radius: 10px; }

/* ==========================================================
   التذييل
   ========================================================== */
.site-footer { background: var(--navy); color: #cfe3e2; padding: 2rem 0 1.5rem; font-size: .95rem; margin-top: 2rem; }
.footer-orgs { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; margin-bottom: 1rem; }
.footer-orgs .label { font-weight: 700; color: #fff; }
.footer-org { display: flex; align-items: center; gap: .6rem; color: #e7f0ef; }
.footer-org img { width: 44px; height: 44px; object-fit: contain; }
.footer-note { font-size: .85rem; color: #a9c4c3; margin: 0; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 1rem; }

@media print {
  .site-header, .site-footer, .pager, .toc-mobile, .lesson-aside, .skip-link { display: none !important; }
  body { background: #fff; font-size: 12pt; }
}

/* اسم الدورة في الرأس على الشاشات الضيقة: سطران مقصودان بدل التفاف عشوائي */
@media (max-width: 559.98px) {
  .brand-name .l1, .brand-name .l2 { display: block; }
  .brand-name { font-size: 1rem; line-height: 1.35; }
}

/* حتى لا يغطي الرأس الثابت العناوين عند الانتقال إليها */
section[id], .box[id], .sim, [id$="-h"] { scroll-margin-top: 96px; }

.sources p { margin-bottom: .4rem; }
.sources ul { margin: 0; padding-inline-start: 1.2em; }
.sources li { margin-bottom: .3rem; line-height: 1.7; }

/* يمنع الجداول العريضة من توسيع عمود الدرس على الجوال؛ الجدول يُمرَّر داخل إطاره */
.lesson-layout { grid-template-columns: minmax(0, 1fr); }
.lesson-body { min-width: 0; }
@media (min-width: 1024px) {
  .lesson-layout { grid-template-columns: 16rem minmax(0, 1fr); }
}

/* بطاقات فئات الحساسية */
.cat-cards { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1rem 0 1.5rem; }
@media (min-width: 900px) { .cat-cards { grid-template-columns: repeat(3, 1fr); } }
.cat-card { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--petrol); border-radius: var(--radius); padding: 1rem 1.1rem; font-size: 1rem; }
.cat-card h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.cat-card p { margin: 0 0 .5rem; line-height: 1.75; }
.cat-card ul { margin: 0 0 .6rem; }
.cat-card li { margin-bottom: .2rem; }

/* ---------- بطاقات الأجهزة (الدرس 2) ---------- */
.device-grid {
  display: grid; gap: 1rem; margin: 1rem 0 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}
.device-card {
  margin: 0; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.device-img {
  aspect-ratio: 4 / 3; background: #fff; display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line); padding: .5rem;
}
.device-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.device-card figcaption { display: flex; flex-direction: column; gap: .4rem; padding: .85rem 1rem 1rem; flex: 1; }
.device-name { font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.device-role { font-size: .98rem; line-height: 1.7; color: var(--ink-soft); }
.btn-doc {
  margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .5rem 1rem; border-radius: 10px;
  background: var(--petrol); color: #fff; font-weight: 700; font-size: 1rem; text-decoration: none; text-align: center;
  transition: background-color .15s;
}
.btn-doc:hover, .btn-doc:focus-visible { background: var(--navy); color: #fff; }
.btn-doc:focus-visible { outline: 3px solid var(--petrol-light); outline-offset: 2px; }
.device-note {
  margin: auto 0 0; padding: .5rem .75rem; font-size: .9rem; line-height: 1.6;
  background: var(--ivory); border-radius: 8px; color: var(--ink-soft);
}

/* ---------- بطاقات المراجع (صفحة المراجع) ---------- */
.ref-list { list-style: none; padding: 0; margin: .8rem 0 1.5rem; display: grid; gap: .85rem; }
.ref-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.15rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .45rem;
}
.ref-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem .75rem; }
.ref-title { font-size: 1.05rem; font-weight: 800; color: var(--navy); margin: 0; }
.ref-pages { font-size: .88rem; font-weight: 700; color: var(--petrol); background: #eef6f6; padding: .15rem .55rem; border-radius: 999px; }
.ref-pages.is-pub { background: #fff7e0; color: #7a5200; }
.ref-pages.is-restricted { background: #f3f4f6; color: #4b5563; }
.ref-meta { margin: 0; font-size: .94rem; line-height: 1.65; color: var(--ink-soft); }
.ref-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: .25rem; }
.ref-actions .btn-doc { margin-top: 0; font-size: .93rem; padding: .45rem .9rem; }
.ref-btn-note { font-size: .85rem; font-weight: 700; color: var(--petrol); background: #eef6f6; padding: .25rem .6rem; border-radius: 8px; }
.ref-btn-note.is-pub { background: #fff7e0; color: #7a5200; }
.btn-doc-outline {
  background: #fff; color: var(--petrol); border: 1.5px solid var(--petrol);
}
.btn-doc-outline:hover, .btn-doc-outline:focus-visible { background: var(--petrol); color: #fff; }

/* ==========================================================
   تحديث صفحة الدخول والصفحة الرئيسية
   ========================================================== */
.splash-v2 {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(15, 94, 102, .45), transparent 65%),
    var(--navy);
  color: var(--cream);
  display: flex;
  flex-direction: column;
}
.orgs-bar {
  background: transparent;
  border: 0;
  padding: 1.15rem 1rem 1.35rem;
}
.orgs-bar .orgs {
  width: min(100%, 24rem);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
  text-align: center;
}
.orgs-bar .org {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.orgs-bar .org-logo {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orgs-bar .org-logo img {
  max-height: 50px;
  max-width: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.orgs-bar .org-name {
  height: 2.9em;
  line-height: 1.45;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: .35rem;
  font-family: var(--font);
  font-size: .76rem;
  font-weight: 700;
  color: var(--cream);
}
.splash-panel {
  padding: 0 1.25rem 1.45rem;
  text-align: center;
  background: transparent;
}
.splash-content {
  width: min(100%, 26.5rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.splash-v2 .splash-shield {
  width: 68px;
  height: 68px;
  margin: 0 0 .55rem;
}
.splash-v2 .splash-sub {
  margin: 0 0 .35rem;
  font-size: .95rem;
  font-weight: 700;
  color: #cfe3e2;
  letter-spacing: .01em;
}
.splash-v2 h1 {
  color: #fff;
  font-size: clamp(1.55rem, 1.2rem + 1.8vw, 2.4rem);
  line-height: 1.3;
  margin: 0 0 1rem;
}
.splash-v2 h1 .l1,
.splash-v2 h1 .l2 {
  display: block;
  white-space: nowrap;
}
.splash-v2 .btn-enter {
  width: 100%;
  max-width: 19rem;
  background: var(--petrol);
  border-color: var(--petrol-light);
  color: #fff;
}
.splash-v2 .btn-enter:hover { background: #12707a; }
.designer-credit {
  margin: .9rem 0 0;
  font-size: .85rem;
  line-height: 1.6;
  color: #b7d2d1;
  text-align: center;
}
.designer-credit .credit-label { display: block; }
.designer-credit .credit-name {
  display: inline-block;
  white-space: nowrap;
  color: #e7f0ef;
  font-weight: 700;
}
.splash-photo-mobile {
  width: 100%;
  flex: 1;
  min-height: 190px;
  max-height: 320px;
  overflow: hidden;
}
.splash-photo-mobile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

@media (min-width: 768px) {
  .splash-v2 {
    position: relative;
    justify-content: center;
    background-image:
      linear-gradient(to left, rgba(10, 46, 59, .96) 0%, rgba(10, 46, 59, .91) 34%, rgba(10, 46, 59, .54) 58%, rgba(10, 46, 59, .14) 100%),
      url('../img/hero-field.jpg');
    background-size: cover;
    background-position: left center;
    padding: 2rem 2.5rem;
  }
  .orgs-bar {
    position: absolute;
    top: 1.5rem;
    left: 2rem;
    z-index: 2;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 46, 59, .88);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    padding: .85rem 1.35rem;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
  }
  .orgs-bar .orgs {
    width: auto;
    margin: 0;
    grid-template-columns: minmax(7.5rem, 1fr) minmax(7.5rem, 1fr);
    gap: 1.35rem;
  }
  .orgs-bar .org-logo { height: 52px; }
  .orgs-bar .org-logo img { max-height: 52px; max-width: 74px; }
  .orgs-bar .org-name { font-size: .78rem; margin: .35rem 0 0; height: 2.9em; line-height: 1.45; }
  .splash-panel {
    padding: 0;
    width: min(100%, 72rem);
    margin-inline: auto;
  }
  .splash-content {
    margin-inline: 0;
    width: min(100%, 27rem);
  }
  .splash-v2 .splash-shield { width: 88px; height: 88px; margin-bottom: .7rem; }
  .splash-v2 .splash-sub { font-size: 1rem; margin-bottom: .4rem; }
  .splash-v2 h1 { margin-bottom: 1.35rem; }
  .splash-v2 .btn-enter { width: auto; min-width: 16.5rem; }
  .designer-credit { margin-top: 1.1rem; }
  .splash-photo-mobile { display: none; }
}

.hero-split {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--cream);
  padding: 2.25rem 0 2.75rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
}
.hero-text { max-width: 36rem; }
.hero-kicker {
  margin: 0 0 .3rem;
  font-size: .95rem;
  font-weight: 700;
  color: var(--yellow);
}
.hero-text h1 { color: #fff; margin-bottom: .55rem; }
.hero-text p:not(.hero-kicker) { font-size: 1.1rem; color: #dbe8e7; margin-bottom: 1.35rem; }
.hero-media { margin: 0; }
.hero-media img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.hero-media figcaption {
  margin-top: .55rem;
  font-size: .88rem;
  color: #cfe3e2;
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
    gap: 2.5rem;
  }
}

#progress-path { scroll-margin-top: 5.5rem; }
.narrow-wrap { max-width: 52rem; }
.progress-head {
  margin-bottom: 1.1rem;
}
.progress-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .4rem 1rem;
  margin-bottom: .6rem;
}
.progress-title-row .section-title {
  margin: 0;
}
.progress-summary {
  margin: 0;
  font-weight: 800;
  color: var(--petrol);
  font-size: 1rem;
}
.progress-track {
  width: 100%;
  height: 10px;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--petrol);
  border-radius: 999px;
  transition: width .25s ease;
}
.progress-note {
  margin: .45rem 0 0;
  font-size: .88rem;
  color: var(--ink-soft);
}
.progress-storage-error {
  margin: .55rem 0 0;
  padding: .6rem .85rem;
  border-radius: 8px;
  border: 1px solid #d78f89;
  background: var(--red-bg);
  color: var(--red);
  font-size: .9rem;
  font-weight: 700;
}
.lesson-map {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.lesson-station {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: .85rem;
  align-items: start;
  margin-bottom: 0;
}
.lesson-station:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: 20.5px;
  top: calc(.25rem + 44px + 6px);
  bottom: calc(-1rem - .25rem + 6px);
  width: 3px;
  background: var(--line);
  border-radius: 999px;
}
.lesson-station.is-completed:not(:last-child)::after {
  background: #9ed0ad;
}
.station-node {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  margin-top: .25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--info-bg);
  border: 2px solid #b5d2d4;
  color: var(--petrol);
  box-shadow: 0 2px 6px rgba(10, 46, 59, .08);
}
.station-node svg {
  width: 22px;
  height: 22px;
}
.lesson-station.is-completed .station-node {
  background: #e6f4ea;
  border-color: #9ed0ad;
  color: #135e34;
}
.station-card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.station-card:focus-within {
  border-color: var(--petrol);
}
.lesson-station.is-completed .station-card {
  border-color: #9ed0ad;
  background: #f9fdf9;
}
.station-card .row-num {
  align-self: flex-start;
  font-size: .84rem;
  font-weight: 800;
  color: var(--petrol);
  background: var(--info-bg);
  padding: .15rem .65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.lesson-station.is-completed .station-card .row-num {
  background: #e6f4ea;
  color: #135e34;
}
.station-card h3 {
  margin: .1rem 0 0;
  font-size: 1.08rem;
  line-height: 1.45;
}
.station-card h3 a {
  display: inline-block;
  padding: .15rem 0;
  color: var(--navy);
  text-decoration: none;
  overflow-wrap: break-word;
}
.station-card h3 a:hover {
  color: var(--petrol);
  text-decoration: underline;
}
.station-goal {
  margin: 0;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.6;
}
.station-footer {
  margin-top: .35rem;
  padding-top: .45rem;
  border-top: 1px solid var(--ivory);
  display: flex;
  flex-wrap: wrap;
}
.lesson-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
  max-width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
}
.lesson-status .status-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.lesson-status.is-done {
  background: #e6f4ea;
  border-color: #9ed0ad;
  color: #135e34;
}
@media (min-width: 1024px) {
  .lesson-map {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
  }
  .lesson-station {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .lesson-station:not(:last-child)::after {
    inset-inline-start: calc(50% + 34px);
    top: 26.5px;
    bottom: auto;
    width: calc(100% + 1rem - 68px);
    height: 3px;
  }
  .station-node {
    width: 56px;
    height: 56px;
    margin: 0 auto .85rem;
  }
  .station-node svg {
    width: 26px;
    height: 26px;
  }
  .station-card {
    flex: 1;
    padding: 1rem .95rem;
  }
  .station-footer {
    margin-top: auto;
    padding-top: .65rem;
  }
}

/* ---------- زر إكمال الدرس داخل الدروس ---------- */
.lesson-complete-box {
  margin-top: 2rem;
  padding: 1.15rem 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--petrol);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 1.25rem;
}
.lesson-complete-box.is-completed {
  border-inline-start-color: #1e7e46;
  background: #f6fbf7;
}
.lesson-complete-info {
  flex: 1 1 16rem;
  min-width: 0;
}
.lesson-complete-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 800;
  padding: .2rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink-soft);
}
.lesson-complete-badge .status-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.lesson-complete-badge.is-done {
  background: #e6f4ea;
  border-color: #9ed0ad;
  color: #135e34;
}
.lesson-complete-msg {
  margin: .45rem 0 0;
  font-size: .95rem;
  color: var(--ink);
  font-weight: 600;
}
.lesson-complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.lesson-complete-error {
  flex-basis: 100%;
  margin: 0;
  padding: .5rem .75rem;
  border-radius: 8px;
  border: 1px solid #d78f89;
  background: var(--red-bg);
  color: var(--red);
  font-size: .88rem;
  font-weight: 700;
}

.sim-promo {
  background: #fff;
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--yellow);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
}
.sim-promo h2 { margin: 0 0 .45rem; font-size: 1.35rem; }
.sim-promo p { margin: 0 0 1rem; color: var(--ink); }

.rules-strip {
  margin-top: 1.25rem;
  background: var(--navy);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.rules-strip h3 {
  color: var(--yellow);
  font-size: 1rem;
  margin: 0 0 .65rem;
}
.rules-strip ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
  gap: .5rem .85rem;
  counter-reset: rule;
}
.rules-strip li {
  counter-increment: rule;
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: #fff;
}
.rules-strip li::before {
  content: counter(rule);
  flex: none;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  font-size: .82rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.refs-strip {
  margin-top: 1.25rem;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
}
.refs-strip h3 { margin: 0 0 .15rem; font-size: 1.1rem; }
.refs-strip p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

.footer-designer {
  margin: .75rem 0 0;
  font-size: .85rem;
  line-height: 1.6;
  color: #cfe3e2;
  text-align: center;
}
.footer-designer .credit-label { display: block; }
.footer-designer .credit-name { display: inline-block; white-space: nowrap; color: #fff; font-weight: 700; }
@media (min-width: 560px) {
  .footer-designer { text-align: start; }
  .footer-designer .credit-label { display: inline; }
  .footer-designer .credit-label::after { content: " — "; }
}

/* ==========================================================
   أزرار المتابعة في الرئيسية + المراجعة التفاعلية + بحث المراجع
   ========================================================== */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .75rem;
}
.btn-resume {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border-color: var(--yellow);
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  padding: .55rem 1.15rem;
  text-align: start;
}
.btn-resume:hover {
  background: var(--yellow);
  color: var(--navy);
}
.btn-resume .resume-label {
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.3;
}
.btn-resume .resume-lesson {
  font-size: .82rem;
  font-weight: 700;
  opacity: .92;
  line-height: 1.4;
}

/* المراجعة التفاعلية في الدرسين 1 و2 */
.quiz-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 94, 102, .22);
}
.quiz-question {
  margin-bottom: .75rem;
}
.quiz-options {
  display: grid;
  gap: .55rem;
  margin-bottom: .85rem;
}
.quiz-option {
  width: 100%;
  min-height: 48px;
  padding: .65rem .95rem;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
  text-align: start;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  transition: border-color .15s, background-color .15s;
}
.quiz-option:hover:not([disabled]) {
  border-color: var(--petrol);
  background: #f7fbfb;
}
.quiz-option[disabled] {
  cursor: default;
}
.quiz-option.is-correct {
  border-color: var(--petrol);
  background: #d9eeee;
  color: var(--navy);
}
.quiz-option.is-wrong {
  border-color: var(--red);
  background: var(--red-bg);
  color: var(--red);
}
.quiz-tag {
  font-size: .82rem;
  font-weight: 800;
  padding: .15rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.quiz-option.is-correct .quiz-tag {
  background: var(--petrol);
  color: #fff;
}
.quiz-option.is-wrong .quiz-tag {
  background: var(--red);
  color: #fff;
}
.quiz-feedback {
  background: #fff;
  border-radius: 10px;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--petrol);
  margin-bottom: .5rem;
}
.quiz-feedback.ok {
  border-inline-start-color: var(--petrol);
}
.quiz-feedback.no {
  border-inline-start-color: var(--red);
}
.quiz-verdict {
  font-weight: 800;
  margin-bottom: .3rem;
}
.quiz-feedback.ok .quiz-verdict { color: var(--petrol); }
.quiz-feedback.no .quiz-verdict { color: var(--red); }
.quiz-explain {
  margin-bottom: .8rem;
}
.quiz-retry {
  min-height: 44px;
  padding: .4rem 1rem;
  font-size: .95rem;
}

/* البحث في صفحة المراجع */
.ref-search {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0 1.5rem;
  box-shadow: var(--shadow);
}
.ref-search-label {
  display: block;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: .5rem;
}
.ref-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: stretch;
}
.ref-search-input {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 48px;
  padding: .55rem .9rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
}
.ref-search-input:focus {
  outline: none;
  border-color: var(--petrol);
  background: #fff;
}
.ref-search-clear,
.ref-empty-clear {
  min-height: 48px;
  padding: .45rem 1rem;
  font-size: .95rem;
}
.ref-search-status {
  margin: .55rem 0 0;
  font-size: .9rem;
  font-weight: 700;
  color: var(--petrol);
  min-height: 1.3em;
}
.ref-search-status:empty {
  display: none;
}
.ref-empty p {
  margin-bottom: .8rem;
  font-weight: 700;
}

/* ==========================================================
   اقرأ شاشة الكاشف (الدرس الثاني)
   ========================================================== */
.reader-widget {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-block: 1.5rem 2rem;
  scroll-margin-top: 88px;
}

.dev-btn, #reader-stage, .unit-btn {
  scroll-margin-top: 88px;
}

.reader-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.reader-head h3 {
  margin: 0;
  font-size: clamp(1.2rem, 1.05rem + .7vw, 1.5rem);
  color: var(--navy);
}
.edu-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--warn-bg);
  color: var(--navy);
  border: 1.5px solid var(--yellow);
  font-size: .85rem;
  font-weight: 800;
  padding: .25rem .75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.selector-groups {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.selector-group-label {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0 0 .35rem;
}
.selector-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.dev-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  padding: .45rem .85rem;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.dev-btn:hover {
  border-color: var(--petrol);
  background: var(--info-bg);
}
.dev-btn[aria-selected="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.dev-btn.is-generic {
  background: var(--info-bg);
  border-color: var(--petrol);
  color: var(--petrol);
}
.dev-btn.is-generic[aria-selected="true"] {
  background: var(--petrol);
  color: #fff;
  border-color: var(--petrol);
}
.dev-btn .tag {
  font-size: .75rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 6px;
  background: rgba(15, 94, 102, .12);
  color: var(--petrol);
}
.dev-btn[aria-selected="true"] .tag {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.reader-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 768px) {
  .reader-grid {
    grid-template-columns: minmax(220px, 290px) 1fr;
    gap: 1.4rem;
  }
}

.device-visual {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.device-visual-img {
  background: #fff;
  border-radius: 8px;
  padding: .5rem;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  max-height: 240px;
  overflow: hidden;
}
.device-visual-img img {
  max-height: 220px;
  width: auto;
  object-fit: contain;
}
.device-visual h4 {
  margin: 0 0 .25rem;
  font-size: 1.15rem;
  color: var(--navy);
}
.device-kind {
  display: inline-block;
  font-size: .82rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: var(--info-bg);
  color: var(--petrol);
  margin-bottom: .5rem;
}
.device-host {
  font-size: .88rem;
  color: var(--navy);
  background: var(--ivory);
  border-radius: 8px;
  padding: .45rem .65rem;
  margin: .4rem 0 0;
}
.device-brief {
  font-size: .95rem;
  color: var(--ink);
  margin: .6rem 0 0;
  text-align: start;
}

.reading-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.sim-screen {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  border: 2px solid var(--navy-2);
}
.sim-screen-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  font-size: .82rem;
  color: #cfe3e2;
}
.sim-edu-tag {
  background: var(--yellow);
  color: var(--navy);
  font-weight: 800;
  padding: .1rem .5rem;
  border-radius: 6px;
  font-size: .78rem;
}
.sim-readout {
  background: #072029;
  border: 1px solid rgba(95, 169, 173, .35);
  border-radius: 10px;
  padding: .9rem 1rem;
  margin-bottom: .75rem;
}
.sim-value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
}
.sim-main-num {
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: .02em;
  direction: ltr;
  unicode-bidi: isolate;
}
.sim-sub-label {
  font-size: .88rem;
  color: #cfe3e2;
}
.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .5rem;
}
.sim-ctrl-btn {
  min-height: 44px;
  padding: .35rem .75rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, .35);
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.sim-ctrl-btn:hover { border-color: var(--yellow); }
.sim-ctrl-btn[aria-pressed="true"] {
  background: var(--petrol);
  border-color: var(--yellow);
  color: #fff;
}

.led-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: .6rem;
}
.led-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.led-row-label {
  min-width: 72px;
  font-size: .85rem;
  font-weight: 700;
  color: #cfe3e2;
}
.led-dots {
  display: flex;
  gap: 5px;
  direction: ltr;
}
.led-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
}
.led-dot.on-orange { background: #f59e0b; border-color: #fde68a; box-shadow: 0 0 8px rgba(245, 158, 11, .7); }
.led-dot.on-blue { background: #38bdf8; border-color: #bae6fd; box-shadow: 0 0 8px rgba(56, 189, 248, .7); }
.led-dot.on-red { background: #ef4444; border-color: #fecaca; box-shadow: 0 0 8px rgba(239, 68, 68, .7); }
.led-dot.on-green { background: #22c55e; border-color: #bbf7d0; box-shadow: 0 0 8px rgba(34, 197, 94, .7); }

.bar-zones {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  direction: ltr;
  margin-block: .5rem;
}
.bar-seg {
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .12);
}
.bar-seg.g.on { background: #22c55e; }
.bar-seg.y.on { background: #eab308; }
.bar-seg.r.on { background: #ef4444; }

.indicators-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .55rem;
}
.indicators-list li {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .6rem .85rem;
  margin: 0;
  font-size: .95rem;
}
.ind-title {
  font-weight: 800;
  color: var(--navy);
  margin-bottom: .15rem;
}

.doc-note {
  background: var(--warn-bg);
  border-inline-start: 4px solid var(--yellow);
  border-radius: 8px;
  padding: .75rem .95rem;
  font-size: .94rem;
}

.source-box {
  background: var(--ivory);
  border-radius: 8px;
  padding: .75rem .95rem;
  font-size: .88rem;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.source-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.unit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}
.unit-btn {
  min-height: 46px;
  padding: .5rem 1rem;
  font: inherit;
  font-size: .98rem;
  font-weight: 800;
  border-radius: 10px;
  border: 1.5px solid var(--petrol);
  background: #fff;
  color: var(--petrol);
  cursor: pointer;
}
.unit-btn:hover { background: var(--info-bg); }
.unit-btn[aria-pressed="true"] {
  background: var(--petrol);
  color: #fff;
}

.generic-card {
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.generic-card h4 {
  margin-top: 0;
  color: var(--navy);
}
.toggle-pair {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-block: .5rem;
}
.toggle-pair button {
  min-height: 44px;
  padding: .4rem .9rem;
  font: inherit;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid var(--petrol);
  background: #fff;
  color: var(--petrol);
  cursor: pointer;
}
.toggle-pair button[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.highlight-reading {
  background: var(--navy);
  color: #fff;
  padding: .75rem 1rem;
  border-radius: 10px;
  margin-block: .6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.highlight-reading .val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--yellow);
}

/* ==========================================================
   تمرين «ماذا تعرف فعلًا؟» (الدرس الثاني)
   ========================================================== */
.wyk-widget {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-block: 1.25rem 2rem;
  scroll-margin-top: 88px;
}
.wyk-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .9rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
.wyk-progress {
  display: inline-flex;
  align-items: center;
  background: var(--info-bg);
  color: var(--petrol);
  font-weight: 800;
  font-size: .9rem;
  padding: .25rem .75rem;
  border-radius: 999px;
}
.wyk-scenario {
  background: var(--cream);
  border-inline-start: 4px solid var(--petrol);
  border-radius: 8px;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  font-size: .98rem;
}
.wyk-scenario-label {
  display: block;
  font-size: .85rem;
  font-weight: 800;
  color: var(--petrol);
  margin-bottom: .25rem;
}
.wyk-statement {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem);
  font-weight: 700;
  line-height: 1.65;
}
.wyk-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
  margin-bottom: .9rem;
}
@media (min-width: 600px) {
  .wyk-choices {
    grid-template-columns: 1fr 1fr;
  }
}
.wyk-choice-btn {
  min-height: 52px;
  padding: .65rem 1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--cream);
  border: 2px solid var(--petrol);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  line-height: 1.45;
  transition: background-color .15s, color .15s, border-color .15s;
}
.wyk-choice-btn:hover:not(:disabled) {
  background: var(--info-bg);
}
.wyk-choice-btn:disabled {
  cursor: default;
}
.wyk-choice-btn.is-right {
  background: #e6f4ea;
  border-color: #1e7e34;
  color: #135323;
}
.wyk-choice-btn.is-wrong {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}
.wyk-choice-btn.is-selected {
  box-shadow: inset 0 0 0 1px currentColor;
}
.wyk-feedback {
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: .9rem;
  border: 1.5px solid var(--line);
  background: var(--cream);
}
.wyk-feedback.is-ok {
  background: #e6f4ea;
  border-color: #1e7e34;
}
.wyk-feedback.is-err {
  background: var(--red-bg);
  border-color: var(--red);
}
.wyk-verdict {
  margin: 0 0 .3rem;
  font-weight: 800;
  font-size: 1rem;
}
.wyk-feedback.is-ok .wyk-verdict { color: #135323; }
.wyk-feedback.is-err .wyk-verdict { color: var(--red); }
.wyk-explain {
  margin: 0;
  font-size: .96rem;
  color: var(--ink);
}
.wyk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.wyk-summary-score {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.wyk-score-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--yellow);
}
.wyk-summary-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: .55rem;
}
.wyk-summary-list li {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .9rem;
  margin: 0;
  font-size: .95rem;
}
.wyk-tag {
  display: inline-block;
  font-size: .82rem;
  font-weight: 800;
  padding: .1rem .55rem;
  border-radius: 999px;
  margin-inline-start: .35rem;
  background: var(--info-bg);
  color: var(--petrol);
}

/* شاشات Inspector 1000 الثلاث */
.insp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .65rem;
}
.insp-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
.insp-chart-wrap {
  background: #04161d;
  border: 1px solid rgba(95, 169, 173, .3);
  border-radius: 8px;
  padding: .65rem .75rem;
  margin-bottom: .6rem;
}
.insp-chart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
  align-items: center;
}
@media (min-width: 560px) {
  .insp-chart-layout.has-readout {
    grid-template-columns: 1fr auto;
  }
}
.insp-cps-box {
  background: #0a2e3b;
  border: 1px solid var(--petrol-light);
  border-radius: 8px;
  padding: .55rem .85rem;
  text-align: center;
}
.insp-cps-num {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--yellow);
  direction: ltr;
  unicode-bidi: isolate;
}
.insp-cps-label {
  display: block;
  font-size: .84rem;
  color: #cfe3e2;
  margin-top: .15rem;
}
.insp-svg {
  width: 100%;
  height: auto;
  display: block;
}
.insp-axis-html {
  font-size: .88rem;
  font-weight: 700;
  color: #cfe3e2;
  line-height: 1.4;
}
.insp-y-html {
  margin-bottom: .3rem;
  text-align: start;
}
.insp-x-html {
  margin-top: .3rem;
  text-align: center;
}
.insp-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(95, 169, 173, .35);
  margin-bottom: .6rem;
}
.insp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  color: #fff;
  background: #04161d;
}
.insp-table th, .insp-table td {
  padding: .5rem .65rem;
  text-align: start;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.insp-table th {
  background: #0a2e3b;
  color: var(--yellow);
  font-weight: 700;
  white-space: nowrap;
}
.insp-table tr:last-child td { border-bottom: 0; }

/* ==========================================================
   رسم «كيف يصبح المصدر يتيمًا؟» (الدرس الأول)
   ========================================================== */
.orphan-widget {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-block: 1.25rem 2rem;
  scroll-margin-top: 88px;
}
.orphan-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.15rem;
}
@media (min-width: 640px) {
  .orphan-start {
    flex-direction: row;
    justify-content: center;
    gap: .75rem;
  }
}
.orphan-node {
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: .65rem 1rem;
  font-weight: 700;
  font-size: .96rem;
  text-align: center;
  border: 2px solid var(--navy);
}
.orphan-node.is-disused {
  background: var(--info-bg);
  color: var(--navy);
  border-color: var(--petrol);
}
.orphan-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--petrol);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
}
@media (max-width: 639.98px) {
  .orphan-arrow { transform: rotate(-90deg); }
}
.orphan-paths {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (min-width: 768px) {
  .orphan-paths { grid-template-columns: 1fr 1fr; }
}
.orphan-path-card {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 1rem;
  border: 2px solid var(--line);
}
.orphan-path-card.is-controlled { border-style: solid; }
.orphan-path-card.is-lost { border-style: dashed; }
.orphan-path-card.is-active.is-controlled {
  border-color: var(--petrol);
  background: #f0f7f7;
}
.orphan-path-card.is-active.is-lost {
  border-color: var(--red);
  background: #fff7f6;
}
.orphan-path-btn {
  width: 100%;
  min-height: 50px;
  padding: .6rem .95rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  text-align: start;
  transition: background-color .15s, color .15s, border-color .15s;
}
.orphan-path-card.is-controlled .orphan-path-btn {
  background: #fff;
  color: var(--petrol);
  border: 2px solid var(--petrol);
}
.orphan-path-card.is-controlled .orphan-path-btn[aria-expanded="true"] {
  background: var(--petrol);
  color: #fff;
}
.orphan-path-card.is-lost .orphan-path-btn {
  background: #fff;
  color: var(--red);
  border: 2px dashed var(--red);
}
.orphan-path-card.is-lost .orphan-path-btn[aria-expanded="true"] {
  background: var(--red);
  color: #fff;
  border-style: solid;
}
.orphan-connector {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}
.orphan-path-card.is-controlled .orphan-connector { background: var(--petrol); }
.orphan-path-card.is-lost .orphan-connector {
  background: repeating-linear-gradient(90deg, var(--red) 0 10px, transparent 10px 18px);
}
.orphan-outcome {
  background: #fff;
  border-radius: 8px;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  font-size: .95rem;
}
.orphan-badge {
  display: inline-block;
  font-size: .82rem;
  font-weight: 800;
  padding: .15rem .6rem;
  border-radius: 999px;
  margin-bottom: .45rem;
}
.orphan-badge.ok { background: #e6f4ea; color: #135323; }
.orphan-badge.warn { background: var(--red-bg); color: var(--red); }
.orphan-note {
  background: var(--warn-bg);
  border-inline-start: 4px solid var(--yellow);
  border-radius: 8px;
  padding: .7rem .95rem;
  font-size: .94rem;
  margin-bottom: .9rem;
}
.orphan-refs {
  background: var(--ivory);
  border-radius: 8px;
  padding: .75rem .95rem;
  font-size: .88rem;
  color: var(--ink-soft);
  margin-bottom: 1.15rem;
}
.orphan-refs ul {
  margin: .35rem 0 0;
  padding-inline-start: 1.25rem;
}
.orphan-quiz {
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.orphan-quiz-opts {
  display: grid;
  grid-template-columns: 1fr;
  gap: .55rem;
  margin-bottom: .85rem;
}
@media (min-width: 600px) {
  .orphan-quiz-opts { grid-template-columns: 1fr 1fr; }
}
.orphan-quiz-opts .quiz-option {
  min-height: 48px;
  text-align: center;
}
.orphan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .75rem;
}


/* ==========================================================
   تمرين «كوّن بلاغك» ومراجعة القرارات داخل المحاكاة
   ========================================================== */
.report-lead { color: var(--ink-soft); margin-bottom: 1rem; }
.report-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .report-grid { grid-template-columns: repeat(2, 1fr); }
}

.report-card {
  width: 100%;
  min-height: 54px;
  text-align: start;
  font: inherit;
  font-size: .98rem;
  line-height: 1.55;
  padding: .8rem .95rem;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.report-card:hover { border-color: var(--petrol); }
.report-card[aria-pressed="true"] {
  border-color: var(--petrol);
  background: var(--info-bg);
  box-shadow: 0 0 0 1px var(--petrol);
}
.report-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
}
.report-card-title {
  font-size: .85rem;
  font-weight: 800;
  color: var(--petrol);
}
.report-card-check {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 6px;
  border: 2px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 800;
  color: transparent;
}
.report-card[aria-pressed="true"] .report-card-check {
  border-color: var(--petrol);
  background: var(--petrol);
  color: #fff;
}
.report-card-text {
  color: var(--ink);
  font-weight: 600;
}

.report-draft {
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-inline-start: 5px solid var(--navy);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.report-draft-label {
  font-size: .88rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: .35rem;
}
.report-draft-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink);
}
.report-draft-missing {
  margin: .65rem 0 0;
  padding: .55rem .8rem;
  border-radius: 8px;
  background: var(--warn-bg);
  border-inline-start: 4px solid #b78103;
  font-size: .94rem;
  font-weight: 700;
  color: #5c3d00;
}

.report-feedback {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.report-feedback-title {
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 .65rem;
  font-size: 1.02rem;
}
.report-eval-list {
  list-style: none;
  padding: 0;
  margin: 0 0 .85rem;
  display: grid;
  gap: .55rem;
}
.report-eval-item {
  border-radius: 10px;
  padding: .65rem .85rem;
  border-inline-start: 4px solid var(--line);
  background: var(--cream);
}
.report-eval-item.is-ok { background: var(--info-bg); border-color: var(--petrol); }
.report-eval-item.is-hearsay { background: #eef3f7; border-color: var(--navy); }
.report-eval-item.is-bad { background: var(--red-bg); border-color: var(--red); }
.report-eval-item.is-miss { background: var(--warn-bg); border-color: #b78103; }

.report-eval-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .6rem;
  margin-bottom: .2rem;
}
.report-eval-badge {
  display: inline-block;
  font-size: .8rem;
  font-weight: 800;
  padding: .1rem .55rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy);
}
.report-eval-item.is-ok .report-eval-badge { color: var(--petrol); border-color: var(--petrol); }
.report-eval-item.is-hearsay .report-eval-badge { color: var(--navy); border-color: var(--navy); }
.report-eval-item.is-bad .report-eval-badge { color: var(--red); border-color: var(--red); }
.report-eval-item.is-miss .report-eval-badge { color: #7a5200; border-color: #b78103; }

.report-eval-quote { font-weight: 700; color: var(--navy); }
.report-eval-why { margin: 0; font-size: .95rem; color: var(--ink); line-height: 1.65; }

.report-rule-note {
  background: var(--info-bg);
  border-radius: 10px;
  padding: .75rem .95rem;
  font-size: .95rem;
  color: var(--ink);
  margin: 0;
}

.sim-review-box {
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin: 1.15rem 0;
}
.sim-review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
}
.sim-review-head h4 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--navy);
}
.sim-review-pill {
  font-size: .8rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--navy);
  border: 1px solid var(--line);
}
.sim-review-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .5rem;
}
.sim-review-item {
  background: #fff;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--line);
  border-radius: 10px;
  padding: .6rem .85rem;
}
.sim-review-item.is-ok { border-inline-start-color: var(--petrol); }
.sim-review-item.is-warn { border-inline-start-color: #b78103; }
.sim-review-item.is-bad { border-inline-start-color: var(--red); }
.sim-review-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .6rem;
  margin-bottom: .2rem;
}
.sim-review-status {
  font-size: .8rem;
  font-weight: 800;
  padding: .08rem .5rem;
  border-radius: 999px;
}
.sim-review-item.is-ok .sim-review-status { background: var(--info-bg); color: var(--petrol); }
.sim-review-item.is-warn .sim-review-status { background: var(--warn-bg); color: #7a5200; }
.sim-review-item.is-bad .sim-review-status { background: var(--red-bg); color: var(--red); }
.sim-review-item p { margin: 0; font-size: .93rem; color: var(--ink-soft); line-height: 1.6; }


/* ==========================================================
   صفحة المساعدة وروابط التذييل
   ========================================================== */
.help-pdf-banner {
  background: var(--info-bg);
  border: 1.5px solid var(--petrol);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
}
.help-pdf-banner strong { display: block; color: var(--navy); font-size: 1.05rem; }
.help-pdf-banner p { margin: .15rem 0 0; font-size: .95rem; color: var(--ink-soft); }

.help-jump {
  display: grid;
  grid-template-columns: 1fr;
  gap: .6rem;
  margin: 1.25rem 0 1.5rem;
}
@media (min-width: 560px) {
  .help-jump { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .help-jump { grid-template-columns: repeat(3, 1fr); }
}
.help-jump-card {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .75rem .95rem;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.help-jump-card:hover { border-color: var(--petrol); color: var(--navy); }
.help-jump-card strong { color: var(--petrol); font-size: 1rem; }
.help-jump-card span { font-size: .88rem; color: var(--ink-soft); line-height: 1.45; }

.help-steps { padding-inline-start: 1.35rem; margin: 0 0 1rem; }
.help-steps li { margin-bottom: .65rem; }
.help-list { padding-inline-start: 1.35rem; margin: 0 0 1rem; }
.help-list li { margin-bottom: .55rem; }

.help-faq { display: grid; gap: .65rem; margin-top: .75rem; }
.help-faq details {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: .8rem 1rem;
}
.help-faq summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--navy);
  list-style-position: inside;
}
.help-faq details p { margin: .6rem 0 0; font-size: .98rem; color: var(--ink); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin-bottom: .9rem;
  padding-top: .25rem;
}
.footer-links a {
  color: #e7f0ef;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.footer-links a:hover,
.footer-links a[aria-current="page"] { color: var(--yellow); }

/* ==========================================================
   الاختبار الختامي «اختبر فهمك» + دعوة الاختبار في الدرس 5
   ========================================================== */
.lesson-quiz-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}
.lesson-quiz-cta-text { flex: 1 1 18rem; }
.lesson-quiz-cta-text h2 {
  margin: 0 0 .35rem;
  font-size: 1.2rem;
  color: var(--navy);
}
.lesson-quiz-cta-text p { margin: 0; font-size: 1rem; }

.fq-intro {
  color: var(--ink-soft);
  margin-bottom: 1.35rem;
}
.fq-card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fq-head {
  background: var(--navy);
  color: #fff;
  padding: .95rem 1.25rem;
}
.fq-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .6rem;
}
.fq-counter { font-weight: 800; font-size: 1.05rem; }
.fq-lesson-pill {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  padding: .2rem .7rem;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
}
.fq-body { padding: 1.25rem; }
.fq-scene { margin-bottom: 1rem; }

.fq-chart-card {
  margin: 0 0 1.25rem;
  padding: .95rem 1rem;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
.fq-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
}
.fq-chart-head strong { color: var(--navy); font-size: 1rem; }
.fq-axis-html {
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.45;
}
.fq-y-html {
  margin-bottom: .35rem;
  text-align: start;
}
.fq-x-html {
  margin-top: .35rem;
  text-align: center;
}
.fq-chart-svg-wrap { width: 100%; overflow: hidden; }
.fq-chart-svg { width: 100%; height: auto; display: block; }
.fq-chart-caption {
  margin-top: .65rem;
  font-size: .95rem;
  color: var(--ink);
  line-height: 1.65;
}

.fq-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.fq-question {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 1rem;
  line-height: 1.55;
  padding: 0;
}
.fq-options {
  display: grid;
  gap: .65rem;
}
.fq-option {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  min-height: 52px;
  padding: .85rem 1rem;
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.fq-option:hover { border-color: var(--petrol); }
.fq-option:focus-within {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
.fq-radio {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.fq-letter {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ivory);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
}
.fq-opt-text {
  flex: 1 1 12rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.55;
}
.fq-option.is-selected {
  border-color: var(--petrol);
  background: var(--info-bg);
}
.fq-option.is-selected .fq-letter {
  background: var(--petrol);
  color: #fff;
}
.fq-option.is-correct {
  border-color: #1B7A43;
  background: #EAF6EE;
}
.fq-option.is-correct .fq-letter {
  background: #1B7A43;
  color: #fff;
}
.fq-option.is-wrong {
  border-color: var(--red);
  background: var(--red-bg);
}
.fq-option.is-wrong .fq-letter {
  background: var(--red);
  color: #fff;
}
.fq-tag {
  font-size: .82rem;
  font-weight: 800;
  padding: .18rem .55rem;
  border-radius: 999px;
}
.fq-tag.is-ok { background: #1B7A43; color: #fff; }
.fq-tag.is-no { background: var(--red); color: #fff; }

.fq-feedback { margin-top: 1.1rem; }
.fq-correct-line,
.fq-why-wrong,
.fq-review-row { margin: .5rem 0 0; }
.fq-review-link {
  display: inline-block;
  font-weight: 700;
  color: var(--petrol);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.fq-review-link:hover { color: var(--navy); }
.fq-review-link.is-highlight { color: var(--red); }

.fq-summary-title {
  margin: 1.5rem 0 .75rem;
  font-size: 1.2rem;
}
.fq-summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .75rem;
}
.fq-summary-item {
  padding: .95rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--cream);
}
.fq-summary-item.is-ok {
  border-color: #8FC6A5;
  background: #F4FBF6;
}
.fq-summary-item.is-wrong {
  border-color: #E3A7A3;
  background: #FFF6F5;
}
.fq-summary-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}
.fq-summary-badge {
  font-size: .82rem;
  font-weight: 800;
  padding: .15rem .55rem;
  border-radius: 999px;
}
.fq-summary-badge.is-ok { background: #1B7A43; color: #fff; }
.fq-summary-badge.is-wrong { background: var(--red); color: #fff; }
.fq-summary-q { margin: .25rem 0; font-weight: 700; color: var(--navy); }
.fq-summary-ans { margin: .25rem 0; font-size: .96rem; }
.fq-summary-review { margin: .4rem 0 0; }
.fq-result-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

@media (max-width: 480px) {
  .fq-body { padding: 1rem .85rem; }
  .fq-head { padding: .85rem .9rem; }
  .fq-option { padding: .75rem .8rem; gap: .6rem; }
}


/* ==========================================================
   قاموس المصطلحات المصوّر
   ========================================================== */
.gl-lead {
  margin: .65rem 0 0;
  max-width: 44rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.gl-section { padding-top: 1.75rem; }

.gl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .85rem 1.25rem;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
  margin-bottom: 1.75rem;
}
.gl-search-field { flex: 1 1 20rem; min-width: 0; }
.gl-search-label {
  display: block;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: .4rem;
  font-size: 1rem;
}
.gl-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.gl-search-input {
  width: 100%;
  min-height: 46px;
  padding: .55rem .9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
.gl-search-input:focus {
  border-color: var(--petrol);
  background: #fff;
}
.gl-clear-inline {
  flex: none;
  min-height: 44px;
  padding: .45rem .9rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  color: var(--petrol);
  background: var(--info-bg);
  border: 1.5px solid var(--petrol-light);
  border-radius: 8px;
  cursor: pointer;
}
.gl-clear-inline:hover { background: var(--petrol); color: #fff; }
.gl-count {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--petrol);
}

.gl-empty {
  background: #fff;
  border: 1.5px dashed var(--petrol-light);
  border-radius: var(--radius);
  padding: 2rem 1.25rem;
  text-align: center;
  margin-bottom: 1.75rem;
}
.gl-empty-msg {
  margin: 0 0 1rem;
  font-weight: 700;
  color: var(--navy);
}

.gl-pairs {
  display: grid;
  gap: 2rem;
}
.gl-pair-head {
  margin-bottom: .9rem;
}
.gl-pair-head h2 {
  margin: 0 0 .2rem;
  font-size: clamp(1.18rem, 1.05rem + .6vw, 1.4rem);
  color: var(--navy);
}
.gl-pair-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: .95rem;
}
.gl-pair-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: stretch;
}
@media (min-width: 900px) {
  .gl-pair-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gl-card {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.25rem;
  min-width: 0;
}
.gl-card-top {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.gl-card-num {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--yellow);
  font-weight: 800;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gl-card-top h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
}
.gl-def {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}
.gl-example {
  background: var(--info-bg);
  border-inline-start: 4px solid var(--petrol);
  border-radius: 8px;
  padding: .75rem .9rem;
  font-size: .94rem;
}
.gl-example strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--navy);
}
.gl-example p { margin: 0; }

.gl-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.gl-svg-box {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .65rem;
}
.gl-svg-box svg {
  width: 100%;
  height: auto;
}
.gl-figcap {
  font-size: .88rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.gl-rate-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: 10px;
  padding: .9rem .75rem;
  text-align: center;
}
.gl-rate-eq-line {
  font-size: clamp(1.05rem, 4.5vw, 1.35rem);
  font-weight: 800;
  color: var(--yellow);
  white-space: nowrap;
  unicode-bidi: isolate;
  line-height: 1.3;
}
.gl-rate-sub-line {
  font-size: .88rem;
  color: #dbe8e7;
  line-height: 1.5;
}

.gl-insp-wrap { margin-bottom: 0; }
.gl-insp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  margin-bottom: .45rem;
}
.gl-insp-dev {
  font-size: .84rem;
  font-weight: 700;
  color: #cfe3e2;
}

.gl-card-foot {
  margin-top: auto;
  padding-top: .35rem;
}
.gl-lesson-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem 1rem;
  border-radius: 8px;
  border: 1.5px solid var(--petrol);
  color: var(--petrol);
  font-weight: 700;
  font-size: .94rem;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.gl-lesson-link:hover {
  background: var(--petrol);
  color: #fff;
}

@media (min-width: 1024px) {
  .site-nav a {
    padding: .42rem .48rem;
    font-size: .83rem;
  }
}

/* ==========================================================
   تمرين «نفس القراءة، ماذا تعرف؟» (الدرس الثاني)
   ========================================================== */
.sr-widget {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-block: 1.25rem 2rem;
  scroll-margin-top: 88px;
}
.sr-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 720px) {
  .sr-charts {
    grid-template-columns: 1fr 1fr;
  }
}
.sr-chart-card {
  margin: 0;
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-width: 0;
}
.sr-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
}
.sr-chart-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
}
.sr-plot-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .65rem .45rem;
}
.sr-y-label {
  font-size: .84rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .25rem;
}
.sr-x-label {
  font-size: .84rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-top: .15rem;
}
.sr-svg {
  width: 100%;
  height: auto;
  display: block;
}
.sr-chart-desc {
  margin: 0;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--ink);
}
.sr-stage-box {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  margin-top: 1.1rem;
}
.sr-stage-title {
  margin: 0 0 .75rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--navy);
}
.sr-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 .9rem;
  min-width: 0;
}
.sr-question {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--navy);
  margin-bottom: .65rem;
  padding: 0;
}
.sr-options {
  display: grid;
  gap: .55rem;
}
.sr-option {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .7rem .9rem;
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: .98rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.5;
  transition: background-color .15s, border-color .15s;
}
.sr-option:hover {
  background: var(--info-bg);
  border-color: var(--petrol);
}
.sr-option:focus-within {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
.sr-option input[type="radio"] {
  margin-top: .25rem;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--petrol);
}
.sr-option.is-selected {
  border-color: var(--petrol);
  background: var(--info-bg);
}
.sr-option.is-right {
  background: #e6f4ea;
  border-color: #1e7e34;
  color: #135323;
}
.sr-option.is-wrong {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}
.sr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .85rem;
}
.sr-inline-warn {
  margin: .65rem 0 0;
  padding: .55rem .8rem;
  border-radius: 8px;
  background: var(--warn-bg);
  border: 1.5px solid var(--yellow);
  color: var(--navy);
  font-size: .92rem;
  font-weight: 700;
}
.sr-story-box {
  background: var(--info-bg);
  border: 1.5px solid var(--petrol);
  border-inline-start: 5px solid var(--petrol);
  border-radius: 10px;
  padding: .9rem 1rem;
  margin-bottom: 1rem;
}
.sr-story-box:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
.sr-story-box p {
  margin: 0 0 .5rem;
  font-size: .98rem;
}
.sr-story-box p:last-child {
  margin-bottom: 0;
}
.sr-story-badge {
  display: inline-block;
  font-size: .82rem;
  font-weight: 800;
  background: var(--petrol);
  color: #fff;
  padding: .15rem .65rem;
  border-radius: 999px;
  margin-bottom: .5rem;
}
.sr-story-note {
  font-size: .88rem !important;
  color: var(--ink-soft);
}
.sr-summary {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-top: .9rem;
}
.sr-summary h4 {
  margin: 0 0 .5rem;
  color: var(--yellow);
  font-size: 1.05rem;
  font-weight: 800;
}
.sr-summary ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}
.sr-summary li {
  margin-bottom: .35rem;
  font-size: .95rem;
}
.sr-summary li:last-child {
  margin-bottom: 0;
}
.sr-summary strong {
  color: #fff;
}

/* ==========================================================
   بطاقات القاموس (معرّفات وتمرير) + التعريفات السريعة في الدروس
   ========================================================== */
.gl-card[id] {
  scroll-margin-top: 96px;
}
.gl-card:target {
  border-color: var(--petrol);
  box-shadow: 0 0 0 3px rgba(15, 94, 102, .18), var(--shadow);
}

.qd-group {
  margin-bottom: 1rem;
}
.qd-group > p:last-of-type {
  margin-bottom: .5rem;
}

.qd-trigger {
  display: inline;
  font: inherit;
  font-weight: 700;
  color: var(--navy);
  background: rgba(15, 94, 102, .08);
  border: 0;
  border-bottom: 2px dashed var(--petrol);
  border-radius: 5px;
  padding: .05em .35em;
  margin: 0;
  cursor: pointer;
  line-height: inherit;
  transition: background-color .15s, color .15s, border-color .15s;
}
.qd-trigger:hover {
  background: rgba(15, 94, 102, .16);
  color: var(--navy);
}
.qd-trigger[aria-expanded="true"] {
  background: var(--petrol);
  color: #fff;
  border-bottom-color: var(--yellow);
}
.qd-trigger:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.qd-box {
  background: #fff;
  border: 1.5px solid var(--petrol);
  border-inline-start: 4px solid var(--yellow);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin: .45rem 0 .85rem;
  box-shadow: var(--shadow);
  max-width: 100%;
  overflow-wrap: break-word;
}
.qd-title {
  margin: 0 0 .25rem;
  font-size: .95rem;
  font-weight: 800;
  color: var(--petrol);
}
.qd-text {
  margin: 0 0 .65rem;
  font-size: .98rem;
  line-height: 1.75;
  color: var(--ink);
}
.qd-glossary-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 44px;
  padding: .35rem .85rem;
  border-radius: 8px;
  border: 1.5px solid var(--petrol);
  background: var(--info-bg);
  color: var(--navy);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.qd-glossary-link:hover {
  background: var(--petrol);
  color: #fff;
}
.qd-glossary-link:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* ==========================================================
   مراجعة الأسئلة الخاطئة في الاختبار الختامي
   ========================================================== */
.fq-score-label {
  font-size: .92rem;
  font-weight: 800;
  color: var(--petrol);
  margin-bottom: .15rem;
}
.fq-original-score-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .85rem;
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-inline-start: 5px solid var(--navy);
  border-radius: 10px;
  padding: .75rem 1rem;
  margin-bottom: 1.1rem;
}
.fq-original-badge {
  display: inline-block;
  padding: .18rem .65rem;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
}
.fq-original-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
}
.fq-original-note {
  font-size: .9rem;
  color: var(--ink-soft);
  flex: 1 1 220px;
}

/* ==========================================================
   نشاط: الطيف أم الرسم الزمني؟
   ========================================================== */
.svt-chart-card {
  margin: 0;
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  min-width: 0;
}
.svt-plot-box {
  background: #0A2E3B;
  color: #fff;
  border-radius: 8px;
  padding: .65rem .75rem;
}
.svt-plot-box .insp-axis-html {
  color: #e6f1f1;
}
.svt-readout-note {
  margin-top: .55rem;
  padding: .45rem .65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(207, 227, 226, .28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  text-align: center;
}
.svt-cps-num {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--yellow);
}
.svt-cps-src {
  font-size: .82rem;
  color: #cfe3e2;
}

/* ==========================================================
   المؤثرات البصرية الخمسة (معاينة)
   ========================================================== */

/* 1. صفحة الدخول — ظهور الدرع والعنوان والزر */
@keyframes splash-shield-in {
  from { opacity: 0; transform: translateY(8px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes splash-text-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes splash-btn-in {
  from { opacity: .72; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.splash-v2 .splash-shield {
  animation: splash-shield-in .45s cubic-bezier(.22, 1, .36, 1) both;
}
.splash-v2 .splash-sub {
  animation: splash-text-in .4s cubic-bezier(.22, 1, .36, 1) .08s both;
}
.splash-v2 h1 {
  animation: splash-text-in .42s cubic-bezier(.22, 1, .36, 1) .12s both;
}
.splash-v2 .btn-enter {
  animation: splash-btn-in .38s cubic-bezier(.22, 1, .36, 1) .16s both;
}

/* 2. خريطة الدروس — استجابة المحطة وإكمال الدرس */
.progress-fill {
  transition: width .45s cubic-bezier(.22, 1, .36, 1);
}
.station-node {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.station-card {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.station-card h3 a {
  -webkit-tap-highlight-color: rgba(15, 94, 102, .14);
}
.station-card h3 a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (hover: hover) and (pointer: fine) {
  .lesson-station:hover .station-node,
  .lesson-station:focus-within .station-node {
    transform: translateY(-2px) scale(1.06);
    border-color: var(--petrol);
    box-shadow: 0 4px 12px rgba(10, 46, 59, .16);
  }
  .lesson-station.is-completed:hover .station-node,
  .lesson-station.is-completed:focus-within .station-node {
    border-color: #135e34;
  }
  .lesson-station:hover .station-card,
  .lesson-station:focus-within .station-card {
    transform: translateY(-3px);
    border-color: var(--petrol);
    box-shadow: 0 6px 18px rgba(10, 46, 59, .12);
  }
}
@media (hover: none), (pointer: coarse) {
  .lesson-station:active .station-card {
    transform: scale(.985);
    border-color: var(--petrol);
    background: #f2f8f8;
  }
  .lesson-station:active .station-node {
    transform: scale(.94);
    border-color: var(--petrol);
  }
  .lesson-station:focus-within .station-card {
    border-color: var(--petrol);
    box-shadow: 0 4px 14px rgba(10, 46, 59, .12);
  }
}
@keyframes lesson-check-pop {
  0%   { transform: scale(.75); }
  60%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}
@keyframes lesson-check-draw {
  from { stroke-dashoffset: 16; }
  to   { stroke-dashoffset: 0; }
}
.lesson-station.is-just-completed .lesson-status.is-done .status-icon {
  animation: lesson-check-pop .4s cubic-bezier(.22, 1, .36, 1) both;
}
.lesson-station.is-just-completed .lesson-status.is-done .status-icon path {
  stroke-dasharray: 16;
  animation: lesson-check-draw .36s ease-out .06s both;
}

/* 3. رسوم الكاشف — ظهور منحنى الطيف والرسم الزمني */
@keyframes insp-reveal-ltr {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.insp-curve-reveal {
  animation: insp-reveal-ltr .65s cubic-bezier(.22, 1, .36, 1) both;
}

/* 4. «نفس القراءة، ماذا تعرف؟» — كشف المعلومة الإضافية */
@keyframes sr-story-reveal {
  0% {
    opacity: .75;
    transform: translateY(6px);
    border-color: var(--yellow);
    box-shadow: 0 0 0 0 rgba(244, 194, 27, 0);
  }
  45% {
    opacity: 1;
    transform: none;
    border-color: var(--yellow);
    box-shadow: 0 0 0 4px rgba(244, 194, 27, .35);
  }
  100% {
    opacity: 1;
    transform: none;
    border-color: var(--petrol);
    box-shadow: 0 0 0 0 rgba(244, 194, 27, 0);
  }
}
.sr-story-box.is-just-revealed {
  animation: sr-story-reveal .85s cubic-bezier(.22, 1, .36, 1) both;
}

/* 5. الاختبار الختامي — التصحيح والنتيجة */
@keyframes fq-tag-pop {
  from { opacity: .6; transform: scale(.86); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fq-feedback-in {
  from { opacity: .78; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fq-result-in {
  from { opacity: .72; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.fq-card.is-just-submitted .fq-tag {
  animation: fq-tag-pop .28s cubic-bezier(.22, 1, .36, 1) both;
}
.fq-card.is-just-submitted .fq-feedback {
  animation: fq-feedback-in .3s ease-out both;
}
.fq-result-box.is-just-rendered {
  animation: fq-result-in .42s cubic-bezier(.22, 1, .36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .splash-v2 .splash-shield,
  .splash-v2 .splash-sub,
  .splash-v2 h1,
  .splash-v2 .btn-enter,
  .insp-curve-reveal,
  .sr-story-box.is-just-revealed,
  .fq-card.is-just-submitted .fq-tag,
  .fq-card.is-just-submitted .fq-feedback,
  .fq-result-box.is-just-rendered,
  .lesson-station.is-just-completed .lesson-status.is-done .status-icon,
  .lesson-station.is-just-completed .lesson-status.is-done .status-icon path {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .insp-curve-reveal {
    clip-path: none !important;
  }
  .lesson-station:hover .station-node,
  .lesson-station:focus-within .station-node,
  .lesson-station:hover .station-card,
  .lesson-station:focus-within .station-card,
  .lesson-station:active .station-card,
  .lesson-station:active .station-node {
    transform: none !important;
  }
}

/* ==========================================================
   المؤثرات البصرية الثلاثة الإضافية (معاينة)
   ========================================================== */

/* 6. الدرس الأول — إبراز مسار «كيف يصبح المصدر يتيمًا؟» وإشارة نهايته */
.orphan-connector {
  position: relative;
  overflow: visible;
}
.orphan-path-card.is-active .orphan-connector::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  transform-origin: inline-start center;
  animation: orphan-line-sweep .32s cubic-bezier(.22, 1, .36, 1) both;
}
.orphan-path-card.is-active.is-controlled .orphan-connector::before {
  background: var(--petrol-light);
  box-shadow: 0 0 0 2px rgba(15, 94, 102, .22);
}
.orphan-path-card.is-active.is-lost .orphan-connector::before {
  background: repeating-linear-gradient(90deg, var(--red) 0 10px, transparent 10px 18px);
  box-shadow: 0 0 0 2px rgba(180, 35, 24, .18);
}
.orphan-path-card.is-active .orphan-connector::after {
  content: "";
  position: absolute;
  inset-inline-end: -2px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translateY(-50%);
  animation: orphan-end-pulse .38s cubic-bezier(.22, 1, .36, 1) .08s both;
}
.orphan-path-card.is-active.is-controlled .orphan-connector::after {
  background: var(--petrol);
  box-shadow: 0 0 0 3px rgba(15, 94, 102, .25);
}
.orphan-path-card.is-active.is-lost .orphan-connector::after {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .24);
}
@keyframes orphan-line-sweep {
  from { transform: scaleX(.18); opacity: .55; }
  to   { transform: scaleX(1); opacity: 1; }
}
@keyframes orphan-end-pulse {
  0%   { transform: translateY(-50%) scale(.5); opacity: 0; }
  65%  { transform: translateY(-50%) scale(1.25); opacity: 1; }
  100% { transform: translateY(-50%) scale(1); opacity: 1; }
}

/* 7. الدرس الخامس — إبراز الخطوة الجديدة في مؤشر الخطوات */
@keyframes sim-step-highlight {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 194, 27, 0); }
  45%  { transform: scale(1.16); box-shadow: 0 0 0 3px rgba(244, 194, 27, .48); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 194, 27, 0); }
}
.sim-progress span.current.is-just-entered {
  animation: sim-step-highlight .36s cubic-bezier(.22, 1, .36, 1) both;
}

/* 8. القاموس المصوّر — إبراز إطار البطاقة المقصودة عند الوصول من تعريف سريع */
@keyframes gl-target-highlight {
  0% {
    border-color: var(--petrol);
    box-shadow: 0 0 0 0 rgba(244, 194, 27, 0), var(--shadow);
  }
  38% {
    border-color: var(--yellow);
    box-shadow: 0 0 0 4px rgba(244, 194, 27, .45), var(--shadow);
  }
  100% {
    border-color: var(--petrol);
    box-shadow: 0 0 0 3px rgba(15, 94, 102, .22), var(--shadow);
  }
}
.gl-card.is-target-highlight {
  border-color: var(--petrol);
  box-shadow: 0 0 0 3px rgba(15, 94, 102, .22), var(--shadow);
  animation: gl-target-highlight .75s cubic-bezier(.22, 1, .36, 1) 1 both;
}

@media (prefers-reduced-motion: reduce) {
  .orphan-path-card.is-active .orphan-connector::before,
  .orphan-path-card.is-active .orphan-connector::after,
  .sim-progress span.current.is-just-entered,
  .gl-card.is-target-highlight {
    animation: none !important;
  }
  .orphan-path-card.is-active .orphan-connector::before {
    transform: none !important;
    opacity: 1 !important;
  }
  .orphan-path-card.is-active .orphan-connector::after {
    transform: translateY(-50%) !important;
    opacity: 1 !important;
  }
  .sim-progress span.current {
    box-shadow: 0 0 0 2px rgba(244, 194, 27, .55);
  }
  .gl-card:target,
  .gl-card.is-target-highlight {
    border-color: var(--petrol);
    box-shadow: 0 0 0 3px rgba(15, 94, 102, .26), var(--shadow);
  }
}
