/* استديو المادة: one teacher's studio for one subject. Warm canvas with a faint dot grid (a studio desk), graphite for the
   tool, one electric lime for what the AI writes and for approval, four colours for the parts of a lesson, and one colour
   per chapter for its materials */
:root {
  --canvas: #f4f2ec;
  --surface: #ffffff;
  --ink: #17161d;
  --ink-2: #46434f;
  --muted: #6c6976;
  --line: #e4e0d6;
  --line-2: #d6d1c4;
  --graphite: #1d1c25;
  --lime: #c9f158;
  --lime-soft: #eef9cf;
  --lime-ink: #3d5a04;
  --ok: #1f7a44; --ok-bg: #e3f5e9;
  --bad: #b4233f; --bad-bg: #fde6eb;
  /* the four parts of a lesson */
  --intro: #ff8a4c; --intro-bg: #ffeadc; --intro-ink: #9a3c0c;
  --explain: #7c66f0; --explain-bg: #ece8ff; --explain-ink: #4734b5;
  --act: #2fae68; --act-bg: #ddf4e5; --act-ink: #1a6a3f;
  --assess: #ef4f78; --assess-bg: #ffe3ea; --assess-ink: #a1173f;
  --r: 18px;
  --head: 64px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow: 0 1px 2px rgba(23, 22, 29, .06), 0 10px 30px -14px rgba(23, 22, 29, .22);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head) + 12px); }
body {
  margin: 0; font-family: 'Mada', system-ui, sans-serif; font-size: 16px; line-height: 1.6; color: var(--ink);
  background-color: var(--canvas);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
  font-feature-settings: 'kern' 1;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
iconify-icon { display: inline-block; width: 1em; height: 1em; flex: none; }
.skip { position: absolute; right: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--explain); outline-offset: 2px; }
#main:focus { outline: none; }
html.js-anim [data-in] { visibility: hidden; }
html.at-lesson #home { display: none; }
[hidden] { display: none !important; }
/* each chapter has its colour: its lessons' thumbnails and materials use it */
.c0 { --cc: var(--explain); --cbg: var(--explain-bg); --cin: var(--explain-ink); }
.c1 { --cc: var(--act); --cbg: var(--act-bg); --cin: var(--act-ink); }
.c2 { --cc: var(--intro); --cbg: var(--intro-bg); --cin: var(--intro-ink); }

