/* BUILD21 history preparation: one bounded workspace and an always visible
   launch row. Scoped to history so custom fleet/commander screens keep theirs. */
dialog:has(.history-room){width:min(1180px,96vw);max-height:94dvh}
dialog:has(.history-room) #modal-content{padding:20px 24px 0}
.history-room{--history-body:14px;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:16px;height:min(760px,calc(92dvh - 90px));min-height:0;font-size:var(--history-body);line-height:1.65;color:#c4d2d9}
.history-room *{box-sizing:border-box}
.history-room button,.history-decision button{font-size:14px;min-height:44px}
.history-room button:focus-visible,.history-room summary:focus-visible,.history-room a:focus-visible,.history-decision button:focus-visible{outline:2px solid #f0d59b;outline-offset:3px}
.history-heading{display:grid;grid-template-columns:1fr auto;gap:4px 24px;align-items:end}
.history-heading .eyebrow{font-size:11px;letter-spacing:1.8px;color:#9cb7c3}
.history-heading .modal-title{font-size:27px;margin:4px 0 0;line-height:1.4}
.history-heading>p{margin:0;max-width:310px;font-size:14px;line-height:1.65;color:#a9bdc8}
.history-heading .war-tabs{grid-column:1/-1;margin:8px 0 0}
.history-heading .war-tabs button{font-size:14px;min-height:42px;padding:8px 20px}
.history-room .history-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.history-cards .war-scenario{min-width:0;min-height:106px;padding:12px;gap:9px;border-color:#56727e70;background:#10212d;text-align:left}
.history-cards .war-scenario>span{font-size:18px;line-height:1.4}
.history-cards .war-scenario small{font-size:11px;letter-spacing:0;color:#a0b6c2}
.history-cards .war-scenario strong{font-size:17px;line-height:1.4;margin:3px 0}
.history-cards .war-scenario p{font-size:13px;line-height:1.45;color:#a6bec9;margin:0}
.history-cards .war-scenario>b{align-self:flex-start;font-size:16px}
.history-cards .war-scenario.selected{background:linear-gradient(110deg,#75603950,#182b36);border-color:#dec184}
.history-workspace{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:20px;align-items:start;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:1px 5px 8px 1px}
.history-briefing{min-width:0;overflow:hidden;border:1px solid #536e7d80;background:#101f2b;display:grid;grid-template-columns:116px minmax(0,1fr)}
.history-briefing .deployment-art{height:100%;min-height:250px;max-height:none;flex:none}
.history-briefing .deployment-art small{font-size:10px;letter-spacing:.5px;left:10px;top:12px;max-width:90px;line-height:1.5}
.history-briefing .deployment-orbit{width:145px;height:145px}
.history-briefing .deployment-fortress{width:50px;height:50px}
.history-briefing .war-operation-copy{padding:16px;border-top:0;border-left:1px solid #4d74804a}
.history-briefing .war-operation-copy>small{font-size:11px;letter-spacing:.5px;color:#d1bd8e}
.history-briefing .war-operation-copy h3{font-size:21px;line-height:1.5;margin:5px 0 10px}
.history-briefing .war-operation-copy>p{font-size:var(--history-body);line-height:1.8;margin:0 0 14px;color:#beced7}
.history-strength{display:flex;gap:20px;flex-wrap:wrap;margin:0 0 12px;font-size:13px;color:#a6bcc8}
.history-strength b{font-weight:500;color:#e1d7b8;display:block;font-size:18px;font-variant-numeric:tabular-nums}
.history-briefing .war-pair{font-size:14px;line-height:1.5;gap:8px;margin-top:0;padding-top:11px}
.history-briefing .war-pair b{font-size:12px;color:#c2af85}
.history-briefing .war-pair i{font-size:11px}
.history-preparation{min-width:0}
.history-modes{margin:0 0 14px;padding:0;border:0;min-width:0;display:grid;gap:8px}
.history-modes legend{font-size:15px;color:#e1d5b7;padding:0 0 8px;font-weight:500}
.history-modes button{display:block;width:100%;padding:11px 13px;text-align:left;border:1px solid #536d7a80;background:#10202a;color:#bdcdd5}
.history-modes button strong{display:flex;align-items:center;gap:9px;font-size:15px;font-weight:500;color:#d7e0df}
.history-modes button em{font-style:normal;font-size:10px;padding:0 6px;border:1px solid #ae98634d;color:#d6c394}
.history-modes button span{display:block;font-size:14px;line-height:1.65;margin-top:4px;color:#9eb7c5}
.history-modes button[aria-pressed="true"]{border-color:#d5ba7c;background:#5148334d;box-shadow:inset 3px 0 #d5ba7c}
.history-modes button[aria-pressed="true"] strong{color:#eed7a4}
.history-reference{border-top:1px solid #55717b6b;margin:0;padding:9px 0;font-size:var(--history-body);line-height:1.8;color:#adc2cd}
.history-reference summary{cursor:pointer;font-size:15px;min-height:32px;color:#d0dcd8}
.history-reference summary>span{font-size:12px;color:#92adbb;margin-left:8px}
.history-reference p{font-size:var(--history-body);margin:8px 0;line-height:1.8}
.history-reference ol{padding-left:22px;margin:9px 0}
.history-reference li{padding:2px 0;font-size:var(--history-body)}
.history-reference p strong{color:#dcc494;font-weight:500}
.history-reference a{display:inline-block;padding:6px 0;font-size:13px;color:#d4c28d;text-decoration:underline;text-underline-offset:3px}
.history-room .history-launch{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:16px;align-items:center;position:sticky;bottom:0;margin:0;padding:14px 0 18px;z-index:5;border-top:1px solid #8b805c80;background:#0c1722;box-shadow:0 -12px 20px #0b151e80}
.history-launch-summary{min-width:0}
.history-launch-summary>strong{display:block;font-size:15px;line-height:1.5;font-weight:500;color:#e8d6ae}
.history-launch-summary>span{display:block;font-size:13px;line-height:1.6;color:#a8c0cb;margin-top:3px}
.history-launch .war-pause-option{font-size:14px;line-height:1.4;gap:8px;max-width:195px}
.history-launch .war-pause-option small{font-size:11px;line-height:1.5;max-width:none;color:#9bb3bf}
.history-launch .war-pause-option input{width:18px;height:18px;flex-shrink:0}
.history-launch>.primary-button{font-size:15px;min-height:50px;min-width:165px;margin:0;padding:12px 18px;gap:18px}
.history-decision{font-size:14px;line-height:1.8;max-width:900px;margin:auto}
.history-decision-pause{display:inline-block;font-size:12px;color:#ead09a;border:1px solid #c4a96780;background:#8b6e2426;padding:4px 10px;margin-bottom:12px}
.history-decision .modal-title{font-size:27px;line-height:1.5;margin-bottom:12px}
.history-decision-detail{font-size:16px;color:#d1dce1;line-height:1.85;margin:0 0 10px}
.history-decision-contract{font-size:14px;line-height:1.8;color:#a4bcc9;margin:0 0 20px}
.history-decision-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.history-decision-options>button{position:relative;text-align:left;padding:18px 38px 18px 18px;border:1px solid #738d997a;background:#142734;color:#c1d2da}
.history-decision-options>button:hover{border-color:#dfc58c;background:#302f29}
.history-decision-options strong{display:block;font-size:17px;font-weight:500;color:#e5d3aa;margin-bottom:6px}
.history-decision-options span{display:block;font-size:14px;line-height:1.85;color:#b2c8d2}
.history-decision-options b{position:absolute;right:15px;top:18px;font-size:20px;font-weight:400;color:#d5bd87}
.history-decision .history-inspect{font-size:14px;padding:15px 0;color:#b7cdd8;min-height:48px}
.history-report-mode{display:flex;flex-wrap:wrap;gap:4px 18px;padding:12px 15px;margin:16px 0;border-left:2px solid #c4ad77;background:#17272d;font-size:14px;line-height:1.8}
.history-report-mode strong{color:#e1cd9f;font-weight:500}
.history-report-mode span{color:#abc2cc}
.history-decision-log{margin:20px 0;padding:16px;border:1px solid #6c81735c;background:#17252b}
.history-decision-log h3{font-size:17px;font-weight:500;color:#e0cea4;margin:0 0 10px}
.history-decision-log ol{list-style:none;padding:0;margin:0;display:grid;gap:9px}
.history-decision-log li{display:flex;gap:15px;font-size:14px;line-height:1.7}
.history-decision-log time{font-size:12px;color:#9db6c2;min-width:45px;font-variant-numeric:tabular-nums}
.history-decision-log strong{font-size:14px;font-weight:400;color:#d0dde0}
@media(max-width:760px){
 dialog:has(.history-room){width:96vw;max-height:96dvh}
 dialog:has(.history-room) #modal-content{padding:12px 12px 0}
 .history-room{--history-body:12px;height:calc(94dvh - 93px);gap:10px}
 .history-heading{grid-template-columns:1fr;gap:3px}
 .history-heading .eyebrow{font-size:10px;letter-spacing:1px}
 .history-heading .modal-title{font-size:21px;margin:2px 0}
 .history-heading>p{font-size:12px;max-width:none;line-height:1.5;margin:0}
 .history-heading .war-tabs{margin-top:4px}
 .history-heading .war-tabs button{min-height:40px;padding:7px 16px;font-size:14px}
 .history-room .history-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .history-cards .war-scenario{min-height:84px;padding:9px;gap:7px}
 .history-cards .war-scenario>span{font-size:15px}
 .history-cards .war-scenario small{font-size:10px;line-height:1.4}
 .history-cards .war-scenario strong{font-size:15px;margin:2px 0}
 .history-cards .war-scenario p{font-size:12px;line-height:1.45}
 .history-cards .war-scenario>b{display:none}
 .history-workspace{grid-template-columns:1fr;gap:12px;padding-right:4px}
 .history-briefing{grid-template-columns:70px minmax(0,1fr)}
 .history-briefing .deployment-art{min-height:190px}
 .history-briefing .deployment-art small{font-size:10px;left:6px;max-width:60px;letter-spacing:0}
 .history-briefing .deployment-orbit{width:100px;height:100px}
 .history-briefing .war-operation-copy{padding:12px}
 .history-briefing .war-operation-copy>small{font-size:10px}
 .history-briefing .war-operation-copy h3{font-size:18px;margin:4px 0 8px}
 .history-briefing .war-operation-copy>p{font-size:12px;line-height:1.8;margin-bottom:10px}
 .history-strength{font-size:12px;gap:18px;margin-bottom:10px}
 .history-strength b{font-size:16px}
 .history-briefing .war-pair{font-size:12px;padding-top:9px}
 .history-briefing .war-pair b{font-size:11px}
 .history-briefing .war-pair i{font-size:10px}
 .history-modes legend,.history-modes button strong,.history-reference summary{font-size:14px}
 .history-modes button span{font-size:12px}
 .history-reference summary>span{font-size:11px}
 .history-reference a{font-size:12px}
 .history-room .history-launch{grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;padding:10px 0 max(12px,env(safe-area-inset-bottom));margin:0}
 .history-launch-summary{grid-column:1/-1}
 .history-launch-summary>strong{font-size:13px}
 .history-launch-summary>span{display:none}
 .history-launch .war-pause-option{font-size:12px;max-width:none}
 .history-launch .war-pause-option small{font-size:10px;max-width:none}
 .history-launch>.primary-button{font-size:14px;min-height:46px;min-width:140px;padding:10px 13px;gap:12px}
 .history-decision{font-size:12px}
 .history-decision-pause{font-size:11px}
 .history-decision .modal-title{font-size:22px}
 .history-decision-detail{font-size:14px}
 .history-decision-contract{font-size:12px}
 .history-decision-options{grid-template-columns:1fr;gap:9px}
 .history-decision-options>button{padding:14px 34px 14px 14px}
 .history-decision-options strong{font-size:16px}
 .history-decision-options span{font-size:12px}
 .history-report-mode{font-size:12px;padding:10px}
 .history-decision-log{padding:12px}
 .history-decision-log h3{font-size:16px}
 .history-decision-log li,.history-decision-log strong{font-size:12px}
 .history-decision-log time{font-size:11px}
}
@media(max-height:650px){
 .history-heading>p{display:none}
 .history-heading .eyebrow{display:none}
 .history-cards .war-scenario{min-height:67px;padding:7px}
 .history-cards .war-scenario p{display:none}
 .history-room{gap:8px}
 .history-heading .modal-title{font-size:20px}
 .history-heading .war-tabs{margin-top:1px}
 .history-room .history-launch{padding-top:8px;padding-bottom:8px}
}

/* Final mobile sizing: reset inherited launch placement before assigning this
   footer's own two rows. Outer scenario cards never consume briefing height. */
.history-room .history-launch{grid-auto-rows:auto}
.history-room .history-launch>.primary-button{grid-column:auto;grid-row:auto;align-self:center}
.history-workspace{grid-auto-rows:max-content;align-content:start}
.history-workspace>.history-briefing,.history-workspace>.history-preparation{min-height:min-content;align-self:start;width:100%}
@media(max-width:760px){
 .history-room{gap:8px}
 .history-heading{gap:0}
 .history-heading>.eyebrow,.history-heading>div>.eyebrow,.history-heading>p{display:none}
 .history-heading .modal-title{font-size:20px;line-height:1.35;margin:0 0 4px;letter-spacing:0}
 .history-heading .war-tabs{margin:0}
 .history-heading .war-tabs button{min-height:40px;padding:7px 15px}
 .history-room .history-cards{grid-template-rows:repeat(2,68px);gap:7px}
 .history-cards .war-scenario{height:68px;min-height:68px;max-height:68px;padding:8px;gap:7px}
 .history-cards .war-scenario p{display:none}
 .history-cards .war-scenario>span{font-size:14px;line-height:1.4}
 .history-cards .war-scenario small{font-size:10px;line-height:1.4;letter-spacing:0}
 .history-cards .war-scenario strong{font-size:15px;line-height:1.35;margin:3px 0 0;letter-spacing:0}
 .history-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:none;grid-auto-rows:max-content;align-content:start;align-items:start;gap:12px;min-height:0;padding:1px 3px 8px 1px}
 .history-workspace>.history-briefing,.history-workspace>.history-preparation{height:auto;min-height:min-content;align-self:start}
 .history-briefing{grid-template-columns:minmax(0,1fr)}
 .history-briefing .deployment-art{display:none}
 .history-briefing .war-operation-copy{border:0;padding:10px 12px}
 .history-briefing .war-operation-copy>small{display:none}
 .history-briefing .war-operation-copy h3{font-size:16px;line-height:1.5;margin:0 0 6px;letter-spacing:0}
 .history-briefing .war-operation-copy>p{font-size:12px;line-height:1.7;margin:0 0 8px}
 .history-strength{gap:16px;margin-bottom:8px;font-size:12px;line-height:1.5}
 .history-strength b{display:inline;font-size:14px;margin-left:4px}
 .history-briefing .war-pair{font-size:12px;padding-top:7px;line-height:1.5}
 .history-briefing .war-pair b{font-size:11px;line-height:1.45;margin-top:2px}
 .history-modes{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-bottom:10px}
 .history-modes legend{font-size:14px;padding-bottom:7px}
 .history-modes button{padding:9px;min-width:0}
 .history-modes button strong{font-size:14px;line-height:1.5;gap:4px;flex-wrap:wrap}
 .history-modes button strong em{display:none}
 .history-modes button span{font-size:12px;line-height:1.6;margin-top:4px}
 .history-room .history-launch{grid-template-columns:minmax(0,1fr) 138px;grid-template-rows:auto 44px;grid-auto-rows:auto;gap:5px 10px;padding:8px 0 max(9px,env(safe-area-inset-bottom));align-items:center}
 .history-room .history-launch-summary{grid-column:1/-1;grid-row:1;margin:0;min-width:0}
 .history-launch-summary>strong{font-size:12px;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .history-room .history-launch>.war-pause-option{grid-column:1;grid-row:2;max-width:none;font-size:12px;line-height:1.5;margin:0;gap:6px}
 .history-room .history-launch>.war-pause-option small{font-size:10px;line-height:1.4;margin-top:1px}
 .history-room .history-launch>.primary-button{grid-column:2;grid-row:2;min-width:0;width:100%;min-height:44px;height:44px;padding:9px 11px;margin:0;font-size:14px;gap:8px;align-self:center}
}
