/* مقياس الجاهزية — هوية أكاديمية المشاريع. الجوال أولًا. */
:root {
  --ink: #0D1B4C;        /* كحلي الشعار: النص والعناوين */
  --ink-2: #3E3C63;      /* نص ثانوي */
  --muted: #5B6680;
  --royal: #1447C0;      /* الأزرق الملكي: الأزرار */
  --royal-d: #0F3796;
  --blue: #365AA4;
  --sky: #1FD0F5;        /* السماوي: المسطرة والتقدّم */
  --mist: #E2F5FF;
  --paper: #F6F8FC;
  --line: #DCE3F0;
  --white: #FFFFFF;
  --amber: #E8952B;      /* اللون الوحيد خارج الهوية: التنبيهات */
  --amber-bg: #FFF4E5;
  --good: #138A5B;
  --r-s: 10px; --r-m: 16px; --r-l: 22px;
  --shadow: 0 1px 2px rgba(13, 27, 76, .06), 0 8px 24px -12px rgba(13, 27, 76, .18);
  --font: 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --pad: 16px;
  --bar-h: 52px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: 17px; line-height: 1.7; min-height: 100dvh; -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.proto { background: var(--ink); color: #CFE6FF; font-size: 13px; text-align: center; padding: 6px var(--pad); }

/* ---------- الرأس والمسطرة ---------- */
.brandbar { position: sticky; top: 0; z-index: 12; background: var(--ink); border-bottom: 1px solid rgba(255, 255, 255, .08); padding: 0 var(--pad); padding-top: env(safe-area-inset-top); }
.brandbar-in { max-width: 620px; margin: 0 auto; height: var(--bar-h); display: flex; align-items: center; }
.brandbar-link { display: inline-flex; align-items: center; height: 100%; padding: 4px 0; border-radius: 6px; }
.brandbar-link img { height: 36px; width: auto; }
/* حقل الفخ مخفي بالقصّ: الإزاحة لليسار في صفحة RTL كانت توسّع الصفحة فيصغّرها الجوال */
.hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; }
.top { position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top)); z-index: 10; background: rgba(246, 248, 252, .94); backdrop-filter: blur(8px); padding: 10px var(--pad) 8px; border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; max-width: 620px; margin: 0 auto; }
.back { display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; padding: 8px 4px; min-height: 44px; color: var(--blue); font-weight: 700; font-size: 15px; cursor: pointer; }
.back svg { width: 22px; height: 22px; }
.back[disabled] { visibility: hidden; }
.top-logo { width: 40px; height: auto; }
.ruler {
  position: relative; height: 14px; max-width: 620px; margin: 6px auto 0; border-radius: 4px; overflow: hidden;
  background:
    repeating-linear-gradient(to left, rgba(13, 27, 76, .28) 0 1px, transparent 1px 10%) bottom / 100% 9px no-repeat,
    repeating-linear-gradient(to left, rgba(13, 27, 76, .16) 0 1px, transparent 1px 2%) bottom / 100% 5px no-repeat,
    #E8EDF6;
}
.ruler-fill { position: absolute; inset: 0 0 0 auto; width: 0; background: linear-gradient(to left, var(--sky), #5FDCF8); transition: width .45s var(--ease); }
.where { max-width: 620px; margin: 6px auto 0; font-size: 13.5px; color: var(--muted); font-weight: 500; min-height: 1.4em; }

/* ---------- الهيكل ---------- */
.app { max-width: 620px; margin: 0 auto; padding: 20px var(--pad) calc(40px + env(safe-area-inset-bottom)); }
.screen { animation: enter .32s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.screen.back-anim { animation-name: enter-back; }
@keyframes enter-back { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

h1, h2, h3 { line-height: 1.35; margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(28px, 7.4vw, 40px); font-weight: 800; }
h2 { font-size: clamp(22px, 5.6vw, 28px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
.lead { font-size: 18px; color: var(--ink-2); }
.small { font-size: 14px; color: var(--muted); }

/* ---------- البداية ---------- */
.intro { padding-bottom: 8px; }
.hero {
  position: relative; overflow: hidden; margin: -20px calc(-1 * var(--pad)) 26px; padding: 26px var(--pad) 22px; color: var(--white);
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(31, 208, 245, .22), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(20, 71, 192, .55), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 24px),
    var(--ink);
}
.hero h1 { color: var(--white); font-size: clamp(30px, 8.2vw, 44px); line-height: 1.3; margin-bottom: 14px; }
.hero-lead { color: #C9D7F5; font-size: 17.5px; max-width: 36em; }
.hero-gauge { margin: 26px 0 4px; }
.hero-gauge svg { width: 100%; height: auto; display: block; overflow: visible; }
.hero-needle { animation: sweep 2.4s .35s var(--ease) both; }
@keyframes sweep { 0% { transform: translateX(0); } 55% { transform: translateX(-560px); } 100% { transform: translateX(-330px); } }
.hero-ask { font-size: 15px; font-weight: 700; color: var(--sky); text-align: center; margin-top: 6px; }

.facts { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 18px; }
.facts li { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; color: var(--ink-2); line-height: 1.65; }
.facts b { display: block; color: var(--ink); font-size: 17px; }
.fi { flex: none; width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--mist); fill: none; stroke: var(--royal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.measure { margin: 0 0 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.measure h2 { font-size: 22px; margin-bottom: 4px; }
.ax12 { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.ax12 li { position: relative; padding: 9px 16px 9px 0; font-size: 14.5px; font-weight: 500; color: var(--ink-2); border-bottom: 1px dashed var(--line); line-height: 1.45; }
.ax12 li::before { content: ''; position: absolute; right: 0; top: 50%; width: 9px; height: 2px; background: var(--sky); }
@media (min-width: 720px) {
  .hero { margin: 0 0 30px; padding: 36px 36px 28px; border-radius: 22px; }
  .facts { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .facts li { flex-direction: column; gap: 10px; }
  .ax12 { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .hero-needle { animation: none; transform: translateX(-330px); } }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 12px 22px; border: 0; border-radius: var(--r-m); background: var(--royal); color: var(--white); font-size: 18px; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .2s, transform .1s; }
.btn:hover { background: var(--royal-d); }
.btn:active { transform: scale(.985); }
.btn[disabled] { background: #9AACD6; cursor: not-allowed; }
.btn.ghost { background: var(--white); color: var(--royal); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--royal); background: var(--white); }
.btn + .btn { margin-top: 10px; }
.link { background: none; border: 0; color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 10px 0; min-height: 44px; }

/* ---------- السؤال ---------- */
.q-text { font-size: clamp(21px, 5.4vw, 25px); font-weight: 700; line-height: 1.55; margin: 6px 0 22px; text-wrap: pretty; }
.q-kind { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 6px; background: var(--mist); color: var(--royal); font-weight: 800; font-size: 13.5px; }
.opts { display: grid; gap: 10px; }
.opt {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 14px 16px;
  text-align: right; background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r-m); cursor: pointer;
  font-size: 17px; line-height: 1.5; transition: border-color .15s, background .15s, box-shadow .15s;
}
.opt:hover { border-color: #AFC0E4; }
.opt .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #B6C3DE; display: grid; place-items: center; transition: all .15s; }
.opt.multi .mark { border-radius: 6px; }
.opt[aria-checked="true"] { border-color: var(--royal); background: #F1F5FF; box-shadow: 0 0 0 1px var(--royal) inset; }
.opt[aria-checked="true"] .mark { border-color: var(--royal); background: var(--royal); }
.opt[aria-checked="true"] .mark::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--white); }
.opt.multi[aria-checked="true"] .mark::after { width: 10px; height: 6px; border-radius: 0; background: none; border: 2.5px solid var(--white); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.opt-body { display: grid; gap: 2px; }
.opt-hint { font-size: 14px; color: var(--muted); }
.route .opt { min-height: 76px; }
.route .opt-title { font-weight: 700; font-size: 18px; }
.next-wrap { margin-top: 18px; }

/* ---------- الفاصل ---------- */
.interlude { text-align: center; padding-top: 18px; }
.interlude .badge { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 20px; background: var(--mist); display: grid; place-items: center; }
.interlude .badge svg { width: 36px; height: 36px; color: var(--royal); }
.interlude h2 { margin-bottom: 10px; }
.interlude .lead { margin-bottom: 26px; }

/* ---------- النموذج ---------- */
.form h2 { margin-bottom: 8px; }
.form .lead { margin-bottom: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 15.5px; margin-bottom: 6px; }
.input, .select {
  width: 100%; min-height: 54px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-s);
  background: var(--white); font-size: 17px; transition: border-color .15s;
}
.input:focus, .select:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 3px rgba(20, 71, 192, .12); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: #C0392B; }
.err { color: #B42318; font-size: 14px; margin-top: 5px; min-height: 0; }
.phone { display: flex; gap: 8px; direction: ltr; }
.phone .dial { flex: none; min-width: 78px; display: grid; place-items: center; border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--paper); font-weight: 700; color: var(--ink-2); }
.phone .input { direction: ltr; text-align: left; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: pointer; font-size: 15.5px; line-height: 1.6; }
.check input { flex: none; width: 22px; height: 22px; margin-top: 3px; accent-color: var(--royal); }
.privacy { margin: 6px 0 20px; font-size: 13.5px; color: var(--muted); }

/* ---------- النتيجة ---------- */
.result-head { text-align: center; padding-top: 6px; }
.result-head .small { margin-bottom: 4px; }
.score { font-size: clamp(76px, 24vw, 112px); font-weight: 800; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.score sup { font-size: .38em; vertical-align: top; position: relative; top: .25em; margin-inline-start: 2px; color: var(--blue); }
.level { margin: 10px 0 8px; font-size: 22px; font-weight: 800; color: var(--royal); }
.level.ready { color: var(--good); }
.result-msg { color: var(--ink-2); font-size: 17px; max-width: 32em; margin: 0 auto; }

.gauge { margin: 26px 0 8px; }
.gauge svg { width: 100%; height: auto; display: block; overflow: visible; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; margin-top: 16px; }
.card h3 { margin-bottom: 12px; }
.warn-card { background: var(--amber-bg); border-color: #F6D3A2; }
.warn-card h3 { color: #8A4B06; }
.warn-item { display: flex; gap: 10px; padding: 8px 0; color: #5C3A0A; font-size: 15.5px; }
.warn-item + .warn-item { border-top: 1px dashed #F0C98F; }
.warn-ico { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--amber); color: var(--white); font-weight: 800; display: grid; place-items: center; font-size: 14px; margin-top: 2px; }

.bars { display: grid; gap: 14px; }
.bar-row { display: grid; gap: 6px; }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; }
.bar-name { font-weight: 700; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; color: #A35A06; border: 1px solid #F3C98E; border-radius: 6px; padding: 0 6px; margin-inline-start: 6px; vertical-align: 2px; }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }
.bar-val.low { color: #A35A06; }
/* المقياس الصغير: شريط بعلامة 75% مثل علامة على مسطرة */
.meter { position: relative; height: 10px; border-radius: 3px; background:
  repeating-linear-gradient(to left, rgba(13, 27, 76, .14) 0 1px, transparent 1px 10%) bottom / 100% 4px no-repeat, #EDF1F8; }
.meter-fill { position: absolute; inset: 0 0 0 auto; border-radius: 3px; background: var(--blue); width: 0; transition: width .8s var(--ease); }
.meter-fill.low { background: var(--amber); }
.meter.static .meter-fill { transition: none; }
.meter::after { content: ''; position: absolute; top: -4px; bottom: -4px; right: 75%; width: 2px; background: var(--ink); opacity: .45; border-radius: 1px; }
.legend { margin-top: 12px; font-size: 13px; color: var(--muted); }

.mail-note { display: flex; gap: 14px; align-items: flex-start; }
.mail-note svg { flex: none; width: 34px; height: 34px; color: var(--royal); }

.dev { margin-top: 22px; padding: 16px; border: 1.5px dashed #AFC0E4; border-radius: var(--r-m); background: #FBFCFF; }
.dev p { font-size: 14px; color: var(--muted); margin-bottom: 10px; }

/* ---------- التقرير: ورقة قياس ---------- */
body.sheet { background-color: #F4F7FC; background-image:
  linear-gradient(rgba(20, 71, 192, .045) 1px, transparent 1px),
  linear-gradient(90deg, rgba(20, 71, 192, .045) 1px, transparent 1px);
  background-size: 22px 22px; }
.report-head { padding: 22px 18px 30px; border-radius: var(--r-l); background: var(--ink); color: var(--white); position: relative; overflow: hidden; }
.r-kicker { color: #A9C4F0; font-size: 14.5px; }
.r-logo { display: block; width: min(170px, 48%); height: auto; margin: 0 0 16px; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.r-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.r-score { font-size: clamp(52px, 15vw, 68px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.r-level { font-size: 20px; font-weight: 800; color: var(--sky); margin-top: 6px; }
.print { width: min(100%, 312px); height: auto; display: block; }
.report-head .r-msg { color: #DCE7FA; margin-top: 12px; font-size: 16px; }
.r-ticks { position: absolute; inset: auto 0 0 0; height: 10px; background: repeating-linear-gradient(to left, rgba(31, 208, 245, .55) 0 1px, transparent 1px 2%), repeating-linear-gradient(to left, rgba(31, 208, 245, .9) 0 2px, transparent 2px 10%); }

.sec { margin-top: 30px; padding-top: 26px; background: repeating-linear-gradient(to left, rgba(13, 27, 76, .3) 0 1px, transparent 1px 10%) top / 100% 8px no-repeat,
  linear-gradient(rgba(13, 27, 76, .22), rgba(13, 27, 76, .22)) top / 100% 1px no-repeat; }
.sec > h2 { margin-bottom: 8px; }
.prose { color: var(--ink-2); font-size: 16.5px; line-height: 1.85; text-wrap: pretty; }
.flag-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--amber-bg); border: 1px solid #F6D3A2; color: #5C3A0A; font-size: 15.5px; }
.flag-note p + p { margin-top: 8px; }

.kp { display: grid; gap: 16px; margin: 6px 0 16px; }
.kp-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: baseline; }
.kp-row .meter { grid-column: 1 / -1; height: 14px; }
.kp-name { font-weight: 800; font-size: 17px; }
.kp-val { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--royal); }
.kp-note { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
.kp-title { font-size: 19px; margin-bottom: 6px; color: var(--royal); }

.map { list-style: none; counter-reset: ax; padding: 0; margin: 0; display: grid; gap: 14px; }
.map li { counter-increment: ax; display: grid; gap: 6px; position: relative; padding-inline-start: 30px; }
.map li::before { content: counter(ax); position: absolute; right: 0; top: 1px; width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--white); font-size: 12px; font-weight: 800; display: grid; place-items: center; }

.gap { margin-top: 16px; padding: 18px 16px; background: var(--white); border: 1px solid #F0D9B8; border-radius: 18px; }
.gap.crit { border-color: #E6A273; background: #FFFCF8; }
.gap-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.gap-no { flex: none; width: 38px; height: 38px; border-radius: 11px; border: 2px solid var(--amber); color: #A35A06; font-weight: 800; font-size: 18px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.gap-title { flex: 1; min-width: 0; }
.gap-title h3 { font-size: 19px; margin-bottom: 8px; }
.gap-meter { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.gap-score { font-weight: 800; color: #A35A06; font-variant-numeric: tabular-nums; font-size: 15px; }
.gap-lack { font-size: 16.5px; margin-bottom: 10px; line-height: 1.8; }
.gap-risk { color: var(--ink-2); font-size: 15.5px; margin-bottom: 12px; }
.gap-sub { font-weight: 800; font-size: 15px; margin: 14px 0 8px; color: var(--ink); }
.tips { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.tips li { position: relative; padding-inline-start: 22px; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.tips li::before { content: ''; position: absolute; right: 0; top: .62em; width: 9px; height: 9px; border-radius: 2px; background: var(--sky); transform: rotate(45deg); }
.course { margin-top: 6px; padding: 14px; border-radius: 12px; background: var(--mist); }
.course-k { font-size: 14.5px; color: var(--ink-2); font-weight: 700; }
.course-n { font-size: 21px; font-weight: 800; color: var(--royal); line-height: 1.4; margin-top: 2px; }
.learn { margin: 6px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 15px; color: var(--ink-2); }
.learn li::marker { color: var(--royal); }
.gap-gain { margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--good); }

.strengths { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip { padding: 6px 12px; border-radius: 999px; background: #E9F7F0; color: var(--good); font-weight: 700; font-size: 14px; }

.kq { margin-top: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.kq > summary { list-style: none; cursor: pointer; padding: 12px 14px; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 15.5px; }
.kq > summary::-webkit-details-marker { display: none; }
.kq > summary::after { content: ''; flex: none; width: 9px; height: 9px; border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); transition: transform .2s; }
.kq[open] > summary::after { transform: rotate(135deg); }
.kq-body { padding: 0 14px 14px; display: grid; gap: 8px; font-size: 15px; }
.kq-q { color: var(--ink); }
.kq-a { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 8px 10px; border-radius: 8px; }
.kq-a span { font-weight: 800; font-size: 13px; }
.kq-a.no { background: #FDF1EC; color: #7A2E14; }
.kq-a.yes { background: #E9F7F0; color: #0E5E3E; }
.kq-why { color: var(--ink-2); }

.cta { margin-top: 34px; padding: 24px 18px 34px; border-radius: var(--r-l); background: var(--ink); color: #DCE7FA; position: relative; overflow: hidden; }
.cta h2 { color: var(--white); margin-bottom: 8px; }
.cta p { font-size: 16.5px; }
.need { list-style: none; padding: 0; margin: 14px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.need li { padding: 6px 12px; border-radius: 8px; background: rgba(31, 208, 245, .12); border: 1px solid rgba(31, 208, 245, .35); color: var(--white); font-weight: 700; font-size: 14.5px; }
.btn.sky { background: var(--sky); color: var(--ink); }
.btn.sky:hover { background: #5FDCF8; }
.cta-small { margin-top: 10px; font-size: 14px !important; color: #A9C4F0; }

/* ---------- تقرير الإدارة ---------- */
.kv { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 8px 12px; font-size: 15px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.pill.consult { background: #E9F7F0; color: var(--good); }
.pill.academy { background: var(--mist); color: var(--royal); }
.ans { font-size: 14px; display: grid; gap: 6px; }
.ans div { display: grid; grid-template-columns: 44px 1fr 28px; gap: 8px; padding: 6px 0; border-bottom: 1px solid #EEF2F8; }
.ans .s { text-align: left; font-weight: 800; color: var(--blue); }

@media (min-width: 720px) {
  body { font-size: 18px; }
  .app { padding-top: 34px; }
  .card { padding: 22px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.proto a { color: var(--sky); font-weight: 700; }
body.sheet .app { max-width: 720px; }
@media (min-width: 900px) {
  .gap { padding: 22px 24px; }
  .course { display: grid; grid-template-columns: 1fr 1.3fr; gap: 4px 20px; align-items: start; }
  .course .course-k:first-child, .course .course-n { grid-column: 1; }
  .course .course-k:nth-of-type(3), .course .learn { grid-column: 2; grid-row: 1 / span 3; }
  .course .course-k[style] { margin-top: 0 !important; }
  .course .learn { margin-top: 26px; }
}
.err-rate{margin:14px 0 4px;padding:10px 14px;border:1px solid rgba(232,149,43,.35);background:rgba(232,149,43,.08);border-radius:8px;font-size:.98rem}
.err-rate b{color:var(--ink,#0D1B4C);font-size:1.08rem}

/* ---------- السابق والتالي ---------- */
.fwd { display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; padding: 8px 4px; min-height: 44px; color: var(--blue); font-weight: 700; font-size: 15px; cursor: pointer; }
.fwd svg { width: 22px; height: 22px; }
.fwd[disabled] { opacity: .35; cursor: default; }
.top.done .back, .top.done .fwd { visibility: hidden; }
.stepnav { position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; gap: 10px; padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom)); background: rgba(246, 248, 252, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.sn-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--white); color: var(--royal); font-size: 16px; font-weight: 700; cursor: pointer; }
.sn-btn svg { width: 20px; height: 20px; }
.sn-btn.sn-next { background: var(--royal); border-color: var(--royal); color: var(--white); }
.sn-btn[disabled] { opacity: .4; cursor: default; }
body.has-stepnav .app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (max-width: 719px) { .top .back, .top .fwd { display: none; } .top-row { justify-content: center; } }
@media (min-width: 720px) { .stepnav { display: none !important; } body.has-stepnav .app { padding-bottom: 40px; } }

/* ---------- زر المنصة الثابت (النتيجة والتقرير) ---------- */
.pbar { position: fixed; inset: auto 0 0 0; z-index: 20; padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom)); background: rgba(246, 248, 252, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.pbar-in { max-width: 460px; margin: 0 auto; }
.pbar-logo, .pbar-note { display: none; }
.pbar-btn { text-decoration: none; }
body.has-pbar .app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
/* الشاشة الواسعة: بطاقة كحلية في الزاوية، بجانب عمود التقرير لا فوقه */
@media (min-width: 1360px) {
  .pbar { inset: auto auto 28px 28px; width: 260px; padding: 20px; background: var(--ink); border: 0; border-radius: var(--r-l); box-shadow: 0 18px 40px -18px rgba(13, 27, 76, .55); backdrop-filter: none; }
  .pbar-in { max-width: none; }
  .pbar-logo { display: block; height: 44px; width: auto; }
  .pbar-note { display: block; margin: 10px 0 14px; color: #CFE6FF; font-size: 14px; line-height: 1.5; }
  .pbar-btn { min-height: 48px; padding: 10px 14px; font-size: 15px; background: var(--sky); color: var(--ink); }
  .pbar-btn:hover { background: #5FDCF8; }
  body.has-pbar .app { padding-bottom: 40px; }
}
@media print { .pbar { display: none !important; } }

.res-actions { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:center; margin-top:22px; }
.res-actions .btn { min-width:240px; }

/* تقرير البريد: قراءة فقط، لا تحديد ولا طباعة */
body.nodl { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.nodl img, body.nodl svg { pointer-events: none; }
.view-note { text-align: center; margin: 28px auto 8px; max-width: 46ch; }
@media print {
  body.nodl > * { display: none !important; }
  body.nodl::after { content: "هذا التقرير يُقرأ من الصفحة فقط، ولا يُطبع."; display: block; padding: 40px; font: 700 20px Tajawal, sans-serif; text-align: center; }
}