/* ── header ── */
.top { position: sticky; top: 0; z-index: 50; background: rgba(244, 242, 236, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; height: var(--head); padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand b { font-size: 19px; font-weight: 800; white-space: nowrap; }
.mark { width: 36px; height: 36px; flex: none; }
.hback { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.hback iconify-icon { font-size: 18px; }

/* ── status chips ── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; flex: none; line-height: 1; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip[data-s="live"] { background: var(--lime-soft); color: var(--lime-ink); }
.chip[data-s="draft"] { background: var(--intro-bg); color: var(--intro-ink); }
.chip[data-s="new"] { border: 1.5px dashed var(--line-2); color: var(--muted); }
.chip[data-s="new"]::before { display: none; }
.chip[data-s="writing"] { background: var(--lime); color: var(--ink); }
.chip[data-s="writing"]::before { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ── views ── */
.home, .lesson { max-width: 1240px; margin: 0 auto; padding: 20px 16px 48px; }

/* ── the subject ── */
.home { display: grid; gap: 28px; }
.hero { display: grid; gap: 18px; }
.hero-t { display: grid; gap: 4px; }
h1#h1 { font-size: clamp(52px, 16vw, 112px); line-height: 1.02; font-weight: 800; letter-spacing: 0; }
.hero-s { font-size: 17px; font-weight: 600; color: var(--ink-2); }
.prog { margin-top: 12px; }
.prog-t { font-size: 17px; color: var(--ink-2); }
.prog-t b { font-weight: 800; color: var(--ink); }
.next { position: relative; overflow: hidden; border-radius: 22px; padding: 20px; background: var(--graphite); color: #fff; display: grid; gap: 6px; box-shadow: 0 20px 40px -24px rgba(23, 22, 29, .6); }
.next-k { font-size: 14px; font-weight: 700; color: var(--lime); }
.next-t { font-size: clamp(23px, 6.6vw, 32px); font-weight: 800; line-height: 1.25; }
.next-m { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 15px; color: rgba(255, 255, 255, .78); }
.next .chip[data-s="new"], .lh .chip[data-s="new"] { border-color: rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .85); }
.next .gen { margin-top: 10px; position: relative; z-index: 1; }

.chapters { display: grid; gap: 26px; }
.ch-h { font-size: 20px; font-weight: 800; line-height: 1.35; margin-bottom: 10px; text-wrap: balance; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.row:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.row-th { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 13px; background: var(--cbg); }
.row-th svg { width: 40px; height: 40px; }
.row-th.empty { background: transparent; border: 2px dotted var(--line-2); color: var(--muted); }   /* not prepared yet: a dotted frame with a pen, so it reads as «to write», not as a missing picture */
.row-th.empty iconify-icon { font-size: 24px; }
.row-t { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.row-t small { font-size: 13px; font-weight: 600; color: var(--muted); }
.row-t b { font-size: 17px; font-weight: 700; }
.row-go { font-size: 18px; color: var(--muted); }

/* the main button: sized to its words and set at the start of the line, away from the corner of the course pill */
.gen { position: relative; overflow: hidden; justify-self: start; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 22px; border: 0; border-radius: 16px; background: var(--graphite); color: #fff; font-size: 17px; font-weight: 800; box-shadow: 0 12px 28px -14px rgba(23, 22, 29, .7); transition: background-color .2s; text-align: right; }
.gen iconify-icon { font-size: 22px; color: var(--lime); }
.gen:hover { background: #2b2a36; }
.gen-lime { background: var(--lime); color: var(--ink); box-shadow: none; }
.gen-lime:hover { background: #d6f774; }
.gen-lime iconify-icon { color: var(--ink); }
.gen[aria-busy="true"] { cursor: progress; }
.gen:disabled { opacity: 1; }
.gen-p { position: absolute; inset: auto 0 0 0; height: 4px; background: var(--lime); transform: scaleX(0); transform-origin: 100% 50%; }

/* ── one lesson ── */
.lesson { display: grid; gap: 16px; }
.lh { position: relative; overflow: hidden; border-radius: 22px; padding: 20px; background: var(--graphite); color: #fff; display: grid; gap: 8px; }
.lh-k { font-size: 14px; font-weight: 700; color: var(--lime); }
.lh-t { font-size: clamp(27px, 7.6vw, 46px); font-weight: 800; line-height: 1.2; }
.lh-o { font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .86); }
.lh-o b { font-weight: 800; color: #fff; }
.lh-m { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.lh-d { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .9); }
.pvb { position: relative; z-index: 1; justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; margin-top: 8px; padding: 0 16px; border-radius: 13px; border: 1.5px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); color: #fff; font-size: 15px; font-weight: 700; transition: background-color .2s; }
.pvb:hover { background: rgba(255, 255, 255, .14); }
.pvb iconify-icon { font-size: 20px; color: var(--lime); }
.prep { display: grid; }

.lbody { display: grid; gap: 24px; align-items: start; }
.lmain { display: grid; gap: 14px; min-width: 0; }
/* the lesson's three parts; they stick under the header and, while the AI writes, fill one after another */
.tabs { position: sticky; top: var(--head); z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 0; margin: -8px 0 0; background: rgba(244, 242, 236, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.tabs button { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 6px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 15px; font-weight: 800; color: var(--ink-2); transition: background-color .2s, color .2s, border-color .2s; }
.tabs button span { position: relative; }
.tabs button[aria-selected="true"] { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.tabs .f { position: absolute; inset: auto 0 0 0; height: 4px; background: var(--lime); transform: scaleX(0); transform-origin: 100% 50%; display: none; }
.tabs.writing .f { display: block; }
.tabs.off button { border-style: dashed; background: rgba(255, 255, 255, .5); color: var(--muted); cursor: default; }
.tabs.writing button { pointer-events: none; }
.panel { min-width: 0; }

/* plan */
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.stage { position: relative; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); padding: 16px 16px 18px; display: grid; align-content: start; gap: 10px; box-shadow: 0 1px 2px rgba(23, 22, 29, .04); }   /* the stage is named once, by its coloured chip */
.stage[data-k="intro"] { --c: var(--intro); --cb: var(--intro-bg); --ci: var(--intro-ink); }
.stage[data-k="explain"] { --c: var(--explain); --cb: var(--explain-bg); --ci: var(--explain-ink); }
.stage[data-k="act"] { --c: var(--act); --cb: var(--act-bg); --ci: var(--act-ink); }
.stage[data-k="assess"] { --c: var(--assess); --cb: var(--assess-bg); --ci: var(--assess-ink); }
.st-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.st-n { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--cb); color: var(--ci); font-size: 15px; font-weight: 800; }
.st-min { font-size: 14px; font-weight: 700; color: var(--muted); }
.st-b { position: relative; }
.st-p { font-size: 17px; line-height: 1.75; }
.st-need { margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--ci); }
/* the skeleton a card shows while its words are being written */
.sk { position: absolute; inset: 2px 0 auto 0; display: grid; gap: 10px; overflow: hidden; pointer-events: none; }
.sk i { display: block; height: 12px; border-radius: 6px; background: #efece4; }
.sk i:nth-child(2) { width: 88%; } .sk i:nth-child(3) { width: 62%; }
.sk .sheen { position: absolute; inset: 0; width: 60%; background: linear-gradient(90deg, transparent, rgba(201, 241, 88, .55), transparent); transform: translateX(120%); }

/* materials: drawn at print size, scaled into their frame */
.dzs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.dz { margin: 0; display: grid; gap: 4px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); cursor: zoom-in; transition: box-shadow .2s, border-color .2s; }
.dz:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.dz--slide { grid-column: 1 / -1; }
.dz-f { position: relative; overflow: hidden; border-radius: 10px; width: 100%; background: #fff; box-shadow: 0 0 0 1px rgba(23, 22, 29, .06); }
.dz figcaption { display: flex; }
.dz-open { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 40px; padding: 0 4px; border: 0; background: none; font-size: 15px; font-weight: 700; text-align: right; }
.dz-open iconify-icon { font-size: 18px; color: var(--muted); }
.dz-in { position: absolute; top: 0; right: 0; transform-origin: 100% 0; transform: scale(var(--k, .3)); font-family: 'Mada', system-ui, sans-serif; line-height: 1.4; }
.dz-in svg { display: block; width: 100%; height: 100%; }
/* the slide */
.dz-in.dz-slide { width: 960px; height: 540px; display: flex; align-items: center; gap: 48px; padding: 60px 72px; background: var(--graphite); color: #fff; }
.sl-text { flex: 1; display: grid; gap: 18px; }
.sl-k { font-size: 28px; font-weight: 700; color: var(--lime); }
.sl-t { font-size: 76px; font-weight: 800; line-height: 1.15; }
.sl-n { font-size: 26px; color: rgba(255, 255, 255, .7); }
.sl-art { width: 300px; height: 300px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--cbg); }
.sl-art svg { width: 220px; height: 220px; }
/* the worksheet */
.dz-in.dz-sheet { width: 620px; height: 877px; display: flex; flex-direction: column; gap: 22px; padding: 46px 46px; background: #fff; color: var(--ink); border-top: 14px solid var(--cc); }
.ws-top { display: flex; align-items: center; justify-content: space-between; }
.ws-b { padding: 6px 16px; border-radius: 999px; background: var(--graphite); color: var(--lime); font-size: 20px; font-weight: 800; }
.ws-s { font-size: 19px; font-weight: 600; color: var(--muted); }
.ws-t { font-size: 40px; font-weight: 800; line-height: 1.2; }
.ws-name { display: flex; align-items: flex-end; gap: 12px; font-size: 20px; font-weight: 700; color: var(--muted); }
.ws-name i { flex: 1; border-bottom: 2px dashed var(--line-2); height: 1.2em; }
.ws-qs { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.ws-qs p { display: flex; gap: 12px; font-size: 22px; font-weight: 700; line-height: 1.45; }
.ws-qs p b { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--cbg); color: var(--cin); font-size: 20px; }
.ws-ops { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 10px 48px 0 0; }
.ws-ops span { display: flex; align-items: center; gap: 10px; font-size: 19px; color: var(--ink-2); }
.ws-ops i { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); }
.ws-art { position: absolute; left: 40px; bottom: 36px; width: 120px; height: 120px; opacity: .9; }
/* the card */
.dz-in.dz-card { width: 640px; height: 640px; display: flex; flex-direction: column; justify-content: space-between; padding: 56px; background: var(--cbg); color: var(--ink); }
.cd-art { width: 200px; height: 200px; }
.cd-t { font-size: 48px; font-weight: 800; line-height: 1.3; }
.cd-k { font-size: 24px; font-weight: 700; color: var(--cin); }

/* questions */
.count { justify-self: start; width: fit-content; font-size: 14px; font-weight: 800; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; transition: background-color .3s; }
.count.all { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.qlist { display: grid; gap: 14px; }
.qlist.busy { pointer-events: none; }
.q { border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); padding: 16px; display: grid; gap: 12px; transition: border-color .3s, box-shadow .3s; }
.q.ok:not(.live) { border-color: #bfe07a; box-shadow: 0 0 0 3px rgba(201, 241, 88, .28); }
.q-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-n { font-size: 15px; font-weight: 800; color: var(--muted); }
.q-tag { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--intro-bg); color: var(--intro-ink); }
.q.ok .q-tag { background: var(--lime-soft); color: var(--lime-ink); }
.q-stem { font-size: 19px; font-weight: 700; line-height: 1.55; margin-bottom: 4px; }
.q-ops { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.q-op { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; border-radius: 12px; background: #f7f5f0; font-size: 16px; font-weight: 600; }
.q-op .l { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 800; color: var(--muted); }
.q-op.right { background: var(--ok-bg); color: #145a31; }
.q-op.right .l { background: var(--ok); border-color: var(--ok); color: #fff; }
.q-why-b { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: 8px; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 700; color: var(--explain-ink); }
.q-why-b iconify-icon { transition: transform .3s var(--ease); }
.q-why-b[aria-expanded="true"] iconify-icon { transform: rotate(180deg); }
.q-why { overflow: hidden; height: 0; }
.q-why ul { list-style: none; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--explain-bg); display: grid; gap: 8px; }
.q-why li { font-size: 15px; line-height: 1.55; color: #2c2370; }
.q-why li b { font-weight: 800; }
.q-acts { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.q-acts button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 15px; font-weight: 700; margin-top: 12px; transition: background-color .2s, border-color .2s, color .2s; }
.q-acts button iconify-icon { font-size: 18px; }
.q-acts [data-act="ok"], .q-acts [data-act="save"] { background: var(--graphite); border-color: var(--graphite); color: #fff; padding: 0 18px; }
.q.ok .q-acts [data-act="ok"] { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.q-acts button:disabled { opacity: .45; cursor: default; }
.q-edit { display: grid; gap: 10px; }
.q-edit label { font-size: 14px; font-weight: 700; color: var(--muted); }
.q-edit textarea, .q-edit input[type="text"] { width: 100%; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 16px; line-height: 1.5; }
.q-edit textarea { min-height: 84px; resize: vertical; font-weight: 700; }
.q-edit textarea:focus, .q-edit input[type="text"]:focus { outline: none; border-color: var(--graphite); box-shadow: 0 0 0 3px rgba(124, 102, 240, .25); }
.q-eo { display: flex; align-items: center; gap: 10px; }
.q-eo input[type="radio"] { width: 22px; height: 22px; flex: none; accent-color: var(--ok); margin: 0; }
.q-eh { font-size: 13px; color: var(--muted); }

/* publishing */
.share { display: grid; }
.sh-card { border-radius: 22px; background: var(--surface); border: 1.5px dashed var(--line-2); padding: 18px; display: grid; gap: 14px; transition: border-color .3s; }
.sh-card.open { border-style: solid; border-color: var(--line); box-shadow: var(--shadow); }
.sh-h { font-size: 19px; font-weight: 800; }
.sh-lock { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--muted); }
.sh-lock iconify-icon { font-size: 20px; }
.pub { justify-self: start; min-height: 56px; padding: 0 30px; border: 0; border-radius: 16px; background: var(--lime); color: var(--ink); font-size: 18px; font-weight: 800; transition: background-color .25s, color .25s; }
.pub:disabled { background: #e8e5dd; color: #77737f; cursor: not-allowed; }
/* on phones the code stands in the middle of the card, the link under it */
.sh-out { display: grid; gap: 16px; justify-items: center; }
.qr { width: 196px; height: 196px; padding: 12px; border-radius: 18px; background: #fff; border: 1.5px solid var(--line); }
.qr svg { display: block; width: 100%; height: 100%; }
.sh-side { display: grid; gap: 12px; width: 100%; }
.sh-note { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.pill { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px; background: var(--graphite); min-width: 0; }
.pill-a { flex: 1; min-width: 0; padding: 0 12px; color: #fff; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 14px; white-space: nowrap; overflow: hidden; text-decoration: none; line-height: 44px; }
.pill-c { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: 15px; font-weight: 800; white-space: nowrap; }
.pill-c iconify-icon { font-size: 18px; }

/* ── the sheets: the student's preview and one material at full size ── */
.dlg { border: 0; padding: 0; margin: auto; background: transparent; color: var(--ink); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: visible; }
.dlg[open] { display: grid; gap: 12px; justify-items: center; }
.dlg::backdrop { background: rgba(23, 22, 29, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; color: #fff; }
.dlg-h h2 { font-size: 18px; font-weight: 800; line-height: 1.35; }
.dlg-x { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: 26px; }
.dlg-pv .phone { height: min(610px, calc(100dvh - 100px)); width: auto; aspect-ratio: 300 / 610; }
.dlg-pv .dlg-h { width: min(340px, 100%); }
.dlg-dz { width: min(1000px, calc(100vw - 24px)); }
.dz-big { width: 100%; display: grid; justify-items: center; }
.dz-big .dz-f { border-radius: 12px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }

.phone { position: relative; border-radius: 46px; background: #121118; padding: 11px; box-shadow: 0 0 0 1.5px #3a3946 inset, 0 30px 60px -28px rgba(0, 0, 0, .55); }
.island { position: absolute; top: 20px; left: 50%; width: 84px; height: 24px; margin-left: -42px; border-radius: 14px; background: #000; z-index: 3; }
.screen { position: relative; height: 100%; border-radius: 36px; overflow: hidden; background: #fbfaf7; }

/* the student app, in the preview and full screen from the shared link */
.stu { height: 100%; display: flex; flex-direction: column; padding: 52px 16px 16px; gap: 12px; font-size: 15px; overflow-y: auto; }
.stu-full { height: auto; min-height: calc(100svh - 64px); max-width: 520px; margin: 0 auto; padding: 20px 16px 110px; overflow: visible; }
.stu-head { display: grid; gap: 2px; }
.stu-sub { font-size: 13px; font-weight: 700; color: var(--muted); }
.stu-title { font-size: 19px; font-weight: 800; line-height: 1.3; }
.stu-full .stu-title { font-size: 26px; }
.stu-obj { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin-top: 4px; }
.stu-q { flex: 1; display: grid; align-content: start; gap: 10px; }
.stu-full .stu-q { flex: none; }
.stu-qn { font-size: 13px; font-weight: 800; color: var(--assess-ink); }
.stu-stem { font-size: 17px; font-weight: 700; line-height: 1.5; }
.stu-full .stu-stem { font-size: 21px; }
.stu-ops { display: grid; gap: 8px; }
.stu-op { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid #e4e0d6; background: #fff; font-size: 15px; font-weight: 600; text-align: right; transition: background-color .2s, border-color .2s, color .2s; }
.stu-full .stu-op { min-height: 54px; font-size: 17px; }
.stu-op.r { background: var(--ok-bg); border-color: var(--ok); color: #145a31; }
.stu-op.w { background: var(--bad-bg); border-color: var(--bad); color: #8a1630; }
.stu-op:disabled { cursor: default; }
.stu-fb { min-height: 24px; font-size: 15px; font-weight: 700; }
.stu-fb.r { color: var(--ok); } .stu-fb.w { color: var(--bad); }
.stu-next { min-height: 46px; flex: none; border: 0; border-radius: 14px; background: var(--graphite); color: #fff; font-size: 16px; font-weight: 800; }
.stu-full .stu-next { align-self: stretch; padding: 0 28px; min-height: 50px; }
.stu-next:disabled { background: #d9d5cb; color: #6c6976; }
.stu-done { flex: 1; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; }
.stu-score { display: grid; place-items: center; width: 108px; height: 108px; border-radius: 50%; background: var(--lime); font-size: 32px; font-weight: 800; line-height: 1; }
.stu-score small { display: block; font-size: 13px; font-weight: 700; margin-top: 4px; }
.stu-done p { font-size: 15px; color: var(--ink-2); }
.stu-again { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; font-size: 15px; font-weight: 700; }

/* ── course invitation and footer ── */
.join { max-width: 1240px; margin: 0 auto; padding: 8px 16px 0; }
.join-in { position: relative; overflow: hidden; border-radius: 26px; background: var(--graphite); color: #fff; padding: 28px 20px 26px; display: grid; gap: 10px; }
.join h2 { font-size: clamp(26px, 7vw, 40px); font-weight: 800; line-height: 1.25; }
.join-c { font-size: 18px; font-weight: 600; color: var(--lime); line-height: 1.5; }
.join ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.join li { display: flex; align-items: center; gap: 10px; font-size: 16px; color: rgba(255, 255, 255, .9); }
.join li iconify-icon { font-size: 20px; color: var(--lime); }
.join-b { justify-self: start; display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; min-height: 54px; padding: 0 24px; border-radius: 16px; background: var(--lime); color: var(--ink); font-size: 18px; font-weight: 800; text-decoration: none; }
.join-b iconify-icon { font-size: 20px; }
.foot { max-width: 1240px; margin: 0 auto; padding: 24px 16px 96px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; font-size: 15px; color: var(--muted); }
.foot a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 16px; font-weight: 800; color: var(--ink); text-decoration: none; }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; padding: 10px 18px; border-radius: 999px; background: var(--graphite); color: #fff; font-size: 15px; font-weight: 700; opacity: 0; visibility: hidden; pointer-events: none; white-space: nowrap; }

/* ── the shared link: only the student's view ── */
html.student body > :not(.stu-page):not(.toast):not(script):not(.course-cta) { display: none !important; }
html.student .stu-page { display: block !important; }
.stu-top { position: sticky; top: 0; z-index: 5; height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: rgba(244, 242, 236, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.stu-top .mark { width: 32px; height: 32px; }
.stu-top b { font-size: 18px; font-weight: 800; }
.stu-top a { margin-inline-start: auto; font-size: 15px; font-weight: 700; color: var(--explain-ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

/* ── wider screens ── */
@media (min-width: 640px) {
  .sh-out { grid-template-columns: auto 1fr; align-items: center; justify-items: stretch; }
  .join-in { padding: 40px 40px 36px; }
  .chapters { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  :root { --head: 72px; }
  .top-in, .home, .lesson { padding-left: 24px; padding-right: 24px; }
  .home { padding-top: 56px; gap: 48px; }
  .hero { grid-template-columns: minmax(0, 1fr) 460px; align-items: end; gap: 56px; }
  .hero-s { font-size: 20px; }
  .prog-t { font-size: 19px; }
  .next { padding: 28px; }
  .chapters { grid-template-columns: repeat(3, 1fr); gap: 28px; align-items: start; }
  .ch-h { font-size: 22px; }
  .lesson { padding-top: 32px; gap: 20px; }
  .lh { padding: 28px 32px; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; }
  .lh > * { grid-column: 1; }
  .lh .pvb { grid-column: 2; grid-row: 1 / span 4; align-self: center; margin-top: 0; }
  .lh-o { font-size: 18px; }
  .lbody { grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; }
  .share { position: sticky; top: calc(var(--head) + 16px); }
  .stages { grid-template-columns: 1fr 1fr; }
  .stage { padding: 20px 22px 22px; }
  .st-p { font-size: 18px; }
  .q { padding: 20px 22px; }
  .q-stem { font-size: 21px; }
  .q-op { font-size: 17px; }
  .q-ops { grid-template-columns: 1fr 1fr; }
  .tabs button { min-height: 52px; font-size: 16px; }
  .dzs { grid-template-columns: 1.15fr 1fr; gap: 16px; }
  .sh-out { grid-template-columns: 1fr; justify-items: start; }
  .foot { padding: 28px 24px 40px; }
  .join { padding: 8px 24px 0; }
  .join li { font-size: 18px; }
  .stu-full { max-width: 640px; padding-top: 40px; }
  .stu-full .stu-title { font-size: 32px; }
  .stu-full .stu-obj { font-size: 18px; }
  .stu-full .stu-stem { font-size: 24px; }
  .stu-full .stu-op { font-size: 19px; min-height: 58px; }
  .stu-full .stu-fb { font-size: 17px; }
}
@media (max-width: 599px) {
  /* the corner the floating course pill shrinks into stays free of these buttons */
  .q-acts { padding-left: 104px; }
  .q-acts [data-act="edit"] iconify-icon, .q-acts [data-act="alt"] iconify-icon { display: none; }
}
@media (max-width: 400px) {
  .stu { padding-left: 12px; padding-right: 12px; }
  .stu-full { padding-top: 14px; gap: 10px; }
  .stu-full .stu-title { font-size: 22px; }
  .stu-full .stu-stem { font-size: 19px; }
  .stu-full .stu-op { min-height: 48px; font-size: 16px; }
  .stu-full .stu-ops { gap: 6px; }
}
@media (max-width: 359px) {
  .home { gap: 22px; }
  .row { gap: 10px; padding: 9px 10px; }
  .row-th { width: 44px; height: 44px; }
  .row-th svg { width: 34px; height: 34px; }
  .row-go { display: none; }
  .row-t b { font-size: 16px; }
  .gen { padding: 0 16px; font-size: 16px; }
  /* the whole label on one line */
  .next { padding: 18px 16px; }
  .next .gen { width: 100%; padding: 0 12px; }
  .next .gen iconify-icon { display: none; }
  .tabs button { font-size: 14px; }
  .q-acts button { padding: 0 12px; font-size: 14px; }
  .pill-c span { display: none; }
  .pill-c { padding: 0 13px; }
  .pill-c::after { content: 'انسخ'; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* the three question actions stay on one row on phones */
@media (max-width: 480px) { .q-acts { display: flex; flex-wrap: wrap; padding-left: 0; gap: 6px; } .q-acts button { padding: 0 10px; font-size: 14px; } .q-acts [data-act="ok"], .q-acts [data-act="save"] { padding: 0 12px; } }
