:root {
  color-scheme: light;
  --page: #f7f3e9;
  --surface: #fffcf6;
  --forest: #18392e;
  --ink: #23362e;
  --muted: #53665c;
  --line: #d1d9ce;
  --sage: #e6eee2;
  --dark-sage: #395648;
  --gold: #957027;
  --focus: #8e681d;
  font: 16px/1.55 system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { background: var(--page); color: var(--ink); margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, h4 { margin-top: 0; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 500; line-height: 1.13; letter-spacing: -.025em; }
h1 { margin-bottom: .4em; font-size: clamp(2rem, 5.5vw, 4.3rem); }
h2 { margin-bottom: .45em; font-size: clamp(1.55rem, 3.6vw, 2.1rem); }
h3 { margin-bottom: .35rem; }
.site-header { background: var(--forest); color: #fff9e9; }
.header-inner, main { max-width: 88rem; margin-inline: auto; padding-inline: clamp(.9rem, 4.5vw, 3.2rem); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: .65rem .9rem; min-height: 4.1rem; flex-wrap: wrap; }
.wordmark { font: 1.28rem Georgia, serif; text-decoration: none; display: inline-flex; gap: .35rem; align-items: baseline; padding-block: .65rem; }
.wordmark span { color: #edd7a6; font-family: system-ui, sans-serif; font-size: .75em; }
.site-header nav { display: flex; gap: .25rem .9rem; flex-wrap: wrap; font-size: .88rem; }
.site-header nav a { min-height: 2.75rem; display: inline-flex; align-items: center; text-underline-offset: .22rem; }
main { padding-block: clamp(1.2rem, 4vw, 3rem) 3rem; }
.account-gate { max-width: 42rem; margin: 2rem auto; padding: clamp(1.15rem, 4vw, 2.8rem); }
.account-gate h1 { font-size: clamp(2rem, 6vw, 3.25rem); }
.account-actions, .account-line { display: flex; flex-wrap: wrap; gap: .65rem 1rem; align-items: center; }
.account-line { margin-bottom: 1.15rem; color: var(--muted); font-size: .92rem; }
#sync-status { color: var(--forest); }
.academy-updates { margin-bottom: 1.25rem; }
.academy-updates summary { color: var(--forest); cursor: pointer; padding: .7rem 1rem; font-weight: 700; }
.updates-body { padding: 0 1rem .75rem; }
.updates-body > p { color: var(--muted); margin: 0 0 .4rem; }
.updates-body details { border-top: 1px solid var(--line); }
.updates-body details summary { padding-inline: .25rem; font-weight: 600; }
.updates-body ol { margin: 0 0 .85rem; padding-inline-start: 1.55rem; max-width: 53rem; }
.updates-body li + li { margin-top: .45rem; }

.welcome { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.5rem; align-items: center; margin-bottom: clamp(1.2rem, 4vw, 2.7rem); }
.welcome-copy > p:last-child, .course-heading p:not(.eyebrow) { max-width: 41rem; color: var(--muted); margin-bottom: 0; }
.welcome img { border-radius: .75rem; width: 100%; height: auto; object-fit: cover; box-shadow: 0 12px 28px #243b2819; }
.eyebrow { font-weight: 750; text-transform: uppercase; letter-spacing: .11em; font-size: .73rem; color: var(--dark-sage); margin-bottom: .45rem; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .8rem; }
.role-card { display: flex; flex-direction: column; min-height: 8.4rem; gap: .3rem; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: .7rem; padding: 1rem; }
.role-card:hover { border-color: var(--dark-sage); background: #f0f5ed; }
.role-card strong { font-size: 1.03rem; line-height: 1.25; color: var(--forest); }
.role-card p { color: var(--muted); margin: 0 0 .3rem; font-size: .92rem; }
.role-card small { color: var(--dark-sage); font-weight: 650; margin-top: auto; }
.course-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.15rem; margin-bottom: 1.25rem; }
.course-heading h1 { font-size: clamp(2.05rem, 4vw, 3.35rem); }
.course-progress { width: min(19rem,100%); flex-shrink: 0; }
progress { width: 100%; height: .75rem; accent-color: var(--forest); }
.course-progress p { font-size: .84rem; }
.workspace { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(19rem,1fr); gap: 1rem; align-items: start; }
.learning-panel, .workspace > *, .course-heading > * { min-width: 0; }
.panel, .player-card { background: var(--surface); border: 1px solid var(--line); border-radius: .72rem; }
.player-card { overflow: hidden; }
.lesson-header, .player-actions, .completion-bar, .chapter-end, .disclosure, #guide, #media-error { padding-inline: clamp(.85rem,3.5vw,1.45rem); }
.lesson-header { padding-top: .95rem; padding-bottom: .8rem; }
.lesson-header p:last-child { margin-bottom: 0; color: var(--muted); }
video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #192820; }
video.portrait { height: min(68vh, 40rem); aspect-ratio: auto; }
.player-actions, .completion-bar { display: flex; flex-wrap: wrap; gap: .45rem; align-items: end; margin-top: .85rem; }
.player-actions label { width: auto; }
label { display: grid; gap: .25rem; font-size: .86rem; font-weight: 650; }
input, select, .button { border: 1px solid #a5b3a7; border-radius: .4rem; min-height: 2.75rem; background: var(--surface); color: var(--ink); padding: .4rem .65rem; }
input, select { font-size: 1rem; min-width: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; font-weight: 680; text-decoration: none; font-size: .88rem; text-align: center; }
.button.primary { background: var(--forest); color: white; border-color: var(--forest); }
.button[aria-pressed=true] { background: var(--sage); border-color: var(--dark-sage); color: var(--forest); }
.disclosure, .fine { font-size: .83rem; color: var(--muted); margin: .65rem 0 0; }
.completion-bar { padding-bottom: .95rem; }
.chapter-end { background: var(--sage); border-top: 1px solid var(--line); padding-block: .9rem; }
.chapter-end p, #media-error { margin-bottom: 0; }
#unit-end { border-top: 1px solid #bdcdbb; margin-top: .65rem; padding-top: .55rem; }
#unit-end .button { margin-top: .45rem; }
#media-error { color: #795523; padding-top: .7rem; }
#guide ol { list-style: decimal; padding-inline-start: 1.5rem; }
#guide li { padding: .25rem 0 .4rem; }
.course-outline { padding: .95rem; }
.course-outline > h2 { margin-bottom: .7rem; }
details { min-width: 0; }
summary { cursor: pointer; font-weight: 700; padding: .65rem 0; }
.unit { border-top: 1px solid var(--line); }
.unit > summary { font-size: .94rem; color: var(--forest); }
.unit > summary span { color: var(--muted); margin-left: .35rem; font-size: .8rem; white-space: nowrap; }
.chapter { padding: .05rem 0 .55rem; }
.chapter h3 { font: 750 .89rem/1.35 system-ui, sans-serif; }
.lesson-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .34rem; }
.lesson-link { min-height: 2.75rem; display: grid; grid-template-columns: 2.1rem minmax(0,1fr) auto; gap: .42rem; align-items: center; border: 1px solid transparent; border-radius: .38rem; padding: .3rem .38rem; text-decoration: none; font-size: .86rem; }
.lesson-link:hover { background: #f1f4ec; }
.lesson-link[aria-current=true] { background: var(--sage); border-color: #8caa91; }
.lesson-link strong { font-weight: 680; }
.number { color: var(--dark-sage); font-weight: 750; font-variant-numeric: tabular-nums; align-self: start; padding-top: .13rem; }
.lesson-state { white-space: nowrap; color: var(--muted); font-size: .75rem; }
.browse { margin-top: .85rem; padding-inline: .85rem; }
.browse-inner { padding-bottom: .7rem; }
.browse-inner input[type=search] { width: 100%; }
.browse-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .6rem; margin-block: .55rem; }
.checkbox { display: flex; min-height: 2.75rem; align-items: center; }
.checkbox input { min-height: auto; accent-color: var(--forest); }
#browse-status, #certificate-message { font-size: .85rem; color: var(--muted); margin-top: .4rem; margin-bottom: .3rem; }
.awards { padding: clamp(.9rem,3vw,1.7rem); margin-top: 1.25rem; scroll-margin-top: .6rem; }
.awards-intro p { max-width: 48rem; color: var(--muted); }
.awards-intro .fine { margin-block: -.45rem .85rem; }
.recipient { max-width: 24rem; }
.award-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem; }
.award { border: 1px solid var(--line); border-radius: .45rem; padding: .8rem; }
.award h3 { font: 700 .98rem/1.35 system-ui,sans-serif; }
.award p { color: var(--muted); font-size: .84rem; margin-bottom: .55rem; }
.award .button { margin: .18rem .18rem 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 56rem) {
  .workspace { grid-template-columns: 1fr; }
  .role-grid,.award-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 39rem) {
  .welcome { grid-template-columns: 1fr; gap: 1rem; }
  .welcome img { max-height: 12rem; object-position: center; }
  .role-grid,.award-grid { grid-template-columns: 1fr; }
  .role-card { min-height: auto; }
  .course-heading { flex-direction: column; align-items: start; }
}
