:root {
  color-scheme: light;
  --paper: #f6f6ed;
  --surface: #fffef7;
  --ink: #1a3128;
  --muted: #4b6056;
  --leaf: #205d42;
  --edge: #bdcec0;
  --mint: #dfeeda;
  --accent: #994613;
  font-family: system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
[hidden] { display: none !important; }
a { color: var(--leaf); text-underline-offset: .23em; }
a:hover { text-decoration-thickness: .14em; }
a:focus-visible, button:focus-visible { outline: 3px solid #a64c10; outline-offset: 4px; }
button { color: var(--ink); font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
.skip { position: absolute; z-index: 2; transform: translateY(-160%); padding: .6rem; background: white; }
.skip:focus { transform: none; }
.mast, .end, .shell { width: min(69rem, 100% - 3rem); margin-inline: auto; }
.mast, .end { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.mast { border-bottom: 1px solid var(--edge); padding-block: 1.25rem; }
.mast nav, .tools, .tabs, .run, .after-lesson { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.mast nav { gap: 1.25rem; }
.mast nav a, .end a { font-size: .875rem; font-weight: 600; }
.wordmark { font-weight: 850; letter-spacing: .08em; color: var(--ink); text-decoration: none; }
.wordmark span { font-weight: 500; letter-spacing: 0; color: var(--muted); }
.shell { padding-block: clamp(2rem, 5vw, 4rem); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: normal; line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.3vw, 5.3rem); letter-spacing: -.045em; margin: .45rem 0 .95rem; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.7rem); letter-spacing: -.035em; }
h3 { font-size: 1rem; line-height: 1.3; }
.intro { max-width: 55rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 750; color: var(--leaf); }
.deck { font-size: clamp(1.08rem, 2.5vw, 1.28rem); line-height: 1.5; max-width: 49rem; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr)); gap: 1rem; margin-block: 2rem; }
.lesson-card, .stage, .teacher-note { border: 1px solid var(--edge); border-radius: 1rem; }
.lesson-card { display: grid; grid-template-columns: 6.75rem 1fr; gap: 1rem; align-items: center; padding: 1.25rem; text-decoration: none; background: var(--surface); color: var(--ink); }
.lesson-card:hover { border-color: var(--leaf); }
.mini-board { background: #e6efdf; border-radius: .6rem; padding: .4rem; }
.lesson-card h2, .teacher-note h2 { font-size: 1.7rem; }
.lesson-card p { color: var(--muted); font-size: .95rem; margin: .5rem 0; }
.card-link, .teacher-note a { font-size: .91rem; color: var(--leaf); font-weight: 700; }
.teacher-note { background: var(--mint); padding: clamp(1.2rem, 3vw, 2rem); }
.teacher-note p { max-width: 54rem; margin: .65rem 0; }
.end { border-top: 1px solid var(--edge); padding: 1rem 0 2rem; flex-wrap: wrap; }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-block: 1.5rem; }
button { border: 1px solid #869e8e; background: var(--surface); border-radius: .55rem; min-height: 2.8rem; padding: .5rem .85rem; font-size: .94rem; line-height: 1.3; }
button:not(:disabled):hover { border-color: var(--leaf); background: #eaf4e4; }
button[aria-pressed="true"] { background: var(--mint); border-color: var(--leaf); box-shadow: inset 0 0 0 1px var(--leaf); }
.rule { border-left: 3px solid #74a37c; padding: .1rem 1rem; margin: 1.35rem 0; max-width: 59rem; }
.rule p, .reflection p { color: var(--muted); }
.stage { padding: clamp(1rem, 3vw, 2rem); background: var(--surface); margin-top: 1rem; }
.stage-heading h2 { margin: .3rem 0 .5rem; }
.stage-heading > p:last-child { font-size: 1.08rem; max-width: 52rem; }
.board-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(15rem, .85fr); gap: clamp(1rem, 3vw, 2.5rem); align-items: start; margin-top: 1.25rem; }
.board { width: 100%; display: block; aspect-ratio: 1; }
.grid-lines { stroke: #9bb29e; stroke-width: .4; fill: none; }
.axes { font: 4px system-ui, sans-serif; text-anchor: middle; fill: #425c4a; }
.live-dots { fill: #23583d; }
.focus-cell { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 1; }
.starting-figure { max-width: 17rem; }
figcaption { font-size: .92rem; color: var(--muted); }
.live-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr)); gap: .65rem; }
.live-boards figure { padding: .65rem; background: #eff4e8; border: 1px solid var(--edge); border-radius: .7rem; min-width: 0; }
.live-boards figure:only-child { width: min(100%, 19rem); }
.live-boards .coords { display: block; font-size: .77rem; line-height: 1.35; margin: .25rem 0 .45rem; }
figcaption strong { color: var(--ink); }
.interactive .stage:not(.current), .interactive .starting-figure { display: none; }
.workpad { min-width: 0; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin: .6rem 0 1rem; }
.choice { min-height: 2.65rem; }
.choice:disabled:not([aria-pressed="true"]) { color: #536159; border-color: var(--edge); }
.step, .step:not(:disabled):hover { color: white; background: var(--leaf); font-weight: 650; }
.step:disabled { color: #415649; background: #d7e3d5; border-color: #a1b2a5; }
.reset:disabled { color: #56645a; border-color: #bdcec0; }
.status { font-size: .95rem; padding: .75rem 0; min-height: 2.5rem; }
.reflection { margin-top: .55rem; border-top: 1px solid var(--edge); padding-top: .75rem; }
.reflection p { margin-top: .25rem; }
.after-lesson { margin-top: 1.4rem; justify-content: space-between; }
.after-lesson a { font-size: .93rem; }
.guide { max-width: 53rem; }
.guide .print { margin-top: 1rem; }
.schedule, .guide-section { margin-top: 2rem; }
.schedule ol { padding-left: 1.5rem; }
.schedule li, .guide-section p, .guide-section h3, .student-link { margin-top: .65rem; }
.guide-section { border-top: 1px solid var(--edge); padding-top: 1.25rem; }
.guide-section .eyebrow { margin: 0 0 .35rem; }
.student-link { display: inline-block; }
@media screen {
  .projecting .mast, .projecting .intro, .projecting .end, .projecting .after-lesson, .projecting .print { display: none; }
  .projecting .shell { width: min(95%, 92rem); padding-block: .5rem; }
  .projecting .toolbar { margin-block: .6rem; }
  .projecting .stage, .projecting .rule { font-size: clamp(1.05rem, 1.6vw, 1.5rem); }
  .projecting .stage-heading > p:last-child, .projecting h3, .projecting .status, .projecting figcaption, .projecting button { font-size: 1.1em; }
  .projecting .live-boards figure:only-child { width: min(100%, 28rem); }
}
@media (max-width: 47rem) {
  .board-layout { grid-template-columns: 1fr; gap: 1rem; }
}
@media (max-width: 34rem) {
  .shell, .mast, .end { width: calc(100% - 1.4rem); }
  .mast { flex-wrap: wrap; gap: .25rem; }
  .mast nav { gap: .85rem; }
  .lesson-card { grid-template-columns: 4.6rem 1fr; padding: 1rem; gap: .75rem; }
  .live-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-boards figure:only-child { grid-column: 1 / -1; }
  .live-boards figure { padding: .35rem; }
  .live-boards figcaption { font-size: .84rem; }
}
@page { margin: 14mm; }
@media print {
  :root { color: black; background: white; font-size: 10pt; }
  body { line-height: 1.4; }
  .shell { width: 100%; max-width: none; padding: 0; }
  .skip, .mast, .end, .toolbar, .after-lesson, .live-boards, .control-panel, .print, .student-link, noscript { display: none !important; }
  .lesson .stage, .interactive .starting-figure { display: block !important; }
  .stage { border: 0; padding: 0; margin: 4mm 0; background: white; }
  .stage + .stage { break-before: page; }
  .board-layout { display: block; margin-top: 3mm; }
  .board, .starting-figure { width: 67mm; max-width: 100%; }
  .eyebrow, .deck, figcaption, .reflection p, .rule p { color: black; }
  .live-dots { fill: black; }
  .grid-lines { stroke: #888; }
  .focus-cell { stroke: black; }
  .intro { max-width: none; }
  h1 { font-size: 25pt; margin-block: 2mm; }
  h2, .teacher-note h2 { font-size: 18pt; }
  .deck, .stage-heading > p:last-child { font-size: 11pt; }
  .rule { margin: 3mm 0; }
  .response-lines { height: 25mm; border-bottom: 1px solid #aaa; }
  .starting-figure { break-inside: avoid; }
  .reflection { margin-top: 5mm; }
  .schedule, .guide-section { margin-top: 5mm; break-inside: avoid; }
}
.grid-template { width: 0; height: 0; position: absolute; overflow: hidden; }
.print-work { display: none; }
@media screen and (max-width: 34rem) {
  .toolbar { display: grid; gap: .45rem; }
  .toolbar .tabs, .toolbar .tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .toolbar button { min-width: 0; padding-inline: .4rem; }
  .projecting .toolbar .tools { grid-template-columns: 1fr; }
}
@media print {
  .print-work { display: block; margin-top: 4mm; }
  .pencil-boards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3mm; }
  .pencil-boards svg { width: 100%; display: block; }
  .pencil-boards figure { break-inside: avoid; }
  .pencil-boards figcaption { font-size: 9pt; }
}
.setup-link { display: inline-block; margin-top: .9rem; }
.teacher-note .setup-link { margin-left: 1rem; }
.file-list { list-style: none; padding: 0; }
.file-list li { display: flex; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; padding-block: .55rem; border-bottom: 1px solid var(--edge); }
.file-list a { font-weight: 600; }
.file-list span { color: var(--muted); font-size: .9rem; }
@media (max-width: 36rem) {
  .teacher-note .setup-link { display: block; margin: .55rem 0 0; }
}
@media print {
  .setup-link { display: none; }
}
