/* The window, rather than the total document length, determines a study page.
   Overflow remains a fallback until a semantic pager has fitted the content. */
@media(min-width:740px) and (min-height:540px){
 body.study-window:not(.dungeon-battle) #stage:not(.with-sheet):not(.scratch-open){grid-template-columns:minmax(0,1fr);--coachW:0px}
 body.study-window:not(.dungeon-battle) #stage>.coach{display:none!important}
 body.study-window:not(.dungeon-battle) #board{flex:1;min-height:0;display:flex;flex-direction:column;padding:12px 16px;overflow:auto}
 body.study-window:not(.dungeon-battle) #board>.qhead{flex:none;gap:9px;margin:0 0 8px}
 body.study-window #board .qhead h2{font-size:22px;line-height:1.35}
 body.study-window #board .qhead .src{font-size:11px;line-height:1.3;margin-top:2px}
 body.study-window.focus-mode #board:has(.fm-layout) .qhead h2{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 body.study-window:not(.dungeon-battle) #qarea{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;overflow:auto;container:study-card / inline-size}
 body.study-window #qarea>.qt-task{flex:none;margin:0;padding:6px 10px}
 body.study-window #qarea .smart-question-grid{height:100%;min-height:0;grid-template-columns:minmax(235px,.8fr) minmax(0,1.4fr);grid-template-rows:minmax(0,1fr);gap:16px;flex:1}
 body.study-window #qarea .smart-question-grid:has(.smart-question-stem img){grid-template-columns:minmax(0,1.1fr) minmax(280px,1fr)}
 body.study-window #qarea .smart-question-grid.smart-marked{grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr)}
 body.study-window #qarea :is(.smart-question-stem,.smart-question-answers){min-height:0;height:100%;max-height:100%;gap:8px;overflow:auto;padding:0 4px 6px}
 body.study-window #qarea :is(.smart-question-stem,.smart-question-answers)>*{flex:none}
 body.study-window #qarea .smart-question-title{font-size:23px;line-height:1.4}
 body.study-window #qarea :is(.bk-card,.mt-card){padding:10px;gap:8px}
 body.study-window #qarea :is(.bk-line,.mt-line,.mt-prompt){font-size:23px;line-height:1.6}
 body.study-window #qarea :is(.bk-opt,.mt-pickopt,.chip.word){font-size:21px;line-height:1.35;min-height:44px}
 body.study-window #qarea :is(.answer-drag-tip,.bk-option-target,.mt-choice-status){font-size:14px;line-height:1.4}
 body.study-window #qarea :is(.smart-question-stem,.fm-question-pane) :is(.bk-pic,.mt-pic){width:min(100%,calc(var(--vp-media-height,360px)*var(--learning-image-ratio,1)))!important;max-width:100%!important}
 body.study-window #qarea :is(.md-write-image,.mz-write-picture>img,.fl-docimg){max-height:var(--vp-media-height,360px)!important;max-width:100%;width:auto;height:auto;object-fit:contain;margin-inline:auto}
 body.study-window #qarea>.fm{flex:1;min-height:0;max-height:100%;overflow:visible}
 body.study-window #qarea .fm-layout{display:grid;grid-template-columns:minmax(245px,.8fr) minmax(0,1.4fr);grid-template-rows:minmax(0,1fr);gap:16px;align-items:start;height:100%;min-height:0}
 body.study-window #qarea .fm-layout>.fm-question-pane{grid-column:1;grid-row:1;position:relative;top:auto;height:100%;max-height:100%;min-height:0;overflow:auto;padding:8px;border:2px solid var(--line2,#dac9a5);border-radius:14px}
 body.study-window #qarea .fm-layout>.fm-display-pane{grid-column:2;grid-row:1;height:100%;max-height:100%;min-height:0;gap:8px;overflow:auto}
 body.study-window #qarea .fm-layout.vp-search-tabs{grid-template-columns:minmax(0,1fr);grid-template-rows:48px minmax(0,1fr)}
 body.study-window #qarea .vp-search-tabs>.vp-search-nav{grid-column:1;grid-row:1;display:flex;gap:8px;align-items:center}
 body.study-window #qarea .vp-search-tabs>:is(.fm-question-pane,.fm-display-pane){grid-column:1;grid-row:2}
 body.study-window #qarea .vp-search-nav button{min-height:44px;min-width:44px}.vp-search-nav [aria-selected=true]{background:#ffe08a}
 body.study-window #qarea :is(.fm-para,.fm-ex){display:flex;flex-direction:column;gap:8px}
 body.study-window #qarea :is(.fm-ex-b,.fm-lesson-deck){flex:1;min-height:0;height:100%}
 body.study-window #qarea .fm-lesson-wide{grid-template-columns:minmax(245px,.8fr) minmax(0,1.4fr);gap:16px}
 body.study-window #qarea .fm-lesson-wide>.fd-deck-panel{height:100%;max-height:100%;min-height:0;position:relative;top:auto;overflow:auto;padding:8px}
 body.study-window #qarea .vp-lesson-tabs{flex:1;display:flex!important;flex-direction:column;gap:8px;height:100%;min-height:0}
 body.study-window #qarea .vp-lesson-tabs>.fd-tabs{display:flex;flex:none;flex-wrap:wrap;gap:6px}
 body.study-window #qarea .vp-lesson-tabs>.fd-deck-panel{height:auto;flex:1;max-height:100%;min-height:0;overflow:auto;padding:4px}
 body.study-window #qarea .vp-lesson-tabs>.fd-deck-panel[hidden]{display:none!important}
 body.study-window #qarea .fm-acts{position:static;margin-top:0;padding:0;flex:none}
 body.study-window #qarea .fm .fd-player{gap:6px}
 body.study-window #qarea .fm .fd-stage{height:auto!important;min-height:0!important;max-height:none;padding:4px;overflow:visible}
 body.study-window #qarea .fm .fd-diagram{margin:4px 0;overflow:visible;padding:0}
 body.study-window #qarea .fm .fd-lab .fd-diagram>svg{min-width:0;width:100%;height:auto;max-height:var(--vp-media-height,300px);object-fit:contain}
 body.study-window #qarea .fm .fd-caption{padding:6px 8px}
 body.study-window #qarea .fm .fd-caption p{font-size:18px;line-height:1.45}
 body.study-window #qarea .fm .fd-controls{gap:6px}
 body.study-window #qarea .fm :is(.fd-control,.fd-controls>.fd-control,.fd-controls .fd-status){font-size:16px;min-height:44px}
 body.study-window #qarea .fm :is(.fd-controls .btn,.fd-lab .btn,.fd-control input[type=range]){min-height:44px;font-size:16px}
 body.study-window #qarea .fm .fd-vertical{font-size:22px}
 body.study-window #qarea :is(.fm-visual,.fm-canvas){overflow:visible}
 body.study-window #qarea .vp-paged :is(.md-picture,.md-node-diagram)>img{max-height:var(--vp-media-height,280px)!important;max-width:100%;width:auto!important;height:auto!important;object-fit:contain}
 body.study-window #qarea .fm-display-pane:has(.fl-search){display:grid!important;grid-template-columns:minmax(0,1fr) 94px;grid-template-rows:auto minmax(0,1fr);gap:8px;align-items:start}
 body.study-window #qarea .fm-display-pane>.fl-search{grid-column:1;grid-row:1/span 2;min-width:0}
 body.study-window #qarea .fm-display-pane:has(.fl-search)>.fm-acts{grid-column:2;grid-row:1}
 body.study-window #qarea .fm-display-pane:has(.fl-search)>.fl-feedback{grid-column:2;grid-row:2;font-size:14px;line-height:1.4}
 body.study-window #qarea .sc-bodywrap>svg{max-width:100%;max-height:var(--vp-media-height,360px);width:auto;height:auto}
 body.study-window #qarea .fl-grid{gap:1px;padding:4px;max-width:min(100%,var(--vp-media-height,400px));margin-inline:auto;align-self:center}
 body.study-window.smart-study #qarea .smart-question-grid :is(.smart-question-stem,.smart-question-answers) :is(.bk-pic,.mt-pic){width:min(100%,calc(var(--vp-media-height,320px)*var(--learning-image-ratio,1)))!important}
 body.study-window #qarea .md-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body.study-window #qarea .md-cards :is(.md-picture img,.md-node-diagram img){max-height:min(180px,var(--vp-media-height,180px))!important;width:auto!important;height:auto!important}
 body.study-window #qarea .module-bubble-map{height:auto;display:grid;grid-template-columns:1fr 1fr;padding:8px;gap:8px;min-height:0}
 body.study-window #qarea .module-bubble-map>svg{display:none}
 body.study-window #qarea .module-bubble-map>:is(.module-map-node,.module-map-center){position:static;transform:none;width:100%;min-height:70px;border-radius:16px}
 body.study-window #qarea .module-map-center{grid-column:1/-1;max-width:none}
 body.study-window #qarea .module-sort-circles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body.study-window #qarea .module-sort-circle{min-width:0;min-height:120px;width:100%;height:auto;border-radius:18px;padding:10px}
 body.study-window #qarea .module-sort-circle h3{font-size:18px;line-height:1.4}
 body.study-window #qarea .module-sort-task .mp-groups{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body.study-window #qarea .module-sort-task .mp-group{min-height:90px;padding:8px}
 body.study-window #qarea .module-sort-task .mp-group h4{font-size:18px}
 body.study-window #qarea .vp-paged .grid2{grid-template-columns:minmax(0,1fr)}
 body.study-window #qarea .mp-sort-preview{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:6px;align-items:center}
 body.study-window #qarea .mp-sort-preview button{min-height:44px;border:3px solid var(--ink);border-radius:12px;background:#fff6bd}
 body.study-window #qarea .mp-sort-preview .mp-current{min-height:90px;display:grid;justify-items:center;padding:5px}
 body.study-window #qarea .mp-sort-preview .mp-current :is(img,.ic){max-height:60px;max-width:90px;object-fit:contain}
 body.study-window #qarea .mp-sort-task>.mp-pool{display:none}
 body.study-window #qarea .mp-sort-task .mp-groups{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0}
 body.study-window #qarea .mp-sort-task .mp-group{min-height:60px;padding:6px}
 body.study-window #qarea .md-observe :is(.md-svg,.md-source-svg){max-height:calc(var(--vp-media-height,260px) - 100px);width:100%;height:auto}
 body.study-window #qarea .md-cards .md-object-scene{gap:4px;padding:5px;display:flex;flex-wrap:wrap}
 body.study-window #qarea .md-cards .md-object-scene img.md-object-sprite{max-height:60px!important;max-width:60px!important;width:auto!important;height:auto!important}
 body.study-window #qarea .md-cards .md-money-group img{max-height:60px!important;max-width:74px!important;width:auto!important;height:auto!important}
 body.study-window #qarea .md-cards .md-text-card{font-size:22px;line-height:1.4;padding:8px}
 body.study-window #qarea .md-picture>span:not(.md-money-group){font-size:14px;line-height:1.4}
 body.study-window #qarea .md-feature-map{grid-template-columns:minmax(0,1fr) minmax(60px,1fr);gap:8px;padding:6px}
 body.study-window #qarea .md-feature-map>img{max-width:100%;max-height:170px!important;object-fit:contain}
 body.study-window #qarea .md-feature-map>div{gap:5px}
 body.study-window #qarea .md-feature-map>div>span{padding:4px 8px;font-size:18px}
 body.study-window #qarea .md-cards.md-compare{grid-template-columns:repeat(3,minmax(0,1fr))}
 body.study-window #qarea .md-nested-figure{display:flex;min-width:0;flex-direction:column;align-items:center;gap:4px}
 body.study-window #qarea .md-nested-figure img{max-height:170px!important;max-width:100%;object-fit:contain}
 body.study-window #qarea .md-observe svg{max-height:calc(var(--vp-media-height,260px) - 100px)!important;max-width:100%;width:100%;height:auto}
 body.study-window #qarea .module-scene-stage{width:min(100%,calc((var(--vp-media-height,350px) - 70px)*var(--learning-image-ratio,1)))!important;height:auto;margin-inline:auto}
 body.study-window #qarea .ws-scene{width:min(100%,calc(var(--vp-media-height,300px)*1.2857));margin:4px auto}
 body.study-window #qarea .sc-pool{gap:6px;padding:6px}
 body.study-window #qarea .sc-pool .mp-item{width:84px;min-height:0;padding:4px;font-size:16px}
 body.study-window #qarea .sc-pool .mp-item .mp-ic{width:60px;height:60px}
 body.study-window #qarea .sc-pool .mp-item b{font-size:16px;line-height:1.3}
 body.study-window #qarea .fl-face{box-sizing:border-box;min-height:180px;padding:8px}
 body.study-window #qarea .ms-pj{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body.study-window #qarea .lt-seq.vp-paged{display:grid;grid-template-columns:repeat(auto-fit,minmax(50px,1fr));gap:4px;min-width:0}
 body.study-window #qarea .sc-mats{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.study-window #qarea .vp-paged>svg{display:block;max-width:100%;width:100%;height:auto;max-height:calc(var(--vp-page-height,300px) - 80px);object-fit:contain}
 body.study-window #qarea figure>img[data-course-image-kind=standalone]{max-height:calc(var(--vp-media-height,350px) - 20px)!important;max-width:100%;width:auto;height:auto;object-fit:contain}
 body.study-window #qarea .md-shape-board{height:min(300px,var(--vp-media-height,300px));min-height:80px}
 body.study-window #qarea .md-position .md-observe{gap:0;justify-content:flex-start}
 body.study-window #qarea .md-position .md-picture{flex:1;min-height:0;height:calc(100% - 16px)}
 body.study-window #qarea .md-position .md-observe svg{width:100%;height:100%!important;max-height:100%!important;object-fit:contain}
 body.study-window #qarea .md-position .md-observe>b{font-size:12px;line-height:16px}
 body.study-window #qarea .vp-paged>*{margin-block:0!important}
 body.study-window #qarea .vp-reading-task{padding:8px;border:2px solid #d6bd93;border-radius:14px;box-sizing:border-box}
 body.study-window #qarea .vp-page-fragment{line-height:1.6}
 body.study-window #qarea :is(.zh-ybpic,.zh-pyhead) :is(.mt-pic,.bk-pic){width:min(100%,calc(var(--vp-media-height,300px)*var(--learning-image-ratio,1)))!important}
 body.study-window #qarea .vp-paged{margin-block:0;justify-content:flex-start;align-items:stretch}
 body.study-window #qarea .vp-table-page>table{margin:0}
 body.study-window #qarea .mp-vis{max-width:100%;align-items:start}
 body.study-window #qarea .mp-visc{max-width:100%;min-width:0}
 body.study-window #qarea .mp-purse .mp-note.pic{width:calc(145px * var(--nw,1))!important;max-width:100%;height:auto!important}
 body.study-window #qarea .mp-purse .mp-coin.pic{width:54px!important;height:auto!important}
 body.study-window #qarea .md-option-diagram img[data-course-image-kind=thumb]{width:auto!important;height:auto!important;max-height:60px;max-width:68px}
 body.study-window #qarea .bk-node img[data-course-image-kind=thumb]{max-height:90px;max-width:100%}
 body.study-window #qarea .module-map-reading .module-activity-prop{height:85px!important;max-height:85px!important;width:auto!important}
 body.study-window #qarea .fm .houses{min-width:0;width:100%;padding:0;gap:4px}
 body.study-window #qarea .fm .house{width:calc((100% - 16px)/5);min-width:44px}
 body.study-window #qarea .fm .house .body{width:100%;max-width:78px}
 body.study-window #qarea .fm .house .roof{width:100%;max-width:96px}
 body.study-window #qarea .fm .house .plabel{max-width:100%;overflow-wrap:anywhere;font-size:13px}
 body.study-window #qarea .fm-nlwrap{padding:38px 42px 100px;overflow:visible}
 body.study-window #qarea .fm-nl{min-width:0}
 body.study-window #qarea .fm-ticklab{font-size:16px}
 body.study-window #qarea .fm-ticklab .fm-cslot{min-width:44px;width:60px;min-height:44px}
 body.study-window #qarea .fm .tiles{max-width:100%;flex-wrap:wrap}
 body.study-window #stage:is(.scratch-open,.with-sheet) #qarea .smart-question-grid{grid-template-columns:minmax(0,1fr)}
 body.study-window #stage:is(.scratch-open,.with-sheet) #qarea :is(.smart-question-stem,.smart-question-answers){height:auto;max-height:none}
}
.vp-paged{position:relative!important;min-height:0!important;grid-auto-rows:max-content!important;flex-shrink:0!important;height:var(--vp-page-height)!important;box-sizing:border-box!important;padding-bottom:0!important;align-content:start!important;overflow:auto;scrollbar-width:thin}
.vp-flow{display:flex!important;flex-direction:column;flex-wrap:nowrap!important;gap:8px}
.vp-flow>*{flex:none}
[data-vp-pager]>[data-vp-page-hidden],.vp-table-page [data-vp-page-hidden]{display:none!important}
.vp-pages{position:absolute;left:0;right:0;bottom:0;height:48px;display:flex;align-items:center;justify-content:space-between;gap:6px;padding:0 5px;background:#fff6de;border-top:2px solid #d7bc8b;z-index:5;color:var(--ink,#2b1d14);font:700 14px/1.3 var(--f-body);box-sizing:border-box}
.vp-pages button{box-sizing:border-box;height:44px;padding:0;line-height:1;min-height:44px;min-width:44px;border:3px solid var(--ink,#2b1d14);border-radius:12px;background:#ffe08a;color:inherit;box-shadow:0 2px 0 #a4804e;font:800 18px var(--f-body);cursor:pointer}
.vp-pages button:disabled{opacity:.4;cursor:default}.vp-pages span{text-align:center;min-width:0}.vp-pages button:focus-visible{outline:3px solid #2486a2;outline-offset:2px}
.vp-page-fragment{display:inline}.vp-table-page{min-width:0}.vp-table-page>table{width:100%;max-width:100%}
.vp-pair-board{min-height:0;align-items:start;overflow:hidden}.vp-pair-board>.bk-col,.vp-pair-board .fl-mcol{min-height:0;align-content:start}.vp-pair-board .bk-ropes{overflow:hidden;width:100%;height:100%}.vp-pair-board .bk-ropes path.done{display:none}
@media(max-width:739px),(max-height:539px){.vp-paged{height:auto!important;max-height:none!important;padding-bottom:0!important}.vp-pages{position:relative;margin-top:8px}}

.vp-table-columns{position:relative;max-width:100%;padding-bottom:56px;box-sizing:border-box}.vp-table-columns [data-vp-page-hidden]{display:none!important}
body.study-window #qarea .vp-table-columns table{max-width:100%;width:100%;table-layout:fixed;margin:0}body.study-window #qarea .vp-table-columns :is(th,td){white-space:normal;overflow-wrap:anywhere;min-width:0;padding:4px}
body.study-window #qarea .vp-table-columns th{width:115px}

body.study-window #qarea .fm .fd-stage.vp-paged{height:var(--vp-page-height)!important}

body.study-window #qarea .vp-lane{position:relative;padding-bottom:56px!important;box-sizing:border-box}.vp-lane>.vp-master{bottom:0}
body.study-window #qarea .vp-lane>*{margin-block:0!important}
/* Nested comparison figures remain a single three-object group on narrow screens too. */
.md-cards.md-compare{grid-template-columns:repeat(3,minmax(0,1fr))}
.md-nested-figure{display:flex;min-width:0;flex-direction:column;align-items:center;gap:4px}
.md-nested-figure img{max-width:100%;max-height:170px;object-fit:contain}
