/* KD mobile game shell v164: canvas priority, one accessible command drawer. */
@media (max-width:800px), (max-height:520px) and (pointer:coarse){
 html,body{height:100%;height:100dvh;overflow:hidden!important;overscroll-behavior:none}
 body{--kd-top:88px!important;--kd-rail:0px!important;--kd-dock-h:0px!important}
 #stage{position:fixed!important;top:88px!important;left:0!important;right:0!important;bottom:61px!important;width:100%!important;height:auto!important;touch-action:none}
 #stage canvas{touch-action:none!important}
 #vignette{top:88px!important;left:0!important;bottom:61px!important;right:0!important}
 #top,body.kd-ui-compact154 #top.kd-topbar163{position:fixed!important;left:0!important;top:0!important;right:0!important;height:88px!important;min-height:88px!important;display:grid!important;grid-template-columns:minmax(0,1fr) 82px!important;grid-template-rows:38px 46px!important;grid-template-areas:'brand menu' 'resources resources'!important;gap:2px!important;padding:3px 7px!important;z-index:105!important;overflow:visible!important;background:#0c1212f5!important}
 #top .head,body.kd-ui-compact154 #top.kd-topbar163 .head{grid-area:brand!important;max-width:100%!important;min-width:0!important;flex-basis:auto!important;padding:3px 6px 3px 35px!important;border:0!important;background:none!important;box-shadow:none!important}
 #top .head h1{font-size:13px!important;letter-spacing:.05em!important;white-space:nowrap!important}
 #top .head span{display:none!important}
 #top #statePill,body.kd-ui-compact154 #top.kd-topbar163 #statePill{grid-area:resources!important;display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:2px!important;margin:0!important;padding:2px!important;width:100%!important;height:43px!important;overflow:hidden!important}
 #top #statePill>div,body.kd-ui-compact154 #top.kd-topbar163 #statePill>div{min-width:0!important;padding:1px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:center!important;border-left:0!important;gap:0!important}
 #top #statePill>div::before{display:none!important}
 #top #statePill>div small{display:block!important;font:8px/1 Georgia,serif!important;text-overflow:clip!important;white-space:nowrap!important}
 #top #statePill>div b{font:700 14px/1.3 Georgia,serif!important}
 #top #kd-quick-menu123{grid-area:menu!important;justify-self:end!important;max-width:82px!important}
 #top > a,#top > button,#top > #kdMusicDock91,#top > #kdAudioMixer122,#top > #kdLightingDock130{display:none!important}
 #kd-reference-sidebar{position:fixed!important;left:0!important;right:0!important;top:auto!important;bottom:61px!important;width:100%!important;height:min(68dvh,540px)!important;max-height:calc(100dvh - 102px)!important;transform:translateY(calc(100% + 64px))!important;transition:transform .22s ease!important;z-index:110!important;pointer-events:none!important;visibility:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important;background:#0e1817f8!important;border-top:2px solid #c4a16b!important;box-shadow:0 -12px 35px #000c!important;padding:9px!important;display:flex!important;flex-direction:column!important}
 body.kd-mobile-open #kd-reference-sidebar{transform:translateY(0)!important;pointer-events:auto!important;visibility:visible!important}
 #kd-reference-sidebar .kd-map-wrap,#kd-reference-sidebar>.kd-hud-block:first-child{display:none!important}
 #kd-reference-sidebar #kd-one-context{overflow-y:auto!important;flex:1 1 auto!important;min-height:0!important;margin:0!important}
 #kd-one-context #kd-context-body{overflow-y:auto!important;display:block!important;max-height:none!important}
 #kd-one-context #kd-action-zone123{overflow-y:visible!important;max-height:none!important}
 #kd-one-context #kd-action-zone123 .build-catalog{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 #kd-one-context #kd-orders-slot .orders-buttons{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 #kd-one-context button,#kd-one-context select{touch-action:manipulation;min-height:42px!important}
 #kd-one-context #kd149-tabs button{min-height:40px!important}
 #kd-one-context #squadGrid{overflow-y:auto!important;max-height:145px!important}
 #left,#right,#hudlog,#bottom #help{display:none!important}
 #bottom{position:fixed!important;left:0!important;right:0!important;bottom:0!important;height:61px!important;max-width:none!important;padding:0!important;z-index:115!important;background:#0e1614f5!important;border-top:1px solid #8b754f!important}
 #bottom #mini{display:none!important}
 #kd25dPreviewLink{display:none!important}
 #kdMobileBar164{position:fixed;bottom:0;left:0;right:0;display:grid;grid-template-columns:1fr 1fr 1fr;gap:5px;padding:7px max(8px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom));z-index:120;background:#111a17f5;border-top:1px solid #92734b}
 #kdMobileBar164 button{min-height:43px;padding:6px 2px;font:700 12px Georgia,serif!important;letter-spacing:0;border:1px solid #aa8755;border-radius:5px;color:#f6dbad;background:linear-gradient(#364038,#19251f)}
 #kdMobileBar164 button[aria-expanded=true]{background:#725332;color:white}
 #kdMobileBack164{display:none;position:fixed;inset:88px 0 61px;background:#0008;z-index:109}
 body.kd-mobile-open #kdMobileBack164{display:block}
 #kd-tooltip,#kdHelpTip82{max-width:calc(100vw - 24px)!important;z-index:122!important}
 #load .inner{max-height:85dvh;overflow:auto;padding:20px!important}
}
@media (min-width:801px) and (min-height:521px){#kdMobileBar164,#kdMobileBack164{display:none!important}}
@media(max-width:380px){#top .head h1{font-size:11px!important}#top #statePill>div small{font-size:7px!important}#kdMobileBar164 button{font-size:11px!important}}
