:root {
  --ink: #252b31;
  --muted: #606a74;
  --link: #245885;
  --line: #d9dfe4;
  --paper: #fff;
  --wash: #f4f6f8;
  --accent: #bd7429;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    17px/1.7 Georgia,
    "Times New Roman",
    serif;
}
a {
  color: var(--link);
  text-underline-offset: 3px;
}
a:hover {
  color: #16374f;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  overflow: auto;
  background: var(--wash);
  border-right: 1px solid var(--line);
  padding: 30px 22px;
  font-family: system-ui, sans-serif;
}
.brand {
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}
.course-label {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 28px;
}
#nav a {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  padding: 9px 10px;
  margin: 3px -10px;
  border-left: 3px solid transparent;
  color: #49545f;
}
#nav a.active {
  background: #e7edf3;
  color: #174a75;
  border-left-color: #245885;
}

#connection {
  font-size: 11px;
  color: var(--muted);
  margin-top: 30px;
}
main {
  margin-left: 260px;
  max-width: 1100px;
  padding: 45px 55px 80px;
  overflow-wrap: anywhere;
}
h1,
h2,
h3,
summary,
button,
label,
.meta,
.small,
.breadcrumb,
.stage-nav,
.page-turn,
.reference-strip,
.criteria,
.assistance,
footer {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}
h1 {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin: 8px 0 25px;
  font-weight: 650;
}
h2 {
  font-size: 22px;
  line-height: 1.4;
  margin: 30px 0 14px;
  font-weight: 650;
}
h3 {
  font-size: 18px;
  line-height: 1.45;
  margin: 25px 0 12px;
}
p {
  margin: 13px 0;
}
article {
  max-width: 72ch;
}
.lesson-purpose {
  color: var(--muted);
  font-size: 17px;
}
.meta,
.small,
footer {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.breadcrumb {
  font-size: 13px;
  margin: 0 0 20px;
}
.next-task {
  border-left: 3px solid var(--link);
  padding: 1px 0 4px 22px;
  margin: 25px 0 35px;
}
.next-task h2 {
  margin-top: 10px;
}
.resume {
  display: inline-block;
  font: 13px system-ui;
  margin: 10px 0;
}
.contents {
  padding-left: 27px;
}
.contents li {
  border-bottom: 1px solid var(--line);
  padding: 20px 0 22px 8px;
}
.contents li > a {
  font: 600 17px system-ui;
}
.contents li p {
  font-size: 16px;
  margin: 8px 0;
}
.stage-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 25px 0 32px;
  overflow-x: auto;
}
.stage-nav a {
  flex: 1;
  padding: 12px 9px;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  min-width: 105px;
  color: var(--muted);
}
.stage-nav span {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}
.stage-nav a[aria-current] {
  border-color: var(--link);
  color: var(--link);
  background: var(--wash);
}
.lesson-section {
  padding-bottom: 18px;
}
.reference-strip {
  font-size: 12px;
  line-height: 1.6;
  background: var(--wash);
  padding: 12px 16px;
  margin: 15px 0 24px;
  border-left: 2px solid var(--line);
}
.reference-strip > span {
  display: block;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.reference-strip a {
  display: block;
  margin: 4px 0;
}
.reference-strip small {
  font-size: 11px;
  color: var(--muted);
}
figure {
  margin: 25px 0;
}
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  margin: auto;
}
figcaption {
  font: 13px/1.6 system-ui;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.eq {
  padding: 16px 20px;
  margin: 22px 0;
  border-left: 2px solid var(--line);
  background: #fafbfc;
  font:
    20px/1.9 Cambria,
    Georgia,
    serif;
  overflow: auto;
}
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 0;
}
.walkthrough-step {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.walkthrough-step:last-child {
  border-bottom: 1px solid var(--line);
}
summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--link);
}
.walkthrough-step > div,
.walkthrough-step > p {
  margin-left: 16px;
}
.problem-list {
  list-style: none;
  padding: 0;
}
.problem-list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.problem-list a {
  font: 600 16px/1.5 system-ui;
}
.problem-list p {
  margin: 8px 0;
  font-size: 16px;
}
.problem-prompt {
  padding: 12px 0;
  border-block: 1px solid var(--line);
  margin: 24px 0;
  font-size: 18px;
}
.criteria {
  font-size: 13px;
  color: var(--muted);
}
.assistance {
  font-size: 13px;
  border-left: 3px solid var(--accent);
  padding: 10px 16px;
  background: #fffbf5;
}
.page-turn {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  margin-top: 38px;
  padding-top: 20px;
  font-size: 14px;
}
.form-row,
.filters {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.form-row > div,
.filters > div {
  flex: 1;
  min-width: 180px;
}
label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin: 14px 0 6px;
}
input,
select,
textarea {
  font: 15px/1.5 system-ui;
  border: 1px solid #adb8c3;
  border-radius: 3px;
  padding: 9px;
  background: white;
  color: var(--ink);
  max-width: 100%;
}
input:not([type="range"]),
select {
  width: 100%;
}
textarea {
  width: 100%;
  min-height: 230px;
  display: block;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 14px;
  line-height: 1.7;
}
button,
.button {
  display: inline-block;
  background: var(--link);
  color: white;
  border: 1px solid var(--link);
  border-radius: 3px;
  padding: 10px 16px;
  margin: 12px 12px 10px 0;
  font: 600 13px/1.4 system-ui;
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  color: white;
  background: #163f60;
}
button.secondary {
  background: white;
  color: var(--link);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.help-actions {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 8px;
}
.feedback {
  padding: 16px 20px;
  background: var(--wash);
  border-left: 3px solid #7292ab;
  margin: 18px 0;
}
.feedback h2 {
  font-size: 18px;
  margin-top: 0;
}
.saved-work {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.attempt,
.resource,
.upload-item {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.upload-item > a,
.resource > a {
  font: 600 15px/1.5 system-ui;
}
#drop-zone {
  border: 2px dashed #a2b4c4;
  padding: 24px;
  margin: 25px 0;
  background: var(--wash);
}
#drop-zone.dragging {
  border-color: var(--link);
  background: #e7f0f7;
}
#drop-zone label {
  margin-top: 0;
  font-size: 16px;
}
#upload-results {
  font: 13px/1.6 system-ui;
}
.error {
  color: #a12b25;
}
table {
  overflow-wrap: normal;
  word-break: normal;
  width: 100%;
  border-collapse: collapse;
  font: 14px/1.6 system-ui;
  margin: 24px 0;
}
td,
th {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}
th {
  white-space: nowrap;
  background: var(--wash);
}
.table-scroll {
  overflow-x: auto;
}
.table-scroll table {
  min-width: 560px;
}
.markdown-document h1 {
  font-size: 24px;
}
.markdown-document h2 {
  font-size: 20px;
}
.markdown-document {
  border-top: 1px solid var(--line);
  margin: 20px 0;
  padding-top: 8px;
}
.markdown-document code {
  font-size: 0.85em;
  background: var(--wash);
  padding: 2px 4px;
}
pre {
  white-space: pre-wrap;
  font-size: 14px;
  overflow: auto;
}
canvas {
  width: 100%;
  max-width: 750px;
  border: 1px solid var(--line);
  margin-top: 20px;
}
input[type="range"] {
  display: block;
  width: 240px;
}
footer {
  margin-top: 40px;
}
#notice {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 90vw;
  background: #263746;
  color: white;
  font: 14px/1.5 system-ui;
  padding: 12px 20px;
  box-shadow: 0 2px 12px #0002;
}
.skip {
  position: absolute;
  top: -100px;
  background: white;
  padding: 12px;
  z-index: 10;
}
.skip:focus {
  top: 0;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #d18c38;
  outline-offset: 3px;
}
main sub,
main sup {
  font-size: 0.72em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
main sub {
  bottom: -0.3em;
}
main sup {
  top: -0.55em;
}
.katex sub,
.katex sup {
  position: static;
}
.notation-key {
  padding: 12px 18px;
  background: var(--wash);
  font-size: 15px;
}
.eq-display {
  margin: 14px 0 18px;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--line);
  overflow-x: auto;
}
.eq-display .katex-display {
  margin: 6px 0;
}
table.terms {
  font-size: 14px;
  margin: 10px 0 16px;
}
table.terms th:first-child,
table.terms td:first-child {
  width: 26%;
  min-width: 12rem;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
table.terms td:last-child {
  white-space: nowrap;
  color: var(--muted);
}
.why,
.self-check {
  font-size: 15px;
  color: #3b444d;
  margin: 8px 0 20px;
}
.self-check {
  border-left: 3px solid var(--accent);
  padding: 6px 14px;
  background: #fffbf5;
}
.walkthrough-step .eq-display {
  margin-left: 16px;
}
@media (max-width: 820px) {
  aside {
    position: static;
    width: auto;
    padding: 18px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .course-label {
    margin-bottom: 12px;
  }
  #nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  #nav a {
    font-size: 12px;
    margin: 0;
    padding: 5px 8px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  #nav a.active {
    border-bottom-color: var(--link);
  }
  #nav a:nth-child(7) {
    margin: 0;
    padding: 5px 8px;
    border-top: 0;
  }
  #connection {
    margin-top: 10px;
  }
  main {
    margin-left: 0;
    padding: 28px 22px 60px;
    max-width: 760px;
  }
  h1 {
    font-size: 27px;
  }
  .stage-nav {
    margin-top: 20px;
  }
  .stage-nav a {
    min-width: 95px;
  }
  .form-row,
  .filters {
    gap: 5px 15px;
  }
  figure img {
    max-height: 320px;
  }
}
@media print {
  aside,
  .stage-nav,
  .page-turn,
  button,
  .button,
  #notice,
  textarea,
  select,
  input,
  label,
  .help-actions,
  .skip {
    display: none !important;
  }
  main {
    margin: 0;
    padding: 0;
    max-width: none;
  }
  body {
    font-size: 11pt;
  }
  h1 {
    font-size: 24pt;
  }
  .reference-strip {
    font-size: 9pt;
  }
  figure,
  .eq,
  .walkthrough-step {
    break-inside: avoid;
  }
  .katex-display {
    overflow: visible;
  }
}
.reference-fit {
  display: block;
  line-height: 1.5;
  color: var(--muted);
  margin: 0.1rem 0 0.6rem;
}
.video-list {
  padding-left: 2.5rem;
}
.video-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.video-list .meta {
  white-space: nowrap;
}
figure.lesson-figure {
  margin: 30px 0 34px;
  padding: 18px 0 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
figure.lesson-figure img {
  margin: 18px auto 6px;
}
.figure-intro {
  font:
    15px/1.65 Georgia,
    serif;
  color: #3b444d;
  margin: 0 0 4px;
}
.figure-intro b {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
.problem-prompt {
  padding: 20px 0 6px;
  margin: 28px 0 30px;
  line-height: 1.75;
}
.problem-prompt h2 {
  margin-top: 0;
}
.problem-prompt > p {
  margin: 0 0 22px;
}
.reference-strip {
  margin-bottom: 30px;
}
.lesson-section {
  padding-bottom: 30px;
}
.walkthrough-step {
  padding: 20px 0;
}
.photo-zone {
  border: 2px dashed #a2b4c4;
  padding: 18px 20px;
  margin: 16px 0 22px;
  background: var(--wash);
}
.photo-zone label {
  margin-top: 0;
  font-size: 16px;
}
.photo-list {
  padding-left: 0;
  list-style: none;
  margin: 12px 0 0;
}
.photo-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font: 13px system-ui;
}
.photo-list button {
  margin: 0 0 0 auto;
  padding: 5px 10px;
}
.photo-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
}
.attempt-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}
textarea.note {
  min-height: 90px;
}
figure.lesson-figure {
  margin: 36px 0 42px;
  padding: 24px 0;
}
figure.lesson-figure img {
  width: 100%;
  max-width: 680px;
  max-height: none;
  margin: 28px auto 12px;
}
.figure-intro {
  font:
    17px/1.8 Georgia,
    serif;
  max-width: 68ch;
  margin: 0 0 28px;
}
.problem-prompt {
  margin: 36px 0;
  padding: 30px 0;
  font-size: 18px;
  line-height: 1.8;
}
.problem-prompt h2 {
  margin: 0 0 20px;
}
.problem-givens,
.problem-tasks {
  margin: 42px 0;
}
.givens-table {
  overflow-wrap: normal;
  word-break: normal;
  width: 100%;
  font-size: 16px;
}
.givens-table th,
.givens-table td {
  padding: 13px 14px;
}
.problem-tasks li {
  padding-left: 8px;
  margin-bottom: 18px;
}
.optional-note {
  margin: 24px 0;
}
#photo-status {
  white-space: pre-line;
}
.video-chapters {
  margin: 12px 0;
  font-size: 14px;
}
.video-chapters li {
  padding: 6px 0;
}

