/* Mizan — styles
   Palette: parchment, ink indigo, antique brass, plus one colour per subject ("room").
   Type: Bodoni Moda (Latin display, large sizes only), IBM Plex Sans Arabic (all interface text, Arabic and Latin),
   Amiri (Arabic display). Amiri Quran is used only for Quranic text. */

:root {
    --parchment: #F5F0E6;
    --parchment-2: #FBF8F1;
    --sand: #E9E1D0;
    --line: #E4DCCB;
    --line-2: #D9CFBB;
    --ink: #1C2140;
    --ink-2: #4A4856;
    --muted: #6E6A74;
    --brass: #806535;
    --focus: #8C6F38;
    --brass-light: #E2C68C;
    --brass-soft: #CBB27C;
    --white: #FFFFFF;
    --ok: #2E6B52;
    --ok-bg: #E6F0EA;
    --bad: #9A3F22;
    --bad-bg: #F6E4DA;
    --warm: #B4593A;

    --room: var(--ink);
    --room-tint: #EEF1F8;
    --room-soft: #C9D3EC;

    --f-display: 'Bodoni Moda', 'Didot', 'Times New Roman', serif;
    --f-ui: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --f-ar: 'Amiri', 'Times New Roman', serif;
    --f-quran: 'Amiri Quran', 'Amiri', serif;

    --gutter: clamp(20px, 4vw, 48px);
    --max: 1280px;
    --radius: 0px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* One colour per subject */
[data-room="french"] { --room: #2F4A8A; --room-tint: #EEF1F8; --room-soft: #C9D3EC; }
[data-room="arabic"] { --room: #2E6B52; --room-tint: #E8F2EC; --room-soft: #CFE5DA; }
[data-room="islamic"] { --room: #24676E; --room-tint: #EAF3F3; --room-soft: #CDE6E8; }
[data-room="social_english"] { --room: #A65033; --room-tint: #F8EBE4; --room-soft: #F3D9CC; }
[data-room="social_arabic"] { --room: #8E4A3A; --room-tint: #F5E9E5; --room-soft: #EDD3CB; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--parchment);
    color: var(--ink);
    font-family: var(--f-ui);
    font-size: 17px;
    line-height: 1.6;
    font-variant-numeric: lining-nums;
    -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-size: 18px; line-height: 1.8; }
a { color: inherit; }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden], .hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.site-head :focus-visible, .hero :focus-visible, .room-hero :focus-visible, .cover:focus-visible, .player :focus-visible, .result-band :focus-visible, .lesson-tip :focus-visible, .skip-link:focus-visible { outline-color: #E2C68C; }

.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--parchment); padding: 10px 16px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.display { font-family: var(--f-display); font-weight: 400; letter-spacing: 0; line-height: 1.05; margin: 0; }
html[lang="ar"] .display { font-family: var(--f-ar); font-weight: 700; letter-spacing: 0; line-height: 1.35; }
.display em { font-style: italic; }
html[lang="ar"] .display em { font-style: normal; color: var(--brass); }
.ar-display { font-family: var(--f-ar); font-weight: 700; }
.en-display { font-family: var(--f-display); font-weight: 400; }
.kicker { margin: 0; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--brass); font-weight: 500; }
html[lang="ar"] .kicker { letter-spacing: 0; text-transform: none; font-size: 15px; }
.lede { color: var(--ink-2); max-width: 580px; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 48px; padding: 12px 26px;
    background: var(--ink); color: var(--parchment);
    border: 1px solid var(--ink); border-radius: var(--radius);
    font-family: var(--f-ui); font-size: 16px; font-weight: 500; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover { background: #2A3058; border-color: #2A3058; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: rgba(28, 33, 64, .06); }
.btn.light { background: var(--parchment); color: var(--ink); border-color: var(--parchment); }
.btn.light:hover { background: #FFFFFF; }
.btn.on-dark { background: transparent; color: var(--parchment); border-color: rgba(245, 240, 230, .5); }
.btn.on-dark:hover { background: rgba(245, 240, 230, .08); }
.btn.room { background: var(--room); border-color: var(--room); color: #FFFFFF; }
.btn.room:hover { filter: brightness(1.08); }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Site header ---------- */
.site-head { background: var(--ink); color: var(--parchment); position: relative; z-index: 5; }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand-ar { font-family: var(--f-ar); font-size: 30px; font-weight: 700; line-height: 1; }
.brand-en { font-family: var(--f-display); font-size: 16px; letter-spacing: 4px; color: var(--brass-soft); }
.nav { display: flex; flex-wrap: wrap; gap: 30px; font-size: 15px; }
.nav a { text-decoration: none; padding-block: 6px; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--brass-light); }
.head-tools { display: flex; align-items: center; gap: 16px; }
.lang-btn { background: none; border: 1px solid rgba(245, 240, 230, .45); color: var(--parchment); min-height: 40px; padding: 6px 16px; cursor: pointer; font-size: 15px; }
.lang-btn:hover { background: rgba(245, 240, 230, .08); }
.lang-btn .ar { font-family: var(--f-ar); font-size: 19px; line-height: 1; }

/* ---------- Hero (light through the lattice) ---------- */
.hero { position: relative; background: var(--ink); color: var(--parchment); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink) 0%, rgba(28, 33, 64, .93) 36%, rgba(28, 33, 64, .2) 72%, rgba(28, 33, 64, 0) 100%); }
[dir="rtl"] .hero-fade { background: linear-gradient(270deg, var(--ink) 0%, rgba(28, 33, 64, .93) 36%, rgba(28, 33, 64, .2) 72%, rgba(28, 33, 64, 0) 100%); }
.hero-scale { position: absolute; inset-inline-end: 9%; top: 50%; width: 340px; height: 340px; margin-top: -170px; }
.hero-inner { position: relative; padding-block: clamp(80px, 11vw, 130px); }
.hero h1 { font-size: clamp(50px, 6.4vw, 92px); max-width: 780px; color: var(--parchment); }
.hero h1 em { color: var(--brass-light); }
html[lang="ar"] .hero h1 { font-size: clamp(56px, 7.2vw, 104px); }
html[lang="ar"] .hero h1 em { color: var(--brass-light); }
.hero-second { margin: 22px 0 0; color: var(--brass-light); line-height: 1.3; }
.hero-second.ar { font-family: var(--f-ar); font-weight: 700; font-size: clamp(32px, 3.6vw, 52px); }
.hero-second.en { font-family: var(--f-display); font-style: italic; font-size: clamp(24px, 2.4vw, 34px); }
.hero-lede { margin: 28px 0 0; max-width: 520px; font-size: 18px; font-weight: 300; color: #D9D4C8; line-height: 1.75; }
html[lang="ar"] .hero-lede { font-size: 20px; line-height: 1.9; }
.hero .actions { margin-top: 38px; }

@keyframes m-d1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(170px, 60px); } }
@keyframes m-d2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-210px, -40px); } }
@keyframes m-d3 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(90px, -90px); } }
@keyframes m-far { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(-40px, 20px) rotate(2deg); } }
@keyframes m-tilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes m-pl { 0%, 100% { transform: translateY(5px); } 50% { transform: translateY(-5px); } }
@keyframes m-pr { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(5px); } }
@keyframes m-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.m-l1 { animation: m-d1 28s ease-in-out infinite; }
.m-l2 { animation: m-d2 34s ease-in-out infinite; }
.m-l3 { animation: m-d3 24s ease-in-out infinite; }
.m-far { transform-origin: 700px 320px; animation: m-far 40s ease-in-out infinite; }
.m-beam { transform-origin: 150px 92px; animation: m-tilt 9s ease-in-out infinite; }
.m-pl { animation: m-pl 9s ease-in-out infinite; }
.m-pr { animation: m-pr 9s ease-in-out infinite; }
.m-rise { animation: m-rise 1.1s var(--ease) both; }
.m-d-1 { animation-delay: .15s; } .m-d-2 { animation-delay: .3s; } .m-d-3 { animation-delay: .45s; }

/* ---------- Home sections ---------- */
.block { padding-block: clamp(70px, 9vw, 120px) 0; }
.block-head .display { font-size: clamp(38px, 4.4vw, 60px); }
html[lang="ar"] .block-head .display { font-size: clamp(42px, 5vw, 66px); }
.block-head .lede { margin: 16px 0 0; font-size: 18px; }
html[lang="ar"] .block-head .lede { font-size: 20px; }

.continue { margin-top: 0; padding: 26px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.continue p { margin: 0; }
.continue strong { font-weight: 600; }

.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 52px; }
.subject { text-decoration: none; display: flex; flex-direction: column; transition: transform .5s var(--ease); }
.subject:hover { transform: translateY(-6px); }
.cover { background: var(--room); color: var(--parchment); height: 250px; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.cover-ar { font-family: var(--f-ar); font-weight: 700; line-height: 1.25; font-size: 44px; direction: rtl; text-align: start; }
.cover-en { font-family: var(--f-display); line-height: 1; font-size: 24px; direction: ltr; text-align: start; }
.cover .lead-ar .cover-ar { font-size: 44px; }
.cover.lead-en .cover-en { font-size: 40px; color: var(--parchment); }
.cover.lead-en .cover-ar { font-size: 26px; font-weight: 400; color: var(--room-soft); }
.cover.lead-ar .cover-en { color: var(--room-soft); }
[dir="ltr"] .cover-ar { text-align: left; }
[dir="rtl"] .cover-en { text-align: right; }
.subject-meta { margin-top: 14px; font-size: 15px; color: var(--ink-2); }
.subject-levels { margin-top: 2px; font-size: 14px; font-weight: 500; color: var(--room); }
.subject-bar { margin-top: 12px; height: 2px; background: var(--line); position: relative; }
.subject-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--room); }

