/* قسم «التأسيس» (تأسيس القدرات): الصفحة الرئيسية للدورة، وصفحة الدرس، وتحديد المستوى، والاختبار الشامل.
   الألوان رموز في :root، ونسختها الداكنة تحت :root[data-theme="dark"] (يضبطه ThemeHead) مكتوبة يدويًا هنا
   لأنها رموز قليلة (لا تمر بمولّد dark.css). أنماط حركات الدروس في src/tasees/qudurat/lessons/NN.css،
   وتقرأ رموز Hark التي تحوّلها .t-lesson أدناه إلى ألوان مصباح. */

@font-face { font-family: Th; src: url("/fonts/thmanyahsans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Th; src: url("/fonts/thmanyahsans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Th; src: url("/fonts/thmanyahsans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f8f7fb; --surface: #ffffff; --ink: #252536; --muted: #625d75; --line: #e7e3ee; --line-strong: #d9d3e6; --soft: #f2f0f7;
  --btn: #6550d8; --btn-hover: #5540c5; --link: #5a45cf; --pale: #eee9fc; --pale-ink: #4a3aa8; --brand-fill: #6550d8;
  --gold: #d99a14; --gold-soft: #fff4d8; --gold-ink: #7a5408; --acc: #c26a00;
  --green: #1f7a62; --green-soft: #e6f4ee; --red: #c8323a; --red-soft: #fbeaea;
  --hero: #211a4a; --hero-2: #2d2466; --hero-text: #f7f5ff; --hero-muted: #d6d0f2;
  --nav: rgb(255 255 255 / 0.92); --shadow: 0 10px 30px rgb(60 40 120 / 0.08);
  --chart-1: #b1bcd2; --chart-2: #607868; --chart-3: #dbb691; --chart-4: #a79fb8; --chart-5: #d9c489; --chart-6: #7e9c9b; --chart-7: #c9a3a8;
  --chart-ink: #252536; --chart-muted: #25253650; --chart-on-colour: #1d1d1f; --x-yellow: #ffe27a;
  --font: Th, "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #13111d; --surface: #1c1929; --ink: #eeebf7; --muted: #aaa4bd; --line: #2f2a42; --line-strong: #3d3755; --soft: #25212f;
  --btn: #6a56e0; --btn-hover: #7a68ea; --link: #b6aaff; --pale: #2a2452; --pale-ink: #cfc6ff; --brand-fill: #8f7cf0;
  --gold: #f0b43a; --gold-soft: #3a2d10; --gold-ink: #ffd98a; --acc: #f0a64a;
  --green: #5cc8a4; --green-soft: #16362c; --red: #f1666c; --red-soft: #3a1a1d;
  --hero: #1a1540; --hero-2: #251e58; --nav: rgb(28 25 41 / 0.92); --shadow: 0 10px 30px rgb(0 0 0 / 0.3);
  --chart-1: #c3ccdd; --chart-2: #8fa898; --chart-3: #e2c39f; --chart-4: #b9b2c9; --chart-5: #e2d09e; --chart-6: #96b3b2; --chart-7: #d6b5b9;
  --chart-ink: #eeebf7; --chart-muted: #eeebf750; --x-yellow: #5c4a00;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body.t-page { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 var(--font); }
.t-page a { color: inherit; text-decoration: none; }
.t-page button { font: inherit; color: inherit; cursor: pointer; }
.t-page h1, .t-page h2, .t-page h3, .t-page p { margin: 0; }
.t-page h1, .t-page h2 { text-wrap: balance; }
.t-page :focus-visible { outline: 3px solid #d5a737; outline-offset: 3px; border-radius: 8px; }
.t-page [hidden] { display: none !important; }
.t-wrap { max-width: 1140px; margin: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.t-narrow { max-width: 1000px; }

/* ===== الترويسة ===== */
.t-nav { position: sticky; top: 0; z-index: 25; background: var(--nav); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.t-nav .t-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.t-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 24px; }
.t-brand img { width: 38px; height: 38px; }
.t-links { display: flex; gap: 22px; font-size: 15px; color: var(--muted); }
.t-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.t-links a[aria-current] { color: var(--link); font-weight: 700; }
.t-navend { display: flex; align-items: center; gap: 8px; }
.t-theme { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.t-theme svg { width: 20px; height: 20px; }
.t-theme .sun { display: none; }
:root[data-theme="dark"] .t-theme .sun { display: block; }
:root[data-theme="dark"] .t-theme .moon { display: none; }

.t-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 16px; background: none; }
.t-btn-main { background: var(--btn); color: #fff; }
.t-btn-main:hover { background: var(--btn-hover); }
.t-btn-line { background: var(--surface); border-color: var(--line); color: var(--ink); }
.t-btn-line:hover:not(:disabled) { border-color: var(--link); }
.t-btn:disabled { opacity: 0.45; cursor: default; }
.t-btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }

.t-foot { margin-top: 32px; border-top: 1px solid var(--line); padding-block: 24px 28px; color: var(--muted); font-size: 14px; }
.t-foot .t-wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.t-foot a { color: var(--link); }

/* ===== الصفحة الرئيسية للدورة ===== */
.t-hero { padding-block: 24px 8px; }
.t-hero-card { position: relative; overflow: hidden; border-radius: 28px; color: var(--hero-text);
  background: radial-gradient(520px 340px at 12% 30%, rgb(255 213 107 / 0.22), transparent 70%), linear-gradient(160deg, var(--hero-2), var(--hero));
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 24px; padding: 40px; }
.t-crumb { font-size: 14px; color: var(--hero-muted); display: flex; gap: 6px; flex-wrap: wrap; }
.t-crumb a { text-decoration: underline; text-underline-offset: 3px; }
.t-crumb b { color: #ffd56b; font-weight: 700; }
.t-hero h1 { font-size: 44px; line-height: 1.35; margin: 10px 0 8px; }
.t-hero h1 span { color: #ffd56b; }
.t-hero-sub { font-size: 19px; color: var(--hero-muted); max-width: 34ch; }
.t-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.t-hero .t-btn-main { min-height: 56px; padding: 0 28px; font-size: 18px; box-shadow: 0 0 0 2px rgb(182 170 255 / 0.55), 0 10px 30px rgb(101 80 216 / 0.45); }
.t-ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 20px; border-radius: 12px; border: 1px solid rgb(255 255 255 / 0.2); background: rgb(255 255 255 / 0.08); color: var(--hero-text); font-weight: 700; }
.t-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.t-path li { display: grid; gap: 4px; padding: 12px; border-radius: 16px; background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.2); font-size: 15px; line-height: 1.45; }
.t-path b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #ffd56b; color: #2a2050; font-size: 15px; }
.t-art { display: grid; place-items: center; min-width: 0; }
.t-art svg { width: 100%; max-width: 440px; height: auto; }

.t-jump { position: sticky; top: 64px; z-index: 20; padding-block: 10px; background: linear-gradient(var(--bg) 70%, transparent); }
.t-jump nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.t-jump nav::-webkit-scrollbar { display: none; }
.t-jump a { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 700; background: color-mix(in srgb, var(--u) 13%, var(--surface)); }
.t-jump a:hover { background: color-mix(in srgb, var(--u) 24%, var(--surface)); }
.t-jump a span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--u); color: #fff; font-size: 14px; }

.t-sec { padding-block: 20px; }
.t-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.t-sec-head h2 { font-size: 26px; }
.t-sec-head p { color: var(--muted); font-size: 15px; }
.t-how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.t-how li { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.t-how b { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--pale); color: var(--pale-ink); font-size: 17px; }

.t-unit { display: grid; gap: 12px; padding-block: 14px; scroll-margin-top: 150px; }
.t-unit-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; background: var(--u); color: #fff; }
.t-unit-ico { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #fff; color: var(--u); font-size: 26px; font-weight: 700; line-height: 1; }
.t-unit-ico svg { width: 30px; height: 30px; }
.t-unit-head h2 { font-size: 23px; line-height: 1.4; }
.t-unit-head p { font-size: 15px; opacity: 0.92; }
.t-count { display: inline-block; margin-inline-start: 6px; padding: 1px 10px; border-radius: 999px; background: rgb(0 0 0 / 0.22); font-size: 14px; vertical-align: middle; }
.t-lessons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.t-card { position: relative; height: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px 14px; align-content: start; padding: 16px; border-radius: 20px; background: var(--surface); border: 2px solid color-mix(in srgb, var(--u) 30%, var(--line)); transition: transform 0.16s, border-color 0.16s; }
.t-card:hover { transform: translateY(-2px); border-color: var(--u); }
.t-num { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--u); color: #fff; font-size: 21px; font-weight: 700; }
.t-name { font-weight: 700; font-size: 18px; line-height: 1.45; align-self: center; }
.t-name small { display: block; font-weight: 400; font-size: 14px; color: var(--muted); }
.t-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.t-tag { font-size: 14px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--u) 12%, var(--surface)); }
.t-go { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; border-radius: 12px; background: color-mix(in srgb, var(--u) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--u) 30%, var(--line)); font-weight: 700; }
.t-note { color: var(--muted); font-size: 14px; margin-top: 18px; }

/* ===== صفحة الدرس ===== */
.t-lhead { margin-top: 16px; border-radius: 24px; padding: 20px 22px; background: var(--u); color: #fff; display: grid; gap: 12px; }
.t-lhead .t-crumb { color: #fff; opacity: 0.92; }
.t-ltitle { display: flex; align-items: center; gap: 14px; }
.t-lnum { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--u); font-size: 24px; font-weight: 700; }
.t-ltitle h1 { font-size: 28px; line-height: 1.35; }
.t-ltitle small { display: block; font-size: 15px; font-weight: 400; opacity: 0.92; }
.t-lprog { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.t-pips { display: flex; gap: 6px; flex: 1; min-width: 180px; max-width: 420px; }
.t-pips i { flex: 1; height: 8px; border-radius: 8px; background: rgb(255 255 255 / 0.3); }
.t-pips i.on { background: #fff; }
.t-skip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; background: rgb(0 0 0 / 0.18); font-size: 15px; font-weight: 700; }

.t-stagecard { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px; display: grid; gap: 12px; }
.t-stagebox { position: relative; border-radius: 16px; background: var(--soft); overflow: hidden; }
/* غلاف المسرح يحمل أصناف الدرس الأصلية (لتنطبق أنماط حركاته)، فنلغي ما فيها من إطار حتى لا يتكرر إطار البطاقة */
.t-stagebox > .t-stagewrap { display: block !important; max-width: 720px; margin-inline: auto; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; gap: 0 !important; }
.t-stagebox svg { display: block; width: 100%; height: auto; }
.t-listen { position: absolute; inset-block-end: 12px; inset-inline-start: 12px; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--btn); color: #fff; font-weight: 700; box-shadow: 0 8px 24px rgb(101 80 216 / 0.4); z-index: 2; }
.t-strow { display: flex; align-items: center; gap: 10px; }
.t-strow h2 { font-size: 21px; }
.t-speak { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.t-speak i { width: 3px; height: 100%; border-radius: 3px; background: var(--green); transform-origin: bottom; animation: t-eq 0.9s ease-out infinite alternate; }
.t-speak i:nth-child(2) { animation-delay: -0.3s; }
.t-speak i:nth-child(3) { animation-delay: -0.6s; }
@keyframes t-eq { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .t-speak i { animation: none; } }
.t-sttext { font-size: 17px; line-height: 1.9; max-width: 68ch; }
.t-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.t-ctrl .t-group { display: flex; flex-wrap: wrap; gap: 8px; }
.t-icon { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; }
.t-icon svg { width: 18px; height: 18px; }
.t-noaudio { font-size: 14px; color: var(--muted); }

/* رموز Hark التي تستعملها أنماط الدروس المنقولة، محوّلة إلى ألوان مصباح وخطه */
.t-lesson {
  --text-primary: var(--ink); --text-secondary: var(--muted); --text-tertiary: color-mix(in srgb, var(--ink) 30%, transparent);
  --text-primary-on: #ffffff; --text-secondary-on: rgb(255 255 255 / 0.75);
  --fill-primary: var(--brand-fill); --fill-primary-on: var(--surface); --fill-secondary: color-mix(in srgb, var(--ink) 50%, transparent);
  --fill-tertiary: var(--pale); --fill-segment: var(--line-strong);
  --fill-system-green: var(--green); --fill-system-orange: var(--acc); --fill-system-red: var(--red);
  --transparent-primary: color-mix(in srgb, var(--ink) 30%, transparent);
  --stroke-primary: var(--line-strong); --stroke-secondary: var(--line); --stroke-primary-on: rgb(255 255 255 / 0.12); --stroke-system-orange: color-mix(in srgb, var(--acc) 15%, transparent);
  --hover-wash: color-mix(in srgb, var(--ink) 5%, transparent);
  --hero-surface: var(--hero); --hero-text: var(--hero-text); --hero-text-muted: var(--hero-muted); --hero-glass: rgb(255 255 255 / 0.08); --hero-glass-faint: rgb(255 255 255 / 0.06); --hero-glass-stroke: rgb(255 255 255 / 0.28);
  --mat-regular: var(--surface); --mat-agent: var(--surface); --hark-blur: none; --hark-shadow: var(--shadow);
  --sans: var(--font); --ar: var(--font); --lh: 1.4;
  --weight-light: 300; --weight-regular: 400; --weight-medium: 500; --weight-bold: 700;
  --size-caption: 14px; --size-meta: 14px; --size-small: 14px; --size-body: 16px; --size-prose: 17px; --size-heading: 20px;
  --size-figure: clamp(24px, 3vw, 32px); --size-title: clamp(24px, 3vw, 30px); --size-display: clamp(30px, 5vw, 44px); --size-lede: clamp(16px, 1.7vw, 20px);
  --type-caption: var(--weight-regular) var(--size-caption) / var(--lh) var(--sans);
  --type-tag: var(--weight-medium) var(--size-caption) / var(--lh) var(--sans);
  --type-small: var(--weight-regular) var(--size-small) / var(--lh) var(--sans);
  --type-label: var(--weight-medium) var(--size-small) / var(--lh) var(--sans);
  --type-body: var(--weight-regular) var(--size-body) / var(--lh) var(--sans);
  --type-body-strong: var(--weight-medium) var(--size-body) / var(--lh) var(--sans);
  --type-heading: var(--weight-bold) var(--size-heading) / var(--lh) var(--sans);
  --type-lede: var(--weight-medium) var(--size-lede) / var(--lh) var(--sans);
  --type-figure: var(--weight-regular) var(--size-figure) / var(--lh) var(--sans);
  --type-title: var(--weight-bold) var(--size-title) / var(--lh) var(--sans);
  --type-display: var(--weight-bold) var(--size-display) / var(--lh) var(--sans);
  --r-s: 12px; --r-m: 16px; --r-l: 24px; --r-xl: 32px; --r-pill: 100px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --dur-quick: 160ms; --dur-draw: 600ms; --tap: 44px; --gutter: 16px;
}
.t-stagebox svg text { font-family: var(--font); }

/* ===== أسئلة الدرس وتحديد المستوى ===== */
.t-qsec { margin-top: 26px; scroll-margin-top: 80px; }
.t-qsec:focus { outline: none; }
.t-qsec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.t-qsec-head h2 { font-size: 24px; }
.t-qsec-head p { color: var(--muted); font-size: 15px; }
.t-qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.t-q { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: grid; gap: 12px; }
.t-qtag { font-size: 14px; color: var(--muted); }
.t-stem { font-size: 18px; font-weight: 700; line-height: 1.9; }
.t-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.t-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 17px; text-align: start; }
.t-opt:hover:not(:disabled) { border-color: var(--link); }
.t-opt:disabled { cursor: default; }
.t-opt .t-mk { flex: none; display: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 700; }
.t-opt.ok { border-color: var(--green); background: var(--green-soft); }
.t-opt.ok .t-mk { display: grid; background: var(--green); }
.t-opt.bad { border-color: var(--red); background: var(--red-soft); }
.t-opt.bad .t-mk { display: grid; background: var(--red); }
.t-opt.sel { border-color: var(--btn); background: var(--pale); font-weight: 700; }
.t-why { font-size: 16px; background: var(--soft); border-radius: 12px; padding: 10px 14px; line-height: 1.9; }
.t-why b { color: var(--green); }
.t-why.is-bad b { color: var(--red); }
.t-ctx { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; line-height: 2; }
.t-ctx svg { display: block; width: 100%; max-width: 620px; height: auto; margin-inline: auto; direction: ltr; }
.t-ctx figure { margin: 0; }
.t-ctx figcaption, .t-ctx h3 { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.t-passage p { margin: 0; font-size: 17px; line-height: 2; }
.t-pair, .t-sent { display: block; margin-top: 8px; padding: 10px 14px; border-radius: 12px; background: var(--soft); font-size: 19px; }
.t-sent u { text-decoration-color: var(--link); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.t-blank { color: var(--link); letter-spacing: 2px; }
.t-given { display: block; color: var(--muted); font-weight: 400; }
.t-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.t-cmp > span { display: block; padding: 10px 14px; border-radius: 12px; background: var(--soft); text-align: center; font-size: 19px; }
.t-cmp b { color: var(--muted); font-weight: 400; margin-inline-end: 6px; }
.t-done { margin-top: 14px; display: grid; gap: 12px; padding: 20px; border-radius: 22px; background: linear-gradient(160deg, var(--hero-2), var(--hero)); color: var(--hero-text); }
.t-done h3 { font-size: 24px; }
.t-done p { color: var(--hero-muted); }
.t-done .t-row { display: flex; flex-wrap: wrap; gap: 10px; }
.t-done .t-btn-line, .t-resh .t-btn-line { background: transparent; color: var(--hero-text); border-color: rgb(255 255 255 / 0.3); }
.t-err { padding: 14px 16px; border-radius: 14px; background: var(--red-soft); color: var(--ink); }

.t-lnav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.t-lnav a { display: grid; gap: 2px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); min-height: 64px; }
.t-lnav a:hover { border-color: var(--link); }
.t-lnav small { font-size: 14px; color: var(--muted); }
.t-lnav b { font-size: 17px; }
.t-lnav .t-nx { text-align: left; grid-column: 2; }

/* رموز الرياضيات في نصوص الأسئلة (من صفحات الحزمة): تبقى من اليسار لليمين، والكسور مكدسة */
.t-page .x-math, .t-page .x-ltr, .t-page .x-eq, .t-page .x-m, .t-page .x-nums, .t-page .x-ex, .t-page .x-num { direction: ltr; unicode-bidi: isolate; display: inline-block; white-space: nowrap; }
.t-page .x-frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: max(0.85em, 14px); line-height: 1.15; margin: 0 2px; }
.t-page .x-frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 3px; }

/* ===== تحديد المستوى والاختبار الشامل ===== */
.t-top { margin-top: 16px; border-radius: 24px; padding: 20px 22px; background: linear-gradient(160deg, var(--hero-2), var(--hero)); color: var(--hero-text); display: grid; gap: 12px; }
.t-top h1 { font-size: 28px; }
.t-top p { color: var(--hero-muted); }
.t-clock { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid rgb(255 255 255 / 0.3); font-weight: 700; direction: ltr; }
.t-clock.is-over { border-color: #ffd56b; color: #ffd56b; }
.t-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.t-strip button { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid rgb(255 255 255 / 0.28); background: transparent; color: var(--hero-text); font-weight: 700; font-size: 15px; }
.t-strip button.ans { background: rgb(255 255 255 / 0.16); }
.t-strip button.cur { border-color: #ffd56b; box-shadow: 0 0 0 2px #ffd56b; }
.t-intro { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.t-intro article { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: grid; gap: 6px; align-content: start; }
.t-intro b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--pale); color: var(--pale-ink); font-size: 18px; }
.t-intro h3 { font-size: 18px; }
.t-intro p { color: var(--muted); font-size: 15px; }
.t-start { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.t-start small { color: var(--muted); font-size: 14px; }
.t-one { margin-top: 14px; display: grid; gap: 12px; }
.t-one .t-q { padding: 22px; }
.t-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.t-warn { padding: 16px; border-radius: 18px; background: var(--gold-soft); color: var(--gold-ink); display: grid; gap: 10px; }
.t-warn .t-row { display: flex; flex-wrap: wrap; gap: 8px; }
.t-res { margin-top: 14px; display: grid; gap: 14px; }
.t-resh { border-radius: 24px; padding: 22px; background: linear-gradient(160deg, var(--hero-2), var(--hero)); color: var(--hero-text); display: grid; gap: 12px; }
.t-resh h2 { font-size: 28px; }
.t-resh h2 span { color: #ffd56b; }
.t-resh p { color: var(--hero-muted); }
.t-resh .t-row { display: flex; flex-wrap: wrap; gap: 10px; }
.t-meter { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 10px; max-width: 520px; }
.t-meter i { height: 10px; border-radius: 10px; background: rgb(255 255 255 / 0.15); overflow: hidden; display: block; }
.t-meter i s { display: block; height: 100%; width: 0; background: #ffd56b; border-radius: 10px; }
.t-meter em { font-style: normal; color: var(--hero-muted); font-size: 15px; }
.t-subh { font-size: 20px; margin-bottom: 8px; }
.t-lit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.t-lit a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 2px solid var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); min-height: 64px; }
.t-lit .t-n { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--u); color: #fff; font-weight: 700; box-shadow: 0 0 0 3px var(--gold-soft), 0 0 14px var(--gold); }
.t-lit b { display: block; font-size: 16px; }
.t-lit small { color: var(--muted); font-size: 14px; }
.t-okl { display: flex; flex-wrap: wrap; gap: 8px; }
.t-okl span { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 700; }
.t-save { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-radius: 18px; background: var(--pale); color: var(--pale-ink); }

@media (max-width: 900px) {
  .t-hero-card { grid-template-columns: 1fr; padding: 28px; }
  .t-art { order: -1; }
  .t-art svg { max-width: 360px; }
  .t-how, .t-intro { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .t-links { display: none; }
  .t-lhead, .t-top { padding: 16px; }
  .t-ltitle h1, .t-top h1 { font-size: 23px; }
  .t-lnum { width: 48px; height: 48px; font-size: 20px; }
  .t-stagecard { padding: 10px; border-radius: 20px; }
  .t-sttext { font-size: 16px; }
  .t-ctrl { flex-direction: column; align-items: stretch; }
  .t-ctrl .t-group { justify-content: space-between; }
  .t-ctrl .t-main-group .t-btn { flex: 1; }
  .t-opts, .t-cmp { grid-template-columns: 1fr; }
  .t-lnav { grid-template-columns: 1fr; }
  .t-lnav .t-nx { grid-column: auto; }
  .t-resh h2 { font-size: 24px; }
}
@media (max-width: 640px) {
  .t-nav .t-wrap { min-height: 60px; }
  .t-jump { top: 60px; }
  .t-brand { font-size: 22px; }
  .t-brand img { width: 34px; height: 34px; }
  .t-hero { padding-block: 14px 4px; }
  .t-hero-card { padding: 22px 18px; border-radius: 24px; }
  .t-hero h1 { font-size: 32px; }
  .t-hero-sub { font-size: 17px; }
  .t-hero-actions > * { width: 100%; }
  .t-path { grid-template-columns: 1fr; }
  .t-path li { grid-template-columns: 30px 1fr; align-items: center; gap: 10px; }
  .t-art svg { max-width: 300px; }
  .t-unit-head { padding: 14px; gap: 12px; }
  .t-unit-ico { width: 48px; height: 48px; }
  .t-unit-head h2 { font-size: 20px; }
}

/* نص الشرح مكتوبًا: لمن لا يستعمل الحركة أو الصوت، ولمحركات البحث */
.t-outline { margin-top: 22px; }
.t-outline details { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 4px 18px; }
.t-outline summary { display: flex; align-items: center; min-height: 52px; font-weight: 700; cursor: pointer; }
.t-outline ol { margin: 0 0 14px; padding-inline-start: 22px; display: grid; gap: 10px; }
.t-outline li { line-height: 1.9; }
.t-outline b { display: block; }
.t-outline span { color: var(--muted); }

.t-savenote { font-size: 14px; color: var(--hero-muted); }
.t-savenote a { color: #ffd56b; text-decoration: underline; text-underline-offset: 3px; }
