.teaching-dialog{width:min(1540px,98vw);max-width:none;height:96dvh;max-height:96dvh;padding:0;border:1px solid #b9ad98;border-radius:8px;background:#f3f0e9;color:#26221d;overflow:hidden;font-family:system-ui,sans-serif}.teaching-dialog::backdrop{background:#211b15aa}.teaching-toolbar{display:flex!important;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;background:#fff;border-bottom:1px solid #d7d0c4;position:relative;height:auto!important}.teaching-toolbar strong{font-size:18px}.teaching-toolbar span{display:block;font-size:12px;color:#716858;margin-top:3px}.teaching-toolbar nav{display:flex;flex-wrap:wrap;gap:6px;width:auto!important}.teaching-dialog button{font-family:inherit;font-size:13px;line-height:1.4;padding:7px 10px;margin:0;border:1px solid #cfc7b8;border-radius:4px;color:#3e3427;background:#fff;cursor:pointer}.teaching-dialog button:hover{background:#eee7dc}.teaching-dialog button[aria-pressed=true]{background:#f4e3c8;border-color:#8d5c2f}.teaching-dialog button:disabled{opacity:.5;cursor:wait}.teaching-dialog [hidden]{display:none!important}.teaching-dialog [data-teach-status]{margin:0;padding:6px 18px;font-size:13px;min-height:30px;color:#6e4a24;max-height:75px;overflow:auto}.teaching-workspace{display:grid;grid-template-columns:300px minmax(0,1fr);height:calc(100% - 108px);min-height:0}.teaching-editor{overflow:auto;border-right:1px solid #d8d0c1;background:#f7f4ed;padding:16px}.teaching-editor section{padding-bottom:20px;margin-bottom:18px;border-bottom:1px solid #d8d0c1}.teaching-editor h2{font-size:16px;margin:0 0 12px}.teaching-editor h3{font-size:14px}.teaching-editor label,.teaching-share-box label{display:block;font-size:12px;margin:9px 0}.teaching-editor input:not([type=checkbox]),.teaching-editor select,.teaching-editor textarea,.teaching-share-box textarea{display:block;box-sizing:border-box;width:100%;padding:7px;border:1px solid #c6beaf;border-radius:3px;background:#fff;font:14px system-ui;color:#28221a;min-width:0;margin-top:5px}.teaching-editor textarea{resize:vertical}.teaching-editor p{font-size:12px;color:#6f6658;line-height:1.65;margin:7px 0}.teaching-check{display:flex!important;align-items:center;gap:7px;line-height:1.5}.teaching-check input{margin:0}.teaching-buttons{display:flex;gap:6px;flex-wrap:wrap}.teaching-field-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}.teaching-star-choice{display:flex;gap:4px;align-items:center;margin:4px 0}.teaching-star-choice label{flex:1;display:flex;align-items:center;gap:4px}.teaching-star-choice button{font-size:11px;padding:4px 6px}.teaching-preview{margin:0!important;padding:24px!important;overflow:auto;min-width:0;background:#dfdbd2}.teaching-sheet{background:#fff;padding:30px;box-shadow:0 2px 12px #0001;min-height:100%;color:#202020;max-width:1250px;margin:auto}.teaching-sheet-heading{display:block!important;border:0!important;background:transparent!important;height:auto!important;padding:0 0 20px!important;box-shadow:none!important;position:static!important}.teaching-sheet-heading>p:first-child{font-size:12px;letter-spacing:.2em;color:#7b6c54}.teaching-sheet h1{font-family:'Noto Serif TC',serif;font-size:27px;margin:8px 0;line-height:1.5;overflow-wrap:anywhere}.teaching-sheet-heading p{font-size:14px;white-space:pre-line;line-height:1.7}.teaching-sheet-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(220px,1fr);gap:25px;align-items:start}.teaching-chart-svg{display:block;width:100%;height:auto}.teaching-chart-svg [role=button]{cursor:pointer}.teaching-chart-svg [role=button]:focus{outline:2px solid #9b682c;outline-offset:-3px}.teaching-provenance{font-size:11px!important;color:#777!important;line-height:1.7;margin-top:15px!important}.teaching-lesson h2{font-size:17px}.teaching-lesson h3{font-family:'Noto Serif TC',serif;font-size:19px;margin:8px 0}.teaching-lesson p{font-size:14px;line-height:1.85;white-space:pre-line;overflow-wrap:anywhere}.teaching-material{border-bottom:1px solid #ddd3c4;padding:5px 0 18px;margin:0 0 18px}.teaching-material-meta,.teaching-source{font-size:11px;color:#756652;line-height:1.7}.teaching-material details{font-size:12px;margin:10px 0}.teaching-material details p{font-size:12px}.teaching-material small{overflow-wrap:anywhere}.teaching-material-actions{display:flex;gap:5px;flex-wrap:wrap;margin-top:10px}.teaching-empty{color:#857a6b}.teaching-reading .teaching-workspace{grid-template-columns:1fr}.teaching-share-box{padding:4px 18px;background:#faf5e9;max-height:160px;overflow:auto}.teaching-share-box p{font-size:12px;margin:4px 0}.teaching-dialog:has(.teaching-share-box:not([hidden])) .teaching-workspace{height:calc(100% - 260px)}[data-teach-results]{max-height:410px;overflow:auto;margin:12px 0}[data-teach-results] article{padding:12px 0;border-bottom:1px solid #d6cbbb}[data-teach-results] article b{font-size:13px}[data-teach-results] article small{display:block;margin-top:5px;font-size:11px;color:#7d6d57}
@media(max-width:1100px){.teaching-sheet-layout{grid-template-columns:1fr}.teaching-sheet{padding:22px}.teaching-diagram{max-width:720px}.teaching-workspace{grid-template-columns:260px minmax(0,1fr)}.teaching-toolbar{align-items:flex-start;gap:8px}.teaching-toolbar span{display:none}}
@media(max-width:700px){.teaching-dialog{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.teaching-toolbar{padding:10px}.teaching-toolbar nav{max-width:75%;gap:4px}.teaching-toolbar button{font-size:11px;padding:6px}.teaching-workspace{display:flex;flex-direction:column;overflow:auto;height:calc(100% - 130px)}.teaching-preview{order:-1;overflow:visible;padding:12px!important;flex-shrink:0}.teaching-sheet{padding:17px}.teaching-editor{overflow:visible;border:0}.teaching-sheet-layout{gap:16px}.teaching-sheet h1{font-size:24px}.teaching-reading .teaching-workspace{display:block}.teaching-reading .teaching-preview{height:100%;overflow:auto}.teaching-dialog:has(.teaching-share-box:not([hidden])) .teaching-workspace{height:calc(100% - 285px)}}
@media print{body.teaching-open>*:not(.teaching-dialog){display:none!important}body.teaching-open .teaching-dialog{display:block!important;position:static!important;width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;border:0;padding:0;background:white}body.teaching-open .teaching-dialog::backdrop{display:none}body.teaching-open .teaching-toolbar,body.teaching-open .teaching-editor,body.teaching-open [data-teach-status],body.teaching-open .teaching-share-box,body.teaching-open .teaching-material-actions{display:none!important}body.teaching-open .teaching-workspace{display:block!important;height:auto!important;overflow:visible!important}body.teaching-open .teaching-preview{padding:0!important;overflow:visible!important;background:white}body.teaching-open .teaching-sheet{padding:0;box-shadow:none;max-width:none}body.teaching-open .teaching-sheet-heading{display:block!important}body.teaching-open .teaching-sheet-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:16px}body.teaching-open .teaching-material{break-inside:avoid}body.teaching-open .teaching-lesson p{font-size:11px}body.teaching-open .teaching-lesson h3{font-size:14px}body.teaching-open .teaching-provenance{font-size:9px!important}@page{size:A4 landscape;margin:12mm}}

/* Teaching uses the app's original flat board; only its container is fitted. */
.teaching-jpg-image{display:block;margin:0 auto;max-width:100%;height:auto;object-fit:contain}
.teaching-original-board{margin:0 auto;min-width:0!important;zoom:1!important;transform:none!important;--chart-font:"Retro Ming","Noto Serif TC",serif}
.teaching-dialog .teaching-original-board .flat-cell{margin:0;padding:0;border:0;border-radius:0;font:inherit;background:#fff;line-height:normal}
.teaching-original-board .teaching-bound-star{outline:1px solid #a76625;outline-offset:3px;background:#fff2d8}
.teaching-chart-only{display:block}.teaching-chart-only .teaching-diagram{max-width:none}.teaching-chart-only .teaching-lesson{display:none}
.teaching-chart-only .teaching-provenance{text-align:center}
@media print{body.teaching-open .teaching-chart-only{display:block!important}.teaching-original-board{max-width:100%}}
