:root {
  color-scheme: light;
  --paper: #f5f1e7;
  --paper-light: #fbf9f2;
  --paper-line: rgba(60, 97, 150, .105);
  --ink: #202b38;
  --graphite: #4b5660;
  --muted: #6d7478;
  --blue: #254b83;
  --red: #a84c42;
  --gold: #b88737;
  --rule: rgba(32, 43, 56, .2);
  --sans: Inter, "Segoe UI", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, var(--paper-line) 36px, transparent 37px);
  background-attachment: fixed;
  font: 16px/1.55 var(--sans);
}
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0 auto 0 clamp(18px, 6.2vw, 94px);
  width: 1px;
  background: rgba(174, 78, 67, .28);
  pointer-events: none;
}
[hidden] { display: none !important; }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: .06em; }
a:hover { color: #17345d; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
::selection { color: white; background: var(--blue); }
.skip-link { position: fixed; z-index: 30; top: -60px; left: 12px; padding: 8px 12px; background: var(--ink); color: white; }
.skip-link:focus { top: 12px; }

.lab-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 64px;
  padding: 8px max(calc((100% - 1140px) / 2), 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: rgba(245, 241, 231, .96);
  border-bottom: 1px solid var(--rule);
}
.lab-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; }
.lab-brand img { width: 42px; height: 35px; object-fit: contain; }
.lab-brand small { display: block; margin-top: -4px; color: var(--muted); font-size: .65rem; font-weight: 500; letter-spacing: .04em; }
.lab-header nav { display: flex; flex-wrap: wrap; gap: clamp(14px, 3vw, 32px); font-size: .82rem; }
.lab-header nav a { color: var(--graphite); text-decoration: none; }
.lab-header nav a:hover { color: var(--blue); text-decoration: underline; }

main { width: min(100% - 64px, 1140px); margin: 0 auto; }
.opening { max-width: 980px; min-height: min(670px, 78vh); padding: clamp(70px, 11vh, 132px) 0 92px clamp(24px, 8vw, 112px); }
.margin-note { margin: 0 0 12px; color: var(--red); font: italic 1rem var(--serif); transform: rotate(-1.2deg); transform-origin: left; }
.opening h1 { margin: 0; font-size: clamp(3rem, 8vw, 6.4rem); line-height: .96; letter-spacing: -.07em; font-weight: 680; }
.opening h1 em { color: var(--blue); font-family: var(--serif); font-weight: 400; }
.opening-copy { max-width: 560px; margin: 28px 0 0; color: var(--graphite); font: 1.14rem/1.62 var(--serif); }
.opening-caveat { max-width: 610px; margin: 17px 0 22px; color: var(--muted); font-size: .82rem; }
.quiet-link { color: var(--muted); font-size: .84rem; text-decoration: none; }
.quiet-link span { margin-left: 7px; color: var(--red); }

