@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Caslon+Display&display=swap");
:root {
  color-scheme: light;
  --paper: #f7f7ef;
  --white: #fffef9;
  --forest: #183e35;
  --ink: #233e34;
  --muted: #53645a;
  --line: #d1d8c9;
  --leaf: #e4ead8;
  --gold: #b6a66f;
  --error: #8c3029;
  --serif: "Libre Caslon Display", Georgia, serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.65;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--forest);
  text-underline-offset: 0.22em;
}
a:hover {
  text-decoration-thickness: 2px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--forest);
  border-radius: 5px;
  padding: 0.7rem 1.15rem;
  min-height: 46px;
  background: var(--white);
  color: var(--forest);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
  cursor: pointer;
}
button:hover,
.button:hover {
  background: var(--leaf);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.primary {
  background: var(--forest);
  color: var(--white);
}
.primary:hover {
  background: #285747;
}
.quiet {
  border-color: var(--line);
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
}
.danger {
  color: var(--error);
  border-color: var(--error);
}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  max-width: 100%;
  background: var(--white);
  color: var(--ink);
  border: 1px solid #85977e;
  border-radius: 4px;
  padding: 0.65rem 0.8rem;
  min-height: 46px;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--forest);
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
label {
  font-weight: 500;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
textarea:focus-visible {
  outline: 3px solid #946a1b;
  outline-offset: 4px;
}
h1,
h2,
h3 {
  font-weight: 400;
  line-height: 1.13;
  margin: 0 0 1rem;
}
h1,
h2 {
  font-family: var(--serif);
}
h1 {
  font-size: clamp(2.65rem, 5vw, 4.5rem);
  letter-spacing: -0.025em;
}
h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
}
h3 {
  font-size: 1.18rem;
  font-weight: 600;
}
p {
  margin: 0 0 1rem;
}
p:last-child {
  margin-bottom: 0;
}
img,
svg,
video {
  max-width: 100%;
}
img {
  display: block;
}
figure {
  margin: 0;
}
figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
ul,
ol {
  padding-left: 1.4rem;
}
li + li {
  margin-top: 0.45rem;
}
[hidden] {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.eyebrow,
.chapter-mark {
  font-size: 0.98rem;
  margin-bottom: 1.3rem;
  font-weight: 500;
}
.actions {
  display: flex;
  gap: 1.35rem;
  align-items: center;
  flex-wrap: wrap;
}
.text-link {
  font-weight: 600;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 10;
  background: var(--forest);
  color: white;
  padding: 1rem;
}
.skip-link:focus {
  top: 0.5rem;
}
.site-header {
  max-width: 1440px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 1.7rem 4.5%;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.1;
  flex-shrink: 0;
}
.brand-sub {
  display: block;
  font: 500 0.85rem var(--sans);
  margin-top: 0.25rem;
}
.site-nav {
  display: flex;
  gap: 1.8rem;
  align-items: center;
  margin-left: auto;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.55rem 0;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--forest);
  font-weight: 700;
}
.demo-link {
  font-size: 0.9rem;
  white-space: nowrap;
}
.demo-link span {
  margin-left: 0.3rem;
}
#main {
  max-width: 1280px;
  margin: auto;
  padding: 0 3rem 5rem;
  min-height: 60vh;
}
#main:focus,
h1:focus {
  outline: none;
}
.site-footer {
  background: var(--leaf);
  padding: 2.5rem max(5vw, calc((100vw - 1184px) / 2));
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  font-size: 0.82rem;
}
.site-footer p {
  margin: 0.3rem 0;
}
.site-footer strong {
  font-weight: 600;
  font-size: 0.95rem;
}
.storage-notice {
  padding: 0.75rem max(5vw, calc((100vw - 1184px) / 2));
  background: #fff1cf;
  color: #5c4312;
  font-size: 0.9rem;
}
.loading-message {
  padding: 5rem 0;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 4.5rem 0 4rem;
  align-items: center;
}
.hero-copy {
  padding-right: 1rem;
}
.hero h1 {
  font-size: clamp(3.1rem, 5.2vw, 5.15rem);
  line-height: 1.025;
  max-width: 13ch;
  margin-bottom: 1.6rem;
}
.hero-description {
  font-size: 1.03rem;
  line-height: 1.8;
  max-width: 44ch;
  margin-bottom: 1.8rem;
}
.hero-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1.2rem;
  max-width: 45ch;
}
.hero-image {
  position: relative;
  padding: 1rem 0 0 1rem;
}
.hero-image:before {
  content: "";
  position: absolute;
  inset: 0 1.3rem 2rem 0;
  background: var(--leaf);
  z-index: -1;
  border-radius: 45% 45% 2px 2px;
}
.hero-image img {
  width: 100%;
  height: 445px;
  object-fit: cover;
  border-radius: 46% 46% 2px 2px;
}
.hero-image figcaption {
  margin-top: 0.9rem;
  max-width: 49ch;
  font-size: 0.76rem;
}
.learning-intro {
  border-top: 1px solid var(--line);
  padding: 3.2rem 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  column-gap: 3.5rem;
}
.learning-intro .chapter-mark {
  grid-row: 1/3;
}
.learning-intro h2 {
  max-width: 24ch;
}
.learning-intro > p:last-child {
  max-width: 64ch;
}
.learning-map {
  padding: 2rem 0 3rem;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}
