/* الدورة الشاملة HTML & CSS — بألوان malshatti.com */
:root {
  --brand: #3144AE; --brand-deep: #202C7C; --brand-tint: #EEF1FB; --brand-line: rgba(49,68,174,.25);
  --ink: #15161B; --ink-2: #4A4944; --muted: #7E7967;
  --paper: #F8F6F1; --card: #FFFFFF; --line: #E7E1D3;
  --ok: #138A4B; --ok-tint: #E7F6EE; --err: #C8352B; --err-tint: #FDECEA; --gold: #B68A46;
  --radius: 16px; --shadow: 0 4px 20px rgba(20,22,28,.06), 0 1px 2px rgba(20,22,28,.05);
  --code-bg: #14172B; --code-ink: #E6E9F5;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "IBM Plex Sans Arabic", system-ui, Tahoma, sans-serif; line-height: 1.75; }
a { color: var(--brand); }
code, pre, .editor { font-family: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.hide { display: none !important; }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }

/* أزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 12px; padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .2s, transform .15s, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(49,68,174,.22); }
.btn.primary:hover { background: var(--brand-deep); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand-line); color: var(--brand); }
.btn.sm { padding: 7px 14px; font-size: .9rem; border-radius: 10px; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row-btns.center { justify-content: center; }

/* الشريط العلوي */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: rgba(248,246,241,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: .78rem; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; direction: ltr; }
.brand-mark.big { width: 56px; height: 56px; font-size: 1.1rem; border-radius: 16px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.who { font-weight: 600; font-size: .92rem; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page { max-width: 980px; margin: 0 auto; padding: 28px 16px 80px; }
.page.wide { max-width: 1400px; }
.narrow { max-width: 620px; margin: 0 auto; }
h1 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); line-height: 1.35; margin: .2em 0 .4em; }
.back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-weight: 600; font-size: .92rem; }

