:root {
  color-scheme: light;
  --paper: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #62626b;
  --blue: #0066cc;
  --blue-soft: #eaf1f8;
  --navy: #263c50;
  --line: #e1e2e6;
  --green: #e0efdf;
  --green-ink: #35543c;
  --amber: #fff2d3;
  --rose: #fae9e7;
  --white: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 20px;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  background: var(--paper);
}

body.menu-open {
  overflow: hidden;
}

a {
  color: var(--blue);
  text-underline-offset: 3px;
}

button,
textarea {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
}

button:hover {
  border-color: #9eafbf;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
textarea:focus-visible,
input:focus-visible + span {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.skip {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 30;
  padding: 16px;
  background: var(--white);
}

.skip:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mast {
  max-width: 1280px;
  margin: auto;
  padding: 26px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  color: var(--white);
  background: var(--navy);
  font-size: 14px;
}

.brand-light {
  color: var(--muted);
  font-weight: 400;
}

.edition,
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.edition {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
}

.layout {
  max-width: 1280px;
  margin: auto;
  padding: 38px 40px 70px;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 54px;
}

.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 0 6px 20px 0;
  scrollbar-width: thin;
}

.sidebar > h2 {
  margin: 0 0 15px;
  font-size: 0.875rem;
}

.progress-block {
  margin: 0 0 20px;
}

.progress-block.compact {
  padding: 0 10px 18px;
  border-bottom: 1px solid var(--line);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.75rem;
}

progress {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  accent-color: var(--blue);
}

progress::-webkit-progress-bar {
  border-radius: 8px;
  background: #dfe2e6;
}

progress::-webkit-progress-value {
  border-radius: 8px;
  background: var(--blue);
}

.nav-section {
  margin: 25px 10px 9px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.lesson-link {
  min-height: 44px;
  margin: 2px 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 9px;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.35;
  text-decoration: none;
}

.lesson-link:hover {
  background: #e9e9ee;
}

.lesson-link[aria-current="page"] {
  color: var(--white);
  background: var(--navy);
}

.lesson-link .number {
  flex: 0 0 23px;
  color: var(--muted);
  font-size: 0.75rem;
}

.lesson-link[aria-current="page"] .number {
  color: var(--white);
}

.lesson-link .tick {
  margin-left: auto;
  color: #3f7a4e;
  font-weight: 800;
}

.lesson-link[aria-current="page"] .tick {
  color: #c9edcf;
}

.lesson-link.subordinate {
  min-height: 38px;
  padding-left: 34px;
  color: var(--muted);
  font-size: 0.8rem;
}

.lesson-link.subordinate[aria-current="page"] {
  color: var(--white);
}

.sidebar-bottom {
  margin-top: 22px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

article {
  min-width: 0;
}

h1 {
  max-width: 820px;
  margin: 0 0 22px;
  font-size: clamp(2.15rem, 4.2vw, 3.6rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.07;
}

h1 em {
  color: var(--blue);
  font-style: normal;
}

h2 {
  margin: 32px 0 14px;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
}

p,
li {
  line-height: 1.7;
}

p {
  margin: 0 0 18px;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.1rem;
}

.pace-note,
.source-note,
small {
  color: var(--muted);
}

.pace-note {
  font-size: 0.875rem;
}

.primary,
.button-link.primary {
  border-color: var(--blue);
  color: var(--white);
  background: var(--blue);
}

.button-link {
  min-height: 44px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

#lesson-heading:focus {
  outline: none;
}

.study-panel {
  margin: 28px 0 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 28px;
  align-items: end;
}

.study-panel h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.study-panel-copy > p:not(.eyebrow, .pace-note) {
  max-width: 650px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pace {
  width: fit-content;
  margin: 17px 0 10px;
  padding: 4px;
  display: flex;
  gap: 3px;
  border-radius: 12px;
  background: #e9e9ed;
}

.pace button {
  min-width: 88px;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  font-size: 0.875rem;
}

.pace button[aria-pressed="true"] {
  background: var(--white);
  box-shadow: 0 1px 6px #00000012;
  font-weight: 650;
}

.study-progress {
  min-height: 144px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-top: 3px solid var(--blue);
  color: var(--muted);
  background: #efeff2;
  font-size: 0.75rem;
}

.study-progress strong {
  margin: 5px 0;
  color: var(--ink);
}

.progress-figure {
  color: var(--ink);
  font-size: 2.2rem;
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
}

.progress-figure small {
  font-size: 1rem;
  letter-spacing: 0;
}

.start-card {
  margin: 26px 0 35px;
  padding: 26px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  border-radius: 15px;
  color: var(--white);
  background: var(--navy);
}

.start-card .eyebrow {
  margin-bottom: 12px;
  color: #c3def6;
}

.start-card h2 {
  margin: 0;
  font-size: 1.4rem;
}

.start-card p:not(.eyebrow) {
  margin: 6px 0 0;
  color: #e0e8ee;
  font-size: 0.875rem;
}

.start-card a {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 13px 19px;
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  color: var(--navy);
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading > span,
.section-heading > a {
  color: var(--muted);
  font-size: 0.875rem;
}

.module-grid {
  margin: 19px 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.module-card {
  min-height: 190px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--white);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.module-card:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.module-card.complete {
  border-color: #bad4bf;
}

.card-meta {
  margin-bottom: 17px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.7rem;
}

.module-card h3 {
  font-size: 1.15rem;
}

.module-card p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--blue);
  font-size: 0.75rem;
}

.completion-label {
  color: var(--muted);
  white-space: nowrap;
}

.module-card.complete .completion-label {
  color: var(--green-ink);
}

.info-strip {
  padding: 20px 24px;
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  background: var(--blue-soft);
  font-size: 0.875rem;
  line-height: 1.6;
}

.lesson-header {
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.lesson-meta {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.lesson-meta strong {
  color: var(--navy);
}

.lesson-body {
  max-width: 740px;
}

.lesson-body ul,
.lesson-body ol {
  padding-left: 24px;
}

.lesson-body li {
  margin-bottom: 10px;
}

.callout {
  margin: 26px 0;
  padding: 22px 25px;
  border-left: 3px solid var(--blue);
  border-radius: 0 12px 12px 0;
  background: var(--blue-soft);
}

.callout .eyebrow {
  margin-bottom: 8px;
}

.callout p:last-child {
  margin-bottom: 0;
  font-weight: 600;
}

.concept-list {
  margin: 20px 0;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.concept {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.concept:last-child {
  border-bottom: 0;
}

.concept strong {
  color: var(--navy);
}

.concept p {
  margin: 4px 0 0;
}

.learning-detail,
.nested-detail {
  margin: 15px 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
}

.learning-detail > summary,
.nested-detail > summary {
  min-height: 48px;
  padding: 15px 48px 15px 20px;
  position: relative;
  display: flex;
  align-items: center;
  font-weight: 650;
  line-height: 1.45;
  cursor: pointer;
  list-style: none;
}

.learning-detail > summary::-webkit-details-marker,
.nested-detail > summary::-webkit-details-marker {
  display: none;
}

.learning-detail > summary::after,
.nested-detail > summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue);
  font-size: 1.4rem;
  font-weight: 400;
}

.learning-detail[open] > summary::after,
.nested-detail[open] > summary::after {
  content: "−";
}

.learning-detail[open] > summary {
  border-bottom: 1px solid var(--line);
}

.detail-content,
.example-content {
  padding: 20px;
}

.example-content {
  border-left: 3px solid #a8c3dc;
}

.detail-content > p:last-child,
.example-content > p:last-child,
.nested-detail > p:last-child {
  margin-bottom: 0;
}

.nested-detail {
  margin: 18px 0 0;
  background: var(--paper);
}

.nested-detail > summary {
  min-height: 44px;
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 0.9rem;
}

.nested-detail > p {
  padding: 0 20px 18px;
}

.deep-detail {
  border-color: #cbd6df;
}

.flow {
  margin: 22px 0;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  border-radius: 13px;
  background: #e8ebee;
}

.flow span {
  min-height: 68px;
  padding: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: center;
}

.flow .wide {
  grid-column: 1 / -1;
  min-height: 48px;
  border-color: var(--navy);
  color: var(--white);
  background: var(--navy);
  font-weight: 650;
}

.table-wrap {
  max-width: 100%;
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.875rem;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}

th {
  background: var(--blue-soft);
}

tr:last-child td {
  border-bottom: 0;
}

.quiz {
  margin: 32px 0;
  padding: 25px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: 13px;
  background: var(--white);
}

.quiz .eyebrow {
  color: var(--navy);
}

.quiz h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.quiz fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

.quiz-options {
  margin: 18px 0;
  display: grid;
  gap: 9px;
}

.quiz-option {
  min-height: 52px;
  padding: 11px 14px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  line-height: 1.5;
  cursor: pointer;
}

.quiz-option:hover {
  border-color: #9eafbf;
}

.quiz-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.quiz-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.check-answer {
  margin-bottom: 14px;
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
  font-weight: 650;
}

.quiz-hint {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.feedback {
  margin-top: 3px;
  padding: 15px 16px;
  border-radius: 9px;
  background: #f0f0f3;
  line-height: 1.6;
}

.feedback.correct {
  color: var(--green-ink);
  background: var(--green);
}

.feedback.incorrect {
  background: var(--rose);
}

.feedback p {
  margin: 5px 0 0;
}

.notes {
  margin: 32px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #efeff2;
}

.notes-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.notes-heading .eyebrow {
  margin-bottom: 7px;
}

.notes h2 {
  margin: 0 0 15px;
  font-size: 1.2rem;
}

.notes label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.save-status {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

textarea {
  width: 100%;
  min-height: 130px;
  margin: 10px 0 5px;
  padding: 14px;
  resize: vertical;
  border: 1px solid #abb6c0;
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
  font-size: 1rem;
  line-height: 1.6;
}

.source-note {
  margin: 24px 0;
  font-size: 0.75rem;
  line-height: 1.7;
}

.notes .source-note {
  margin: 4px 0 0;
}

.completion-panel,
.resource-cta {
  margin: 30px 0;
  padding: 23px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 13px;
  color: var(--white);
  background: var(--navy);
}

.completion-panel .eyebrow,
.resource-cta .eyebrow {
  margin-bottom: 7px;
  color: #c3def6;
}

.completion-panel p:not(.eyebrow),
.resource-cta p:not(.eyebrow) {
  margin: 6px 0 0;
  color: #e0e8ee;
  font-size: 0.875rem;
}

.completion-panel button {
  flex: 0 0 auto;
}

.lesson-actions {
  margin-top: 28px;
  padding-top: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.lesson-actions > a:not(.button-link) {
  font-size: 0.875rem;
}

.review-summary {
  margin: 28px 0 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.review-summary > div {
  padding: 18px;
  border-top: 3px solid var(--navy);
  background: var(--white);
}

.review-summary strong,
.review-summary span {
  display: block;
}

.review-summary strong {
  margin-bottom: 6px;
  font-size: 1.5rem;
}

.review-summary span {
  color: var(--muted);
  font-size: 0.75rem;
}

.review-list {
  margin: 18px 0 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.review-row {
  min-height: 74px;
  padding: 13px 18px;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.review-row:last-child {
  border-bottom: 0;
}

.review-row:hover {
  background: #f9f9fa;
}

.review-number {
  color: var(--muted);
  font-size: 0.75rem;
}

.review-row strong,
.review-row small,
.status-stack span {
  display: block;
}

.review-row small {
  margin-top: 3px;
  font-size: 0.75rem;
}

.status-stack {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
}

.practice-panel,
.edition-note {
  margin: 28px 0;
  padding: 23px 25px;
  border-radius: 12px;
  background: var(--blue-soft);
}

.practice-panel h2,
.edition-note h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.practice-panel p:last-child,
.edition-note p:last-child {
  margin-bottom: 0;
}

.practice-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.practice-links a {
  min-height: 44px;
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  color: var(--navy);
  background: var(--white);
  font-size: 0.875rem;
  text-decoration: none;
}

.source-list {
  margin: 18px 0 32px;
  padding: 0;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  list-style: none;
}

.source-list li {
  margin: 0;
  padding: 17px 20px;
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.source-list li:last-child {
  border-bottom: 0;
}

.source-list a {
  font-weight: 650;
}

.source-list span {
  color: var(--muted);
  font-size: 0.875rem;
}

.resource-cta h2 {
  margin: 0;
  font-size: 1.3rem;
}

.resource-cta .button-link {
  flex: 0 0 auto;
  border-color: var(--white);
  color: var(--navy);
  background: var(--white);
}

.chapter-map {
  grid-template-columns: 1fr 1fr;
}

.chapter-map .concept:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.chapter-map .concept:nth-last-child(2) {
  border-bottom: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.reset-area {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.reset-area h2 {
  margin-top: 0;
}

.danger-button {
  border-color: #b34d45;
  color: #91362f;
  background: transparent;
}

.reset-status {
  margin-left: 12px;
  color: var(--muted);
  font-size: 0.875rem;
}

.resource-grid {
  margin: 18px 0 38px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.resource-card {
  min-height: 230px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--white);
  text-decoration: none;
}

.resource-card.featured {
  border-color: var(--navy);
  color: var(--white);
  background: var(--navy);
}

.resource-card h3 {
  margin-top: 14px;
  font-size: 1.25rem;
}

.resource-card p {
  color: var(--muted);
  font-size: 0.875rem;
}

.resource-card.featured p {
  color: #dbe5ec;
}

.resource-type,
.resource-origin {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.resource-card.featured .resource-type,
.resource-card.featured .resource-origin {
  color: #c3def6;
}

.resource-origin {
  margin-top: auto;
  letter-spacing: 0;
}

.resource-list {
  margin: 18px 0 32px;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.resource-list > a {
  min-height: 76px;
  padding: 14px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.resource-list > a:last-child {
  border-bottom: 0;
}

.resource-list > a:hover {
  background: #f9f9fa;
}

.resource-list strong,
.resource-list small {
  display: block;
}

.resource-list small {
  margin-top: 3px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.site-footer {
  max-width: 1280px;
  margin: auto;
  padding: 25px 40px 35px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.8;
}

.noscript,
.storage-warning {
  max-width: 1200px;
  margin: 14px auto;
  padding: 12px 20px;
  background: var(--amber);
  font-size: 0.875rem;
}

.menu-toggle {
  display: none;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: transparent;
}

.burger-lines {
  width: 22px;
  display: grid;
  gap: 5px;
}

.burger-lines i {
  height: 2px;
  display: block;
  border-radius: 1px;
  background: var(--navy);
}

.mobile-menu {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(90vw, 390px);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 24px 20px 40px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: -10px 0 40px #0002;
}

.mobile-menu::backdrop {
  background: #172b40aa;
}

.mobile-menu[open] {
  display: block;
}

.menu-heading {
  margin-bottom: 19px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.menu-heading .eyebrow {
  margin-bottom: 8px;
}

.menu-heading h2 {
  margin: 0;
  font-size: 1.3rem;
}

.menu-heading button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 7px;
  font-size: 1.5rem;
  line-height: 1;
}

.drawer-route {
  margin-bottom: 18px;
  padding: 14px 10px 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.drawer-route > span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.drawer-route .pace {
  width: 100%;
  margin: 9px 0 5px;
}

.drawer-route .pace button {
  min-width: 0;
  flex: 1;
}

.mobile-menu .progress-block.compact {
  margin-top: 0;
}

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 235px minmax(0, 1fr);
    gap: 28px;
    padding: 30px 25px 60px;
  }

  .mast {
    padding: 22px 25px;
  }

  .edition {
    display: none;
  }

  .module-card {
    padding: 19px;
  }

  .study-panel {
    grid-template-columns: minmax(0, 1fr) 160px;
  }
}

@media (max-width: 720px) {
  .mast {
    padding: 15px 20px;
    gap: 6px;
  }

  .menu-toggle {
    display: block;
  }

  .brand {
    gap: 9px;
    font-size: 0.875rem;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .brand-light {
    font-size: 0.8rem;
  }

  .layout {
    display: block;
    padding: 25px 20px 48px;
  }

  .sidebar {
    display: none;
  }

  h1 {
    font-size: clamp(2.35rem, 12.5vw, 3.25rem);
  }

  .lead {
    font-size: 1rem;
  }

  .study-panel {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .study-progress {
    min-height: 0;
  }

  .pace {
    width: 100%;
  }

  .pace button {
    min-width: 0;
    flex: 1;
    padding-inline: 8px;
  }

  .start-card,
  .completion-panel,
  .resource-cta {
    padding: 22px;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .start-card a,
  .completion-panel button,
  .resource-cta .button-link {
    width: 100%;
    justify-content: center;
  }

  .module-grid,
  .resource-grid,
  .chapter-map {
    grid-template-columns: 1fr;
  }

  .chapter-map .concept:nth-child(odd) {
    border-right: 0;
  }

  .chapter-map .concept:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .module-card {
    min-height: 176px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading > span {
    font-size: 0.75rem;
    text-align: right;
  }

  .flow {
    grid-template-columns: 1fr 1fr;
  }

  .quiz,
  .notes {
    padding: 21px;
  }

  .notes-heading {
    display: block;
  }

  .save-status {
    display: block;
    margin-bottom: 12px;
  }

  .lesson-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .lesson-actions .button-link {
    width: 100%;
  }

  .review-summary {
    grid-template-columns: 1fr;
  }

  .review-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .status-stack {
    grid-column: 2;
    text-align: left;
  }

  .site-footer {
    padding: 22px 20px 35px;
  }

  .reset-status {
    display: block;
    margin: 12px 0 0;
  }
}

@media (max-width: 390px) {
  .layout {
    padding-inline: 16px;
  }

  .mast {
    padding-inline: 16px;
  }

  .brand-light {
    display: none;
  }

  .route-unit {
    display: none;
  }

  .card-meta,
  .card-foot {
    gap: 8px;
  }

  .completion-label {
    text-align: right;
  }

  .flow {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 560px) and (max-width: 720px) {
  .mobile-menu {
    padding-top: 14px;
    padding-bottom: 24px;
  }

  .menu-heading {
    margin-bottom: 10px;
  }

  .drawer-route {
    padding-top: 9px;
    margin-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  .sidebar,
  .mast,
  .menu-toggle,
  .mobile-menu,
  .pace,
  .lesson-actions,
  .quiz-options,
  .check-answer,
  .site-footer,
  .reset-area {
    display: none !important;
  }

  body {
    background: var(--white);
  }

  .layout {
    display: block;
    padding: 0;
  }

  .lesson-body {
    max-width: none;
  }

  .quiz,
  details,
  .callout {
    break-inside: avoid;
  }

  h1 {
    font-size: 30px;
  }
}
