/* Layout: one centred column (phone-first). Top bar with three tabs; each view is a stack of plain sections.
   Mastery is the recurring visual: a 4-step "energy level" bar per concept (not started / weak / learning / mastered). */
/* Identity «عنصر واحد» (Oct 2026): warm paper, deep teal for actions and mastery, terracotta only for weak points.
   Display type Alexandria, body IBM Plex Sans Arabic, numbers IBM Plex Mono. The logo is an element box: 88 · Ra. */
:root {
  --bg: #f5f2ec;
  --surface: #ffffff;
  --sand: #ece7dd;
  --ink: #1d1c1a;
  --muted: #66615a;
  --line: #ddd6c8;
  --accent: #155e63;        /* Radiation teal */
  --accent-soft: #d5e7e5;
  --accent-ink: #ffffff;
  --glow: #c4532f;          /* terracotta: weak points and warnings only */
  --glow-soft: #f6dfd6;
  --lv0: #e3ddd1;           /* not started */
  --lv1: #c4532f;           /* weak */
  --lv2: #8dbcb8;           /* learning */
  --lv3: #155e63;           /* mastered */
  --good-bg: #dcebe9; --bad-bg: #f6dfd6;
  --r: 14px;
  --f-head: "Alexandria", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --f-ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --f-en: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --f-num: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151413; --surface: #1f1d1b; --sand: #2a2724; --ink: #ede9e1; --muted: #a8a196; --line: #36322d;
    --accent: #5fb3b3; --accent-soft: #1d3436; --accent-ink: #0f1514; --glow: #e07a55; --glow-soft: #3a241c;
    --lv0: #3a3631; --lv1: #e07a55; --lv2: #3f7e80; --lv3: #5fb3b3; --good-bg: #1d3436; --bad-bg: #3a241c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151413; --surface: #1f1d1b; --sand: #2a2724; --ink: #ede9e1; --muted: #a8a196; --line: #36322d;
  --accent: #5fb3b3; --accent-soft: #1d3436; --accent-ink: #0f1514; --glow: #e07a55; --glow-soft: #3a241c;
  --lv0: #3a3631; --lv1: #e07a55; --lv2: #3f7e80; --lv3: #5fb3b3; --good-bg: #1d3436; --bad-bg: #3a241c;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 15px/1.65 var(--f-ui); }
.wrap { max-width: 760px; margin: 0 auto; padding-inline: 16px; padding-block: 0 48px; }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.3; text-wrap: balance; margin: 0; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.en { direction: ltr; unicode-bidi: isolate; font-family: var(--f-en); }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.logo { font-family: var(--f-head); font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; margin-inline-end: auto; }
.logo i { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, var(--glow) 0 22%, transparent 23% 40%, var(--accent) 41% 52%, transparent 53%); flex: none; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tab { border: 0; background: none; color: var(--muted); padding: 5px 14px; border-radius: 999px; font-size: 14px; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

.view { display: grid; gap: 22px; padding-top: 22px; }
.hello { display: grid; gap: 4px; }
.hello p { color: var(--muted); }
.demo { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; }

/* next step card: the one emphasised object */
.next { background: var(--glow-soft); border: 1px solid color-mix(in srgb, var(--glow) 40%, transparent); border-radius: 14px; padding: 16px; display: grid; gap: 10px; }
.next-label { font-size: 12px; font-weight: 600; color: var(--glow); letter-spacing: .3px; }
.rec { display: grid; gap: 8px; }
.rec-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rec-item .t { min-width: 0; flex: 1; display: grid; }
.rec-item .t small { color: var(--muted); font-size: 12px; }
.btn { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 7px 14px; font-weight: 600; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 13px; }

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.stat b { display: block; font-family: var(--f-head); font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
@media (max-width: 480px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* energy-level bar */
.lv { display: inline-flex; gap: 2px; direction: ltr; flex: none; }
.lv i { width: 10px; height: 14px; border-radius: 2px; background: var(--lv0); }
.lv[data-l="1"] i:nth-child(-n+1) { background: var(--lv1); }
.lv[data-l="2"] i:nth-child(-n+2) { background: var(--lv2); }
.lv[data-l="3"] i:nth-child(-n+3) { background: var(--lv3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* unit / lesson map */
.unit { display: grid; gap: 8px; }
.unit-h { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.lesson { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; cursor: pointer; text-align: start; width: 100%; color: inherit; }
.lesson:hover { border-color: var(--accent); }
.lesson-top { display: flex; align-items: baseline; gap: 10px; }
.lesson-top .en { font-weight: 600; flex: 1; min-width: 0; }
.lesson-top small { color: var(--muted); font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 3px; background: var(--lv0); overflow: hidden; display: flex; direction: ltr; }
.meter span { display: block; height: 100%; }

/* lesson view */
.back { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 600; justify-self: start; }
.concepts { display: grid; gap: 8px; }
.concept { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.concept .t { display: grid; min-width: 0; }
.concept .t small { color: var(--muted); font-size: 12px; }
.concept .req { font-size: 12px; color: var(--muted); }
.lesson-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* quiz */
.quiz { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 14px; }
.qhead { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; direction: ltr; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.qbody { font-size: 17px; line-height: 1.55; }
.choices { display: grid; gap: 8px; }
.choice { text-align: left; direction: ltr; font-family: var(--f-en); font-size: 16px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; }
.choice b { color: var(--muted); }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice.right { background: var(--good-bg); border-color: var(--lv3); }
.choice.wrong { background: var(--bad-bg); border-color: var(--lv1); }
.blanks { display: grid; gap: 8px; direction: ltr; }
.blanks input { font: 16px var(--f-en); padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); width: 100%; }
.feedback { border-radius: 10px; padding: 12px; display: grid; gap: 6px; }
.feedback.ok { background: var(--good-bg); }
.feedback.no { background: var(--bad-bg); }
.feedback .en { font-size: 15px; }
.qnav { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.selfgrade { display: flex; gap: 8px; flex-wrap: wrap; }
.result { text-align: center; display: grid; gap: 10px; justify-items: center; }
.result .score { font-family: var(--f-head); font-size: 40px; font-variant-numeric: tabular-nums; }
.result ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; width: 100%; }
.result li { display: flex; gap: 10px; align-items: center; background: var(--bg); border-radius: 8px; padding: 8px 10px; text-align: start; }
.result li .en { flex: 1; min-width: 0; }

/* teacher heatmap */
.heat-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
table.heat { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.heat th, .heat td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.heat th { font-weight: 600; color: var(--muted); font-size: 12px; }
.heat th.c { font-variant-numeric: tabular-nums; min-width: 38px; }
.ckey { margin: 0; padding-inline-start: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; font-size: 13px; }
.ckey li { display: flex; gap: 6px; } .ckey b { font-variant-numeric: tabular-nums; color: var(--muted); }
.heat td.n { text-align: start; position: sticky; inset-inline-start: 0; background: var(--surface); }
.heat td.cell { font-variant-numeric: tabular-nums; font-size: 12px; color: #fff; }
.heat tr.me td.n { font-weight: 700; color: var(--accent); }
.insight { display: grid; gap: 6px; }
.insight li { margin-inline-start: 18px; }
select.inp, input.inp { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--surface); color: var(--ink); }
.empty { color: var(--muted); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- app additions ---- */
.top .who { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.linkbtn { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 600; font-size: 13px; }
.auth { max-width: 420px; margin: 40px auto; display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { font: 15px var(--f-ui); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
.field textarea { min-height: 140px; font-family: var(--f-en); direction: ltr; }
.err { color: var(--lv1); font-size: 13px; }
.ok-msg { color: var(--lv3); font-size: 13px; }
.seg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; color: var(--muted); padding: 6px 10px; border-radius: 999px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }
table.list { border-collapse: collapse; width: 100%; font-size: 14px; }
.list th, .list td { padding: 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.list th { color: var(--muted); font-weight: 600; font-size: 12px; }
.list td.mono { font-family: var(--f-en); direction: ltr; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.qrev { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.qrev .meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.pill.draft { color: var(--lv2); border-color: var(--lv2); }
.pill.approved { color: var(--lv3); border-color: var(--lv3); }
.pill.rejected { color: var(--lv1); border-color: var(--lv1); }
.qrev .ans { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.qrev .ans .right { color: var(--lv3); font-weight: 600; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.toolbar .field { min-width: 160px; flex: 1; }

/* ---- tutor chat ---- */
.chat { gap: 14px; }
.chat-head { display: flex; justify-content: space-between; align-items: end; gap: 10px; flex-wrap: wrap; }
.msgs { display: flex; flex-direction: column; gap: 10px; min-height: 280px; max-height: calc(100vh - 330px); overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-start-start-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-start-end-radius: 4px; }
.msg .chg { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.msg .chg > span { display: inline-flex; align-items: center; gap: 6px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip:hover { border-color: var(--accent); }
.composer { display: flex; gap: 8px; align-items: end; position: sticky; bottom: env(safe-area-inset-bottom, 0px); background: var(--bg); padding-block: 8px; }
.composer textarea { flex: 1; min-width: 0; font: 15px var(--f-ui); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: none; max-height: 140px; }

/* ---- all subjects, homework, reports ---- */
.tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; }
@media (max-width: 700px) { .tabs { order: 3; width: 100%; } }
.ar { direction: rtl; unicode-bidi: isolate; }
.ctxbar { display: flex; align-items: center; gap: 10px; padding-block: 10px 0; flex-wrap: wrap; }
.ctxbar .inp { flex: none; }
.grade-tag { font-size: 13px; color: var(--muted); font-weight: 600; }
.subjs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding-block: 2px; }
.subjs::-webkit-scrollbar { display: none; }
.subj { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 14px; font-size: 14px; white-space: nowrap; }
.subj[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.quiz.ar .choice { text-align: right; direction: rtl; font-family: var(--f-ui); }
.quiz.ar .blanks input { font-family: var(--f-ui); }
.choice.picked { border-color: var(--accent); background: var(--accent-soft); }
.feedback.neutral { background: var(--accent-soft); }
.timer { font-variant-numeric: tabular-nums; color: var(--glow); }
.plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pnum { width: 26px; height: 26px; border-radius: 50%; background: var(--glow); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.rec-item .t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rec-item .t small .pill { margin-inline-end: 4px; }
.alist { display: grid; gap: 10px; }
.acard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.acard .t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.acard .t small { color: var(--muted); font-size: 12px; }
.acard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.acard .st { color: var(--muted); }
.acard .st.open, .acard.open .st, .acard.in_progress .st { color: var(--lv3); font-weight: 600; }
.acard.missed .st { color: var(--lv1); }
.acard .acts { display: flex; gap: 6px; flex-wrap: wrap; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::before { content: "+ "; color: var(--accent); font-weight: 700; }
details[open].card > summary::before { content: "− "; }
.aform { display: grid; gap: 12px; margin-top: 12px; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.lessons-pick { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; margin: 0; }
.lessons-pick legend { padding: 0 4px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; padding: 3px 0; }
.check span { flex: 1; min-width: 0; }
.check small { color: var(--muted); }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sub-card { gap: 6px; padding: 14px; }
.sub-card small { color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row b { flex: 1; min-width: 0; }
.rtext { font: 14px/1.6 var(--f-ui); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 220px; width: 100%; }
a.btn { text-decoration: none; display: inline-block; }
a.btn[aria-disabled="true"] { opacity: .5; }
tr.quiet td { color: var(--muted); }
.staff.off { opacity: .6; }
.chip .x { border: 0; background: none; color: var(--muted); padding: 0 0 0 2px; font-size: 15px; line-height: 1; }
.pend .inp { width: 100%; }
.qrev.is-right { border-inline-start: 3px solid var(--lv3); }
.qrev.is-wrong { border-inline-start: 3px solid var(--lv1); }
.qrev .ans .right { color: var(--lv3); }
@media (max-width: 420px) { .tab { padding: 5px 10px; font-size: 13px; } }
.codes { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.codes > div { display: grid; gap: 2px; }
.codes small { color: var(--muted); }
.codes b { font-size: 22px; letter-spacing: 1px; }
.codes .empty { grid-column: 1 / -1; }
.subj-row .t { min-width: 140px; }

/* report a question */
.flag { margin-top: 14px; font-size: 13px; }
.flag-box { margin-top: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; display: grid; gap: 8px; }
.flag-reasons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flag-reasons [aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.flag-box .inp { width: 100%; box-sizing: border-box; }
.flag-note { background: var(--glow-soft); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.flag-list { background: var(--glow-soft); padding: 10px 12px; border-radius: 10px; margin-top: 8px; font-size: 14px; }
.flag-list ul { margin: 4px 0 8px; padding-inline-start: 18px; }
/* class: new password */
.pwbtn { font-size: 14px; margin-inline-start: 4px; opacity: .75; }
.pwbtn:hover { opacity: 1; }
.pwcard { border: 1px solid var(--glow); }
/* footer */
.foot { text-align: center; padding: 24px 16px 32px; font-size: 13px; }
.foot a { color: var(--muted); }
/* quick assistant */
.qclip { padding-inline: 12px; font-size: 18px; }
.qattach { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--accent-soft); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.qattach .inp { width: 190px; max-width: 100%; }
.qfile { font-size: 13px; opacity: .9; margin-bottom: 4px; }
.msg img.qchart { display: block; width: 100%; max-width: 560px; height: auto; margin-top: 8px; border-radius: 10px; background: #fff; }
/* 0051: pictures in the AI tutor chat */
.msg img.tphoto { display: block; max-width: min(100%, 320px); max-height: 360px; height: auto; border-radius: 10px; margin-bottom: 6px; background: #fff; }
.tattach img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.tattach span { flex: 1; min-width: 140px; }
.tgraph { margin: 8px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; max-width: 560px; }
.tgraph svg { display: block; width: 100%; height: auto; font: 17px var(--f-ui); fill: var(--muted); }
.tgraph .grid { stroke: var(--line); stroke-width: 1; }
.tgraph .axis { stroke: var(--ink); stroke-width: 1.4; }
.tgraph .ax-t { fill: var(--ink); font-weight: 600; }
.tgraph .g-t { fill: var(--ink); font-weight: 700; font-size: 20px; }
.tgraph figcaption { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); padding: 2px 6px 4px; }
.tgraph figcaption i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }

/* ---------- paper exams ---------- */
.paper-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.paper-preview { display: grid; gap: 18px; justify-items: center; padding-block: 8px 24px; }
.paper { --pink: #111; background: #fff; color: #111; width: 210mm; max-width: 100%; box-sizing: border-box; padding: 12mm 12mm 16mm;
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08); border-radius: 4px; font: 11.5pt/1.55 "IBM Plex Sans Arabic", "Times New Roman", serif; }
.paper[dir="ltr"] { font-family: "Source Sans 3", "Times New Roman", "IBM Plex Sans Arabic", serif; }
.paper h1 { font-size: 14pt; margin: 2px 0; }
.paper h2 { font-size: 11.5pt; margin: 12px 0 6px; padding-bottom: 3px; border-bottom: 1.5px solid #111; }
.ph { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; border-bottom: 2px solid #111; padding-bottom: 8px; font-size: 10pt; }
.ph-mid { text-align: center; } .ph-mid img { max-height: 18mm; max-width: 40mm; display: block; margin: 0 auto 2px; }
.ph-side.end { text-align: end; }
.ph-code b { font-size: 12pt; letter-spacing: 1px; font-family: ui-monospace, "Courier New", monospace; }
.ph-student { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding: 7px 0; border-bottom: 1px solid #111; font-size: 10.5pt; }
.ph-ins { font-size: 10pt; margin: 6px 0 0; }
.pq-list, .key-list { margin: 0; padding-inline-start: 26px; display: grid; gap: 8px; }
.pq { break-inside: avoid; position: relative; padding-inline-end: 34px; }
.pq-pts { position: absolute; inset-inline-end: 0; top: 0; font-size: 9pt; border: 1px solid #111; border-radius: 4px; padding: 0 4px; }
.pq-ch { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }
.pq-tf { margin-inline-start: 8px; white-space: pre; }
.pq-img { display: block; max-width: 70%; max-height: 60mm; margin: 4px 0; }
.blank { display: inline-block; min-width: 32mm; border-bottom: 1px dotted #111; height: 1em; vertical-align: baseline; }
.pq-lines { height: calc(var(--n, 3) * 8mm); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(8mm - 1px), #999 calc(8mm - 1px), #999 8mm); margin-top: 2px; }
.pq-acts { position: absolute; inset-inline-end: 0; top: 22px; display: flex; gap: 4px; }
.pq-ai { color: var(--ink); }
.pq-swap:disabled { opacity: .55; cursor: wait; }
.pq-swap { font: 12px var(--f-ui); border: 1px solid var(--line); background: var(--surface); color: var(--accent); border-radius: 999px; padding: 1px 8px; cursor: pointer; }
.bub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 18px; margin-top: 10px; }
.bub-row { display: flex; align-items: center; gap: 6px; break-inside: avoid; }
.bub-row b { min-width: 7mm; text-align: center; font-size: 10.5pt; }
.bub { width: 7mm; height: 7mm; border: 1.3px solid #111; border-radius: 50%; display: inline-grid; place-items: center; font-size: 8pt; color: #555; }
.paper.key { background: #fffdf6; }
.key-list li { position: relative; padding-inline-end: 34px; }
.paper-foot { display: none; }
.tpl { display: grid; gap: 10px; max-width: 640px; }
.tpl textarea.inp { font: inherit; resize: vertical; }
@media (max-width: 640px) { .paper { padding: 6mm; font-size: 10pt; } .bub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pq-ch { grid-template-columns: 1fr; } }
@media print {
  @page { size: A4; margin: 12mm 11mm 15mm; }
  body[data-print] { background: #fff !important; }
  body[data-print] > *:not(#app) { display: none !important; }
  body[data-print] #app { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  body[data-print] #app > section > *:not(.paper-preview) { display: none !important; }
  body[data-print] .paper-preview { display: block; padding: 0; }
  body[data-print="exam"] .paper[data-part="key"], body[data-print="key"] .paper[data-part="exam"] { display: none !important; }
  body[data-print] .paper { width: auto; box-shadow: none; border-radius: 0; padding: 0; margin: 0; break-after: page; background: #fff; }
  body[data-print] .pq-swap, body[data-print] .pq-acts { display: none !important; }
  body[data-print] .paper-foot { display: flex; position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-between; font: 9pt "IBM Plex Sans Arabic", sans-serif; color: #333; }
}
/* student upload */
.tips { margin: 0; padding-inline-start: 18px; color: var(--muted); font-size: 14px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs figure { margin: 0; width: 120px; display: grid; gap: 4px; font-size: 12px; }
.thumbs img, .thumbs .pdf { width: 120px; height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
/* 0078: each page's upload state, and the three steps of sending a paper */
.thumbs figure.up-ok img, .thumbs figure.up-ok .pdf { outline: 3px solid var(--accent); outline-offset: -3px; }
.thumbs figure.up-busy img, .thumbs figure.up-busy .pdf { opacity: .6; }
.thumbs figure.up-err img, .thumbs figure.up-err .pdf { outline: 3px dashed #c0392b; outline-offset: -3px; }
.up-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; counter-reset: st; }
.up-steps li { counter-increment: st; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.up-steps li::before { content: counter(st); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); font-size: 12px; flex: none; }
.up-steps li.now { color: var(--ink); font-weight: 600; }
.up-steps li.now::before { border-color: var(--accent); animation: up-pulse 1.4s infinite; }
.up-steps li.done { color: var(--ink); }
.up-steps li.done::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.up-steps li.bad::before { content: "!"; background: var(--bad-bg); border-color: #c0392b; color: #c0392b; }
@keyframes up-pulse { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .up-steps li.now::before { animation: none; } }
/* teacher review */
.rv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rv-imgs { display: grid; gap: 10px; position: sticky; top: 8px; max-height: calc(100vh - 24px); overflow-y: auto; }
.rv-imgs img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.rv-items { display: grid; gap: 8px; }
.rv-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 6px; background: var(--surface); }
.rv-row.low { border-color: var(--glow); background: var(--glow-soft); }
.rv-row.ok { border-inline-start: 4px solid var(--lv3); } .rv-row.part { border-inline-start: 4px solid var(--lv2); } .rv-row.no { border-inline-start: 4px solid var(--lv1); }
.rv-q { font-size: 14px; } .rv-k { font-size: 12px; color: var(--muted); }
.rv-a { display: flex; flex-wrap: wrap; gap: 6px; } .rv-a select, .rv-a .inp { min-width: 0; }
.rv-essay { width: 100%; font-size: 13px; background: var(--bg); border-radius: 8px; padding: 6px 8px; }
@media (max-width: 800px) { .rv-grid { grid-template-columns: 1fr; } .rv-imgs { position: static; max-height: none; } }
/* Bloom */
.pq-bloom { display: inline-block; margin-top: 3px; font: 11px var(--f-ui); color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 8px; }
.key-bloom { color: #666; }
.bloom-sum { display: flex; flex-wrap: wrap; gap: 6px; }
.bloom-sel { font: 12px var(--f-ui); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; background: var(--surface); color: var(--ink); }
.bloom-sel.saved { border-color: var(--lv3); }
.bloom-cov td.gap { color: var(--lv1); }
@media print { body[data-print] .pq-bloom { display: none !important; } }

/* ---------- notifications bell ---------- */
.who { display: flex; align-items: center; gap: 10px; }
.bell-wrap { position: relative; }
.bell { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; font-size: 17px; line-height: 1; }
.bell[aria-expanded="true"] { border-color: var(--accent); }
.bell-n { position: absolute; top: -5px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: #d92d20; color: #fff; font: 600 11px/18px var(--f-ui); text-align: center; font-variant-numeric: tabular-nums; }
.npanel { position: fixed; z-index: 30; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 10px; display: grid; gap: 8px; align-content: start; }
.np-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.np-new summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); padding: 6px 4px; }
.np-form { display: grid; gap: 6px; padding: 4px; }
.np-form textarea { font: inherit; resize: vertical; }
.np-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.np-item { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: start; background: none; border: 0; border-radius: 10px; padding: 8px; color: inherit; }
.np-item:hover { background: var(--accent-soft); }
.np-item.unread { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.np-item.unread b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d92d20; margin-inline-start: 6px; vertical-align: middle; }
.np-ic { font-size: 18px; line-height: 1.3; }
.np-t { display: grid; gap: 2px; min-width: 0; }
.np-t b { font-size: 14px; } .np-t small { color: var(--muted); font-size: 12.5px; white-space: pre-line; overflow-wrap: anywhere; }
.np-when { font-size: 11.5px !important; }
.np-empty { padding: 12px 6px; }

/* ---------- lessons dropdown + collapsible units ---------- */
.lesson-sel { max-width: 100%; min-width: 220px; flex: 1 1 260px; }
details.unit.fold { border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
details.unit.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 13px; }
details.unit.fold > summary::-webkit-details-marker { display: none; }
details.unit.fold > summary::before { content: "◂"; transition: transform .15s; color: var(--accent); }
details.unit.fold[open] > summary::before { transform: rotate(-90deg); }
details.unit.fold > summary small { margin-inline-start: auto; font-weight: 400; }
details.unit.fold[open] { display: grid; gap: 8px; padding-bottom: 10px; }

/* ---------- review booklet: form ---------- */
.bk-form { display: grid; gap: 14px; }
.bk-fs { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0; display: grid; gap: 10px; }
.bk-fs legend { font-weight: 700; padding: 0 6px; font-family: var(--f-head); }
.bk-units { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bk-unit { display: grid; gap: 4px; }
.bk-lessons { display: grid; gap: 2px; padding-inline-start: 22px; font-size: 14px; }
.bk-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.bk-grid2 { display: grid; gap: 8px 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.bk-color { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.bk-color input[type=color] { width: 38px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); }
.bk-pal { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); background: linear-gradient(135deg, var(--m) 0 55%, var(--a) 55%); }
.bk-designs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.bk-design { display: grid; gap: 6px; justify-items: center; font-size: 13px; cursor: pointer; }
.bk-design input { position: absolute; opacity: 0; }
.bk-thumb { width: 100%; aspect-ratio: 3/4; max-width: 120px; background: #fff; border: 2px solid var(--line); border-radius: 8px; padding: 8px; box-sizing: border-box; display: grid; gap: 6px; align-content: start; }
.bk-design input:checked + .bk-thumb { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bk-design input:focus-visible + .bk-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.bk-thumb i { display: block; height: 8px; border-radius: 2px; background: #e5e7eb; }
.bk-thumb i:first-child { height: 16px; }
.bk-thumb[data-design="modern"] i:first-child { background: var(--bk-main); }
.bk-thumb[data-design="modern"] i:nth-child(2) { background: var(--bk-accent); width: 55%; }
.bk-thumb[data-design="classic"] i:first-child { background: none; border-top: 2px solid var(--bk-main); border-bottom: 2px solid var(--bk-main); }
.bk-thumb[data-design="notebook"] { border-inline-start: 6px solid var(--bk-main); background: repeating-linear-gradient(#fff 0 9px, #e8eef3 9px 10px); }
.bk-thumb[data-design="notebook"] i:first-child { background: color-mix(in srgb, var(--bk-accent) 35%, #fff); }
.bk-thumb[data-design="compact"] { grid-template-columns: 1fr 1fr; }
.bk-thumb[data-design="compact"] i:first-child { grid-column: 1 / -1; background: var(--bk-main); height: 10px; }
.bk-printbar { width: 100%; max-width: 210mm; align-items: center; }

/* ---------- review booklet: the printed pages ---------- */
.booklet { --bk-main: #0f5c63; --bk-accent: #eba35a; --bk-fs: 11.5pt; --tint: color-mix(in srgb, var(--bk-main) 9%, #fff);
  background: #fff; color: #111; width: 210mm; max-width: 100%; box-sizing: border-box; padding: 12mm; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08); font: var(--bk-fs)/1.6 "IBM Plex Sans Arabic", "Times New Roman", serif; }
.booklet[dir="ltr"] { font-family: "Source Sans 3", "IBM Plex Sans Arabic", serif; }
.booklet h1, .booklet h2, .booklet h3 { font-family: "Alexandria", "IBM Plex Sans Arabic", sans-serif; }
.bk-cover { min-height: 250mm; display: grid; align-content: center; justify-items: center; gap: 14px; text-align: center; padding: 10mm; box-sizing: border-box; border: 3px solid var(--bk-main); border-radius: 10px; margin-bottom: 10mm; }
.bk-logo { max-height: 30mm; max-width: 60mm; }
.bk-school { font-weight: 600; color: #333; }
.bk-ctitle { display: grid; gap: 6px; padding: 10mm 6mm; background: var(--bk-main); color: #fff; border-radius: 8px; width: 100%; box-sizing: border-box; }
.bk-ctitle h1 { font-size: 26pt; line-height: 1.25; } .bk-ctitle p { font-size: 13pt; opacity: .92; }
.bk-cmeta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bk-cmeta span { border: 1.5px solid var(--bk-accent); border-radius: 999px; padding: 2px 12px; font-size: 11pt; }
.bk-toc { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; font-size: 11pt; color: #333; }
.bk-teacher { font: 700 16pt "Alexandria", sans-serif; color: var(--bk-main); display: grid; gap: 2px; }
.bk-teacher span { font: 500 12pt "Source Sans 3", sans-serif; color: #333; }
.bk-name { font-size: 12pt; margin-top: 8mm; }
.bk-lesson { margin-bottom: 8mm; }
.bk-lh { display: grid; gap: 2px; padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; position: relative; }
.bk-lh small { font-size: 9.5pt; opacity: .85; } .bk-lh h2 { font-size: 15pt; margin: 0; }
.bk-cnt { position: absolute; inset-inline-end: 12px; top: 10px; font-size: 9.5pt; }
.bk-notes { border: 1.5px dashed var(--bk-accent); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; background: color-mix(in srgb, var(--bk-accent) 7%, #fff); }
.bk-notes h3 { font-size: 12pt; margin: 0 0 4px; color: var(--bk-main); }
.bk-note { margin-bottom: 6px; break-inside: avoid; } .bk-note b { color: var(--bk-main); }
.bk-note p { white-space: pre-line; margin: 2px 0 0; font-size: .95em; }
.bk-sec { margin-top: 6px; }
.bk-sh { font-size: 12pt; margin: 10px 0 6px; display: flex; align-items: center; gap: 8px; }
.bk-sh span { display: inline-grid; place-items: center; min-width: 22px; padding: 0 6px; height: 22px; border-radius: 6px; font-size: 10pt; }
.bk-qs { display: grid; gap: 7px; }
.bk-q { display: flex; gap: 8px; align-items: flex-start; break-inside: avoid; }
.bk-n { flex: none; min-width: 24px; height: 24px; display: grid; place-items: center; font: 700 10pt "Alexandria", sans-serif; font-variant-numeric: tabular-nums; }
.bk-qin { flex: 1; min-width: 0; }
.bk-qb { white-space: pre-line; }
.bk-ch { list-style: none; padding: 0; margin: 3px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 14px; }
.bk-ans { margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: color-mix(in srgb, var(--bk-accent) 14%, #fff); font-size: .95em; }
.bk-rub { display: block; color: #444; font-size: .9em; }
.bk-key { break-before: page; } .bk-key h2 { font-size: 16pt; color: var(--bk-main); border-bottom: 2px solid var(--bk-main); padding-bottom: 4px; }
.bk-kl h3 { font-size: 12pt; margin: 10px 0 4px; color: var(--bk-main); }
.bk-kli { margin: 0; padding-inline-start: 28px; display: grid; gap: 2px; font-size: .95em; }
.bk-foot { display: none; }
/* designs */
.booklet[data-design="modern"] .bk-lh { background: var(--bk-main); color: #fff; }
.booklet[data-design="modern"] .bk-sh span { background: var(--bk-accent); color: #fff; }
.booklet[data-design="modern"] .bk-sh { border-bottom: 2px solid color-mix(in srgb, var(--bk-accent) 40%, #fff); padding-bottom: 3px; }
.booklet[data-design="modern"] .bk-n { border-radius: 50%; background: var(--tint); color: var(--bk-main); }
.booklet[data-design="classic"] .bk-cover { border-style: double; border-width: 6px; }
.booklet[data-design="classic"] .bk-ctitle { background: none; color: var(--bk-main); border-top: 2px solid var(--bk-main); border-bottom: 2px solid var(--bk-main); border-radius: 0; }
.booklet[data-design="classic"] .bk-lh { border-top: 3px double var(--bk-main); border-bottom: 3px double var(--bk-main); border-radius: 0; text-align: center; color: var(--bk-main); }
.booklet[data-design="classic"] .bk-cnt { position: static; }
.booklet[data-design="classic"] .bk-sh { text-decoration: underline; text-decoration-color: var(--bk-main); text-underline-offset: 4px; }
.booklet[data-design="classic"] .bk-sh span { border: 1.5px solid var(--bk-main); color: var(--bk-main); }
.booklet[data-design="classic"] .bk-n { display: inline-flex; align-items: center; }
.booklet[data-design="classic"] .bk-n::after { content: "-"; }
.booklet[data-design="notebook"] { border-inline-start: 8px solid var(--bk-main); }
.booklet[data-design="notebook"] .bk-lh { background: color-mix(in srgb, var(--bk-accent) 22%, #fff); border-inline-start: 6px solid var(--bk-accent); color: #111; }
.booklet[data-design="notebook"] .bk-q { background: var(--tint); border-radius: 8px; padding: 6px 8px; }
.booklet[data-design="notebook"] .bk-n { background: var(--bk-main); color: #fff; border-radius: 6px; }
.booklet[data-design="notebook"] .bk-sh span { background: var(--bk-main); color: #fff; border-radius: 999px; }
.booklet[data-design="compact"] { --bk-fs: 10pt; }
.booklet[data-design="compact"] .bk-lh { border-bottom: 2.5px solid var(--bk-main); border-radius: 0; padding: 4px 0; color: var(--bk-main); }
.booklet[data-design="compact"] .bk-qs { display: block; column-count: 2; column-gap: 8mm; column-rule: 1px solid #ddd; }
.booklet[data-design="compact"] .bk-q { margin-bottom: 5px; }
.booklet[data-design="compact"] .bk-ch { grid-template-columns: 1fr; }
.booklet[data-design="compact"] .bk-sh span { background: var(--bk-accent); color: #fff; }
.booklet[data-design="compact"] .bk-n { min-width: 18px; height: 18px; color: var(--bk-main); }
.booklet[data-design="compact"] .bk-cover { min-height: 200mm; }
@media (max-width: 640px) { .booklet { padding: 6mm; } .bk-ch { grid-template-columns: 1fr; } .booklet[data-design="compact"] .bk-qs { column-count: 1; } }
@media print {
  body[data-print="booklet"] .bk-printbar { display: none !important; }
  body[data-print="booklet"] .booklet { width: auto; box-shadow: none; border-radius: 0; padding: 0; margin: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body[data-print="booklet"] .bk-cover { break-after: page; min-height: 262mm; margin: 0; }
  body[data-print="booklet"] .bk-lesson { break-before: page; }
  body[data-print="booklet"] .bk-cover + .bk-lesson { break-before: auto; }
  body[data-print="booklet"] .bk-foot { display: flex; position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-between; font: 9pt "IBM Plex Sans Arabic", sans-serif; color: #444; border-top: 1px solid #ccc; padding-top: 2px; }
}

/* ---------- white-label brand + usage meters ---------- */
.logo img { height: 30px; width: auto; max-width: 120px; object-fit: contain; border-radius: 6px; flex: none; }
.brand-hello { text-align: center; }
.brand-hello .brand-logo { display: block; margin: 0 auto 10px; max-height: 96px; max-width: 220px; object-fit: contain; }
.brand-prev { margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 420px; }
.bp-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-family: var(--f-head); position: relative; }
.bp-bar img { height: 28px; max-width: 90px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.bp-bar span { position: absolute; inset-inline: 0; bottom: 0; height: 4px; }
.bp-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.bp-body small { color: var(--muted); min-height: 1em; }
.bp-body i { display: block; height: 10px; border-radius: 5px; width: 60%; opacity: .85; }
.bp-body i + i { width: 35%; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 12px; }
.share small { width: 100%; color: var(--muted); }
.share code { background: var(--accent-soft); padding: 4px 8px; border-radius: 6px; font-size: 13px; overflow-wrap: anywhere; max-width: 100%; }
.usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 8px; }
.usage-card { margin-bottom: 14px; }
.usage-card > small { color: var(--muted); }
.umeter { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; font-size: 13px; }
.umeter span { color: var(--muted); }
.umeter small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.umeter .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.umeter .bar i { display: block; height: 100%; background: var(--accent); }
.umeter.full b { color: var(--lv1); }
.umeter.full .bar i { background: var(--lv1); }
form.ov details { margin-top: 10px; }
form.ov summary { cursor: pointer; color: var(--accent); font-size: 14px; }

/* ---------- bubble sheets (OMR) ---------- */
.omr-out { display: none; }
.omr-page { position: relative; width: 210mm; height: 297mm; background: #fff; color: #000; overflow: hidden; font-family: "IBM Plex Sans Arabic", "Source Sans 3", sans-serif; box-sizing: border-box; }
.omr-page > * { position: absolute; box-sizing: border-box; }
.omr-m { background: #000; display: block; }
.omr-b { border: 0.3mm solid #222; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.3mm; line-height: 1; color: #555; }
.omr-b.on { background: #000; border-color: #000; }
.omr-n { font-size: 3.2mm; text-align: right; padding-right: 1mm; line-height: 5mm; }
.omr-idbox { border: 0.3mm solid #888; border-radius: 2mm; }
.omr-idh { font-size: 3mm; text-align: center; font-weight: 600; }
.omr-t { font-size: 3.4mm; line-height: 1.35; overflow: hidden; }
.omr-title { font-size: 5mm; font-weight: 700; }
.omr-line { border-bottom: 0.25mm solid #999; }
.omr-hint { font-size: 2.8mm; color: #333; }
.omr-foot { font-size: 2.5mm; color: #666; text-align: center; }
.omr-box { border: 0.35mm solid #333; border-radius: 1.5mm; }
.omr-box b { position: absolute; top: 0; left: 0; font-size: 3mm; background: #000; color: #fff; padding: 0.3mm 1.6mm; border-radius: 1.2mm 0 1.2mm 0; }
.omr-roster { padding: 10mm; }
@media print {
  body[data-print="omr"] .omr-out, body[data-print="omrlist"] .omr-out { display: block !important; }
  body[data-print="omr"] .paper, body[data-print="omrlist"] .paper, body[data-print="omr"] .paper-foot, body[data-print="omrlist"] .paper-foot { display: none !important; }
  body[data-print="omr"] #paperArea, body[data-print="omrlist"] #paperArea { display: none !important; }
  body[data-print="omr"] .omr-page { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body[data-print="omr"] .omr-page + .omr-page { break-before: page; }
  body[data-print="omr"] #app > section, body[data-print="omr"] .omr-out { margin: 0 !important; padding: 0 !important; gap: 0 !important; border: 0 !important; }
}
.omr-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.omr-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface); }
.omr-card img { width: 72px; height: auto; border-radius: 6px; flex: none; }
.omr-card .t { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.omr-card .t small { color: var(--muted); }
.omr-card.warn { border-color: var(--lv2); }
.omr-card.bad { border-color: var(--lv1); background: var(--bad-bg); }
.omr-card.done { border-color: var(--lv3); background: var(--good-bg); }
.omr-card details .field { display: inline-flex; margin: 4px 8px 0 0; }
.paper-tools label.btn { cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); }
.ow-model { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.ow-list { display: flex; flex-direction: column; gap: 12px; }
.ow-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; outline: none; }
.ow-row:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ow-row.marked { opacity: .75; }
.ow-row img { width: 100%; max-height: 260px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.ow-name { font-weight: 600; }
.ow-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* exam versions + keep the extra print areas out of other prints */
.ver-out { display: none; }
@media print {
  body[data-print]:not([data-print="omr"]):not([data-print="omrlist"]) .omr-out { display: none !important; }
  body[data-print]:not([data-print="vexam"]):not([data-print="vkey"]) .ver-out { display: none !important; }
  body[data-print="vexam"] #paperArea, body[data-print="vkey"] #paperArea { display: none !important; }
  body[data-print="vexam"] .ver-out .paper[data-part="key"], body[data-print="vkey"] .ver-out .paper[data-part="exam"] { display: none !important; }
  body[data-print="omr"] .ver-out, body[data-print="omrlist"] .ver-out { display: none !important; }
}

/* exam report */
.rep h2 { margin: 22px 0 8px; font-size: 18px; }
.rep-bands { display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.rep-bands > div { display: grid; grid-template-columns: minmax(90px, 220px) 1fr 44px; gap: 10px; align-items: center; font-size: 14px; }
.rep-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.rep-bar i { display: block; height: 100%; border-radius: 5px; }
.rep-bar i.low { background: var(--lv1); } .rep-bar i.mid { background: var(--lv2); } .rep-bar i.hi { background: var(--lv3); }
.rep-wrap { display: block; }
@media print {
  body[data-print="report"] .rep { padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body[data-print="report"] .rep table { font-size: 10pt; }
  body[data-print="report"] .rep h2 { break-after: avoid; }
}

/* parent report page + weekly messages */
.pr-chart { width: 100%; max-width: 420px; height: auto; display: block; margin: 8px auto 0; }
.pr-bar { fill: var(--lv0); } .pr-bar.hi { fill: var(--lv3); } .pr-bar.mid { fill: var(--lv2); } .pr-bar.low { fill: var(--lv1); }
.pr-n { font-size: 11px; fill: var(--ink); font-family: var(--f-en); } .pr-w { font-size: 10px; fill: var(--muted); font-family: var(--f-en); }
.parent-rep h2 { margin: 18px 0 8px; }
.wa-row.done { opacity: .7; }
.wk-steps { padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.wk-steps code { display: inline-block; margin-top: 4px; background: var(--accent-soft); padding: 4px 8px; border-radius: 6px; }

.remedial { margin: 14px 0; }
@media print { body[data-print] .no-print { display: none !important; } }

.ow-sug { background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.ow-btns .btn.sug { box-shadow: 0 0 0 3px var(--glow); }

/* centre: attendance + payments */
.pay { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.pay.paid { background: var(--good-bg); color: var(--lv3); } .pay.part { background: var(--glow-soft); color: #9a5b12; } .pay.unpaid { background: var(--bad-bg); color: var(--lv1); }
.att-row { align-items: center; }
.att-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.att-btns .chip { cursor: pointer; min-height: 36px; }
.chip.on.present { background: var(--lv3); color: #fff; border-color: var(--lv3); }
.chip.on.late { background: var(--lv2); color: #1b1b1b; border-color: var(--lv2); }
.chip.on.absent { background: var(--lv1); color: #fff; border-color: var(--lv1); }
.chip.on.excused { background: var(--muted); color: #fff; }
.scan-card video { width: 100%; max-width: 420px; border-radius: 12px; margin-top: 8px; background: #000; }
.scan-toast { margin-top: 8px; font-size: 18px; padding: 10px 14px; border-radius: 12px; min-height: 0; }
.scan-toast:empty { display: none; }
.scan-toast.ok { background: var(--good-bg); } .scan-toast.bad { background: var(--bad-bg); }
.sched { display: flex; flex-direction: column; gap: 6px; }
.sched .check { gap: 10px; } .sched input[type=time] { width: 120px; }
.receipt-out, .cards-out { display: none; }
.receipt { max-width: 120mm; margin: 0 auto; font-size: 11pt; text-align: center; }
.receipt img { max-height: 18mm; }
.receipt table { width: 100%; border-collapse: collapse; margin-top: 4mm; text-align: start; }
.receipt th, .receipt td { border: 0.3mm solid #999; padding: 2mm 3mm; } .receipt th { width: 32mm; background: #f2f2f2; }
.cards-sheet { display: grid; grid-template-columns: repeat(2, 85mm); gap: 6mm 8mm; justify-content: center; }
.id-card { width: 85mm; height: 54mm; border: 0.3mm solid #666; border-radius: 3mm; padding: 3mm; box-sizing: border-box; display: flex; flex-direction: column; gap: 2mm; break-inside: avoid; font-size: 10pt; color: #000; background: #fff; }
.idc-head { display: flex; align-items: center; gap: 2mm; border-bottom: 0.3mm solid #ccc; padding-bottom: 1.5mm; } .idc-head img { height: 7mm; }
.idc-body { display: flex; gap: 3mm; align-items: center; flex: 1; }
.idc-qr { width: 30mm; height: 30mm; flex: none; } .idc-qr svg { width: 100%; height: 100%; }
.idc-name { font-size: 12pt; display: block; margin-bottom: 1mm; }
@media print {
  body[data-print]:not([data-print="receipt"]) .receipt-out, body[data-print]:not([data-print="cards"]) .cards-out { display: none !important; }
  body[data-print="receipt"] #app > section > *:not(#cBody), body[data-print="cards"] #app > section > *:not(#cBody) { display: none !important; }
  body[data-print="receipt"] #cBody > *:not(.receipt-out), body[data-print="cards"] #cBody > *:not(.cards-out) { display: none !important; }
  body[data-print="receipt"] .receipt-out, body[data-print="cards"] .cards-out { display: block !important; }
  body[data-print="receipt"] #app > section > #cBody, body[data-print="cards"] #app > section > #cBody { display: block !important; }
  body[data-print="cards"] .id-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.fees { margin-top: 14px; } .fee-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.fee-row:first-of-type { border-top: 0; }
.pay-result h2 { margin-bottom: 6px; }

/* videos */
.upbar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; } .upbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.vid .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.vid details { margin-top: 6px; } .vid summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.vid-s.locked { opacity: .75; }
.player-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 12px; }
.player { width: min(960px, 100%); background: #000; border-radius: 12px; overflow: hidden; }
.player-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #111; color: #eee; } .player-bar b { flex: 1; } .player-bar small { color: #aaa; }
.player-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-frame:fullscreen { aspect-ratio: auto; width: 100vw; height: 100vh; }
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wm { position: absolute; pointer-events: none; color: rgba(255,255,255,.55); font: 600 15px var(--f-ui); text-shadow: 0 0 3px rgba(0,0,0,.8); transition: top 2s, left 2s; white-space: nowrap; z-index: 2; }
.codes-out { display: none; }
.code-sheet { display: grid; grid-template-columns: repeat(2, 90mm); gap: 4mm 8mm; justify-content: center; }
.code-card { border: 0.3mm dashed #666; border-radius: 2mm; padding: 3mm; display: flex; flex-direction: column; gap: 1.5mm; break-inside: avoid; font-size: 9pt; color: #000; }
.cc-code { font: 700 16pt "Source Sans 3", monospace; letter-spacing: 1mm; text-align: center; border: 0.3mm solid #000; padding: 1.5mm; }
@media print {
  body[data-print]:not([data-print="codes"]) .codes-out { display: none !important; }
  body[data-print="codes"] .codes-out { display: block !important; }
}

/* video AI helper */
.player { max-height: calc(100vh - 24px); overflow-y: auto; }
.vask { background: #15171c; color: #eee; border-top: 1px solid #2a2d35; }
.vask > summary { padding: 10px 12px; cursor: pointer; font-weight: 700; }
.vask-log { max-height: 34vh; overflow-y: auto; padding: 0 12px; display: grid; gap: 8px; }
.vask-log .empty { color: #aaa; }
.vask-form { display: flex; gap: 8px; padding: 10px 12px; align-items: flex-end; }
.vask-form textarea { flex: 1; resize: vertical; background: #0d0f13; color: #eee; border-color: #333; }
.vqa { border-radius: 10px; padding: 8px 10px; background: rgba(127,127,127,.1); }
.vqa .q { font-weight: 700; margin: 0 0 4px; }
.vqa .a { margin: 0; line-height: 1.7; }
.tjump { font: inherit; font-size: .85em; border: 0; border-radius: 999px; padding: 1px 8px; margin: 0 2px; cursor: pointer; background: var(--accent, #f59e0b); color: #fff; direction: ltr; unicode-bidi: isolate; }
.vai { margin-top: 6px; } .vai > summary { cursor: pointer; }
.vqa-list { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; margin-top: 8px; }

/* formulas: always left-to-right inside Arabic text */
.katex { direction: ltr; unicode-bidi: isolate; font-size: 1.08em; }
.katex-display { direction: ltr; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }

/* timetable */
.sched .toolbar { align-items: center; }
.sched-day { font-size: 1.05rem; margin: 18px 0 6px; color: var(--muted); }
.sched-day.today { color: var(--accent); }
.acard.sess .t b .mono { direction: ltr; unicode-bidi: isolate; }
.acard.sess.cancelled { opacity: .65; }
.acard.sess.cancelled .t b { text-decoration: line-through; }
.acard.sess.live { border-color: var(--lv1); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lv1) 25%, transparent); }
.sess-edit { margin-top: -4px; }
.acard.sess .meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.pill.live { display: inline-block; line-height: 1.6; }
.pill.live { color: #fff; background: var(--lv1); border-color: var(--lv1); }
.live-now { border-color: var(--lv1); }
.btn.danger, .btn.ghost.danger { color: var(--lv1); border-color: var(--lv1); }
.btn.danger:not(.ghost) { background: var(--lv1); color: #fff; }
.today-sess .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.sched-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 0; }

/* live class */
.live-wrap { position: fixed; inset: 0; z-index: 60; background: #0b1114; color: #e8eef0; display: flex; }
.live-room { display: flex; flex-direction: column; width: 100%; height: 100%; }
.live-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #121b1f; border-bottom: 1px solid #22313a; flex-wrap: wrap; }
.live-bar b { color: #ff6b5f; } .live-bar .sp { flex: 1; } .live-bar .empty { color: #9fb0b6; }
.live-body { flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
.live-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 10px; gap: 8px; }
.wb-wrap { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.wb-wrap canvas { max-width: 100%; max-height: 100%; aspect-ratio: 16 / 9; background: #fff; border-radius: 8px; touch-action: none; cursor: crosshair; }
.wb-wrap .screen { position: absolute; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.wb-wrap .screen video { max-width: 100%; max-height: 100%; }
.wb-wrap .pip { position: absolute; bottom: 10px; left: 10px; width: 22%; min-width: 140px; border-radius: 8px; border: 2px solid #fff; background: #000; }
.wb-page { position: absolute; top: 8px; left: 10px; font-size: 12px; color: #555; background: rgba(255,255,255,.8); padding: 1px 8px; border-radius: 99px; }
.live-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.live-tools .tool { background: #1b272c; color: #e8eef0; border: 1px solid #2c3d45; border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
.live-tools .tool[aria-pressed="true"] { background: #155e63; border-color: #5fb3b3; }
.live-tools .tool:disabled { opacity: .45; cursor: not-allowed; }
.live-tools .swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #2c3d45; cursor: pointer; }
.live-tools .swatch[aria-pressed="true"] { outline: 3px solid #5db8bf; outline-offset: 1px; }
.live-tools .sep { width: 1px; height: 24px; background: #2c3d45; margin: 0 4px; }
.live-tools .empty { color: #9fb0b6; }
.live-side { border-inline-start: 1px solid #22313a; display: flex; flex-direction: column; min-height: 0; padding: 10px; gap: 6px; background: #10181c; }
.live-side h3 { margin: 6px 0 2px; font-size: 15px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.people { max-height: 34vh; overflow: auto; display: grid; gap: 4px; }
.person { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; background: #162126; }
.person span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person.hand { background: #3a2c12; }
.person .linkbtn { color: #9fd7dc; }
.cams { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
video.cam { width: 100%; border-radius: 6px; background: #000; }
.chat-log { flex: 1; overflow: auto; display: grid; align-content: start; gap: 4px; font-size: 14px; min-height: 120px; }
.chat-log .msg b { color: #9fd7dc; } .chat-log .msg.mine b { color: #eba35a; }
.chat-f { display: flex; gap: 6px; } .chat-f .inp { min-width: 0; } .chat-f .inp { flex: 1; background: #0b1114; color: #e8eef0; border-color: #2c3d45; }
.live-up { margin: auto; max-width: 420px; color: var(--ink); }
.check.small { font-size: 12px; font-weight: 400; }
.live-room .check span { color: #cfdde1; }
@media (max-width: 760px) {
  .live-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow: auto; }
  .live-side { border-inline-start: 0; border-top: 1px solid #22313a; }
  .wb-wrap { flex: none; }
}

/* protected exam */
body.exam-lock .quiz { user-select: none; -webkit-user-select: none; }
.exam-warn { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--lv1); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 92vw; }
.exam-rules ul { line-height: 1.9; }

/* ---------- toasts (instead of alert boxes) ---------- */
#toasts { position: fixed; inset-inline: 0; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; cursor: pointer; max-width: min(520px, 100%); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-inline-start: 4px solid var(--muted); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px; line-height: 1.6; animation: toast-in .2s ease-out; transition: opacity .25s, transform .25s; }
.toast-ok { border-inline-start-color: #2e8b57; }
.toast-err { border-inline-start-color: #c0392b; }
.toast.bye { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- loading skeletons: a page that is loading shows grey cards instead of a blank screen ---------- */
#app > .loading { display: flex; flex-direction: column; text-align: start; padding: 14px 0 0; font-size: 13px; }
#app > .loading::before { order: 1; } #app > .loading::after { order: 2; }
#app > .loading::before, #app > .loading::after { content: ""; display: block; border-radius: 14px; margin-top: 12px;
  background: linear-gradient(90deg, var(--line) 0%, var(--surface) 50%, var(--line) 100%) 0 0 / 200% 100%; animation: skel 1.3s linear infinite; }
#app > .loading::before { height: 92px; }
#app > .loading::after { height: 180px; opacity: .7; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .toast, #app > .loading::before, #app > .loading::after { animation: none; } }

/* ---------- lesson extras: simulations, slides, AI decks (resources.js) ---------- */
.lres { margin-top: 22px; }
.lres-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.lres-head h2 { margin: 0; font: 600 18px/1.4 var(--f-head); }
.lres-add { display: flex; flex-wrap: wrap; gap: 6px; }
.lres-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.lres-item { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px 6px 6px; min-width: 0; }
.lres-open { flex: 1; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px; text-align: start; color: inherit; font: inherit; cursor: pointer; min-width: 0; border-radius: 8px; }
.lres-open:hover, .lres-open:focus-visible { background: var(--accent-soft); }
.lres-ic { font-size: 24px; line-height: 1; }
.lres-t { display: flex; flex-direction: column; min-width: 0; } .lres-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lres-t small { color: var(--muted); }
.res-wrap { align-items: stretch; }
.res-sheet { width: min(640px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border-radius: 12px; overflow: hidden; margin: auto; }
.res-sheet.wide { width: min(1200px, 100%); height: 100%; }
.res-sheet .player-bar .res-bar-x { flex: 0; }
.res-body { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.sim-frame { flex: 1; min-height: 60vh; background: #fff; border-radius: 8px; overflow: hidden; }
.sim-frame iframe { width: 100%; height: 100%; min-height: 60vh; border: 0; display: block; }
.sim-frame:fullscreen iframe { height: 100vh; }
.sim-foot, .deck-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.deck-ctl .sp { flex: 1; }
.res-form { display: flex; flex-direction: column; gap: 10px; }
.res-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.res-form label.chk { flex-direction: row; align-items: center; gap: 6px; }
.sim-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 34vh; overflow: auto; }
.sim-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: inherit; font: inherit; cursor: pointer; }
.sim-opt small { color: var(--muted); font-size: 12px; } .sim-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.pdf-pages { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; background: var(--bg); padding: 8px; border-radius: 8px; min-height: 60vh; }
.pdf-page { background: #fff; width: 100%; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.pdf-page canvas { display: block; }
.deck-stage { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 10px; padding: 12px; min-height: 55vh; outline: none; cursor: pointer; user-select: none; }
.deck-slide { width: 100%; max-width: 1000px; aspect-ratio: 16 / 9; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; overflow: auto; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.deck-slide h2 { margin: 0 0 .6em; color: var(--accent); font: 700 clamp(20px, 3.4vw, 38px)/1.3 var(--f-head); }
.deck-slide ul { margin: 0; padding-inline-start: 1.2em; font-size: clamp(15px, 2.2vw, 24px); line-height: 1.8; }
.deck-note { margin-top: 1em; padding: 8px 12px; background: var(--glow-soft); border-radius: 8px; font-size: 14px; }
.k-title .deck-slide { background: var(--accent); color: var(--accent-ink); text-align: center; } .k-title .deck-slide h2 { color: var(--accent-ink); } .k-title .deck-slide ul { list-style: none; padding: 0; }
.k-question .deck-slide h2::before { content: "❓ "; }
.res-sheet:fullscreen { border-radius: 0; } .res-sheet:fullscreen .deck-stage { min-height: 0; }
.deck-ttl { display: flex; flex-direction: column; gap: 4px; }
.deck-edit { display: flex; flex-direction: column; gap: 10px; }
.dk { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.dk-h { display: flex; align-items: center; gap: 6px; } .dk-h input { flex: 1; min-width: 0; font-weight: 600; }
.dk textarea { width: 100%; resize: vertical; }
@media (max-width: 600px) { .res-wrap { padding: 0; } .res-sheet, .res-sheet.wide { border-radius: 0; height: 100%; } .sim-frame, .sim-frame iframe { min-height: 70vh; } }

/* ---------- ask the teacher (questions.js) ---------- */
.ask-form { display: flex; flex-direction: column; gap: 10px; }
.ask-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .ask-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; min-width: 0; }
@media (max-width: 520px) { .ask-form .row2 { grid-template-columns: 1fr; } }
.sec-h { font: 600 18px/1.4 var(--f-head); margin: 22px 0 10px; }
.ask-list { display: flex; flex-direction: column; gap: 12px; }
.askq { display: flex; flex-direction: column; gap: 8px; }
.askq-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .askq-h small { color: var(--muted); }
.askq-q { margin: 0; font-size: 16px; white-space: pre-wrap; }
.pill.ok { background: var(--good-bg); color: var(--lv3); }
.reply { border-inline-start: 3px solid var(--accent); padding: 6px 12px; background: var(--accent-soft); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.reply-h { display: flex; gap: 8px; align-items: baseline; } .reply-h small { color: var(--muted); } .reply p { margin: 0; }
.voice audio, .rec-out audio { width: 100%; max-width: 420px; height: 40px; }
.clip { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); flex-wrap: wrap; }
.clip-ic { font-size: 24px; } .clip-t { flex: 1; min-width: 180px; display: flex; flex-direction: column; } .clip-t small { color: var(--muted); } .clip-t p { margin: 4px 0 0; }
.answer { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.rec { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rec-out { flex: 1 1 260px; display: block; min-width: 0; }
.rec .recording { background: var(--lv1); animation: recpulse 1s infinite alternate; }
@keyframes recpulse { to { opacity: .7; } }
.clip-pick { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 8px; } .clip-pick select { flex: 1; min-width: 180px; }
.clip-pick label { display: flex; flex-direction: column; font-size: 13px; }
.ask .seg { display: inline-flex; margin-bottom: 12px; }
.seg-b { border: 0; background: none; padding: 5px 14px; border-radius: 999px; font: inherit; color: var(--muted); cursor: pointer; } .seg-b[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) { .rec .recording { animation: none; } }
.voice-box summary { cursor: pointer; } .voice-box .vb-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.vb-read { margin: 0; padding: 12px 14px; background: var(--bg); border-inline-start: 3px solid var(--glow); border-radius: 8px; line-height: 2; font-size: 16px; }
.vb-modes { display: flex; flex-direction: column; gap: 6px; } .vb-modes select { width: auto; display: inline-block; padding: 2px 6px; }
.voice-box label.chk { display: flex; align-items: flex-start; gap: 6px; }
.reply.ai { border-inline-start-color: var(--glow); background: var(--glow-soft); }
.ai-draft { border-inline-start-color: var(--glow); background: var(--glow-soft); border: 1px dashed var(--glow); }
.qrev.qflag { border-inline-start: 4px solid var(--lv1); }
.qobj { font-size: 13px; color: var(--muted); margin: 2px 0 4px; }

/* ---------- teacher home: a conversation that is not the AI (home.js) ---------- */
.home { display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - 190px); }
.hlog { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.hb { max-width: min(640px, 92%); padding: 10px 14px; border-radius: 16px; line-height: 1.7; animation: hb-in .18s ease-out; }
.hb p { margin: 0 0 4px; } .hb p:last-child { margin-bottom: 0; }
.hb.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-start-start-radius: 4px; }
.hb.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-start-end-radius: 4px; }
.hgrp { margin: 6px 0; } .hgrp > div { margin: 2px 0; } .hnames { display: flex; flex-wrap: wrap; gap: 4px; }
.hname { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 13px; }
.hacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hchips { display: flex; flex-wrap: wrap; gap: 6px; }
.hchips .chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.hchips .chip:hover, .hchips .chip:focus-visible { border-color: var(--accent); }
.hform { display: flex; gap: 8px; position: sticky; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--bg); padding-top: 6px; }
.hform .inp { flex: 1; min-width: 0; font-size: 16px; padding: 10px 14px; border-radius: 999px; }
.hdots { display: inline-flex; gap: 4px; } .hdots span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: hdot 1s infinite; }
.hdots span:nth-child(2) { animation-delay: .15s; } .hdots span:nth-child(3) { animation-delay: .3s; }
@keyframes hdot { 50% { opacity: .25; } } @keyframes hb-in { from { opacity: 0; transform: translateY(6px); } }
.live-pill { background: var(--lv1); color: #fff; border-color: var(--lv1); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-align: start; color: inherit; font: inherit; cursor: pointer; }
.tile:hover, .tile:focus-visible { border-color: var(--accent); }
.tile-i { font-size: 26px; } .tile small { color: var(--muted); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .hb, .hdots span { animation: none; } }
.hpick .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hpick .chip:disabled { opacity: .6; cursor: default; }
.mm-wrap { flex: 1; overflow: auto; background: #fbfcfc; border-radius: 10px; min-height: 55vh; }
.mm-wrap svg { width: 100%; min-width: 900px; height: auto; display: block; }
.tiles.make { margin-bottom: 18px; } .tiles.make .tile { border-color: var(--accent); background: var(--accent-soft); }
/* slide pictures */
.deck-slide.has-img { flex-direction: row; align-items: center; gap: 4%; }
.deck-slide .deck-txt { flex: 1; min-width: 0; }
.deck-img { flex: 0 0 42%; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.deck-img img { max-width: 100%; max-height: 52vh; object-fit: contain; border-radius: 8px; background: #fff; }
.deck-img figcaption { font-size: 11px; color: var(--muted); text-align: center; }
@media (max-width: 700px) { .deck-slide.has-img { flex-direction: column; } .deck-img { flex-basis: auto; } .deck-img img { max-height: 28vh; } }
.dk-img { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .dk-img img { height: 56px; border-radius: 6px; }
.dk-img .sp { flex: 1; } .dk-img label.linkbtn { cursor: pointer; }
.dk-q { display: flex; gap: 6px; margin: 6px 0; } .dk-q .inp { flex: 1; min-width: 0; }
.dk-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.dk-pic { border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; } .dk-pic img { width: 100%; height: 90px; object-fit: contain; }

/* marketplace */
.mk-search { width: 100%; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mk-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.mk-top { display: flex; gap: 8px; align-items: flex-start; } .mk-t { display: flex; flex-direction: column; min-width: 0; } .mk-t small { color: var(--muted, #666); }
.mk-d { margin: 0; font-size: 14px; color: #444; }
.mk-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; }
.mk-f { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 14px; }
.mk-f input, .mk-f textarea { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.mk-slides { padding-inline-start: 22px; line-height: 1.8; }

/* question pictures, the queue of questions waiting for one, the outline of each idea */
.q-img { display: block; max-width: 100%; max-height: 420px; margin: 8px auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qrev.held { border-inline-start: 4px solid #d99a00; }
.held-fig { background: #fff7e0; border-radius: 8px; padding: 6px 10px; margin: 6px 0; font-size: 14px; }
.held-up { cursor: pointer; }
.lout { margin-top: 16px; } .lout h2 { font-size: 18px; margin: 0 0 8px; }
.outline { margin: 8px 0; padding: 10px 12px; } .outline summary { cursor: pointer; }
.outline h3 { font-size: 15px; margin: 10px 0 6px; }
.ol-root { font-weight: 700; padding: 6px 10px; background: var(--soft, #eef4ff); border-radius: 8px; display: inline-block; }
.ol-br, .ol-sl ol { padding-inline-start: 22px; line-height: 1.8; }
.ol-rule { background: #eefbf1; border-radius: 6px; padding: 4px 8px; margin: 4px 0; }
.ol-ex { background: #f6f6f6; border-radius: 6px; padding: 4px 8px; margin: 4px 0; }

/* ---------- growth: public page, joining, coupons, certificates, protected files (v34) ---------- */
.site-hero { text-align: center; padding: 28px 16px 18px; }
.site-hero h1 { font-size: clamp(26px, 6vw, 40px); margin: 8px 0 4px; }
.site-logo { width: 96px; height: 96px; object-fit: contain; border-radius: 20px; background: var(--surface); }
.site-tag { color: var(--muted); font-size: 17px; margin: 0 0 12px; }
.site-hero .chips { justify-content: center; margin: 10px 0; }
.site-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.site-about p { line-height: 1.9; margin: 0; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.why-grid > div { display: flex; flex-direction: column; gap: 4px; }
.why-grid small { color: var(--muted); line-height: 1.6; }
.site-h { margin: 22px 0 6px; } .site-g { margin: 14px 0 6px; color: var(--muted); font-size: 15px; }
.site-certs { text-align: center; margin-top: 20px; }
.join-done .cred { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 16px; }
.join-done .cred > div { background: var(--accent-soft); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.join-done .cred b { font-size: 18px; word-break: break-all; }
@media (max-width: 480px) { .join-done .cred { grid-template-columns: 1fr; } }
.coupon-f { display: flex; gap: 6px; margin: 4px 0 10px; }
.coupon-f .inp { flex: 1; min-width: 0; max-width: 220px; }
.ct-pick { margin: 8px 0; } .ct-pick .chip { cursor: pointer; } .ct-pick input { margin-inline-end: 4px; }
.site-ed { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; margin: 12px 0; }
.site-ed legend { font-weight: 700; padding: 0 6px; }
/* a student file: no selecting, no dragging the pages out, nothing when printed */
.pdf-pages.guarded { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pdf-pages.guarded canvas { pointer-events: none; }
@media print { .res-wrap { display: none !important; } }
/* the certificate (A4 landscape when printed) */
.cert { --cm: #155e63; --ca: #c4532f; width: 297mm; max-width: 100%; aspect-ratio: 297 / 210; padding: 9mm; margin: 0 auto; }
.cert-frame { height: 100%; box-sizing: border-box; border: 3px solid var(--cm); outline: 1px solid var(--ca); outline-offset: -9px; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6% 8%; gap: 2%; position: relative; }
.cert-head { display: flex; align-items: center; gap: 10px; font-size: clamp(14px, 2.2vw, 22px); color: var(--cm); }
.cert-head img { height: clamp(32px, 6vw, 64px); }
.cert-k { font-size: clamp(22px, 4.6vw, 46px); font-weight: 800; color: var(--cm); margin: 0; letter-spacing: .5px; }
.cert-to { margin: 0; color: #555; font-size: clamp(12px, 1.8vw, 18px); }
.cert-name { font-size: clamp(24px, 5vw, 50px); margin: 0; color: #111; border-bottom: 2px solid var(--ca); padding: 0 24px 4px; }
.cert-title { font-size: clamp(15px, 2.6vw, 26px); font-weight: 700; margin: 0; }
.cert-detail { margin: 0; color: #555; font-size: clamp(12px, 1.8vw, 17px); }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; width: 100%; margin-top: auto; }
.cert-foot > div { display: flex; flex-direction: column; gap: 2px; min-width: 25%; font-size: clamp(11px, 1.6vw, 15px); }
.cert-foot small { color: #777; }
.cert-qr svg { width: clamp(52px, 9vw, 92px); height: auto; margin: 0 auto; }
.cert-verify { position: absolute; bottom: 10px; inset-inline: 0; color: #888; font-size: clamp(8px, 1.1vw, 11px); }
.cert-check { text-align: center; }
@media print {
  body[data-print="cert"] .cert { width: 297mm; height: 210mm; padding: 9mm; break-after: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body[data-print="cert"] .cert-check, body[data-print="cert"] .paper-tools { display: none !important; }
}
/* follow-up, exam checks, wrong choices (v35) */
.fu-quick { margin: 8px 0; } .fu-quick .chip, .chip.on { cursor: pointer; } .chip.on { background: var(--accent-soft); border-color: var(--accent); }
.fu-table td { white-space: nowrap; } .fu-table td:first-child { white-space: normal; }
.flag-card { border-inline-start: 4px solid #c0392b; } .hold-card { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 12px; }
.picked .pk { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.picked .pk.ok { border-color: #2e7d32; color: #2e7d32; } .picked .pk.bad { border-color: #c0392b; color: #c0392b; }
.picked small { flex-basis: 100%; }
/* courses and the domain box (v36) */
.dom-ed { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; }
table.dns td { font-size: 13px; word-break: break-all; }
.acard.course small.empty { display: block; }
/* the student's calendar and the plan editor (v42) */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head b { font-family: var(--f-head); font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; direction: rtl; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-day { min-height: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-day.out { opacity: .45; background: transparent; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-day > span { font-size: 12px; color: var(--muted); }
.cal-ev { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; background: var(--accent-soft); color: var(--ink); border-radius: 7px; padding: 3px 5px; font-size: 11px; line-height: 1.35; border-inline-start: 3px solid var(--accent); }
.cal-ev:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-ev b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-weight: 600; overflow: hidden; word-break: break-word; }
.cal-ev.live { background: var(--glow-soft); border-color: var(--glow); }
.cal-ev.cancelled { opacity: .55; text-decoration: line-through; border-color: var(--lv1); }
.cal-ev.past { opacity: .8; }
.cal-sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.cal-sheet { background: var(--surface); width: min(520px, 100%); border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; max-height: 85vh; overflow: auto; }
.cal-sheet h2 { margin: 0; }
.cal-acts { display: grid; gap: 8px; }
.cal-acts .btn { width: 100%; padding: 12px; font-size: 15px; }
.cal-acts .btn[disabled] { opacity: .55; }
.cal-acts small { color: var(--muted); }
@media (max-width: 480px) { .cal-day { min-height: 78px; padding: 3px; } .cal-ev { font-size: 10px; padding: 2px 3px; } }
.pl-row { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.pl-row select[multiple] { min-height: 110px; }
.cal-agenda { display: grid; gap: 6px; }
.cal-ag { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cal-ag:focus-visible { outline: 2px solid var(--accent); }
.cal-ag.cancelled { opacity: .55; text-decoration: line-through; }
.cal-ag b { flex: 1; font-weight: 600; }
.cal-ag small { color: var(--muted); }


/* ================= identity «عنصر واحد» ================= */
.mono, .stat b, .result .score { font-family: var(--f-num); }
h1 { font-size: 26px; font-weight: 800; } h2 { font-weight: 700; }
.btn { border-radius: 12px; padding: 9px 16px; min-height: 40px; font-family: var(--f-head); font-weight: 600; }
.btn.small { border-radius: 10px; padding: 5px 12px; min-height: 32px; }
.btn.big { min-height: 54px; font-size: 17px; width: 100%; border-radius: 16px; }
.btn.wide { width: 100%; }
.card, .tile, .lesson, .quiz, .concept, .rec-item { border-radius: var(--r); }
select.inp, input.inp { border-radius: 10px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.pnum { background: var(--sand); color: var(--ink); font-family: var(--f-num); }

/* logo: an element box «88 · Ra» */
.logo { font-weight: 800; }
.logo .ra { width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 7px; background: var(--surface); display: flex; flex-direction: column;
  justify-content: space-between; padding: 2px 4px; flex: none; direction: ltr; line-height: 1; }
.logo .ra small { font: 600 8px/1 var(--f-num); color: var(--ink); }
.logo .ra b { font: 800 14px/1 var(--f-head); color: var(--accent); text-align: left; }
.logo i { display: none; }

/* tabs: a dark pill on wide screens, a bar at the bottom on phones */
.tabs { background: var(--ink); border: 0; border-radius: 14px; padding: 4px; }
.tab { color: color-mix(in srgb, var(--bg) 70%, transparent); border-radius: 10px; padding: 7px 14px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.tab[aria-selected="true"] { background: var(--bg); color: var(--ink); }
.tab-i { display: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.tab-i[data-i="today"], .tab-i[data-i="home"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cellipse cx='12' cy='12' rx='10' ry='4.5' transform='rotate(-25 12 12)'/%3E%3C/svg%3E"); }
.tab-i[data-i="lessons"], .tab-i[data-i="class"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='7.5' height='7.5' rx='1.5'/%3E%3Crect x='13.5' y='3' width='7.5' height='7.5' rx='1.5'/%3E%3Crect x='3' y='13.5' width='7.5' height='7.5' rx='1.5'/%3E%3Crect x='13.5' y='13.5' width='7.5' height='7.5' rx='1.5'/%3E%3C/svg%3E"); }
.tab-i[data-i="work"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E"); }
.tab-i[data-i="tutor"], .tab-i[data-i="questions"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z'/%3E%3C/svg%3E"); }
.tab-i[data-i="more"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E"); }
@media (max-width: 640px) {
  body.has-tabs { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .tabs { position: fixed; inset-inline: 10px; width: auto; max-width: none; overflow: visible; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 20; display: grid !important;
    grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-radius: 20px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
  .tabs[hidden] { display: none !important; }
  .tab { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; border-radius: 14px; min-height: 52px; justify-content: center; }
  .tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tab-i { display: block; }
  .hform { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}

/* the section tiles («المزيد»): a small element box with a number instead of an emoji */
.tile { gap: 6px; border-color: var(--line); }
.tile:hover { border-color: var(--ink); }
.tile-el { width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 7px; display: flex; padding: 2px 4px; background: var(--accent-soft); }
.tile-el small { font: 600 10px/1 var(--f-num); color: var(--ink); }
.tiles.make .tile-el { background: var(--accent); } .tiles.make .tile-el small { color: var(--accent-ink); }

/* student «النهارده»: the next step as one big element box, its orbit fills with electrons */
.today .focus { background: var(--surface); border: 2.5px solid var(--ink); border-radius: 22px; padding: 16px 18px 18px; display: grid; gap: 6px; }
.focus-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.focus .tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.focus .tag.weak { background: var(--glow-soft); color: color-mix(in srgb, var(--glow) 80%, var(--ink)); }
.focus .tag.due { background: var(--sand); color: var(--ink); }
.orbit { position: relative; height: 196px; display: grid; place-items: center; }
.orbit svg { position: absolute; inset: 0; margin: auto; width: 250px; height: 196px; }
.orbit ellipse { fill: none; stroke: var(--line); stroke-width: 1.5; }
.orbit circle { fill: var(--surface); stroke: color-mix(in srgb, var(--line) 60%, var(--muted)); stroke-width: 2; }
.orbit circle.on { fill: var(--accent); stroke: var(--accent); }
.orbit h2 { position: relative; font-size: 28px; font-weight: 800; text-align: center; max-width: 230px; line-height: 1.35; }
.focus-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.focus .btn.big { margin-top: 8px; }
.focus-empty h2 { font-size: 22px; } .focus-empty p { color: var(--muted); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.strip { display: flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: var(--ink); width: 100%; }
.strip i { flex: 1; height: 22px; max-width: 34px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--surface); }
.strip i[data-l="1"] { background: var(--lv1); } .strip i[data-l="2"] { background: var(--lv2); } .strip i[data-l="3"] { background: var(--lv3); }
.strip span { margin-inline-start: auto; font-size: 13px; font-weight: 600; white-space: nowrap; padding-inline-start: 8px; }
.after { display: grid; gap: 10px; } .after h2 { font-size: 16px; }
.plan-time { background: var(--sand); border-radius: 18px; padding: 16px; display: grid; gap: 12px; }
.pt-head { display: grid; gap: 2px; } .pt-head b { font-family: var(--f-head); font-size: 16px; } .pt-head small { color: var(--muted); font-size: 13px; }
.pt-seg { background: var(--surface); }
.pt-seg button { min-height: 40px; }
.plan-time .btn.ghost { background: var(--surface); }
.toolbar.quiet { justify-content: center; }

/* teacher «النهارده»: the one thing that matters now, and the week's groups */
.home-top { display: flex; flex-wrap: wrap; gap: 14px; }
.hfocus { flex: 3 1 360px; min-width: 0; display: flex; flex-wrap: wrap; border: 2.5px solid var(--ink); border-radius: 22px; background: var(--surface); overflow: hidden; }
.hfocus:empty, .hgroups:empty { display: none; }
.hf-el { flex: 0 0 150px; background: var(--accent); color: var(--accent-ink); padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; min-height: 150px;
  border-inline-end: 2.5px solid var(--ink); }
.hf-el small { font-size: 13px; opacity: .9; } .hf-el b { font: 800 44px/1 var(--f-head); direction: ltr; text-align: right; }
.hf-body { flex: 1 1 200px; padding: 18px 20px; display: grid; gap: 8px; align-content: center; }
.hf-body h2 { font-size: 21px; } .hf-body p { color: var(--muted); font-size: 14px; } .hf-body .btn { justify-self: start; }
.hgroups { flex: 2 1 280px; min-width: 0; background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.hgroups h2 { font-size: 16px; } .hgroups .btn { justify-self: start; }
.glist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.glist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--bg); }
.glist li.next { background: var(--accent); color: var(--accent-ink); }
.glist li.next small, .glist li.next .gday .mono { color: inherit; opacity: .85; }
.glist li.next .pill { background: var(--surface); color: var(--accent); border-color: transparent; }
.gday { width: 70px; flex: none; display: grid; text-align: center; font-size: 13px; }
.gday b { font-family: var(--f-head); font-size: 14px; }
.gname { flex: 1; min-width: 0; display: grid; } .gname small { color: var(--muted); font-size: 12px; }
.hb.me { background: var(--ink); color: var(--bg); }

/* inside the Android app (RadiationApp): the app has its own back button and pull to refresh */
html.in-app .foot { display: none; }

/* paper exam at home (0052): the student's page and the teacher's watch page */
.pe-bar { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.pe-bar #peTime { font-size: 18px; }
.pe-cam { position: fixed; bottom: 12px; left: 12px; width: 96px; height: 72px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); z-index: 30; background: #000; transform: scaleX(-1); }
body.exam-lock .pe-paper { user-select: none; -webkit-user-select: none; }
.pe-paper .paper { margin-inline: auto; }
.pw-strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; }
.pw-strip a { flex: none; display: grid; gap: 2px; text-align: center; color: var(--muted); font-size: 11px; text-decoration: none; }
.pw-strip img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- the student's main page (shome.js) ---------- */
.tab-i[data-i="shome"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.sh-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sh-tile { display: grid; gap: 4px; justify-items: start; text-align: start; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card, var(--bg)); color: inherit; cursor: pointer; font: inherit; min-height: 132px; }
.sh-tile:hover, .sh-tile:focus-visible { border-color: var(--lv3); }
.sh-tile .sh-i { font-size: 30px; line-height: 1; }
.sh-tile b { font-size: 18px; }
.sh-tile small { color: var(--muted); }
.sh-badge { margin-top: auto; font-size: 13px; color: var(--muted); }
.sh-badge.hot { color: var(--lv1); font-weight: 600; }
.sh-tile:last-child { border-color: var(--lv2); }
@media (max-width: 520px) { .sh-tiles { grid-template-columns: 1fr 1fr; } .sh-tile { min-height: 118px; padding: 14px; } .sh-tile:last-child { grid-column: 1 / -1; } .sh-tile b { font-size: 16px; } }

/* ---------- weak points / remedial plan, printable ---------- */
.wk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.wk-head h1 { margin: 0; }
.wk-brand { font-weight: 700; color: var(--muted); }
.wk-box { width: 28px; text-align: center; font-size: 18px; }
.wk-days li { margin: 6px 0; }
.wk-note { break-inside: avoid; border-inline-start: 3px solid var(--lv2); padding: 2px 10px; margin: 10px 0; }
.wk-note h3 { margin: 0 0 4px; font-size: 15px; }
.wk-note p { margin: 0; white-space: pre-wrap; }
.wk-sign { margin-top: 28px; }
@media print {
  body * { visibility: hidden; }
  .weak-print, .weak-print * { visibility: visible; }
  .weak-print { position: absolute; inset: 0; padding: 12mm; color: #000; background: #fff; }
  .weak-print .no-print { display: none !important; }
  .weak-print table { font-size: 11pt; }
  .weak-print tr { break-inside: avoid; }
  @page { size: A4; margin: 10mm; }
}
/* ---------- a whole booklet (bookjob.js) ---------- */
.bj-form .bj-outs { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: grid; gap: 6px; }
.bj-form .bj-outs label { display: flex; gap: 8px; align-items: center; }
.bj-form .bj-n .inp { width: 72px; }
.bj-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.bj-bar i { display: block; height: 100%; width: 0; background: var(--lv3); transition: width .3s; }
.bj-row { display: grid; gap: 4px; text-align: start; width: 100%; cursor: pointer; }
.bj-row small { color: var(--muted); }
.bj-u { display: grid; gap: 10px; margin: 12px 0; }
.bj-l { border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 6px; }
.bj-lh { display: flex; gap: 8px; align-items: center; }
.bj-lh .inp:not(.bj-pos) { flex: 1; min-width: 0; }
.bj-pos { width: 64px; flex: none; }
.bj-ol li { margin: 6px 0; }
.bj-ideas { display: block; color: var(--muted); }
.bj-sticky { position: sticky; bottom: 0; background: var(--bg, #fff); padding: 10px 0; border-top: 1px solid var(--line); }
.pill.warn { color: var(--lv2); border-color: var(--lv2); }
.warn-msg { color: var(--lv2); font-size: 13px; }
@media (max-width: 600px) { .bj-u .row2 { grid-template-columns: 1fr; } }

/* ---------- «ملازمي» (mybooklets.js) ---------- */
.bk-row { display: grid; gap: 4px; text-align: start; width: 100%; cursor: pointer; }
.bk-row small { color: var(--muted); }
.bk-lesson { display: grid; gap: 8px; }
.bk-lh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-ideas { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-idea { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.bk-idea small { color: var(--muted); }
.bk-idea.weak { border-color: var(--lv1); }
.bk-idea.mid { border-color: var(--lv2); }
.bk-one h3 { margin: 14px 0 6px; }
.pdf-pages.guarded { user-select: none; }
.wk-sheet-sum h2 { margin-top: 0; }
.sh-tiles .sh-tile:nth-last-child(2) { border-color: var(--lv2); }
.sh-tiles .sh-tile:last-child { border-color: var(--line); }
@media (max-width: 520px) { .sh-tiles .sh-tile:last-child { grid-column: auto; } }
/* ---------- written answers of an online exam (written.js) ---------- */
.wr-pend { display: grid; gap: 6px; border-color: var(--lv2); }
.wr-qs li { margin: 4px 0; }
.wr-pick { display: inline-block; cursor: pointer; }
.wr-thumbs, .wr-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.wr-th { position: relative; }
.wr-th img, .wr-photos img { width: 96px; height: 128px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.wr-th .x { position: absolute; top: 2px; inset-inline-end: 2px; }
.wr-st { border-top: 1px solid var(--line); padding: 8px 0; }
.wr-unsure { background: color-mix(in srgb, var(--lv2) 12%, transparent); }
.ns-card { border-color: var(--lv2); }
.lc-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
.lc-card { display: flex; gap: 10px; align-items: center; border: 1px dashed #999; border-radius: 8px; padding: 10px; break-inside: avoid; }
.lc-qr { width: 84px; flex: none; } .lc-qr svg { width: 84px; height: 84px; }
.lc-pw { font-size: 1.2em; letter-spacing: 1px; }
.wm-card summary { cursor: pointer; }
.qr-card { font-size: 17px; }
.qr-body { margin: 10px 0; font-size: 18px; }
.qr-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.qr-btns .btn small { opacity: .6; font-size: 11px; margin-inline-start: 4px; }
.qr-acts { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 520px) { .qr-btns { grid-template-columns: 1fr 1fr; } .qr-btns .btn:last-child { grid-column: 1 / -1; } }

/* ---------- «اشرحلي غلطي»: the board (0059) ---------- */
.bd-ask { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.bd-ask small { color: var(--muted); }
.board { --chalk: #1f3b36; --chalk-ink: #f2f5ef; --chalk-dim: #b9c9c2; margin-top: 14px; background: var(--chalk); color: var(--chalk-ink);
  border-radius: var(--r); padding: 14px 16px; border: 6px solid #6b4f36; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.bd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-family: var(--f-head); }
.board .btn.ghost { color: var(--chalk-ink); border-color: rgba(255,255,255,.35); background: transparent; }
.board .btn.ghost[aria-pressed="true"] { background: rgba(255,255,255,.15); }
.board .linkbtn { color: var(--chalk-dim); }
.bd-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bd-step { padding: 10px 12px; border-inline-start: 4px solid #8fd3c7; background: rgba(255,255,255,.05); border-radius: 8px; animation: bdIn .35s ease-out; }
.bd-step.k-mistake { border-color: #f0a37f; background: rgba(240,163,127,.12); }
.bd-step.k-answer { border-color: #f5d76e; }
.bd-step.k-rule { border-color: #9fc3ff; }
.bd-tag { font-size: 12px; font-weight: 700; color: var(--chalk-dim); letter-spacing: .02em; }
.k-mistake .bd-tag { color: #f0a37f; } .k-answer .bd-tag { color: #f5d76e; }
.bd-math { overflow-x: auto; overflow-y: hidden; font-size: 1.15em; padding: 2px 0; color: var(--chalk-ink); }
.bd-math .katex-display { margin: .35em 0; }
.bd-raw { font-family: var(--f-num); white-space: pre-wrap; word-break: break-word; display: block; padding: 4px 0; }
.bd-say { margin-top: 4px; line-height: 1.7; }
.bd-ctl, .bd-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.board .ok-msg { color: #bfe8c9; }
@keyframes bdIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bd-step { animation: none; } }
@media print { .bd-ask, .board { display: none; } }
/* «لوحة المتابعة» (0064) */
.dash .card { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.db-chart { width: 100%; height: auto; max-height: 180px; direction: ltr; }
.db-bar { fill: var(--accent); opacity: .55; } .db-bar.now { opacity: 1; }
.db-n { font-size: 10px; text-anchor: middle; fill: var(--ink, currentColor); font-family: var(--f-num); }
.db-d { font-size: 9px; text-anchor: middle; fill: var(--muted); font-family: var(--f-num); }
/* exam: numbers of the questions (0065) */
.qjump { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.qj { min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; font-family: var(--f-num); cursor: pointer; }
.qj.done { background: var(--accent-soft); border-color: var(--accent); }
.qj.cur { outline: 2px solid var(--accent); outline-offset: 1px; font-weight: 700; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.choice.picked { font-size: 16px; gap: 10px; margin-top: 0; flex-wrap: nowrap; }   /* not the small «.picked» list of the results page */
/* «راجع الفيديو» (0066) */
.vr { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.vr h3 { font-size: 16px; margin: 10px 0 2px; }
.vr-desc { white-space: pre-line; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
/* «امتحانات تلقائية» (0067) */
.ae { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.ae-item { flex-wrap: wrap; } .ae-edit { flex-basis: 100%; }
.ae-plan { display: flex; flex-direction: column; gap: 6px; } .ae-day summary small { color: var(--muted); margin-inline-start: 6px; }
.ae-tg { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; } .ae-tg small { color: var(--muted); flex-basis: 100%; }
.xd-qs { display: flex; flex-direction: column; gap: 10px; padding-inline-start: 22px; }
.xd-q { font-weight: 600; margin-bottom: 6px; } .xd-ch { margin: 0 0 6px; padding-inline-start: 18px; }
.xd-ch li.ok { color: var(--ok, #1b7a3a); font-weight: 600; }

/* ---------- daily goal and streak on the student's main page; students who cannot sign in (0068) ---------- */
.sh-streak { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 12px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.sh-streak.done { border-color: var(--accent); background: var(--accent-soft); }
.sh-streak .st-fire { font-size: 26px; line-height: 1; filter: grayscale(1); opacity: .55; }
.sh-streak.done .st-fire { filter: none; opacity: 1; }
.sh-streak .st-main { display: grid; flex: 1; min-width: 0; }
.sh-streak .st-main b { font-family: var(--f-head); font-size: 16px; }
.sh-streak .st-main small { color: var(--muted); }
.sh-streak .st-dots { display: flex; gap: 5px; direction: ltr; }
.sh-streak .st-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--lv0); }
.sh-streak .st-dots i.on { background: var(--accent); }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: confetti-fall 2.1s ease-in forwards; }
@keyframes confetti-fall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: .9; } }
.inc-card { border-color: var(--glow); }
.inc-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.inc-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inc-list li span { display: grid; min-width: 0; }
.inc-list small { color: var(--muted); }

/* ---------- «كشف الدرجات» (0069) ---------- */
.gb-tools { align-items: end; }
.gb-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.gb-table { border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 100%; }
.gb-table th, .gb-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gb-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; vertical-align: bottom; font-weight: 600; }
.gb-table thead th span, .gb-table thead th small { display: block; }
.gb-table .gb-kind, .gb-table thead small { color: var(--muted); font-size: 12px; font-weight: 400; }
.gb-table .gb-title { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.gb-table .gb-name { position: sticky; inset-inline-start: 0; background: var(--surface); text-align: start; z-index: 1; font-weight: 600; min-width: 150px; max-width: 220px; white-space: normal; border-inline-end: 1px solid var(--line); }
.gb-table thead .gb-name { z-index: 3; }
.gb-table .gb-sum { font-weight: 700; border-inline-start: 1px solid var(--line); }
.gb-table .gb-miss { color: var(--muted); }
.gb-table td.g3 { background: color-mix(in srgb, var(--lv3) 22%, transparent); }
.gb-table td.g2 { background: color-mix(in srgb, var(--lv2) 16%, transparent); }
.gb-table td.g1 { background: color-mix(in srgb, #e2b33c 22%, transparent); }
.gb-table td.g0 { background: color-mix(in srgb, var(--lv1) 24%, transparent); }
.gb-table tfoot th, .gb-table tfoot td { border-bottom: 0; color: var(--muted); background: var(--surface); position: sticky; bottom: 0; }
@media print {
  body[data-gbprint] > *:not(#app), body[data-gbprint] .gb-tools, body[data-gbprint] .stats, body[data-gbprint] .gb + * { display: none !important; }
  body[data-gbprint] { background: #fff !important; }
  body[data-gbprint] #app { max-width: none !important; padding: 0 !important; }
  body[data-gbprint] .gb-wrap { overflow: visible; max-height: none; border: 0; }
  body[data-gbprint] .gb-table { font-size: 10pt; }
  body[data-gbprint] .gb-table th, body[data-gbprint] .gb-table td { position: static; padding: 4px 6px; }
}

/* ---------- «شهادات الطلاب» (0070) ---------- */
.rc-list { display: grid; gap: 18px; }
.rc { background: #fff; color: #17202a; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; max-width: 760px; margin-inline: auto; width: 100%; }
.rc-head { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 2px solid #155e63; }
.rc-head img { width: 54px; height: 54px; object-fit: contain; }
.rc-head div { display: grid; flex: 1; }
.rc-head b { font-family: var(--f-head); font-size: 20px; }
.rc-head span { color: #155e63; font-weight: 600; }
.rc-head small { color: #5b6770; text-align: end; }
.rc-who { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0; }
.rc-who div { display: grid; } .rc-who dt { color: #5b6770; font-size: 13px; } .rc-who dd { margin: 0; font-weight: 600; font-size: 16px; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rc-table th, .rc-table td { border: 1px solid #cfd6da; padding: 7px 9px; text-align: center; }
.rc-table thead th { background: #eef3f3; } .rc-table tbody th { text-align: start; }
.rc-total { margin: 12px 0 4px; font-size: 15px; } .rc-att, .rc-none { margin: 6px 0; color: #37434c; }
.rc-sign { display: flex; justify-content: space-between; gap: 16px; margin-top: 44px; }
.rc-sign span { flex: 1; border-top: 1px solid #8a959c; padding-top: 6px; text-align: center; color: #5b6770; font-size: 13px; }
@media (max-width: 560px) { .rc { padding: 16px 14px; } .rc-table { font-size: 12.5px; } .rc-table th, .rc-table td { padding: 5px 4px; } }
@media print {
  body[data-rcprint] > *:not(#app), body[data-rcprint] .rcv > *:not(.rc-list) { display: none !important; }
  body[data-rcprint] { background: #fff !important; }
  body[data-rcprint] #app { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  body[data-rcprint] .rc-list { display: block; }
  body[data-rcprint] .rc { border: 0; border-radius: 0; max-width: none; padding: 6mm 4mm; break-after: page; }
}

/* ---------- «متابعة المدرسين» (0071) ---------- */
.sv-card { margin-bottom: 12px; }
.sv-card.idle { border-color: var(--glow); }
.sv-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.sv-head b { font-family: var(--f-head); font-size: 17px; }
.sv-head small { color: var(--muted); }
.sv-flag { margin-inline-start: auto; color: var(--glow); font-weight: 600; font-size: 14px; }

/* ---------- big text and high contrast (the «Aa» menu in the header) ---------- */
.seeprefs { position: relative; }
.seeprefs summary { list-style: none; cursor: pointer; min-width: 40px; min-height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; font: 600 14px var(--f-en); color: var(--ink); background: var(--surface); }
.seeprefs summary::-webkit-details-marker { display: none; }
.seeprefs[open] summary { border-color: var(--accent); }
.seeprefs[open] { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seebox { display: flex; flex-wrap: wrap; gap: 6px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; font-size: 14px; }
  border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; min-width: 150px; box-shadow: 0 8px 24px rgba(0,0,0,.15); font-size: 14px; }
.seebox label { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; white-space: nowrap; }
html[data-text="big"] body { zoom: 1.18; }
:root[data-contrast="high"] { --muted: #3a352d; --line: #7d766b; }
:root[data-contrast="high"][data-theme="dark"] { --muted: #e2ddd3; --line: #9a9387; }
@media (prefers-color-scheme: dark) { :root[data-contrast="high"]:not([data-theme="light"]) { --muted: #e2ddd3; --line: #9a9387; } }
:root[data-contrast="high"] :focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* «مهمتك الجاية» on the student's home */
.sh-next { display: grid; gap: 6px; margin-block: 4px 14px; padding: 16px; border-radius: 16px; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.sh-next.soon { border-color: var(--glow); }
.sh-next-l { font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.sh-next.soon .sh-left { color: var(--glow); font-weight: 600; }
.sh-next b { font-family: var(--f-head); font-size: 19px; line-height: 1.4; }
.sh-next small { color: var(--muted); }
.sh-next-a { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sh-next-a .btn { flex: 1 1 180px; min-height: 48px; }
.sh-next .linkbtn { justify-self: start; }

/* the same answer from many students, graded once */
.ow-groups { display: grid; gap: 10px; margin-block: 12px 18px; }
.ow-groups h2 small { font-size: 13px; color: var(--muted); font-weight: 400; }
.ow-group { border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 12px; padding: 12px; background: var(--surface); display: grid; gap: 6px; }
.ow-g-ans { font-size: 17px; font-weight: 600; }
.ow-group small { color: var(--muted); }

/* «ليه أخدت الدرجة دي» on the student's answers (0079) */
.qrev details.why { margin-top: 8px; font-size: 14px; }
.qrev details.why summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.qrev details.why p { margin: 6px 0 0; color: var(--ink); }

/* «اللي المنصة عملته عنك» on the dashboard (0080) */
.impact { border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 14px; padding: 14px; margin-block: 8px 18px; background: var(--surface); }
.impact h2 { margin-bottom: 10px; }
.impact p { margin: 8px 0 0; }

/* 0083 the engine: why this question, the level so far */
.eng-head { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 6px 2px; }
.eng-why { background: var(--sand); }
.eng-level { font-weight: 600; }
.eng-level.lv-tried { border-color: var(--lv1); color: var(--lv1); }
.eng-level.lv-close { border-color: var(--lv2); }
.eng-level.lv-got, .eng-level.lv-master { border-color: var(--lv3); color: var(--lv3); }
.eng-done { margin-bottom: 10px; }

/* 0084 «ملفي» */
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pf-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 4px; vertical-align: -1px; }
.pf-subject { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; min-width: 0; }
.pf-subject h2 { font-size: 17px; margin-bottom: 8px; } .pf-subject h2 small { color: var(--muted); font-weight: 400; }
.pf-subject h3 { font-size: 14px; margin: 8px 0 4px; }
.pf-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--lv0); }
.pf-master { background: var(--lv3); } .pf-got { background: color-mix(in srgb, var(--lv3) 70%, var(--surface)); }
.pf-close { background: var(--lv2); } .pf-tried { background: var(--lv1); } .pf-none { background: var(--lv0); }
.pf-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pf-cols ul, .pf-exams { margin: 0; padding-inline-start: 18px; } .pf-cols li, .pf-exams li { overflow-wrap: anywhere; }
.pf-exams li { display: flex; justify-content: space-between; gap: 8px; }
.pf-note { font-size: 13px; }
