/* mobile-ui70: the card and its actions fit the game viewport. Only lists scroll. */
.building-main#overlay{padding:100px 20px 14px}
.building-main #panel{height:100%;max-height:100%;overflow:hidden}
.building-main #panelBody{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.client-native-building{width:100%;min-height:0;flex:1;display:grid;grid-template-columns:minmax(0,.32fr) minmax(0,.68fr);gap:clamp(12px,2vw,30px)}
.client-native-left{min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px}
.client-native-name{position:static;gap:10px;min-height:44px;font-size:clamp(14px,1.7vw,22px);flex:none}
.client-native-name b{width:44px;height:44px;font-size:22px}
.client-native-description{color:var(--muted);font-size:clamp(11px,1vw,14px);line-height:1.3;margin:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;flex:none}
.client-building-scene{height:auto;min-height:0;flex:1}
.client-native-model-fallback{position:absolute;inset:0;display:grid;place-items:center}
.client-native-model-fallback .client-building-preview{width:100%;height:100%;max-height:100%;object-fit:contain}
.client-native-tools{position:static;display:flex;align-items:stretch;gap:4px;flex:none}
.client-native-tools .client-menu-button{min-width:44px;width:auto;height:60px;flex:1;padding:3px;font-size:clamp(9px,1vw,12px);overflow-wrap:anywhere}
.client-native-tools .client-menu-button img{width:24px;height:24px}
.client-native-right{min-width:0;min-height:0;padding:0;gap:8px}
.client-native-next{min-height:44px;margin:0;padding:5px 8px;flex:none}
.client-native-next h2{font-size:clamp(12px,1.4vw,20px)}
.client-native-next .client-level-change{gap:6px}
.client-native-next .client-level-change b{width:30px;height:30px;font-size:18px}
.client-native-comparison{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(8px,1.5vw,20px);flex:1;min-height:0}
.client-native-stats{min-width:0;min-height:0}
.client-native-stat-head,.client-native-benefit{display:grid;grid-template-columns:minmax(0,1fr) auto auto;column-gap:8px;align-items:center}
.client-native-stat-head{min-height:24px;color:var(--muted);font-size:10px;grid-template-columns:minmax(0,1fr) 52px 52px;text-align:right}
.client-native-stat-head>span:first-child{text-align:left}
.client-native-benefits{overflow:visible;flex:none}
.client-native-benefit{min-height:44px;padding:6px;margin-top:3px;font-size:clamp(11px,1.1vw,16px)}
.client-native-benefit>span{max-width:none;line-height:1.2;overflow-wrap:anywhere}
.client-native-benefit>b,.client-native-benefit>strong{white-space:nowrap;font-variant-numeric:tabular-nums}
.client-native-benefit strong{color:var(--positive)}
.client-native-unlocks{gap:4px;max-height:60px;overflow:auto}
.client-native-unlocks:not(:empty){margin-top:4px;padding:0;border-width:1px}
.client-native-unlocks .client-unlock{min-width:44px;min-height:44px;font-size:10px;gap:3px}
.client-native-unlocks .client-unlock img{width:32px;height:32px}
.client-native-requirements{overflow:visible;scrollbar-gutter:auto;min-width:0}
.client-native-requirements h2{font-size:clamp(11px,1.3vw,18px);line-height:1.25;min-height:24px;margin:0;letter-spacing:0}
.client-native-resource{grid-template-columns:28px minmax(0,1fr) 44px 14px;min-height:52px;padding:0 4px;gap:4px}
.client-native-resource>img{width:28px;height:28px}
.client-native-resource>div,.client-native-resource small{font-size:clamp(11px,1.3vw,18px)}
.client-native-resource .client-resource-add{width:44px;height:44px;min-height:44px}
.client-native-resource>[data-requirement-mark]{font-size:16px}
.client-native-blockers{flex:none;display:flex;gap:4px;overflow:auto;max-height:48px}
.client-native-blockers .client-building-blocker{margin:0;padding:0 4px;flex:1;flex-wrap:nowrap;font-size:11px;gap:4px;min-width:0}
.client-native-blockers .client-building-blocker>span{min-width:0}
.client-native-blockers .back-link{margin:0;padding:4px;min-height:44px}
.client-native-bottom{display:flex;gap:8px;flex:none}
.client-native-process{flex:1;min-width:0;padding:4px;display:grid;grid-template-columns:1fr auto;gap:3px;align-items:center}
.client-native-process h3{font-size:11px;margin:0;line-height:1.1}
.client-native-process>b{font-size:15px}
.client-native-process .bar{grid-column:1/-1;height:4px;margin:0}
.client-native-actions{flex:1;min-width:0;margin:0;padding:4px;gap:6px;border-radius:4px}
.client-native-actions>button{min-height:48px;padding:3px;font-size:clamp(11px,1.3vw,16px);gap:2px}
.client-native-actions small{font-size:12px;gap:4px}
.client-native-actions img{width:16px;height:16px}
@media(min-height:451px) and (min-width:801px){.client-building-scene.live-model .client-native-model-fallback{display:none}}
@media(max-height:450px){
 .building-main#overlay{padding:70px 8px 6px;background:#03162cf2}
 .building-main #panelBody{padding:0}
 .building-main .close{top:10px;left:8px;width:44px;height:44px}
 .client-native-base-return{top:10px;right:8px;width:70px;height:44px;font-size:13px}
 .client-native-building{gap:clamp(8px,1.4vw,16px);height:100%}
 .client-native-left{gap:4px}
 .client-native-name{font-size:clamp(12px,1.8vw,16px);line-height:1.1;gap:6px}
 .client-native-description{-webkit-line-clamp:2;font-size:11px;line-height:1.2}
 .client-native-tools .client-menu-button{height:48px;font-size:9px}
 .client-native-tools .client-menu-button img{width:18px;height:18px}
 .client-native-right{gap:4px}
 .client-native-next{min-height:28px;padding:0 5px}
 .client-native-next h2{font-size:12px}
 .client-native-next .client-level-change b{width:24px;height:24px;font-size:16px}
 .client-native-stat-head{min-height:20px;font-size:9px;grid-template-columns:minmax(0,1fr) 42px 42px}
 .client-native-benefit{min-height:28px;padding:3px;margin-top:2px;font-size:clamp(10px,1.4vw,12px);column-gap:4px}
 .client-native-requirements h2{min-height:20px;font-size:11px}
 .client-native-resource{min-height:44px}
 .client-native-resource>div,.client-native-resource small{font-size:clamp(10px,1.55vw,13px)}
 .client-native-bottom{gap:4px}
 .client-native-actions{padding:0;border:0}
 .client-native-actions>button{min-height:44px;font-size:11px}
 .client-native-actions small{font-size:11px}
 .client-native-blockers{max-height:44px}
 .client-native-process h3{font-size:10px}
}