.module-preview {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border-top: 2px solid var(--forest);
  padding: 1.3rem 0 0.8rem;
}
.module-preview h3 {
  margin: 1rem 0 0.8rem;
  line-height: 1.4;
}
.module-preview p {
  font-size: 0.9rem;
  flex: 1;
}
.module-preview:hover h3 {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.module-letter {
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1;
  color: #526c4a;
}
.module-preview .muted {
  font-size: 0.8rem;
}
.practice-banner {
  background: var(--forest);
  color: var(--white);
  padding: 2.3rem 2.6rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: space-between;
  border-radius: 5px;
}
.practice-banner h2 {
  font-size: 2.25rem;
  max-width: 24ch;
}
.practice-banner p {
  font-size: 0.92rem;
  max-width: 65ch;
}
.practice-banner .button {
  flex-shrink: 0;
}
.resume-panel {
  margin-top: 4rem;
  max-width: 850px;
}
.route-picker {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.6rem 2rem;
  align-items: center;
  margin: 1.6rem 0;
  padding: 1.3rem 1.5rem;
  background: var(--leaf);
  border-radius: 5px;
}
.route-picker p {
  grid-column: 1/-1;
  font-size: 0.85rem;
  max-width: 84ch;
}
.route-picker select {
  width: 100%;
  font-size: 0.92rem;
}
.progress-summary {
  font-weight: 600;
}
.page-heading {
  padding: 3.5rem 0 1rem;
  max-width: 820px;
}
.page-heading h1 {
  margin-bottom: 1.2rem;
}
.lede {
  max-width: 70ch;
  font-size: 1.05rem;
  color: var(--muted);
}
.course-module {
  margin-top: 3rem;
}
.module-heading {
  display: flex;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.6rem;
}
.module-heading .module-letter {
  width: 50px;
  flex-shrink: 0;
}
.module-heading h2 {
  font-size: 2.3rem;
}
.module-heading p {
  max-width: 76ch;
  font-size: 0.92rem;
}
.lesson-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.course-lesson {
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.lesson-row-link {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-decoration: none;
  padding: 1.2rem 0.5rem;
}
.lesson-row-link:hover {
  background: var(--leaf);
}
.lesson-id {
  font-weight: 600;
  font-size: 0.9rem;
  width: 45px;
  flex-shrink: 0;
}
.lesson-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.lesson-row-text strong {
  font-weight: 500;
}
.lesson-row-text .muted {
  font-size: 0.85rem;
}
.lesson-status {
  font-size: 0.78rem;
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
}
.is-complete .lesson-status {
  font-weight: 700;
  color: var(--forest);
}
.scope-note {
  border-left: 3px solid var(--gold);
  padding: 1rem 1.3rem;
  margin-top: 3rem;
  max-width: 85ch;
  background: #f0f0e3;
  font-size: 0.9rem;
}
.search-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 600px;
  margin: 1.5rem 0;
}
.glossary-list {
  max-width: 850px;
}
.glossary-list dt {
  font-size: 1.1rem;
  font-weight: 600;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
  margin-top: 1.2rem;
}
.glossary-list dd {
  margin: 0.4rem 0 0;
  max-width: 75ch;
}
.progress-overview,
.review-panel,
.saved-records,
.progress-tools {
  margin: 2rem 0 3rem;
  max-width: 950px;
}
.progress-overview h2 {
  font-size: 2.2rem;
}
.progress-overview progress {
  width: 100%;
  height: 13px;
  accent-color: var(--forest);
  margin: 0.5rem 0 1rem;
}
.review-list,
.record-list {
  list-style: none;
  padding: 0;
}
.review-list li,
.record-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.record-list .muted {
  font-size: 0.8rem;
  white-space: nowrap;
}
.progress-tools > label {
  display: block;
  margin: 1.5rem 0 0.5rem;
}
.progress-tools input[type="file"] {
  width: 100%;
}
.import-status {
  color: var(--error);
  margin-top: 0.8rem;
}
.reset-progress {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.reset-progress summary {
  cursor: pointer;
  color: var(--error);
  font-weight: 500;
}
.reset-progress p {
  margin: 1rem 0;
}
.panel {
  padding: 1.6rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.load-error {
  margin-top: 4rem;
}
.load-error a {
  display: block;
  margin-top: 1rem;
}
.screen-reader-status {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  max-width: 650px;
  padding: 1rem;
  background: var(--forest);
  color: var(--white);
  z-index: 20;
  border-radius: 5px;
}
.lesson-player {
  max-width: 1020px;
  margin: auto;
  padding-top: 2.5rem;
}
.lesson-header {
  margin-bottom: 2rem;
}
.lesson-header h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  max-width: 26ch;
}
.lesson-header p {
  max-width: 75ch;
}
.lesson-header a {
  font-size: 0.9rem;
}
.lesson-slide {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2rem;
  margin: 1.5rem 0;
}
.slide-heading {
  font-size: 2.3rem;
}
.lesson-slide h2 {
  font-size: 2.3rem;
}
.lesson-slide ul {
  max-width: 75ch;
}
.slide-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
}
.slide-counter {
  font-size: 0.85rem;
  color: var(--muted);
}
.lesson-media {
  padding: 1.3rem;
  background: var(--leaf);
  border-radius: 5px;
  margin: 1.4rem 0;
}
.lesson-media audio,
.lesson-media video {
  width: 100%;
  max-height: 480px;
}
.media-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.media-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.media-controls select {
  min-height: 38px;
  padding: 0.3rem 0.5rem;
}
.media-captions {
  min-height: 2rem;
  line-height: 1.65;
  padding: 0.6rem 0;
  max-width: 80ch;
}
.lesson-transcript {
  border-top: 1px solid var(--line);
  margin: 1.3rem 0;
  padding-top: 1rem;
}
.lesson-transcript summary {
  cursor: pointer;
  font-weight: 600;
}
.lesson-transcript p {
  margin-top: 1rem;
  max-width: 77ch;
}
.worked-example {
  background: var(--leaf);
  padding: 1.5rem;
  border-left: 3px solid #667e52;
  border-radius: 0 5px 5px 0;
  margin: 1.5rem 0;
}
.worked-example h3 {
  font-size: 1.2rem;
}
.worked-example p,
.worked-example li {
  max-width: 76ch;
}
.lesson-section,
.lesson-practice,
.lesson-quiz,
.lesson-sources,
.practical-task {
  margin: 2.5rem 0;
}
.lesson-section h2,
.lesson-practice h2,
.lesson-quiz h2,
.lesson-sources h2,
.practical-task h2 {
  font-size: 2rem;
}
.lesson-practice textarea {
  width: 100%;
  min-height: 130px;
  margin: 0.7rem 0;
}
.practical-task {
  border-left: 3px solid var(--gold);
  background: #f0f0e3;
  padding: 1.5rem;
}
.quiz-question {
  border: 1px solid var(--line);
  border-radius: 5px;
  margin: 1.5rem 0;
  padding: 1.5rem;
  min-width: 0;
}
.quiz-question legend {
  font-weight: 600;
  padding: 0 0.3rem;
  max-width: 100%;
}
.quiz-options {
  display: grid;
  gap: 0.65rem;
}
.quiz-option {
  display: flex;
  align-items: start;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 400;
  background: var(--white);
}
.quiz-option input {
  margin-top: 0.25rem;
}
.quiz-option.is-selected {
  border-color: var(--forest);
  background: var(--leaf);
}
.quiz-option.is-correct {
  border-color: #386546;
  background: #e4efdf;
}
.quiz-option.is-incorrect {
  border-color: #9c4b3f;
  background: #fff0e9;
}
.quiz-feedback {
  font-size: 0.9rem;
  margin-top: 0.7rem;
}
.correct {
  color: #285239;
}
.incorrect {
  color: var(--error);
}
.quiz-result {
  padding: 1.3rem;
  background: var(--leaf);
  margin: 1rem 0;
  border-radius: 5px;
}
.quiz-result.incorrect {
  background: #fff0e9;
}
.lesson-sources {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  font-size: 0.88rem;
}
.teaching-visual {
  margin: 1.5rem 0;
}
.teaching-visual svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}
.teaching-visual figcaption {
  margin-top: 0.6rem;
}
.practice-labs {
  padding-top: 3.5rem;
}
.practice-labs > h1 {
  max-width: 20ch;
}
.practice-lab {
  padding: 2rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 2rem 0;
}
.practice-lab h2 {
  font-size: 2rem;
}
.lab-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  margin: 1.4rem 0;
}
.lab-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.lab-field input {
  width: 100%;
}
.lab-form > button {
  justify-self: start;
}
.lab-result {
  padding: 1rem 1.3rem;
  background: var(--leaf);
  border-left: 3px solid #627b4e;
  border-radius: 0 5px 5px 0;
  margin: 1rem 0;
}
.threshold-chart {
  width: 100%;
  height: auto;
}
.lab-readings {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  font-size: 0.9rem;
  margin: 1rem 0;
}
.practice-lab p {
  max-width: 80ch;
}
details summary {
  cursor: pointer;
}
details[open] > summary {
  margin-bottom: 0.8rem;
}
@media (min-width: 1450px) {
  .hero h1 {
    font-size: 5.1rem;
  }
}
@media (max-width: 1050px) {
  .site-header {
    gap: 1.5rem;
    padding: 1.3rem 2rem;
  }
  .site-nav {
    gap: 1.15rem;
  }
  .demo-link {
    display: none;
  }
  .hero {
    gap: 2rem;
  }
  .hero-image img {
    height: 390px;
  }
  .hero h1 {
    font-size: 4rem;
  }
  .module-grid {
    gap: 1rem;
  }
}
@media (max-width: 760px) {
  #main {
    padding: 0 1.25rem 3rem;
  }
  .site-header {
    padding: 1rem 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 1.35rem;
  }
  .brand svg {
    width: 27px;
    height: 35px;
  }
  .brand-sub {
    font-size: 0.75rem;
  }
  .site-nav {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    gap: 0.6rem;
    overflow-x: auto;
  }
  .site-nav a {
    font-size: 0.86rem;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 2.5rem 0 2rem;
    gap: 2rem;
  }
  .hero-copy {
    padding: 0;
  }
  .hero h1 {
    font-size: clamp(3rem, 10vw, 4.5rem);
    max-width: 15ch;
  }
  .hero-image {
    max-width: 600px;
    padding-left: 0.65rem;
  }
  .hero-image img {
    height: 350px;
    object-position: 50% 50%;
  }
  .hero-image figcaption {
    font-size: 0.78rem;
  }
  .hero-description {
    max-width: 53ch;
  }
  .learning-intro {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 2.5rem 0;
  }
  .learning-intro .chapter-mark {
    grid-row: auto;
  }
  .module-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
  }
  .module-preview h3 {
    font-size: 1.1rem;
  }
  .practice-banner {
    display: block;
    padding: 1.7rem;
  }
  .practice-banner .button {
    margin-top: 1.5rem;
  }
  .resume-panel {
    margin-top: 2.5rem;
  }
  .route-picker {
    grid-template-columns: 1fr;
    padding: 1.2rem;
    gap: 0.7rem;
  }
  .route-picker p {
    grid-column: auto;
  }
  .site-footer {
    flex-direction: column;
    padding: 2rem 1.25rem;
    gap: 1.5rem;
  }
  .page-heading {
    padding: 2.5rem 0 1rem;
  }
  .lesson-row-link {
    gap: 0.7rem;
    align-items: start;
    padding: 1rem 0;
    flex-wrap: wrap;
  }
  .lesson-id {
    width: 35px;
  }
  .lesson-row-text {
    flex: 1;
    min-width: 170px;
  }
  .lesson-status {
    margin-left: calc(35px + 0.7rem);
    font-size: 0.75rem;
  }
  .module-heading {
    gap: 0.7rem;
  }
  .module-heading .module-letter {
    width: 35px;
  }
  .module-heading h2 {
    font-size: 2rem;
  }
  .review-list li,
  .record-list li {
    flex-direction: column;
    align-items: start;
    gap: 0.5rem;
  }
  .lesson-player {
    padding-top: 1.8rem;
  }
  .lesson-slide {
    padding: 1.15rem;
  }
  .lesson-slide h2,
  .slide-heading {
    font-size: 1.9rem;
  }
  .lesson-header h1 {
    font-size: 2.6rem;
  }
  .slide-navigation {
    gap: 0.4rem;
    flex-wrap: wrap;
  }
  .slide-navigation button {
    padding: 0.65rem 0.8rem;
  }
  .slide-counter {
    font-size: 0.75rem;
  }
  .quiz-question {
    padding: 1rem;
  }
  .quiz-option {
    padding: 0.7rem;
  }
  .lesson-media {
    padding: 1rem;
  }
  .lab-form {
    grid-template-columns: 1fr 1fr;
  }
  .practice-lab {
    padding: 1.2rem;
  }
  .practical-task {
    padding: 1.1rem;
  }
  .actions {
    gap: 1rem;
  }
  .glossary-list dd {
    margin-left: 0;
  }
}
@media (max-width: 420px) {
  .module-grid {
    grid-template-columns: 1fr;
  }
  .hero-image img {
    height: 290px;
  }
  .hero .actions {
    align-items: start;
    flex-direction: column;
  }
  .hero h1 {
    font-size: 3.3rem;
  }
  .lab-form {
    grid-template-columns: 1fr;
  }
  .site-nav a {
    font-size: 0.81rem;
  }
  .lesson-row-text {
    min-width: 160px;
  }
  .slide-navigation {
    justify-content: center;
  }
  .slide-counter {
    width: 100%;
    text-align: center;
    order: 3;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  .site-header,
  .site-footer,
  .slide-navigation,
  .media-controls,
  .actions {
    display: none;
  }
  #main {
    padding: 0;
    max-width: none;
  }
  body {
    background: white;
    color: black;
  }
  .lesson-slide,
  .panel {
    border: 1px solid #aaa;
    break-inside: avoid;
  }
  a {
    color: black;
  }
}

