:root{color-scheme:light;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#143c2b;background:#f3f8f4}
*{box-sizing:border-box}body{margin:0}.wrap{max-width:760px;padding:18px 16px 70px;margin:auto}
header{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.back{color:#095c43;font-weight:700}.brand{font-size:1.3rem;color:#07583d}.langs{display:flex;gap:4px;flex-wrap:wrap}
button{font:inherit;cursor:pointer;border:1px solid #0b6e4f;border-radius:12px;padding:12px;min-height:46px;background:#0b6e4f;color:white}
.langs button{background:#fff;color:#07583d;padding:8px}button:focus-visible,a:focus-visible{outline:3px solid #bd8c32;outline-offset:3px}
.panel{background:#fff;border:1px solid #cfdfd3;border-radius:18px;padding:20px;margin-bottom:14px;box-shadow:0 4px 16px #184b3220}
h1{margin:0 0 12px;font-size:clamp(1.35rem,5vw,1.85rem)}h2{font-size:1.2rem}
p{line-height:1.6}.muted{color:#486354}.warning{border-inline-start:4px solid #bc9147;padding:10px;background:#fff9ed}
.choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:10px;margin:18px 0}
.choices button{background:#f7faf8;color:#09513a;font-size:1.2rem}.choices button[disabled]{opacity:.7}
.choices .chosen{border:3px solid #a9780f}.arabic{font-family:"Noto Naskh Arabic","Noto Sans Arabic",serif;font-size:clamp(2.3rem,9vw,4rem);line-height:1.8;text-align:center;direction:rtl}
.primary{display:block;width:100%;margin:12px 0}.lesson{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:10px;border-bottom:1px solid #e2ece4}
.locked{color:#617569}.pass{color:#0b6e4f;font-weight:700}a{color:#095c43}
[dir="rtl"] .wrap{text-align:right}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Preserve Arabic base + kasrah mark anchoring in iOS/Android answer cards. */
.arabic-answer-glyph,.arabic{
 font-family:"Noto Naskh Arabic","Amiri","Noto Sans Arabic",serif;
 font-size:clamp(2.3rem,9vw,3.7rem);
 line-height:1.9;
 font-weight:400;
 letter-spacing:0;
 font-kerning:normal;
 font-feature-settings:"mark" 1,"mkmk" 1;
 text-rendering:optimizeLegibility;
 direction:rtl;
 unicode-bidi:isolate;
 display:inline-block;
 padding-block:.2em;
}
.choices button{display:flex;align-items:center;justify-content:center;min-height:100px;overflow:visible}

/* Draft level 2–6 discovery: generous mark clearance and accessible labels. */
.discovery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px;margin:18px 0}
.discovery-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border:1px solid #ccdfd3;background:#f7faf8;border-radius:14px;padding:16px 10px;min-width:0;overflow:visible;text-align:center}
.discovery-card .arabic{display:block;min-height:2.4em;line-height:2.1;padding:.15em .1em;max-width:100%;overflow-wrap:anywhere}
.discovery-card p,.discovery-card small{margin:0;font-size:.97rem;line-height:1.5;color:#214b38}
.guidance{background:#eef7f0;border-inline-start:4px solid #0b6e4f;padding:12px 14px;border-radius:6px;line-height:1.65}
[dir="rtl"] .discovery-card{text-align:center}
@media(max-width:420px){.discovery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.discovery-card{padding:12px 8px}}

/* iOS Arabic connected-form reliability and visually verifiable feedback. */
.arabic-answer-glyph{direction:rtl;unicode-bidi:isolate;white-space:nowrap;min-width:1.8em;text-align:center}
.choices button .arabic-answer-glyph{display:inline-block;line-height:2.2;padding-inline:.18em;font-size:clamp(2.65rem,11vw,4.25rem)}
.answer-feedback{border-radius:12px;padding:14px 12px;margin-block:12px;background:#fff9eb;border:1px solid #e5d39b}
.answer-feedback.pass{background:#edf9f1;border-color:#a2d2b3}
.feedback-forms{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.feedback-forms>span{display:flex;flex-direction:column;align-items:center;gap:4px;background:white;border:1px solid #d4dfd7;border-radius:10px;padding:9px;font-size:.93rem;color:#224c38;text-align:center}
.feedback-forms .feedback-arabic{display:block;line-height:2.1;font-size:clamp(2.2rem,10vw,3.8rem);padding:.08em .18em}
@media(max-width:350px){.feedback-forms{grid-template-columns:1fr}}

/* Keep three-position Arabic sequences entirely inside their answer cards. */
.choices{grid-template-columns:repeat(2,minmax(0,1fr))}
.choices button{min-width:0;max-width:100%;overflow:hidden;padding-inline:8px}
.choices button .arabic-answer-glyph.arabic-sequence{
  display:block;max-width:100%;min-width:0;box-sizing:border-box;
  font-size:clamp(1.15rem,4.4vw,1.85rem);line-height:1.7;
  white-space:normal;overflow-wrap:anywhere;word-break:normal;
  padding-inline:0;text-align:center;
}
.feedback-forms .arabic-sequence{font-size:clamp(1.15rem,4.4vw,1.85rem);max-width:100%;white-space:normal;overflow-wrap:anywhere}
@media(max-width:360px){.choices button .arabic-answer-glyph.arabic-sequence{font-size:1.1rem}}
