.cb-main{max-width:1200px;margin:auto;padding:18px;color:#193b59;font:15px/1.5 system-ui}.cb-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}.cb-heading h1{font-size:22px;text-align:center;margin:4px}.cb-heading a,.cb-toolbar a{color:#275f89;text-decoration:none}.cb-assignment{display:flex;flex-direction:column;gap:4px;margin:12px 0;padding:10px 14px;border:1px solid #c3d9ec;border-radius:10px;background:#f4f9fd}.cb-note{font-size:13px;color:#7c653a}.cb-pages{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}.cb-pages button,.cb-toolbar button{font:inherit;color:#244f6e;background:#fff;border:1px solid #c5d7e4;border-radius:7px;padding:7px 11px;min-height:36px;cursor:pointer}.cb-pages button[aria-pressed=true]{background:#dfedf9;border-color:#78a7ca}.cb-toolbar{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;margin:10px 0}.cb-toolbar button:disabled{opacity:.4;cursor:default}.cb-stage{overflow:auto;max-height:calc(100dvh - 275px);padding:10px;background:#edf1f3;border:1px solid #d9e2e8;border-radius:10px}.cb-page{position:relative;max-width:none;min-width:280px;margin:0 auto;background:white}.cb-page img{display:block;width:100%;height:auto}.cb-page svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.cb-page rect{fill:#fff3b522;stroke:#d34d36;stroke-width:5;vector-effect:non-scaling-stroke}.cb-embedded>.ls-header,.cb-embedded>.ls-footer{display:none!important}.cb-embedded{margin:0;background:white}.cb-embedded .cb-main{padding:10px;max-width:none}.cb-embedded .cb-stage{max-height:calc(100dvh - 220px)}.cb-embedded .cb-heading>a:first-child{display:none}.school-copybook-dialog{width:min(1100px,96vw);height:min(940px,94dvh);max-width:none;max-height:94dvh;border:1px solid #bdd1e2;border-radius:14px;padding:10px;overflow:hidden;background:white}.school-copybook-dialog::backdrop{background:#152b40aa}.school-copybook-dialog>header{height:38px;display:flex;justify-content:space-between;align-items:center;gap:10px;color:#234e70;font:600 16px system-ui}.school-copybook-dialog>header button{border:1px solid #b8cedf;border-radius:7px;background:white;color:#234e70;padding:6px 12px;font:14px system-ui;cursor:pointer}.school-copybook-dialog iframe{width:100%;height:calc(100% - 42px);border:0;display:block}.school-bottom-tools>.school-copybook-link{background:#fff7e7!important;border-color:#cfb47b!important;color:#76571d!important;font-weight:600!important;white-space:nowrap}
@media(max-width:650px){.cb-main{padding:8px}.cb-heading{flex-wrap:wrap;justify-content:center;font-size:13px}.cb-heading h1{font-size:19px}.cb-assignment{font-size:14px;margin:7px 0}.cb-pages{gap:4px}.cb-pages button{padding:5px 8px;min-height:34px;font-size:13px}.cb-toolbar{font-size:12px;gap:5px}.cb-toolbar button{padding:5px 8px;min-height:32px}.cb-stage{padding:4px;max-height:calc(100dvh - 300px)}.cb-embedded .cb-stage{max-height:calc(100dvh - 280px)}.cb-page rect{stroke-width:3}.school-copybook-dialog{padding:6px;width:98vw;height:96dvh;max-height:96dvh}.school-copybook-dialog>header{font-size:14px}}

/* Show one complete original page, including its pinyin, without nested scrollbars. */
body.copybook-viewer{height:100dvh;overflow:hidden;display:flex;flex-direction:column;background:#f8fafc}
body.copybook-viewer>.ls-header{flex:none}body.copybook-viewer>.ls-footer{display:none!important}
body.copybook-viewer .cb-main{box-sizing:border-box;display:flex;flex:1 1 0;min-height:0;width:100%;max-width:1400px;flex-direction:column;padding:10px 18px;overflow:hidden}
.cb-heading,.cb-assignment,.cb-toolbar{flex:none}.cb-heading h1{font-size:20px}.cb-assignment{margin:7px 0;gap:3px;padding:8px 12px;font-size:14px}.cb-assignment strong{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 14px}.cb-counts{font-weight:400;font-size:13px;color:#526c80}.cb-range{font-size:13px;color:#496c54}.cb-toolbar{margin:4px 0 8px;font-size:13px}.cb-toolbar button{padding:5px 12px;min-height:32px}
body.copybook-viewer .cb-stage{flex:1 1 0;min-height:0;max-height:none!important;display:flex;align-items:center;justify-content:center;overflow:hidden!important;padding:6px;background:#f0f3f5}
body.copybook-viewer .cb-page{flex:none;min-width:0!important;max-width:100%;margin:0;aspect-ratio:auto}
.cb-page img{width:100%;height:100%;object-fit:contain}.cb-page rect{stroke:#5a8566;stroke-width:2;fill:none;vector-effect:non-scaling-stroke}
body.cb-embedded .cb-main{padding:6px 8px}.cb-embedded .cb-heading h1{font-size:18px}
.school-copybook-dialog{box-sizing:border-box;display:flex;flex-direction:column;gap:2px;overflow:hidden}.school-copybook-dialog:not([open]){display:none}.school-copybook-dialog>header{flex:none}.school-copybook-dialog iframe{flex:1 1 0;min-height:0;height:auto}
@media(max-width:650px){body.copybook-viewer .cb-main{padding:5px}.cb-heading{gap:5px;flex-wrap:nowrap;font-size:11px}.cb-heading h1{font-size:16px}.cb-assignment{font-size:12px;padding:6px 8px}.cb-counts,.cb-range,.cb-note{font-size:11px}.cb-toolbar{gap:4px;font-size:11px;margin:3px 0 5px}.cb-toolbar button{padding:5px 8px;font-size:12px}.cb-page rect{stroke-width:1.5}.school-copybook-dialog{height:96dvh;max-height:96dvh}}

/* Contrast against the printed green grid while leaving all text unobscured. */
body.copybook-viewer .cb-page rect{stroke:#1765b0;stroke-width:3;fill:none;vector-effect:non-scaling-stroke}
