/**
 * الصفحات العامّة — التصميم الجديد (مالك، 2026-10-31: «كلّ الصفحات الخارجيّة بهذا الأسلوب»).
 *
 * المرجع: html_mockups/think-redesign/ (موكابٌ محلّيّ اعتمده مالك) · PRODUCT.md.
 * الخطّان من خادمنا (CSP: font-src 'self'): Alexandria للعناوين، Vazirmatn للنصّ.
 *
 * ⚠️ كلّ صنفٍ ومتغيّرٍ هنا يبدأ بـ p- / --p-: school.css فيه .btn و.wrap و.lede و--ink و--accent بمعانٍ أخرى،
 *    وهو يُحمَّل قبل هذا الملفّ في كلّ صفحة. البادئة تمنع أن يغلب أحدهما الآخر بصمت.
 * ⚠️ إعادة ضبط العناصر داخل .p-main و.p-top و.p-foot وحدها: الصفحة التي لم تُنقل بعد تبقى سليمة.
 */

@font-face { font-family: 'Alexandria'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/alexandria-600-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Alexandria'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/alexandria-600-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alexandria'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/alexandria-700-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Alexandria'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/alexandria-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alexandria'; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/alexandria-800-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Alexandria'; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/alexandria-800-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/vazirmatn-400-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/vazirmatn-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/vazirmatn-600-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/vazirmatn-600-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/vazirmatn-700-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/vazirmatn-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --p-bg:        oklch(0.985 0.004 160);
  --p-surface:   oklch(1 0 0);
  --p-ink:       oklch(0.22 0.035 160);
  --p-ink-2:     oklch(0.42 0.025 160);
  --p-line:      oklch(0.90 0.012 160);
  --p-brand:     oklch(0.33 0.075 158);
  --p-brand-deep:oklch(0.25 0.055 158);
  --p-brand-tint:oklch(0.95 0.025 158);
  --p-on-brand:  oklch(0.97 0.01 158);
  --p-on-brand-2:oklch(0.84 0.03 158);
  --p-accent:    oklch(0.84 0.15 82);
  --p-accent-ink:oklch(0.27 0.06 70);
  --p-accent-tint:oklch(0.96 0.045 85);

  --p-s-chess:   oklch(0.38 0.08 255);
  --p-s-abacus:  oklch(0.55 0.10 190);
  --p-s-cube:    oklch(0.58 0.19 30);
  --p-s-logic:   oklch(0.50 0.15 295);
  --p-s-decision:oklch(0.66 0.15 55);
  --p-s-memory:  oklch(0.55 0.13 250);

  --p-f-display: 'Alexandria', 'Vazirmatn', 'Tajawal', system-ui, sans-serif;
  --p-f-text:    'Vazirmatn', 'Tajawal', system-ui, sans-serif;

  --p-step--1: clamp(0.84rem, 0.8rem + 0.15vw, 0.92rem);
  --p-step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --p-step-1:  clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
  --p-step-2:  clamp(1.5rem, 1.3rem + 0.9vw, 2.05rem);
  --p-step-3:  clamp(1.95rem, 1.55rem + 1.8vw, 3.05rem);
  --p-step-4:  clamp(2.35rem, 1.7rem + 3vw, 4.1rem);

  --p-wrap: 1180px;
  --p-gutter: clamp(16px, 4vw, 40px);
  --p-r: 18px;
  --p-r-sm: 12px;
  --p-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --p-z-sticky: 10; --p-z-menu: 20; --p-z-dev: 30;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--p-bg); color: var(--p-ink);
  font-family: var(--p-f-text); line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--p-f-display); }
/* إعادة الضبط داخل التصميم الجديد وحده — الصفحات القديمة تبقى كما هي حتى تُنقل */
:where(.p-main, .p-top, .p-foot) :is(h1, h2, h3, h4, p) { margin: 0; }
:where(.p-main, .p-top, .p-foot) :is(h1, h2, h3) { font-weight: 700; line-height: 1.3; text-wrap: balance; letter-spacing: -0.01em; }
:where(.p-main, .p-top, .p-foot) p { text-wrap: pretty; }
:where(.p-main, .p-top, .p-foot) :is(img, svg) { display: block; max-width: 100%; }
:where(.p-main, .p-top, .p-foot) a { color: inherit; }
.p-main { font-size: var(--p-step-0); }
.p-wrap { width: min(var(--p-wrap), 100% - 2 * var(--p-gutter)); margin-inline: auto; }
.p-lede { font-size: var(--p-step-1); line-height: 1.8; color: var(--p-ink-2); max-width: 46ch; }
.p-muted { color: var(--p-ink-2); }
.p-tag-honest {
  justify-self: start; width: fit-content;
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--p-step--1); font-weight: 600;
  color: var(--p-accent-ink); background: var(--p-accent-tint); border-radius: 99px; padding: 3px 12px;
}
:focus-visible { outline: 3px solid var(--p-accent); outline-offset: 3px; border-radius: 6px; }