/* Production retains fixed tabs and an order pane, with scroll inside the catalogue. */
.production-screen#overlay{padding:70px 8px 6px}
.production-screen #panel{height:100%;max-height:100%;width:min(1440px,100%);display:flex;flex-direction:column;overflow:hidden}
.production-screen .panel-head{position:static;flex:none;min-height:48px;padding:2px 12px}
.production-screen .panel-head h1{font-size:16px}
.production-screen .panel-head .close{height:44px;width:44px}
.production-screen #panelBody{padding:6px;flex:1;min-height:0;overflow:hidden}
.production-screen .client-production-layout{grid-template-columns:minmax(0,.25fr) minmax(0,.38fr) minmax(0,.37fr);gap:8px;height:100%;margin:0;min-height:0}
.production-screen .client-unit-list,.production-screen .client-unit-details,.production-screen .client-production-action-pane{display:flex;flex-direction:column;min-width:0;min-height:0;gap:4px}
.production-screen .client-unit-list>.back-link{flex:none;min-height:44px;padding:4px;margin:0;font-size:11px}
.production-screen #panelBody .client-tabs{flex:none;margin:0;gap:3px;display:flex}
.production-screen #panelBody .client-tabs button{min-height:44px;flex:1;min-width:0;padding:3px;font-size:11px}
.production-screen .client-unit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:auto;min-height:0;gap:4px;padding:0;scrollbar-gutter:stable;overscroll-behavior:contain}
.production-screen .client-unit-choice{min-height:80px;min-width:0;max-width:none;padding:4px;font-size:10px}
.production-screen .client-unit-choice img,.source-skin .production-screen .client-unit-choice>img{width:44px;height:44px}
.production-screen .client-unit-heading{grid-template-columns:50px minmax(0,1fr);gap:4px;flex:none}
.production-screen .client-unit-heading>img,.source-skin .production-screen .client-unit-heading>.source-unit-art{width:50px;height:50px}
.production-screen .client-unit-heading h2{font-size:14px;margin:0}
.production-screen .client-unit-heading p{display:none}
.production-screen .client-unit-heading .stat{margin:2px 0;font-size:10px}
.production-screen .client-unit-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;flex:none;margin:0}
.production-screen .client-unit-stats>div{padding:3px;min-width:0}
.production-screen .client-unit-stats small{font-size:9px}
.production-screen .client-unit-stats b{font-size:12px}
.production-screen .client-info-tabs{display:flex;flex:none;gap:2px;margin:0}
.source-skin .production-screen #panelBody .client-info-tabs button{min-height:44px;padding:2px;flex:1;font-size:9px;gap:2px;min-width:0}
.production-screen .client-info-tabs img{display:none}
.production-screen .client-unit-information{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}
.production-screen .client-unit-bonuses{font-size:10px}
.production-screen .client-unit-bonuses td,.production-screen .client-unit-bonuses th{padding:4px}
.production-screen .client-balance-note{display:none}
.production-screen .client-production-order{display:flex;flex-direction:column;flex:1;min-height:0;gap:4px;margin:0;padding:4px}
.production-screen .client-production-order>h3{display:none}
.production-screen .client-order-capacity{margin:0;padding:0;font-size:10px;flex:none;min-height:18px}
.production-screen .client-order-capacity img{display:none}
.production-screen .client-order-selector{gap:3px;flex:none}
.production-screen .client-order-selector>button{width:44px;height:44px;flex:none}
.production-screen .item-quantity{min-width:0;padding:0;gap:2px}
.production-screen .item-quantity label{font-size:10px}
.production-screen .item-quantity input{width:100%;min-width:0;height:44px}
.production-screen .field-error:empty{display:none}
.production-screen #production-range{min-height:20px;width:100%;margin:0;flex:none}
.production-screen #productionQuote{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}
.production-screen .quote-status{min-height:16px;font-size:10px;line-height:1.2;margin:0}
.production-screen .client-resource-requirements{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;margin:0}
.production-screen .client-resource-requirements>div{display:grid;grid-template-columns:minmax(0,1fr) 20px;gap:1px;padding:2px;min-height:44px;font-size:10px}
.production-screen .client-resource-requirements img{width:16px;height:16px}
.production-screen .client-resource-requirements small,.production-screen .client-resource-requirements>[data-cost-index]>span{display:none}
.production-screen .client-resource-requirements .client-resource-add{grid-column:2;grid-row:1/3;min-height:44px;width:44px;justify-self:end}
.production-screen #productionQuote .client-benefit{padding:2px;margin:0;font-size:10px;min-height:18px}
.production-screen #productionCommit{min-height:44px;flex:none;padding:4px;font-size:12px}
.production-screen .client-locked-requirements,.production-screen .client-process-state{overflow:auto;min-height:0;flex:1;padding:6px;font-size:11px}
.production-screen .defense-placement{margin:0;padding:3px;font-size:10px;flex:none}
@media(min-height:451px){
 .production-screen#overlay{padding-top:100px}
 .production-screen .client-unit-choice{min-height:110px;font-size:12px}
 .production-screen .client-unit-heading h2{font-size:18px}
 .production-screen .client-unit-heading>img,.source-skin .production-screen .client-unit-heading>.source-unit-art{width:70px;height:70px}
 .production-screen .client-unit-heading{grid-template-columns:70px 1fr}
 .production-screen .client-unit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* The science viewport owns tree/list scrolling, while its heading remains fixed. */
.research-screen#overlay:has(.research-heading){padding:70px 8px 6px}
.research-screen:has(.research-heading) #panel{height:100%;max-height:100%;display:flex;flex-direction:column;overflow:hidden;width:min(1440px,100%)}
.research-screen:has(.research-heading) .panel-head{position:static;flex:none;min-height:48px;padding:2px 12px}
.research-screen:has(.research-heading) .panel-head .close{width:44px;height:44px}
.research-screen:has(.research-heading) #panelBody{padding:4px 8px;display:flex;flex-direction:column;min-height:0;flex:1;overflow:hidden;gap:3px}
.research-screen .research-heading{flex:none;flex-wrap:nowrap;gap:4px;margin:0;min-height:44px}
.research-screen .research-heading .back-link{font-size:11px;padding:4px;min-width:0}
.research-screen .research-view-switch{flex-wrap:nowrap;gap:3px}
.research-screen .research-view-switch button{font-size:10px;padding:3px;min-height:44px}
.research-screen .research-progress{flex:none;min-height:24px;font-size:11px;margin:0;padding:2px 6px}
.research-screen .research-controls{flex:none;min-height:44px;font-size:11px;margin:0}
.research-screen .research-controls[open]{max-height:132px;overflow:auto;overscroll-behavior:contain}
.research-screen .research-tools{margin:0;gap:4px;flex-wrap:nowrap}
.research-screen .research-tools input{height:44px}
.research-screen .research-filters{flex-wrap:nowrap;overflow:auto;margin:0}
.research-screen .research-filters button{flex:none}
.research-screen .research-controls .research-source-note{margin:0}
.research-screen .research-viewport{height:auto;min-height:0;flex:1;scrollbar-gutter:stable}
.research-screen .research-list,.research-screen #panelBody>.cards{overflow:auto;min-height:0;flex:1;overscroll-behavior:contain}
.research-screen .research-caption{display:none}
@media(min-height:451px){.research-screen#overlay:has(.research-heading){padding-top:100px}}
.production-screen .defense-placement .client-benefit{min-height:0;margin:0;padding:2px;display:block;font-size:10px}
.production-screen .defense-placement .client-benefit b{display:block}
.production-screen .defense-placement p{font-size:10px;line-height:1.1;margin:2px 0}
.production-screen .client-production-order>.client-green{margin-top:0}
.production-screen#overlay{padding-top:64px;padding-bottom:4px}
.production-screen .panel-head{min-height:44px;padding:0 8px}
.production-screen #panelBody{padding:4px}
.production-screen .client-production-order{padding:2px;gap:2px}
.production-screen .item-quantity>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.production-screen .item-quantity>small{display:none}
.production-screen .quote-status:empty{display:none}
.production-screen .client-resource-requirements>div{padding:0;border:0;grid-template-columns:minmax(0,1fr) 44px}
@media(min-height:451px){.production-screen#overlay{padding-top:100px}}
.production-screen .client-resource-requirements .client-resource-add{position:static}
.production-screen .client-resource-requirements img{grid-column:1}
.production-screen .client-resource-requirements b{grid-column:1;margin:0;font-size:11px;line-height:1.1;justify-self:start}
.production-screen .client-unit-grid{grid-auto-rows:max-content}
.production-screen .client-unit-choice{gap:2px;flex-shrink:0}
.production-screen .client-unit-choice>img,.production-screen .client-unit-choice>span,.production-screen .client-unit-choice>b{flex:none}
.production-screen .client-unit-choice>span{font-size:10px;line-height:1.1}
