@font-face {
  font-family: Plex;
  src: url(/fonts/ibm-plex-sans-latin.woff2);
}
@font-face {
  font-family: Serif;
  src: url(/fonts/source-serif-4-latin.woff2);
  font-weight: 200 800;
}
@font-face {
  font-family: Mono;
  src: url(/fonts/ibm-plex-mono-400-latin.woff2);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f7f4ee;
  color: #282923;
  font:
    16px Plex,
    system-ui,
    sans-serif;
}
header {
  height: 76px;
  border-bottom: 1px solid #c9c6bb;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 clamp(18px, 5vw, 80px);
}
.brand {
  font:
    600 29px Serif,
    Georgia,
    serif;
  letter-spacing: -1.7px;
  text-decoration: none;
  color: inherit;
}
.brand i,
.accent {
  color: #7a262a;
}
.division,
.kicker,
.meta,
.num {
  font:
    12px Mono,
    monospace;
  letter-spacing: 0.09em;
}
.division {
  border-left: 1px solid #bdb7ac;
  padding-left: 20px;
}
#account {
  margin-left: auto;
}
main {
  max-width: 1450px;
  margin: auto;
  padding: 36px clamp(18px, 5vw, 80px) 60px;
}
h1,
h2,
h3 {
  font-family: Serif, Georgia, serif;
  font-weight: 550;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
}
h1 {
  font-size: clamp(35px, 4.6vw, 66px);
  line-height: 1.04;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 23px;
}
.kicker {
  color: #7a262a;
  margin: 0 0 14px;
  text-transform: uppercase;
}
.lead {
  font-size: 19px;
  line-height: 1.5;
  color: #54564e;
  max-width: 36em;
}
.entry {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 8%;
  align-items: center;
  padding: clamp(20px, 6vh, 80px) 0;
}
.entry h1 {
  font-size: clamp(54px, 6.5vw, 96px);
}
.sheet,
.card {
  background: #fffdf8;
  border: 1px solid #cfcbc0;
  border-radius: 7px;
  padding: 24px;
}
.sheet {
  padding: clamp(22px, 4vw, 44px);
  box-shadow: 4px 5px 0 #e7e2d8;
  border-top: 3px solid #802d32;
}
.rule {
  border-top: 1px solid #c9c6bb;
  margin-top: 28px;
  padding-top: 15px;
  max-width: 460px;
}
.row,
.toolbar,
.between {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.toolbar {
  margin: 18px 0;
}
.muted,
small {
  color: #5c6057;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #ccc7bc;
  margin-bottom: 22px;
}
.tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: none;
}
.tabs .selected {
  border-bottom-color: #7a262a;
  color: #7a262a;
}
button,
select,
input {
  font: inherit;
}
button,
select {
  cursor: pointer;
  min-height: 44px;
  border: 1px solid #c4c1b6;
  background: #fffdf8;
  border-radius: 5px;
  padding: 8px 15px;
  color: inherit;
}
button:hover {
  border-color: #7a262a;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #865c36;
  outline-offset: 2px;
}
.primary,
.tool.active {
  color: white;
  background: #792a30;
  border-color: #792a30;
}
.danger {
  color: #792a30;
}
.link {
  background: transparent;
  border: 0;
  text-decoration: underline;
  padding: 4px 0;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
label {
  display: block;
  margin: 14px 0;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  line-height: 1.5;
}
.check input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex: none;
}
input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 46px;
  border: 1px solid #b5b5a9;
  border-radius: 4px;
  background: #fff;
  padding: 10px;
}
.cards,
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin-top: 16px;
}
.card .row {
  margin-top: 14px;
}
.badge {
  font-size: 13px;
  padding: 4px 9px;
  border-radius: 20px;
  background: #e4eee3;
  color: #275b3b;
}
.badge.warn {
  background: #f7e6ca;
  color: #69451a;
}
.thumb {
  padding: 0;
  text-align: left;
  overflow: hidden;
}
.thumb .between {
  padding: 12px;
}
.thumb svg,
.paper svg {
  display: block;
  width: 100%;
  background-color: #fff;
  background-image: linear-gradient(#eff0eb 1px, transparent 1px);
  background-size: 100% 8.333%;
}
.paper {
  overflow: hidden;
  border: 1px solid #c5c6b9;
  border-radius: 5px;
  background: #fff;
}
.paper svg {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.pdf {
  background: #e9e7df;
  border: 1px solid #cecbc1;
  border-radius: 5px;
  max-height: 37vh;
  overflow: auto;
  text-align: center;
}
.pdf canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: auto;
}
.code {
  letter-spacing: 0.15em;
  color: #742529;
  font:
    600 24px Mono,
    monospace;
}
.panel {
  max-width: 950px;
  margin: 16px auto;
}
.empty {
  border: 1px dashed #c4c1b6;
  padding: 30px;
  border-radius: 6px;
}
.foot {
  font-size: 13px;
  color: #55584f;
  margin-top: 30px;
}
dialog {
  color: inherit;
  background: #fffdf8;
  border: 1px solid #aba89d;
  border-radius: 8px;
  width: min(520px, 92vw);
  padding: 26px;
}
dialog::backdrop {
  background: #2225;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #4d2025;
  color: white;
  padding: 12px 20px;
  border-radius: 5px;
  z-index: 10;
  max-width: 94vw;
}
.art {
  font:
    italic 36px Serif,
    serif;
  color: #574f44;
  transform: rotate(-3deg);
  display: block;
  padding: 10px;
}
.art b {
  font: italic 25px Serif;
  color: #8b3337;
}
.stat {
  font:
    13px Mono,
    monospace;
  color: #54594e;
}
details {
  margin: 18px 0;
}
summary {
  cursor: pointer;
}
.tools {
  position: sticky;
  top: 0;
  background: #f7f4ee;
  z-index: 1;
  padding: 8px 0;
}
.noticebox {
  padding: 12px 16px;
  background: #f3e7d4;
  border-radius: 5px;
}
.hidden {
  display: none;
}
@media (max-width: 750px) {
  .entry {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 12px 0;
  }
  .entry .rule {
    display: none;
  }
  header {
    height: 62px;
    gap: 12px;
  }
  .division {
    font-size: 10px;
    padding-left: 10px;
  }
  .brand {
    font-size: 25px;
  }
  main {
    padding-top: 22px;
  }
  .toolbar {
    gap: 8px;
  }
  .sheet,
  .card {
    padding: 16px;
  }
  .thumb {
    padding: 0;
  }
}
@media (min-width: 1100px) {
  .studentLayout {
    display: grid;
    grid-template-columns: minmax(300px, 0.78fr) minmax(480px, 1.22fr);
    gap: 24px;
  }
  .studentLayout .pdf {
    max-height: 75vh;
  }
}
[hidden] {
  display: none !important;
}
@media (min-width: 720px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 10px;
  }
  .thumb .between {
    padding: 7px 9px;
    gap: 5px;
  }
}