/* ── الأزرار ── */
.p-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 99px; border: 0; cursor: pointer;
  font: 600 var(--p-step-0)/1 var(--p-f-display); text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--p-ease), background-color .25s var(--p-ease), box-shadow .25s var(--p-ease);
}
.p-btn:active { transform: translateY(1px) scale(.99); }
.p-btn--accent { background: var(--p-accent); color: var(--p-accent-ink); box-shadow: 0 8px 24px -10px oklch(0.6 0.15 80 / .7); }
.p-btn--accent:hover { background: oklch(0.87 0.15 85); }
.p-btn--ghost { background: transparent; color: var(--p-on-brand); box-shadow: inset 0 0 0 1.5px oklch(1 0 0 / .35); }
.p-btn--ghost:hover { box-shadow: inset 0 0 0 1.5px oklch(1 0 0 / .8); }
.p-btn--ink { background: var(--p-brand); color: var(--p-on-brand); }
.p-btn--ink:hover { background: var(--p-brand-deep); }
.p-btn--line { background: var(--p-surface); color: var(--p-ink); box-shadow: inset 0 0 0 1.5px var(--p-line); }
.p-btn--line:hover { box-shadow: inset 0 0 0 1.5px var(--p-ink-2); }
.p-btn .p-arrow { transition: transform .25s var(--p-ease); }
.p-btn:hover .p-arrow { transform: translateX(-4px); }

/* ── الرأس ── */
.p-top { position: sticky; top: 0; z-index: var(--p-z-sticky); background: var(--p-brand-deep); color: var(--p-on-brand); }
.p-top--light { background: oklch(0.985 0.004 160 / .92); color: var(--p-ink); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--p-line); }
.p-top__in { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.p-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--p-f-display); }
.p-logo__mark { width: 34px; height: 34px; }
.p-logo__name { font-weight: 700; font-size: 1.12rem; line-height: 1.15; }
.p-logo__name small { display: block; font-weight: 400; font-size: .72rem; opacity: .75; }
.p-nav { display: flex; gap: 24px; margin-inline-start: auto; font-size: .96rem; }
.p-nav a { text-decoration: none; opacity: .86; padding: 6px 0; }
.p-nav a:hover, .p-nav a[aria-current] { opacity: 1; text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; text-decoration-color: var(--p-accent); }
.p-top__act { display: flex; align-items: center; gap: 18px; }
.p-top__act .p-login { text-decoration: none; font-weight: 600; font-size: .96rem; }
.p-top .p-btn { min-height: 44px; padding: 0 20px; font-size: .95rem; }
.p-menu-btn { display: none; }

@media (max-width: 900px) {
  .p-nav, .p-top__act .p-login { display: none; }
  .p-top__act .p-login:only-child { display: inline; }  /* الترويسة المختصرة (focus): رابطها الوحيد يبقى على الهاتف */
  .p-top__act { margin-inline-start: auto; }
  .p-menu-btn {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    background: transparent; color: inherit; border: 1.5px solid currentColor; opacity: .7; cursor: pointer;
  }
  .p-nav.is-open {
    display: flex; flex-direction: column; gap: 4px; position: absolute; inset-inline: 0; top: 68px;
    background: var(--p-brand-deep); padding: 12px var(--p-gutter) 22px; z-index: var(--p-z-menu); font-size: 1.1rem;
  }
  .p-top--light .p-nav.is-open { background: var(--p-bg); border-bottom: 1px solid var(--p-line); }
  .p-nav.is-open a { padding: 12px 0; border-bottom: 1px solid oklch(1 0 0 / .1); }
}

/* ── البطل ── */
.p-hero { background: var(--p-brand-deep); color: var(--p-on-brand); overflow: clip; position: relative; }
.p-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 70% at 15% 40%, oklch(0.36 0.08 158 / .9), transparent 70%);
}
.p-hero__in { position: relative; display: grid; grid-template-columns: 1.02fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(40px, 7vw, 96px) clamp(48px, 7vw, 104px); }
.p-hero h1 { font-size: clamp(2.3rem, 1.6rem + 2.7vw, 3.75rem); font-weight: 800; line-height: 1.25; }
.p-nb { white-space: nowrap; }
@media (max-width: 420px) { .p-nb { white-space: normal; } }
.p-hero h1 em { font-style: normal; color: var(--p-accent); }
.p-hero .p-lede { color: var(--p-on-brand-2); margin-top: 22px; }
.p-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.p-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 30px; padding: 0; list-style: none; font-size: var(--p-step--1); color: var(--p-on-brand-2); }
.p-facts li { display: flex; align-items: center; gap: 8px; }
.p-facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--p-accent); }

