/* Academy 11: readable commands, optional reference, and a board-first layout. */
body{min-width:0}
.game-shell{max-width:1440px;padding:0 24px 20px}
.topbar{height:auto;min-height:64px;gap:16px;padding:10px 0;flex-wrap:wrap}
.brand{flex:1 1 220px;gap:8px}.brand-sc2{width:56px;height:38px}.brand .eyebrow{display:none}.brand h1{font-size:21px;letter-spacing:2px}.brand h1 span{display:none}
.header-status{font-size:12px}.header-buttons{margin:0;gap:7px;align-items:center;flex-wrap:wrap}
.quiet-button,.header-buttons .quiet-button,.header-buttons #sound-toggle,.header-buttons #open-editor{font-size:12px;min-height:38px;padding:8px 11px}
.mission-strip{background:none;padding:10px 0;gap:22px}.mission-title{gap:0;flex:1}.mission-title .section-index,.mission-title .eyebrow{display:none}.mission-title h2{font-size:14px;margin:0 0 3px}.mission-title p{font-size:12px;line-height:1.7}.base-meter{width:160px}.base-meter>div:first-child{font-size:12px;margin-bottom:6px}.base-meter strong{font-size:19px}.quota-block{padding-left:18px}.quota-block>span{font-size:12px}.quota-block strong{font-size:22px}.quota-block small{font-size:11px}
.battle-layout{grid-template-columns:minmax(0,1fr) 330px;gap:18px}.field-column,.command-column{min-width:0}.command-column{max-height:none;overflow:visible;padding:0;gap:9px}.command-column>.panel{order:initial}
.board-frame,.field-heading,.field-instruction,.squad-section{max-width:none;margin-left:0;margin-right:0}.field-heading{height:auto;min-height:28px;margin-bottom:6px;gap:8px}.field-heading h2{font-size:14px}.tower-status{font-size:12px;line-height:1.4}.sector{display:none}
.objective-tracker{font-size:12px;padding:7px 10px;margin-bottom:6px}.objective-tracker p{font-size:12px}.pressure-label{font-size:12px;padding-left:0;margin-bottom:6px;min-height:0}.pressure-label:empty{display:none}
.board-footer{height:auto;min-height:36px;flex-wrap:wrap;gap:6px 15px;padding:7px 0;font-size:12px;color:#adc2c5}.board-footer i{width:9px;height:9px}.board-footer .seed-label{display:none}.coordinates-x,.coordinates-y{font-size:11px;color:#9cb2bb}
.field-instruction{font-size:13px;line-height:1.5;min-height:34px;padding:7px 0}.combat-caption{font-size:13px;margin-left:0}.board .terrain-label,.board .tower-human .terrain-label{font-size:10px;letter-spacing:0}.board .base-icon .terrain-label{font-size:9px}
.panel{padding:13px;background:linear-gradient(120deg,#1b2a33,#101c25)}.panel-heading{margin-bottom:8px;padding-bottom:6px}.panel-heading h3{font-size:14px;font-weight:600}.small-tag{font-size:11px}.eyebrow{font-size:10px;letter-spacing:1px}
.selected-panel .selected-hero{min-height:0;gap:12px;margin:0 0 9px}.portrait-monitor{width:50px;height:66px}.selected-hero h2{font-size:18px;margin-top:0}.selected-hero p,.selected-identity>small{font-size:12px}.comms-label{display:none}.portrait-health{margin-top:7px}
.selected-stats{padding:9px 0;grid-template-columns:repeat(4,minmax(0,1fr))}.selected-stats div{padding:0 7px;min-width:0}.selected-stats span{font-size:12px}.selected-stats strong{font-size:20px;margin-top:3px;overflow-wrap:anywhere}.selected-stats .ap-stat{font-weight:700}
.action-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding-top:9px;margin-top:8px}.action-button{font-size:13px;gap:5px;padding:0 0 3px;align-items:center}.command-glyph{width:48px}.action-cost{font-size:12px;line-height:1.5;margin-top:6px;color:#9db3bc}
.primary-button,.battle-panel .primary-button{font-size:14px;min-height:44px;padding:11px 12px}.skill-button,.battle-panel .skill-button{padding:8px;gap:9px}.skill-icon,.battle-panel .skill-icon{width:32px;height:32px}.skill-button strong{font-size:13px;font-weight:600}.skill-button small{font-size:11px;line-height:1.5}.skill-footnote,.battle-panel .skill-footnote{font-size:12px;line-height:1.55;margin:6px 0 9px}.skill-footnote:empty,.cost-note:empty{display:none}.cost-note{font-size:12px;line-height:1.5}.end-button{margin-top:9px}
.prep-panel h2{font-size:17px;margin:3px 0 6px}.muted{font-size:12px;line-height:1.6}.threat-grid{margin-top:10px;gap:8px}.threat-grid>div{padding:8px 10px}.threat-grid span{font-size:12px}.threat-grid strong{font-size:19px;margin-top:3px}.threat-grid strong i{font-size:11px}.deployment-brief{padding:9px;font-size:12px;margin-top:8px}.deployment-brief p{margin:5px 0;line-height:1.5}.divider{margin:10px 0}.brief-note p{font-size:12px}.brief-note{margin:7px 0}
details>summary{cursor:pointer;font-size:12px;color:#b5ced4;line-height:1.5;padding:8px 0;min-height:34px}details>summary:hover{color:#e0faf3}details>summary:focus-visible{outline:2px solid #8be4eb;outline-offset:2px}.mission-reference>summary{padding:0;min-height:0;font-size:11px}.mission-reference[open]{max-width:520px}.prep-reference{margin-top:5px}#unit-reference{border-top:1px solid #435964;margin-top:9px}#unit-reference .unit-description{font-size:13px;line-height:1.65;margin:7px 0}#unit-reference .unit-mechanics{max-height:none;overflow:visible;padding:0;margin-bottom:4px;gap:8px}#unit-reference .unit-mechanics>div{font-size:12px;line-height:1.6;grid-template-columns:52px 1fr}
#combat-log{padding:5px 13px}#combat-log>summary{font-size:14px}#combat-log[open]{padding-bottom:12px}.event-log{max-height:220px;margin-top:7px}.log-line{font-size:12px}.log-line .log-turn{font-size:11px}.intent-list{max-height:180px}.intent-item,.intent-empty,.hatch-summary p,.nest-list{font-size:12px;line-height:1.6}.radar-details{font-size:12px;line-height:1.65}
.supply-panel{padding:9px}.supply-panel label,.supply-panel select{font-size:12px}.supply-panel select{min-height:40px}.playback-actor{font-size:13px}.playback-actions .quiet-button{font-size:12px}
.section-heading{margin:9px 0}.section-heading h2{font-size:14px}.section-heading>span{font-size:12px}.section-heading h2 span{display:none}.squad-budget{font-size:12px;padding:7px 10px;margin:6px 0 8px}.squad-budget p{font-size:12px}.roster{gap:8px}.roster-card{padding:9px;overflow:hidden}.roster-card-header{font-size:11px;letter-spacing:0}.roster-card h3{font-size:13px;margin:5px 0}.roster-card .roster-mode,.roster-vitals,.pilot-line{font-size:11px}.roster-card .key{font-size:10px}.roster-card select,.roster-card select[data-start-mode],.prep-select{font-size:12px;padding:7px 3px;min-height:36px}.roster-icon{height:30px;margin:3px auto}.roster-vitals{gap:5px;flex-wrap:wrap}.pilot-line{line-height:1.4;min-height:0}.roster-ap b{font-size:14px}
.utility-settings,.volume-settings{position:relative}.utility-settings>summary,.volume-settings>summary{border:1px solid #537481;padding:8px 11px;border-radius:3px;min-height:38px;font-size:12px;background:#20323d}.utility-menu{position:absolute;right:0;top:calc(100% + 6px);width:250px;padding:12px;background:#152630;border:1px solid #69818e;box-shadow:0 8px 28px #0009;z-index:45;display:grid;gap:9px}.utility-menu .random-game{margin:0}.utility-menu .random-note{font-size:12px;line-height:1.6;margin:0}.utility-menu a{font-size:13px;color:#bae5d5;padding:7px 0}.volume-settings label{font-size:12px}.page-footer{font-size:11px;margin-top:16px;padding-top:12px}.page-footer>span:nth-child(2){font-size:11px}.ambient-grid:before{opacity:.05}
/* Tutorial DOM is mounted by tutorial.js. It remains in normal flow, never over cells. */
#open-academy{border-color:#99c6a1;color:#d7f5c6}#academy-dialog{width:min(880px,calc(100vw - 24px));max-width:880px;max-height:90dvh;overflow:auto;padding:24px}#academy-dialog h2{font-size:24px;margin:6px 0 14px}#academy-welcome{font-size:14px;line-height:1.7;color:#b8ccd4;margin:0 0 18px}#academy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}#academy-grid>button,#academy-grid>article,.academy-card{border:1px solid #4b7075;border-radius:5px;background:#173039;padding:15px;text-align:left;color:#d9ebe8;min-width:0}#academy-grid h3,#academy-grid strong{font-size:16px}#academy-grid p,#academy-grid small{font-size:13px;line-height:1.65;color:#b5c9cd}#academy-grid button{min-height:44px}#coach-panel{position:relative;min-width:0;padding:12px 14px;border:1px solid #739c72;border-left:4px solid #b1d783;border-radius:4px;background:#172f2c;margin:0 0 10px;scroll-margin-top:10px}#coach-progress{font-size:12px;color:#b7d6a4;line-height:1.5}#coach-title{font-size:18px;line-height:1.45;margin:3px 0 5px}#coach-text{font-size:14px;line-height:1.6;color:#e1ede4}#coach-tip{font-size:12px;line-height:1.6;color:#b7c9bd;margin-top:5px}#coach-next,#coach-retry,#coach-exit{min-height:40px;font-size:13px;padding:8px 12px;margin:8px 6px 0 0}#coach-next{background:#456b43;border:1px solid #a6cf8a;color:#f0ffe4}#coach-retry,#coach-exit{background:#203a38;border:1px solid #5e7a72}.tutorial-focus{outline:3px solid #ffe58e!important;outline-offset:3px;animation:tutorial-pulse 1.6s ease-in-out infinite!important}.board .tutorial-focus{outline-offset:-2px;z-index:10!important}.board .unit-badge.tutorial-focus{outline-offset:2px}
@keyframes tutorial-pulse{50%{box-shadow:0 0 0 5px #ffe58e35,0 0 14px #f8d67e80}}
@media(min-width:901px) and (max-height:800px){.game-shell{max-width:1440px}.board-frame{width:min(100%,calc((100dvh - 235px)*var(--board-ratio,1.2) + 38px));margin-inline:auto}.topbar{min-height:58px;padding:7px 0}.mission-strip{padding:8px 0}.field-heading,.field-instruction,.squad-section{max-width:none}.command-column{max-height:none}.selected-panel .selected-hero{margin-bottom:6px}.portrait-monitor{height:56px;width:44px}.command-glyph{width:42px}}
@media(max-width:1100px) and (min-width:901px){.game-shell{padding-inline:18px}.battle-layout{grid-template-columns:minmax(0,1fr) 310px}.header-status{margin-left:auto}.header-buttons{gap:5px}.brand{flex-basis:170px}.roster{display:flex;overflow-x:auto;padding-bottom:7px}.roster-card{flex:0 0 138px}}
/* Flatten structural columns only on narrow layouts so commands precede the roster. */
@media(max-width:900px){.game-shell{padding:0 16px 18px}.topbar{gap:8px 12px}.brand{flex-basis:180px}.header-status{margin-left:auto}.header-buttons{width:100%;justify-content:flex-start}.mission-strip{flex-wrap:wrap;gap:9px 20px}.mission-title{width:auto;flex-basis:auto}.base-meter{width:150px}.quota-block{margin-left:auto}.battle-layout{display:flex;flex-direction:column;gap:0}.field-column,.command-column{display:contents}.field-heading{order:0;width:100%}.objective-tracker{order:1;width:100%}.pressure-label{order:2}.field-column>#coach-panel{order:3;width:100%}.board-frame{order:4;width:100%;max-width:none}.combat-caption{order:5;width:100%}.field-instruction{order:6;width:100%}.command-column>#selected-panel{order:7;width:100%;margin-bottom:9px}.command-column>#battle-panel{order:8;width:100%;margin-bottom:9px}.command-column>#intermission-panel{order:9;width:100%;margin-bottom:9px}.squad-section{order:10;width:100%;min-width:0;margin-bottom:10px}.command-column>#prep-panel{order:11;width:100%;margin-bottom:9px}.command-column>.intel-panel{order:12;width:100%;margin-bottom:9px}.command-column>#combat-log{order:13;width:100%}.roster{display:flex;overflow-x:auto;max-width:100%;padding-bottom:8px;scroll-snap-type:x proximity}.roster-card{flex:0 0 150px;scroll-snap-align:start}.selected-panel .selected-hero{margin:0 0 8px}.selected-stats{max-width:none}.action-grid{gap:12px}.action-button{flex-direction:row;justify-content:center;padding:4px;min-height:48px;border:1px solid #47616b;background:#142830;font-size:14px}.command-glyph{width:38px}.selected-panel .portrait-monitor{width:42px;height:54px}.selected-hero h2{font-size:17px}#unit-reference{margin-top:7px}.page-footer>span:nth-child(2){display:none}}
@media(max-width:550px){.game-shell{padding:0 10px 14px}.topbar{display:flex;gap:7px;padding:8px 0;min-height:0}.topbar .brand{width:auto;flex:1;min-width:140px;gap:6px}.topbar .brand h1{font-size:19px;letter-spacing:1px}.brand-sc2{width:38px;height:30px;margin:0}.topbar .header-status{flex-basis:auto;order:initial;margin:0;font-size:11px;gap:4px}.header-divider{margin:0 2px}.topbar .header-buttons{gap:6px;justify-content:flex-start;margin:0}.topbar .header-buttons .quiet-button,.topbar .header-buttons #sound-toggle,.topbar .header-buttons #open-editor{font-size:12px;min-height:40px;padding:8px}.header-buttons .quiet-button span{display:none}.utility-settings>summary,.volume-settings>summary{font-size:12px;min-height:40px;padding:9px 8px}.mission-strip{gap:8px;padding:9px 0}.mission-title{flex-basis:100%;width:100%;background:none}.mission-title h2{display:none}.mission-reference>summary{font-size:12px}.base-meter{width:46%}.quota-block{padding-left:0}.quota-block strong{font-size:21px}.quota-block small{display:none}.field-heading h2{font-size:13px}.tower-status{font-size:11px}.objective-tracker{font-size:12px;padding:7px 9px}.objective-tracker p{font-size:12px}.pressure-label{font-size:12px;padding-left:0}.coordinates-x{font-size:9px}.coordinates-y{font-size:9px}.board-footer{font-size:11px;gap:6px 10px;min-height:38px;margin-left:18px;padding:6px 0}.board-footer>span{gap:2px}.board-footer i{width:8px;height:8px;margin-right:2px}.board .terrain-label,.board .tower-human .terrain-label{font-size:7px}.board .base-icon .terrain-label{font-size:7px}.board .unit-number,.board .unit-mode{font-size:7px}.board .height-mark{font-size:6px}.field-instruction{font-size:12px;line-height:1.5}.panel{padding:11px}.selected-stats span{font-size:12px}.selected-stats strong{font-size:19px}.action-grid{gap:6px}.action-button{font-size:12px;gap:5px}.command-glyph{width:32px}.action-cost{font-size:12px}.roster-card{flex-basis:143px}.roster-card-header{font-size:11px}.roster-card h3{font-size:13px}.roster-card select,.roster-card select[data-start-mode]{font-size:12px;min-height:40px}.roster-card .roster-mode,.roster-vitals,.pilot-line{font-size:11px}.section-heading>span{font-size:11px}.section-heading h2{font-size:14px}.squad-budget p{font-size:12px}.skill-button{min-height:48px}.playback-actions .quiet-button{min-height:42px}.page-footer{font-size:11px}.utility-menu{position:fixed;top:112px;right:12px;max-width:calc(100vw - 24px)}#academy-dialog{padding:20px 15px}#academy-grid{grid-template-columns:1fr}#coach-panel{padding:10px 11px}#coach-title{font-size:16px}#coach-text{font-size:13px}#coach-tip{font-size:12px}.rules-grid p,.manual-foot{font-size:13px;line-height:1.7}}
@media(prefers-reduced-motion:reduce){.tutorial-focus{animation:none!important}}

/* Expose only the systems used in the current exercise. */
[hidden]{display:none!important}
.training [data-training-hidden="true"]{display:none!important}
.training .mission-strip:has(>.mission-title[data-training-hidden="true"]):not(:has(>.base-meter[data-training-hidden="false"])):not(:has(>.quota-block[data-training-hidden="false"])){display:none}
.training .roster{grid-template-columns:repeat(5,minmax(0,1fr))}
.unit-tags{display:flex;gap:5px;flex-wrap:wrap;margin:5px 0 8px}
.unit-tags>span{font-size:12px;line-height:1.4;padding:3px 6px;border:1px solid #45636d;background:#122b33;color:#c4ddd9;border-radius:3px}
.unit-tags .tag-alert{color:#f5c189;border-color:#997354}
.coach-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.coach-tools{display:flex;gap:5px;flex-wrap:wrap}
.coach-tools button,#coach-chapters{min-height:32px;padding:5px 7px;margin:0;font-size:11px;border:1px solid #4f786e;background:#17352f;color:#bad6ca;border-radius:3px}
#coach-text{margin:4px 0;max-width:66em}#coach-tip{margin:5px 0 0}
#coach-action{font-size:15px;line-height:1.55;color:#fff1b7;margin:5px 0 8px;font-weight:600}
#coach-next{width:auto;min-width:170px;min-height:38px;margin:8px 0 0;padding:7px 12px}
.academy-header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.academy-start-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:15px}
.academy-start-actions .primary-button{width:auto;min-width:200px}
.academy-section-heading{display:flex;justify-content:space-between;align-items:center;margin:12px 0;gap:10px}
.academy-section-heading h3{font-size:14px;margin:0}.academy-section-heading>span{font-size:12px;color:#b4cdbe}
#academy-grid .academy-chapter{display:grid;grid-template-columns:22px 42px minmax(0,1fr) 16px;gap:10px;align-items:center;min-height:110px;transition:border-color .15s,background .15s}
#academy-grid .academy-chapter:hover{background:#244139;border-color:#b1d783}
.academy-chapter img{width:42px;height:42px;object-fit:contain;border:1px solid #486972;border-radius:4px}
.academy-chapter strong,.academy-chapter small,.academy-chapter em{display:block}
.academy-chapter em{font-size:11px;color:#d4dab5;font-style:normal;margin-top:5px}
.lesson-index{font-family:var(--mono,monospace);font-size:12px;color:#86a894}
.academy-chapter.completed{border-color:#8ca56c!important}.academy-chapter.completed em{color:#c2e899}
.academy-footnote{font-size:12px;line-height:1.6;color:#93aaa8;margin:18px 0 0}
body[data-phase="prep"]:not(.training) .intel-panel{display:none}
body:not([data-phase="prep"]) .roster-card .roster-card-header,body:not([data-phase="prep"]) .roster-card .roster-mode{display:none}
body:not([data-phase="prep"]) .roster-card .roster-icon{height:24px}
body:not([data-phase="prep"]) .roster-card h3{margin:4px 0}
body:not([data-phase="prep"]) .pilot-line{font-size:10px;line-height:1.4;margin-top:5px}
@media(min-width:901px){
 .board-frame{width:min(100%,calc((max(340px,100dvh - 330px))*var(--board-ratio,1) + 32px));margin-inline:auto}
 .training .board-frame{width:min(100%,calc((max(280px,100dvh - 430px))*var(--board-ratio,1) + 32px))}
 .training .field-heading{display:none}.training .squad-section{margin-top:4px}.training #prep-panel{margin-top:0}
}
#coach-panel .coach-tools button{margin:0;min-height:32px;padding:5px 7px;font-size:11px}
.selected-identity>small{display:none}
.legend-preview{background:repeating-linear-gradient(135deg,#ff9a7d 0 1px,transparent 1px 3px);border:1px solid #ff9a7d}
@media(max-width:900px){
 .training .roster{display:flex}.training .field-heading{display:none}.training .mission-strip{padding:4px 0}.training #coach-panel{margin-top:6px}
 .training .squad-section{order:9}.training #prep-panel{order:10}
}
@media(max-width:550px){
 #academy-dialog h2{font-size:21px}
 #academy-grid .academy-chapter{padding:12px;min-height:104px;gap:8px;grid-template-columns:18px 36px minmax(0,1fr) 12px}
 .academy-chapter img{width:36px;height:36px}#academy-grid strong{font-size:15px}#academy-grid small{font-size:12px}
 #coach-action{font-size:14px}#coach-progress{font-size:11px}.coach-heading{gap:4px}.coach-tools button,#coach-chapters{min-height:36px}
}
.coach-feedback{margin:8px 0 0;padding:8px 10px;border-left:3px solid #e5bf72;background:#352e20;color:#ffe1a6;font-size:13px;line-height:1.6}
