/* Written-work hand explanations: a sheet of lined paper with the student's working and a short note per line. */
.written-work{height:100%;min-height:0;display:flex;flex-direction:column;box-sizing:border-box;padding:14px 16px 16px;background:#f4f1ea;color:#1f2430;font:15px/1.5 Inter,'Segoe UI',sans-serif}
html:root body .workspace-panel .written-work{background:#f4f1ea!important;color:#1f2430!important}
.ww-header{flex:none;display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-bottom:10px}
.ww-header small{font-size:12px;letter-spacing:.04em;text-transform:uppercase;color:#6a6f7c!important}
.ww-header h3{margin:2px 0 0;font-size:17px;line-height:1.35;color:#1f2430!important}
.ww-key{flex:none;display:flex;align-items:center;gap:6px;font-size:12px;color:#5d6270!important;white-space:nowrap}
.ww-key i{display:inline-block;width:18px;height:3px;border-radius:2px;background:#1d3f8f}
.ww-key i.ww-key-note{margin-left:10px;background:#9aa0ad}
.ww-scroll{flex:1;min-height:0;overflow:auto;border-radius:6px;box-shadow:0 1px 2px #0002,0 8px 24px #0000001a}
/* The sheet: ruled lines every 40px and a red margin line. */
.ww-scroll{container-type:inline-size}
.ww-paper{--rule:42px;position:relative;min-height:100%;box-sizing:border-box;padding:14px 0 var(--rule) 0;background-color:#fffdf6;background-image:linear-gradient(90deg,transparent 43px,#e9a3a3 43px,#e9a3a3 45px,transparent 45px);background-attachment:local}
.ww-row{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);column-gap:20px;align-items:center;min-height:var(--rule);padding:0 16px 0 58px;border-bottom:1px solid #c9d7ea}
.ww-gap{height:var(--rule);border-bottom:1px solid #c9d7ea}
.ww-ink{margin:0;min-height:var(--rule);line-height:var(--rule);font-family:'Segoe Print','Bradley Hand','Ink Free','Comic Sans MS','Chalkboard SE',cursive;font-size:20px;font-weight:500;color:#1d3f8f!important;letter-spacing:.01em}
.ww-ink sup{font-size:.62em;line-height:0;vertical-align:.62em}
.ww-label .ww-ink{grid-column:1/-1;font-size:18px;color:#3b4252!important;text-decoration:underline;text-decoration-color:#9aa6c0;text-underline-offset:5px}
.ww-note{margin:6px 0;padding:2px 0 2px 12px;border-left:2px solid #d5d9e2;font-size:13.5px;line-height:1.45;color:#4a4f5c!important}
.ww-note b{color:#1f2430!important;font-weight:700}
.ww-frac{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;line-height:1.05;font-size:.82em;margin:0 3px}
.ww-frac span:first-child{padding:0 4px;border-bottom:2px solid currentColor}
.ww-frac span:last-child{padding:0 4px}
.ww-root>span{border-top:2px solid currentColor;padding:0 2px;margin-left:-1px}
.ww-box{display:inline-block;line-height:1.3;padding:0 7px;border:2px solid currentColor;border-radius:3px}
.ww-circle{display:inline-block;line-height:1.35;padding:0 12px;border:2.5px solid #c0392b;border-radius:50%/60%;transform:rotate(-2deg)}
.ww-strike{text-decoration:line-through;text-decoration-thickness:2px;opacity:.7}
.ww-yes{color:#1e8a4c;font-weight:700}
.ww-no{color:#c0392b;font-weight:700}
.ww-answer{border-bottom:0;padding-top:10px}
.ww-answer .ww-ink{font-size:23px}
@container (max-width:640px){.ww-row{grid-template-columns:1fr;padding-right:12px}.ww-ink{font-size:19px}.ww-note{margin:0 0 8px}}
@media(max-width:700px){.written-work{padding:10px}.ww-key{display:none}}
/* The paper stays light in both themes, so its ink and notes must beat the dark-theme text colour rules. */
html:root body .workspace-panel .written-work .ww-paper .ww-row .ww-ink{color:#1d3f8f!important}
html:root body .workspace-panel .written-work .ww-paper .ww-row.ww-label .ww-ink{color:#3b4252!important}
html:root body .workspace-panel .written-work .ww-paper .ww-row .ww-note{color:#4a4f5c!important}
html:root body .workspace-panel .written-work .ww-note b,html:root body .workspace-panel .written-work .ww-header h3{color:#1f2430!important}
html:root body .workspace-panel .written-work .ww-header small,html:root body .workspace-panel .written-work .ww-key{color:#5d6270!important}
html:root body .workspace-panel .written-work .ww-yes{color:#1e8a4c!important}
html:root body .workspace-panel .written-work .ww-no,html:root body .workspace-panel .written-work .ww-circle{color:#c0392b!important}
html:root body .workspace-panel .written-work .ww-paper .ww-row.ww-answer .ww-ink{color:#1d3f8f!important}
/* Lines with stacked fractions need a taller row so the fraction clears the ruled lines. */
.ww-ink:has(.ww-frac){line-height:70px}
.ww-frac{line-height:1.2;font-size:.84em;margin:0 4px}
.ww-frac span:first-child{padding:0 5px 3px}
.ww-frac span:last-child{padding:3px 5px 0}
.ww-root{white-space:nowrap}
.ww-root>span{display:inline-block;line-height:1.15;padding:1px 3px 0;margin-left:-2px}
/* A root that holds a stacked fraction: keep the fraction stacked and let the bar sit above it. */
.ww-root>span:has(.ww-frac){vertical-align:middle;padding-top:3px}
/* Sketches drawn on the sheet (written-work-figures.js). Blue pen for what is given, red for what is worked out. */
.ww-figure-row{align-items:center;padding-top:8px;padding-bottom:8px}
.ww-figure{min-width:0}
.ww-figure svg{display:block;width:100%;max-width:330px;height:auto;overflow:visible}
.ww-figure .ww-sk *{fill:none;stroke:#1d3f8f;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.ww-figure .ww-sk .d{stroke-dasharray:6 6}
.ww-figure .ww-sk .r{stroke:#c0392b}
.ww-figure .ww-sk .f{fill:#1d3f8f;stroke:none}
.ww-figure .ww-sk .f.r{fill:#c0392b}
.ww-figure .ww-lab text{font-family:'Segoe Print','Bradley Hand','Ink Free','Comic Sans MS','Chalkboard SE',cursive;font-size:16px;font-weight:500;fill:#1d3f8f;stroke:none}
.ww-figure .ww-lab text.s{font-size:13px}
.ww-figure .ww-lab text.r{fill:#c0392b}