@media (max-width: 1100px) {
  .p-hero__in { grid-template-columns: 1fr; }
  .p-hero__visual { width: min(100%, 680px); margin-inline: auto !important; }
  .p-hero__visual { order: 2; }
}

/* جهاز يعرض الدرس — أفقيّ كما التطبيق */
.p-device {
  background: oklch(0.16 0.02 160); border-radius: 26px; padding: 12px;
  box-shadow: 0 40px 80px -30px oklch(0.1 0.03 160 / .8), inset 0 0 0 1px oklch(1 0 0 / .08);
  transform: rotate(-1.5deg);
}
.p-screen { background: var(--p-bg); border-radius: 16px; overflow: hidden; color: var(--p-ink); display: grid; grid-template-columns: 1.08fr 1fr; }
.p-screen__board { background: oklch(0.95 0.02 140); display: grid; place-items: center; padding: 6%; }
.p-screen__side { padding: 7% 7% 6%; display: flex; flex-direction: column; gap: 10px; font-size: clamp(.7rem, .55rem + .45vw, .95rem); }
.p-tutor { display: flex; align-items: center; gap: 8px; font-weight: 600; font-family: var(--p-f-display); font-size: .92em; }
.p-tutor__face { width: 30px; height: 30px; border-radius: 50%; background: var(--p-c, var(--p-s-chess)); color: #fff; display: grid; place-items: center; font-size: .8em; }
.p-bubble { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 14px; padding: 9px 12px; line-height: 1.7; }
.p-opts { display: grid; gap: 7px; margin-top: auto; }
.p-opt { display: flex; align-items: center; gap: 9px; background: var(--p-surface); border: 1.5px solid var(--p-line); border-radius: 12px; padding: 7px 10px; font-weight: 600; }
.p-opt b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--p-brand-tint); font-family: var(--p-f-display); font-size: .85em; }
.p-opt.is-right { border-color: var(--p-brand); background: var(--p-brand-tint); }
.p-hero__note { margin-top: 14px; font-size: var(--p-step--1); color: var(--p-on-brand-2); text-align: center; }

/* ── الأقسام ── */
.p-sec { padding-block: clamp(64px, 9vw, 128px); }
.p-sec__head { display: grid; gap: 14px; max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.p-sec__head h2 { font-size: var(--p-step-3); }
.p-sec--tint { background: var(--p-brand-tint); }
.p-sec--brand { background: var(--p-brand); color: var(--p-on-brand); }
.p-sec--brand .p-lede, .p-sec--brand .p-muted { color: var(--p-on-brand-2); }

/* المواد الستّ — لكلّ مادّةٍ عالمها */
.p-subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.p-subj {
  --p-c: var(--p-s-chess);
  position: relative; display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--p-ink);
  background: var(--p-surface); border-radius: var(--p-r); overflow: hidden; border: 1px solid var(--p-line);
  transition: transform .35s var(--p-ease), box-shadow .35s var(--p-ease);
}
.p-subj:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -24px oklch(0.3 0.05 160 / .45); }
.p-subj__art { background: color-mix(in oklch, var(--p-c) 12%, white); aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 18px; }
.p-subj__art svg { height: 100%; width: auto; }
.p-subj__body { padding: 20px 22px 22px; display: grid; gap: 6px; align-content: start; }
.p-subj__body h3 { font-size: var(--p-step-1); }
.p-subj__tag { font-size: var(--p-step-0); color: var(--p-ink); }
.p-subj__meta { font-size: var(--p-step--1); color: var(--p-ink-2); margin-top: 4px; }
.p-subj--chess { --p-c: var(--p-s-chess); } .p-subj--abacus { --p-c: var(--p-s-abacus); } .p-subj--cube { --p-c: var(--p-s-cube); }
.p-subj--logic { --p-c: var(--p-s-logic); } .p-subj--decision { --p-c: var(--p-s-decision); } .p-subj--memory { --p-c: var(--p-s-memory); }

/* كيف يمشي الدرس — تسلسلٌ حقيقيّ */
.p-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 3vw, 36px); counter-reset: s; list-style: none; padding: 0; margin: 0; }
.p-step { display: grid; gap: 12px; align-content: start; }
.p-step__n { font-family: var(--p-f-display); font-weight: 800; font-size: var(--p-step-3); color: var(--p-brand); line-height: 1; }
.p-step h3 { font-size: var(--p-step-1); }
.p-step p { color: var(--p-ink-2); }
.p-step__mini { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-r-sm); padding: 14px 16px; font-size: var(--p-step--1); line-height: 1.8; }
.p-step__mini .p-who { font-weight: 700; font-family: var(--p-f-display); }
@media (max-width: 820px) { .p-steps { grid-template-columns: 1fr; } }