.notebook-spread, .atlas-section, .honesty-section { padding: 64px clamp(0px, 3vw, 38px) 84px clamp(22px, 8vw, 112px); border-top: 1px solid var(--rule); }
.section-kicker { display: flex; gap: 13px; align-items: baseline; margin-bottom: 14px; color: var(--muted); font: .76rem var(--mono); text-transform: uppercase; letter-spacing: .075em; }
.section-kicker span:first-child { color: var(--red); }
.journey-tabs { display: flex; flex-wrap: wrap; gap: 8px 24px; width: fit-content; max-width: 100%; border-bottom: 1px solid var(--rule); }
.journey-tab { padding: 12px 2px 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: .93rem; }
.journey-tab.is-active { color: var(--blue); border-color: var(--blue); font-weight: 650; }
.journey-panel { padding: 34px 0 0; }
.panel-intro { max-width: 690px; margin-bottom: 30px; }
.panel-intro h2, .atlas-section h2, .honesty-section h2 { margin: 0; font: 400 clamp(2rem, 4vw, 3.1rem)/1.08 var(--serif); letter-spacing: -.035em; }
.panel-intro > p:last-child { max-width: 650px; margin: 12px 0 0; color: var(--graphite); }
.sample-picker { max-width: 850px; padding: 14px 0 16px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.sample-picker > label, .work-input > label, .photo-input > label, #topic-panel > label { display: block; margin-bottom: 7px; font-weight: 650; }
.sample-controls { display: flex; flex-wrap: wrap; gap: 8px; }
select, input[type="text"], input[type="number"], textarea {
  min-width: 0;
  color: var(--ink);
  border: 1px solid rgba(32, 43, 56, .3);
  border-radius: 2px;
  background: rgba(255, 254, 250, .88);
}
select { min-height: 40px; max-width: 100%; padding: 7px 30px 7px 10px; }
input[type="text"] { min-height: 42px; padding: 8px 10px; }
textarea { display: block; width: 100%; resize: vertical; padding: 13px 14px; font: .96rem/1.8 var(--mono); }
textarea::placeholder { color: #81847f; opacity: 1; }
.small-note { margin: 8px 0 0; color: var(--muted); font-size: .77rem; line-height: 1.5; }
.work-entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 62px); margin-top: 28px; align-items: start; }
.work-input, .photo-input { min-width: 0; }
.work-input textarea { min-height: 190px; }
.photo-input > p { margin: 0 0 12px; }
input[type="file"] { max-width: 100%; color: var(--graphite); font-size: .82rem; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 13px; }
.ink-button, .quiet-button {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 2px;
  font-size: .83rem;
  font-weight: 620;
}
.ink-button { border: 1px solid var(--blue); background: var(--blue); color: white; }
.ink-button:hover { background: #17345d; }
.quiet-button { border: 1px solid rgba(32, 43, 56, .24); background: transparent; color: var(--blue); }
.quiet-button:hover { background: rgba(255, 255, 255, .42); }
button:disabled { cursor: not-allowed; opacity: .58; }
.live-note { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); font-size: .79rem; }
.photo-stage { margin-top: 16px; padding-top: 13px; border-top: 1px dashed rgba(32, 43, 56, .35); }
#photo-canvas { display: block; width: 100%; max-height: 470px; border: 1px solid var(--rule); background: var(--paper-light); object-fit: contain; touch-action: none; cursor: crosshair; }
.crop-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 11px 0 0; padding: 10px; border: 1px solid var(--rule); }
.crop-fields legend { padding: 0 6px; color: var(--muted); font-size: .73rem; }
.crop-fields label { display: grid; gap: 3px; color: var(--graphite); font-size: .72rem; }
.crop-fields input { width: 100%; height: 34px; padding: 5px; font: .82rem var(--mono); }
.photo-buttons { align-items: flex-start; }
.ocr-result { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--rule); }
.ocr-result label { display: block; margin-bottom: 7px; font-size: .83rem; font-weight: 650; }
.ocr-result textarea { min-height: 70px; font-size: .86rem; }
.ocr-sequence { margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(32, 43, 56, .4); }
.ocr-sequence h3 { margin: 0 0 5px; font: 1.2rem/1.25 var(--serif); }
.ocr-sequence > p { margin: 0 0 10px; }
.ocr-sequence-list { margin: 0; padding: 0; list-style: none; counter-reset: ocr-line; }
.ocr-sequence-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); counter-increment: ocr-line; }
.ocr-sequence-crop { display: block; width: 128px; max-height: 74px; object-fit: contain; border: 1px solid var(--rule); background: white; }
.ocr-sequence-content { min-width: 0; }
.ocr-sequence-content label { display: block; margin-bottom: 5px; color: var(--graphite); font-size: .75rem; font-weight: 650; }
.ocr-sequence-content textarea { min-height: 52px; font: .86rem/1.4 var(--mono); }
.ocr-line-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ocr-line-controls button { padding: 5px 8px; font-size: .72rem; }
.ocr-sequence .button-row { margin: 12px 0 4px; }
.ocr-sequence .button-row button { border-radius: 2px; }