@media (max-width: 760px) {
  .demo-link {
    display: block;
    margin-left: auto;
    font-size: 0.8rem;
  }
  .site-nav {
    order: 3;
  }
}
.slide-jump {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  flex: 1;
}
.slide-jump select {
  width: 100%;
  min-width: 0;
}
.lab-field {
  min-width: 0;
}
.lab-field input,
.lab-field select {
  min-width: 0;
  width: 100%;
}
@media (max-width: 420px) {
  .lab-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .slide-jump {
    flex-basis: 100%;
    width: 100%;
    order: 4;
  }
  .slide-navigation .slide-counter {
    order: 3;
  }
  .critical-label {
    display: inline-block;
    font-size: 0.75rem;
    color: #7b3825;
    margin-left: 0.3rem;
  }
}
.lesson-tools {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.4rem 0;
}
.critical-label {
  font-size: 0.75rem;
  color: #7b3825;
  margin-left: 0.35rem;
}
@media print {
  .lesson-tools,
  .slide-navigation,
  .media-controls,
  audio,
  video,
  button {
    display: none !important;
  }
  .lesson-transcript {
    display: block;
  }
  .lesson-header h1 {
    font-size: 28pt;
  }
  .site-header,
  .site-footer {
    display: none !important;
  }
}

.production-notes {
  margin-top: 3rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--line);
  max-width: 85ch;
}
.production-notes h2 {
  font-size: 2rem;
}
.production-notes p {
  font-size: 0.9rem;
}