.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 64px; }
.block:has(> .ways) { padding-bottom: clamp(80px, 10vw, 130px); }
.way-num { font-family: var(--f-display); font-size: 48px; line-height: 1; color: var(--brass); }
html[lang="ar"] .way-num { font-family: var(--f-ar); font-weight: 700; }
.way h3 { margin: 16px 0 0; font-size: 40px; }
html[lang="ar"] .way h3 { font-size: 44px; }
.way p { margin: 14px 0 0; color: var(--ink-2); max-width: 500px; font-size: 18px; line-height: 1.8; }
html[lang="ar"] .way p { font-size: 19px; line-height: 1.9; }


.site-foot { border-top: 1px solid var(--line-2); }
.site-foot .wrap { padding-block: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; font-size: 14px; color: var(--muted); }
.foot-guides a { color: var(--ink-2); }

/* ---------- Subject room ---------- */
.room-hero { background: var(--room); color: var(--parchment); }
.room-hero .wrap { padding-block: 40px 52px; }
.crumbs { font-size: 14px; color: var(--room-soft); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.room-title { margin-top: 26px; display: flex; flex-direction: column; gap: 4px; }
.room-title .ar-display { font-size: clamp(48px, 6vw, 80px); line-height: 1.2; }
.room-title .en-display { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; }
.room-title .first.en-display { font-size: clamp(48px, 6vw, 84px); }
.room-title .second { color: var(--room-soft); }
[dir="ltr"] .room-title .ar-display { direction: rtl; text-align: left; }
[dir="rtl"] .room-title .en-display { direction: ltr; text-align: right; }
.room-sub { margin: 14px 0 0; color: var(--room-soft); max-width: 640px; }

.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 40px; }
.level { text-align: start; background: var(--parchment-2); border: 1px solid var(--line); padding: 18px 18px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 150px; text-decoration: none; transition: border-color .25s, transform .25s; }
.level:hover { border-color: var(--room); }
.level[aria-current="true"] { border-color: var(--room); background: var(--room-tint); box-shadow: inset 0 3px 0 var(--room); }
.level-code { font-family: var(--f-ui); font-size: 24px; font-weight: 600; line-height: 1.1; color: var(--room); letter-spacing: .5px; }
.level-code.grade { font-size: 20px; letter-spacing: 0; }
.lvl-num { font-family: var(--f-ui); font-weight: 500; font-size: .82em; letter-spacing: 0; }
.level-can { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.level-state { margin-top: auto; font-size: 13px; color: var(--muted); }
.level-state.soon { color: var(--brass); }
.level-state.mine { color: var(--room); font-weight: 600; }

.level-panel { padding-block: 56px 100px; }
.level-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.level-panel-head .display { font-size: clamp(32px, 3.4vw, 46px); }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 20px; margin-top: 32px; }
.skill { background: var(--white); padding: 28px; box-shadow: 0 1px 0 var(--line-2); }
.skill-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.skill-head h3 { margin: 0; font-size: 22px; font-weight: 600; }
.skill-head svg { width: 24px; height: 24px; color: var(--brass); flex: none; }
.skill-desc { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.set-row { margin-top: 22px; }
.set-row h4 { margin: 0 0 10px; font-size: 14px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
.set-row h4 small { font-weight: 400; color: var(--muted); }
.squares { display: flex; flex-wrap: wrap; gap: 6px; }
.sq { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); background: var(--parchment-2); text-decoration: none; font-size: 15px; font-weight: 500; transition: border-color .2s, background .2s; }
.sq:hover { border-color: var(--room); }
.sq.done { background: var(--room-tint); border-color: var(--room); color: var(--room); }
.sq.test { border-color: var(--ink); }
.sq.test.scored { background: var(--ink); color: var(--parchment); }
.sq.test.scored.low { background: var(--warm); border-color: var(--warm); }
.sq small { position: absolute; bottom: -18px; inset-inline: 0; text-align: center; font-size: 11px; color: var(--muted); font-weight: 400; }
.set-row.tests .squares { padding-bottom: 16px; }
.soon-note { margin-top: 32px; padding: 28px; background: var(--parchment-2); border-top: 3px solid var(--brass); max-width: 760px; }
.soon-note h3 { margin: 0; font-size: 20px; }
.soon-note p { margin: 8px 0 0; color: var(--ink-2); }

/* ---------- Exam screens ---------- */
.exam-head { background: var(--parchment-2); border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 10; }
.exam-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding-block: 12px; }
.exam-head .brand-ar { font-size: 26px; color: var(--ink); }
.exam-head .brand svg { width: 26px; height: 26px; }
.exam-sep { width: 1px; height: 28px; background: var(--line-2); }
.exam-meta { flex: 1 1 280px; min-width: 0; }
.exam-meta .kicker { color: var(--room); font-size: 12px; }
html[lang="ar"] .exam-meta .kicker { font-size: 13px; }
.exam-title { margin: 0; font-family: inherit; font-size: 18px; font-weight: 500; line-height: 1.35; }
.timer { display: flex; align-items: baseline; gap: 8px; }
.timer b { font-size: 26px; font-weight: 300; letter-spacing: .5px; direction: ltr; }
.timer span { font-size: 13px; color: var(--muted); }
.timer.low b { color: var(--bad); }
.mode-tag { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 5px 10px; border: 1px solid var(--room); color: var(--room); }
html[lang="ar"] .mode-tag { letter-spacing: 0; font-size: 13px; }
.progress-line { height: 3px; background: var(--line); }
.progress-line i { display: block; height: 3px; width: 0; background: var(--room); transition: width .4s var(--ease); }

.exam-body { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; padding-block: 36px 90px; }
.source { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; }
.source.static { position: static; max-height: none; }
.work { flex: 999 1 560px; min-width: 0; }

