:root {
  color-scheme: light;
  --ink: #202944;
  --muted: #555c72;
  --paper: #f8f7f3;
  --line: #dedee7;
  --teal: #11584e;
  --violet: #5036a0;
  --lilac: #ede8fb;
  font: 17px/1.5 ui-rounded, "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
header { border-bottom: 1px solid var(--line); background: #fff; }
.brand-wrap { max-width: 65rem; margin: auto; padding: .45rem 1.2rem; }
header button { background: none; color: var(--ink); padding: .25rem 0; display: inline-flex; gap: .65rem; align-items: center; }
.brand-icon { display: grid; place-items: center; border-radius: .62rem; width: 2.1rem; height: 2.1rem; background: var(--lilac); color: var(--violet); }
svg { width: 1.25rem; height: 1.25rem; flex: none; vertical-align: middle; }
main { max-width: 65rem; margin: auto; padding: 1.5rem 1.2rem max(2rem, env(safe-area-inset-bottom)); }
main > :not(.map-layout) { max-width: 37rem; margin-inline: auto; }
h1, h2 { line-height: 1.13; margin: .2em 0 .38em; font-weight: 830; }
h1 { font-size: clamp(2rem, 6vw, 3.35rem); letter-spacing: -.035em; outline: none; }
h2 { font-size: 1.25rem; letter-spacing: -.02em; }
p { margin: .45rem 0 .85rem; }
button, select { font: inherit; min-height: 44px; }
button { border: 0; border-radius: .75rem; background: var(--violet); color: white; padding: .55rem 1rem; font-weight: 750; cursor: pointer; }
button:hover:not(:disabled) { filter: brightness(1.08); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: default; background: #e1deea; color: #55536a; }
button.secondary, .icon-button { background: var(--lilac); color: var(--violet); }
:focus-visible { outline: 3px solid #8757c3; outline-offset: 3px; }
h1[tabindex="-1"]:focus { outline: none; }
.module-label, .status, .eyebrow { color: var(--muted); font-size: .85rem; font-weight: 750; }
.map-layout { max-width: 36rem; margin-inline: auto; }
.map-intro { padding: clamp(1rem, 3.5vw, 1.6rem); color: white; background: var(--teal); border-radius: 1.15rem; }
.map-intro h1 { margin: .2rem 0 .7rem; }
.map-intro p:last-child { margin-bottom: 0; }
.progress-label { display: flex; justify-content: space-between; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 740; color: #dcf1e9; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: .58rem; display: block; border: none; border-radius: 99px; overflow: hidden; background: #e9e4f3; color: var(--violet); }
progress::-webkit-progress-bar { background: #e9e4f3; }
progress::-webkit-progress-value { background: var(--violet); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--violet); border-radius: 99px; }
.map-intro progress { color: #cff1dc; }
.map-intro progress::-webkit-progress-bar { background: #32796b; }
.map-intro progress::-webkit-progress-value { background: #cff1dc; }
.map-intro progress::-moz-progress-bar { background: #cff1dc; }
.start-link { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: .65rem; text-align: start; margin-top: .9rem; background: #e2f4df; color: #15483b; }
.trail { --swing: 12%; position: relative; isolation: isolate; list-style: none; max-width: 29rem; margin: 1rem auto 0; padding: 0; }
.stop { --x: calc(50% - var(--swing)); position: relative; }
.stop-body { position: relative; display: grid; align-items: center; min-height: 6rem; width: 100%; padding: 0; text-align: start; color: inherit; background: transparent; font-weight: inherit; }
button.stop-body:hover:not(:disabled) { filter: none; }
button.stop-body:hover .tile { filter: brightness(1.08); }
.stop:nth-child(2) { --x: calc(50% + var(--swing)); }
.stop::after { content: ""; position: absolute; z-index: -1; width: calc(var(--swing) * 2); height: 6rem; left: calc(50% - var(--swing)); top: 50%; border-bottom: 2px dashed #bcb0da; border-left: 2px dashed #bcb0da; border-radius: 0 0 0 70%; }
.stop:nth-child(2)::after { border-left: none; border-right: 2px dashed #bcb0da; border-radius: 0 0 70% 0; }
.stop:nth-child(3)::after { width: var(--swing); height: 4.6rem; }
.tile { position: absolute; left: var(--x); transform: translateX(-50%); width: 3.65rem; aspect-ratio: 1; padding: 0; display: grid; place-items: center; border-radius: 1.1rem; background: #e9e7ef; border: 1px solid #ddd8e8; color: #5b536a; }
.tile svg { width: 1.65rem; height: 1.65rem; }
.current .tile { background: var(--violet); color: #fff; border-color: #493097; box-shadow: 0 4px 0 #372477, 0 8px 14px #5036a037; }
.completed .tile { background: #d8eee6; color: #195c4a; border-color: #beded1; }
.stop-copy { justify-self: start; background: var(--paper); margin-left: calc(var(--x) + 2.5rem); }
.stop:nth-child(2) .stop-copy { justify-self: start; background: var(--paper); margin-left: 0; margin-right: calc(100% - var(--x) + 2.5rem); text-align: end; }
.stop-title { display: block; line-height: 1.13; font-weight: 830; letter-spacing: -.02em; margin: .08rem 0 .1rem; font-size: clamp(1rem, 4.25vw, 1.25rem); }
.stop small { color: var(--muted); font-size: .78rem; }
.current .status { color: var(--violet); }
.finish { display: flex; flex-direction: column; gap: .25rem; align-items: center; color: #71451b; font-size: .85rem; font-weight: 750; margin: .35rem 0 0; }
.finish svg { box-sizing: content-box; padding: .55rem; background: #f7e9cb; border-radius: .7rem; border: 1px solid #f0d8a8; }
.panel, .feedback li { background: #fff; border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; margin: 1rem 0; }
.hero { padding: 1.2rem; border-radius: 1.2rem; background: #d9eee6; }
.hero p:last-child { margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: 1rem 1.6rem; }
.example { background: #e8f2ed; padding: 1rem; border-radius: .8rem; }
[lang=ar] { font-family: "Geeza Pro", "Noto Naskh Arabic", Tahoma, serif; font-size: 1.46em; line-height: 1.55; }
.practice-top { display: flex; align-items: center; gap: .85rem; margin-bottom: clamp(1.3rem, 4vw, 2.5rem); font-weight: 750; font-variant-numeric: tabular-nums; color: var(--muted); }
.icon-button { width: 44px; padding: 0; flex: none; }
.question-title { font-size: clamp(1.65rem, 4vw, 2.35rem); margin-bottom: 1rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.option { background: #fff; display: flex; gap: .75rem; align-items: center; min-height: 56px; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: .8rem; margin: .55rem 0; }
.option { cursor: pointer; }
.option input { accent-color: var(--violet); flex: none; }
.option:has(input:checked) { color: #3e268a; background: var(--lilac); border-color: #9e87d0; }
.practice-actions { margin-top: 1.15rem; padding: .75rem; background: #eeecf4; border-radius: .85rem; }
.practice-actions.positive { background: #dcefe6; color: #174f3d; }
.practice-actions.correction { background: #f8e9dc; color: #713e26; }
.practice-actions button { width: 100%; }
.answer-feedback { margin-bottom: .65rem; }
.answer-feedback h2 { display: flex; align-items: center; gap: .45rem; }
.answer-feedback p { margin-bottom: .45rem; }
.correct-answer { font-weight: 750; }
.feedback { list-style: none; padding: 0; }
.feedback li p:last-child { margin-bottom: 0; }
@media (max-width: 43rem) {
  main { padding-top: .9rem; }
}
@media (max-width: 24rem) {
  main, .brand-wrap { padding-inline: .85rem; }
  .trail { --swing: 14%; }
}
@media (prefers-reduced-motion: no-preference) {
  .answer-feedback { animation: reveal .2s ease-out; }
  @keyframes reveal { from { opacity: .35; transform: translateY(5px); } }
}
.match-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.match-grid > div { display: grid; gap: .6rem; }
.pair-tip { color: var(--muted); font-size: .94rem; }
.match-card, .match-card:disabled { display: flex; justify-content: space-between; align-items: center; gap: .25rem; min-height: 58px; min-width: 0; padding: .4rem .55rem; color: var(--ink); background: #fff; border: 1px solid var(--line); text-align: start; overflow-wrap: anywhere; }
.match-card.paired { background: #f0ebfb; border-color: #cabbe8; }
.match-card[aria-pressed=true] { color: #3e268a; background: var(--lilac); box-shadow: inset 0 0 0 2px #7651bf; }
.pair-number:not(:empty) { display: grid; flex: none; place-items: center; width: 1.25rem; min-height: 1.25rem; border-radius: .35rem; background: #ddd0f8; color: #3e268a; font-size: .72rem; }
