/* Each column gets only the space it needs. Long original passages remain
   accessible; text is never shrunk or clipped to manufacture a scroll-free page. */
body.smart-study #qarea .smart-question-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;min-width:0;align-items:start}
.smart-question-stem,.smart-question-answers{position:relative;display:flex;flex-direction:column;gap:12px;min-width:0;max-width:100%}
.smart-question-title{font:700 clamp(22px,2.2vw,28px)/1.5 var(--f-body);margin:0;overflow-wrap:anywhere}
.smart-question-stem:has(.smart-expand) .smart-question-title{padding-right:52px;min-height:44px}
body.smart-study #board:has(.smart-question-grid) .qhead h2{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body.smart-study #board:has(#smartExpand) #courseImageOpen{display:none}
#qarea .smart-question-grid :is(.qt-task,.answer-drag-tip,.bk-option-target,.bk-note){margin:0}
#qarea .smart-without-picture{display:block;min-width:0}#qarea .mt-choice-col.smart-without-picture{display:flex;flex-direction:column;gap:10px}
#qarea .smart-question-answers :is(.mt-card,.bk-card){width:100%;box-sizing:border-box}
#qarea .smart-question-answers :is(.mt-picks,.bk-tray){margin-top:0}
#qarea .smart-question-answers .mt-picks{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#qarea .smart-question-answers .mt-pickopt .mt-ring{inset:1px}
.smart-expand{position:absolute;top:0;right:5px;z-index:3;min-width:44px;min-height:44px;border:3px solid var(--ink);border-radius:13px;background:#ffe390;color:var(--ink);font:800 28px/1 var(--f-body);box-shadow:0 3px 0 #95754b;cursor:pointer}
.smart-expand:focus-visible{outline:4px solid #258aaa;outline-offset:2px}
body.smart-study #board.smart-expanded{position:fixed!important;inset:12px!important;width:auto!important;height:auto!important;max-height:none!important;z-index:590;box-shadow:0 0 0 100vmax #203329b8!important;animation:none!important;overflow:auto!important}
body.smart-study #board.smart-expanded #qarea{--learning-image-height:calc(100dvh - 180px)!important}
@media(min-width:960px) and (orientation:landscape){
 body.smart-study:not(.dungeon-battle) #stage:not(.with-sheet):not(.scratch-open){--coachW:0px;grid-template-columns:minmax(0,1fr)}
 body.smart-study:not(.dungeon-battle) #stage:not(.with-sheet):not(.scratch-open)>.coach{display:none}
 body.smart-study #qarea .smart-question-grid{grid-template-columns:minmax(0,1.12fr) minmax(280px,1fr);gap:clamp(16px,2vw,28px)}
 body.smart-study #qarea .smart-question-grid.smart-marked{grid-template-columns:minmax(0,1.65fr) minmax(250px,1fr)}
 body.smart-study:not(.dungeon-battle) #board{flex:1;display:flex;flex-direction:column;overflow:hidden}
 body.smart-study:not(.dungeon-battle) #board>.qhead{flex:none;margin-bottom:12px}
 body.smart-study:not(.dungeon-battle) #qarea{flex:1;min-height:0;overflow:auto}
 body.smart-study:not(.dungeon-battle) #qarea .smart-question-grid{height:100%;min-height:0}
 body.smart-study:not(.dungeon-battle) #qarea :is(.smart-question-stem,.smart-question-answers){max-height:100%;overflow:auto;overscroll-behavior:contain;padding:0 5px 8px;scrollbar-width:thin}
 body.smart-study #qarea .smart-question-stem :is(.bk-pic,.mt-pic){width:min(100%,calc((var(--smart-space,480px) - 150px)*var(--learning-image-ratio,1)))!important;flex:none}
 body.smart-study #qarea .smart-marked .smart-question-stem :is(.bk-pic,.mt-pic){width:100%!important}
 body.smart-study #stage:is(.with-sheet,.scratch-open) #qarea .smart-question-grid{grid-template-columns:minmax(0,1fr);height:auto}
 body.smart-study #stage:is(.with-sheet,.scratch-open) #qarea :is(.smart-question-stem,.smart-question-answers){max-height:none;overflow:visible}
 body.smart-study #stage:is(.with-sheet,.scratch-open) #qarea{overflow:auto}
 body.smart-study #board.smart-expanded #qarea .smart-question-grid{grid-template-columns:minmax(0,1.8fr) minmax(280px,1fr);height:100%}
 body.smart-study #board.smart-expanded #qarea .smart-question-stem :is(.mt-pic,.bk-pic){width:100%!important}
}
@media(max-width:959px),(orientation:portrait){
 #qarea .smart-question-answers .mt-picks{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.smart-study #qarea .smart-question-grid{gap:12px}
 body.smart-study #board.smart-expanded{inset:6px!important;padding:10px!important}
}