.paper { background: var(--white); box-shadow: 0 1px 0 var(--line-2), 0 30px 60px -44px rgba(28, 33, 64, .3); }
.passage { padding: 36px clamp(22px, 3vw, 40px); position: relative; }
.passage::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 5px; background: var(--room); }
.passage h2 { margin: 0 0 18px; font-size: clamp(26px, 2.4vw, 32px); line-height: 1.2; }
.passage h2.display { font-size: clamp(26px, 2.4vw, 32px); }
.passage .text { white-space: pre-line; font-size: 18px; line-height: 1.85; color: #1E2438; }
.passage .text[dir="rtl"] { font-family: var(--f-ar); font-size: 22px; line-height: 2.05; }
.passage .text.quran { font-family: var(--f-quran); font-size: 28px; line-height: 2.3; text-align: center; }

.player { background: var(--room); color: var(--parchment); padding: 28px; }
.player-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--room-soft); }
html[lang="ar"] .player-top { letter-spacing: 0; font-size: 13px; }
.player h2 { margin: 14px 0 22px; font-size: 30px; line-height: 1.15; color: var(--parchment); }
.player-ctrl { display: flex; align-items: center; gap: 18px; }
.play { width: 60px; height: 60px; flex: none; border-radius: 50%; border: 0; background: var(--parchment); color: var(--room); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.play:disabled { opacity: .45; cursor: not-allowed; }
.play svg { width: 20px; height: 20px; }
[dir="rtl"] .play svg.tri { transform: scaleX(-1); }
.track { flex: 1; min-width: 0; }
.track-bar { height: 2px; background: rgba(245, 240, 230, .25); position: relative; }
.track-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--parchment); }
.track-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--room-soft); margin-top: 8px; direction: ltr; }
.player-hint { margin: 18px 0 0; font-size: 14px; color: #E6E9F2; }
.speakers { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(245, 240, 230, .2); font-size: 13px; color: #E6E9F2; }
.audio-missing { margin-top: 18px; padding: 14px 16px; background: rgba(245, 240, 230, .1); border-inline-start: 3px solid var(--brass-light); font-size: 14px; line-height: 1.6; }
.transcript { margin-top: 0; }
.transcript summary { cursor: pointer; padding: 16px 20px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; }
.transcript summary::after { content: "+"; color: var(--brass); }
.transcript[open] summary::after { content: "–"; }
.transcript .text { padding: 0 20px 20px; white-space: normal; }
.tline { display: block; margin-bottom: 8px; }
.tline b { color: var(--room); font-weight: 600; }

.notice { border-top: 1px solid var(--ink); padding-top: 14px; font-size: 15px; color: var(--ink-2); line-height: 1.75; }
.notice .kicker { display: block; margin-bottom: 2px; font-size: 12px; }

/* Questions */
.q { min-width: 0; border: 0; margin: 0; padding: 32px clamp(20px, 3vw, 40px); display: flex; gap: 22px; border-bottom: 1px solid #ECE5D6; }
.q:last-child { border-bottom: 0; }
.q-num { font-family: var(--f-ui); font-weight: 300; font-size: 36px; line-height: .95; color: var(--room); width: 34px; flex: none; }
.q[dir="rtl"] .q-num { font-family: var(--f-ar); font-weight: 700; font-size: 36px; line-height: 1; }
.q-main { flex: 1; min-width: 0; }
.q legend, .q .q-text { padding: 0; font-size: 19px; line-height: 1.6; font-weight: 500; float: left; width: 100%; }
.q[dir="rtl"] legend, .q[dir="rtl"] .q-text { float: right; font-size: 20px; }
.opts { clear: both; display: flex; flex-direction: column; gap: 10px; padding-top: 18px; }
.opt { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid #E2DACA; background: var(--white); font-size: 16px; line-height: 1.5; cursor: pointer; transition: border-color .2s, background .2s; }
.q[dir="rtl"] .opt { font-size: 18px; }
.opt:hover { border-color: var(--room); }
.opt:has(input:checked) { border-color: var(--room); background: var(--room-tint); }
.opt.right { border-color: var(--ok) !important; background: var(--ok-bg) !important; }
.opt.wrong { border-color: var(--bad) !important; background: var(--bad-bg) !important; }
.locked .opt { cursor: default; }
.locked .opt:hover { border-color: #E2DACA; }
.opt .key { font-size: 13px; color: var(--muted); width: 14px; flex: none; }
input[type="radio"].r { appearance: none; -webkit-appearance: none; margin: 0; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px solid #9A93A0; background: var(--white); cursor: pointer; }
input[type="radio"].r:checked { border-color: var(--room); background: radial-gradient(circle, var(--room) 0 4.5px, var(--white) 5px); }
.opt.right input.r:checked { border-color: var(--ok); background: radial-gradient(circle, var(--ok) 0 4.5px, var(--white) 5px); }
.opt.wrong input.r:checked { border-color: var(--bad); background: radial-gradient(circle, var(--bad) 0 4.5px, var(--white) 5px); }
.pts { font-size: 12px; color: var(--muted); flex: none; }
.why { margin-top: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.7; background: var(--parchment-2); border-inline-start: 3px solid var(--ok); }
.why.wrong { border-inline-start-color: var(--bad); }
.why b { display: block; margin-bottom: 2px; }
.your { margin: 10px 0 0; font-size: 14px; color: var(--bad); }

.qnav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 22px; }
.qnav button { width: 40px; height: 40px; border: 1px solid var(--line-2); background: var(--parchment-2); cursor: pointer; font-size: 14px; }
.qnav button.answered { background: var(--ink); border-color: var(--ink); color: var(--parchment); }
.qnav button.right { background: var(--ok); border-color: var(--ok); color: #FFFFFF; }
.qnav button.wrong { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
.qnav .count { margin-inline-start: auto; font-size: 14px; color: var(--muted); }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 26px; }
.encourage { margin: 22px 0 0; display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-2); min-height: 24px; }
.encourage::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); flex: none; }
.encourage:empty { visibility: hidden; }

/* Writing & speaking */
.task-head { padding: 34px clamp(22px, 3vw, 40px); position: relative; }
.task-head::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 5px; background: var(--room); }
.task-head h2 { margin: 0; font-size: clamp(26px, 2.4vw, 32px); line-height: 1.2; }
.prompt { margin: 14px 0 0; font-size: 19px; line-height: 1.75; white-space: pre-line; }
.prompt[dir="rtl"] { font-family: var(--f-ar); font-size: 22px; line-height: 2; }
.tips { margin-top: 20px; padding: 16px 18px; background: var(--parchment-2); font-size: 15px; }
.tips strong { display: block; margin-bottom: 6px; color: var(--brass); }
.tips ul { margin: 0; padding-inline-start: 20px; }
details.model { margin-top: 20px; }
details.model summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
details.model summary::-webkit-details-marker { display: none; }
details.model summary::before { content: '+'; display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--brass); color: var(--brass); font-weight: 600; flex: none; }
details.model[open] summary::before { content: '−'; }
details.model summary .display { font-size: 22px; }
details.model .muted { margin: 12px 0 0; }
.model-text { margin-top: 14px; padding: 16px 18px; background: var(--parchment-2); border-inline-start: 3px solid var(--brass); line-height: 1.75; }
.model-text p { margin: 0 0 12px; }
.model-text p:last-child { margin-bottom: 0; }
.answer { display: block; width: 100%; min-height: 340px; margin-top: 20px; border: 0; border-bottom: 1px solid var(--ink); background: var(--white) repeating-linear-gradient(transparent 0 39px, var(--line) 39px 40px); padding: 0 clamp(16px, 2vw, 24px); font: 18px/40px var(--f-ui); color: var(--ink); resize: vertical; box-shadow: 0 1px 0 var(--line-2); }
.answer[dir="rtl"] { font: 21px/40px var(--f-ar); }
.answer:focus { outline: 2px solid var(--room); outline-offset: 0; }
.wc { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.wc .bar { flex: 1 1 160px; height: 3px; background: var(--line); position: relative; max-width: 300px; }
.wc .bar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--room); }

.rec { margin-top: 20px; padding: 40px 24px; text-align: center; background: var(--white); box-shadow: 0 1px 0 var(--line-2); }
.rec-btn { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--room); color: #FFFFFF; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .2s; }
.rec-btn svg { width: 36px; height: 36px; }
.rec-btn.on { background: var(--bad); animation: pulse 1.6s infinite; }
.rec-btn:disabled { opacity: .45; cursor: not-allowed; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(154, 63, 34, .45); } 100% { box-shadow: 0 0 0 22px rgba(154, 63, 34, 0); } }
.rec-time { margin-top: 16px; font-size: 32px; font-weight: 300; direction: ltr; }
.rec .hint { margin: 8px auto 0; max-width: 460px; color: var(--muted); font-size: 15px; }
.rec audio { margin-top: 18px; width: 100%; max-width: 460px; }

.rubric { margin-top: 24px; padding: 32px clamp(22px, 3vw, 40px); }
.rubric h2 { margin: 0; font-size: 30px; }
.rubric > p { margin: 8px 0 18px; color: var(--ink-2); }
.check { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-top: 1px solid #ECE5D6; cursor: pointer; font-size: 17px; line-height: 1.6; }
.check input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--room); flex: none; }

