/* Available-space layouts. Long semantic content uses visible section pages;
   native overflow remains a fallback for an indivisible control or zoomed text. */
#modal[open]{display:flex;flex-direction:column;width:min(1100px,calc(100vw - 24px));height:min(820px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);padding:0;overflow:hidden}
#modal .modal-top{position:relative;flex:0 0 auto;min-height:48px;padding:5px 18px;gap:10px}
#modal #modal-content{flex:1 1 auto;height:auto;min-height:0;padding:18px 22px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#modal-content>:first-child{margin-top:0}#modal-content .modal-title{line-height:1.25;margin-top:0}
#modal-content :is(img,svg,canvas,iframe){max-width:100%}
.viewport-page-away{display:none!important}.viewport-flow{display:contents!important}
.viewport-pages{display:flex;align-items:center;gap:8px;position:sticky;top:0;z-index:6;min-height:44px;margin:0 0 12px;padding:3px 0 7px;background:#0e1b28;border-bottom:1px solid #65838b66;color:#c3d1d4}
.viewport-pages[hidden]{display:none!important}.viewport-pages>button{flex:none;width:44px;min-height:36px;background:#20343d;color:#d5decf;border:1px solid #718885;border-radius:3px;font-size:17px}
.viewport-pages>button:disabled{opacity:.35}.viewport-pages>label{min-width:0;flex:1}.viewport-pages select{display:block;width:100%;min-width:0;min-height:36px;padding:6px 8px;background:#12232e;color:#ded7bd;border:1px solid #718885;border-radius:3px;font:inherit;font-size:12px;text-overflow:ellipsis}.viewport-pages>[role=status]{flex:none;min-width:37px;font-size:11px;text-align:center}
.viewport-paged{overflow-y:auto!important;scrollbar-width:thin}.viewport-paged>.viewport-pages~:not(.viewport-page-away){max-width:100%}
.viewport-pages .sr-only{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
#modal :is(button,summary,select,input):focus-visible{outline:2px solid #ebcb84;outline-offset:2px}
#modal:has(.custom-workspace){height:min(820px,calc(100dvh - 24px));max-height:calc(100dvh - 24px)}
#modal:has(.custom-workspace) #modal-content{padding:12px 18px;overflow:hidden}
.custom-workspace{gap:10px}.setup-panel{padding:0;overflow:auto}.setup-heading .modal-title{font-size:23px}.setup-steps button{min-height:42px;padding:8px 12px}.setup-footer{gap:10px}
.custom-workspace .setup-side-tabs{margin-bottom:9px}.custom-workspace .setup-doctrine{padding:14px}.setup-doctrine dl{margin-top:10px}.setup-doctrine dt{margin-top:8px}
.setup-commander-layout{gap:12px}.fleet-workbench .fleet-side{padding:10px}.fleet-workbench .fleet-unit-editor{gap:12px;padding:10px}.fleet-workbench .fleet-team-presets{flex-wrap:wrap;gap:6px}
.sound-workspace{height:100%;display:flex;flex-direction:column;min-height:0}.sound-workspace-heading,.sound-shared-mixer,.sound-tabs,.sound-workspace-status{flex:none}.sound-workspace-heading{margin:0 0 8px}.sound-workspace-heading h2{font-size:26px}.sound-workspace-heading p{margin:5px 0;font-size:12px}.sound-workspace .sound-tabs{margin:8px 0}.sound-workspace .sound-pane{flex:1 1 auto;min-height:0;overflow:auto}.sound-pane[hidden]{display:none!important}.sound-shared-mixer{padding:10px;gap:12px}.sound-workspace .sound-note{line-height:1.55}.sound-workspace h3{margin:8px 0;font-size:17px}.sound-workspace .sound-card,.sound-workspace .sound-auto-direction{padding:12px}.sound-workspace .sound-repertoire{margin:10px 0;padding:12px}.sound-workspace .faction-music-desk{margin:0!important;padding:12px!important}.sound-workspace .faction-music-desk>div>article{padding:12px!important;flex:1 1 180px!important}.sound-workspace .faction-music-desk iframe{min-height:150px!important;height:min(32dvh,260px);aspect-ratio:16/9}
.manual-cards{gap:8px}.manual-cards article{padding:12px}.manual-cards p{font-size:12px;line-height:1.65}.command-manual .manual-tabs{margin:12px 0}.lesson-menu-grid button{min-height:110px}
.hangar-info{max-height:calc(100dvh - 250px);overflow:auto;scrollbar-width:thin}.ship-selector{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));max-width:min(980px,92vw);width:92vw;overflow:visible!important}.ship-selector button{width:auto!important;min-width:0!important}.ship-selector+.menu-pages{max-width:94vw}.hangar-tools{max-width:94vw;flex-wrap:wrap}
/* Main menu fits without sacrificing a navigation entry. */
#intro{overflow:auto;padding-block:6px;scrollbar-width:thin}.intro-shell{margin-block:auto}#intro h1{font-size:clamp(36px,3.8vw,52px);margin:12px 0 10px}.intro-copy{font-size:13px;line-height:1.65}.intro-launch{margin-top:16px}.intro-mission{padding-top:12px;margin-bottom:9px}.intro-modes{margin-top:9px}.intro-mode{min-height:86px;padding:10px}.intro-bottom-note{margin-top:7px}.intro-sound-note{margin-top:0}.history-entry{min-height:60px}
.feedback-dialog[open]{display:flex;flex-direction:column;max-height:calc(100dvh - 24px);overflow:hidden}.feedback-dialog .feedback-heading{flex:none}.feedback-dialog .feedback-scroll{min-height:0;overflow:auto}.feedback-dialog textarea{max-height:110px;resize:vertical}.feedback-item p{overflow-wrap:anywhere}.feedback-list{margin-top:5px}
@media(min-width:761px) and (min-height:700px){.feedback-scroll{display:grid;grid-template-columns:1fr 1fr;gap:10px 24px}.feedback-scroll>#feedback-description,.feedback-scroll>.feedback-form,.feedback-scroll>.feedback-notice{grid-column:1}.feedback-scroll>.feedback-recent{grid-column:2;grid-row:1/4;margin:0;min-height:0}}
@media(max-width:760px){
 #modal[open],#modal:has(.custom-workspace){width:calc(100vw - 12px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)}#modal .modal-top{min-height:46px;padding:2px 10px}#modal #modal-content,#modal:has(.custom-workspace) #modal-content{padding:10px 12px}
 #app:not([data-view=battle]) .topbar{padding-inline:12px;gap:6px}.topbar .utilities{flex-wrap:nowrap;gap:3px!important}.topbar .utilities .icon-button{flex-shrink:0}
 #app{--menu-top:112px;--menu-bottom:58px}#intro{padding:5px 18px 9px}.intro-shell{margin:0 auto!important;max-width:460px}#intro h1{font-size:33px;line-height:1.17;margin:8px 0}.intro-copy{font-size:12px;line-height:1.5}.intro-launch{margin-top:11px}.intro-mission{padding-top:9px;margin-bottom:8px}.intro-mission h2{font-size:14px}.intro-mission p{font-size:10px}.history-entry{min-height:54px;padding:7px 8px}.history-entry strong{font-size:12px}.history-entry small{font-size:9px}.intro-briefing{min-height:40px;font-size:11px;margin-top:6px}.intro-mode{min-height:76px;padding:8px 6px;gap:3px}.intro-mode strong{font-size:12px}.intro-mode .mode-description{font-size:9px}.intro-tutorial{margin-top:6px;min-height:38px}.intro-bottom-note{gap:6px;flex-wrap:wrap}.intro-bottom-note .intro-sound-note{font-size:9px}.intro-feedback{font-size:10px}.intro-footer{min-height:48px;font-size:8px;padding-block:7px}.intro-footer>div{font-size:9px}
 .setup-heading{gap:8px}.setup-heading .modal-title{font-size:17px}.setup-heading .war-tabs button{min-height:36px;padding:6px 8px}.setup-heading>div>small{font-size:8px}.custom-workspace{gap:8px}.setup-steps{gap:4px}.setup-steps button{gap:5px;padding:7px 5px;min-height:40px}.setup-steps button span{font-size:10px}.setup-panel{overflow:auto}.setup-side-tabs>button{padding:7px;min-height:48px}.setup-commander-layout{grid-template-columns:1fr}.setup-footer{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding-top:8px}.setup-footer-actions{grid-column:1/-1;justify-content:flex-end}.setup-footer-summary strong{font-size:17px}.setup-footer-summary small{font-size:9px}.setup-control-option{font-size:10px}.setup-footer-actions button{min-height:40px!important}.setup-footer-actions .primary-button{padding:8px 12px}.setup-footer-actions .quiet-button{font-size:10px}.setup-footer-summary{min-width:0}
 .sound-workspace-heading{gap:8px}.sound-workspace-heading h2{font-size:21px}.sound-workspace-heading p{font-size:11px;line-height:1.4}.sound-workspace-heading>button{min-height:40px;padding:8px;font-size:11px}.sound-shared-mixer{gap:7px;padding:8px}.sound-tabs button{min-height:40px;padding:5px;font-size:11px}.sound-workspace .sound-pane{overflow:auto}.sound-workspace .sound-auto-direction{gap:8px;flex-wrap:wrap}.sound-workspace .sound-note{font-size:11px;line-height:1.5}.sound-workspace .sound-repertoire-heading p{font-size:11px}.sound-workspace .sound-repertoire-list article{padding:8px}.sound-workspace .faction-music-desk>div>article{flex:1 1 125px!important;padding:10px!important}
 .manual-cards{grid-template-columns:1fr}.manual-cards p{font-size:12px;line-height:1.6}.lesson-menu-grid{gap:8px}.lesson-menu-grid button{min-height:110px}.lesson-menu-grid small{font-size:11px}.ship-selector{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.ship-selector button{padding:8px;min-height:53px}.hangar-info{top:124px!important;left:18px!important;max-width:calc(100vw - 36px);max-height:calc(100dvh - 360px)}.hangar-info h2{font-size:27px}.hangar-info #ship-description{font-size:12px;line-height:1.6}.hangar-tools{bottom:190px;gap:5px}
 .feedback-dialog{width:calc(100vw - 16px)}.feedback-dialog .feedback-scroll{padding:12px}.feedback-dialog .feedback-heading{padding:10px 12px}.feedback-dialog textarea{min-height:80px}.feedback-dialog .feedback-note{font-size:10px}.feedback-dialog .feedback-recent{margin-top:12px}
}
@media(max-height:540px) and (orientation:landscape){
 #app{--menu-top:66px;--menu-bottom:35px}#app:not([data-view=battle]) .topbar{height:56px;min-height:56px;flex-wrap:nowrap;padding:5px 16px;gap:12px}#app:not([data-view=battle]) .topbar .wordmark{min-width:135px;font-size:13px}#app:not([data-view=battle]) .topbar nav{gap:14px}#app:not([data-view=battle]) .nav{min-height:36px;padding:10px 0;font-size:11px}.topbar .wordmark small{font-size:7px}.topbar .utilities{gap:3px!important}
 #intro{inset:64px auto 37px 22px;width:min(590px,73vw);padding:2px 10px 2px 0}.intro-shell{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,1.45fr);gap:15px;margin:0!important;max-width:none}.intro-story{padding-top:10px}#intro h1{font-size:30px;margin:8px 0}.intro-copy{font-size:11px}.intro-launch{margin:0}.intro-mission{padding:0;border:0;margin:0 0 5px}.intro-mission>span{font-size:7px}.intro-mission h2{font-size:12px;margin:2px 0}.intro-mission p{font-size:9px}.history-entry{min-height:41px;padding:5px;gap:5px}.history-entry strong{font-size:10px}.history-entry small{font-size:8px}.history-entry-number{font-size:9px}.intro-briefing{min-height:30px;font-size:9px;margin-top:4px;padding:5px}.intro-modes{gap:4px;margin-top:5px}.intro-mode{min-height:52px;padding:5px;gap:1px}.intro-mode small{font-size:6px}.intro-mode strong{font-size:10px}.intro-mode .mode-description{font-size:8px}.intro-mode .mode-symbol{display:none}.intro-tutorial{min-height:30px;margin-top:4px;padding:4px 6px}.intro-tutorial span{font-size:8px}.intro-tutorial strong{font-size:9px}.intro-bottom-note{margin-top:4px;gap:5px}.intro-sound-note{font-size:8px!important}.intro-feedback{font-size:9px;padding:3px}.intro-footer{min-height:32px;padding-block:4px}.intro-footer>span{font-size:7px}.hero-label{right:3%;bottom:46px;max-width:24vw}.hero-label h3{font-size:17px;letter-spacing:1px}.hero-label p{font-size:9px}
 #modal[open],#modal:has(.custom-workspace){height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);width:calc(100vw - 16px)}#modal .modal-top{min-height:40px;padding:0 12px}#modal #modal-content,#modal:has(.custom-workspace) #modal-content{padding:7px 12px}.custom-workspace{gap:6px}.setup-heading .modal-title{font-size:17px}.setup-heading>div>small{display:none}.setup-heading .war-tabs button{min-height:32px;padding:5px 10px}.setup-steps button{min-height:34px;padding:5px 8px}.setup-footer{display:flex;gap:10px;padding-top:5px;min-height:40px}.setup-footer-summary strong{font-size:15px}.setup-footer-summary small{font-size:8px}.setup-footer-actions{gap:6px}.setup-footer-actions .primary-button{min-height:36px;padding:6px 11px}.setup-footer-actions .quiet-button{min-height:36px;padding:5px;font-size:10px}.setup-control-option{max-width:190px}.setup-side-tabs>button{min-height:40px;padding:4px 8px}.viewport-pages{min-height:36px;margin-bottom:7px;padding-bottom:4px}.viewport-pages>button,.viewport-pages select{min-height:30px}.viewport-pages select{font-size:11px}.sound-workspace-heading h2{font-size:20px}.sound-workspace-heading p{font-size:10px;margin:3px 0}.sound-workspace-heading>button{min-height:34px;padding:6px 10px;font-size:11px}.sound-shared-mixer{padding:5px;gap:8px}.sound-workspace .sound-tabs{margin:5px 0}.sound-tabs button{min-height:32px;padding:5px}.sound-workspace-status{font-size:10px;margin:2px 0}.manual-tabs{grid-template-columns:repeat(6,minmax(0,1fr))}.manual-tabs button{min-height:34px}.manual-cards{grid-template-columns:1fr 1fr}.manual-cards p{font-size:11px}.lesson-menu-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.lesson-menu-grid button{min-height:100px}.hangar-info{top:65px!important;left:20px!important;max-height:calc(100dvh - 190px);width:240px!important}.hangar-info h2{font-size:23px}.hangar-info #ship-description{font-size:11px;line-height:1.5}.hangar-tools{bottom:112px}.ship-selector{grid-template-columns:repeat(4,minmax(0,1fr));bottom:39px}.ship-selector button{min-height:54px}.ship-selector+.menu-pages{bottom:3px}
 .feedback-dialog .feedback-scroll{display:grid;grid-template-columns:1fr 1fr;gap:5px 18px}.feedback-scroll>#feedback-description,.feedback-scroll>.feedback-form,.feedback-scroll>.feedback-notice{grid-column:1}.feedback-scroll>.feedback-recent{grid-column:2;grid-row:1/4;margin:0}.feedback-dialog .feedback-heading{padding:6px 12px}.feedback-heading h2{font-size:21px}.feedback-dialog textarea{min-height:60px;max-height:75px}.feedback-dialog .feedback-note{font-size:9px}.feedback-dialog #feedback-description{font-size:11px;margin:0}
}
dialog.feedback-dialog{width:min(880px,calc(100vw - 24px));height:min(730px,calc(100dvh - 24px))}.feedback-scroll{flex:1 1 auto}.feedback-scroll>.viewport-pages{grid-column:1/-1}.feedback-list .menu-pages{margin-top:6px}.feedback-dialog .feedback-send{min-width:110px}.feedback-dialog .feedback-item{padding:9px 0}.feedback-dialog .feedback-item>p{line-height:1.65}
@media(max-width:760px){dialog.feedback-dialog{width:calc(100vw - 16px);height:min(760px,calc(100dvh - 16px))}.feedback-dialog .feedback-send{min-width:105px}}
@media(max-height:540px) and (orientation:landscape){dialog.feedback-dialog{height:calc(100dvh - 12px)}}
/* Keep launch authorization present while browsing a historical briefing. */
.history-room{display:flex;flex-direction:column;height:100%;min-height:0;gap:10px}.history-screen{flex:1;min-height:0;overflow:auto}.history-room .history-launch{flex:none;margin:0}.history-room .history-heading{margin-top:0}.history-room .history-launch-summary{min-width:0}.history-room .history-launch-summary span{line-height:1.5}
@media(max-width:760px){.history-room .history-launch{gap:8px;padding:9px}.history-room .history-launch-summary strong{font-size:12px}.history-room .history-launch-summary span{font-size:10px}.history-room .history-launch .primary-button{min-height:42px}.custom-workspace .setup-footer{grid-template-columns:1fr 1fr;gap:7px}}
@media(max-height:540px) and (orientation:landscape){.history-room{gap:6px}.history-room .history-launch{padding:7px 10px;gap:8px;display:grid;grid-template-columns:minmax(0,1fr) auto auto}.history-room .history-launch-summary strong{font-size:11px}.history-room .history-launch-summary span{font-size:9px}.history-room .history-launch .war-pause-option{font-size:10px}.history-room .history-launch .primary-button{min-height:36px;padding:7px 10px;font-size:11px}.custom-workspace .setup-footer{display:flex;flex-wrap:nowrap;gap:10px}.custom-workspace .setup-footer-actions{flex-wrap:nowrap}}
.viewport-linked-away{display:none!important}
.feedback-scroll.viewport-paged{display:block}
/* Roster size belongs to the outer workspace pager, never to a nested scroller. */
.roster-expand .setup-commander-grid{max-height:none;height:auto;overflow:visible;padding-right:0}
/* Phone page controls keep a full finger target even in a short landscape pane. */
@media(max-width:760px),(max-width:980px) and (max-height:540px){
 .viewport-pages>button,.viewport-pages select{min-height:44px}
 .viewport-pages select{font-size:16px}
 #app[data-view=battle] #fullscreen .fullscreen-label{display:none}
}