/* المسار التكيّفيّ */
.p-paths { background: var(--p-surface); border-radius: var(--p-r); border: 1px solid var(--p-line); padding: clamp(18px, 3vw, 32px); display: grid; gap: 4px; }
.p-path { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--p-line); }
.p-path:last-of-type { border-bottom: 0; }
.p-path h3 { font-size: var(--p-step-0); }
.p-path p { font-size: var(--p-step--1); color: var(--p-ink-2); line-height: 1.7; }
.p-track { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.p-dot { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--p-line); background: var(--p-bg); }
.p-dot--idea { background: var(--p-accent); border-color: var(--p-accent); }
.p-dot--again { background: var(--p-s-decision); border-color: var(--p-s-decision); }
.p-dot--slow { background: var(--p-s-memory); border-color: var(--p-s-memory); }
.p-dot--skip { border-style: dashed; width: auto; padding: 0 9px; font-size: .74rem; display: grid; place-items: center; color: var(--p-ink-2); }
.p-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--p-step--1); color: var(--p-ink-2); padding-top: 14px; }
.p-legend span { display: inline-flex; align-items: center; gap: 7px; }
.p-legend .p-dot { width: 16px; height: 16px; border-radius: 5px; }
@media (max-width: 700px) { .p-path { grid-template-columns: 1fr; gap: 8px; } }

/* ما يصلك أنت: التقرير والمدير */
.p-duo { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .p-duo { grid-template-columns: 1fr; } }
.p-report { background: var(--p-surface); border-radius: var(--p-r); border: 1px solid var(--p-line); padding: clamp(20px, 3vw, 30px); display: grid; gap: 16px; }
.p-report__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.p-report h3 { font-size: var(--p-step-1); }
.p-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.p-num { background: var(--p-bg); border-radius: var(--p-r-sm); padding: 12px; text-align: center; }
.p-num b { display: block; font-family: var(--p-f-display); font-size: var(--p-step-2); line-height: 1.2; }
.p-num span { font-size: var(--p-step--1); color: var(--p-ink-2); }
.p-skill { border: 1.5px solid var(--p-brand); border-radius: var(--p-r-sm); padding: 14px 16px; display: grid; gap: 6px; }
.p-skill--soft { border-style: dashed; border-color: var(--p-line); }
.p-skill__h { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-family: var(--p-f-display); }
.p-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.p-chip { font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; color: #fff; }
.p-chat { background: var(--p-brand-deep); color: var(--p-on-brand); border-radius: var(--p-r); padding: clamp(20px, 3vw, 30px); display: grid; gap: 14px; }
.p-chat h3 { font-size: var(--p-step-1); }
.p-chat .p-muted { color: var(--p-on-brand-2); }
.p-prog { display: flex; gap: 4px; }
.p-prog i { flex: 1; height: 5px; border-radius: 9px; background: var(--p-line); }
.p-prog i.on { background: var(--p-brand); }
.p-msg { border-radius: 16px; padding: 12px 16px; line-height: 1.8; max-width: 92%; }
.p-msg--me { background: oklch(1 0 0 / .1); justify-self: start; }
.p-msg--him { background: var(--p-surface); color: var(--p-ink); justify-self: end; }
.p-msg--him b { font-family: var(--p-f-display); }

/* إلى جانب مدرسته */
.p-statement { font-family: var(--p-f-display); font-size: var(--p-step-3); line-height: 1.45; font-weight: 600; max-width: 24ch; }
.p-statement em { font-style: normal; color: var(--p-accent); }

/* ما لا نَدّعيه */
.p-honest { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; list-style: none; padding: 0; margin: 0; }
.p-honest li { padding: 22px 0; border-top: 1px solid var(--p-line); display: grid; gap: 6px; }
.p-honest b { font-family: var(--p-f-display); font-size: var(--p-step-1); font-weight: 700; }
.p-honest span { color: var(--p-ink-2); }
@media (max-width: 760px) { .p-honest { grid-template-columns: 1fr; } }

/* للمعلّمين */
.p-teach { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .p-teach { grid-template-columns: 1fr; } }
.p-board-screen { background: oklch(0.14 0.01 160); border-radius: 20px; padding: 14px; box-shadow: 0 30px 60px -30px oklch(0 0 0 / .7); }
.p-board-screen__in { background: var(--p-bg); border-radius: 12px; aspect-ratio: 16 / 9; padding: 5% 6%; display: grid; grid-template-rows: auto; align-content: space-between; gap: 4%; color: var(--p-ink); }
.p-board-screen h4 { margin: 0; font: 700 clamp(.95rem, .6rem + 1.4vw, 1.6rem)/1.4 var(--p-f-display); text-align: center; }
.p-class-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4%; }
.p-class-opt { display: flex; align-items: center; gap: 4%; background: var(--p-surface); border: 2px solid var(--p-line); border-radius: 12px; padding: 3% 4%; font: 600 clamp(.8rem, .5rem + 1vw, 1.25rem)/1.3 var(--p-f-display); }
.p-class-opt b { display: grid; place-items: center; min-width: 2em; height: 2em; border-radius: 10px; background: var(--p-brand); color: var(--p-on-brand); }
.p-praise { text-align: center; font: 700 clamp(.85rem, .5rem + 1vw, 1.3rem)/1.3 var(--p-f-display); color: var(--p-brand); }
.p-keys { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; font-size: var(--p-step--1); color: var(--p-on-brand-2); }
kbd { font: 700 .82rem/1 var(--p-f-display); background: oklch(1 0 0 / .12); border: 1px solid oklch(1 0 0 / .25); border-bottom-width: 3px; border-radius: 7px; padding: 5px 8px; color: var(--p-on-brand); margin-inline-end: 6px; }
.p-ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.p-ticks li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.p-ticks li::before { content: "✓"; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--p-accent); color: var(--p-accent-ink); font-weight: 800; font-size: .85rem; margin-top: 3px; }

