/* Dialogs stay inside the safe screen; only their content region scrolls. */
dialog.screen-panel[open],#researchDialog[open]{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:min(1000px,calc(100dvw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)));height:min(800px,calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));max-width:calc(100dvw - 16px);padding:10px;overflow:hidden;background-color:#eee;color:#111;border:2px solid #222;box-shadow:none;display:flex;flex-direction:column;gap:8px}.screen-panel-head{flex-shrink:0;margin:0!important;min-height:44px}.screen-panel-head h2,#researchDialog h2{font-size:26px!important;line-height:1.1;margin:0!important}.screen-panel-head small,#researchDialog .options-head small{display:none}.screen-panel-body{flex:1;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:0 4px 8px;scrollbar-gutter:stable}.screen-panel-foot{flex-shrink:0;display:flex;gap:8px;padding-top:6px;border-top:1px solid #999}.screen-panel-foot button{min-height:44px!important;margin:0!important;flex:1}.screen-panel-body>:first-child{margin-top:0}.screen-panel-body .options-grid{margin:8px 0;gap:10px}.screen-panel-body .options-grid small{display:none}.screen-panel-body .options-actions{position:sticky;bottom:0;background:#eee;padding:6px 0}.screen-panel-body .commander-banner{min-height:80px;padding:12px}#researchDialog .options-head{flex-shrink:0;min-height:44px}#researchSummary{font-size:13px;line-height:1.3;margin:0;flex-shrink:0}#researchBranches{display:flex;gap:4px;flex-shrink:0}#researchBranches button{flex:1;min-height:44px;font-size:14px;background:#fafafa;color:#111}#researchBranches [aria-selected=true]{background:#222;color:white}#researchNodes{display:block;flex:1;min-height:0;overflow:auto}#researchNodes .research-branch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-height:100%;align-content:stretch}#researchNodes .research-branch[hidden]{display:none}#researchNodes h3{display:none}.research-node{min-height:88px!important;margin:0!important;padding:8px!important;gap:4px!important;overflow-wrap:anywhere;justify-content:center}.research-node::after,.research-node small,.research-node p{display:none!important}.research-node b{font-size:14px;line-height:1.2}.research-node .research-status{font-size:12px;line-height:1.2}.research-node .research-cost{font-size:12px}.research-node.inspected{outline:2px solid #111;outline-offset:-4px}.research-node progress{flex-shrink:0}#researchDetail{flex-shrink:0;display:grid;grid-template-columns:1fr auto;gap:4px 10px;border-top:2px solid #333;padding-top:8px;max-height:34%;overflow:auto}#researchDetailName{font-size:15px}#researchDetailText,#researchDetailNeeds{grid-column:1;font-size:13px;line-height:1.35;margin:0}#researchBegin{grid-column:2;grid-row:1/4;align-self:center;min-height:44px;font-size:14px;max-width:120px}#researchBegin:disabled{opacity:.5}@media(orientation:landscape) and (max-height:600px){dialog.screen-panel[open],#researchDialog[open]{padding:6px;gap:4px;height:calc(100dvh - 8px - env(safe-area-inset-top) - env(safe-area-inset-bottom));max-height:calc(100dvh - 8px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}#researchDialog[open]{display:grid;grid-template-columns:minmax(0,1fr) 220px;grid-template-rows:44px 44px minmax(0,1fr)}#researchDialog .options-head{grid-column:1/3;grid-row:1}#researchSummary{grid-column:2;grid-row:2;align-self:center}#researchBranches{grid-column:1;grid-row:2}#researchNodes{grid-column:1;grid-row:3}#researchDetail{grid-column:2;grid-row:3;display:flex;flex-direction:column;max-height:none;min-height:0;margin:0;padding:6px;border:1px solid #888}#researchBegin{align-self:stretch;margin-top:auto;max-width:none}#researchNodes .research-branch{grid-template-columns:repeat(2,minmax(0,1fr))}.research-node{min-height:76px!important;padding:5px!important}.research-node .research-status{display:none}.screen-panel-body .options-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.screen-panel-body>p{margin:6px 0}.screen-panel-body #conquestMap{max-height:60dvh}}@media(max-height:330px){#researchNodes .research-branch{grid-template-columns:repeat(4,minmax(0,1fr))}#researchDetailText{font-size:12px}}
.world-toolbar{flex-wrap:wrap;gap:4px}.world-toolbar button{min-width:44px;min-height:44px}#worldReport{flex-basis:100%}#conquestMap{height:42dvh;min-height:200px;max-height:none!important;overflow:hidden;margin:8px 0;touch-action:none}#conquestMap svg{min-width:0!important;width:100%;height:100%;touch-action:none;user-select:none}#worldIncursion{min-height:44px;width:100%;margin:4px 0;background:#222;color:white;font-size:14px}@media(orientation:landscape){#conquestMap{height:64dvh;min-height:220px}}
#campaignTech{border:1px solid #888;margin:6px 0;background:#fff8}#campaignTech summary{min-height:44px;cursor:pointer;padding:10px;font-size:14px}#campaignTechCount{padding:0 10px;font-size:13px}#campaignUnlocks{display:flex;gap:8px;overflow:auto;padding:8px;max-height:190px}.campaign-unlock{flex:0 0 160px;border:1px dashed #666;padding:8px;opacity:.65}.campaign-unlock.earned{opacity:1;border:2px solid #222}.campaign-unlock b,.campaign-unlock span{display:block;font-size:14px}.campaign-unlock p{font-size:13px!important;line-height:1.3!important;margin:4px 0!important}

/* Artwork remains visible on compact landscape cards as well as desktop. */
.research-node{display:grid!important;grid-template-columns:64px minmax(0,1fr);grid-template-rows:auto auto auto auto;column-gap:10px!important;align-content:center;align-items:center}.research-art{display:block;width:64px;height:64px;background-repeat:no-repeat;grid-column:1;grid-row:1/4;filter:grayscale(1)}.research-node b,.research-node .research-cost,.research-node .research-status{grid-column:2}.research-node progress{grid-column:1/-1;width:100%}@media(min-width:1000px) and (min-height:650px){.research-node{grid-template-columns:100px minmax(0,1fr)}.research-art{width:100px;height:100px}}@media(orientation:landscape) and (max-height:600px){.research-node{grid-template-columns:48px minmax(0,1fr);column-gap:6px!important}.research-art{width:48px;height:48px;grid-row:1/3}}