/* ---------- Results ---------- */
.result-band { background: var(--ink); color: var(--parchment); }
.result-band .wrap { padding-block: 52px 64px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.verdict { flex: 1 1 420px; min-width: 0; }
.verdict .kicker { color: var(--brass-soft); }
.score-big { display: flex; align-items: baseline; gap: 12px; margin-top: 12px; direction: ltr; justify-content: flex-start; }
[dir="rtl"] .score-big { justify-content: flex-end; }
.score-big b { font-family: var(--f-display); font-weight: 400; font-size: clamp(100px, 11vw, 160px); line-height: .85; letter-spacing: -4px; }
.score-big span { font-size: 18px; color: var(--brass-soft); }
.verdict h1 { margin: 24px 0 0; font-size: clamp(30px, 2.8vw, 40px); color: var(--parchment); line-height: 1.15; }
.verdict h1 em { color: var(--brass-light); }
html[lang="ar"] .verdict h1 em { color: var(--brass-light); }
.verdict p { margin: 16px 0 0; max-width: 540px; color: #D9D4C8; font-weight: 300; line-height: 1.75; }
.verdict .actions { margin-top: 28px; }
.balance { flex: 1 1 480px; min-width: 0; margin: 0; }
.balance svg { display: block; width: 100%; height: auto; }
.balance figcaption { margin-top: 4px; text-align: center; font-size: 13px; color: #B8B4C8; }
@keyframes b-beam { from { transform: rotate(0); } }
@keyframes b-l { from { transform: translateY(0); } }
@keyframes b-r { from { transform: translateY(0); } }
@keyframes grow { from { transform: scaleY(0); } }
.b-beam { transform-origin: 300px 80px; transform: rotate(var(--tilt)); animation: b-beam 2.2s cubic-bezier(.3, .6, .2, 1) both .8s; }
.b-left { transform: translateY(var(--dl)); animation: b-l 2.2s cubic-bezier(.3, .6, .2, 1) both .8s; }
.b-right { transform: translateY(var(--dr)); animation: b-r 2.2s cubic-bezier(.3, .6, .2, 1) both .8s; }
.b-blk { transform-box: fill-box; transform-origin: bottom; animation: grow .8s var(--ease) both; }

.result-body { padding-block: 56px 100px; }
.result-body h2.display { font-size: clamp(30px, 3vw, 38px); }
.review { margin-top: 24px; }
.tabs-inline { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Progress ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 36px; }
.stat { background: var(--white); padding: 22px; box-shadow: inset 0 3px 0 var(--room), 0 1px 0 var(--line-2); }
.stat h2, .stat h3 { margin: 0; font-size: 18px; }
.stat p { margin: 6px 0 14px; color: var(--muted); font-size: 14px; }
.stat .subject-bar { margin-top: 0; }
.table-wrap { overflow-x: auto; margin-top: 20px; background: var(--white); box-shadow: 0 1px 0 var(--line-2); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: start; font-weight: 500; color: var(--muted); font-size: 13px; padding: 14px 16px; border-bottom: 1px solid var(--ink); }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); }
td.low { color: var(--bad); font-weight: 600; }
td.high { color: var(--ok); font-weight: 600; }
.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); }
.page-pad { padding-block: 56px 100px; }
.loading { padding: 120px 0; text-align: center; color: var(--muted); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translate(-50%, 20px); background: var(--ink); color: var(--parchment); padding: 12px 20px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 60; max-width: calc(100vw - 32px); }
[dir="rtl"] .toast { transform: translate(50%, 20px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[dir="rtl"] .toast.show { transform: translate(50%, 0); }

/* ---------- Young grades (1–6): same parts, friendlier ---------- */
.young { --radius: 18px; }
.young .paper, .young .player, .young .opt, .young .skill, .young .q-wrap, .young .rec, .young .answer, .young .tips, .young .why, .young .model-text { border-radius: 22px; }
.young .paper { overflow: hidden; }
.young .btn { border-radius: 999px; }
.young .opt { padding: 18px 20px; font-size: 20px; border-width: 2px; }
.young .q[dir="rtl"] .opt { font-size: 22px; }
.young .q legend, .young .q .q-text { font-size: 24px; font-weight: 600; line-height: 1.45; }
.young .q[dir="rtl"] legend { font-size: 26px; }
.young input[type="radio"].r { width: 24px; height: 24px; border-width: 2.5px; }
.young input[type="radio"].r:checked { background: radial-gradient(circle, var(--room) 0 6px, var(--white) 7px); }
.young .qnav button { border-radius: 50%; }
.young .passage .text { font-size: 20px; line-height: 1.9; }
.young .passage .text[dir="rtl"] { font-size: 25px; }
.young .play { width: 72px; height: 72px; }
.stars { display: inline-flex; gap: 4px; }
.stars svg { width: 26px; height: 26px; }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.stars .new { animation: pop .6s cubic-bezier(.2, .9, .3, 1.4) both; transform-box: fill-box; transform-origin: center; }
.cheer { margin-top: 14px; padding: 16px 20px; border-radius: 22px; border: 2px solid var(--ok); background: var(--white); font-size: 18px; display: flex; gap: 14px; align-items: flex-start; }
.cheer b { color: var(--ok); display: block; font-size: 20px; }

/* ---------- Phone ---------- */
@media (max-width: 900px) {
    .hero-scale { display: none; }
    .source { position: static; max-height: none; }
}
@media (max-width: 760px) {
    .nav { gap: 16px; font-size: 14px; order: 3; width: 100%; justify-content: flex-start; }
    .site-head .wrap { row-gap: 8px; }
    .site-head .wrap { padding-block: 12px; }
    .brand-en { display: none; }
    .q { padding: 24px 18px; gap: 14px; }
    .q-num { width: 26px; font-size: 32px; }
    .pts { display: none; }
    .exam-sep, .exam-head .brand { display: none; }
    .timer b { font-size: 22px; }
    .skill { padding: 22px 18px; }
    .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .level { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    .site-head, .exam-head, .actions, .qnav, .site-foot, .submit-row { display: none !important; }
    body { background: #FFFFFF; }
    .result-band { background: #FFFFFF; color: var(--ink); }
}

/* ---------- Learn ---------- */
.learn-strip { margin-top: 32px; padding: 28px; background: var(--room-tint); border-top: 3px solid var(--room); }
.learn-strip.help { margin: 0 0 32px; }
.learn-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.learn-head h3 { margin: 0; font-size: 22px; font-weight: 600; }
.learn-head p { margin: 4px 0 0; font-size: 15px; }
.lesson-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; margin-top: 20px; }
.lesson-cards.all { margin-top: 24px; }
.lesson-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px 20px 22px; background: var(--white); text-decoration: none; color: var(--ink); box-shadow: 0 1px 0 var(--line-2); transition: transform .2s, box-shadow .2s; }
.lesson-card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 var(--line-2), 0 18px 34px -24px rgba(28, 33, 64, .45); }
.lc-kind { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--room); font-weight: 600; }
[lang="ar"] .lc-kind, .lc-kind:lang(ar) { letter-spacing: 0; text-transform: none; font-size: 14px; }
.lc-title { font-size: 19px; font-weight: 600; line-height: 1.35; }
.lc-sum { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.lc-done { position: absolute; top: 16px; inset-inline-end: 16px; font-size: 12px; color: var(--ok); font-weight: 600; }
.lesson-card.read { box-shadow: inset 3px 0 0 var(--ok), 0 1px 0 var(--line-2); }
[dir="rtl"] .lesson-card.read { box-shadow: inset -3px 0 0 var(--ok), 0 1px 0 var(--line-2); }
.lesson-wrap { max-width: 860px; padding-block: 48px 100px; display: flex; flex-direction: column; gap: 24px; }
.lesson { padding: clamp(26px, 4vw, 52px); }
.lesson .kicker { color: var(--room); }
.lesson-lede { font-size: 21px; line-height: 1.65; margin: 10px 0 8px; color: var(--ink); }
.lesson h2 { font-size: 22px; font-weight: 600; margin: 36px 0 10px; padding-top: 22px; border-top: 1px solid #ECE5D6; }
.lesson p { font-size: 17px; line-height: 1.85; margin: 0 0 14px; color: var(--ink-2); }
[lang="ar"] .lesson p, [lang="ar"] .lesson-lede { font-size: 19px; line-height: 2; }
.lesson-ex { list-style: none; margin: 12px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lesson-ex li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; padding: 12px 16px; background: var(--parchment-2); border-inline-start: 3px solid var(--room); }
.ex-t { font-size: 19px; font-weight: 500; color: var(--ink); }
.ex-t[lang="ar"] { font-family: var(--f-ar); font-size: 24px; line-height: 1.8; }
.ex-m { font-size: 15px; color: var(--muted); }
.lesson-table-wrap { overflow-x: auto; margin: 12px 0 18px; }
.lesson-table { border-collapse: collapse; width: 100%; font-size: 16px; }
.lesson-table th { text-align: start; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 2px solid var(--ink); }
[lang="ar"] .lesson-table th { letter-spacing: 0; text-transform: none; font-size: 15px; }
.lesson-table td { padding: 11px 14px; border-bottom: 1px solid #ECE5D6; vertical-align: top; }
.lesson-table td[lang="ar"] { font-family: var(--f-ar); font-size: 21px; }
.lesson-table td[lang="fr"] { font-weight: 500; }
.lesson-tip { margin: 18px 0; padding: 16px 20px; background: var(--ink); color: var(--parchment); font-size: 16px; line-height: 1.75; }
.lesson-tip .kicker { display: block; color: #E2C68C; margin-bottom: 4px; font-size: 12px; }
.lesson-check { padding-bottom: 8px; }
.lc-head { padding: 30px clamp(20px, 3vw, 40px) 4px; }
.lc-head .display { font-size: 30px; margin: 0; }
.lc-head p { margin: 6px 0 0; }
.lesson-check .q:last-child { border-bottom: 0; }
.lesson-foot { display: flex; flex-direction: column; gap: 22px; }
.lesson-foot h3 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.lesson-prac, .lesson-nav { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) {
    .learn-strip { padding: 22px 18px; margin-inline: -4px; }
    .lesson-wrap { padding-block: 28px 70px; }
    .lesson-lede { font-size: 19px; }
    .lesson-table { font-size: 15px; }
    .lesson-table th, .lesson-table td { padding: 9px 8px; }
    .lesson-table td { overflow-wrap: anywhere; }
    .lesson-table td[lang="ar"] { font-size: 19px; }
    .lesson-nav .btn, .lesson-prac .btn { flex: 1 1 100%; justify-content: center; text-align: center; }
}
@media print { .lesson-check, .lesson-foot { display: none; } }

/* English display type: use Bodoni's sturdier optical sizes so hairlines stay readable (stronger on small screens) */
.display, .en-display, .brand-en, .hero-second.en, .cover-en, .way-num, .lc-head .display { font-optical-sizing: none; font-variation-settings: 'opsz' 28; }
@media (max-width: 900px) {
    .display, .en-display, .brand-en, .hero-second.en, .cover-en, .way-num, .lc-head .display { font-variation-settings: 'opsz' 11; font-weight: 500; }
}
[lang="ar"] .display, .ar-display { font-variation-settings: normal; }

/* ---------- Placement test ---------- */
.place-bar { border-bottom: 0; padding: 22px 0 0; }
.place-wrap { max-width: 860px; }
.place-wrap > .kicker { margin: 0 0 6px; }
.place-wrap > .muted { margin: 0 0 22px; }
.place-how { margin: 0 0 32px; padding-inline-start: 22px; line-height: 1.9; font-size: 17px; }
.place-how li::marker { color: var(--room); font-weight: 600; }
.place-line { position: sticky; top: 0; z-index: 5; }
.place-stages { flex: 0 1 340px; min-width: 260px; }
.place-stages h2 { font-size: 15px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--brass-soft); margin: 0 0 14px; }
html[lang="ar"] .place-stages h2 { letter-spacing: 0; text-transform: none; font-size: 16px; }
.place-stages ol { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.place-stages li { display: grid; grid-template-columns: 34px 1fr 52px; align-items: center; gap: 12px; font-size: 15px; direction: ltr; }
.pl-lvl { font-weight: 600; }
.pl-bar { height: 6px; background: rgba(245, 240, 230, .14); }
.pl-bar i { display: block; height: 6px; background: var(--brass-soft); }
.place-stages li.fail .pl-bar i { background: #D9805C; }
.place-stages li.skip { opacity: .4; }
.pl-sc { text-align: end; color: #D9D4C8; font-variant-numeric: tabular-nums; }

/* Lesson voice buttons */
.say { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--room); background: var(--white); color: var(--room); display: inline-grid; place-items: center; cursor: pointer; padding: 0; align-self: center; transition: background .2s, color .2s; }
.say svg { width: 12px; height: 12px; }
.say .tri { margin-inline-start: 2px; }
.say:hover, .say.on { background: var(--room); color: var(--white); }
.say:focus-visible { outline: 2px solid var(--room); outline-offset: 2px; }
.lesson-ex li { align-items: center; }
.td-say { display: inline-flex; align-items: center; gap: 10px; }
.td-say .say { width: 26px; height: 26px; }

/* ---------- Full exam ---------- */
.exam-strip { margin-top: 32px; padding: 24px 28px; border: 1px solid var(--line); border-top: 3px solid var(--ink); background: var(--white); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.exam-strip h3 { margin: 0; font-size: 22px; font-weight: 600; }
.exam-strip h3 small { font-size: 14px; font-weight: 500; color: var(--room); margin-inline-start: 8px; letter-spacing: .04em; }
.exam-strip p { margin: 6px 0 0; max-width: 520px; }
.exam-h { font-size: 20px; font-weight: 600; margin: 0 0 14px; }
.exam-parts { list-style: none; margin: 0 0 36px; padding: 0; border-top: 1px solid var(--line); }
.exam-parts li { display: grid; grid-template-columns: 36px 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ep-num { font-family: var(--f-display); font-size: 26px; color: var(--room); }
.ep-name { font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.ep-name small { font-weight: 400; color: var(--muted, #6B6B6B); font-size: 14px; }
.ep-time { font-size: 14px; color: var(--muted, #6B6B6B); white-space: nowrap; }
.exam-between { font-size: clamp(30px, 3.4vw, 44px); margin: 8px 0 12px; }
.exam-res li { grid-template-columns: 96px 1fr 64px; }
.ex-sk { font-weight: 500; }
.exam-res li { direction: inherit; }

/* Placement for grade bands */
.place-stages.bands li { grid-template-columns: 104px 1fr 52px; direction: inherit; }
.score-big.band { direction: inherit; justify-content: flex-start; }
.score-big.band b { font-size: clamp(54px, 6.4vw, 96px); letter-spacing: -1px; line-height: 1; }
html[lang="ar"] .score-big.band b { font-family: var(--f-ar); font-weight: 700; letter-spacing: 0; }

/* My mistakes */
.nav-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 4px; font-size: 12px; line-height: 20px; text-align: center; background: var(--brass-light); color: var(--ink); border-radius: 10px; font-weight: 600; }
.mist-note { margin: 0 0 28px; padding: 14px 18px; background: var(--white); border-inline-start: 3px solid var(--brass); font-size: 15px; line-height: 1.7; }
.mist-note a { color: var(--brass); font-weight: 600; }
.mist-block { margin-top: 48px; }
.mist-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--room); }
.mist-head h2 { font-size: clamp(28px, 3vw, 38px); margin: 0; color: var(--room); }
.mist-head p { margin: 4px 0 0; }
.mist-list { list-style: none; margin: 0; padding: 0; }
.mist-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.mist-q { font-size: 17px; line-height: 1.6; font-weight: 500; }
.mist-q[dir="rtl"] { font-size: 19px; }
.mist-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.mist-meta a { color: var(--room); }
.mist-n { color: var(--bad); }
.mist-more { margin-top: 12px; }
.mist-run .lede { margin-bottom: 28px; }
.mist-from { margin: 0 0 8px; font-size: 13px; color: var(--muted); clear: both; }
.mist-card .q-main > .mist-from { float: none; }
.mist-src { margin-top: 16px; background: var(--parchment-2); }
.mist-src .text { white-space: pre-line; line-height: 1.8; }
.mist-card[dir="rtl"] .mist-src .text { font-family: var(--f-ar); font-size: 19px; }
.mist-why, .mist-clue, .mist-status { display: block; }
.mist-clue { margin-top: 8px; }
.mist-clue i { display: block; font-style: normal; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mist-clue i:lang(ar) { text-transform: none; letter-spacing: 0; }
.mist-status { margin-top: 8px; font-size: 13px; color: var(--muted); }
.mist-card.skipped { opacity: .55; }
.mist-sum { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; margin-bottom: 32px; padding: 28px clamp(20px, 3vw, 40px); background: var(--room); color: var(--parchment); }
.mist-sum .score-line { margin: 0; font-family: var(--f-display); font-size: 64px; line-height: 1; }
.mist-sum .score-line b { font-weight: 400; }
.mist-sum h2 { margin: 0; font-size: clamp(26px, 3vw, 34px); color: var(--parchment); }
.mist-sum p { margin: 6px 0 0; }
.mist-sum .actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; }
.mist-sum .btn.room { background: var(--parchment); color: var(--room); border-color: var(--parchment); }
.mist-sum .btn.ghost { color: var(--parchment); border-color: rgba(245, 240, 230, .5); }
.mist-run .crumbs { color: var(--muted); margin-bottom: 10px; }
.mist-run .crumbs a { color: var(--room); }
.mist-card .why [dir] { text-align: start; }

/* Move progress */
.move { margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.move h2 { font-size: 32px; margin: 0; }
.move .lede { max-width: 720px; }
.move-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 20px; }
.move-label { display: block; font-weight: 500; margin-bottom: 8px; }
.move-code { display: block; width: 100%; height: 96px; margin: 12px 0; padding: 10px 12px; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; border: 1px solid var(--line-2); background: var(--white); color: var(--ink); resize: vertical; }
.move-label + .move-code { margin-top: 0; }
.move-msg { margin: 8px 0 0; font-size: 14px; color: var(--ok); min-height: 1em; }
.move-msg.bad { color: var(--bad); }
.move-code.hidden { display: none; }
@media (max-width: 720px) { .move-grid { grid-template-columns: 1fr; } }

/* Writing & speaking: automatic notes and criteria self-check */
.fb-notes { margin-top: 24px; padding: 28px clamp(22px, 3vw, 40px); }
.fb-notes h2 { margin: 0; font-size: 26px; }
.fb-notes > p { margin: 6px 0 14px; font-size: 14px; }
.fb-notes ul { list-style: none; margin: 0; padding: 0; }
.fb-notes li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid #ECE5D6; font-size: 16px; line-height: 1.6; }
.fb-dot { flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--white); background: var(--ok); }
.fb-notes li.warn .fb-dot { background: var(--warm); }
.rub-h { margin: 28px 0 0; font-size: 18px; font-weight: 600; color: var(--room); }
.rub-h + .muted { margin: 4px 0 6px; font-size: 14px; }
.crit { border: 0; margin: 0; padding: 18px 0; border-top: 1px solid #ECE5D6; min-width: 0; }
.crit legend { float: inline-start; width: 100%; padding: 0; font-size: 17px; font-weight: 600; }
.crit-d { clear: both; margin: 0; padding-top: 4px; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.rate { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rate label { position: relative; cursor: pointer; }
.rate input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rate span { display: inline-block; min-width: 96px; padding: 9px 14px; text-align: center; border: 1px solid var(--line-2); background: var(--white); font-size: 14px; transition: background .2s, border-color .2s; }
.rate label:hover span { border-color: var(--room); }
.rate input:focus-visible + span { outline: 2px solid var(--room); outline-offset: 2px; }
.rate input:checked + span { background: var(--room); border-color: var(--room); color: var(--white); }
.crit.missing .rate span { border-color: var(--bad); }
.rub-need { margin: 12px 0 0; color: var(--bad); font-size: 14px; min-height: 1em; }
.sc-sum { margin-bottom: 32px; padding: 28px clamp(22px, 3vw, 40px); }
.sc-sum h2 { margin: 0; font-size: 28px; }
.sc-sum > .muted { margin: 6px 0 12px; }
.sc-bars { list-style: none; margin: 0; padding: 0; }
.sc-bars li { display: grid; grid-template-columns: 1fr auto 90px; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid #ECE5D6; font-size: 15px; }
.sc-bars b { font-weight: 500; font-size: 14px; color: var(--muted); text-align: end; }
.sc-meter { display: inline-flex; gap: 4px; }
.sc-meter i { width: 28px; height: 8px; background: var(--sand); }
.sc-meter i.on { background: var(--room); }
.sc-next { margin-top: 18px; padding: 14px 16px; background: var(--room-tint); border-inline-start: 3px solid var(--room); font-size: 15px; line-height: 1.7; }
.sc-next .kicker { display: block; margin-bottom: 4px; font-size: 12px; }
@media (max-width: 520px) { .sc-bars li { grid-template-columns: 1fr auto; } .sc-bars b { display: none; } .rate span { min-width: 0; } }

/* Headings that receive focus on page change: no ring needed */
h1[tabindex="-1"]:focus, #main:focus { outline: none; }

/* ---------- Teacher printables ---------- */
.print-link { margin: 26px 0 0; font-size: 15px; }
.offline-save { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 0; font-size: 15px; }
.offline-save .btn { margin: 0; }
.print-link a { font-weight: 600; color: var(--ink); }
.pick-wrap { padding-block: 28px 80px; }
.pick-levels { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip-l { padding: 7px 14px; border: 1px solid var(--line-2); background: var(--white); text-decoration: none; color: var(--ink); font-size: 15px; }
.chip-l[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--parchment); }
.pick-wrap .exam-strip h2 { margin: 0; font-size: 22px; font-weight: 600; }
.pick-wrap .exam-strip h2 small { font-weight: 400; color: var(--muted); font-size: 15px; margin-inline-start: 6px; }
.pick-h { margin: 36px 0 14px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.pick-skill { margin: 0; border: 0; border-top: 3px solid var(--room); padding: 18px 20px 20px; min-width: 0; }
.pick-skill legend { float: inline-start; width: 100%; padding: 0; font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.pick-skill h3 { clear: both; margin: 14px 0 4px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
html[lang="ar"] .pick-skill h3 { letter-spacing: 0; text-transform: none; font-size: 15px; }
.check.pick { font-size: 15px; padding-block: 6px; }
.pick-go { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 18px; margin-top: 22px; padding: 14px 0; background: var(--parchment); border-top: 1px solid var(--line-2); }
.pick-go .rub-need { margin: 0; }

.print-bar { background: var(--ink); color: var(--parchment); }
.print-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-block: 14px; }
.print-bar :focus-visible { outline-color: #E2C68C; }
.print-h { margin: 0; flex: 1 1 260px; font-size: 18px; font-weight: 600; font-family: inherit; }
.print-h span { font-weight: 400; color: #E2C68C; }
.pmode { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; border: 0; }
.pmode label { cursor: pointer; }
.pmode input { position: absolute; opacity: 0; }
.pmode span { display: inline-block; padding: 7px 12px; border: 1px solid rgba(245, 240, 230, .45); font-size: 14px; }
.pmode input:checked + span { background: var(--parchment); color: var(--ink); border-color: var(--parchment); }
.pmode input:focus-visible + span { outline: 2px solid #E2C68C; outline-offset: 2px; }
.print-bar .btn.gold { background: #E2C68C; border-color: #E2C68C; color: var(--ink); }
.print-bar .btn.gold:hover { background: #EBD3A2; }
.print-tip { margin: 0; padding-block: 0 12px; font-size: 14px; color: #D8D2C4; }

.printdoc { padding: 28px 12px 80px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.printdoc[data-mode="student"] .sheet.key, .printdoc[data-mode="key"] .sheet.student { display: none; }
.sheet { width: 100%; max-width: 820px; background: #FFFFFF; color: #111; padding: clamp(20px, 5vw, 56px); box-shadow: 0 1px 0 var(--line-2), 0 20px 40px -30px rgba(28, 33, 64, .5); font-size: 16px; line-height: 1.6; }
.sheet[lang="ar"] { font-family: var(--f-ar); font-size: 19px; line-height: 1.9; }
.ph { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; align-items: center; padding-bottom: 14px; border-bottom: 2px solid #111; }
.ph-brand { display: flex; align-items: center; gap: 6px; color: #111; }
.ph-brand svg { width: 30px; height: 30px; }
.ph-brand span { font-family: var(--f-ar); font-weight: 700; font-size: 22px; line-height: 1; }
.ph-brand .ph-en { font-family: var(--f-display); font-weight: 400; font-size: 11px; letter-spacing: 3px; }
.ph-k { margin: 0; font-size: 13px; color: #444; font-family: var(--f-ui); }
.ph-t h2 { margin: 0; font-size: 22px; line-height: 1.3; }
.sheet[lang="ar"] .ph-t h2 { font-size: 25px; }
.ph-f { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; font-size: 14px; font-family: var(--f-ui); }
.sheet[lang="ar"] .ph-f { font-size: 16px; }
.ph-f span { display: inline-flex; align-items: flex-end; gap: 6px; flex: 1 1 180px; }
.ph-f i { flex: 1; min-width: 60px; border-bottom: 1px solid #555; height: 1.2em; }
.ph-f i.short { flex: 0 0 50px; min-width: 50px; }
.part, .kpart { margin-top: 28px; }
.part-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 6px 0; border-bottom: 1px solid #999; font-size: 13px; font-family: var(--f-ui); color: #333; }
.sheet[lang="ar"] .part-h { font-size: 15px; }
.part-n { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sheet[lang="ar"] .part-n { letter-spacing: 0; text-transform: none; }
.part-t { margin: 12px 0 8px; font-size: 19px; }
.sheet[lang="ar"] .part-t { font-size: 22px; }
.ptext { white-space: pre-line; padding: 14px 16px; border: 1px solid #BBB; }
.pins { margin: 12px 0 6px; font-style: italic; color: #333; }
.sheet[lang="ar"] .pins { font-style: normal; font-weight: 700; }
.purl { display: block; font-style: normal; font-size: 13px; font-family: var(--f-ui); word-break: break-all; }
.pq, .kq { list-style: none; margin: 0; padding: 0; }
.pq > li, .kq > li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dotted #BBB; break-inside: avoid; }
.pq-n { font-weight: 700; }
.pq-q { margin: 0 0 4px; font-weight: 600; }
.po { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.po.two { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.po li { display: flex; gap: 10px; align-items: baseline; }
.bub { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid #333; border-radius: 50%; font-size: 12px; font-family: var(--f-ui); font-weight: 600; line-height: 1; }
.bub.on { background: #111; color: #FFF; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pprompt { padding: 12px 16px; border-inline-start: 3px solid #111; background: #F6F4EF; }
.pprompt p { margin: 0 0 8px; } .pprompt p:last-child { margin: 0; }
.ptips { font-size: 14px; color: #333; }
.sheet[lang="ar"] .ptips { font-size: 17px; }
.pnotes { margin: 16px 0 0; font-weight: 600; }
.lines i { display: block; height: 32px; border-bottom: 1px solid #9A9A9A; }
.kgrid { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0; padding: 10px 14px; border: 1px solid #111; font-family: var(--f-ui); font-size: 15px; }
.ka { display: flex; gap: 10px; align-items: baseline; margin: 0; font-weight: 600; }
.kwhy { margin: 4px 0 0; font-size: 14px; color: #333; }
.sheet[lang="ar"] .kwhy { font-size: 17px; }
.kh { margin: 18px 0 6px; font-size: 15px; font-family: var(--f-ui); }
.sheet[lang="ar"] .kh { font-size: 17px; }
.kl { margin: 0; padding-inline-start: 22px; }
.kl li { margin-bottom: 4px; }
.ktx .tline { display: block; margin-bottom: 4px; }
.kmodel { padding: 12px 16px; border: 1px solid #BBB; }
.kmodel p { margin: 0 0 8px; }
.pfoot { margin: 32px 0 0; font-size: 12px; color: #666; text-align: center; font-family: var(--f-ui); }

@media print {
    @page { size: A4; margin: 14mm 13mm; }
    .print-bar { display: none !important; }
    body:has(.printdoc) { background: #FFFFFF; }
    .printdoc { padding: 0; display: block; }
    .sheet { max-width: none; box-shadow: none; padding: 0; font-size: 11.5pt; }
    .sheet[lang="ar"] { font-size: 14pt; }
    .sheet.key { break-before: page; }
    .printdoc[data-mode="key"] .sheet.key { break-before: auto; }
    .sheet.student .part + .part { break-before: page; }
    .part-h, .part-t, .kh { break-after: avoid; }
    .pprompt { background: none; }
}

/* ---------- Mizan Path (js/path.js) ---------- */
.pa-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; background: rgba(245, 240, 230, .12); color: inherit; font-size: 14px; line-height: 1.3; }
.pa-chip svg { width: 18px; height: 18px; flex: none; }
.pa-chip b { font-weight: 600; }
.pa-chip.hot svg { color: #E9A23B; }
.pa-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pa-stats .pa-chip.goal { padding-inline-end: 16px; }
.pa-goalbar { display: inline-block; width: 70px; height: 6px; background: rgba(245, 240, 230, .25); position: relative; overflow: hidden; }
.pa-goalbar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--brass-light); }
.pa-goalbar.wide { display: block; width: 100%; height: 8px; background: var(--sand); margin: 10px 0 6px; }
.pa-goalbar.wide i { background: var(--room); }
.pa-hero-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.pa-hero-tools .btn svg { width: 18px; height: 18px; margin-inline-end: 8px; }
.muted-on-dark { color: var(--room-soft); font-size: 14px; }
.pa-h2 { font-size: clamp(30px, 3vw, 40px); margin-bottom: 26px; }

/* home band */
.pa-band { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; margin: 40px 0 8px; padding: 28px 32px; background: var(--ink); color: var(--parchment); }
.pa-band .kicker { color: var(--brass-light); }
.pa-band h2 { font-size: clamp(26px, 2.6vw, 34px); margin: 6px 0 8px; }
.pa-band p { margin: 0; color: #CFCBD8; max-width: 620px; }
.pa-band-go { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.pa-band .btn { background: var(--brass-light); border-color: var(--brass-light); color: var(--ink); }
.pa-band-art { position: relative; width: 84px; height: 84px; }
.pa-band-art i { position: absolute; width: 26px; height: 26px; transform: rotate(45deg); border: 1.5px solid var(--brass-light); left: calc(var(--i) * 16px); top: calc(54px - var(--i) * 16px); }
.pa-band-art i:last-child { background: var(--brass-light); }

/* stage card on the level page */
.pa-lvl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px; margin-bottom: 28px; background: var(--room-tint); border-inline-start: 4px solid var(--room); }
.pa-lvl > div { flex: 1 1 320px; }
.pa-lvl h3 { margin: 0 0 4px; font-size: 20px; }
.pa-lvl p { margin: 0; }
.pa-lvl .pa-goalbar.wide { max-width: 420px; background: var(--white); }

/* picker */
.pa-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pa-pick { background: var(--white); box-shadow: 0 1px 0 var(--line-2); }
.pa-pick-head .cover { min-height: 150px; }
.pa-pick-list { display: grid; }
.pa-pick-lvl { display: block; padding: 16px 20px; text-decoration: none; border-top: 1px solid var(--line); }
.pa-pick-lvl:hover { background: var(--room-tint); }
.pa-pick-name { font-weight: 600; font-size: 18px; }
.pa-pick-lvl .muted { font-size: 14px; }
.pa-how { margin-top: 56px; max-width: 720px; }
.pa-how h3 { font-size: 20px; margin: 0 0 10px; }
.pa-how li { margin-bottom: 6px; }
@media (max-width: 900px) { .pa-picks { grid-template-columns: 1fr; } .pa-band { grid-template-columns: 1fr; } .pa-band-go { align-items: flex-start; } .pa-band-art { display: none; } }

/* the map */
.pa-map { max-width: 560px; margin: 0 auto; padding: 40px 0 100px; }
.pa-alldone { text-align: center; margin: 32px auto 0; max-width: 560px; padding: 14px 18px; background: var(--ok-bg); color: var(--ok); }
.pa-unit { margin-bottom: 30px; }
.pa-unit-head { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; background: var(--room); color: #FFFFFF; margin-bottom: 26px; }
.pa-unit-n { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--room-soft); }
.pa-unit-t { font-size: 20px; font-weight: 600; line-height: 1.4; }
.pa-unit-t[dir="rtl"] { font-family: var(--f-ar); font-size: 24px; }
.pa-nodes { display: flex; flex-direction: column; align-items: center; gap: 40px; padding-top: 30px; }
.pa-step { position: relative; display: flex; flex-direction: column; align-items: center; transform: translateX(var(--x)); }
.pa-node { position: relative; display: grid; place-items: center; width: 84px; height: 84px; text-decoration: none; color: #FFFFFF; }
.pa-node::before { content: ""; position: absolute; inset: 14px; transform: rotate(45deg); background: var(--room); box-shadow: 0 6px 0 rgba(28, 33, 64, .22); transition: transform .15s var(--ease), box-shadow .15s; }
.pa-node:hover::before { transform: rotate(45deg) translate(-2px, -2px); }
.pa-node:active::before { transform: rotate(45deg) translate(2px, 2px); box-shadow: 0 2px 0 rgba(28, 33, 64, .22); }
.pa-gem { position: relative; display: grid; place-items: center; }
.pa-gem svg { width: 30px; height: 30px; }
.pa-node.lock { color: var(--muted); cursor: not-allowed; }
.pa-node.lock::before { background: var(--sand); box-shadow: 0 6px 0 var(--line-2); }
.pa-node.done::before { background: var(--room); }
.pa-node.done .pa-gem::after { content: ""; position: absolute; width: 10px; height: 10px; background: var(--brass-light); transform: rotate(45deg); inset-inline-end: -20px; top: -20px; }
.pa-node.cp { width: 104px; height: 104px; }
.pa-node.cp::before { inset: 16px; background: var(--brass); }
.pa-node.cp.lock::before { background: var(--sand); }
.pa-node.cp .pa-gem svg { width: 36px; height: 36px; }
.pa-node.cur::after { content: ""; position: absolute; inset: 4px; transform: rotate(45deg); border: 3px solid var(--brass-light); animation: pa-pulse 1.6s var(--ease) infinite; }
.pa-node.cur:not(.done)::before { background: var(--room); }
@keyframes pa-pulse { 0%, 100% { opacity: 1; transform: rotate(45deg) scale(1); } 50% { opacity: .35; transform: rotate(45deg) scale(1.08); } }
.pa-step-l { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pa-bubble { position: absolute; bottom: calc(100% + 2px); background: var(--ink); color: var(--parchment); font-size: 13px; font-weight: 600; padding: 5px 12px; white-space: nowrap; animation: pa-bob 1.8s ease-in-out infinite; }
.pa-bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: var(--ink); transform: translateX(-50%) rotate(45deg); z-index: -1; }
@keyframes pa-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.pa-stars { display: inline-flex; gap: 2px; margin-top: 2px; }
.pa-stars i { width: 16px; height: 16px; color: var(--line-2); display: inline-grid; }
.pa-stars i.on { color: #D9A23A; }
.pa-stars svg { width: 100%; height: 100%; }
@media (max-width: 520px) { .pa-step { transform: translateX(calc(var(--x) * .6)); } }

/* a round */
.pa-top { position: sticky; top: 0; z-index: 20; background: var(--parchment); border-bottom: 1px solid var(--line); }
.pa-top-in { max-width: 980px; margin: 0 auto; padding: 14px var(--gutter); display: flex; align-items: center; gap: 18px; }
.pa-x { display: grid; place-items: center; width: 40px; height: 40px; color: var(--muted); }
.pa-x svg { width: 24px; height: 24px; }
.pa-x:hover { color: var(--ink); }
.pa-track { flex: 1; height: 14px; background: var(--sand); position: relative; overflow: hidden; }
.pa-track i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--room); transition: width .4s var(--ease); }
.pa-hearts { display: inline-flex; align-items: center; gap: 6px; color: var(--bad); font-weight: 700; font-size: 18px; }
.pa-hearts svg { width: 24px; height: 24px; }
.pa-hearts.hit { animation: pa-shake .45s; }
@keyframes pa-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.pa-run { max-width: 980px; margin: 0 auto; padding: 36px var(--gutter) 200px; }
.pa-run.with-src { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.pa-src { padding: 24px 26px; max-height: calc(100vh - 220px); overflow: auto; position: sticky; top: 86px; }
.pa-src-t { font-size: 20px; margin: 0 0 12px; }
.pa-src-t[dir="rtl"] { font-family: var(--f-ar); font-size: 24px; }
.pa-src-text p { margin: 0 0 12px; }
.pa-src-text[dir="rtl"] { font-size: 20px; line-height: 1.9; }
.pa-audio { width: 100%; margin: 6px 0; }
.pa-tx { margin-top: 12px; }
.pa-tx summary { cursor: pointer; color: var(--room); font-weight: 600; }
.pa-tx .tline { display: block; margin-bottom: 6px; }
.pa-inline { margin: 0 0 18px; padding: 12px 16px; background: var(--white); border: 1px solid var(--line); }
.pa-lede { margin: 0 0 18px; color: var(--muted); }
.pa-prompt { font-size: 24px; font-weight: 600; line-height: 1.45; margin: 0 0 22px; }
.pa-q[dir="rtl"] .pa-prompt { font-size: 27px; }
.pa-opts { display: grid; gap: 12px; }
.pa-opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; padding: 16px 18px; background: var(--white); border: 2px solid var(--line-2); border-bottom-width: 4px; cursor: pointer; font-size: 18px; line-height: 1.45; transition: border-color .12s, background .12s, transform .08s; }
.pa-q[dir="rtl"] .pa-opt { font-size: 20px; }
.pa-opt:hover:not(:disabled) { background: var(--room-tint); }
.pa-opt:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.pa-opt .key { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 1.5px solid var(--line-2); font-size: 14px; color: var(--muted); }
.pa-opt.sel { border-color: var(--room); background: var(--room-tint); }
.pa-opt.sel .key { border-color: var(--room); color: var(--room); }
.pa-opt.right { border-color: var(--ok); background: var(--ok-bg); }
.pa-opt.right .key { border-color: var(--ok); color: var(--ok); }
.pa-opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.pa-opt:disabled { cursor: default; }
.pa-keys { font-size: 13px; margin-top: 22px; }
@media (hover: none) { .pa-keys { display: none; } }
#pa-card.pa-in { animation: pa-in .28s var(--ease); }
@keyframes pa-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pa-foot { position: fixed; inset-inline: 0; bottom: 0; z-index: 25; background: var(--parchment-2); border-top: 1px solid var(--line); transition: background .2s; }
.pa-foot-in { max-width: 980px; margin: 0 auto; padding: 18px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 96px; }
.pa-foot.ok { background: var(--ok-bg); border-top-color: #BFD8CA; }
.pa-foot.bad { background: var(--bad-bg); border-top-color: #E9C6B4; }
.pa-fb { display: flex; flex-direction: column; gap: 3px; }
.pa-fb b { font-size: 20px; }
.pa-foot.ok .pa-fb b { color: var(--ok); }
.pa-foot.bad .pa-fb b, .pa-foot.bad .pa-fb span:first-of-type { color: var(--bad); }
.pa-why { color: var(--ink-2); font-size: 15px; }
.pa-go { min-width: 170px; }
.pa-foot.ok .pa-go { background: var(--ok); border-color: var(--ok); }
.pa-foot.bad .pa-go { background: var(--bad); border-color: var(--bad); }
@media (max-width: 860px) {
    .pa-run.with-src { grid-template-columns: 1fr; }
    .pa-src { position: static; max-height: 46vh; }
    .pa-prompt { font-size: 21px; }
    .pa-foot-in { flex-direction: column; align-items: stretch; min-height: 0; }
    .pa-go { width: 100%; }
}

/* end screens */
.pa-end { position: relative; min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 40px var(--gutter) 80px; overflow: hidden; }
.pa-end-card { position: relative; z-index: 1; text-align: center; max-width: 560px; }
.pa-end-card h1 { font-size: clamp(36px, 5vw, 56px); margin: 18px 0 8px; }
.pa-end-gem { display: inline-grid; place-items: center; width: 112px; height: 112px; position: relative; color: #FFFFFF; }
.pa-end-gem::before { content: ""; position: absolute; inset: 18px; transform: rotate(45deg); background: var(--room); }
.pa-end-gem.bad::before { background: var(--bad); }
.pa-end-gem svg { position: relative; width: 40px; height: 40px; }
.pa-end .pa-stars i { width: 34px; height: 34px; }
.pa-end-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0; }
.pa-chip.big { background: var(--white); box-shadow: 0 1px 0 var(--line-2); font-size: 16px; padding: 10px 16px; }
.pa-chip.big svg { color: var(--room); }
.pa-chip.big.hot svg { color: #E9A23B; }
.pa-end-goal { max-width: 360px; margin: 0 auto 26px; font-size: 15px; }
.pa-end-go { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }
.pa-end-go .btn { min-width: 200px; }
.pa-confetti i { position: absolute; top: -20px; left: var(--x); width: 10px; height: 10px; transform: rotate(45deg); background: var(--room); opacity: .8; animation: pa-fall 2.6s calc(var(--i) * 70ms) var(--ease) forwards; }
.pa-confetti i:nth-child(3n) { background: var(--brass-light); }
.pa-confetti i:nth-child(4n) { background: #D9A23A; width: 8px; height: 8px; }
@keyframes pa-fall { to { transform: translateY(105vh) rotate(405deg); opacity: 0; } }

/* younger learners */
.pa-young .pa-prompt { font-size: 28px; }
.pa-young .pa-q[dir="rtl"] .pa-prompt { font-size: 32px; }
.pa-young .pa-opt { font-size: 22px; padding: 18px 20px; border-radius: 18px; }
.pa-young .pa-q[dir="rtl"] .pa-opt { font-size: 25px; }
.pa-young .pa-opt .key { border-radius: 50%; }
.pa-young .pa-src-text[dir="rtl"] { font-size: 24px; }
@media (prefers-reduced-motion: reduce) {
    .pa-node.cur::after, .pa-bubble, .pa-confetti i, #pa-card.pa-in, .pa-hearts.hit { animation: none; }
    .pa-confetti { display: none; }
}
@media print { .pa-top, .pa-foot, .pa-band { display: none; } }

body:has(.pa-foot) .toast { bottom: 130px; }
.pa-lvl .muted, .level[aria-current="true"] .level-state:not(.mine):not(.soon) { color: var(--ink-2); }
.learn-head .muted { color: var(--ink-2); }

/* ---------- Teachers (js/teach.js) ---------- */
.te-gate { max-width: 680px; }
.te-gate h1 { font-size: clamp(36px, 4vw, 52px); margin-bottom: 14px; }
.te-gate .btn { margin: 18px 0 12px; }
.te-wrap { padding-block: 36px 100px; }
.te-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.te-pick-l { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brass); min-width: 130px; font-weight: 600; }
html[lang="ar"] .te-pick-l { letter-spacing: 0; }
.te-vers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.te-ver { background: var(--white); padding: 20px 22px; border-top: 4px solid var(--ink); box-shadow: 0 1px 0 var(--line-2); }
.te-ver.v-sup { border-top-color: var(--ok); }
.te-ver.v-ext { border-top-color: var(--brass); }
.te-ver h2 { margin: 0 0 6px; font-size: 19px; display: flex; gap: 10px; align-items: center; }
.te-ver p { margin: 0; font-size: 15px; color: var(--ink-2); }
.te-mk { font-size: 15px; line-height: 1; }
.te-marks { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.te-list { margin-top: 52px; }
.te-list h2, .te-own h2 { font-size: clamp(28px, 2.8vw, 36px); }
.te-list h2 small { font-family: var(--f-ui); font-size: 15px; color: var(--muted); margin-inline-start: 10px; }
.te-list ul { list-style: none; margin: 18px 0 0; padding: 0; background: var(--white); box-shadow: 0 1px 0 var(--line-2); }
.te-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.te-row:last-child { border-bottom: 0; }
.te-row > div:first-child { display: flex; flex-direction: column; min-width: 200px; flex: 1 1 240px; }
.te-row .muted { font-size: 14px; color: var(--ink-2); }
.te-vs { display: flex; flex-wrap: wrap; gap: 8px; }
.te-v { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line-2); text-decoration: none; font-size: 14px; background: var(--parchment-2); }
.te-v:hover { border-color: var(--ink); background: var(--white); }
.te-v.v-sup .te-mk { color: var(--ok); }
.te-v.v-ext .te-mk { color: var(--brass); }
.te-v.v-all { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.te-v.v-all:hover { background: #2A3058; }
.te-own { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 52px; padding: 24px 26px; background: var(--room-tint); border-inline-start: 4px solid var(--room); }
.te-own p { margin: 6px 0 0; color: var(--ink-2); }
@media (max-width: 900px) { .te-vers { grid-template-columns: 1fr; } }

/* version tabs on the print page */
.vtabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; }
.vtab { padding: 6px 14px; border: 1px solid rgba(245, 240, 230, .35); color: var(--parchment); text-decoration: none; font-size: 14px; }
.vtab:hover { background: rgba(245, 240, 230, .08); }
.vtab.on { background: var(--parchment); color: var(--ink); border-color: var(--parchment); }

/* adapted papers */
.ph-mk { font-family: var(--f-ui); margin-inline-start: 6px; }
.pchunks { list-style: none; margin: 0; padding: 0; border: 1px solid #BBB; }
.pchunks > li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed #CCC; }
.pchunks > li:last-child { border-bottom: 0; }
.pc-n { display: inline-grid; place-items: center; width: 26px; height: 26px; background: #111; color: #FFF; font-family: var(--f-ui); font-size: 13px; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pchunks .tline { display: block; }
.phint { margin: 0 0 6px; font-size: 13px; font-family: var(--f-ui); font-style: italic; color: #333; }
.pprove { margin: 8px 0 0; font-size: 14px; font-style: italic; }
.popen-t { margin: 20px 0 8px; font-size: 15px; font-family: var(--f-ui); }
.popen { margin: 0; padding-inline-start: 22px; }
.popen li p { margin: 0; font-weight: 600; }
.pcheck { margin: 10px 0; padding: 10px 14px; border: 1px solid #BBB; }
.pcheck ul { margin: 4px 0 0; padding-inline-start: 0; list-style: none; }
.pcheck li::before { content: "☐  "; }
.kev { font-style: italic; }
.kev:not(:empty)::before { content: "“"; }
.kev:not(:empty)::after { content: "”"; }
.sheet.v-sup { font-family: var(--f-ui); font-size: 19px; line-height: 2; letter-spacing: .01em; }
.sheet.v-sup[lang="ar"] { font-family: var(--f-ui); font-size: 21px; line-height: 2.1; }
.sheet.v-sup .pq > li { padding: 14px 0; }
.sheet.v-sup .po { gap: 10px; }
.sheet.v-sup .bub { width: 28px; height: 28px; font-size: 14px; }
.sheet.v-sup .phint { font-size: 15px; }
.sheet.v-sup .lines i { height: 42px; }
@media print {
    .sheet.student ~ .sheet.student { break-before: page; }
    .printdoc[data-mode="key"] .sheet.key ~ .sheet.key { break-before: page; }
    .sheet.v-sup { font-size: 14pt; line-height: 1.9; }
    .sheet.v-sup[lang="ar"] { font-size: 16pt; }
    .vtabs { display: none; }
}
@media (max-width: 760px) { .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 18px; white-space: nowrap; gap: 13px; } .nav::-webkit-scrollbar { display: none; } }
