/* Scoped imagery for fifth-grade true/false, magnification, and bacterial catch. */
.g5-art-group{display:flex;align-items:center;justify-content:center;gap:18px;width:100%;height:100%;min-width:0}
.g5-art-group>img,.g5-art-group>svg{display:block;flex:1 1 0;width:0;min-width:0;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.question-scene>.g5-art-group{height:clamp(140px,27vh,255px);max-width:700px}
.question-scene .g5-art-group>img{height:100%;width:0;max-width:100%}
.g5-magnification{display:flex;align-items:center;justify-content:center;gap:32px;height:clamp(155px,28vh,255px);width:100%;max-width:680px;margin:0}
.question-scene .g5-magnification .g5-instrument{width:42%;height:100%;object-fit:contain}
.g5-optics{display:flex;flex-direction:column;justify-content:center;gap:12px;width:48%;height:100%}
.g5-optics>div{display:flex;align-items:center;gap:14px;flex:1;min-height:0;padding:8px 12px;background:#173c48;border:1px solid #86a8ad80;border-radius:12px}
.g5-optics .g5-art-group{width:76px;height:70px;flex:0 0 76px}
.g5-optics>div>span{font:500 15px/1.4 system-ui;color:#d9e8e3}
.g5-optics b{display:block;color:#f0e5c8;font-size:21px}
.g5-bacteria-question{font-size:clamp(20px,2.6vw,29px);line-height:1.3;flex-shrink:0}
.g5-bacteria-hint{font-size:13px;line-height:1.4;padding:4px 12px;margin:0;flex-shrink:0}
.g5-bacteria-field{flex-shrink:0}
@media(max-width:600px){
 .question-scene>.g5-art-group{height:clamp(130px,24vh,200px);gap:12px}
 .g5-magnification{gap:12px;height:190px}
 .question-scene .g5-magnification .g5-instrument{width:40%}
 .g5-optics{width:56%;gap:8px}
 .g5-optics>div{gap:7px;padding:7px}
 .g5-optics .g5-art-group{width:45px;height:58px;flex-basis:45px}
 .g5-optics>div>span{font-size:12px}
 .g5-optics b{font-size:18px}
 .g5-bacteria-question{font-size:20px}
}
@media(max-height:500px){.question-scene>.g5-art-group{height:115px}.g5-magnification{height:150px}}

/* Textbook plates with real leader arrows; a separate mobile composition keeps labels readable. */
.g5-diagram-stack{display:flex;flex-direction:column;align-items:center;width:100%;gap:12px;min-width:0}
.g5-study-figure{width:100%;max-width:800px;margin:0;background:#f5f0e6;color:#203d46;border:1px solid #cfcec0;border-radius:15px;overflow:hidden;box-sizing:border-box}
.g5-study-figure>figcaption{padding:13px 15px 0;font:650 18px/1.3 system-ui;text-align:center;color:#233e46}
.g5-study-svg{display:block;width:100%;height:auto;overflow:visible;user-select:none}
.g5-study-mobile{display:none}
.g5-study-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-top:1px solid #cdcfc2;font:13px/1.4 system-ui;color:#425f64}
.g5-study-toolbar button{border:1px solid #668b90;background:#e5e7db;color:#234653;padding:10px 13px;border-radius:9px;min-height:44px;font:600 14px/1.3 system-ui;cursor:pointer;flex-shrink:0}
.g5-study-toolbar button:hover{background:#dce3d6}
.g5-study-toolbar button:focus-visible,.g5-study-dialog button:focus-visible{outline:3px solid #b9853c;outline-offset:2px}
.g5-study-details{padding:8px 14px 12px;text-align:left;font:14px/1.45 system-ui}
.g5-study-details summary{cursor:pointer;min-height:32px;color:#345963}
.g5-study-legend{margin:8px 0 0;padding:0 0 0 23px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 26px;text-align:left;font:14px/1.5 system-ui;color:#354f55}
.g5-study-legend li{padding-left:2px;overflow-wrap:anywhere}
.g5-study-legend b{color:#1f424b}
.question-scenes-wrap:has(.g5-study-figure){justify-content:flex-start}
.question-scenes-wrap .tf-qbox:has(.g5-study-figure){flex:0 0 auto;gap:14px}
.question-scene:has(.g5-study-figure){max-width:800px}
.question-scenes-wrap .tf-qbox:has(.g5-study-figure) .g-question{font-size:clamp(20px,2.3vw,28px);line-height:1.35;max-width:900px}
.g5-study-context{width:150px;height:90px}
.g5-study-context>.g5-art-group{height:100%}
.g5-study-dialog{position:fixed;inset:0;margin:auto;width:min(1100px,calc(100vw - 24px));max-width:1100px;max-height:calc(100dvh - 24px);padding:0;border:1px solid #b0b7a8;border-radius:16px;background:#f5f0e6;color:#203d46;overflow:auto;overscroll-behavior:contain;z-index:20000;box-sizing:border-box}
.g5-study-dialog::backdrop{background:#041319dd}
.g5-study-dialog>header{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f5f0e6f5;padding:12px 17px;border-bottom:1px solid #cdd0c0;z-index:1}
.g5-study-dialog h2{margin:0;font:650 20px/1.3 system-ui;color:#233e46}
.g5-study-dialog button{min-width:44px;min-height:44px;border:1px solid #77959a;border-radius:10px;background:#e4e8db;color:#224551;font:700 19px system-ui;cursor:pointer}
.g5-study-dialog-body{padding:0 14px 18px}
.g5-study-dialog .g5-study-legend{font-size:16px;gap:13px 28px;padding-bottom:10px}
@media(max-width:600px){
 .g5-study-desktop{display:none}
 .g5-study-mobile{display:block}
 .g5-study-figure>figcaption{font-size:17px;padding:11px 10px 0}
 .g5-study-toolbar{flex-direction:column;gap:8px;padding:9px 11px;font-size:12px}
 .g5-study-toolbar button{width:100%}
 .g5-study-legend{grid-template-columns:1fr;gap:10px;font-size:14px}
 .g5-study-dialog{width:calc(100vw - 14px);max-height:calc(100dvh - 14px);border-radius:12px}
 .g5-study-dialog>header{padding:9px 11px}
 .g5-study-dialog h2{font-size:17px}
 .g5-study-dialog-body{padding:0 5px 15px}
 .g5-study-dialog .g5-study-legend{font-size:15px;padding-left:27px;padding-right:13px}
}
