:root {
  --ink: #102a43;
  --muted: #627d98;
  --line: #dbe5ee;
  --paper: #ffffff;
  --wash: #f3f7fb;
  --navy: #123c69;
  --blue: #176b87;
  --teal: #1b998b;
  --amber: #f2a93b;
  --red: #d34b4b;
  --shadow: 0 22px 65px rgba(16, 42, 67, .11);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--wash); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 45px; height: 45px; border-radius: 14px;
  background: linear-gradient(145deg, var(--navy), var(--blue)); color: white;
  font-family: Georgia, serif; font-size: 24px; box-shadow: 0 8px 22px rgba(18,60,105,.22);
}
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-size: 17px; letter-spacing: .01em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 70px; }
.quiet-button, .back-link {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 10px 4px; font-weight: 650;
}
.quiet-button:hover, .back-link:hover { color: var(--navy); }

.primary-button, .secondary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 49px; border-radius: 14px; padding: 0 22px; border: 1px solid transparent;
  font-weight: 750; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primary-button { background: var(--navy); color: white; box-shadow: 0 10px 24px rgba(18,60,105,.18); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(18,60,105,.24); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-button { border-color: var(--line); background: white; color: var(--navy); }
.secondary-button:hover { border-color: #a9bdce; }
.compact { min-height: 40px; padding: 0 16px; border-radius: 12px; font-size: 14px; }
.eyebrow { display: block; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

/* Entry */
.entry-page { background: radial-gradient(circle at 18% 15%, #e2f2f2 0, transparent 35%), var(--wash); }
.hero-grid { min-height: calc(100vh - 160px); display: grid; grid-template-columns: 1fr minmax(390px, .76fr); align-items: center; gap: 8vw; }
.hero-copy h1 { max-width: 700px; margin: 18px 0 22px; font: 600 clamp(42px, 5.3vw, 72px)/1.04 Georgia, serif; letter-spacing: -.035em; }
.hero-copy > p { max-width: 630px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.hero-points { display: grid; gap: 13px; margin-top: 38px; }
.hero-points span { display: flex; align-items: center; gap: 14px; color: #3e5972; font-weight: 650; }
.hero-points b { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #b9d1d8; border-radius: 50%; color: var(--blue); font-size: 10px; }
.entry-card { min-height: 540px; padding: 34px; border: 1px solid rgba(255,255,255,.8); border-radius: 30px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.step-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.step-head > div { display: flex; flex-direction: column; gap: 6px; }
.step-head span { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.step-head strong { font: 600 24px/1.25 Georgia, serif; }
.step-count { font-size: 13px !important; color: #9babb9 !important; }
.step-count b { color: var(--navy); font-size: 22px; }
.step-line { height: 3px; margin: 24px 0 32px; border-radius: 5px; background: #e9eff4; overflow: hidden; }
.step-line i { display: block; width: 20%; height: 100%; background: linear-gradient(90deg, var(--blue), var(--teal)); transition: width .3s ease; }
.form-step { display: none; animation: stepIn .25s ease both; }
.form-step.is-active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateX(9px); } }
.form-step > label { display: block; margin: 0 0 9px; color: #3d556c; font-size: 13px; font-weight: 750; }
.form-step select, .form-step input, .match-row select {
  width: 100%; height: 54px; margin-bottom: 24px; padding: 0 15px; border: 1px solid var(--line); border-radius: 13px;
  outline: 0; background: #fbfdff; color: var(--ink); transition: border .2s, box-shadow .2s;
}
.form-step select:focus, .form-step input:focus, .match-row select:focus, .fill-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,107,135,.09); }
.choice-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.choice-pair button { min-height: 145px; border: 1px solid var(--line); border-radius: 17px; background: #fbfdff; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 7px; transition: .2s ease; }
.choice-pair button:hover, .choice-pair button.is-selected { border-color: var(--blue); background: #f0f8fa; transform: translateY(-2px); }
.choice-pair span { font-size: 32px; }
.choice-pair b { font-size: 16px; }
.choice-pair small { color: var(--muted); }
.field-note { min-height: 24px; margin: -12px 0 10px; color: var(--muted); font-size: 13px; }
.selected-student { display: flex; flex-direction: column; gap: 5px; padding: 15px; margin-bottom: 24px; border-left: 3px solid var(--teal); background: #f1f8f8; border-radius: 6px 13px 13px 6px; }
.selected-student span, .selected-student small { color: var(--muted); font-size: 11px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 80px; }
.password-wrap button { position: absolute; top: 8px; right: 8px; height: 38px; border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 750; cursor: pointer; }
.form-step .primary-button { width: 100%; }
.entry-status { min-height: 22px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.entry-status.is-error { color: var(--red); }

/* PWA install assistant */
.pwa-install-dock {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 9000;
  width: min(470px, calc(100vw - 30px)); display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 13px;
  padding: 12px 12px 12px 13px; border: 1px solid rgba(18,60,105,.12); border-radius: 19px;
  background: rgba(255,255,255,.97); box-shadow: 0 18px 54px rgba(16,42,67,.2); backdrop-filter: blur(16px);
  animation: pwaDockIn .32s ease both;
}
.pwa-install-app { min-width: 0; display: flex; align-items: center; gap: 11px; }
.pwa-install-app img { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 13px; box-shadow: 0 6px 17px rgba(18,60,105,.2); }
.pwa-install-app span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pwa-install-app strong { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.pwa-install-app small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pwa-install-button {
  min-height: 42px; padding: 0 15px; border: 0; border-radius: 12px; background: var(--navy); color: white;
  font-size: 13px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px rgba(18,60,105,.18);
}
.pwa-install-button:hover { background: #0d3156; }
.pwa-install-button:disabled { opacity: .58; cursor: wait; }
.pwa-install-dismiss, .pwa-dialog-close {
  display: grid; place-items: center; border: 0; background: transparent; color: #7b91a5; cursor: pointer; font-size: 24px; line-height: 1;
}
.pwa-install-dismiss { width: 28px; height: 38px; }
.pwa-install-dialog {
  width: min(490px, calc(100% - 28px)); padding: 38px; border: 0; border-radius: 27px; color: var(--ink);
  background: white; box-shadow: 0 28px 90px rgba(8,29,49,.28);
}
.pwa-install-dialog::backdrop { background: rgba(8,29,49,.58); backdrop-filter: blur(3px); }
.pwa-dialog-close { position: absolute; top: 15px; right: 15px; width: 38px; height: 38px; border-radius: 50%; background: #f1f5f8; }
.pwa-dialog-logo { display: block; width: 72px; height: 72px; margin-bottom: 23px; border-radius: 20px; box-shadow: 0 10px 24px rgba(18,60,105,.2); }
.pwa-install-dialog .eyebrow { margin-bottom: 9px; }
.pwa-install-dialog h2 { margin: 0 0 12px; font: 600 31px/1.14 Georgia, serif; }
.pwa-install-dialog > p { margin: 0; color: var(--muted); line-height: 1.65; }
.pwa-install-steps { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: pwa-step; }
.pwa-install-steps li { position: relative; min-height: 42px; padding: 3px 0 17px 48px; color: #3e5972; font-size: 14px; line-height: 1.55; counter-increment: pwa-step; }
.pwa-install-steps li::before {
  content: counter(pwa-step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: #e8f4f4; color: var(--blue); font-size: 12px; font-weight: 850;
}
.pwa-dialog-action { width: 100%; margin-top: 22px; }
.focus-page .pwa-install-dock { display: none !important; }
html.is-pwa .pwa-install-dock { display: none !important; }
@keyframes pwaDockIn { from { opacity: 0; transform: translateY(14px); } }

/* Shared cards */
.center-card, .result-card { max-width: 680px; margin: 7vh auto; padding: clamp(30px,5vw,65px); text-align: center; border: 1px solid white; border-radius: 30px; background: var(--paper); box-shadow: var(--shadow); }
.status-card h1, .result-card h1 { margin: 12px 0; font: 600 clamp(30px,4vw,48px)/1.12 Georgia,serif; }
.status-card p, .result-card > p { color: var(--muted); line-height: 1.7; }
.status-symbol { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 22px; border-radius: 50%; font-size: 31px; font-weight: 500; }
.status-symbol.amber { color: #9a640e; background: #fff2d5; }
.status-symbol.red { color: var(--red); background: #fdecec; }
.phone-link { display: block; width: max-content; margin: 22px auto; color: var(--navy); font-size: 28px; font-weight: 800; }

.student-banner { display: flex; align-items: center; justify-content: space-between; min-height: 220px; padding: 44px 50px; overflow: hidden; border-radius: 30px; background: linear-gradient(125deg, #113b66, #176b87 70%, #168d88); color: white; box-shadow: 0 22px 48px rgba(18,60,105,.17); }
.student-banner .eyebrow { color: #a8e0dc; }
.student-banner h1 { margin: 10px 0 7px; font: 600 clamp(32px,4vw,52px)/1.1 Georgia,serif; }
.student-banner p { margin: 0; color: #d9ebf2; }
.avatar { display: grid; place-items: center; width: 105px; height: 105px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(255,255,255,.12); font: 600 32px Georgia,serif; }
.content-section { padding: 52px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.section-heading h2 { margin: 7px 0 0; font: 600 34px Georgia,serif; }
.section-heading p { color: var(--muted); }
.subject-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; }
.subject-card { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 20px; min-height: 145px; padding: 27px; border: 1px solid var(--line); border-radius: 20px; background: white; transition: .2s ease; }
.subject-card:hover { transform: translateY(-3px); border-color: #b3cad6; box-shadow: 0 14px 34px rgba(16,42,67,.09); }
.subject-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 17px; background: #ecf5f6; font-size: 27px; }
.subject-icon.large { width: 84px; height: 84px; font-size: 38px; border-radius: 24px; }
.subject-card h3 { margin: 0 0 7px; font-size: 18px; }
.subject-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.card-arrow { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--wash); color: var(--blue); }
.empty-state { width: 100%; padding: 55px 25px; text-align: center; border: 1px dashed #bdcedb; border-radius: 20px; color: var(--muted); }
.empty-state > span { display: block; color: var(--blue); font-size: 34px; }
.empty-state h3 { color: var(--ink); }

.breadcrumbs { display: flex; gap: 10px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--blue); }
.subject-heading { display: flex; align-items: center; gap: 24px; padding: 42px 0 34px; }
.subject-heading h1 { margin: 8px 0; font: 600 clamp(34px,4vw,52px) Georgia,serif; }
.subject-heading p { margin: 0; color: var(--muted); }
.topic-list { display: grid; gap: 12px; }
.topic-row { display: grid; grid-template-columns: 66px 1fr minmax(150px,auto); align-items: center; gap: 20px; padding: 24px 27px; border: 1px solid var(--line); border-radius: 19px; background: white; }
.topic-row.is-locked { opacity: .62; background: #f6f8fa; }
.topic-row.is-complete { border-color: #c9e4dd; }
.topic-number { color: #a6b6c3; font: 600 25px Georgia,serif; }
.topic-info h2 { margin: 0 0 7px; font-size: 18px; }
.topic-info p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.topic-action { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.state-chip { display: inline-flex; align-items: center; min-height: 35px; padding: 0 12px; border-radius: 20px; font-size: 12px; font-weight: 750; }
.state-chip.locked { color: #66788a; background: #e9eef2; }
.state-chip.complete { color: #167263; background: #e1f4ee; }
.mini-progress { height: 3px; margin-top: 13px; border-radius: 4px; background: #e7edf2; overflow: hidden; }
.mini-progress i { display: block; height: 100%; background: var(--teal); }
.grade-badge { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: var(--navy); color: white; font-weight: 850; }

/* Lesson and exam */
.focus-page { overflow: hidden; background: #eef3f7; }
.learning-shell { height: 100vh; display: grid; grid-template-rows: 74px 1fr; }
.focus-header { display: grid; grid-template-columns: 44px minmax(0,1fr) minmax(220px,.55fr); align-items: center; gap: 18px; padding: 0 3vw; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); }
.focus-back { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: var(--wash); font-size: 19px; }
.focus-title { min-width: 0; display: flex; flex-direction: column; }
.focus-title small { color: var(--muted); font-size: 11px; }
.focus-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.progress-cluster { display: grid; grid-template-columns: auto minmax(110px,1fr); align-items: center; gap: 13px; color: var(--muted); font-size: 12px; }
.progress-track { height: 6px; border-radius: 8px; background: #e5ecf1; overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg,var(--blue),var(--teal)); transition: width .3s; }
.lesson-stage { min-height: 0; display: grid; grid-template-columns: minmax(0,1.18fr) minmax(330px,.72fr); gap: 18px; padding: 18px; transition: opacity .2s, transform .2s; }
.lesson-stage.is-transitioning { opacity: 0; transform: translateX(-12px); }
.block-content, .checkpoint-card, .question-card { min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 7px 25px rgba(16,42,67,.055); }
.block-content { padding: clamp(24px,3vw,45px); }
.block-index { color: var(--teal); font-size: 11px; font-weight: 850; letter-spacing: .13em; }
.block-content h1 { margin: 10px 0 22px; font: 600 clamp(28px,3.3vw,48px)/1.12 Georgia,serif; }
.block-body { white-space: pre-wrap; color: #304b62; font-size: clamp(15px,1.45vw,19px); line-height: 1.72; }
.lesson-media, .exam-media { margin: 25px 0 0; }
.lesson-media img, .lesson-media video, .exam-media img, .exam-media video { display: block; max-width: 100%; max-height: 45vh; margin: auto; border-radius: 15px; object-fit: contain; background: #edf2f5; }
.lesson-media figcaption { margin-top: 8px; color: var(--muted); text-align: center; font-size: 11px; }
.animation-play { display: flex; margin: 12px auto 0; }
.concept-demo { margin-top: 25px; padding: 20px; border-radius: 16px; background: #eff7f7; }
.concept-demo h3 { margin: 0 0 8px; }
.concept-demo p { color: var(--muted); }
.demo-step { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid #d6e8e7; }
.demo-step b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: white; color: var(--teal); }
.checkpoint-card { display: flex; flex-direction: column; padding: clamp(21px,2.6vw,36px); }
.checkpoint-card h2 { margin: 9px 0 23px; font: 600 clamp(22px,2.4vw,33px)/1.24 Georgia,serif; }
.checkpoint-form { display: flex; flex: 1; flex-direction: column; }
.answer-list { display: grid; gap: 10px; }
.answer-option { position: relative; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 11px; min-height: 58px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: .16s; }
.answer-option:hover, .answer-option:has(input:checked) { border-color: var(--blue); background: #f0f7fa; }
.answer-option input { position: absolute; opacity: 0; pointer-events: none; }
.option-letter { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--wash); color: var(--blue); font-size: 12px; font-weight: 850; }
.answer-option:has(input:checked) .option-letter { background: var(--blue); color: white; }
.option-content { min-width: 0; color: #304b62; font-size: 14px; line-height: 1.4; }
.option-content .lesson-media, .option-content .exam-media { margin: 8px 0 0; }
.option-content img, .option-content video { max-height: 100px; }
.checkpoint-submit { width: 100%; margin-top: auto; }
.fill-input { width: 100%; height: 58px; padding: 0 17px; border: 1px solid var(--line); border-radius: 14px; outline: 0; font-size: 17px; }
.interactive-box { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #f8fbfd; }
.interactive-instruction { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.tile-bank, .sequence-output, .task-options { display: flex; flex-wrap: wrap; gap: 8px; min-height: 41px; }
.task-tile, .task-option, .ordered-tile { min-height: 40px; padding: 0 13px; border: 1px solid #c7d6e1; border-radius: 11px; background: white; color: var(--ink); cursor: pointer; }
.task-tile:disabled { opacity: .35; }
.task-option.is-selected { border-color: var(--blue); background: #e9f4f7; }
.ordered-tile { display: inline-flex; align-items: center; border-color: #9fcfc8; background: #eaf7f4; cursor: default; }
.match-row { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 12px; }
.match-row select { height: 44px; margin: 0; }
.feedback-dialog { width: min(460px, calc(100% - 32px)); padding: 34px; border: 0; border-radius: 23px; text-align: center; color: var(--ink); box-shadow: 0 30px 100px rgba(16,42,67,.25); }
.feedback-dialog::backdrop { background: rgba(8,28,45,.55); backdrop-filter: blur(3px); }
.feedback-dialog h2 { margin: 0; font: 600 28px Georgia,serif; }
.feedback-dialog p { color: var(--muted); line-height: 1.6; }
.lesson-finish { grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; border-radius: 22px; background: white; }
.lesson-finish h1 { margin: 12px 0; font: 600 clamp(32px,5vw,54px) Georgia,serif; }
.lesson-finish p { max-width: 600px; color: var(--muted); }
.finish-check { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 18px; border-radius: 50%; color: white; background: var(--teal); font-size: 32px; }

.exam-header { grid-template-columns: minmax(0,1fr) auto; }
.exam-meta { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 12px; }
.timer { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 12px; background: #eef3f7; color: var(--navy); }
.timer i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(27,153,139,.12); }
.timer.is-low { color: var(--red); background: #fbecec; }
.timer.is-low i { background: var(--red); }
.timer b { font-variant-numeric: tabular-nums; font-size: 17px; }
.exam-stage { min-height: 0; padding: 18px; }
.question-card { height: 100%; display: grid; grid-template-columns: minmax(300px,.82fr) minmax(0,1.18fr); overflow: hidden; }
.question-prompt { overflow: auto; padding: clamp(24px,3.5vw,52px); border-right: 1px solid var(--line); background: #f8fbfd; }
.question-prompt h1 { margin: 12px 0; font: 600 clamp(25px,3vw,43px)/1.2 Georgia,serif; }
.exam-answer-form { min-height: 0; overflow: auto; display: flex; flex-direction: column; padding: clamp(22px,3vw,42px); }
.exam-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exam-option { min-height: 80px; }
.exam-submit { margin: auto 0 0 auto; min-width: 210px; }
.exam-fill { max-width: 650px; margin: auto; }
.exam-interactive { max-width: 760px; width: 100%; margin: auto; }
.loader { grid-column: 1/-1; display: flex; align-items: center; justify-content: center; gap: 13px; color: var(--muted); }
.loader i { width: 25px; height: 25px; border: 3px solid #d7e3ea; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Result */
.result-card { max-width: 760px; }
.score-orbit { position: relative; display: grid; place-items: center; width: 170px; height: 170px; margin: 30px auto; border-radius: 50%; background: conic-gradient(var(--teal) 0 75%, #e6edf2 75%); }
.score-orbit::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: white; }
.score-orbit span { position: relative; display: flex; flex-direction: column; }
.score-orbit b { font: 600 70px/.9 Georgia,serif; }
.score-orbit small { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.score-orbit.grade-2 { background: conic-gradient(var(--red) 0 40%,#e6edf2 40%); }
.score-orbit.grade-3 { background: conic-gradient(var(--amber) 0 58%,#e6edf2 58%); }
.score-orbit.grade-5 { background: conic-gradient(var(--teal) 0 100%,#e6edf2 100%); }
.result-stats { display: grid; grid-template-columns: repeat(3,1fr); margin: 28px 0; border: 1px solid var(--line); border-radius: 17px; }
.result-stats div { display: flex; flex-direction: column; gap: 4px; padding: 20px 10px; border-right: 1px solid var(--line); }
.result-stats div:last-child { border: 0; }
.result-stats b { font-size: 25px; }
.result-stats span { color: var(--muted); font-size: 11px; }

/* Mandatory guards */
.network-guard, .rotate-guard { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: #0d2e4e; color: white; text-align: center; }
.network-guard { z-index: 10010; }
.network-card { max-width: 490px; }
.network-card h2, .rotate-guard h2 { margin: 18px 0 8px; font: 600 32px Georgia,serif; }
.network-card p, .rotate-guard p { margin: 0; color: #c4d8e7; line-height: 1.6; }
.network-icon { display: grid; place-items: center; width: 70px; height: 70px; margin: auto; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; font-size: 38px; }
.rotate-guard { align-content: center; }
.rotate-phone { width: 55px; height: 90px; margin: auto; padding: 6px; border: 3px solid white; border-radius: 10px; animation: rotatePhone 1.8s ease-in-out infinite; }
.rotate-phone span { display: block; width: 100%; height: 100%; border-radius: 5px; background: rgba(255,255,255,.13); }
@keyframes rotatePhone { 0%,25% { transform: rotate(0); } 70%,100% { transform: rotate(90deg); } }

@media (max-width: 850px) {
  .site-header, .page-shell { width: min(100% - 26px, 720px); }
  .site-header { height: 72px; }
  .hero-grid { min-height: auto; grid-template-columns: 1fr; gap: 36px; padding: 36px 0; }
  .hero-copy { text-align: center; }
  .hero-copy h1 { font-size: clamp(39px,10vw,60px); }
  .hero-copy > p { margin-inline: auto; font-size: 16px; }
  .hero-points { display: none; }
  .entry-card { width: min(100%,560px); min-height: 500px; margin: auto; padding: 25px; }
  .student-banner { padding: 30px; min-height: 180px; }
  .avatar { width: 78px; height: 78px; }
  .subject-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .topic-row { grid-template-columns: 45px 1fr; }
  .topic-action { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .brand small { display: none; }
  .page-shell { padding-top: 20px; }
  .hero-copy h1 { font-size: 41px; }
  .hero-copy > p { font-size: 14px; }
  .choice-pair button { min-height: 125px; }
  .student-banner { align-items: flex-start; padding: 25px; }
  .student-banner h1 { font-size: 31px; }
  .student-banner p { font-size: 13px; }
  .avatar { width: 60px; height: 60px; font-size: 20px; }
  .subject-card { grid-template-columns: 50px 1fr auto; gap: 13px; padding: 19px; }
  .subject-icon { width: 48px; height: 48px; }
  .subject-heading { align-items: flex-start; }
  .subject-icon.large { width: 60px; height: 60px; border-radius: 18px; font-size: 28px; }
  .topic-row { padding: 19px 15px; gap: 11px; }
  .result-stats { grid-template-columns: 1fr; }
  .result-stats div { border-right: 0; border-bottom: 1px solid var(--line); }
  .pwa-install-dock {
    right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100vw - 20px); grid-template-columns: minmax(0,1fr) auto auto; gap: 9px; padding: 10px;
  }
  .pwa-install-app img { width: 42px; height: 42px; border-radius: 12px; }
  .pwa-install-app small { max-width: 135px; }
  .pwa-install-button { min-height: 40px; padding: 0 12px; font-size: 12px; }
  .pwa-install-dialog { padding: 32px 24px 25px; border-radius: 23px; }
  .pwa-dialog-logo { width: 62px; height: 62px; border-radius: 17px; }
  .pwa-install-dialog h2 { font-size: 27px; }
}

/* Small landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
  .learning-shell { grid-template-rows: 58px 1fr; }
  .focus-header { padding: 0 18px; }
  .focus-back { width: 34px; height: 34px; }
  .lesson-stage, .exam-stage { padding: 10px; gap: 10px; }
  .lesson-stage { grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); }
  .block-content, .checkpoint-card { border-radius: 16px; padding: 19px; }
  .block-content h1 { margin: 7px 0 13px; font-size: 27px; }
  .block-body { font-size: 14px; line-height: 1.52; }
  .lesson-media { margin-top: 13px; }
  .lesson-media img, .lesson-media video { max-height: 34vh; }
  .checkpoint-card h2 { margin: 6px 0 12px; font-size: 21px; }
  .answer-list { gap: 6px; }
  .answer-option { min-height: 45px; padding: 5px 9px; }
  .option-letter { width: 29px; height: 29px; }
  .primary-button { min-height: 42px; }
  .question-card { grid-template-columns: minmax(260px,.82fr) minmax(0,1.18fr); border-radius: 15px; }
  .question-prompt, .exam-answer-form { padding: 18px; }
  .question-prompt h1 { font-size: 24px; }
  .exam-answer-grid { gap: 7px; }
  .exam-option { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