/* Tutor-only question preparation. */
.prep-mode { margin: 24px 0; max-width: 340px; }
.prep-layout { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(320px,1fr); gap:28px; align-items:start; }
.prep-layout h2 { font-size:24px; }
.prep-source-scroll { max-height:72vh; overflow:auto; border:1px solid #cecbc1; background:#e9e7df; }
#source-surface { position:relative; width:100%; }
#source-canvas { display:block; width:100%; touch-action:none; cursor:crosshair; }
#selection { position:absolute; pointer-events:none; border:2px solid #742529; background:rgba(116,37,41,.12); box-sizing:border-box; }
.prep-source .toolbar { flex-wrap:wrap; }
.prep-source label { display:flex; align-items:center; gap:8px; }
.prep-source select { width:auto; }
#question-list { display:flex; gap:8px; overflow:auto; padding:0 0 12px; margin-bottom:14px; }
#question-list button { min-width:130px; max-width:220px; text-align:left; flex-shrink:0; }
#question-list small { display:block; opacity:.7; }
#question-list .selected { background:#742529; color:white; }
#question-list span { display:block; overflow:hidden; text-overflow:ellipsis; }
#question-label { width:100%; }
#question-editor .toolbar { margin-top:12px; }
#region-list { list-style:none; padding:0; }
#region-list li { display:flex; justify-content:space-between; gap:8px; align-items:center; border-bottom:1px solid #ddd9ce; padding:8px 0; }
#region-list button { padding:5px 9px; font-size:13px; }
.prep-preview { padding:12px; background:white; border:1px solid #cecbc1; min-height:120px; max-height:60vh; overflow:auto; }
.prep-preview canvas { display:block; width:100%; height:auto; }
.prep-save { margin-top:28px; }
.prep-save .toolbar { margin-top:16px; }
.whole-mode { grid-template-columns:minmax(0,820px); }
.question-dialog { width:min(1100px,92vw); max-width:92vw; }
.question-dialog img { display:block; width:100%; margin-top:20px; }
@media (max-width:950px) { .prep-layout { grid-template-columns:minmax(0,1fr); } .prep-source-scroll { max-height:60vh; } }
.prep-title { font-size:clamp(32px,4vw,46px); margin-bottom:8px; }
#question-list .selected small { color:#fff; opacity:.85; }
.prep-source .toolbar { position:sticky; top:0; z-index:3; background:#f7f4ee; padding:8px 0; }
.studentLayout.question-layout { display:block; max-width:1000px; margin:0 auto; }
.question-layout > section + section { margin-top:20px; }
.question-layout .pdf { max-height:35vh; }

/* Prepared questions each have their own uncluttered writing screen. */
.question-layout .paper svg { background-image:none; }
.question-layout .pdf { max-height:28vh; }

.worksheet-picker { display:grid; gap:12px; max-height:50vh; overflow:auto; }
.worksheet-picker article { border:1px solid #d1cabe; padding:16px; border-radius:6px; }
.worksheet-picker h3 { margin:0 0 8px; }
.waiting-roster { list-style:none; padding:0; max-width:650px; }
.waiting-roster li { display:flex; align-items:center; justify-content:space-between; padding:14px 0; border-bottom:1px solid #d1cabe; }
.waiting-student { margin-top:28px; }

/* Simplified lesson screens (Nov 2026). */
.title-sm { font-size: clamp(28px, 3.2vw, 40px); margin: 0; }
.h3 { font-size: 23px; margin-top: 28px; }
.small { font-size: 13px; }
.wide { width: 100%; }
.spacer { flex: 1; }
.warn-text { color: #69451a; }
.lesson-head { margin-bottom: 18px; align-items: flex-start; }
.lesson-head .muted { margin: 4px 0 0; }
.studio-head { margin-bottom: 14px; }
.join-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; background: #fffdf8; border: 1px solid #cfcbc0; border-radius: 7px; padding: 14px 20px; margin-bottom: 18px; }
.join-strip .meta { display: block; color: #6b6d64; margin-bottom: 2px; }
.join-strip .code { font-size: 30px; }
.join-url { font: 15px Mono, monospace; }
#joined { margin-left: auto; }
.waiting-tutor { text-align: center; padding: 36px 24px; }
.waiting-tutor p { max-width: 34em; margin: 0 auto 18px; }
.question-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.question-bar select { flex: 0 1 420px; min-width: 0; }
.icon { min-width: 44px; padding: 8px 0; font-size: 22px; line-height: 1; }
.tutor-pdf { max-height: 24vh; margin-bottom: 18px; }
.diagnostics { margin-top: 36px; color: #5c6057; font-size: 14px; }
.diagnostics .stat { margin: 8px 0; }
.past { margin-top: 14px; font-size: 14px; }
.past-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e3ded3; }
.past-row .link { min-height: 36px; }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.card h2 { font-size: 26px; }
.card .meta { margin: 0 0 8px; color: #5c6057; }
.card .past { align-self: stretch; }
.card-foot { margin-top: auto; padding-top: 10px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2f7a4a; margin-right: 7px; vertical-align: 1px; }
.join-only { display: grid; place-items: center; padding: clamp(10px, 6vh, 70px) 0; }
.join-only .sheet { width: min(460px, 100%); }
.join-only h1 { font-size: clamp(34px, 5vw, 46px); }
.join-only .code-sm { font-size: 18px; }
.join-only .link { display: block; margin-top: 14px; }
.q-head { margin-bottom: 8px; }
.q-head .kicker { margin: 0; }
.q-head .row { gap: 18px; }
.studentLayout .tools { margin: 0 0 10px; }
.question-layout > section + section { margin-top: 14px; }
@media (max-width: 750px) {
  .join-strip { padding: 12px 14px; gap: 8px 18px; }
  .join-url { display: none; }
  .question-bar select { flex: 1 1 100%; order: -1; }
}

/* Classroom workspace: consistent hierarchy, comfortable touch targets, generous paper. */
:root { --wine:#792a30; --line:#ded9ce; --surface:#fffdf8; --quiet:#686b61; }
body { line-height:1.5; }
button { font-weight:500; transition:background-color .15s, border-color .15s; }
button:not(.primary):not(.active):hover { background-color:#eee9df; }
button:disabled:hover { background-color:inherit; }
h1,h2,h3,p { overflow-wrap:break-word; }
.tabs .selected { font-weight:600; }
.studio-intro { margin:0 0 24px; max-width:60em; }
.studio-summary { display:flex; flex-wrap:wrap; gap:12px 32px; padding:18px 22px; background:#eeeae1; border-radius:10px; margin-bottom:26px; color:#55594f; }
.studio-summary strong { color:#282923; font-size:22px; margin-right:6px; }
.studio-summary span:last-child { margin-left:auto; align-self:center; font-size:14px; }
.class-controls { display:flex; gap:20px; align-items:end; }
.class-controls label { margin:0; font-size:14px; font-weight:500; }
.class-controls label:first-child { flex:1; max-width:500px; }
.class-controls select { display:block; margin-top:6px; min-width:180px; min-height:46px; }
.classroom-card { border-radius:12px; padding:24px; gap:12px; }
.classroom-card h2 { margin:8px 0 0; }
.classroom-card p { margin:0; }
.class-symbol { display:grid; place-items:center; width:44px; height:44px; background:#f0e3df; border-radius:12px; color:var(--wine); font:600 24px Serif,serif; }
.badge.neutral { background:#eeece5; color:#5a5d54; }
.card-actions { display:flex; flex-wrap:wrap; gap:8px; padding-top:14px; margin-top:auto; }
.breadcrumbs { display:flex; flex-wrap:wrap; gap:14px; align-items:center; color:var(--quiet); margin-bottom:26px; font-size:14px; }
.class-overview { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:28px; border:1px solid var(--line); border-radius:12px; background:var(--surface); padding:28px; margin:30px 0; }
.class-overview h2 { font-size:23px; margin:12px 0 6px; }
.class-overview p { font-size:15px; color:var(--quiet); margin:0; }
.step-number { font:13px Mono,monospace; color:var(--wine); }
.lesson-history { margin-top:36px; }
.lesson-history > .between { margin-bottom:16px; }
.history-list { border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--surface); }
.history-row { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:22px 24px; }
.history-row + .history-row { border-top:1px solid var(--line); }
.history-row h3 { font:500 18px Plex, sans-serif; letter-spacing:0; margin:0; }
.history-row p { margin:4px 0 0; }
.class-settings { margin-top:40px; font-size:14px; color:var(--quiet); }
.empty { background:#ffffff60; padding:32px; }
.empty p { max-width:52em; }
.desk-app { max-width:1500px; padding-inline:clamp(16px,3vw,44px); }
.desk-app .studentLayout.question-layout { max-width:1200px; }
.question-section { border:1px solid var(--line); background:var(--surface); border-radius:12px; overflow:hidden; }
.question-section .q-head { padding:18px 24px; margin:0; gap:16px; }
.q-head h2 { font-size:24px; margin:5px 0 0; }
.question-section .pdf { border:0; border-top:1px solid var(--line); border-radius:0; background:white; max-height:34vh; }
.question-section .pdf canvas { max-width:100%; }
.question-layout > .workings-section { margin-top:28px; }
.workings-heading { margin-bottom:12px; padding-inline:4px; }
.workings-heading .kicker { margin-bottom:5px; }
.workings-heading h2 { font-size:25px; margin:0; }
.workings-section .tools { border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:var(--surface); top:8px; box-shadow:0 3px 12px #28292308; }
.workings-section .paper { border-color:#d5d3c9; border-radius:10px; box-shadow:0 4px 18px #28292306; }
.workings-section .paper svg { aspect-ratio:5 / 3; background-image:none; }
.workings-section .foot { margin:12px 4px; }
.writing-focus .question-section { display:none; }
.writing-focus .studentLayout.question-layout { max-width:none; }
.writing-focus .workings-section { margin-top:16px; }
.join-only .sheet p { line-height:1.6; }
@media (min-width:1000px) { .classroom-card { min-height:260px; } }
@media (max-width:750px) {
  .studio-summary { gap:8px 20px; padding:16px; }
  .studio-summary span:last-child { flex-basis:100%; margin-left:0; }
  .class-overview { grid-template-columns:1fr; gap:22px; padding:22px; }
  .class-controls { gap:12px; flex-wrap:wrap; }
  .class-controls label:first-child { min-width:180px; }
  .history-row { padding:18px; flex-wrap:wrap; gap:12px; }
  .question-section .q-head { padding:14px 16px; }
  .workings-heading { align-items:start; }
  .workings-heading > span { width:100%; }
  .workings-section .tools { gap:8px; padding:8px; }
  .workings-section .tools button { padding-inline:12px; }
  .studio-head .primary { flex-shrink:0; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; } }
/* Keep the prompt readable without letting its source image consume the desk. */
.desk-app:has(.workings-section) { padding-top:22px; }
.desk-app:has(.workings-section) .lesson-head { margin-bottom:14px; }
.desk-app:has(.workings-section) .lesson-head h1 { font-size:28px; }
.question-section .q-head { padding:12px 18px; }
.question-section .q-head h2 { font:500 17px Plex,sans-serif; letter-spacing:0; }
.question-section .pdf { max-height:22vh; min-height:80px; }
.question-section .pdf canvas, .question-section .pdf img { width: min(100%, 800px) !important; height:auto; margin:auto; display:block; }
.question-layout > .workings-section { margin-top:20px; }
.workings-heading h2 { font-size:22px; }
@media (max-width:480px) {
  header { padding-inline:16px; }
  .division { display:none; }
  .brand { font-size:23px; }
  .question-section .q-head .row { gap:16px; }
  .question-section .pdf { max-height:30vh; }
}
.input-mode.active { border-color:var(--wine); color:var(--wine); background:#f3e7e4; }
@media (pointer:coarse) {
  button, select, summary { min-height:48px; }
  .tools { scroll-margin-top:12px; }
  .question-section { scroll-margin-top:16px; }
  .history-row button { min-height:48px; }
}
.annotation-tools { border:1px solid var(--line); border-radius:10px; padding:10px; margin-bottom:6px; }
.annotation-tools .tool.active { background:#b12630; border-color:#b12630; }
#annotation-status { margin:6px 0 12px; }

/* Quiet classroom surfaces: controls and states carry the interaction. */
.assigned-check { display:inline-grid; place-items:center; width:32px; height:32px; border-radius:50%; background:#e4eee3; color:#275b3b; font-size:20px; }
.desk-meta { display:flex; align-items:center; gap:14px; }
.expand-mark { color:var(--wine); font-size:24px; line-height:1; }
.thumb { border-radius:12px; transition:border-color .15s,box-shadow .15s; }
.thumb:hover, .thumb:focus-visible { border-color:var(--wine); box-shadow:0 3px 14px #74252912; }
#grid { scroll-margin-top:12px; }
.desk-controls { position:sticky; top:0; z-index:2; background:var(--bg, #f7f4ee); padding:10px 0; }
.desk-controls > .between { gap:12px; }
.desk-controls label { display:flex; align-items:center; gap:10px; }
.desk-controls .annotation-tools { position:static; margin:10px 0 0; }
#annotation-status:empty, .workings-section .foot:empty { display:none; }
@media (prefers-reduced-motion:reduce) { .thumb { transition:none; } }
.focus-toggle { display:inline-grid; place-items:center; flex-shrink:0; }
.focus-toggle[aria-pressed="true"] { color:var(--wine); background:#f0e3df; }
/* Consistent, touch-sized icons keep the paper's tools quiet and discoverable. */
.icon-control { display:inline-grid; place-items:center; flex:0 0 48px; width:48px; height:48px; padding:0 !important; border-radius:9px; }
.icon-control svg { pointer-events:none; }
.tools { gap:8px; }
.tool-divider { width:1px; height:26px; background:var(--line); margin-inline:2px; }
.workings-section .tool.active { background:#273447; border-color:#273447; }
.annotation-tools .red-pen { color:#c02f36; }
.annotation-tools .tool.active { color:white; }
.input-mode { color:var(--quiet); }
#start select { display:block; width:100%; margin-top:8px; }
.join-strip #joined { margin-left:auto; }
.q-head .row { gap:6px; }
