:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:#17364a;background:#eff4f7;font-synthesis:none;--teal:#13776e;--line:#dce6ec;--muted:#617787;--radius:12px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.42}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #e2b44d;outline-offset:2px}#gssv-app{height:100dvh;min-height:420px;display:flex;flex-direction:column;overflow:hidden}.app-header{min-height:56px;display:flex;align-items:center;gap:8px;padding:6px 14px;background:#fff;border-bottom:1px solid var(--line);flex-shrink:0}.brand{display:flex;align-items:center;gap:10px;color:var(--teal);margin-right:auto;font-weight:750;font-size:18px;text-decoration:none}.brand-mark{background:var(--teal);color:white;width:34px;height:34px;border-radius:11px;display:grid;place-items:center}.brand small{display:block;font-weight:450;font-size:11px;color:var(--muted)}.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:46px;padding:8px 12px;border:1px solid #dce6ec;border-radius:10px;background:#f8fafc;color:#22475c;line-height:1.2;white-space:nowrap;touch-action:manipulation}.button:hover:not(:disabled){filter:brightness(.97)}.button.active,.button.primary{background:var(--teal);color:#fff;border-color:var(--teal)}.button.quiet{background:transparent;border-color:transparent}.button .icon{width:20px;height:22px;flex-shrink:0;display:inline-block}.icon svg{display:block;width:100%;height:100%}.pen{--tool:#207858;--pale:#e9f5ee}.eraser{--tool:#ad503c;--pale:#fff0e9}.highlight{--tool:#806307;--pale:#fff4c9}.select{--tool:#70549d;--pale:#f1eafa}.undo{--tool:#3c6598;--pale:#edf3ff}.button.tool{color:var(--tool,#246d82);background:var(--pale,#edf5f8);border-color:#dce6ec}.button.tool.active{color:#fff;background:var(--tool,#246d82);border-color:var(--tool,#246d82)}.app-tools{display:flex;gap:6px;padding:5px 12px;background:#f7fafb;border-bottom:1px solid var(--line);flex-shrink:0;overflow-x:auto;scrollbar-width:thin}.app-tools .button{border:0;background:transparent}.app-tools .button:hover{background:#e8f2f2}.app-tools .button span:last-child{font-size:13px}.workspace{display:flex;flex:1;min-height:0;position:relative}.left-pane{display:none;flex:0 0 var(--left-size,47%);min-width:280px;min-height:0;background:#fff;border-right:1px solid var(--line);flex-direction:column}.workspace.split .left-pane{display:flex}.left-header{display:flex;align-items:center;gap:5px;min-height:48px;padding:3px 9px;background:#f7fafb;border-bottom:1px solid var(--line)}.left-header strong{font-size:14px;margin-right:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.left-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}.split-divider{display:none;width:12px;cursor:col-resize;touch-action:none;background:#e5edf1;flex-shrink:0;position:relative}.split-divider:after{content:'⋮';position:absolute;top:48%;width:100%;text-align:center;color:#617787}.workspace.split .split-divider{display:block}.note-pane{flex:1;min-width:240px;min-height:0;display:flex;flex-direction:column}.note-tools{display:flex;gap:5px;padding:5px 8px;background:#fff;border-bottom:1px solid var(--line);overflow-x:auto;flex-shrink:0}.note-tools .button{font-size:12px;padding:6px 10px;min-width:53px;flex-direction:column;gap:2px;min-height:48px}.note-tools input[type=color]{height:43px;min-width:37px;width:37px;border:0;background:transparent;padding:4px}.note-tools .width-select{width:57px;min-width:57px;border:1px solid var(--line);border-radius:9px;background:#f9fbfc}.board-host{position:relative;flex:1;min-height:0;overflow:hidden;background:#e9eff3;isolation:isolate}.board-paper{position:absolute;left:0;top:0;width:1600px;background:#fff;transform-origin:0 0;box-shadow:0 2px 18px #15354b0b;pointer-events:none;z-index:1}.board-paper[data-paper=ruled]{background-image:linear-gradient(#dfe8f2 1px,transparent 1px);background-size:100% 54px}.board-paper[data-paper=grid]{background-image:linear-gradient(#e7edf5 1px,transparent 1px),linear-gradient(90deg,#e7edf5 1px,transparent 1px);background-size:40px 40px}.board-items{position:absolute;inset:0}.board-item{position:absolute;overflow:visible;pointer-events:none}.board-item>img{display:block;width:100%;height:100%;object-fit:contain}.board-item .text-card{font:28px/1.6 system-ui,sans-serif;white-space:pre-wrap;padding:20px;background:#fff;border:1px solid #e0e9ef;border-radius:10px}.board-ink,.board-live{position:absolute;inset:0;touch-action:none}.board-ink{z-index:2;pointer-events:none}.board-live{z-index:3;outline:none;cursor:crosshair}.board-host[data-tool=pan] .board-live{cursor:grab}.board-handles{position:absolute;inset:0;pointer-events:none;z-index:10}.selection-outline{position:absolute;border:1.5px dashed #765bab;border-radius:2px;pointer-events:none}.resize-handle{position:absolute;width:26px;height:26px;min-height:26px;border:2px solid #765bab;background:white;border-radius:50%;pointer-events:auto;touch-action:none}.board-context{position:absolute;bottom:10px;left:50%;transform:translateX(-50%);z-index:15;display:flex;gap:5px;padding:4px;background:#fffffff2;border-radius:14px;box-shadow:0 3px 20px #12344a18}.board-context:empty{display:none}.board-context .button{font-size:12px;padding:7px 10px}.item-control-layer{position:absolute;inset:0;pointer-events:none;z-index:14}.item-control{position:absolute;pointer-events:auto;display:flex;gap:4px;background:#fffffff2;padding:3px;border:1px solid var(--line);border-radius:12px;box-shadow:0 2px 10px #17364a10;max-width:calc(100% - 8px)}.item-control .button{min-height:42px;min-width:42px;padding:5px 8px;font-size:12px}.item-control>span{align-self:center;font-size:12px;color:var(--teal)}.note-footer{height:38px;display:flex;gap:4px;align-items:center;padding:0 8px;background:#f9fbfc;border-top:1px solid var(--line);flex-shrink:0}.note-footer .button{min-height:32px;min-width:34px;padding:4px 7px;font-size:12px;border:0;background:transparent}.save-status{margin-left:auto;font-size:11px;color:var(--muted);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.page-label{font-size:12px;color:#4a6376}.dialog{border:1px solid var(--line);border-radius:18px;padding:0;width:min(680px,95vw);max-width:96vw;max-height:94dvh;box-shadow:0 24px 100px #17364a38;background:#fff;color:#17364a}.dialog.wide{width:min(1320px,96vw)}.dialog::backdrop{background:#18384a55;backdrop-filter:blur(2px)}.dialog>header{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:8px 18px;background:#f7fafb;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:2}.dialog h2{font-size:18px;margin:0}.dialog-body{padding:16px;overflow:auto;max-height:calc(94dvh - 126px)}.dialog-foot{display:flex;gap:8px;justify-content:flex-end;align-items:center;border-top:1px solid var(--line);padding:10px 16px;background:#fff;position:sticky;bottom:0;z-index:2}.field{display:flex;flex-direction:column;gap:6px;margin:0 0 12px;font-size:13px;color:#526c7e}.field input,.field select,.field textarea{color:#17364a;min-height:46px;width:100%;border:1px solid #ccdce5;border-radius:10px;padding:9px 12px;background:#fff;font-size:17px}.field textarea{min-height:150px;resize:vertical}.pair-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.segmented{display:flex;gap:5px;margin-bottom:14px}.segmented .button{flex:1;font-size:13px;padding:8px 10px}.scroll-row{overflow-x:auto}.method-list{display:grid;gap:9px}.method-list .button{justify-content:flex-start;white-space:normal;text-align:left;padding:14px}.muted{color:var(--muted);font-size:13px}.form-status{min-height:22px;font-size:13px;margin:8px 0}.error,.item-error{color:#a64532}.math-workspace{display:grid;grid-template-columns:310px minmax(350px,1fr);gap:18px;min-height:300px}.math-input{overflow:auto;max-height:70dvh;padding-right:4px}.math-preview-side{min-width:0;display:flex;flex-direction:column}.math-preview{overflow:auto;max-height:64dvh;background:#f3f7fa;padding:14px;border:1px solid var(--line);border-radius:12px;min-height:250px}.math-preview .math-card{font-size:16px}.math-card{background:#fff;color:#17364a;padding:22px 26px;font-size:24px;min-height:100px;border-radius:10px;overflow:hidden;line-height:1.5}.math-card .katex{font-size:1em}.math-card .katex-display{margin:.35em 0;text-align:left}.math-card .katex-display>.katex{text-align:left}.math-row{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:16px;padding:13px 0;border-bottom:1px solid #edf1f4;align-items:center}.math-row:has(.math-rule:empty){grid-template-columns:1fr}.math-rule:empty{display:none}.math-rule{display:flex;flex-direction:column;gap:7px;border-left:1px solid #dce5ed;padding-left:14px;font-size:.77em;color:#597083}.math-actual{min-width:0;overflow-x:auto;scrollbar-width:thin}.math-header{color:#147d84;font-size:1.06em}.math-condition,.math-summary{font-size:.64em;color:#4e697c;margin:10px 0}.math-summary{color:#167a76}.formula{display:inline-block;max-width:100%;vertical-align:middle;white-space:nowrap}.formula.block{display:block;overflow-x:auto}.formula-fallback{white-space:pre-wrap;font-family:serif}.method-step{padding:12px 14px;background:#f8fafc;border-radius:9px;margin:10px 0}.method-step>small{font-size:.66em;color:#587285;display:block;margin-bottom:7px}.method-step .math-row{padding:2px 0;border:0}.method-step.conclusion{background:#eaf6f1;color:#0e796b}.step-controls{display:flex;gap:6px;align-items:center;padding:10px 0;flex-wrap:wrap}.step-controls>span{font-size:13px;color:#517080}.step-controls .button{font-size:12px;min-width:44px}.family-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-bottom:12px}.family-grid .button{flex-direction:column;font-size:12px;min-height:73px;white-space:normal;text-align:center}.family-grid .formula{font-size:16px}.coefficient-fields{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.coefficient-fields input{width:100%;min-width:0}.coefficient-fields .field{margin-bottom:4px}.math-keyboard{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin:10px 0}.math-keyboard .button{padding:7px;font-size:16px}.math-keyboard .button:nth-last-child(-n+2){font-size:12px}.sample-row{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.sample-row .button{font-size:12px}.system-fields{border-left:3px solid #376579;border-radius:14px;padding-left:10px;margin-bottom:12px}.system-input-row{display:flex;align-items:center;gap:5px}.system-input-row .field{width:70px;min-width:0}.system-input-row input{padding:8px 5px;text-align:center}.system-input-row>span{font-size:14px;white-space:nowrap}.fraction-rule{height:2px;background:#17364a;margin:7px 0}.variation-table,.value-table{width:100%;border-collapse:collapse;font-size:.65em;text-align:center;margin:15px 0}.variation-table th,.variation-table td,.value-table th,.value-table td{padding:10px 4px;border-bottom:1px solid #aabecb;white-space:nowrap}.variation-table th{width:30px;border-right:1px solid #aabecb}.variation-table .excluded{border-left:3px double #bd6b45}.variation-table .trend{font-size:30px;color:#2b6e82;min-width:42px}.table-scroll{overflow-x:auto}.plot-wrap{max-width:100%;padding:12px 0}.math-plot{width:100%;max-height:320px;display:block}.math-plot text{font-family:serif;font-size:17px;fill:#526d7f}.measure-card{position:absolute;left:-15000px;top:0;width:1000px;visibility:hidden}.board-item .math-card{width:100%;height:auto;border:1px solid #dce7ed}.calculator-result{min-height:72px;padding:15px;background:#f0f7f5;border-radius:12px;text-align:right;font-size:30px;overflow:auto;margin:10px 0}.calculator-keys{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.calculator-history{max-height:130px;overflow:auto;font-size:13px;color:#617787}.file-actions{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}.file-actions .button{justify-content:flex-start;min-height:60px;white-space:normal;text-align:left}.lesson-list{display:grid;gap:7px;margin-top:16px}.lesson-list .button{justify-content:flex-start;white-space:normal;text-align:left}.lesson-list small{margin-left:auto;color:#617787}.paper-choices{display:flex;gap:8px;margin:12px 0}.app-condensed .app-header{min-height:44px}.app-condensed .brand small,.app-condensed .app-tools{display:none}.app-condensed .note-tools .button{flex-direction:row;min-height:44px}.app-condensed .note-tools .button span:last-child{display:none}.app-condensed .note-tools .button:nth-child(-n+4) span:last-child{display:inline}.app-condensed .note-tools .button{min-width:44px}.free-badge{background:#ecf6f2;color:#327c68;font-size:11px;padding:4px 7px;border-radius:20px}.app-header .button{font-size:13px;min-height:42px;padding:7px 10px}#gssv-toast{position:fixed;left:50%;bottom:26px;transform:translate(-50%,20px);background:#17384af2;color:#fff;padding:12px 18px;border-radius:12px;max-width:min(90vw,600px);font-size:14px;z-index:10000;opacity:0;pointer-events:none;transition:.16s}#gssv-toast.show{opacity:1;transform:translate(-50%,0)}.export-paper{position:relative;width:1600px;background:white;overflow:hidden;isolation:isolate}.export-paper .board-item{z-index:1}.export-paper>canvas{position:absolute;inset:0;z-index:2;pointer-events:none}.hidden{display:none!important}
@media(max-width:1000px){.app-tools{gap:2px}.app-tools .button{padding:7px 9px}.math-workspace{grid-template-columns:270px minmax(280px,1fr);gap:10px}.note-tools{gap:3px;padding:4px}.note-tools .button{padding:6px;min-width:48px}.brand small{display:none}.free-badge{display:none}}@media(max-width:700px){.app-header{padding:5px 8px;gap:3px}.brand{font-size:15px;gap:6px}.brand-mark{width:28px;height:28px}.app-header .button{padding:7px;min-width:40px}.app-header .button span:last-child{display:none}.app-tools .button{min-width:72px;flex-direction:column;gap:2px;font-size:11px}.app-tools .button span:last-child{font-size:11px}.workspace.split .left-pane{position:absolute;inset:0;z-index:30;min-width:0;width:100%}.workspace.split .split-divider{display:none}.workspace.split.notes-focused .left-pane{display:none}.math-workspace{display:flex;flex-direction:column}.math-input{max-height:none;overflow:visible}.math-preview{max-height:52dvh}.dialog-body{padding:12px}.dialog>header{padding:8px 12px}.dialog h2{font-size:16px}.dialog-foot .button{white-space:normal}.math-card{padding:14px 12px}.note-tools .button{min-width:46px;font-size:10px}.note-tools .width-select{display:none}.brand{margin-right:auto}.system-input-row .field{flex:1;width:auto}.item-control .button{font-size:11px;padding:5px}.note-footer{padding:0 4px}.save-status{max-width:110px}.file-actions{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
.math-scaler{width:1000px;transform:scale(var(--item-scale,1));transform-origin:0 0}.math-scaler .math-card{width:1000px}.item-control .button[aria-label="Thu điều khiển"]{min-width:36px}
.app-tools .button{flex-shrink:0}.page-label{white-space:nowrap}.note-footer .button{flex-shrink:0}@media(max-width:700px){.note-footer .button span:last-child{display:none}.note-footer .button[aria-label="Thêm trang"] span:last-child{display:inline}.note-footer .save-status{max-width:120px}.note-footer .button{min-width:36px}}
.board-host{overflow:clip;overflow-anchor:none}.board-paper{overflow-anchor:none}
.brand-logo{display:block;width:40px;height:40px;object-fit:contain;flex:0 0 40px;background:#fff}.app-condensed .brand-logo{width:34px;height:34px;flex-basis:34px}@media(max-width:700px){.brand-logo,.app-condensed .brand-logo{width:32px;height:32px;flex-basis:32px}}

/* 1.0.4: the source stays in the left pane; tools use the note pane. */
.question-tool{min-width:0;max-height:64%;overflow:auto;background:#fff;border-bottom:1px solid #cbdde3;overscroll-behavior:contain}
.question-tool>header{display:flex;gap:8px;align-items:center;justify-content:space-between;padding:8px 12px;position:sticky;top:0;background:#fff;z-index:2}
.question-tool h2{font-size:17px;margin:0}.question-tool .dialog-body{padding:12px}.question-tool .dialog-foot{padding:8px 12px}
.question-tool .math-workspace{display:flex;flex-direction:column;min-width:0;gap:12px}.question-tool .math-preview-side,.question-tool .math-input{min-width:0}
.question-tool .math-preview{max-height:42vh;overflow:auto}.question-tool .math-card{min-width:0;width:100%}
.study-work-modes{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}.study-work-modes button,.question-tool button{min-height:44px}
.has-question-tool .board-host{min-height:180px;flex:1}.app-tools [hidden]{display:none!important}
@media(max-width:700px){.question-tool{max-height:62%;}.question-tool .pair-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.question-tool input{min-width:0;width:100%}.question-tool .dialog-body{padding:8px}.question-tool .math-preview{max-height:32vh}.question-tool .math-card{font-size:16px}.study-toolbar select{max-width:100%;min-height:44px}}

.math-input-disclosure{min-width:0}.math-input-disclosure>summary{cursor:pointer;min-height:44px;padding:10px 4px;font-weight:600}.math-workspace.showing-steps{display:block}.math-workspace.showing-steps .math-input-disclosure{margin-bottom:10px}.source-context{padding:8px 12px;background:#eef7f2;border-bottom:1px solid #cbded7}.source-context p{margin:5px 0;font-size:13px}.source-context button{min-height:44px}.source-input-note{display:block;padding:6px 0}.source-embedded .app-header .brand,.source-embedded .app-header .free-badge{display:none}.source-embedded .app-header>button{display:none}.source-embedded .app-header>button[aria-label="Bài của tôi"],.source-embedded .app-header>button[aria-label="Giữ sáng"]{display:inline-flex}.source-embedded .app-header{min-height:48px;justify-content:flex-end;padding:4px}.source-embedded .workspace{display:block}.source-embedded .note-pane{height:100%}.source-embedded .app-tools:has(button:not([hidden])){display:flex}.source-embedded .app-tools:not(:has(button:not([hidden]))){display:none}.source-pending .board-host{visibility:hidden;pointer-events:none}.source-pending .note-tools,.source-pending .note-footer{pointer-events:none;opacity:.45}.source-embedded .question-tool{max-height:62dvh}.source-embedded .note-tools{overflow-x:auto;flex-wrap:nowrap}.source-embedded .note-tools button{flex-shrink:0;min-height:44px}
.source-pending .question-tool{visibility:hidden}.source-locked .question-tool{display:none}.source-context{flex-shrink:0}

/* Keep formulas legible in a narrow dock, including a tablet split view. */
.question-tool{container-type:inline-size}.hub-return{flex-shrink:0;text-decoration:none}
@container(max-width:500px){.question-tool .math-row{grid-template-columns:minmax(0,1fr);gap:6px}.question-tool .math-rule{border-left:0;border-top:1px solid #dce5ed;padding:8px 0 0;font-size:.85em}.question-tool .math-actual{padding:3px 0}.question-tool .math-preview{padding:8px}}
@media(max-width:700px){.app-header:has(.hub-return) .brand>span{display:none}.app-header:has(.hub-return) .brand{flex:0 0 32px;margin-right:auto}.app-header .hub-return{min-width:44px;min-height:44px}.question-tool .math-row{grid-template-columns:minmax(0,1fr);gap:6px}.question-tool .math-rule{border-left:0;border-top:1px solid #dce5ed;padding:8px 0 0;font-size:.85em}.question-tool .math-actual{padding:3px 0}.question-tool .math-preview{padding:8px}}

/* 1.0.18: context, recovery, readable steps and touch controls. */
#gssv-app{height:var(--gssv-visible-height,100dvh);min-height:0}
.app-header{overflow-x:auto}.app-header>*{flex-shrink:0}
.app-header .button,.note-footer .button,.item-control .button,.item-control .button[aria-label="Thu điều khiển"]{min-width:44px;min-height:44px}
.note-footer{height:auto;min-height:48px;flex-wrap:wrap;padding:2px 8px}.note-footer .save-status{min-width:90px;max-width:100%;white-space:normal;line-height:1.35}
.save-status[data-state=error]{color:#a63c26;font-weight:650}.save-status[data-state=pending]{color:#80610a}.save-status[data-state=saved]{color:#267462}
.note-context{flex-shrink:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:6px 10px;background:#f2f8f7;border-bottom:1px solid #dce6ec;font-size:12px;line-height:1.4;color:#34655f}
.note-tools input[type=color]{height:44px;min-width:44px;width:44px}.note-tools .width-select{min-height:44px}.redo{--tool:#3c6598;--pale:#edf3ff}
.recovery-notice{display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding:10px 14px;background:#fff5dc;border-bottom:1px solid #e6c77b;flex-shrink:0;max-height:32%;overflow:auto}.recovery-notice p{flex:1 1 300px;margin:0;font-size:13px;line-height:1.5}.recovery-notice .button{white-space:normal}
.file-scope{padding:10px 12px;background:#edf6f3;border-radius:9px;line-height:1.5}.file-unsaved{padding:10px 12px;background:#fff1e7;color:#8e3c21;border-radius:9px;font-size:13px;line-height:1.5}
.lesson-row{display:flex;gap:6px;align-items:stretch}.lesson-row>.button:first-child{flex:1;min-width:0}.lesson-row>.button:last-child{flex-shrink:0;white-space:normal;font-size:12px}
.math-data-origin{font-size:13px;line-height:1.5;padding:8px 10px;border-left:3px solid #4a8b7e;background:#f0f8f5;border-radius:5px;margin:6px 0 10px}
.math-example-actions,.math-recent-methods{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0}.math-recent-methods .button{white-space:normal;text-align:left;font-size:13px}
.math-input-hint,.math-calculus-mode-hint{font-size:13px;line-height:1.5;color:#506b79;margin:4px 0 10px}.math-field-error{font-size:13px;line-height:1.45;color:#a23c27;margin:4px 0 10px}.math-field-error:empty{display:none}
.math-family-formula{display:block;font-family:Georgia,serif;font-size:16px;line-height:1.4;white-space:normal;overflow-wrap:anywhere}.math-other-examples>summary{min-height:44px;padding:10px 4px;cursor:pointer;color:#386b61}
.math-step-heading{font-size:15px;line-height:1.4;margin:6px 0 10px;color:#176a63}.math-workspace.showing-steps{display:flex;flex-direction:column;min-height:0;gap:8px}.math-workspace.showing-steps .math-input-disclosure{margin-bottom:0}.math-input-disclosure>summary{border-bottom:1px solid #e0eae8}.math-workspace.showing-steps .math-input-disclosure:not([open])>summary{color:#35685f}
.math-preview-side{min-height:0}.math-preview{min-height:170px}.math-preview .math-card{font-size:18px;line-height:1.6}.math-preview .math-condition,.math-preview .math-summary{font-size:.85em}.math-preview .method-step>small{font-size:.8em}
.step-controls{position:sticky;bottom:0;z-index:1;background:#fff;border-top:1px solid #dce6ec;box-shadow:0 -5px 10px #ffffffc0;gap:6px;padding:8px 0}.step-controls:empty{display:none}.step-controls .button{min-height:44px;font-size:13px}.step-controls>span{font-weight:650;min-width:48px;text-align:center}
.geometry-history{display:flex;flex-wrap:wrap;gap:6px}.geometry-history .button{min-width:44px;min-height:44px}.geometry-current-model{margin:8px 0;font-size:13px;line-height:1.5;color:#376b61}
.dialog{max-height:calc(var(--gssv-visible-height,100dvh) - 16px)}.dialog-body{max-height:calc(var(--gssv-visible-height,100dvh) - 142px)}.dialog-foot{flex-wrap:wrap}
.question-tool{display:flex;flex-direction:column;min-height:0;overflow:hidden}.question-tool>header{flex-shrink:0;flex-wrap:wrap;gap:6px}.question-tool>header h2{margin-right:auto}.question-tool>header .button{font-size:12px;white-space:normal}.question-tool .dialog-body{flex:1;min-height:0;max-height:none;overflow:auto}.question-tool .dialog-foot{flex-shrink:0;flex-wrap:wrap}.has-question-tool .board-host{min-height:110px}
.workspace.tool-expanded .left-pane,.workspace.tool-expanded .split-divider{display:none!important}.workspace.tool-expanded .note-pane{min-width:0;width:100%}.workspace.tool-expanded .note-tools,.workspace.tool-expanded .board-host,.workspace.tool-expanded .note-footer{display:none}.workspace.tool-expanded .question-tool{flex:1;max-height:none}.workspace.tool-expanded .math-preview{max-height:calc(var(--gssv-visible-height,100dvh) - 300px)}
.keyboard-open .app-header,.keyboard-open .app-tools,.keyboard-open .tutor-profile-hint,.keyboard-open .note-tools,.keyboard-open .note-footer{display:none}.keyboard-open .question-tool{max-height:85%;flex:1}.keyboard-open .note-context{padding:3px 10px}.keyboard-open .board-host{min-height:48px}
@media(min-width:701px) and (max-width:1100px){.app-header .button{padding:7px}.app-header .button span:last-child{font-size:12px}.left-header{flex-wrap:wrap}.left-header strong{flex-basis:100%;padding:4px}.math-workspace{grid-template-columns:minmax(230px,1fr) minmax(260px,1.2fr)}.note-footer .save-status{flex-basis:100%;margin-left:0;padding:0 4px 3px}.workspace.split .note-tools .button{min-width:46px}.workspace.split .note-pane{min-width:260px}}
@media(max-width:700px){.app-header .brand>span{display:none}.app-header .button{min-width:44px;min-height:44px}.note-footer .button{min-width:44px;min-height:44px}.note-footer .save-status{flex-basis:100%;max-width:none;margin-left:0;padding:0 5px 4px}.note-footer .button[aria-label="Thêm trang"] span:last-child{display:none}.note-tools{scrollbar-width:thin}.note-tools .button{flex-shrink:0}.note-context{font-size:11px}.question-tool{max-height:70%}.question-tool .dialog-foot{justify-content:stretch}.question-tool .dialog-foot .button{flex:1}.math-example-actions .button{white-space:normal}.geometry-history .button{flex:1;font-size:12px}.lesson-row>.button:last-child span:last-child{display:none}.recovery-notice{max-height:35%;padding:8px}.math-preview{max-width:100%;padding:8px}.math-preview .math-card{font-size:17px}.math-preview .math-row{grid-template-columns:minmax(0,1fr);gap:7px}.math-preview .math-rule{border-left:0;border-top:1px solid #dce5ed;padding:7px 0 0;font-size:.85em}.item-control{flex-wrap:wrap}.item-control .button{min-width:44px;min-height:44px}.workspace.tool-expanded .math-preview{max-height:calc(var(--gssv-visible-height,100dvh) - 290px)}.step-controls .button{flex:1;white-space:normal}.keyboard-open .question-tool{max-height:85%}}

/* Keep the dialog body as the scrolling area; header and actions stay reachable. */
.dialog[open]{display:flex;flex-direction:column;overflow:hidden}
.math-preview .math-actual,.math-preview .formula.block{padding-block:.4em;overflow-y:hidden}
.dialog-body:has(>.math-workspace.showing-steps){display:flex;flex-direction:column;overflow:hidden}
.dialog-body:has(>.math-workspace.showing-steps)>.study-work-modes{flex-shrink:0}
.dialog-body:has(>.math-workspace.showing-steps)>.math-workspace{flex:1 1 auto;min-height:0}
.math-workspace.showing-steps .math-input-disclosure{flex-shrink:0}
.math-workspace.showing-steps .math-input-disclosure[open]{max-height:45%;overflow:auto}
.math-workspace.showing-steps .math-input{max-height:none;overflow:visible}
.math-workspace.showing-steps .math-preview-side{flex:1 1 auto;min-height:0}
.dialog-body:has(>.math-workspace.showing-steps) .math-preview{flex:1 1 auto;min-height:0;max-height:none}
.math-workspace.showing-steps .step-controls,.math-workspace.showing-steps .math-step-heading,.math-workspace.showing-steps .form-status{flex-shrink:0}
.math-workspace.showing-steps .form-status:empty{display:none}
.dialog>header,.dialog>.dialog-foot{flex-shrink:0}
.dialog>.dialog-body{flex:1 1 auto;min-height:0}