.terms-scroll {
  max-width: 100%;
  margin: 24px 0;
}
.terms-scroll table {
  min-width: 640px;
  table-layout: auto;
}
table.terms {
  overflow-wrap: normal;
}
table.terms th,
table.terms td {
  padding: 14px 16px;
}
table.terms th:nth-child(2),
table.terms td:nth-child(2) {
  min-width: 17rem;
}
table.terms th:last-child,
table.terms td:last-child {
  min-width: 6rem;
  white-space: nowrap;
}
table.terms td:first-child .katex {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.givens-table td:nth-child(2),
.givens-table th:nth-child(2) {
  min-width: 6rem;
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Live pointer: elements an agent is pointing at during a spoken session. */
.pointer-hl {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  position: relative;
  scroll-margin: 6rem;
}
.pointer-hl::before {
  content: attr(data-pointer-n);
  position: absolute;
  left: -0.6rem;
  top: -0.9rem;
  min-width: 1.4rem;
  padding: 0 0.3rem;
  border-radius: 0.7rem;
  background: var(--accent);
  color: #fff;
  font: 600 0.8rem/1.4rem system-ui, sans-serif;
  text-align: center;
  z-index: 2;
}
tr.pointer-hl::before {
  content: none;
}
#pointer-bar {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(42rem, calc(100vw - 2rem));
  max-height: 40vh;
  overflow: auto;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  z-index: 20;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
#pointer-bar ol {
  margin: 0;
  padding-left: 1.4rem;
  flex: 1;
}
#pointer-bar li + li {
  margin-top: 0.4rem;
}
@media (prefers-reduced-motion: reduce) {
  .pointer-hl {
    scroll-behavior: auto;
  }
}

