:root{font-family:Arial,Helvetica,sans-serif;color:#102d48;background:#e8f7ff;font-synthesis:none;--navy:#102d48;--cyan:#cbf1ff;--yellow:#ffd84d;--muted:#4b6477;--line:#c8dfec}
*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:default}[hidden]{display:none!important}a{color:inherit}.shell{max-width:1190px;margin:auto;padding:0 36px}.header{display:flex;justify-content:space-between;gap:24px;align-items:center;padding:26px 0;border-bottom:1px solid #b7d8e8}.teacher{display:grid;gap:8px}.teacher strong{font-size:1.2rem}.teacher span{font-size:.94rem;white-space:normal;width:fit-content}.grade-label{font-size:.875rem;letter-spacing:.045em;font-weight:700;border:1px solid #91bdd3;border-radius:6px;padding:10px 13px;background:#fff8}
.layout{display:grid;grid-template-columns:290px minmax(0,1fr);gap:54px;padding:42px 0 28px}.eyebrow{font-size:.875rem;font-weight:700;letter-spacing:.07em;color:#456478}h1{font-size:2.75rem;line-height:1.15;letter-spacing:-.035em;margin:14px 0 14px}.title-line{display:block;width:68px;height:6px;background:var(--yellow);border-radius:4px;margin-top:15px}.intro{font-size:1rem;color:var(--muted);line-height:1.5}.stages{list-style:none;counter-reset:stage;padding:0;margin:30px 0}.stage{position:relative;counter-increment:stage;display:grid;grid-template-columns:34px 1fr;gap:12px;align-items:start;margin:22px 0;color:#527285;line-height:1.45}.stage:before{content:counter(stage);display:grid;place-items:center;width:32px;height:32px;background:#d6eaf5;border:1px solid #9cbece;border-radius:50%;font-weight:700}.stage strong{display:block;font-size:1rem}.stage small{font-size:.875rem}.stage.active{color:var(--navy)}.stage.active:before{background:var(--yellow);border-color:#b99a22}.stage.done:before{background:var(--navy);color:white;border-color:var(--navy)}.rule-card{border-left:4px solid #0b91b8;padding:16px 16px 8px;background:var(--cyan);border-radius:0 10px 10px 0}.rule-card p{font-size:1rem;line-height:1.65;margin:8px 0}.lesson-note{font-size:.875rem;line-height:1.7;color:var(--muted);margin-top:20px}
main{min-width:0}main:focus{outline:none}.quiz-card{background:#fff;border:1px solid #bed9e8;border-radius:20px;padding:30px;box-shadow:0 12px 35px #153f5910}.quiz-status{display:flex;justify-content:space-between;gap:16px;font-size:.94rem;font-weight:700}.quiz-status #score{color:#456478}progress{display:block;width:100%;height:7px;border:none;border-radius:20px;background:#e0edf4;margin:17px 0 28px;overflow:hidden}progress::-webkit-progress-bar{background:#e0edf4}progress::-webkit-progress-value{background:#0b91b8;border-radius:20px}progress::-moz-progress-bar{background:#0b91b8}.question-meta{display:flex;gap:16px;justify-content:space-between;align-items:center;color:#516b7c;font-size:.875rem;margin-bottom:22px}.level{padding:6px 10px;border-radius:6px;background:#e4f6ff;color:#145572;font-weight:700}fieldset{border:none;padding:0;margin:0;min-width:0}legend{width:100%;padding:0;font-weight:700;font-size:1.4rem;line-height:1.55;overflow-wrap:anywhere}.equation{display:block;font-size:1.8rem;margin-top:10px;letter-spacing:.025em}.instruction{color:var(--muted);font-size:.94rem;margin:14px 0 18px}.choices{display:grid;gap:10px}.choice{display:flex;align-items:center;gap:14px;border:2px solid #d7e6ef;background:#f7fbfe;border-radius:10px;min-height:58px;padding:12px 14px;cursor:pointer;transition:background .12s,border-color .12s;font-size:1.06rem;line-height:1.5}.choice input{position:absolute;width:1px;height:1px;opacity:0}.choice-letter{flex-shrink:0;border:1px solid #bcd1de;border-radius:6px;width:30px;height:30px;display:grid;place-items:center;font-size:.875rem;font-weight:700;background:white}.choice-text{min-width:0;overflow-wrap:anywhere}.choice:hover{border-color:#8bc5dc}.choice:has(input:checked){border-color:#137da3;background:#e7f6ff}.choice:has(input:checked) .choice-letter{color:white;background:#137da3;border-color:#137da3}.choice:has(input:focus-visible){outline:3px solid #102d48;outline-offset:3px}.choice.correct{border-color:#23805b;background:#edf9f2}.choice.wrong{border-color:#bb3f3f;background:#fff3f3}.choice.locked{cursor:default}.answer-tag{margin-left:auto;font-size:.875rem;flex-shrink:0;font-weight:700}.correct .answer-tag{color:#1c694b}.wrong .answer-tag{color:#9c3131}.actions{margin-top:24px;display:flex;justify-content:flex-end}.primary{border:2px solid var(--yellow);background:var(--yellow);color:var(--navy);font-size:1rem;font-weight:700;padding:13px 23px;border-radius:9px;min-height:50px;min-width:155px}.primary:hover{background:#ffcf25;border-color:#ffcf25}.primary:focus-visible,summary:focus-visible,.skip:focus-visible{outline:3px solid #102d48;outline-offset:4px}.primary:disabled{opacity:.65}.feedback{margin-top:22px;padding:19px;background:#eff8f4;border-left:4px solid #23805b;border-radius:0 10px 10px 0;line-height:1.6;font-size:1rem}.feedback.incorrect{background:#fff6f2;border-left-color:#bb3f3f}.feedback h3{font-size:1.1rem;margin:0 0 6px}.feedback p{margin:0 0 12px}.steps{padding-left:22px;margin:0}.steps li{padding:3px 0}.error{color:#a62f2f;font-size:1rem;line-height:1.5;margin-bottom:0}
h2{font-size:1.8rem;margin:10px 0 15px}h3{font-size:1.12rem}.result-score{display:flex;align-items:baseline;gap:18px;margin:12px 0}.result-score>span:first-child{font-size:3.5rem;font-weight:700;letter-spacing:-.04em}.percentage{color:var(--muted);font-size:1.12rem}.result-card>p{font-size:1.06rem;line-height:1.7}.stage-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:24px 0}.stage-result{border:1px solid var(--line);border-radius:9px;padding:13px 10px;background:#f7fbfe}.stage-result span{display:block;font-size:.875rem;line-height:1.4}.stage-result strong{display:block;font-size:1.4rem;margin-top:7px}.review-header{border-top:1px solid var(--line);margin-top:30px;display:flex;justify-content:space-between;align-items:center;gap:14px}.review-header span{font-size:.875rem;color:var(--muted)}.review details{border-top:1px solid var(--line);padding:15px 0}.review summary{font-size:1rem;line-height:1.5;cursor:pointer;font-weight:700}.review-status{font-size:.875rem;display:block;font-weight:400;margin:4px 0 0 18px}.review-body{margin:14px 0 4px 18px;line-height:1.6;font-size:1rem}.review-body p{margin:8px 0}.result-card #result-title:focus{outline:none}footer{padding:8px 0 24px;text-align:center;font-size:.875rem;line-height:1.6;color:var(--muted)}.skip{position:fixed;top:-100px;left:16px;background:white;padding:12px;z-index:5}.skip:focus{top:12px}
@media(max-width:900px){.shell{padding:0 24px}.layout{grid-template-columns:235px minmax(0,1fr);gap:28px}.quiz-card{padding:24px}h1{font-size:2.4rem}.stage-results{grid-template-columns:1fr}.stage-result{display:flex;align-items:center;justify-content:space-between;gap:12px}.stage-result strong{margin:0;font-size:1.1rem}}
@media(max-width:680px){.shell{padding:0 16px}.header{padding:18px 0;gap:14px;align-items:flex-start}.teacher strong{font-size:1rem}.teacher span{font-size:.875rem;line-height:1.6}.grade-label{font-size:.875rem;max-width:125px;line-height:1.4;padding:7px 9px;text-align:center}.layout{grid-template-columns:1fr;gap:18px;padding-top:22px}.lesson-panel{display:grid;grid-template-columns:1fr;gap:0}.eyebrow{font-size:.875rem}h1{font-size:2rem;margin:8px 0}.title-line{display:inline-block;vertical-align:middle;width:35px;height:5px;margin:0 0 0 14px}.intro{margin:4px 0 14px}.stages,.rule-card,.lesson-note{display:none}.quiz-card{padding:21px 18px;border-radius:15px}.quiz-status{font-size:.875rem;gap:8px}progress{margin-bottom:20px}.question-meta{margin-bottom:16px}legend{font-size:1.22rem}.equation{font-size:1.7rem}.choice{padding:11px 12px;gap:12px;min-height:58px}.answer-tag{font-size:.875rem}.actions{margin-top:20px}.primary{width:100%}.feedback{padding:15px 13px}.stage-results{grid-template-columns:1fr}.result-score>span:first-child{font-size:3rem}.review-header{align-items:flex-start}.review-header h3{margin:18px 0}.review-header span{margin-top:18px}.review-body{margin-left:4px}.review summary{overflow-wrap:anywhere}footer{padding-bottom:22px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media(max-width:680px){.choice{position:relative;flex-wrap:wrap}.choice-text{flex:1 1 calc(100% - 44px)}.answer-tag{margin-left:44px;max-width:calc(100% - 44px);overflow-wrap:anywhere;flex-shrink:1}.header{flex-wrap:wrap}.grade-label{max-width:none}.quiz-status{flex-wrap:wrap}.review-header{flex-wrap:wrap}}
/* Arabic typography and mathematical layout */
:root{font-family:Tahoma,Arial,sans-serif}.teacher strong{font-size:1.3rem}h1{font-size:2.5rem;line-height:1.55;letter-spacing:0}.eyebrow,.grade-label{letter-spacing:0}.layout{grid-template-columns:290px minmax(0,1fr)}.stages{padding:0}.stage:before{content:counter(stage,arabic-indic)}.rule-card{border-left:0;border-right:4px solid #0b91b8;border-radius:10px 0 0 10px}.feedback{border-left:0;border-right:4px solid #23805b;border-radius:10px 0 0 10px}.feedback.incorrect{border-right-color:#bb3f3f}.steps{padding-left:0;padding-right:24px}.steps li::marker{content:counter(list-item,arabic-indic) '. '}.answer-tag{margin-left:0;margin-inline-start:auto}.review-status{margin-left:0;margin-right:18px}.review-body{margin-left:0;margin-right:18px}.math{direction:ltr;unicode-bidi:isolate;font-family:'Cambria Math',serif;font-size:1.08em;white-space:normal}.equation{font-size:1.8rem;letter-spacing:0;line-height:1.8;text-align:right}.equation .math{max-width:100%}.result-score> bdi{font-size:3.5rem;font-weight:700;letter-spacing:0}.stage-results{grid-template-columns:1fr}.stage-result{display:flex;align-items:center;justify-content:space-between;gap:12px}.stage-result span{font-size:1rem}.stage-result strong{margin:0;font-size:1.1rem}.question-meta{flex-wrap:wrap}.actions{justify-content:flex-start}
@media(max-width:900px){.layout{grid-template-columns:235px minmax(0,1fr)}h1{font-size:2.15rem}.equation{font-size:1.6rem}}
@media(max-width:680px){.layout{grid-template-columns:1fr}.teacher strong{font-size:1.1rem}.grade-label{max-width:none}.title-line{margin-left:0;margin-right:14px}h1{font-size:1.8rem;line-height:1.5}.quiz-card{padding:21px 17px}.choice{flex-wrap:wrap}.choice-text{flex:1 1 calc(100% - 44px)}.answer-tag{margin-left:0;margin-inline-start:44px;max-width:calc(100% - 44px);overflow-wrap:anywhere;flex-shrink:1}.review-body{margin-right:4px}.equation{font-size:1.55rem}.result-score> bdi{font-size:3rem}legend{font-size:1.2rem;line-height:1.9}.instruction,.feedback,.review-body{line-height:1.9}}
.math-run{display:inline-flex;direction:ltr;unicode-bidi:isolate;flex-wrap:wrap;gap:.25em;max-width:100%;vertical-align:middle}
.math[dir="ltr"],.math-run[dir="ltr"]{direction:ltr}
.math[dir="rtl"],.math-run[dir="rtl"]{direction:rtl}

/* Fractions keep enough room on narrow screens. */
.notation-note{font-size:.875rem;line-height:1.7;color:var(--muted)}
.math{font-family:'Cambria Math','STIX Two Math',serif;line-height:1.6}
.equation{font-size:1.5rem;overflow-x:auto;padding-block:5px 10px}
.equation .math{white-space:nowrap}
.choice .math{font-size:1.14em}
.choice-text{overflow-x:auto;padding-block:5px}
.steps .math,.review .math{font-size:1.05em}
.math-run{align-items:center;row-gap:.5em}
@media(max-width:680px){.notation-note{margin:0 0 12px}.equation{font-size:1.3rem}.choice .math{font-size:1.12em}.question-meta{gap:8px}.feedback .math{font-size:1em}}