.production-notes > .text-link {
  display: block;
  margin-top: 0.7rem;
}

/* Keep lesson and video navigation visible beside the learning material. */
.lesson-navigation { margin: 1.5rem 0; }
.lesson-sequence { margin-top: 0; }
.lesson-adjacent, .watch-group-navigation, .video-chapters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .75rem;
}
.lesson-adjacent > * { flex: 1 1 16rem; }
.lesson-jump, .chapter-jump, .watch-group-picker {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  min-width: 0;
}
.lesson-jump { margin: 1rem 0; }
.lesson-jump select, .chapter-jump select, .watch-group-picker select { width: 100%; min-width: 0; }
.video-chapters { margin: 1rem 0; }
.chapter-jump { flex: 1 1 18rem; }
.watch-group-picker { margin: 1.5rem 0; max-width: 48rem; }
.watch-player { margin: 1.5rem 0; }
.watch-player video { width: 100%; background: #17211b; display: block; aspect-ratio: 16 / 9; }
.watch-player h2 { margin-top: 0; }
.watch-current-section { margin: 1.5rem 0 .6rem; }
.watch-caption-toggle { display: inline-block; margin-top: 1rem; }
.watch-group-navigation > * { flex: 1 1 16rem; }
.watch-auto-continue { display: block; margin: 1rem 0; }
.watch-media-status { min-height: 1.65em; }
.watch-media-error { color: var(--error); font-weight: 600; }
.watch-contents { margin-top: 2.5rem; }
.watch-chapter-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; list-style: none; padding: 0; }
.watch-chapter-list button { width: 100%; justify-content: flex-start; text-align: left; font-weight: 400; }
.watch-chapter-list [aria-current="true"] { background: var(--forest); color: var(--white); }
@media (max-width: 760px) {
  .video-chapters .chapter-jump { order: -1; flex-basis: 100%; }
  .video-chapters > button { flex: 1; }
  .watch-chapter-list { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .lesson-navigation, .video-chapters, .watch-group-navigation, .watch-group-picker,
  .watch-chapter-list, .watch-auto-continue, .watch-caption-toggle { display: none !important; }
}

/* ---- R4 one-screen lesson player ------------------------------------- */
body.lesson-mode .site-header,
body.lesson-mode .site-footer {
  display: none;
}
body.lesson-mode {
  overflow: hidden;
}
body.lesson-mode #main {
  padding: 0;
  max-width: none;
  margin: 0;
}
.lp {
  --lp-gap: clamp(0.75rem, 1.6vw, 1.25rem);
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  max-width: 1440px;
  margin: 0 auto;
  background: var(--paper);
}
.lp-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding: 0.6rem var(--lp-gap) 0.5rem;
  border-bottom: 1px solid var(--line);
}
.lp-back,
.lp-menu-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-decoration: none;
  font-size: 1.2rem;
  color: var(--forest);
}
.lp-title {
  min-width: 0;
}
.lp-title h1 {
  font: 600 clamp(1rem, 2.2vw, 1.3rem) / 1.25 var(--sans);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lp-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.lp-track {
  grid-column: 1 / -1;
  display: flex;
  gap: 3px;
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
}
.lp-track li {
  flex: 1;
  display: flex;
}
.lp-dot {
  flex: 1;
  min-height: 0;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--line);
}
.lp-dot[data-kind="quiz"],
.lp-dot[data-kind="result"] {
  background: #e3dcc0;
}
.lp-dot.is-done {
  background: #6e8d76;
}
.lp-dot.is-current {
  background: var(--forest);
}
.lp-dot:hover {
  background: var(--gold);
}
.lp-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: var(--lp-gap);
  padding: var(--lp-gap);
}
.lp.lp-no-stage .lp-body {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}
.lp.lp-no-stage .lp-stage {
  display: none;
}
.lp-stage {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.lp-stage-inner {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lp-video {
  display: block;
  width: 100%;
  min-height: 0;
  flex: 0 1 auto;
  aspect-ratio: 16 / 9;
  background: #10241f;
  border-radius: 10px;
  object-fit: contain;
}
.lp-stage-inner > * {
  margin-top: 0;
  margin-bottom: 0;
}
.lp-stage-inner > figure {
  overflow: auto;
  min-height: 0;
}
.lp-caption {
  margin: 0;
  min-height: 2.9em;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  background: var(--forest);
  color: var(--white);
  font-size: 0.95rem;
  line-height: 1.45;
}
.lp-caption:empty::before {
  content: "Captions appear here while the narrator speaks.";
  opacity: 0.6;
}
.lp-media-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.lp-chip {
  min-height: 36px;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.lp-section-status {
  font-size: 0.85rem;
  color: var(--forest);
  font-weight: 600;
}
.lp-section-status:empty {
  display: none;
}
.lp-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.lp-panel-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1rem, 2vw, 1.5rem);
}
.lp-panel-body h2 {
  font: 400 clamp(1.45rem, 2.6vw, 2rem) / 1.15 var(--serif);
  margin: 0.25rem 0 0.75rem;
}
.lp-panel-body h2:focus {
  outline: none;
}
.lp-lead {
  font-size: 1.08rem;
  margin-top: 0;
}
.lp-points {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}
.lp-points li {
  margin: 0.3rem 0;
  font-weight: 500;
}
.lp-outcomes li {
  margin: 0.35rem 0;
}
.lp-muted,
.lp-save {
  color: var(--muted);
  font-size: 0.86rem;
}
.lp-save {
  margin: 0;
  padding: 0 var(--lp-gap);
}
.lp-save:empty {
  display: none;
}
.lp-done {
  padding: 0.6rem 0.8rem;
  background: var(--leaf);
  border-radius: 6px;
}
.lp-example {
  margin: 0.75rem 0;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid #667e52;
  background: var(--leaf);
  border-radius: 0 6px 6px 0;
}
.lp-example summary,
.lp-transcript summary {
  cursor: pointer;
  font-weight: 600;
}
.lp-example ol {
  margin: 0.4rem 0;
  padding-left: 1.3rem;
}
.lp-answer {
  font-weight: 700;
  margin-bottom: 0;
}
.lp-transcript {
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.lp-check {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1rem 0 0;
  padding: 0.9rem;
  min-width: 0;
  background: #fbfbf3;
}
.lp-check legend {
  font-weight: 700;
  padding: 0 0.3rem;
}
.lp-slide .lp-check legend::before {
  content: "Quick check · ";
  color: var(--muted);
  font-weight: 600;
}
.lp-option {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.45rem 0;
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  line-height: 1.4;
}
.lp-option input {
  margin-top: 0.2rem;
  accent-color: var(--forest);
}
.lp-option.is-selected {
  border-color: var(--forest);
}
.lp-option.is-correct {
  border-color: #3f7a4f;
  background: #e5f1e2;
}
.lp-option.is-incorrect {
  border-color: var(--error);
  background: #f8e7e3;
}
.lp-feedback {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
}
.lp-feedback:empty {
  display: none;
}
.lp-feedback.correct {
  color: #2f6b3e;
}
.lp-feedback.incorrect {
  color: var(--error);
}
.lp-notes {
  width: 100%;
  min-height: 90px;
  margin: 0.5rem 0;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.lp-review {
  padding-left: 1.2rem;
}
.lp-review li {
  margin: 0.6rem 0;
}
.lp-review li.is-correct strong::after {
  content: " \2713";
  color: #2f6b3e;
}
.lp-review li.is-incorrect strong::after {
  content: " \2717";
  color: var(--error);
}
.lp-review p {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
}
.lp-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem var(--lp-gap) max(0.6rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.lp-counter {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
.lp-next {
  min-width: 9rem;
}
.lp-drawer {
  width: min(440px, 100vw);
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 1rem 1.25rem 2rem;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--white);
  overflow-y: auto;
}
.lp-drawer::backdrop {
  background: rgb(16 36 31 / 0.45);
}
.lp-drawer h2 {
  font: 600 1rem var(--sans);
  margin: 1.25rem 0 0.5rem;
}
.lp-drawer-close {
  float: right;
}
.lp-jump {
  list-style: none;
  padding: 0;
  margin: 0;
}
.lp-jump button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-color: transparent;
  min-height: 40px;
  font-weight: 500;
}
.lp-jump button.is-current {
  background: var(--leaf);
  font-weight: 700;
}
.lp-drawer select,
.lp-adjacent button,
.lp-drawer section > button {
  width: 100%;
  margin: 0.25rem 0;
  justify-content: flex-start;
  text-align: left;
}
.lp-drawer select {
  min-height: 44px;
}
.lp-print {
  display: none;
}

/* Phones and narrow tablets: video on top, panel below, sticky nav. */
@media (max-width: 860px) {
  .lp-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0;
    gap: 0;
  }
  .lp.lp-no-stage .lp-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .lp-stage-inner {
    gap: 0;
  }
  .lp-video {
    border-radius: 0;
    max-height: 34dvh;
  }
  .lp-caption {
    border-radius: 0;
    font-size: 0.86rem;
    min-height: 2.6em;
  }
  .lp-media-bar {
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid var(--line);
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .lp-chip {
    flex-shrink: 0;
  }
  .lp-autopause {
    display: none;
  }
  .lp-panel {
    border: 0;
    border-radius: 0;
  }
  .lp-stage-inner > figure {
    max-height: 36dvh;
  }
  .lp-next {
    min-width: 0;
  }
}
@media (max-width: 420px) {
  .lp-counter {
    display: none;
  }
  .lp-nav {
    grid-template-columns: auto 1fr;
  }
}
@media print {
  body.lesson-mode {
    overflow: visible;
  }
  .lp {
    display: block;
    height: auto;
  }
  .lp-bar,
  .lp-body,
  .lp-nav,
  .lp-drawer {
    display: none !important;
  }
  .lp-print {
    display: block;
  }
}

/* R4: compact course list on phones */
@media (max-width: 600px) {
  .lesson-row-link {
    gap: 0.75rem;
    padding: 0.8rem 0.25rem;
  }
  .lesson-row-text .muted {
    display: none;
  }
  .lesson-row-text strong {
    line-height: 1.35;
  }
  .lesson-status {
    font-size: 0.72rem;
  }
  .course-module {
    margin-top: 1.75rem;
  }
  .module-heading h2 {
    font-size: 1.7rem;
  }
}
/* R4: legend sits inside the question box; stage captions hidden on phones */
.lp-check legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 0.4rem;
}
.lp-check legend + * {
  clear: both;
}
@media (max-width: 860px) {
  .lp-stage-inner > figure figcaption {
    display: none;
  }
}
/* The lesson shows its own save warning inside the layout (.lp-save). */
body.lesson-mode .storage-notice {
  display: none;
}
/* Diagram kept for screen readers while the video shows the same picture. */
.lp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.lp-diagram {
  min-height: 0;
  overflow: auto;
}
.lp-diagram > figure {
  margin: 0;
}
@media (max-width: 860px) {
  .lp-diagram {
    max-height: 36dvh;
  }
  .lp-diagram figcaption {
    display: none;
  }
}