#pointer-bar {
  top: auto;
  right: auto;
  height: auto;
}
#tutor-session,
#site-update {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  font: 13px/1.5 system-ui, sans-serif;
}
#tutor-session label { display: block; margin: 0.4rem 0; }
#tutor-session input[type="checkbox"] { width: auto; margin-right: 0.4rem; }
#tutor-session-id { width: 100%; font: 11px/1.5 monospace; padding: 0.4rem; }
#tutor-session button,
#site-update button { font-size: 12px; padding: 0.4rem 0.6rem; }
#tutor-session-status { font-size: 11px; color: var(--muted); }
#site-update { border-left: 3px solid var(--accent); padding-left: 0.6rem; }

#site-update {
  position: fixed;
  right: 1rem;
  top: 1rem;
  width: min(20rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.65rem 0.8rem;
  background: var(--paper);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
  z-index: 25;
}
#site-update p { margin: 0 0 0.5rem; }

/* Subject hierarchy stays vertical at narrow widths: no wrapped lesson toolbar. */
#nav { display: block; }
#nav details { margin: 12px 0; border-top: 1px solid var(--line); padding-top: 10px; }
#nav summary { font-size: 14px; font-weight: 650; cursor: pointer; }
#nav details a { margin: 2px 0 2px 8px; padding: 6px 9px; }
.subject-overview { border-bottom: 1px solid var(--line); padding: 8px 0 20px; }
#tutor-session > summary { cursor: pointer; font-weight: 600; }
@media (max-width: 820px) {
  #nav { display: block; }
  #nav a { display: block; }
  #nav details a { margin-left: 12px; }
  aside { padding: 14px 20px; }
}
