:root {
  --ink: #17203c;
  --muted: #68728e;
  --paper: rgba(255, 255, 255, .94);
  --purple: #5147c7;
  --purple-dark: #302a91;
  --purple-pale: #efedff;
  --cyan: #25b9cf;
  --green: #0aa36c;
  --green-pale: #e8fff6;
  --red: #e5485e;
  --red-pale: #fff0f2;
  --gold: #ffbd36;
  --line: #dfe3ee;
  --shadow: 0 22px 60px rgba(39, 45, 88, .14);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #f6f7fd;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: linear-gradient(150deg, #fafbff, #f2f0ff 50%, #edfbfc); }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.ambient span { position: absolute; border-radius: 999px; opacity: .3; filter: blur(2px); animation: float 10s ease-in-out infinite alternate; }
.ambient span:nth-child(1) { width: 24rem; height: 24rem; top: -12rem; right: -7rem; background: #ac9cff; }
.ambient span:nth-child(2) { width: 18rem; height: 18rem; left: -9rem; top: 45%; background: #59d9de; animation-delay: -3s; }
.ambient span:nth-child(3) { width: 8rem; height: 8rem; left: 58%; bottom: -4rem; background: #ffd162; animation-delay: -7s; }
@keyframes float { to { transform: translate3d(1.5rem, -1rem, 0) scale(1.05); } }

.site-header { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; min-height: 5.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.public-header { position: relative; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: .9rem; color: #fff; font: 800 1.6rem/1 Georgia, serif; background: linear-gradient(145deg, var(--purple), var(--cyan)); box-shadow: 0 8px 24px rgba(74, 66, 187, .25); }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.02em; }
.brand small { margin-top: .1rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .15em; }
.nav-toggle { display: none; min-height: 2.6rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: .7rem; color: var(--purple-dark); background: rgba(255,255,255,.85); cursor: pointer; font-weight: 850; }
.site-nav { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.site-nav a { padding: .6rem .72rem; border-radius: .65rem; color: var(--muted); text-decoration: none; font-size: .86rem; font-weight: 800; }
.site-nav a:hover, .site-nav a.active { color: var(--purple-dark); background: var(--purple-pale); }
.text-button { padding: .6rem .8rem; border: 0; border-radius: .7rem; color: var(--purple-dark); background: transparent; cursor: pointer; font-weight: 800; }
.text-button:hover { background: var(--purple-pale); }

.page-shell { width: min(1180px, calc(100% - 2rem)); min-height: calc(100vh - 9rem); margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) 0 5rem; }

/* Homepage: visual wayfinding, scoped so lesson and test layouts stay unchanged. */
.home-body { background: radial-gradient(circle at 8% 10%, #e4eeff 0, transparent 31rem), radial-gradient(circle at 95% 78%, #dcf6f4 0, transparent 30rem), #f5f8fc; }
.home-header { width: min(1240px, calc(100% - 2.5rem)); min-height: 5.3rem; }
.home-header .brand-mark { width: 3rem; height: 3rem; border-radius: .95rem; background: linear-gradient(145deg, #103765, #216abc); box-shadow: 0 9px 18px rgba(18, 64, 117, .18); }
.home-header .brand strong { color: #122a48; font-size: .96rem; }
.home-header .brand small { color: #5a7791; }
.home-header .site-nav { gap: .25rem; }
.home-header .site-nav a { display: inline-flex; align-items: center; min-height: 2.8rem; padding: .65rem 1rem; border-radius: .8rem; color: #31506c; font-size: .9rem; }
.home-header .site-nav a:hover, .home-header .site-nav a:focus-visible { color: #123c72; background: #e5f0fc; }
.home-page { width: min(1240px, calc(100% - 2.5rem)); min-height: calc(100vh - 9rem); padding: .9rem 0 4rem; }
.home-hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 25rem; overflow: hidden; border: 1px solid #1c4771; border-radius: 1.8rem; background: #081b39; box-shadow: 0 28px 65px rgba(13, 43, 80, .2); }
.home-hero::after { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(90deg, #081b39 0%, #081b39 31%, rgba(8, 27, 57, .86) 48%, rgba(8, 27, 57, .06) 100%); }
.home-hero-copy { position: relative; z-index: 1; width: min(100%, 39rem); padding: clamp(2rem, 3vw, 3rem); }
.home-kicker { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1.25rem; padding: .44rem .75rem; border: 1px solid rgba(128, 200, 242, .35); border-radius: 999px; color: #c5e7fd; background: rgba(21, 72, 115, .42); font-size: .72rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.home-kicker span { width: .48rem; height: .48rem; border-radius: 50%; background: #6ce6d8; box-shadow: 0 0 0 4px rgba(108, 230, 216, .16); }
.home-hero h1 { color: #fff; font-size: clamp(3rem, 6.2vw, 5.3rem); line-height: .99; letter-spacing: -.064em; }
.home-hero h1 em { color: #8cddf5; font-style: normal; }
.home-intro { max-width: 31rem; margin: 1.25rem 0 0; color: #d8e8f5; font-size: clamp(.98rem, 1.65vw, 1.15rem); line-height: 1.5; }
.home-hero-art { position: absolute; inset: 0 0 0 auto; z-index: -2; width: 69%; background: url('/assets/physics-hero-2026.jpg') center center / cover no-repeat; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.75rem; }
.home-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.45rem; padding: .8rem 1.05rem; border: 1px solid transparent; border-radius: .8rem; font-size: .94rem; font-weight: 850; text-decoration: none; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.home-button:hover { transform: translateY(-3px); }
.home-button:active { transform: translateY(0); }
.home-button span { font-size: 1.2rem; font-weight: 500; }
.home-button-primary { min-width: 11.5rem; color: #092743; background: #9ce7f2; box-shadow: 0 12px 25px rgba(33, 192, 214, .18); }
.home-button-primary:hover { background: #c1f4f8; }
.home-button-outline { min-width: 8rem; border-color: rgba(195, 226, 247, .53); color: #fff; background: rgba(12, 45, 82, .62); }
.home-button-outline:hover { background: rgba(35, 87, 132, .82); }
.home-destinations { margin-top: 2.15rem; }
.home-section-heading { margin-bottom: 1rem; }
.home-section-heading .eyebrow { margin: 0 0 .35rem; color: #2e718f; font-size: .7rem; }
.home-section-heading h2 { margin: 0; color: #102a49; font-size: clamp(1.55rem, 2.5vw, 2rem); letter-spacing: -.045em; }
.home-route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.home-route { position: relative; display: flex; align-items: center; gap: 1rem; min-height: 9.5rem; padding: 1.25rem; border: 1px solid #d9e5f0; border-radius: 1.25rem; color: #102a49; background: rgba(255,255,255,.93); box-shadow: 0 13px 35px rgba(20, 61, 102, .08); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.home-route:hover { transform: translateY(-5px); border-color: #77b6d6; box-shadow: 0 20px 38px rgba(20, 61, 102, .14); }
.home-route-icon { display: grid; place-items: center; flex: 0 0 auto; width: 4.5rem; height: 4.5rem; border-radius: 1.15rem; }
.home-route-icon svg { width: 2.55rem; height: 2.55rem; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.home-route-learn .home-route-icon { color: #2255a4; background: #e3eeff; }
.home-route-tests .home-route-icon { color: #087d82; background: #dff8f4; }
.home-route-resources .home-route-icon { color: #a45f13; background: #fff0d7; }
.home-route-copy { display: grid; gap: .25rem; min-width: 0; }
.home-route-copy strong { font-size: 1.37rem; letter-spacing: -.035em; }
.home-route-copy small { color: #5b7089; font-size: .81rem; line-height: 1.35; }
.home-route-arrow { align-self: flex-start; margin-left: auto; color: #326583; font-size: 1.4rem; line-height: 1; }
.home-body footer { width: min(1240px, calc(100% - 2.5rem)); padding: 1rem 0 1.7rem; border-top: 1px solid #dce6ee; }
.home-body footer a:hover { color: #145b9c; text-decoration: underline; }
.home-body a:focus-visible, .home-body button:focus-visible { outline: 3px solid #00a9cc; outline-offset: 3px; }

@media (max-width: 950px) {
  .home-route-grid { gap: .7rem; }
  .home-route { flex-wrap: wrap; align-content: center; min-height: 10.5rem; }
  .home-route-copy { flex: 1 1 10rem; }
}

@media (max-width: 700px) {
  .home-header, .home-page, .home-body footer { width: min(100% - 1.4rem, 1240px); }
  .home-page { padding-top: .4rem; }
  .home-hero { min-height: 26rem; border-radius: 1.35rem; }
  .home-hero::after { background: linear-gradient(90deg, rgba(8,27,57,.98), rgba(8,27,57,.74) 68%, rgba(8,27,57,.52)); }
  .home-hero-art { width: 100%; opacity: .73; background-position: 56% center; }
  .home-hero-copy { padding: 2rem 1.4rem; }
  .home-hero h1 { font-size: clamp(2.9rem, 11vw, 4.3rem); }
  .home-intro { max-width: 25rem; }
  .home-route-grid { grid-template-columns: 1fr; }
  .home-route { flex-wrap: nowrap; min-height: 7.25rem; }
  .home-destinations { margin-top: 1.7rem; }
}

@media (max-width: 430px) {
  .home-header .brand strong { font-size: .84rem; }
  .home-header .brand-mark { width: 2.65rem; height: 2.65rem; }
  .home-header .nav-toggle { min-height: 2.85rem; padding: .6rem .75rem; }
  .home-hero { min-height: 0; }
  .home-hero-copy { padding: 1.8rem 1.2rem; }
  .home-kicker { font-size: .62rem; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .home-button { width: 100%; min-width: 0; }
  .home-route-icon { width: 3.7rem; height: 3.7rem; }
  .home-route-icon svg { width: 2.15rem; height: 2.15rem; }
  .home-route-copy strong { font-size: 1.2rem; }
  .home-body footer { align-items: flex-start; flex-direction: column; gap: .5rem; }
}
.hero { max-width: 780px; }
.eyebrow { margin: 0 0 .55rem; color: var(--purple); font-size: .73rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2.7rem, 7vw, 6rem); line-height: .98; letter-spacing: -.06em; }
h1 span { color: var(--purple); }
.hero > p:last-child { max-width: 64ch; margin: 1.25rem 0 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.17rem); line-height: 1.65; }
.notice { margin: 2rem 0; padding: 1rem 1.1rem; color: var(--muted); background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 1rem; }
.notice.error { color: #a9283e; background: var(--red-pale); }

/* Learning presentation shell */
.lesson-header { max-width: 900px; margin-bottom: 1.7rem; }
.lesson-header h1 { font-size: clamp(2.4rem, 6vw, 4.7rem); }
.lesson-header > p:last-child { max-width: 68ch; margin: .9rem 0 0; color: var(--muted); font-size: 1.04rem; line-height: 1.6; }
.lesson-goal strong { display: inline-block; margin-right: .4rem; color: var(--purple-dark); }
.back-link { display: inline-flex; margin-bottom: 1.5rem; color: var(--purple-dark); font-size: .84rem; font-weight: 850; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.lesson-content { display: grid; gap: 1.25rem; }
.lesson-intro, .lesson-resource, .lesson-next { padding: clamp(1.15rem, 3vw, 2rem); border: 1px solid rgba(255,255,255,.9); border-radius: 1.3rem; background: var(--paper); box-shadow: var(--shadow); }
.lesson-lead, .lesson-resource > p:not(.eyebrow) { max-width: 70ch; margin: 0; color: var(--muted); line-height: 1.65; }
.lesson-prerequisite { margin: 0 0 1.2rem; color: var(--ink); line-height: 1.55; }
.lesson-position { margin: -.3rem 0 .8rem; color: var(--muted); font-size: .82rem; font-weight: 750; }
.lesson-progress { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.lesson-step { display: grid; align-content: center; gap: .3rem; min-height: 5.5rem; padding: 1rem 1.2rem; border: 1px solid #d4d0f7; border-radius: 1rem; color: var(--purple-dark); background: #fff; text-decoration: none; box-shadow: 0 8px 22px rgba(39,45,88,.08); }
.lesson-step:hover { border-color: var(--purple); background: var(--purple-pale); }
.lesson-step small { color: var(--muted); font-size: .76rem; font-weight: 850; }
.lesson-step strong { font-size: .92rem; line-height: 1.35; }
.lesson-step-next { grid-column: 2; }
.lesson-assessment { padding: clamp(1.15rem, 3vw, 2rem); border: 1px solid #c8e8ea; border-radius: 1.3rem; background: linear-gradient(135deg, #f5fffd, #f2f7ff); box-shadow: var(--shadow); }
.lesson-assessment h2 { margin: 0 0 1rem; font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -.035em; }
.lesson-assessment-links { display: flex; flex-wrap: wrap; gap: .65rem; }
.lesson-resource h2 { margin: .18rem 0 .8rem; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.035em; }
.lesson-frame { width: 100%; min-height: 35rem; margin: 1.1rem 0; border: 1px solid #d8dced; border-radius: 1rem; background: #fff; }
.lesson-presentation-frame { height: min(78vh, 58rem); min-height: 44rem; }
.lesson-open-link { min-height: 3.5rem; margin-top: 1rem; }
.lesson-page a:focus-visible { outline: 3px solid #0a9aca; outline-offset: 3px; }
.link-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.resource-list { display: grid; gap: .65rem; }
.resource-row { display: block; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .8rem; color: var(--ink); text-decoration: none; background: #fbfcff; }
.resource-row:hover { border-color: #9b94e2; background: #f5f3ff; }
.resource-row strong, .resource-row span { display: block; }
.resource-row span { margin-top: .25rem; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.lesson-next { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--purple-dark); font-weight: 850; }

/* Course catalogue */
.content-page { max-width: 1180px; }
.course-hero { display: flex; align-items: flex-start; gap: 1.15rem; margin-bottom: clamp(1.8rem, 4vw, 3.2rem); }
.course-hero-code { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; flex: 0 0 auto; border: 1px solid #d8d5fb; border-radius: 1.2rem; color: var(--purple-dark); background: var(--purple-pale); font-size: 1.2rem; font-weight: 950; letter-spacing: .08em; }
.course-hero h1 { font-size: clamp(2.45rem, 6vw, 4.6rem); }
.course-hero p:last-child { max-width: 66ch; margin: .7rem 0 0; color: var(--muted); line-height: 1.6; }
.topic-stack { display: grid; gap: 1.4rem; }
.chapter-catalogue, .course-guide-links { padding: clamp(1.15rem, 3vw, 2rem); border: 1px solid rgba(255,255,255,.92); border-radius: 1.35rem; background: var(--paper); box-shadow: var(--shadow); }
.catalogue-introduction { display: grid; gap: .25rem; max-width: 74ch; margin-bottom: 1.25rem; }
.catalogue-introduction h2, .course-guide-links h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.04em; }
.catalogue-introduction > p:last-child { margin: .35rem 0 0; color: var(--muted); line-height: 1.55; }
.chapter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.chapter-card { display: flex; min-height: 15.8rem; flex-direction: column; padding: 1.15rem; border: 1px solid var(--line); border-radius: 1rem; background: #fbfcff; }
.chapter-card-available { border-color: #c9c4fb; background: linear-gradient(145deg, #ffffff, #f5f3ff); box-shadow: 0 10px 25px rgba(81,71,199,.08); }
.chapter-card-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.chapter-label { color: var(--purple-dark); font-size: .69rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.chapter-status { padding: .28rem .5rem; border-radius: 999px; color: #68728e; background: #edf0f7; font-size: .66rem; font-weight: 900; letter-spacing: .04em; white-space: nowrap; }
.chapter-status.available { color: #087a52; background: var(--green-pale); }
.chapter-card h2 { margin: .9rem 0 .45rem; font-size: clamp(1.12rem, 2.2vw, 1.4rem); letter-spacing: -.03em; }
.chapter-card > p { margin: 0; color: var(--muted); font-size: .89rem; line-height: 1.52; }
.chapter-open-link, .chapter-coming-note { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; padding: .75rem .8rem; border-radius: .75rem; }
.chapter-open-link { border: 1px solid #cbc6f9; color: var(--purple-dark); background: #fff; text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.chapter-open-link:hover { border-color: var(--purple); background: var(--purple-pale); transform: translateY(-2px); }
.chapter-open-link span, .chapter-open-link small, .chapter-coming-note strong, .chapter-coming-note small { display: block; }
.chapter-open-link strong { font-size: .86rem; }
.chapter-open-link small, .chapter-coming-note small { margin-top: .15rem; color: var(--muted); font-size: .73rem; line-height: 1.35; }
.chapter-open-link b { flex: 0 0 auto; }
.chapter-coming-note { align-items: flex-start; flex-direction: column; color: var(--muted); background: #f2f4f8; }
.chapter-coming-note strong { color: #56607c; font-size: .8rem; }
.course-guide-links { display: grid; gap: .75rem; }
.lesson-links { display: grid; gap: .65rem; }
.lesson-link { display: flex; align-items: center; justify-content: space-between; gap: .85rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .85rem; color: var(--ink); background: #fbfcff; text-decoration: none; }
.lesson-link:hover { border-color: #9b94e2; background: #f5f3ff; }
.lesson-link strong, .lesson-link small { display: block; }
.lesson-link small { margin-top: .22rem; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.lesson-link b { flex: 0 0 auto; color: var(--purple); font-size: .78rem; }
.chapter-lesson-nav { padding: 1.1rem; border: 1px solid #dedcf7; border-radius: 1rem; background: #f8f7ff; }
.chapter-lesson-nav .eyebrow { margin-bottom: .7rem; }
.chapter-lesson-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.chapter-lesson-link { padding: .55rem .7rem; border: 1px solid #d4d0f7; border-radius: .65rem; color: var(--purple-dark); background: #fff; font-size: .8rem; font-weight: 800; line-height: 1.25; text-decoration: none; }
.chapter-lesson-link:hover, .chapter-lesson-link[aria-current='page'] { border-color: var(--purple); color: #fff; background: var(--purple); }

.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2.2rem; }
.test-course-switcher { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.test-course-switcher a { display: inline-flex; align-items: center; justify-content: space-between; gap: 2rem; min-width: 10rem; min-height: 3.25rem; padding: .72rem 1rem; border: 1px solid #c5c4ee; border-radius: .85rem; color: var(--purple-dark); background: #fff; box-shadow: 0 9px 23px rgba(39,45,88,.08); font-weight: 850; text-decoration: none; }
.test-course-switcher a:hover { border-color: var(--purple); background: var(--purple-pale); }
.test-course-switcher a span { font-size: 1.15rem; }
.course-card, .topic { scroll-margin-top: 1rem; }
.course-card { overflow: hidden; background: var(--paper); border: 1px solid rgba(255,255,255,.9); border-radius: 1.5rem; box-shadow: var(--shadow); }
.course-heading { display: flex; align-items: center; gap: 1rem; padding: 1.3rem 1.4rem; color: #fff; background: linear-gradient(135deg, var(--purple-dark), var(--purple) 65%, #7970eb); }
.course-heading.cyan { background: linear-gradient(135deg, #086e86, #159bb5 65%, #2fc3cf); }
.course-code { display: grid; place-items: center; width: 3.7rem; height: 3.7rem; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.32); border-radius: 1rem; background: rgba(255,255,255,.13); font-weight: 950; font-size: 1.25rem; }
.course-heading h2 { margin: 0 0 .15rem; font-size: 1.35rem; }
.course-heading p { margin: 0; color: rgba(255,255,255,.77); font-size: .88rem; }
.topic-list { padding: .65rem; }
.topic { border-bottom: 1px solid var(--line); }
.topic:last-child { border-bottom: 0; }
.topic summary { position: relative; cursor: pointer; list-style: none; padding: 1rem 2.2rem 1rem .8rem; }
.topic summary::-webkit-details-marker { display: none; }
.topic summary::after { content: '+'; position: absolute; right: .8rem; top: 50%; translate: 0 -50%; color: var(--purple); font-size: 1.4rem; font-weight: 500; }
.topic[open] summary::after { content: '−'; }
.topic-unit { display: block; margin-bottom: .25rem; color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.topic-name { font-weight: 850; }
.test-list { display: grid; gap: .55rem; padding: 0 .55rem .9rem; }
.topic-study-link { display: grid; gap: .2rem; padding: .85rem .9rem; border: 1px solid #b7e4e2; border-radius: .85rem; color: #0a605b; background: #ecfbf8; text-decoration: none; }
.topic-study-link:hover { border-color: #58b7ad; background: #ddf6f0; }
.topic-study-link strong { font-size: .85rem; }
.topic-study-link span { font-size: .77rem; line-height: 1.35; }
.test-button { display: flex; align-items: center; justify-content: space-between; gap: .7rem; width: 100%; padding: .8rem .9rem; border: 1px solid #dedcf7; border-radius: .85rem; color: var(--ink); background: #f8f7ff; cursor: pointer; text-align: left; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.test-button:hover { transform: translateY(-2px); border-color: #9b94e2; background: #f1efff; }
.test-button strong { font-size: .91rem; }
.test-button span { flex: 0 0 auto; color: var(--muted); font-size: .75rem; font-weight: 750; }
.empty-course { padding: 1.5rem; color: var(--muted); text-align: center; }

.login-dialog { width: min(31rem, calc(100% - 1.5rem)); padding: 0; border: 0; border-radius: 1.5rem; color: var(--ink); background: #fff; box-shadow: 0 30px 100px rgba(20,24,57,.3); }
.login-dialog::backdrop { background: rgba(28,29,56,.58); backdrop-filter: blur(6px); }
.login-dialog form { position: relative; padding: clamp(1.4rem, 5vw, 2.3rem); }
.login-dialog h2 { margin: 0; font-size: 1.8rem; letter-spacing: -.035em; }
.login-study-link { display: block; margin: .9rem 0 .2rem; padding: .85rem; border: 1px solid #b7e4e2; border-radius: .8rem; color: #0a605b; background: #ecfbf8; font-size: .82rem; font-weight: 850; line-height: 1.35; text-decoration: none; }
.login-study-link:hover { border-color: #58b7ad; background: #ddf6f0; }
.login-dialog label { display: grid; gap: .38rem; margin-top: 1rem; font-size: .8rem; font-weight: 850; }
input, textarea, select { width: 100%; color: var(--ink); background: #fbfcff; border: 1.5px solid #d9deeb; border-radius: .8rem; outline: 0; }
input, select { min-height: 3rem; padding: .65rem .8rem; }
textarea { min-height: 11rem; padding: .8rem; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(81,71,199,.12); }
.dialog-close { position: absolute; top: 1rem; right: 1rem; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; color: var(--muted); background: #f1f3f8; cursor: pointer; font-size: 1.3rem; }
.form-error { min-height: 1.3rem; margin: .8rem 0 0; color: #bb2f44; font-size: .83rem; font-weight: 750; white-space: pre-line; }
.privacy-note { margin: .8rem 0 0; color: var(--muted); font-size: .72rem; line-height: 1.45; text-align: center; }

.button { min-height: 2.85rem; padding: .65rem 1rem; border: 0; border-radius: .82rem; cursor: pointer; font-weight: 900; transition: transform .14s ease, filter .14s ease; }
.button:hover { transform: translateY(-2px); filter: saturate(1.1); }
.button:active { transform: translateY(0) scale(.985); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--purple), #7065df); box-shadow: 0 10px 22px rgba(76,67,187,.24); }
.button.secondary { color: var(--purple-dark); background: var(--purple-pale); }
.button.danger { color: #b1273d; background: var(--red-pale); }
.button.full { width: 100%; margin-top: .8rem; }

.quiz-shell { position: relative; width: min(1180px, calc(100% - 2rem)); min-height: calc(100vh - 7rem); margin: 0 auto; padding: 1rem 0 3rem; }
.quiz-topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.quiz-topbar h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.2rem); letter-spacing: -.04em; }
.quiz-topbar p { margin-bottom: 0; }
.score-strip { display: grid; grid-template-columns: repeat(3, minmax(5.7rem, 1fr)); gap: .55rem; }
.score-strip > div { padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .8rem; background: rgba(255,255,255,.8); }
.score-strip span, .score-strip strong { display: block; }
.score-strip span { color: var(--muted); font-size: .64rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.score-strip strong { margin-top: .1rem; font-size: 1.15rem; }
.score-strip .good strong { color: var(--green); }
.score-strip .bad strong { color: var(--red); }
.progress-track { height: .48rem; overflow: hidden; background: #dfe2ef; border-radius: 999px; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), var(--cyan)); border-radius: inherit; transition: width .35s ease; }
.question-panel { display: grid; place-content: center; min-height: clamp(13rem, 31vh, 22rem); margin: 1rem 0; padding: clamp(1.4rem, 4vw, 3.5rem); text-align: center; background: var(--paper); border: 1px solid #fff; border-radius: 1.5rem; box-shadow: var(--shadow); }
.question-label { margin: 0 0 .7rem; color: var(--purple); font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.question-panel h3 { max-width: 34ch; margin: 0 auto; font-size: clamp(1.55rem, 4vw, 3.5rem); line-height: 1.12; letter-spacing: -.04em; text-wrap: balance; }
.question-panel h3.image-instruction { margin-bottom: .8rem; font-size: clamp(1rem, 2vw, 1.3rem); color: var(--muted); }
.question-image { display: block; width: min(100%, 1000px); max-height: 67vh; margin: 0 auto; object-fit: contain; border-radius: .75rem; }
.mistake-image { display: block; width: min(100%, 760px); max-height: 34rem; margin: .65rem 0; object-fit: contain; border: 1px solid var(--line); border-radius: .7rem; }
.mistake-card .explanation { color: var(--ink); font-weight: 650; }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.answer-button { position: relative; display: flex; align-items: center; gap: 1rem; min-height: 5.2rem; padding: .85rem 1rem; border: 2px solid transparent; border-radius: 1.1rem; color: var(--ink); background: rgba(255,255,255,.9); box-shadow: 0 9px 25px rgba(35,41,79,.08); cursor: pointer; text-align: left; font-weight: 780; transition: transform .14s ease, border-color .14s ease, background .14s ease; }
.answer-button:hover:not(:disabled) { transform: translateY(-3px); border-color: #a9a3e8; }
.answer-letter { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; flex: 0 0 auto; border-radius: .8rem; color: var(--purple-dark); background: var(--purple-pale); font-size: 1.05rem; font-weight: 950; }
.answer-button.selected-wrong { border-color: var(--red); background: var(--red-pale); }
.answer-button.selected-wrong .answer-letter { color: #fff; background: var(--red); }
.answer-button.correct-answer { border-color: var(--green); background: var(--green-pale); }
.answer-button.correct-answer .answer-letter { color: #fff; background: var(--green); }
.answer-button:disabled { cursor: default; opacity: .62; }
.answer-button.correct-answer, .answer-button.selected-wrong { opacity: 1; }
.keyboard-hint { margin: .75rem 0 0; color: var(--muted); font-size: .74rem; text-align: center; }

.feedback-layer { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 1rem; background: rgba(31,32,65,.42); backdrop-filter: blur(4px); }
.feedback-card { width: min(36rem, 100%); padding: clamp(1.5rem, 5vw, 3rem); color: #fff; text-align: center; border-radius: 1.8rem; box-shadow: 0 30px 100px rgba(20,20,50,.35); animation: feedback-in .3s cubic-bezier(.18,.89,.32,1.28); }
.feedback-card.correct { background: linear-gradient(145deg, #087a57, #16b57d); }
.feedback-card.incorrect { background: linear-gradient(145deg, #c72e4a, #ed5a4c); }
@keyframes feedback-in { from { opacity: 0; transform: scale(.78) rotate(-2deg); } }
#feedback-word { margin: 0; font-size: clamp(3rem, 10vw, 6.7rem); font-weight: 950; line-height: .95; letter-spacing: -.07em; }
#feedback-detail { min-height: 2.7em; margin: 1rem 0; color: rgba(255,255,255,.9); font-weight: 720; line-height: 1.4; }
.feedback-card .button { background: rgba(255,255,255,.92); }
.feedback-timer { height: .35rem; margin: 1rem 0; overflow: hidden; background: rgba(255,255,255,.25); border-radius: 999px; }
.feedback-timer span { display: block; width: 100%; height: 100%; background: #fff; transform-origin: left; animation: shrink var(--feedback-time, 5s) linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }

.result-shell { display: grid; align-content: center; gap: 1.5rem; }
.result-hero { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(1.5rem, 5vw, 4rem); padding: clamp(1.5rem, 5vw, 3.5rem); background: var(--paper); border-radius: 1.7rem; box-shadow: var(--shadow); }
.result-ring { display: grid; place-content: center; width: clamp(9rem, 20vw, 14rem); aspect-ratio: 1; border-radius: 50%; text-align: center; background: conic-gradient(var(--purple) var(--score-angle, 0deg), #e5e5f1 0); position: relative; }
.result-ring::before { content: ''; position: absolute; inset: .72rem; border-radius: 50%; background: #fff; }
.result-ring strong, .result-ring span { position: relative; display: block; }
.result-ring strong { font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -.05em; }
.result-ring span { color: var(--muted); font-size: .72rem; font-weight: 850; text-transform: uppercase; }
.result-hero h1 { font-size: clamp(2.4rem, 6vw, 5rem); }
.result-summary { color: var(--muted); font-size: 1.05rem; line-height: 1.55; }
.mistake-section { padding: clamp(1.2rem, 4vw, 2rem); background: var(--paper); border-radius: 1.5rem; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin: 0; letter-spacing: -.03em; }
.count-badge { display: grid; place-items: center; min-width: 2.2rem; height: 2.2rem; padding: 0 .5rem; color: #b62f45; background: var(--red-pale); border-radius: 999px; font-weight: 900; }
.mistake-list { display: grid; gap: .8rem; margin-top: 1rem; }
.mistake-card { padding: 1rem; border: 1px solid var(--line); border-left: .35rem solid var(--red); border-radius: .9rem; background: #fff; }
.mistake-card h3 { margin: 0 0 .75rem; font-size: 1rem; line-height: 1.45; }
.mistake-card p { margin: .3rem 0; color: var(--muted); font-size: .86rem; }
.mistake-card .wrong { color: #b22d42; }
.mistake-card .right { color: #087b55; }

footer { width: min(1180px, calc(100% - 2rem)); min-height: 3.5rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .76rem; }
footer a { font-weight: 800; text-decoration: none; }

/* Teacher area */
.admin-body { background: #f4f5fa; }
.admin-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; padding: 1.4rem 1rem; color: #fff; background: #24204f; }
.admin-sidebar .brand { color: #fff; margin-bottom: 2rem; }
.admin-sidebar .brand small { color: #aaa7d1; }
.admin-nav { display: grid; gap: .35rem; }
.admin-nav button { width: 100%; padding: .75rem .8rem; border: 0; border-radius: .7rem; color: #c9c7e8; background: transparent; cursor: pointer; text-align: left; font-weight: 800; }
.admin-nav button:hover, .admin-nav button.active { color: #fff; background: rgba(255,255,255,.12); }
.admin-nav .logout { margin-top: 2rem; color: #ffb8c2; }
.admin-main { min-width: 0; padding: clamp(1.2rem, 4vw, 3rem); }
.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.admin-heading h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.admin-panel { padding: 1.2rem; background: #fff; border: 1px solid #e1e3ec; border-radius: 1.1rem; box-shadow: 0 12px 35px rgba(35,38,69,.07); }
.spaced-panel { margin-top: 1rem; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat-card { padding: 1rem; background: #fff; border: 1px solid #e1e3ec; border-radius: 1rem; }
.stat-card span { display: block; color: var(--muted); font-size: .69rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: .2rem; font-size: 1.8rem; letter-spacing: -.04em; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
.field { display: grid; gap: .35rem; color: #4f5872; font-size: .75rem; font-weight: 850; }
.field.full { grid-column: 1 / -1; }
.format-note { padding: .7rem; border-radius: .7rem; color: #56537b; background: #f2f0ff; font: 700 .74rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: .72rem .65rem; border-bottom: 1px solid #e7e9f0; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .65rem; letter-spacing: .07em; text-transform: uppercase; }
td strong { display: block; }
.pill { display: inline-flex; padding: .25rem .5rem; border-radius: 999px; color: #087b55; background: var(--green-pale); font-size: .69rem; font-weight: 850; }
.pill.closed { color: #8a5360; background: #f2edf0; }
.mini-button { padding: .35rem .55rem; border: 0; border-radius: .5rem; color: var(--purple-dark); background: var(--purple-pale); cursor: pointer; font-size: .7rem; font-weight: 850; }
.mini-button.danger { color: #b1273d; background: var(--red-pale); }
.toolbar { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar select { width: auto; min-width: 15rem; }
.success-message { color: #087b55; font-weight: 800; white-space: pre-line; }
.error-message { color: #b1273d; font-weight: 800; white-space: pre-line; }
.field-help { color: var(--muted); font-size: .72rem; font-weight: 650; }
.check-field { display: flex; align-items: center; gap: .55rem; margin: .75rem 0; color: #4f5872; font-size: .75rem; font-weight: 800; }
.check-field input { width: 1.1rem; min-height: 1.1rem; margin: 0; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.teacher-login { width: min(27rem, 100%); padding: 2rem; background: #fff; border-radius: 1.3rem; box-shadow: var(--shadow); }
.teacher-login h1 { font-size: 2.4rem; }

@media (max-width: 850px) {
  .course-grid, .admin-grid, .chapter-grid { grid-template-columns: 1fr; }
  .quiz-topbar { align-items: stretch; flex-direction: column; }
  .score-strip { width: 100%; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
  .admin-sidebar .brand { margin-bottom: 1rem; }
  .admin-nav { grid-template-columns: repeat(4, 1fr); }
  .admin-nav .logout { margin-top: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .test-course-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .test-course-switcher a { min-width: 0; gap: .5rem; }
  .lesson-progress { grid-template-columns: 1fr; }
  .lesson-step-next { grid-column: auto; }
  .lesson-assessment-links .button { width: 100%; }
  .lesson-presentation-frame { display: none; }
  .lesson-open-link { width: 100%; }
  .site-header { min-height: 4.5rem; }
  .site-header .brand { min-width: 0; }
  .brand strong { font-size: .9rem; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
  .site-nav { position: absolute; top: calc(100% - .2rem); right: 0; left: 0; display: none; margin: 0; padding: .55rem; flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: .9rem; background: #fff; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .75rem .85rem; }
  .page-shell { padding-top: 2.3rem; }
  .answer-grid { grid-template-columns: 1fr; }
  .question-panel { min-height: 12rem; }
  .question-panel h3 { font-size: clamp(1.4rem, 7vw, 2.2rem); }
  .answer-button { min-height: 4.2rem; }
  .result-hero { grid-template-columns: 1fr; text-align: center; }
  .result-ring { margin: 0 auto; }
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .admin-nav { grid-template-columns: repeat(2, 1fr); }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .course-hero { gap: .8rem; }
  .course-hero-code { width: 3.35rem; height: 3.35rem; border-radius: .95rem; font-size: .94rem; }
  .chapter-catalogue, .course-guide-links { padding: 1rem; }
  .chapter-card { min-height: 0; }
  .chapter-lesson-list { display: grid; }
  .chapter-lesson-link { width: 100%; }
}

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

/* Four clear student destinations: two class lists and two test lists. */
.path-page { background: radial-gradient(circle at 91% 2%, #d6edfb 0, transparent 30rem), linear-gradient(145deg, #f7fbff, #edf4fa); }
.path-shell { width: min(1020px, calc(100% - 2rem)); padding-top: 1.6rem; }
.path-jump { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: 0 0 2rem; }
.path-jump a { display: grid; place-items: center; min-height: 3.75rem; padding: .65rem .5rem; border: 1px solid #c9dbea; border-radius: .9rem; color: #173b60; background: #fff; box-shadow: 0 6px 18px rgba(18, 57, 92, .06); font-size: clamp(.9rem, 1.6vw, 1.08rem); font-weight: 850; text-align: center; text-decoration: none; }
.path-jump a:hover, .path-jump a:focus-visible { border-color: #388bc0; background: #e8f5fd; }
.path-jump a[aria-current='page'] { border-color: #126391; color: #fff; background: #126391; }
.path-hero { align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; padding: 1.8rem 2rem; border-radius: 1.3rem; color: #fff; background: linear-gradient(115deg, rgba(8, 30, 61, .98), rgba(18, 71, 112, .92)), url('/assets/physics-hero-2026.jpg') center / cover; box-shadow: 0 18px 36px rgba(11, 47, 84, .16); }
.path-hero h1, .path-hero .eyebrow { color: #fff; }
.path-hero h1 { font-size: clamp(2.25rem, 5vw, 3.65rem); }
.path-hero p:last-child, .path-hero.course-hero p:last-child { margin: .5rem 0 0; color: #dbeaf6; font-size: 1.08rem; line-height: 1.4; }
.path-hero .course-hero-code { width: 4.5rem; height: 4.5rem; border-color: rgba(255,255,255,.5); color: #fff; background: rgba(255,255,255,.14); font-size: 1.25rem; }
.simple-topic-list { overflow: hidden; border: 1px solid #cbdce9; border-radius: 1.2rem; background: #fff; box-shadow: 0 14px 35px rgba(19, 57, 92, .08); }
.simple-topic-row { display: flex; align-items: center; gap: 1.15rem; min-height: 5.15rem; padding: .8rem 1.25rem; border-bottom: 1px solid #e3edf5; color: #102e4b; text-decoration: none; }
.simple-topic-row:last-child { border-bottom: 0; }
a.simple-topic-row:hover, a.simple-topic-row:focus-visible { color: #0b6591; background: #eaf7fd; }
.simple-topic-number { display: grid; place-items: center; flex: 0 0 2.75rem; height: 2.75rem; border-radius: .7rem; color: #155e88; background: #e3f3fb; font-weight: 900; }
.simple-topic-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: clamp(1.04rem, 2.1vw, 1.3rem); line-height: 1.25; }
.simple-topic-action { flex: 0 0 auto; font-size: .9rem; font-weight: 850; }
.simple-topic-unavailable { color: #6a7d8d; background: #f7f9fb; }
.simple-topic-unavailable .simple-topic-number { color: #647887; background: #e9eef2; }
.simple-topic-unavailable .simple-topic-action { font-weight: 700; }
.path-choice-title { margin: 1.7rem 0 1.8rem; color: #0e2b4a; font-size: clamp(2.4rem, 5vw, 4.2rem); }
.path-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.path-choice-grid.three-paths { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.path-choice-grid a { display: flex; align-items: center; justify-content: space-between; min-height: 9rem; padding: 1.5rem 1.8rem; border: 1px solid #c5dcea; border-radius: 1.3rem; color: #123957; background: #fff; box-shadow: 0 15px 32px rgba(17, 60, 97, .09); font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 900; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.path-choice-grid a:hover { transform: translateY(-3px); border-color: #348dbd; }
.path-choice-grid a span { color: #157ca8; font-size: 1.4em; font-weight: 500; }
.home-path-grid a { min-height: 7.5rem; }
.home-body .home-hero { min-height: 20rem; }
.path-page .course-grid { display: block; margin-top: 1rem; }
.test-topic-panel { overflow: hidden; border: 1px solid #cbdce9; border-radius: 1.2rem; background: #fff; box-shadow: 0 14px 35px rgba(19, 57, 92, .08); }
.test-topic-panel .topic-list { padding: .3rem 1rem; }
.test-topic-panel .topic summary { min-height: 4.6rem; display: flex; align-items: center; padding: .85rem 2.7rem .85rem .7rem; }
.test-topic-panel .topic-name { color: #12334f; font-size: clamp(1.04rem, 2vw, 1.25rem); }
.test-topic-panel .topic[open] summary { color: #075f87; }
.test-topic-panel .topic summary:focus-visible { outline: 3px solid #0a9aca; outline-offset: -3px; border-radius: .5rem; }
.path-page .notice { color: #264963; }
.path-page a:focus-visible, .path-page button:focus-visible { outline: 3px solid #0a9aca; outline-offset: 3px; }
@media (max-width: 700px) {
  .path-jump { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path-jump a { min-height: 3.4rem; }
  .path-hero { padding: 1.35rem; }
  .path-choice-grid { grid-template-columns: 1fr; }
  .path-choice-grid.three-paths { grid-template-columns: 1fr; }
  .path-choice-grid a { min-height: 6.5rem; }
  .simple-topic-row { gap: .75rem; padding: .75rem; }
  .simple-topic-action { font-size: .76rem; }
}