/* الدخول */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-tint), transparent 70%), var(--paper); }
.login-card { width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 32px 28px; box-shadow: var(--shadow); text-align: center; }
.login-card h1 { font-size: 1.6rem; margin-top: 14px; }
.login-card form { text-align: start; margin-top: 18px; }
.login-points { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.login-points li { background: var(--brand-tint); color: var(--brand-deep); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 12px 0 6px; }
input:not([type=radio]):not([type=checkbox]), textarea { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.field-hint { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
.form-err { color: var(--err); font-size: .9rem; min-height: 1.4em; margin: 8px 0 4px; }

/* لوحة المستويات */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 28px; box-shadow: var(--shadow); margin-bottom: 26px; }
.kicker { color: var(--brand); font-weight: 600; margin: 0; }
.ring { --p: 0; flex: none; width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--brand-tint) 0); }
.ring span { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; background: var(--card); font-weight: 700; font-size: 1.35rem; color: var(--brand); }
.levels { display: grid; gap: 12px; position: relative; }
.part-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 4px 2px; font-size: 1.05rem; color: var(--brand-deep); }
.part-h:first-child { margin-top: 0; }
.part-h small { font-size: .82rem; color: var(--muted); font-weight: 600; }
.lvl { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; transition: border-color .2s, box-shadow .2s; }
.lvl.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.lvl.locked { opacity: .55; background: transparent; }
.lvl-num { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; background: var(--brand-tint); color: var(--brand); }
.lvl.complete .lvl-num { background: var(--ok); color: #fff; }
.lvl h3 { margin: 0; font-size: 1.05rem; }
.lvl p { margin: 2px 0 8px; color: var(--ink-2); font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.chip.ok { background: var(--ok-tint); border-color: transparent; color: var(--ok); }
.lock { font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* رأس المستوى والمراحل */
.lvl-head { margin-bottom: 22px; }
.lvl-kicker { color: var(--brand); font-weight: 600; font-size: .9rem; }
.stepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.st { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .92rem; padding: 4px 8px; border-radius: 10px; }
.st-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); font-size: .8rem; }
.st.on { color: var(--brand); background: var(--brand-tint); }
.st.on .st-n { background: var(--brand); color: #fff; border-color: var(--brand); }
.st.done .st-n { background: var(--ok); color: #fff; border-color: var(--ok); }
.st.off { opacity: .45; pointer-events: none; }
.st-line { flex: 1; min-width: 14px; height: 2px; background: var(--line); }

/* الشرح */
.lesson-sec { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px; margin-bottom: 16px; }
.lesson-sec h2 { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; margin: 0 0 8px; }
.lesson-sec h2 span { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: .85rem; flex: none; }
.prose p, .prose li { color: #2a2a2f; }
.prose ul { padding-inline-start: 1.2em; }
.prose li { margin: 4px 0; }
.prose code { background: var(--brand-tint); color: var(--brand-deep); padding: 1px 6px; border-radius: 6px; font-size: .88em; direction: ltr; unicode-bidi: isolate; }
.prose pre { background: var(--code-bg); color: var(--code-ink); padding: 12px 14px; border-radius: 12px; overflow: auto; direction: ltr; text-align: left; }
.prose pre code { background: none; color: inherit; padding: 0; }
.example { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; }
.ex-tabs { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; background: #1D2140; padding: 6px 8px; }
.ex-tabs button { font: inherit; font-size: .8rem; font-weight: 600; color: #AEB5D6; background: none; border: 0; padding: 4px 12px; border-radius: 8px; cursor: pointer; direction: ltr; }
.ex-tabs button.on { background: rgba(255,255,255,.12); color: #fff; }
.ex-label { margin-inline-start: auto; font-size: .75rem; color: #8C93B8; }
.ex-code { margin: 0; background: var(--code-bg); color: var(--code-ink); padding: 14px 16px; overflow: auto; font-size: .85rem; line-height: 1.6; text-align: left; max-height: 360px; }
.ex-preview { position: relative; background: #fff; border-inline-start: 1px solid var(--line); min-height: 200px; }
.ex-preview .ex-label { position: absolute; top: 6px; inset-inline-end: 10px; color: var(--muted); }
.ex-preview iframe { width: 100%; height: 100%; min-height: 220px; border: 0; display: block; }
.next-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--brand-tint); border: 1px solid var(--brand-line); border-radius: 18px; padding: 18px 22px; margin-top: 22px; }
.next-bar p { margin: 0; flex: 1 1 280px; }

/* الاختبار */
.quiz-intro p { margin: 0 0 10px; }
.note { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: .92rem; margin-bottom: 14px; }
.note.ok { background: var(--ok-tint); border-color: transparent; color: var(--ok); }
.q { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 16px 18px 12px; margin: 0 0 12px; }
.q legend { display: contents; }
.q legend, .q > legend { font-weight: 600; }
.q legend .qn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-tint); color: var(--brand); font-size: .8rem; margin-inline-end: 8px; }
.q.missing { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(182,138,70,.18); }
.q.wrong { border-color: var(--err); background: var(--err-tint); }
.q.right { border-color: rgba(19,138,75,.35); }
.opt { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; margin: 8px 0 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.opt:hover { border-color: var(--brand-line); }
.opt input { margin-top: .45em; accent-color: var(--brand); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.quiz-foot { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); }
.result { display: flex; gap: 22px; align-items: center; border-radius: 20px; padding: 22px 24px; margin-top: 18px; border: 1px solid; }
.result.pass { background: var(--ok-tint); border-color: rgba(19,138,75,.3); }
.result.fail { background: var(--err-tint); border-color: rgba(200,53,43,.3); }
.result h3 { margin: 0 0 4px; }
.result p { margin: 0; }
.score { flex: none; font-size: 2.2rem; font-weight: 700; width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.result.pass .score { color: var(--ok); }
.result.fail .score { color: var(--err); }

/* بيئة العمل */
.ws { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.ws-tasks { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow: auto; }
.ws-tasks h2 { margin: 0; font-size: 1.15rem; }
.ws-tasks > p { font-size: .9rem; margin: 4px 0 10px; }
.tasks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: t; }
.tasks li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; font-size: .9rem; line-height: 1.6; }
.tasks .tk { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); margin-top: 2px; display: grid; place-items: center; font-size: .75rem; color: #fff; }
.tasks li.ok { background: var(--ok-tint); border-color: transparent; }
.tasks li.ok .tk { background: var(--ok); border-color: var(--ok); }
.tasks li.ok .tk::after { content: "✓"; }
.tt code { direction: ltr; unicode-bidi: isolate; background: var(--brand-tint); color: var(--brand-deep); padding: 0 5px; border-radius: 5px; font-size: .85em; white-space: nowrap; }
.tasks li.ok .tt code { background: rgba(255,255,255,.7); }
.hint-btn { font: inherit; font-size: .78rem; color: var(--brand); background: none; border: 0; padding: 0; margin-inline-start: 6px; cursor: pointer; text-decoration: underline; }
.hint { display: block; margin-top: 6px; background: var(--code-bg); color: var(--code-ink); border-radius: 8px; padding: 6px 10px; font-size: .8rem; text-align: left; white-space: pre-wrap; word-break: break-word; }
.ws-progress { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: .85rem; font-weight: 600; }
.ws-progress .bar { flex: 1; height: 8px; background: var(--brand-tint); border-radius: 99px; overflow: hidden; }
.ws-progress .bar i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.project-meta { margin-top: 10px; }
.ws-main { background: var(--code-bg); border-radius: 18px; overflow: hidden; border: 1px solid #262B4F; }
.ws-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #1D2140; }
.tabs { display: flex; gap: 4px; }
.tabs button { font: inherit; font-size: .85rem; color: #AEB5D6; background: none; border: 0; padding: 6px 14px; border-radius: 9px; cursor: pointer; direction: ltr; }
.tabs button.on { background: var(--code-bg); color: #fff; }
.ws-tools { display: flex; gap: 6px; }
.ws-tools .btn.ghost { background: transparent; color: #D7DBEF; border-color: #3A4070; }
.ws-split { display: grid; grid-template-columns: 1fr 1fr; height: calc(100vh - 230px); min-height: 460px; }
.editor-wrap { position: relative; }
.editor { width: 100%; height: 100%; resize: none; border: 0; outline: none; padding: 16px; background: var(--code-bg); color: var(--code-ink); font-size: 14px; line-height: 1.65; tab-size: 2; white-space: pre; overflow: auto; text-align: left; caret-color: #fff; }
.preview-wrap { display: flex; flex-direction: column; background: #fff; }
.pv-label { font-size: .78rem; color: var(--muted); padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.preview-wrap iframe { flex: 1; width: 100%; border: 0; }
.mobile-only { display: none !important; }

/* النوافذ والتنبيهات */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(21,22,27,.45); }
.modal-card { background: var(--card); border-radius: 22px; padding: 28px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 30px 60px rgba(0,0,0,.2); }
.modal-card .row-btns { justify-content: center; }
.big-emoji { font-size: 3rem; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); opacity: 0; z-index: 60; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: .92rem; transition: .3s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }

/* التقييم */
.rate textarea { margin-bottom: 14px; }
.stars { border: 0; padding: 0; margin: 10px 0 6px; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; direction: rtl; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { margin: 0; font-size: 2.6rem; line-height: 1; color: var(--line); cursor: pointer; transition: color .15s, transform .15s; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--gold); }
.stars input:focus-visible + label { outline: 3px solid var(--brand); border-radius: 6px; }

/* الشهادة */
.done-wrap { max-width: 760px; margin: 0 auto; }
.cert { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 48px 36px; text-align: center; box-shadow: var(--shadow); outline: 2px solid var(--brand-tint); outline-offset: -14px; }
.cert-mark { display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; background: var(--brand); color: #fff; font-weight: 700; direction: ltr; }
.cert-k { color: var(--gold); font-weight: 700; letter-spacing: .02em; margin: 14px 0 0; }
.cert h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); color: var(--brand-deep); margin: 6px 0 10px; }
.cert-d { color: var(--muted); }
.cert-sig { font-weight: 700; margin-bottom: 0; }

/* شريط متابعة التقدم */
.course-progress { position: sticky; top: 59px; z-index: 19; display: flex; align-items: center; gap: 12px; padding: 7px 20px; background: rgba(248,246,241,.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.cp-track { flex: 1; height: 8px; background: var(--brand-tint); border-radius: 99px; overflow: hidden; }
.cp-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #5468D4); border-radius: 99px; transition: width .6s var(--ease, ease); }
.cp-text { display: flex; align-items: baseline; gap: 8px; font-size: .82rem; white-space: nowrap; color: var(--ink-2); }
.cp-text b { color: var(--brand); font-size: .92rem; }
/* التقييم والرسوم */
.rate-box textarea { margin-top: 2px; }
.sv-sub { font-weight: 600; margin: 18px 0 8px; color: var(--ink-2); }
.fee-note { display: flex; gap: 14px; align-items: center; background: #FFF8EC; border: 1px solid rgba(182,138,70,.45); border-radius: 16px; padding: 14px 16px; margin: 14px 0 4px; }
.fee-note p { margin: 2px 0 0; font-size: .92rem; color: #5c4415; }
.fee-amt { flex: none; display: grid; place-items: center; min-width: 78px; height: 58px; padding: 0 10px; border-radius: 14px; background: var(--gold); color: #fff; font-weight: 700; font-size: 1.05rem; }

/* الحفظ التلقائي والوقت */
.autosave { font-size: .78rem; color: var(--ok); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.autosave.on { opacity: 1; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; color: var(--ink-2); margin: 0 0 14px; }
.lvl-time { display: inline-block; font-size: .8rem; color: var(--muted); margin-inline-start: 6px; white-space: nowrap; }
.note.warn { background: #FFF6E5; border-color: rgba(182,138,70,.4); color: #7a5418; }

/* الاستبيان */
.survey { margin-top: 18px; }
.sv-q { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; }
.sv-q legend { font-weight: 600; padding: 0 4px; }
.sv-q.missing { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(182,138,70,.18); }
.sv-q .stars { margin: 4px 0 0; }
.scale-head, .scale-row { display: grid; grid-template-columns: minmax(140px, 1.6fr) repeat(5, minmax(44px, 1fr)); align-items: center; gap: 4px; }
.scale-head span { font-size: .72rem; color: var(--muted); text-align: center; }
.scale-row { padding: 8px 0; border-top: 1px solid var(--line); }
.scale-label { font-size: .92rem; }
.scale-opt { margin: 0; display: grid; place-items: center; cursor: pointer; }
.scale-opt input { position: absolute; opacity: 0; pointer-events: none; }
.scale-opt span:not(.sr) { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; font-weight: 600; transition: .15s; }
.scale-opt input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.scale-opt input:focus-visible + span { outline: 3px solid var(--gold); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pill { margin: 0; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 500; transition: .15s; }
.pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill input:focus-visible + span { outline: 3px solid var(--gold); }
.survey textarea { margin-bottom: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin-top: 16px; }
.check input { margin-top: .45em; accent-color: var(--brand); }
#certForm { margin-top: 10px; }

/* حالة الشهادة والملخص */
.cert-status { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 30px 24px; text-align: center; margin-top: 18px; box-shadow: var(--shadow); }
.cert-status.issued { border-color: rgba(19,138,75,.35); background: linear-gradient(180deg, var(--ok-tint), #fff 60%); }
.cert-status.returned { border-color: rgba(182,138,70,.45); }
.cert-data { display: grid; gap: 6px; max-width: 420px; margin: 18px auto 0; text-align: start; }
.cert-data div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 6px; font-size: .92rem; }
.cert-data dt { color: var(--muted); }
.cert-data dd { margin: 0; font-weight: 600; }
.summary { margin-top: 18px; }
.summary h2 { font-size: 1.1rem; }
.sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sum-grid div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; }
.sum-grid b { display: block; font-size: 1.25rem; color: var(--brand); }
.sum-grid span { font-size: .82rem; color: var(--ink-2); }
@media (max-width: 720px) {
  .sum-grid { grid-template-columns: repeat(2, 1fr); }
  .scale-head { display: none; }
  .scale-row { grid-template-columns: repeat(5, 1fr); }
  .scale-label { grid-column: 1 / -1; font-weight: 600; }
  .autosave { display: none; }
  .course-progress { top: 55px; padding: 6px 12px; }
  .cp-text span { display: none; }
}

@media (max-width: 1000px) {
  .ws { grid-template-columns: 1fr; }
  .ws-tasks { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .hero { flex-direction: column-reverse; align-items: flex-start; padding: 20px; }
  .ring { width: 90px; height: 90px; }
  .ring span { width: 68px; height: 68px; font-size: 1.1rem; }
  .lvl { grid-template-columns: 42px 1fr; padding: 14px; }
  .lvl-num { width: 40px; height: 40px; }
  .lvl-act { grid-column: 1 / -1; }
  .lvl-act .btn { width: 100%; }
  .lesson-sec { padding: 18px 16px; }
  .example { grid-template-columns: 1fr; }
  .ex-preview { border-inline-start: 0; border-top: 1px solid var(--line); }
  .st-line { display: none; }
  .result { flex-direction: column; text-align: center; }
  .result .row-btns { justify-content: center; }
  .mobile-only { display: inline-flex !important; }
  .ws-split { grid-template-columns: 1fr; height: 70vh; }
  .ws-split .preview-wrap { display: none; }
  .ws-split.show-preview .preview-wrap { display: flex; }
  .ws-split.show-preview .editor-wrap { display: none; }
  .topbar { padding: 8px 12px; }
  .brand small { display: none; }
}
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .cert { box-shadow: none; border: 0; }
}

/* صفحة الدخول: فكرة الدورة */
.login-kicker { margin: 14px 0 0; color: var(--gold); font-weight: 700; font-size: .85rem; }
.login-card h1 { margin-top: 4px !important; }
.login-sub { margin: -4px 0 12px; color: var(--brand); font-weight: 600; }
.login-idea { color: var(--ink-2); line-height: 1.95; margin: 0 0 14px; }
.login-learn { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: start; }
.login-learn li { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; font-size: .9rem; font-weight: 500; }
.login-learn span { font-size: 1.15rem; }
.login-path { list-style: none; padding: 0; margin: 0 0 4px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; counter-reset: st; }
.login-path li { counter-increment: st; font-size: .82rem; color: var(--brand-deep); font-weight: 600; }
.login-path li::before { content: counter(st); display: inline-grid; place-items: center; width: 20px; height: 20px; margin-inline-end: 4px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .72rem; }
.login-path li:not(:last-child)::after { content: "←"; margin-inline-start: 6px; color: var(--muted); }
@media (max-width: 480px) { .login-learn { grid-template-columns: 1fr; } }