/* أسئلة */
.p-faq { display: grid; gap: 10px; max-width: 820px; }
.p-faq details { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-r-sm); padding: 0 20px; }
.p-faq summary { cursor: pointer; list-style: none; padding: 18px 0; font: 600 var(--p-step-0)/1.6 var(--p-f-display); display: flex; justify-content: space-between; gap: 16px; }
.p-faq summary::-webkit-details-marker { display: none; }
.p-faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--p-brand); transition: transform .3s var(--p-ease); }
.p-faq details[open] summary::after { transform: rotate(45deg); }
.p-faq details p { padding-bottom: 18px; color: var(--p-ink-2); }

/* الختام والذيل */
.p-final { background: var(--p-accent); color: var(--p-accent-ink); }
.p-final__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-block: clamp(48px, 7vw, 88px); }
.p-final h2 { font-size: var(--p-step-3); max-width: 18ch; }
.p-final .p-btn--ink { min-height: 58px; padding: 0 32px; }
.p-foot { background: var(--p-brand-deep); color: var(--p-on-brand-2); padding-block: 48px 36px; font-size: var(--p-step--1); }
.p-foot__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.p-foot h4 { margin: 0 0 10px; font: 700 .95rem var(--p-f-display); color: var(--p-on-brand); }
.p-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.p-foot a { text-decoration: none; }
.p-foot a:hover { color: var(--p-on-brand); }
.p-foot__base { margin-top: 36px; padding-top: 18px; border-top: 1px solid oklch(1 0 0 / .12); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) { .p-foot__grid { grid-template-columns: 1fr 1fr; } .p-foot__grid > :first-child { grid-column: 1 / -1; } }

/* صفحة مادّة */
.p-sh { --p-c: var(--p-s-chess); background: color-mix(in oklch, var(--p-c) 10%, var(--p-bg)); }
.p-sh__in { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(36px, 6vw, 84px); }
.p-sh h1 { font-size: var(--p-step-4); font-weight: 800; }
.p-sh .p-crumb { font-size: var(--p-step--1); color: var(--p-ink-2); margin-bottom: 14px; }
.p-sh .p-crumb a { text-decoration: none; }
.p-sh__art { background: var(--p-surface); border-radius: 28px; padding: 6%; box-shadow: 0 30px 60px -36px oklch(0.3 0.05 255 / .5); }
@media (max-width: 900px) { .p-sh__in { grid-template-columns: 1fr; } }
.p-journey { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; position: relative; }
.p-journey li { display: grid; grid-template-columns: 56px 1fr auto; gap: 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--p-line); }
.p-journey .p-n { font: 800 var(--p-step-2)/1 var(--p-f-display); color: var(--p-c, var(--p-brand)); }
.p-journey h3 { font-size: var(--p-step-1); }
.p-journey p { color: var(--p-ink-2); font-size: var(--p-step--1); }
.p-journey .p-cnt { font-size: var(--p-step--1); color: var(--p-ink-2); white-space: nowrap; }

/* المدارس */
.p-how3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; list-style: none; padding: 0; margin: 0; }
.p-how3 li { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-r); padding: 24px; display: grid; gap: 8px; align-content: start; }
.p-how3 .p-n { font: 800 var(--p-step-2)/1 var(--p-f-display); color: var(--p-brand); }
.p-how3 h3 { font-size: var(--p-step-1); }
.p-how3 p { color: var(--p-ink-2); }
@media (max-width: 820px) { .p-how3 { grid-template-columns: 1fr; } }
.p-tcard { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-r); padding: clamp(20px, 3vw, 30px); display: grid; gap: 14px; }
.p-tcard dl { margin: 0; display: grid; gap: 12px; }
.p-tcard dt { font: 700 var(--p-step--1) var(--p-f-display); color: var(--p-brand); }
.p-tcard dd { margin: 2px 0 0; }
.p-human { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-r); padding: 20px 24px; }
.p-human__face { width: 52px; height: 52px; border-radius: 50%; background: var(--p-brand); color: var(--p-on-brand); display: grid; place-items: center; font: 700 1.1rem var(--p-f-display); }