#topic-panel { max-width: 830px; }
#topic-question { display: block; width: 100%; max-width: 680px; }
.concept-library { max-width: 800px; margin: 26px 0 36px; padding: 17px 0 20px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.concept-library h3, .atlas-search h3 { margin: 0 0 7px; font: 400 1.35rem/1.2 var(--serif); }
.concept-library > p, .atlas-search > p { max-width: 670px; margin: 6px 0 14px; color: var(--graphite); font-size: .84rem; }
.concept-lesson-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.concept-choice { min-width: 0; padding: 11px 10px 12px 0; border-top: 2px solid var(--blue); }
.concept-choice p { margin: 4px 0 9px; color: var(--muted); font-size: .75rem; }
.concept-choice button { min-height: 38px; padding: 6px 9px; border: 1px solid rgba(32, 43, 56, .25); border-radius: 2px; background: transparent; color: var(--blue); text-align: left; font-size: .78rem; font-weight: 650; }
.concept-choice button:hover { background: rgba(255, 255, 255, .42); }
.learning-route { max-width: 800px; margin: 24px 0 30px; padding: 15px 17px 16px; border-top: 2px solid var(--gold); border-bottom: 1px solid var(--rule); background: rgba(245, 238, 220, .52); }
.learning-route h3 { margin: 0 0 7px; font: 400 1.3rem/1.2 var(--serif); }
.learning-route > p:not(.margin-note) { max-width: 680px; margin: 6px 0 12px; color: var(--graphite); }
.learning-route details { margin: 10px 0 12px; color: var(--muted); font-size: .78rem; }
.learning-route summary { width: fit-content; cursor: pointer; color: var(--blue); font-weight: 650; }
.learning-route details p { max-width: 720px; overflow-wrap: anywhere; }
.learning-route .button-row { margin-top: 12px; }
.checked-work-coach { max-width: 800px; margin: 24px 0 30px; padding: 17px 0 19px; border-top: 2px solid var(--blue); border-bottom: 1px solid var(--rule); }
.checked-work-coach h3 { margin: 0 0 7px; font: 400 1.45rem/1.2 var(--serif); }
.checked-work-coach > p:not(.margin-note) { max-width: 690px; color: var(--graphite); }
.checked-work-coach-step { margin-top: 15px; }
.checked-work-coach-step > label { display: block; margin-bottom: 6px; font-size: .84rem; font-weight: 650; }
.checked-work-coach-step select { min-width: min(100%, 330px); max-width: 100%; min-height: 42px; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 2px; background: var(--paper); color: var(--ink); }
.checked-work-coach-actions { margin-top: 14px; }
.checked-work-coach-explanation { max-width: 690px; margin-top: 16px; padding: 12px 14px; border-left: 2px solid var(--gold); background: rgba(255, 254, 250, .72); }
.checked-work-coach-explanation h4 { margin: 0 0 5px; font: 400 1.08rem/1.25 var(--serif); }
.checked-work-coach-explanation p { margin: 0; color: var(--graphite); font-size: .86rem; line-height: 1.55; }
.checked-work-coach-status { margin: 12px 0 0; color: var(--muted); font-size: .78rem; }
.concept-lesson { max-width: 800px; margin: 0 0 42px; padding: 20px clamp(14px, 3vw, 26px) 24px; border-left: 3px solid var(--gold); background: rgba(255, 254, 250, .62); }
.concept-lesson-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.concept-lesson-heading h3 { margin: 0; font: 400 clamp(1.55rem, 3.5vw, 2.25rem)/1.13 var(--serif); }
.concept-lesson-heading .margin-note { font-size: .8rem; }
.concept-lesson-heading button { flex: 0 0 auto; }
.concept-statement { max-width: 680px; margin: 12px 0 4px; color: var(--graphite); font: 1rem/1.55 var(--serif); }
.concept-lesson-notes { margin: 16px 0 21px; color: var(--muted); font-size: .78rem; }
.concept-lesson-notes summary { width: fit-content; color: var(--blue); cursor: pointer; font-weight: 650; }
.concept-lesson-notes p { margin: 7px 0; }
.concept-worked, .concept-quick-check, .concept-transfer { margin-top: 22px; padding-top: 17px; border-top: 1px dashed var(--rule); }
.concept-repair { margin: 22px 0; padding: 16px 16px 18px; border: 1px solid rgba(184, 135, 55, .45); border-left: 3px solid var(--gold); background: rgba(255, 254, 250, .7); }
.concept-repair h4 { margin: 0 0 8px; font: 400 1.25rem/1.25 var(--serif); }
.concept-repair > label { display: block; margin: 12px 0 6px; font-weight: 650; }
.concept-repair textarea { min-height: 150px; }
.guided-practice-button { margin-top: 8px; border-radius: 2px; }
.concept-worked h4, .concept-quick-check h4, .concept-transfer h4 { margin: 0 0 9px; font: 400 1.25rem/1.25 var(--serif); }
.concept-worked .margin-note, .concept-quick-check .margin-note, .concept-transfer .margin-note { font-size: .83rem; }
.concept-check-note { margin: 12px 0 0; padding-left: 11px; border-left: 2px solid var(--gold); color: var(--muted); font-size: .76rem; }
.concept-transfer > label { display: block; margin-top: 10px; font-weight: 650; }
.concept-transfer input[type="text"] { flex: 1 1 220px; font-family: var(--mono); }
.atlas-search { max-width: 800px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--rule); }
.topic-response { max-width: 760px; margin-top: 28px; padding: 22px 0; border-top: 2px solid var(--blue); border-bottom: 1px solid var(--rule); }
.topic-response h3 { margin: 0 0 12px; font: 400 1.55rem var(--serif); }
.topic-response p { margin: 8px 0; color: var(--graphite); }
.topic-response ol { padding-left: 23px; }
.topic-response li { margin: 8px 0; }
.topic-match { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--rule); }
.topic-match > p:first-of-type { color: var(--muted); font: .76rem var(--mono); }
.topic-match .quiet-button { margin-top: 8px; }
.topic-teach-response { max-width: 760px; margin-top: 28px; padding: 22px 0; border-top: 2px solid var(--gold); border-bottom: 1px solid var(--rule); }
.topic-teach-response h3 { margin: 0 0 12px; font: 400 1.55rem/1.2 var(--serif); }
.topic-teach-response h4 { margin: 20px 0 5px; font: 650 1rem var(--sans); }
.topic-teach-response > p:not(.margin-note) { color: var(--graphite); white-space: pre-wrap; overflow-wrap: anywhere; }
.topic-teach-response .margin-note { font-size: .9rem; }
.topic-tutor-turn + .topic-tutor-turn { margin-top: 28px; padding-top: 22px; border-top: 1px dashed var(--rule); }
.topic-tutor-speaker { margin: 10px 0 5px; color: var(--muted); font: .68rem var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.topic-tutor-question { margin: 5px 0 14px; padding-left: 12px; border-left: 2px solid var(--blue); white-space: pre-wrap; overflow-wrap: anywhere; }
.topic-tutor-turn > p:not(.topic-tutor-speaker):not(.topic-tutor-question):not(.topic-tutor-caveat) { white-space: pre-wrap; overflow-wrap: anywhere; }
.topic-tutor-caveat { margin-top: 24px; padding-left: 12px; border-left: 2px solid var(--gold); font-size: .82rem; }
.ask-panel > label { display: block; margin-bottom: 7px; font-weight: 650; }
#math-request { max-width: 820px; min-height: 112px; }
.math-interpretation { max-width: 820px; margin-top: 24px; padding: 17px 18px; border-left: 3px solid var(--gold); background: rgba(255, 254, 250, .72); }
.math-interpretation h3 { margin: 0 0 12px; font: 400 clamp(1.45rem, 3vw, 2rem)/1.18 var(--serif); }
.math-interpretation-fields { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 6px 13px; margin: 14px 0; }
.math-interpretation-fields dt { color: var(--muted); font: .69rem/1.5 var(--mono); text-transform: uppercase; }
.math-interpretation-fields dd { min-width: 0; margin: 0; color: var(--graphite); overflow-wrap: anywhere; }
.math-interpretation-question { margin: 10px 0 0; color: var(--graphite); }
.math-interpretation-choices { margin-top: 10px; }
.model-consent { max-width: 820px; margin-top: 18px; padding: 14px 16px; border-left: 3px solid var(--red); background: rgba(255, 254, 250, .78); }
.model-consent h3, .model-consent h4 { margin: 0 0 8px; font: 400 clamp(1.35rem, 2.8vw, 1.8rem)/1.2 var(--serif); }
.model-consent > p { max-width: 760px; margin: 8px 0; color: var(--graphite); font-size: .84rem; line-height: 1.55; }
.model-consent blockquote { max-height: 190px; overflow: auto; margin: 12px 0; padding: 10px 12px; border-left: 1px solid var(--rule); color: var(--blue); white-space: pre-wrap; overflow-wrap: anywhere; font: .88rem/1.55 var(--mono); }
.model-consent .model-retention-note { color: var(--muted); font-size: .77rem; }
.model-consent a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.math-answer { max-width: 820px; margin-top: 32px; padding-top: 20px; border-top: 2px solid var(--blue); }
.math-answer h3 { margin: 0 0 10px; font: 400 clamp(1.65rem, 3.5vw, 2.35rem)/1.15 var(--serif); }
.math-answer-value { margin: 14px 0; padding: 10px 0; color: var(--blue); font: 1.1rem/1.6 var(--mono); overflow-wrap: anywhere; }
.math-answer-steps { margin: 0; padding-left: 25px; }
.math-answer-steps li { padding: 6px 0; border-bottom: 1px dotted var(--rule); }
.math-step-status { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.math-step-status.is-checked::before { content: "↳ "; color: #34715c; }
.math-step-status.is-failed { color: var(--red); }
.math-step-why { width: fit-content; max-width: 100%; margin-top: 7px; color: var(--graphite); font-size: .82rem; }
.math-step-why summary { width: fit-content; color: var(--blue); cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.math-step-why summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.math-step-why p { max-width: 680px; margin: 7px 0 3px; line-height: 1.55; }
.math-answer-practice { max-width: 760px; margin: 22px 0; padding: 15px 0; border-top: 1px dashed var(--rule); border-bottom: 1px dashed var(--rule); }
.math-answer-practice h4 { margin: 0 0 7px; font: 600 1rem var(--sans); }
.math-answer-practice > p { margin: 5px 0 12px; color: var(--graphite); font-size: .85rem; }
.math-answer-practice ol { margin: 0; padding-left: 22px; }
.math-answer-practice li { margin: 12px 0; }
.math-answer-practice li p { margin: 5px 0; }
.math-practice-answer { color: var(--blue); font: .92rem/1.55 var(--mono); overflow-wrap: anywhere; }
.math-answer-check { margin: 15px 0 0; padding-left: 13px; border-left: 2px solid var(--gold); color: var(--graphite); font-size: .85rem; }
.engine-notes { max-width: 820px; margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--rule); color: var(--graphite); font-size: .83rem; }
.engine-notes summary { width: fit-content; color: var(--blue); cursor: pointer; font-weight: 650; }
.engine-notes p { max-width: 720px; }

.analysis-section { margin-top: 58px; padding: 30px 0 0; border-top: 2px solid var(--blue); max-width: 890px; }
.analysis-section > h2 { margin: 0; font: 400 clamp(2rem, 4vw, 3rem)/1.1 var(--serif); }
.result-summary { max-width: 710px; margin: 12px 0 18px; color: var(--graphite); }
.step-list { max-width: 820px; margin: 0; padding: 0 0 0 35px; list-style: none; counter-reset: written-step; }
.step-row { position: relative; min-height: 50px; padding: 10px 12px; border-bottom: 1px solid rgba(60, 97, 150, .2); counter-increment: written-step; }
.step-row::before { position: absolute; top: 14px; left: -34px; color: #89877e; font: .72rem var(--mono); content: counter(written-step, decimal-leading-zero); }
.step-row code { font: 1rem/1.5 var(--mono); overflow-wrap: anywhere; }
.step-row.is-candidate { color: #7e382f; border-bottom-color: rgba(168, 76, 66, .6); background: rgba(168, 76, 66, .055); }
.step-row.is-candidate::after { content: "first changed line"; float: right; margin-left: 10px; color: var(--red); font: .67rem var(--mono); }
.step-row.is-calculus-candidate::after { content: none; display: none; }
.step-row .candidate-kind { float: right; margin-left: 10px; color: var(--red); font: .67rem var(--mono); }
.candidate-note { max-width: 780px; margin-top: 19px; padding: 13px 15px; border-left: 2px solid var(--gold); background: rgba(184, 135, 55, .09); color: #5c4b2c; font-size: .84rem; }
.probe-section, .lesson-section { max-width: 800px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--rule); }
.probe-section h3, .lesson-section h3 { margin: 0 0 15px; font: 400 1.6rem/1.2 var(--serif); }
.answer-options { display: grid; gap: 9px; margin: 0 0 10px; padding: 0; border: 0; }
.answer-options legend { margin-bottom: 9px; font-weight: 650; }
.answer-option { display: flex; gap: 10px; align-items: flex-start; max-width: 650px; padding: 8px 0; border-bottom: 1px dotted var(--rule); cursor: pointer; }
.answer-option input { margin-top: 5px; accent-color: var(--blue); }
.lesson-steps { margin: 0; padding-left: 24px; }
.lesson-steps li { padding: 8px 0 10px 5px; border-bottom: 1px solid rgba(60, 97, 150, .15); }
.transfer-box { max-width: 650px; margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--rule); }
.transfer-box > label { display: block; font-weight: 650; }
.transfer-box input[type="text"] { flex: 1 1 180px; min-height: 40px; padding: 8px 10px; font-family: var(--mono); }

.atlas-section h2 { max-width: 620px; }
.section-subhead { max-width: 650px; color: var(--graphite); font: 1.02rem/1.58 var(--serif); }
.atlas-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(18px, 5vw, 62px); margin-top: 28px; }
.atlas-strand { border-top: 1px solid var(--rule); }
.atlas-strand h3 { margin: 14px 0 7px; color: var(--blue); font-size: .92rem; }
.atlas-strand ol { margin: 0 0 17px; padding-left: 22px; color: var(--graphite); font-size: .84rem; }
.atlas-strand li { padding: 4px 0; }
.honesty-section { max-width: 980px; border-top: 1px solid var(--rule); }
.honesty-section p { max-width: 760px; color: var(--graphite); }
.honesty-section a { display: inline-block; margin-top: 6px; font-size: .86rem; }
.lab-footer { display: flex; justify-content: space-between; gap: 20px; width: min(100% - 64px, 1140px); margin: 0 auto; padding: 18px 0 28px; border-top: 1px solid var(--rule); color: var(--muted); font-size: .76rem; }
.lab-footer a { color: var(--blue); }
.noscript-note { width: min(100% - 64px, 1140px); margin: 0 auto 24px; color: var(--muted); font-size: .8rem; }

@media (max-width: 760px) {
  .lab-header { padding-inline: 18px; align-items: flex-start; }
  .lab-header nav { justify-content: flex-end; gap: 9px 14px; padding-top: 7px; font-size: .74rem; }
  main, .lab-footer { width: min(100% - 36px, 680px); }
  .opening { min-height: auto; padding: 74px 0 72px 18px; }
  .notebook-spread, .atlas-section, .honesty-section { padding: 48px 0 62px 18px; }
  .work-entry-grid { grid-template-columns: 1fr; }
  .work-input textarea { min-height: 170px; }
  .crop-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atlas-list { grid-template-columns: 1fr; gap: 17px; }
  .concept-lesson-choices { grid-template-columns: 1fr; }
  .concept-choice { padding: 10px 0; }
  .checked-work-coach-step .button-row { align-items: stretch; }
  .checked-work-coach-step select { width: 100%; }
  .concept-lesson-heading { display: block; }
  .concept-lesson-heading button { margin-top: 12px; }
  .lab-footer { flex-direction: column; }
  .noscript-note { width: min(100% - 36px, 680px); }
}
@media (max-width: 420px) {
  .lab-header { padding-inline: 12px; gap: 8px; }
  .lab-brand { gap: 5px; font-size: .9rem; }
  .lab-brand img { width: 34px; }
  .lab-header nav { display: grid; gap: 3px; font-size: .69rem; }
  main, .lab-footer { width: min(100% - 24px, 400px); }
  .opening h1 { font-size: clamp(2.8rem, 13vw, 3.8rem); }
  .journey-tabs { gap: 8px 16px; }
  .journey-tab { font-size: .84rem; }
  .sample-controls { display: grid; grid-template-columns: 1fr; }
  .sample-controls select, .sample-controls button { width: 100%; }
  .step-row { padding-right: 2px; }
  .step-row.is-candidate::after { display: block; float: none; margin: 4px 0 0; }
  .button-row > button { max-width: 100%; }
  .math-interpretation { padding: 14px 12px; }
  .math-interpretation-fields { grid-template-columns: 94px minmax(0, 1fr); gap: 5px 9px; }
  .photo-buttons { display: grid; grid-template-columns: 1fr; }
  .photo-buttons button { width: 100%; }
  .ocr-sequence-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ocr-sequence-crop { width: 100%; height: auto; max-height: 86px; object-position: left center; }
  .ocr-line-controls button { padding: 5px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
