/* Content reflows rather than being cropped. Normal vertical scrolling remains available. */
.app-shell,.game-shell,.main-console,.screen-column,.screen,.stage{min-width:0;max-width:100%}
.stage button,.stage p,.stage h2,.stage h3,.agent-dialogue,.question-title,.feedback{max-width:100%;overflow-wrap:anywhere}
.q-choices{grid-template-columns:repeat(2,minmax(0,1fr))}.q-choice{min-width:0}.q-choice>span:not(.key){min-width:0;overflow-wrap:anywhere}
.screen-top,.screen-footer{flex-wrap:wrap;gap:8px}.screen-top-left{min-width:0;flex-wrap:wrap}.screen-top>div,.screen-footer>div{min-width:0;max-width:100%;overflow-wrap:anywhere}
.timer-row>div:first-child{min-width:0}.timer-box{flex-shrink:0}.roundup,.completion-stats{min-width:0}.challenge-message,.mission-tip,.clue-card,.module-reveal-status{overflow-wrap:anywhere}
.cipher-key,.cipher-code,.cipher-input{max-width:100%}.cipher-keyboard{grid-template-columns:repeat(4,minmax(0,1fr));width:100%}.cipher-letter-button{min-width:0}
#operationDebrief,#sbTestMenu{box-sizing:border-box;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain}
#operationDebrief button,#sbTestMenu button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.debrief-head>div,.debrief-topic,.debrief-stat,.debrief-question{min-width:0;overflow-wrap:anywhere}.debrief-stat strong{overflow-wrap:anywhere}.debrief-continue-banner{min-width:0}.debrief-continue-banner #debriefResume{white-space:normal;overflow-wrap:anywhere;line-height:1.4;padding:14px}
.simple-packet-lane{display:block;padding:12px}.simple-packet-lane .packet-track{height:100px;margin-top:10px}.simple-packet-lane .network-packet{width:144px;min-height:72px;top:12px;font:700 17px 'IBM Plex Mono',monospace;touch-action:manipulation;cursor:pointer}.attack-packet{background:#8c2737!important;border:2px solid #ffb2b8!important;color:#fff!important}.safe-packet{background:#165c3c!important;border:2px solid #8ce9b2!important;color:#e7fff1!important}.packet-arrival,.packet-feedback{font:500 12px/1.5 'IBM Plex Mono',monospace;color:#c8f7df;margin:12px 0}.packet-feedback{min-height:1.6em}.packet-rule{line-height:1.6}
@media(max-width:980px),(max-height:500px){
 .app-shell{padding-inline:12px}.topbar{flex-wrap:wrap;align-items:center;gap:10px;padding:12px 0}.brand{min-width:0;flex-wrap:wrap;gap:8px}.brand-sub{display:none}.top-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));width:100%;gap:7px;justify-content:stretch}.top-actions .offline-status{display:none}.top-actions .icon-btn{min-width:0;min-height:44px;white-space:normal;overflow-wrap:anywhere;line-height:1.4;padding:9px;font-size:10px}.game-heading{flex-wrap:wrap;gap:12px;margin-bottom:16px}.heading-left{min-width:0;max-width:100%}.heading-left h1{font-size:clamp(30px,8vw,58px);letter-spacing:-.04em;overflow-wrap:anywhere}.heading-left p{line-height:1.6;letter-spacing:.05em;overflow-wrap:anywhere}.threat-gauge{width:100%;max-width:320px;padding:10px}.main-console{display:flex;flex-direction:column}.screen-column{order:0;width:100%}.side-panel{order:1;min-height:0;border-right:0;border-top:1px solid #326066;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px}.side-panel .side-head,.side-panel .side-divider,.node-map,.sidebar-bottom{display:none}.status-card,.stat-grid{min-width:0}.status-card strong,.stat strong{overflow-wrap:anywhere}#serverCctv{grid-column:1/-1;width:100%;max-width:440px;justify-self:center}.screen,.stage{min-height:0}.stage{padding:16px 12px}.q-choices{grid-template-columns:1fr}.q-choice{min-height:52px}.agent-portrait{width:min(100%,680px)}.agent-dialogue{padding:16px}.agent-type{min-height:0;font-size:14px;line-height:1.7}.agent-dialogue .primary-btn{width:100%;min-height:48px;white-space:normal;overflow-wrap:anywhere}.agent-link{flex-wrap:wrap;gap:6px}.agent-report-action{margin-left:0;width:100%;min-height:44px}
}
@media(max-width:420px){.app-shell{padding-inline:8px}.stage{padding:14px 9px}.timer-row{gap:8px}.timer-box{min-width:82px;padding:7px}.timer-box strong{font-size:24px}.challenge-title{font-size:21px!important}.screen-top,.screen-footer{padding:10px;font-size:10px}.memory-grid{gap:9px;width:100%}.memory-pad{height:64px}.cipher-glyph,.cipher-letter{min-width:28px;font-size:21px}.cipher-code,.cipher-input{gap:6px}.debrief-head{flex-direction:column}.debrief-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.debrief-stat{padding:11px}.debrief-stat strong{font-size:24px}.debrief-topics{grid-template-columns:1fr}#operationDebrief,#sbTestMenu{padding:14px}.sb-test-choices{grid-template-columns:1fr}.debrief-continue-banner{padding:14px}.debrief-continue-banner h3{font-size:21px}.debrief-continue-banner #debriefResume{font-size:16px}.simple-packet-lane{padding:9px}}
@media(max-height:500px) and (min-width:600px){.stage{padding:12px}.agent-portrait{width:min(100%,360px)}.memory-grid{max-width:330px;gap:8px}.memory-pad{height:60px}.module,.module-inner{height:80px;min-height:80px}.mission-tip{font-size:12px;line-height:1.4;margin-block:8px}.challenge-title{font-size:24px!important}.timer-row{margin-block:0 9px}.simple-packet-lane .packet-track{height:88px}.simple-packet-lane .network-packet{min-height:64px;top:10px}.debrief-stats{grid-template-columns:repeat(4,minmax(0,1fr))}}

@media(max-width:420px){.puzzle-board{padding:8px;min-height:0}.circuit-grid{gap:4px}.clue-card{padding:10px}.roundup,.completion-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.roundup>div,.result-stat{min-width:0;overflow-wrap:anywhere}}

#operationDebrief,#sbTestMenu{overflow-wrap:anywhere;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px)}
@media(max-width:980px){.app-shell{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}}