/* التسجيل */
.p-auth { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1fr 1fr; }
.p-auth__side { background: var(--p-brand-deep); color: var(--p-on-brand); padding: clamp(32px, 6vw, 72px); display: grid; align-content: center; gap: 18px; }
.p-auth__side h1 { font-size: var(--p-step-3); }
.p-auth__main { padding: clamp(28px, 5vw, 64px); display: grid; align-content: center; }
.p-who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 26px; }
.p-who-pick label { position: relative; display: grid; gap: 4px; border: 1.5px solid var(--p-line); border-radius: var(--p-r-sm); padding: 14px 16px; cursor: pointer; background: var(--p-surface); }
.p-who-pick input { position: absolute; opacity: 0; }
.p-who-pick label:has(input:checked) { border-color: var(--p-brand); box-shadow: inset 0 0 0 1.5px var(--p-brand); background: var(--p-brand-tint); }
.p-who-pick b { font-family: var(--p-f-display); }
.p-who-pick span { font-size: var(--p-step--1); color: var(--p-ink-2); }
.p-form { display: grid; gap: 16px; max-width: 440px; }
.p-field { display: grid; gap: 6px; }
.p-field label { font: 600 .95rem var(--p-f-display); }
.p-field input, .p-field select { font: inherit; min-height: 50px; border-radius: var(--p-r-sm); border: 1.5px solid var(--p-line); padding: 0 14px; background: var(--p-surface); color: var(--p-ink); }
.p-field input:focus, .p-field select:focus { outline: none; border-color: var(--p-brand); box-shadow: 0 0 0 4px var(--p-brand-tint); }
.p-field small { color: var(--p-ink-2); font-size: var(--p-step--1); }
.p-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p-seg label { display: grid; place-items: center; min-height: 48px; border: 1.5px solid var(--p-line); border-radius: var(--p-r-sm); cursor: pointer; font-weight: 600; background: var(--p-surface); }
.p-seg input { position: absolute; opacity: 0; }
.p-seg label:has(input:checked) { border-color: var(--p-brand); background: var(--p-brand-tint); }
@media (max-width: 860px) { .p-auth { grid-template-columns: 1fr; } .p-auth__side { padding-block: 36px; } }

/* الخطوط */
.p-spec { display: grid; gap: 18px; }
.p-spec__row { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-r); padding: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: 230px 1fr; gap: 28px; }
.p-spec__row.is-pick { border: 2px solid var(--p-brand); }
.p-spec__label { display: grid; gap: 8px; align-content: start; font-size: var(--p-step--1); color: var(--p-ink-2); }
.p-spec__label b { font: 700 1.05rem var(--p-f-display); color: var(--p-ink); }
.p-spec__h { font-size: var(--p-step-3); line-height: 1.3; margin-bottom: 14px; }
.p-spec__p { max-width: 62ch; }
@media (max-width: 760px) { .p-spec__row { grid-template-columns: 1fr; } }
.p-swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.p-sw { border-radius: var(--p-r-sm); overflow: hidden; border: 1px solid var(--p-line); background: var(--p-surface); font-size: var(--p-step--1); }
.p-sw i { display: block; height: 72px; }
.p-sw div { padding: 10px 12px; }


