/* Only the explicitly resolved Mobile view uses this layout. Touch capability and
 * input activity never choose the view; saved panel/hotbar data remain intact. */
html.view-mobile {scroll-padding-top:calc(var(--touch-vv-top) + var(--touch-safe-top));}
html.view-mobile :is(button,[role=button],summary) {min-height:44px;}
html.view-mobile :is(button,[role=button]) {min-width:44px;}
html.view-mobile :is(input,select,textarea) {font-size:16px;max-width:100%;}
html.view-mobile input:not([type=checkbox]):not([type=radio]):not([type=range]),html.view-mobile select {min-height:44px;}
html.view-mobile :is(input[type=checkbox],input[type=radio]) {width:20px;height:20px;vertical-align:middle;}
html.view-mobile label:has(>input[type=checkbox]),html.view-mobile label:has(>input[type=radio]) {min-height:44px;display:inline-flex;align-items:center;gap:6px;}
html.view-mobile #hud :is(.world-brand,.runtime-pill,.objectives,.hud-dock),html.view-mobile #control-status {display:none!important;}
html.view-mobile #hud .player-status {
 position:fixed;left:calc(var(--touch-vv-left) + var(--touch-safe-left));top:calc(var(--touch-vv-top) + var(--touch-safe-top));bottom:auto;
 width:min(190px,calc(var(--touch-vv-width) - 156px));max-width:none;min-width:0;padding:6px 8px;gap:0;box-sizing:border-box;
}
html.view-mobile .player-status .status-avatar,html.view-mobile .player-status .account-balance {display:none;}
html.view-mobile .player-status .status-body {width:100%;min-width:0;}
html.view-mobile .player-status .eyebrow {font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
html.view-mobile .player-status :is(small,.status-shots) {font-size:10px;}
html.view-mobile #hud-right-rail {
 top:calc(var(--touch-vv-top) + var(--touch-safe-top));right:calc(var(--touch-safe-right) + max(0px,100vw - var(--touch-vv-left) - var(--touch-vv-width)));
 bottom:auto;width:132px;max-height:calc(var(--touch-vv-height) - var(--touch-safe-top) - var(--touch-safe-bottom) - 268px);min-height:82px;
 overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;
}
html.view-mobile #hud .map-panel {padding:5px!important;}
html.view-mobile .map-panel canvas {display:block;width:120px!important;max-width:100%;height:auto!important;}
html.view-mobile .map-panel :is(.map-legend,#map-tracking,.eyebrow) {display:none;}
html.view-mobile .map-panel .map-foot {font-size:9px;gap:4px;}
html.view-mobile #hud-right-rail :is(.party-dock,#planet-location) {display:none!important;}
html.view-mobile #hud-right-rail :is(#flight-hud,#finder-hud,#tracked-claim) {font-size:10px;padding:6px;}
html.view-mobile #hud-right-rail :is(h3,p) {margin:4px 0;font-size:11px;}
html.view-mobile .flight-help,html.view-mobile .crew-travel-note {display:none;}
html.view-mobile .flight-top {flex-wrap:wrap;}
html.view-mobile .flight-top span {width:100%;font-size:9px;}
html.view-mobile .flight-telemetry {gap:5px;font-size:10px;}
html.view-mobile #hud-right-rail button {font-size:10px;white-space:normal;}
html.view-mobile #hud .target-panel {
 position:fixed;left:calc(var(--touch-vv-left) + var(--touch-vv-width)/2);right:auto;top:calc(var(--touch-vv-top) + var(--touch-safe-top) + 66px);bottom:auto;
 transform:translateX(-50%);width:min(240px,calc(var(--touch-vv-width) - 32px));max-height:108px;overflow:auto;box-sizing:border-box;font-size:11px;
}
html.view-mobile #tool-status {
 position:fixed;left:calc(var(--touch-vv-left) + var(--touch-safe-left));right:auto;bottom:calc(var(--touch-vv-bottom) + var(--touch-safe-bottom) + var(--touch-stick-size) + 8px);
 top:auto;width:min(160px,calc(var(--touch-vv-width) - 158px));max-width:none;padding:5px 7px;font-size:10px;
}
html.view-mobile #tool-status>div {display:none;}
html.view-mobile #active-tool-name {font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
html.view-mobile #hud-notice-stack {
 left:calc(var(--touch-vv-left) + var(--touch-vv-width)/2);right:auto;top:calc(var(--touch-vv-top) + var(--touch-safe-top) + 110px);bottom:auto;
 transform:translateX(-50%);width:min(280px,calc(var(--touch-vv-width) - 24px));max-height:90px;
}
/* Closed chat is a single edge tab; opening/focusing it restores the full scrollable panel. */
html.view-mobile .comms-log:not(.comms-expanded) {
 left:calc(var(--touch-vv-left) + var(--touch-safe-left))!important;top:calc(var(--touch-vv-top) + var(--touch-safe-top) + 64px)!important;
 bottom:auto!important;width:126px!important;max-width:126px!important;height:46px!important;min-height:44px!important;transform:none!important;
}
html.view-mobile .comms-log:not(.comms-expanded)>:not(.comms-head),html.view-mobile .comms-log:not(.comms-expanded) :is(.comms-grip small,.comms-reset,.comms-resize) {display:none!important;}
html.view-mobile .comms-log:not(.comms-expanded) .comms-head {height:44px;padding:0 4px;}
html.view-mobile .comms-log:not(.comms-expanded) .comms-grip {min-width:0;flex:1;font-size:10px;}
html.view-mobile .comms-log:not(.comms-expanded) .comms-grip i {display:none;}
html.view-mobile .comms-collapse {width:44px;height:44px;min-height:44px;}
html.view-mobile .comms-log.comms-expanded {
 left:calc(var(--touch-vv-left) + var(--touch-safe-left))!important;top:calc(var(--touch-vv-top) + var(--touch-safe-top))!important;bottom:auto!important;transform:none!important;
 width:calc(var(--touch-vv-width) - var(--touch-safe-left) - var(--touch-safe-right))!important;max-width:none!important;
 height:min(380px,calc(var(--touch-vv-height) - var(--touch-safe-top) - var(--touch-safe-bottom)))!important;max-height:none!important;z-index:180;
}
html.view-mobile .comms-compose {flex-wrap:wrap;}
html.view-mobile .comms-text-label {min-width:100px;flex:1;}
/* The saved native hotbar is revealed by Actions; no slot or binding is replaced. */
html.view-mobile .hotbar {display:none!important;}
html.view-mobile.touch-tray-open .hotbar {
 display:flex!important;position:fixed;left:calc(var(--touch-vv-left) + var(--touch-safe-left));right:auto;
 bottom:calc(var(--touch-vv-bottom) + var(--touch-safe-bottom) + var(--touch-controls-space) + 6px);top:auto;transform:none;
 width:calc(var(--touch-vv-width) - var(--touch-safe-left) - var(--touch-safe-right));max-width:none;min-width:0;
 height:64px;padding:4px;overflow-x:auto;overflow-y:hidden;overscroll-behavior:contain;touch-action:pan-x;z-index:45;background:#11272fee;border-radius:8px;
}
html.view-mobile.touch-tray-open #hud #hotbar-slots {display:flex;flex-wrap:nowrap;justify-content:flex-start;flex:0 0 auto;width:max-content;max-width:none;gap:5px;}
html.view-mobile.touch-tray-open #hud #hotbar-slots>* {width:48px;min-width:48px;min-height:48px;flex:0 0 48px;}
html.view-mobile .hotbar-help {display:none!important;}
/* Management windows scroll above the thumb controls. Their existing close buttons remain available. */
html.view-mobile #menu-shell {pointer-events:none;}
html.view-mobile :is(.menu-window,#expedition-window,#planet-window,#cooperative-window,#auction-window,#housing-panel,#social-window,#service-window,#network-window,#systems-window,#cooking-workbench) {
 position:fixed!important;left:calc(var(--touch-vv-left) + var(--touch-safe-left))!important;top:calc(var(--touch-vv-top) + var(--touch-safe-top))!important;right:auto!important;bottom:auto!important;transform:none!important;
 width:calc(var(--touch-vv-width) - var(--touch-safe-left) - var(--touch-safe-right))!important;max-width:1100px;min-width:0!important;
 height:auto!important;min-height:0!important;max-height:calc(var(--touch-vv-height) - var(--touch-safe-top) - var(--touch-safe-bottom) - var(--touch-controls-space) - 10px)!important;
 overflow:auto!important;overscroll-behavior:contain;touch-action:pan-y;pointer-events:auto;box-sizing:border-box;
}
html.view-mobile :is(#menu-content,#expedition-body,#planet-body,#service-body,#housing-body,.cooperative-body,.social-body) {min-height:0;overflow:auto;overscroll-behavior:contain;}
html.view-mobile :is(.menu-head,#menu-nav,#expedition-tabs,#planet-tabs,#service-tabs,.systems-nav) {flex-wrap:wrap;}
html.view-mobile :is(.menu-head,#expedition-window>header,#planet-window>header,#service-window>header,#housing-panel>header) {padding:8px 10px;gap:6px;}
html.view-mobile :is(.menu-head h1,#expedition-title,#service-name) {font-size:20px;}
html.view-mobile :is(.menu-foot,#expedition-foot,#planet-foot) {font-size:10px;padding:6px;}
html.view-mobile :is(.item-context-menu,#player-context-menu,.trade-confirm) {max-height:calc(var(--touch-vv-height) - 24px);max-width:calc(var(--touch-vv-width) - 24px);overflow:auto;overscroll-behavior:contain;}
html.view-mobile :is(#planet-entry-confirmation,.planet-entry-confirmation) {
 left:calc(var(--touch-vv-left) + var(--touch-safe-left))!important;top:calc(var(--touch-vv-top) + var(--touch-safe-top))!important;right:auto;bottom:auto;transform:none!important;
 width:min(530px,calc(var(--touch-vv-width) - var(--touch-safe-left) - var(--touch-safe-right)));max-width:none;min-width:0;box-sizing:border-box;
 max-height:calc(var(--touch-vv-height) - var(--touch-safe-top) - var(--touch-safe-bottom));overflow:auto;overscroll-behavior:contain;touch-action:pan-y;
}
html.view-mobile .planet-entry-confirmation>header {min-height:60px;padding:8px 12px;gap:8px;}
html.view-mobile .planet-entry-confirmation header strong {font-size:20px;}
html.view-mobile .planet-entry-copy {padding:12px;}
html.view-mobile .planet-entry-cost {flex-wrap:wrap;gap:10px;}
html.view-mobile .fishing-activity {
 left:calc(var(--touch-vv-left) + var(--touch-safe-left));right:auto;top:calc(var(--touch-vv-top) + var(--touch-safe-top) + 54px);bottom:auto;transform:none;
 width:calc(var(--touch-vv-width) - var(--touch-safe-left) - var(--touch-safe-right));max-width:700px;max-height:calc(var(--touch-vv-height) - var(--touch-safe-top) - var(--touch-safe-bottom) - 208px);
 padding:9px 11px;font-size:12px;overflow:auto;overscroll-behavior:contain;
}
html.view-mobile.touch-fishing-playing .fishing-activity-controls,html.view-mobile.touch-fishing-playing .fishing-activity-help,html.view-mobile.touch-fishing-playing .fishing-activity footer {display:none;}
html.view-mobile .fishing-activity :is(h2,h3) {font-size:16px;}
html.view-mobile .fishing-activity :is(select,button) {min-height:44px;}
html.view-mobile.touch-keyboard-open {--touch-controls-space:0px!important;}
html.view-mobile.touch-keyboard-open :is(.touch-controls,.hotbar,#tool-status,#hud-right-rail,#hud-notice-stack) {display:none!important;}
html.view-mobile.touch-keyboard-open .comms-log.comms-expanded {height:calc(var(--touch-vv-height) - var(--touch-safe-top) - var(--touch-safe-bottom))!important;}

@media (max-width:700px) {
 html.view-mobile :is(.fleet-layout,.controls-layout,.map-layout,#service-body,.fishing-kit,.cooking-grid,.cargo-columns) {grid-template-columns:minmax(0,1fr)!important;}
 html.view-mobile .map-layout {min-height:0;height:auto;}
 html.view-mobile :is(.atlas,.fleet-detail,.controls-layout) {padding:10px;}
 html.view-mobile .inventory-tabs {grid-template-columns:repeat(3,minmax(0,1fr));}
 html.view-mobile #menu-shell[data-view=inventory] .inventory-layout {grid-template-columns:minmax(0,1fr)!important;overflow:auto;flex:0 0 auto;}
 html.view-mobile #menu-shell[data-view=inventory] .inventory-grid-panel {min-height:180px;overflow:visible;}
 html.view-mobile #menu-shell[data-view=inventory] .inventory-grid {min-height:150px;max-height:260px;flex:none;overflow:auto;}
 html.view-mobile :is(.slot-editor,.module-row) {grid-template-columns:44px minmax(0,1fr) 60px;}
}
@media (max-height:420px) {
 html.view-mobile #hud .map-panel {display:none!important;}
 html.view-mobile #hud-right-rail {left:calc(var(--touch-vv-left) + var(--touch-safe-left) + 148px);right:auto;top:calc(var(--touch-vv-top) + var(--touch-safe-top));width:calc(var(--touch-vv-width) - var(--touch-safe-left) - var(--touch-safe-right) - 280px);max-height:76px;min-height:0;}
 html.view-mobile .player-status {max-width:138px!important;}
 html.view-mobile .comms-log:not(.comms-expanded) {width:106px!important;top:calc(var(--touch-vv-top) + var(--touch-safe-top) + 62px)!important;}
 html.view-mobile #hud .target-panel {top:calc(var(--touch-vv-top) + var(--touch-safe-top) + 78px);max-height:64px;max-width:210px;}
 html.view-mobile #hud-notice-stack {top:calc(var(--touch-vv-top) + var(--touch-safe-top) + 84px);max-height:60px;max-width:210px;}
 html.view-mobile .fishing-activity {top:calc(var(--touch-vv-top) + var(--touch-safe-top));left:calc(var(--touch-vv-left) + var(--touch-vv-width)/2);transform:translateX(-50%);width:min(640px,calc(var(--touch-vv-width) - 220px));max-height:calc(var(--touch-vv-height) - var(--touch-safe-top) - var(--touch-safe-bottom) - 108px);}
 html.view-mobile :is(.fishing-activity-paid,.fishing-activity-help) {font-size:10px;margin:4px 0;}
}
/* Account/creation forms remain usable before a character or network session exists. */
@media (max-width:860px),(max-height:500px) {
 html.view-mobile #account-screen {box-sizing:border-box;overflow:auto;overscroll-behavior:contain;padding:calc(env(safe-area-inset-top,0px) + 12px) 12px calc(env(safe-area-inset-bottom,0px) + 12px);}
 html.view-mobile #account-screen .account-card {position:relative;left:auto;right:auto;top:auto;bottom:auto;transform:none;width:min(420px,100%);max-width:100%;margin:auto;padding:20px;box-sizing:border-box;}
 html.view-mobile #account-screen .account-brand {display:none;}
 html.view-mobile #account-screen :is(input,button) {min-height:44px;font-size:16px;}
 html.view-mobile #account-screen .account-card h1 {font-size:32px;}
 html.view-mobile #login {pointer-events:none;}
 html.view-mobile #login :is(button,input,select,.panel,.creator-view,.creator-bottom) {pointer-events:auto;}
 html.view-mobile #login .brandbar {top:calc(var(--touch-vv-top) + var(--touch-safe-top));left:var(--touch-safe-left);right:var(--touch-safe-right);padding:0;}
 html.view-mobile #login :is(.buildtag,.creator-stage-label) {display:none;}
 html.view-mobile #login .brand small {font-size:8px;}
 html.view-mobile #login :is(.creator-left,.creator-right) {position:fixed;top:auto;bottom:calc(var(--touch-vv-bottom) + var(--touch-safe-bottom) + 72px);width:calc((var(--touch-vv-width) - var(--touch-safe-left) - var(--touch-safe-right) - 8px)/2);max-height:min(36dvh,220px);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;padding:10px;}
 html.view-mobile #login .creator-left {left:calc(var(--touch-vv-left) + var(--touch-safe-left));right:auto;}
 html.view-mobile #login .creator-right {left:auto;right:calc(var(--touch-safe-right) + max(0px,100vw - var(--touch-vv-left) - var(--touch-vv-width)));}
 html.view-mobile #login .creator-left h1 {font-size:20px;}
 html.view-mobile #login .creator-right h2 {font-size:17px;}
 html.view-mobile #login .creator-left :is(.muted,.micro),html.view-mobile #login .creator-left>.divider:first-of-type {display:none;}
 html.view-mobile #login .label {margin-top:8px;font-size:10px;}
 html.view-mobile #login :is(input,select) {max-width:100%;min-width:0;font-size:16px;}
 html.view-mobile #login .creator-view {position:fixed;top:calc(var(--touch-vv-top) + var(--touch-safe-top) + 52px);left:calc(var(--touch-vv-left) + var(--touch-safe-left));right:auto;bottom:auto;transform:none;width:calc(var(--touch-vv-width) - var(--touch-safe-left) - var(--touch-safe-right) - 118px);display:flex;gap:4px;overflow-x:auto;}
 html.view-mobile #login .creator-view span {display:none;}
 html.view-mobile #login .creator-view button {min-height:44px;flex:0 0 auto;padding:4px 8px;font-size:10px;}
 html.view-mobile #login .creator-bottom {position:fixed;left:calc(var(--touch-vv-left) + var(--touch-safe-left));right:var(--touch-safe-right);bottom:calc(var(--touch-vv-bottom) + var(--touch-safe-bottom));padding:0;gap:6px;max-height:64px;overflow:auto;}
 html.view-mobile #login .creator-bottom>div:first-child {font-size:0;max-width:32%;}
 html.view-mobile #login .creator-bottom :is(.status-dot,#creator-count) {display:none;}
 html.view-mobile #login #error {font-size:11px;}
 html.view-mobile #login .creator-bottom button {min-height:44px;padding:6px 10px;font-size:11px;}
 html.view-mobile.touch-keyboard-open #login :is(.creator-left,.creator-right) {top:calc(var(--touch-vv-top) + var(--touch-safe-top));bottom:auto;max-height:calc(var(--touch-vv-height) - var(--touch-safe-top) - var(--touch-safe-bottom) - 72px);}
}
