:root {
  color-scheme: light;
  --green: #18473c;
  --pine: #153831;
  --dark: #17322c;
  --paper: #fbf8ef;
  --page: #f1eee4;
  --line: #dcd7c7;
  --text: #21332c;
  --muted: #59665c;
  --gold: #e9bc67;
  --body: "DM Sans", "Avenir Next", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 300px; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--text); font-family: var(--body); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #b47021; outline-offset: 4px; }
.skip { position: absolute; z-index: 3; top: .5rem; left: 1rem; background: white; padding: .5rem; transform: translateY(-200%); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; padding: .65rem clamp(1rem, 4vw, 4.2rem); background: var(--pine); color: var(--paper); }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid #ad9565; color: var(--gold); font-size: 1.45rem; }
.brand strong { display: block; font: 700 1.2rem var(--serif); }
.brand small { display: block; font-size: .68rem; color: #e2e1d5; margin-top: .12rem; }
.top-actions, .deck-tools, .qr-actions, .inbox-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.top-actions { justify-content: flex-end; }
.plain-link { font-size: .83rem; padding: .45rem; text-underline-offset: .23em; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .45rem; min-height: 39px; padding: .55rem .85rem; border: 1px solid transparent; border-radius: .42rem; font-size: .83rem; font-weight: 700; text-decoration: none; line-height: 1.3; }
.button:disabled { opacity: .44; cursor: default; }
.button:not(:disabled):hover { filter: brightness(.94); }
.button.light { border-color: var(--line); background: var(--paper); color: var(--pine); }
.button.gold { background: var(--gold); color: #332611; }
.button.green { background: var(--green); color: white; }
.layout { width: min(1580px, 100%); margin-inline: auto; padding: clamp(1rem, 2.5vw, 2.5rem) clamp(1rem, 3vw, 3rem); display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: clamp(1rem, 2.5vw, 2.4rem); align-items: start; }
.side { position: sticky; top: 1.5rem; }
.side summary { font: 700 1.15rem var(--serif); padding: .35rem 0 .8rem; }
.side nav { display: grid; gap: .3rem; margin-bottom: .3rem; }
.toc-link { display: grid; gap: .18rem; padding: .64rem .73rem; border: 1px solid transparent; border-radius: .43rem; color: var(--text); text-decoration: none; font-size: .84rem; line-height: 1.3; }
.toc-link small { font-size: .67rem; font-weight: 700; color: var(--muted); }
.toc-link:hover { border-color: var(--line); background: var(--paper); }
.toc-link[aria-current] { background: #e3ebdf; border-color: #c4d2bf; font-weight: 700; }
.deck { min-width: 0; }
.deck-head, .deck-controls { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.deck-head { margin-bottom: .75rem; }
.eyebrow { margin: 0; color: var(--green); font-size: .72rem; letter-spacing: .12em; font-weight: 800; text-transform: uppercase; }
.stage { min-height: min(610px, 73vh); border: 1px solid var(--line); border-radius: .75rem; background: var(--paper); overflow: hidden; box-shadow: 0 11px 34px #242d1f0b; }
.stage h1, .stage h2, .page h1, .page h2, dialog h2 { margin: 0; font-family: var(--serif); line-height: 1.03; text-wrap: balance; }
.stage h1 { font-size: clamp(2.8rem, 5.45vw, 6.2rem); font-weight: 600; letter-spacing: -.06em; }
.stage h2 { font-size: clamp(2.45rem, 4.25vw, 5.25rem); font-weight: 600; letter-spacing: -.045em; }
.cover { background: #172f29; color: var(--paper); display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .64fr); align-items: center; gap: clamp(1rem, 2.4vw, 2.8rem); padding: clamp(1.4rem, 4vw, 4rem); }
.cover .eyebrow, .chapter-stage .eyebrow { color: #f2cd88; }
.cover .subtitle { color: #f9dda5; font: 500 clamp(1.34rem, 2.5vw, 2.4rem) var(--serif); margin: .9rem 0 1rem; }
.cover h1 { margin-top: .52rem; }
.cover .byline { color: #f0ebd7; font-size: .88rem; line-height: 1.55; margin: 1rem 0 1.35rem; }
.cover figure { margin: 0; display: flex; align-self: stretch; justify-content: center; align-items: center; }
.cover img { display: block; width: 100%; max-width: 315px; max-height: 540px; object-fit: contain; filter: drop-shadow(0 15px 24px #0218109a); }
.lesson-stage { display: grid; align-content: center; padding: clamp(1.5rem, 4vw, 3.9rem); }
.chapter-stage { background: var(--pine); color: var(--paper); }
.slide-content { min-width: 0; }
.slide-content .eyebrow { margin-bottom: .65rem; }
.slide-content .summary { margin: .85rem 0 0; max-width: 65ch; font-size: clamp(1.03rem, 1.55vw, 1.45rem); line-height: 1.48; }
.slide-content ul { margin: 1rem 0; padding-left: 1.28rem; display: grid; gap: .5rem; font-size: clamp(.98rem, 1.32vw, 1.24rem); line-height: 1.5; }
.slide-content li::marker { color: #a16a24; }
.chapter-stage li::marker { color: var(--gold); }
.source { margin: .95rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.chapter-stage .source { color: #e5e8db; }
.slide-figure { margin: 1rem 0 0; display: grid; place-items: center; }
.slide-figure img { display: block; width: 100%; max-height: min(34vh, 305px); object-fit: contain; }
.visual-side { grid-template-columns: minmax(0, 1fr) minmax(0, .88fr); align-items: center; gap: clamp(1rem, 2vw, 2.25rem); }
.visual-side .slide-figure { margin: 0; }
.visual-side .slide-figure img { max-height: 385px; }
.slide-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0 .25rem; }
.activity-stage { border-top: 5px solid #c59145; }
.deck-controls { margin-top: .8rem; }
.progress-group { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .77rem; white-space: nowrap; }
progress { width: clamp(52px, 12vw, 180px); height: .44rem; accent-color: var(--green); }
.notes { margin-top: .65rem; padding: .85rem 1rem; line-height: 1.55; background: #e3ebe2; border-radius: .42rem; }
.deck:fullscreen { background: var(--page); display: flex; flex-direction: column; width: 100%; height: 100%; padding: 1rem clamp(1rem, 4vw, 4rem); }
.deck:fullscreen .stage { flex: 1; min-height: 0; overflow: auto; }
.deck:fullscreen .slide-figure img { max-height: min(43vh, 420px); }
.page { width: min(700px, 100%); margin: 0 auto; padding: clamp(1.1rem, 4vw, 3.5rem) 1rem 4rem; }
.page.wide { width: min(1020px, 100%); }
.back { display: inline-block; font-size: .88rem; color: var(--green); text-underline-offset: .2em; }
.page-header { margin: 1.6rem 0 1.2rem; }
.page h1 { margin-top: .3rem; font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: -.055em; }
.page-header > p:last-child { max-width: 52ch; line-height: 1.5; }
.panel, .modal-inner { background: var(--paper); border: 1px solid var(--line); border-radius: .7rem; padding: clamp(1rem, 3vw, 1.65rem); }
.form-stack { display: grid; gap: 1rem; }
.form-stack > .button { justify-self: start; }
label { display: grid; gap: .35rem; font-size: .89rem; font-weight: 700; }
input, select, textarea { min-width: 0; width: 100%; min-height: 44px; padding: .62rem .7rem; border: 1px solid #a3aa99; border-radius: .37rem; background: white; color: var(--text); font-size: 1rem; }
textarea { resize: vertical; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; }
small, .assignment-info { color: var(--muted); }
.assignment-info { line-height: 1.48; font-size: .87rem; }
.assignment-info p, .notice, .status { margin: 0; }
.assignment-info ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.notice, .status:not([hidden]) { padding: .68rem .78rem; border-radius: .35rem; background: #f5e5c5; color: #5a411e; line-height: 1.45; }
.receipt { display: grid; justify-items: start; gap: .85rem; }
.receipt h2 { font-size: 2.6rem; }
.receipt p { margin: 0; }
.receipt-mark { display: grid; place-content: center; width: 40px; height: 40px; border-radius: 50%; background: #d5e6d8; color: var(--pine); font-size: 1.35rem; }
#receipt-code { overflow-wrap: anywhere; }
.inbox-tools { flex-wrap: wrap; }
#inbox-list { display: grid; gap: .5rem; }
.inbox-record { padding: .7rem; border: 1px solid var(--line); border-radius: .4rem; }
.inbox-record summary { font-weight: 700; line-height: 1.55; }
.inbox-record .answer { white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-record .record-meta { font-size: .8rem; overflow-wrap: anywhere; color: var(--muted); }
dialog { border: 0; padding: 0; border-radius: .7rem; width: min(455px, calc(100vw - 1.4rem)); color: var(--text); max-height: 94vh; box-shadow: 0 1.1rem 5rem #03150da6; }
dialog::backdrop { background: #102820af; }
.modal-inner { position: relative; padding: 1.4rem; }
dialog h2 { font-size: 2.7rem; margin: .35rem 0 .75rem; }
dialog p { margin: .4rem 0 .8rem; font-size: .95rem; line-height: 1.45; }
.close { position: absolute; top: .65rem; right: .65rem; padding-inline: .72rem; font-size: 1.15rem; }
#qr-code { display: grid; place-items: center; margin: .85rem auto; width: min(280px, 100%); padding: .45rem; background: white; border: 1px solid var(--line); }
#qr-code svg { display: block; width: 100%; height: auto; }
.qr-actions { justify-content: center; }
#qr-status { margin-top: .7rem; }
@media (max-width: 960px) {
  .layout { grid-template-columns: 175px minmax(0, 1fr); }
  .visual-side { gap: 1rem; }
}
@media (max-width: 740px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .side summary { padding: .35rem 0; }
  .side nav { grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); margin: .35rem 0; }
  .stage { min-height: 435px; }
  .cover { grid-template-columns: minmax(0, 1fr) minmax(95px, .45fr); }
  .visual-side { grid-template-columns: minmax(0, 1fr); }
  .visual-side .slide-figure img { max-height: 255px; }
}
@media (max-width: 420px) {
  .brand-icon, .brand small, #fullscreen span { display: none; }
  .top { min-height: 65px; padding-inline: .72rem; }
  .top-actions { gap: .16rem; }
  .top-actions .button { padding-inline: .5rem; }
  .cover { grid-template-columns: minmax(0, 1fr); }
  .cover img { max-height: 225px; }
  .stage h1 { font-size: 2.65rem; }
  .eyebrow { font-size: .64rem; }
  .deck-tools { gap: .3rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .stage > * { animation: appear .18s ease-out; }
  @keyframes appear { from { opacity: .65; transform: translateY(3px); } }
}
.notes p { margin: 0; }
.notes dl { margin: .75rem 0 0; }
.notes dt { margin-top: .6rem; font-weight: 800; }
.notes dd { margin-inline-start: 0; }
.notes ul { margin: .3rem 0 0; }
.form-stack h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.form-help { margin: 0; font-size: .87rem; line-height: 1.45; color: var(--muted); }
#access-notice { margin-bottom: .85rem; }
.text-button { display: inline-block; min-height: 36px; padding: .36rem 0; border: 0; background: transparent; color: var(--green); font-size: .86rem; text-decoration: underline; text-underline-offset: .23em; }
.roster { margin: 1.25rem 0; padding: .8rem; border: 1px solid var(--line); border-radius: .4rem; }
.roster summary { font-weight: 750; }
.roster ul { margin: .7rem 0 0; padding-left: 1.3rem; display: grid; gap: .38rem; }
.roster p { margin: .7rem 0 0; color: var(--muted); }
#roster-count { color: var(--muted); margin-left: .25rem; font-weight: 500; }
.inbox-heading { font-size: 2rem; }
.inbox-record .comment-heading { margin-bottom: .25rem; font-size: .85rem; }
.inbox-record .comment-heading + .answer { margin-top: .25rem; }
#qr-assignment-label { margin-top: .65rem; }

.course-tab { display: inline-flex; align-items: center; min-height: 39px; padding: .45rem .65rem; border: 1px solid transparent; border-radius: .42rem; font-size: .85rem; font-weight: 700; text-decoration: none; }
.course-tab:hover { background: #ffffff13; }
.course-tab[aria-current="page"] { color: #ffe1a5; border-color: #b39456; background: #ffffff0c; }
.attachment-field { display: grid; gap: .5rem; }
.attachment-field button { justify-self: start; }
.attachment-field input { padding: .4rem; }
.attachment-field input::file-selector-button { margin-right: .45rem; padding: .38rem .55rem; border-radius: .3rem; border: 1px solid var(--line); background: var(--paper); color: var(--pine); font: inherit; cursor: pointer; }
.record-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.record-actions button { overflow-wrap: anywhere; max-width: 100%; }
@media (max-width: 560px) {
  .top { flex-wrap: wrap; gap: .2rem .65rem; }
  .top-actions { justify-content: flex-start; }
  .course-tab { padding-inline: .42rem; }
}