/* حركة الدخول — تُحسّن ما هو ظاهرٌ أصلاً */
@media (prefers-reduced-motion: no-preference) {
  .p-hero h1, .p-hero .p-lede, .p-hero__cta, .p-facts { animation: rise .9s var(--p-ease) both; }
  .p-hero .p-lede { animation-delay: .08s; } .p-hero__cta { animation-delay: .16s; } .p-facts { animation-delay: .24s; }
  .p-hero__visual { animation: settle 1.1s var(--p-ease) .12s both; }
  .p-knight-path { stroke-dasharray: 120; animation: draw 1.4s var(--p-ease) .9s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes settle { from { opacity: 0; transform: translateY(24px) rotate(0deg); } }
@keyframes draw { from { stroke-dashoffset: 120; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* الهاتف: المواد صفوفٌ أفقيّة مدمجة، والجهاز يتّسع لمحتواه، والشعار سطرٌ واحد */
.p-logo__name { white-space: nowrap; }
@media (max-width: 560px) {
  /* البطل: الجملة والزرّ، ثم الدرس يطلّ في الشاشة الأولى */
  .p-hero__in { padding-block: 28px 44px; gap: 26px; }
  .p-hero .p-lede { font-size: var(--p-step-0); margin-top: 14px; }
  .p-hero__cta { margin-top: 22px; }
  .p-hero__cta .p-btn--accent { flex: 1 1 100%; }
  .p-hero__cta .p-btn--ghost { flex: 1 1 100%; min-height: 46px; box-shadow: none; text-decoration: underline; text-underline-offset: 6px; padding: 0; }
  .p-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 18px; }
  .p-hero__note { margin-top: 10px; }

  /* المواد: شبكةٌ من عمودين — الستّ في ثلاثة صفوف */
  .p-subjects { grid-template-columns: 1fr 1fr; gap: 10px; }
  .p-subj { border-radius: 14px; }
  .p-subj:hover { transform: none; }
  .p-subj__art { aspect-ratio: 4 / 3; padding: 10px; }
  .p-subj__body { padding: 12px 12px 14px; gap: 2px; }
  .p-subj__body h3 { font-size: 1.02rem; }
  .p-subj__tag { font-size: .84rem; line-height: 1.65; }
  .p-subj__meta { font-size: .76rem; margin-top: 2px; }

  /* الدرس: الرقم بجانب العنوان */
  .p-step { grid-template-columns: 40px 1fr; column-gap: 12px; row-gap: 8px; }
  .p-step__n { grid-row: 1 / span 2; font-size: var(--p-step-2); }
  .p-step__mini { grid-column: 1 / -1; }

  .p-screen { aspect-ratio: auto; grid-template-columns: 1fr 1.05fr; }
  .p-screen__side { padding: 12px; gap: 8px; }
  .p-opts { margin-top: 4px; }
  .p-device { transform: none; padding: 9px; border-radius: 20px; }
  .p-statement { font-size: var(--p-step-2); }
  .p-sec { padding-block: 56px; }
  .p-sec__head { margin-bottom: 26px; }
  .p-nums { gap: 6px; } .p-num { padding: 10px 6px; }
  .p-final__in .p-hero__cta { width: 100%; }
  .p-final__in .p-btn { flex: 1 1 100%; }
}

/* زرّ التسجيل الثابت على الهاتف — يظهر بعد البطل، ويختفي عند الختام */
.p-mcta { display: none; }
@media (max-width: 700px) {
  .p-mcta {
    display: flex; position: fixed; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: var(--p-z-sticky);
    gap: 10px; align-items: center; padding: 8px 8px 8px 8px; border-radius: 99px;
    background: var(--p-brand-deep); box-shadow: 0 16px 34px -14px oklch(0.1 0.03 160 / .7);
    transform: translateY(140%); transition: transform .45s var(--p-ease);
  }
  .p-mcta.is-on { transform: none; }
  .p-mcta .p-btn { flex: 1; min-height: 50px; }
  .p-mcta > span { color: var(--p-on-brand-2); font-size: .8rem; padding-inline: 10px 2px; line-height: 1.4; }
  body.has-mcta { padding-bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) { .p-mcta { transition: none; } }
.p-hero__alt { margin-top: 18px; font-size: var(--p-step--1); color: var(--p-on-brand-2); }
.p-hero__alt a { color: var(--p-on-brand); font-weight: 600; text-underline-offset: 5px; }
/* الهاتف: النموذج أوّلاً، والترحيب بعده */
@media (max-width: 860px) {
  .p-auth__main { order: 1; padding-block: 24px 40px; }
  .p-auth__side { order: 2; }
  .p-auth__side h1 { font-size: var(--p-step-2); }
}

/* ── الترويسة في الموقع: العلامة، وقائمة الهاتف <details> بلا JavaScript ── */
.p-top .p-logo { text-decoration: none; }
.p-top .brand-name { font-family: var(--p-f-display); }
.p-top--light .brand-name { color: var(--p-ink); }
.p-menu { display: none; position: relative; }
.p-menu > summary {
  list-style: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  border: 1.5px solid color-mix(in oklch, currentColor 40%, transparent);
}
.p-menu > summary::-webkit-details-marker { display: none; }
.p-menu[open] > summary .ic-ui-menu, .p-menu:not([open]) > summary .ic-ui-close { display: none; }
.p-menu__list {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; min-width: 240px; z-index: var(--p-z-menu);
  display: flex; flex-direction: column; padding: 8px; border-radius: 16px;
  background: var(--p-brand-deep); color: var(--p-on-brand); box-shadow: 0 24px 50px -18px oklch(0.1 0.03 160 / .6);
}
.p-top--light .p-menu__list { background: var(--p-surface); color: var(--p-ink); border: 1px solid var(--p-line); }
.p-menu__list a { padding: 12px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; min-height: 44px; }
.p-menu__list a:hover { background: color-mix(in oklch, currentColor 8%, transparent); }
.p-menu__login { margin-top: 4px; border-top: 1px solid color-mix(in oklch, currentColor 15%, transparent); border-radius: 0 0 10px 10px !important; }
@media (max-width: 900px) {
  .p-menu { display: block; }
  .p-top .p-btn { min-height: 42px; padding: 0 16px; }
}
@media (max-width: 380px) { .p-top .brand-name { font-size: .9em; } }

/* الذيل */
.p-foot__brand p { margin: 12px 0 10px; max-width: 38ch; line-height: 1.8; }
.p-foot__brand small { display: block; font-size: .78rem; line-height: 1.7; opacity: .8; max-width: 46ch; }
.p-foot__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.p-foot li a { display: inline-block; padding: 3px 0; }

/* ── طاقم المدرسة: المدير شريطٌ عريض، والمعلّمون بطاقاتٌ بلون مادّتهم؛ على الهاتف تُسحب أفقيّاً ── */
.p-ava { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--p-c, var(--p-brand)); color: #fff; font: 700 1.2rem var(--p-f-display); }
.p-ava--lg { width: 64px; height: 64px; font-size: 1.5rem; background: var(--p-brand-deep); box-shadow: 0 0 0 4px var(--p-accent); }
.p-staff-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--p-brand-tint); border-radius: var(--p-r); padding: 22px 24px; margin-bottom: 18px; }
.p-staff-head > div { flex: 1 1 320px; display: grid; gap: 6px; }
.p-staff-head h3 { font-size: var(--p-step-1); }
.p-staff-head h3 .p-muted { font: 400 var(--p-step-0) var(--p-f-text); }
.p-staff-line { font-family: var(--p-f-display); font-weight: 600; font-size: 1.05rem; line-height: 1.7; color: var(--p-ink); }
.p-staff { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.p-tch { background: var(--p-surface); border: 1px solid var(--p-line); border-top: 4px solid var(--p-c, var(--p-brand)); border-radius: var(--p-r); padding: 20px 20px 18px; display: grid; gap: 12px; align-content: start; }
.p-tch__top { display: flex; align-items: center; gap: 12px; }
.p-tch__top h3 { font-size: var(--p-step-1); line-height: 1.3; }
.p-tch__role { font-size: var(--p-step--1); color: var(--p-ink-2); }
.p-tch__dl { margin: 0; display: grid; gap: 10px; font-size: var(--p-step--1); }
.p-tch__dl dt { font: 700 .82rem var(--p-f-display); color: color-mix(in oklch, var(--p-c, var(--p-brand)) 75%, var(--p-ink)); }
.p-tch__dl dd { margin: 2px 0 0; color: var(--p-ink-2); line-height: 1.75; }
.p-tch__tone { display: flex; flex-wrap: wrap; gap: 6px; }
.p-tch__tone span { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: color-mix(in oklch, var(--p-c, var(--p-brand)) 12%, white); color: color-mix(in oklch, var(--p-c, var(--p-brand)) 70%, var(--p-ink)); }
@media (max-width: 700px) {
  .p-staff { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-inline: calc(-1 * var(--p-gutter)); padding: 4px var(--p-gutter) 14px; scrollbar-width: none; }
  .p-staff::-webkit-scrollbar { display: none; }
  .p-tch { flex: 0 0 82%; scroll-snap-align: center; }
  .p-staff-head { padding: 18px; gap: 14px; }
  .p-staff-head .p-btn { flex: 1 1 100%; }
}
.p-paths__note { font-size: var(--p-step--1); color: var(--p-ink-2); padding-top: 12px; }

/* ── البطل: درس المعداد (مالك 2026-10-31: «إشي ملفت واضح وينفهم بسهولة» — الرقعة كانت تُقصّ على الآيباد) ──
   الشاشة بلا نسبةٍ ثابتة: تتّسع لمحتواها فلا يُقصّ شيء على أيّ عرض. */
.p-hero .p-screen__board { background: oklch(0.96 0.025 195); padding: 5% 6%; }
.p-abacus { width: 100%; max-width: 320px; height: auto; margin-inline: auto; }
.p-abacus .on { fill: #1f7f86; }
.p-abacus .off { fill: #cfe6e7; }
.p-opts--num .p-opt { min-height: 48px; }
.p-opts--num .p-opt b { min-width: 2.6em; height: 1.9em; font-size: 1.15em; border-radius: 9px; }
.p-opts--num .p-opt.is-right b { background: var(--p-brand); color: var(--p-on-brand); }
.p-hero .p-screen__side { justify-content: center; }
.p-subj-inner { margin-top: 6px !important; font-size: var(--p-step--1); color: var(--p-ink-2); }
