/* Full-width console: adjustable systems and overall reactor allocation. */
@media(min-width:901px){
 main{grid-template-rows:64px minmax(0,1fr) auto;padding-bottom:8px}
 main:has(.battle-theatre:not([hidden])){grid-template-rows:64px 150px minmax(300px,1fr) auto;overflow-y:auto}
 .battle-theatre{margin:0}.battle-theatre canvas{height:100%}
}
.lower-grid{display:block;min-width:0}
.lower-grid .systems-panel{min-height:0}
.systems-panel .panel-heading{min-height:25px;padding:4px 10px;gap:12px}
#reactor-value{font:600 12px/1.4 "Segoe UI",sans-serif;color:#ffdc8c}
.systems-panel .reactor-bar{display:flex;min-height:22px;margin:5px 8px 1px;gap:4px}
.systems-panel #power-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:6px;padding:4px 8px;max-height:180px;overflow:auto}
.power-module{min-width:0;background:#111f2b;border:1px solid #405767;padding:4px 6px;color:#f0f5f7;font-family:"Segoe UI",sans-serif}
.module-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:12px;line-height:1.4}
.module-heading strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.module-heading span{color:#a9d9e4;font-variant-numeric:tabular-nums;white-space:nowrap}
.allocation-controls{display:flex;gap:5px;align-items:center;margin:3px 0}
.allocation-controls>button{flex:0 0 23px;width:23px;height:24px;padding:0;font:700 16px/1 "Segoe UI",sans-serif;box-shadow:none}
.allocation-levels{display:flex;gap:3px;flex:1;min-width:0}
.allocation-levels button{flex:1;min-width:0;height:24px;padding:0;border:1px solid #617888;background:#24333f;color:#cbd5df;font:700 11px/1 "Segoe UI",sans-serif;box-shadow:none}
.allocation-levels button.powered{background:#8de1c0;color:#102820;border-color:#b9ffe5}
.allocation-levels button.damaged{background:repeating-linear-gradient(135deg,#532c30,#532c30 3px,#30252c 3px,#30252c 6px);color:#ffbaa5;border-color:#d67d6a;opacity:1}
.power-module>small{display:block;font-size:10px;line-height:1.3;color:#b6c5ce}
.power-module.offline{border-color:#d67d6a}.power-module.offline>small{color:#ffbaa5}
.passive-output{height:24px;margin:3px 0;display:flex;align-items:center;font-size:13px;font-weight:600;color:#f2d496}
.power-legend{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px;margin:0;padding:0 10px 6px;color:#bdcbd4;font:11px/1.4 "Segoe UI",sans-serif}
.power-legend i{display:inline-block;vertical-align:middle;width:8px;height:8px;margin:0 3px 0 8px;border:1px solid #8b9fa9;background:#24333f}.power-legend .lit{background:#8de1c0}.power-legend .broken{background:#d67d6a}
.masthead{grid-template-columns:auto auto minmax(0,1fr);column-gap:18px}
.masthead nav{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:3px;grid-column:3;grid-row:1}
#drill-menu{position:relative;font:11px "Segoe UI",sans-serif}
#drill-menu summary{cursor:pointer;list-style:none;padding:6px 8px;border:1px solid #536078;background:#253044;white-space:nowrap}
#drill-menu summary::after{content:' ▾'}
#drill-menu[open] summary{border-color:#f4c978}
.drill-options{position:absolute;right:0;top:calc(100% + 5px);z-index:20;display:grid;gap:5px;width:150px;padding:8px;border:1px solid #8296a5;background:#111f2b;box-shadow:0 6px 16px #0008}
.view-buttons{align-items:center}
#log-dialog{width:min(760px,94vw);max-width:760px;padding:20px}
#log-dialog header{display:flex;align-items:start;justify-content:space-between;gap:20px}
#log-dialog header p{color:#bdcbd4;margin:6px 0 12px}
#log-dialog #log{max-height:65vh;padding:0;overflow-y:auto}
#log-dialog #log li{font:13px/1.6 "Segoe UI",sans-serif;padding:8px 4px;border-bottom:1px solid #364858}
#log-dialog #log time{font:12px/1.6 Consolas,monospace}
@media(max-width:1100px){.masthead{grid-template-columns:auto 1fr}.masthead .edition{display:none}.masthead nav{grid-column:2}.power-legend{font-size:10px}}
@media(max-width:600px){.systems-panel #power-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:none}.masthead{grid-template-columns:1fr}.masthead nav{grid-column:1;grid-row:2;justify-content:flex-start}}

/* Primary top-bar action; DOM order also puts it first for keyboard navigation. */
.masthead nav #new-run{background:#e4bd76;color:#14212e;border:1px solid #f7d99d;font-weight:700;margin-right:6px;padding:6px 11px;box-shadow:inset 0 1px #ffebbd}
.masthead nav #new-run:hover:not(:disabled){background:#f3d49a;border-color:#fff0c8;color:#101a24}
.masthead nav #new-run:focus-visible{outline:2px solid #fff0c8;outline-offset:3px}

#launch-manifest{width:min(560px,92vw)}
.launch-stores{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:20px 0}
.launch-stores>div{display:grid;gap:8px;padding:12px;background:#142530;border:1px solid #607581;box-shadow:inset 0 3px #90c7b4}
.launch-stores span,.launch-stores small{font:11px Consolas,monospace;color:#bed0d5}
.launch-stores strong{font:700 32px Consolas,monospace;color:#f4cc83}
#launch-crew{padding:12px;border-left:3px solid #b7a0da;background:#26313f;color:#e3d8f4}
