:root {
  color-scheme: light;
  font: 16px/1.42 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #252525;
  background: #eeece1;
  --board: #eeece1;
  --ink: #242424;
  --muted: #656565;
  --glass: rgba(255,255,255,.94);
  --edge: #d8d7d3;
  --graphite: rgba(28,28,30,.73);
  --violet: #5e5ce6;
  --panel-width: min(370px,36vw);
  --shadow: 0 8px 32px #29251d13, 0 2px 8px #29251d09;
}
* { box-sizing:border-box }
[hidden] { display:none !important }
body { margin:0 }
h1,h2,h3,p { margin:0 }
h1,h2,h3 { line-height:1.2 }
h2 { font-size:1.45rem; letter-spacing:-.04em }
h3 { font-size:1.02rem; letter-spacing:-.02em }
button,input,textarea { font:inherit; color:inherit }
button {
  min-height:42px; padding:.46rem .85rem; border:1px solid #cfceca; border-radius:8px;
  background:#fff; font-size:.91rem; font-weight:550; cursor:pointer;
}
button:enabled:hover { background:#f4f3ef }
button:disabled { opacity:.46; cursor:default }
button.primary { background:var(--ink); border-color:var(--ink); color:white }
button.primary:enabled:hover { background:#404042 }
button.quiet,.editor-sample {
  min-height:40px; padding:.25rem .1rem; background:transparent; border:0;
  text-decoration:underline; text-underline-offset:.2em; color:#54535b;
}
button.quiet:enabled:hover,.editor-sample:enabled:hover { color:#242424; background:transparent }
:focus-visible { outline:3px solid var(--violet); outline-offset:2px }
input,textarea { padding:.55rem .65rem; border:1px solid #bdbdb8; border-radius:7px; background:white; max-width:100% }
label,summary { font-weight:600; font-size:.89rem }
summary { cursor:pointer }
.sr-only,.editor-prompt.ink-description {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
#fullscreen {
  position:fixed; top:max(17px,env(safe-area-inset-top)); right:max(24px,env(safe-area-inset-right));
  z-index:8; min-height:40px; padding:.45rem .95rem; border-radius:32px;
  background:rgba(255,255,255,.9); font-size:.77rem; font-weight:550;
}
#fullscreen { display:grid; place-items:center; min-width:44px; min-height:44px; padding:0 }
.fullscreen-mark {
  width:14px; height:14px; color:#33333a;
  background:
    linear-gradient(currentColor 0 0) left top/5px 2px,
    linear-gradient(currentColor 0 0) left top/2px 5px,
    linear-gradient(currentColor 0 0) right top/5px 2px,
    linear-gradient(currentColor 0 0) right top/2px 5px,
    linear-gradient(currentColor 0 0) left bottom/5px 2px,
    linear-gradient(currentColor 0 0) left bottom/2px 5px,
    linear-gradient(currentColor 0 0) right bottom/5px 2px,
    linear-gradient(currentColor 0 0) right bottom/2px 5px;
  background-repeat:no-repeat;
}
.is-fullscreen .fullscreen-mark { transform:scale(.78) }
#fullscreen:enabled:hover { background:white }
#learner-sign-in {
  width:min(390px,calc(100% - 32px)); margin:clamp(72px,15vh,140px) auto 24px; padding:24px;
  border:1px solid var(--edge); border-radius:12px; background:var(--glass); box-shadow:var(--shadow);
}
#learner-credentials { display:grid; gap:7px; margin:18px 0 10px }
#learner-credentials input + label { margin-top:7px }
#learner-open { margin-top:8px }
#learner-session {
  position:fixed; z-index:8; display:flex; align-items:center; gap:8px;
  top:max(15px,env(safe-area-inset-top)); right:max(76px,calc(env(safe-area-inset-right) + 62px));
  max-width:calc(100% - 144px); font-size:.81rem;
}
#current-learner { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
#learner-sign-out { flex:none }
#entry {
  position:fixed; inset:16px; display:flex; flex-direction:column; gap:8px;
  overflow:auto; padding:18px 16px 12px; background:var(--glass); border:1px solid #e5e4e1;
  border-radius:8px; box-shadow:var(--shadow);
}
#entry h2 { margin:.35rem 7rem .2rem 0 }
#entry-draft { flex:1; display:flex; flex-direction:column; align-items:start; gap:8px; min-height:260px }
#entry-editor { flex:1; width:100%; min-height:180px; display:flex }
#entry:has(#proposal:not([hidden])) {
  inset:auto; top:50%; left:50%; transform:translate(-50%,-50%); width:min(calc(100% - 32px),760px);
  max-height:calc(100dvh - 32px); padding:clamp(1.2rem,3vw,2rem); gap:10px;
}
#entry:has(#proposal:not([hidden])) #entry-title { display:none }
#proposal-title { font-size:1.35rem }
#entry-question { font-size:1.05rem; margin:0 0 .5rem }
#proposal-title,#proposed-task,#work-title { white-space:pre-line }
.equation,.math-field,.response-math,#graded-reading { font-family:"Cambria Math","STIX Two Text",Georgia,serif }
.equation { margin:1rem 0 1.5rem; font-size:clamp(1.5rem,4vw,2.7rem); overflow-wrap:anywhere }
.rehearsal-note { font-size:.73rem; color:var(--muted) }
.note { font-size:.82rem; color:var(--muted); line-height:1.4 }
#transcription { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:center }
#transcription label { grid-column:1 / -1 }
#notice,#leave,#task-edit,#conflict {
  position:fixed; z-index:12; max-height:calc(100dvh - 24px); overflow:auto; margin:0;
  background:#fff; border:1px solid var(--edge); border-radius:12px; padding:1rem; box-shadow:var(--shadow);
}
#notice { max-width:min(calc(100vw - 32px),450px); top:15px; left:50%; transform:translateX(-50%); font-size:.9rem }
#notice p:not(:only-child) { margin-bottom:.3rem }
#leave,#task-edit,#conflict { left:50%; top:50%; transform:translate(-50%,-50%); width:min(440px,calc(100vw - 30px)) }
#leave p,#conflict p { margin:.6rem 0 }
#task-edit { display:grid; gap:.6rem }
.workspace-grid,.work-sheet { position:fixed; inset:0 }
.work-sheet {
  z-index:0; top:62px;
  --work-left:calc(max(12px,env(safe-area-inset-left)) + var(--panel-width) + 20px);
  --work-top:14px;
}
#work-title { position:absolute; left:var(--work-left); top:var(--work-top); font-size:.88rem; color:#5b5953; font-weight:550; letter-spacing:0; pointer-events:none }
#solution-editor { height:100% }
#save-state {
  position:fixed; left:14px; bottom:12px; pointer-events:none; padding:2px 3px; font-size:.75rem; color:#595953;
  background:var(--board);
}
#save-state:empty { display:none }
#toggle-box {
  position:fixed; top:max(12px,env(safe-area-inset-top)); left:max(12px,env(safe-area-inset-left)); z-index:6;
  width:46px; height:46px; padding:0; border:1px solid #ffffff2e; border-radius:50%; color:white;
  background:var(--graphite); box-shadow:0 4px 16px #2020202b; backdrop-filter:blur(18px);
}
#toggle-box:enabled:hover { background:#4a4945 }
.m-mark { font-size:1rem; font-weight:800; letter-spacing:-.04em }
#mbox-panel {
  position:fixed; z-index:5; left:max(12px,env(safe-area-inset-left)); top:70px;
  width:var(--panel-width); max-height:calc(100dvh - 160px); overflow:auto; overscroll-behavior:contain;
  padding:16px; border:1px solid #e3e1dc; border-radius:18px; background:var(--glass);
  box-shadow:var(--shadow); backdrop-filter:blur(18px);
}
.mbox-bar,.actions,#items { display:flex; flex-wrap:wrap; align-items:center; gap:8px }
.mbox-bar button { flex:1 }
#feedback { margin:.75rem 0 }
#burst-feedback, #entry-burst-feedback { display:grid; gap:.5rem; padding:.7rem; margin-bottom:.75rem; border:1px solid var(--edge); border-radius:10px; background:#fff }
#burst-status, #entry-burst-status { font-size:.9rem }
#burst-retry { justify-self:start }
#response { overflow-wrap:anywhere }
#response p:not(:empty),#practice-reason:not(:empty) { margin:.35rem 0 }
.response-math { font-size:1.16rem }
.response-math p { line-height:1.35 }
.math-display-row { display:block; white-space:pre-line }
.math-display-row math { font-size:1em; white-space:nowrap }
.math-display-emphasis,.math-display-emphasis math { font-weight:700 }
.math-display-aligned { display:grid; grid-template-columns:repeat(3,max-content); column-gap:.18em }
.math-display-aligned > .math-display-row { grid-column:1 / -1 }
.math-display-aligned > .math-display-relation { display:grid; grid-template-columns:subgrid; align-items:baseline }
.math-display-relation > :first-child { justify-self:end }
.math-display-labelled { display:inline-flex; align-items:baseline; gap:.25em }
.response-math,#proposed-task { overflow-x:auto }
#graded-reading,#provisional-reading-text { white-space:pre-wrap; overflow-wrap:anywhere; max-height:12rem; overflow:auto; margin:.2rem 0 .5rem }
#review-options,#task-options,#practice,#work-controls { border-top:1px solid #deddd9; padding-top:.58rem; margin-top:.58rem }
#task-options summary,#review-options summary { color:#58585a; min-height:30px; line-height:28px }
.review-controls { display:grid; gap:.45rem; padding:.45rem 0 }
#reading-uncertainty { overflow-wrap:anywhere }
#reading-uncertainty p,#uncertain-marks { margin:.15rem 0 .4rem }
#uncertain-marks { padding-inline-start:1.2rem }
.review-controls input,.review-controls textarea,#entry-reading,#corrected-task { width:100% }
#reading-choices { min-width:0; margin:0; padding:.35rem .6rem .5rem; border:1px solid var(--edge); border-radius:6px }
#reading-choice-options label { display:flex; align-items:baseline; gap:.45rem; white-space:pre-wrap; overflow-wrap:anywhere }
#reading-choice-options input { width:auto; margin:0; flex:none }
#practice h2 { font-size:1.02rem; margin-bottom:.35rem }
#practice-count { margin:.3rem 0 }
#items button[aria-current] { background:#eae9f7; color:#29276a }
.footer-actions { margin-top:.3rem }
@media(max-width:700px) {
  :root { --panel-width:min(370px,calc(100vw - 24px)); --panel-height:min(35dvh,290px) }
  #entry { inset:8px; padding:12px 10px 8px }
  #fullscreen { top:14px; right:14px }
  #mbox-panel { top:62px; max-height:var(--panel-height); padding:12px }
  .work-sheet {
    --work-left:max(16px,env(safe-area-inset-left));
    --work-top:calc(var(--panel-height) + 16px);
  }
  #save-state { max-width:35vw; bottom:6px }
}
@media(max-height:480px) and (min-width:701px) {
  #mbox-panel { max-height:calc(100dvh - 86px) }
}
