/* Small screens use sheets instead of permanently covering the map. */
#mobile-nav,#mobile-camera,#mobile-backdrop,.mobile-sheet-close{display:none}
body.mobile-layout{height:100dvh;overscroll-behavior:none;-webkit-tap-highlight-color:transparent}
body.mobile-layout #view{touch-action:none}
body.mobile-layout #topbar{height:calc(102px + env(safe-area-inset-top));padding:calc(5px + env(safe-area-inset-top)) 10px 5px;gap:8px;display:flex;flex-wrap:wrap;align-content:center;overflow:hidden}
body.mobile-layout #topbar .brand{display:none}body.mobile-layout #crest{width:28px;height:28px}
body.mobile-layout #topbar .stat{display:flex!important;flex:1 0 auto;min-width:44px;font-size:10px;max-width:110px}
body.mobile-layout #topbar .stat:nth-of-type(5),body.mobile-layout #topbar .stat:nth-of-type(n+7){display:none!important}
body.mobile-layout #topbar .stat b{font-size:12px}body.mobile-layout #topbar .stat span{font-size:9px}
body.mobile-layout #speed{order:20;flex:1 0 100%;margin:0;display:flex;justify-content:flex-end;gap:6px}
body.mobile-layout .sbtn{min-height:40px;min-width:48px;padding:5px 10px;font-size:12px}
body.mobile-layout #tb-toggle,body.mobile-layout #side-toggle,body.mobile-layout #camera3d{display:none!important}
body.mobile-layout #mobile-nav{position:fixed;left:8px;right:8px;bottom:calc(6px + env(safe-area-inset-bottom));z-index:92;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;padding:6px;border:1px solid #60789177;border-radius:13px;background:#172332f5;box-shadow:0 5px 25px #06121c88}
body.mobile-layout #mobile-nav button{min-width:0;min-height:46px;border:1px solid #64788e66;border-radius:8px;background:#2c3e53;color:#e3edf6;font-family:inherit;font-size:12px;cursor:pointer}
body.mobile-layout #mobile-nav button[aria-expanded=true],body.mobile-layout #mobile-nav button[aria-pressed=true]{background:#496b89;border-color:#add7f6;color:white}
body.mobile-layout #toolbar{display:none!important;position:fixed;left:8px;right:8px;top:auto;bottom:calc(78px + env(safe-area-inset-bottom));width:auto!important;max-height:min(65dvh,calc(100dvh - 200px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));padding:10px!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px;align-content:start;overflow:auto;z-index:75;touch-action:pan-y;overscroll-behavior:contain}
body.mobile-layout.mobile-tools-open #toolbar{display:grid!important}
body.mobile-layout #toolbar .tg{grid-column:1/-1;display:block!important}
body.mobile-layout #toolbar .tbtn{min-height:88px!important;display:flex;flex-direction:column;justify-content:center;gap:4px;padding:5px!important;font-size:11px;text-align:center}
body.mobile-layout #toolbar .tl{display:block!important}body.mobile-layout #toolbar .tool-preview{width:60px!important;height:51px!important;max-width:100%}
body.mobile-layout #toolbar .tbtn [style*="margin-left"]{margin-left:0!important}
body.mobile-layout #side{display:none!important;position:fixed;left:8px;right:8px;top:auto;bottom:calc(78px + env(safe-area-inset-bottom));width:auto;max-height:min(70dvh,calc(100dvh - 200px));height:min(70dvh,calc(100dvh - 200px));z-index:75;overflow:hidden;touch-action:pan-y}
body.mobile-layout.mobile-info-open #side{display:flex!important}
body.mobile-layout #tabs{flex-wrap:nowrap;flex-shrink:0;overflow-x:auto;min-height:48px;touch-action:pan-x}
body.mobile-layout #tabs .tab{min-width:64px;min-height:44px;padding:13px 6px;font-size:11px}
body.mobile-layout #panel{overscroll-behavior:contain;font-size:13px;padding:12px}
body.mobile-layout .mobile-sheet-close{display:block;grid-column:1/-1;min-height:44px;flex-shrink:0;border:1px solid #667d9555;background:#293e53;color:#dfeeff;border-radius:7px;font-family:inherit;font-size:13px}
body.mobile-layout #mobile-camera{position:fixed;bottom:calc(78px + env(safe-area-inset-bottom));right:8px;left:8px;z-index:75;padding:12px;gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}
body.mobile-layout.mobile-camera-open #mobile-camera{display:grid}
body.mobile-layout #mobile-camera button{min-height:46px;background:#2d435a;color:#e2efff;border:1px solid #728ba966;border-radius:7px;font-family:inherit;font-size:16px}
body.mobile-layout #mobile-backdrop{position:fixed;inset:calc(102px + env(safe-area-inset-top)) 0 0;z-index:60;border:0;background:#06111b55;touch-action:none}
body.mobile-layout:is(.mobile-tools-open,.mobile-info-open,.mobile-camera-open) #mobile-backdrop{display:block}
body.mobile-layout #hint{display:none}
body.mobile-layout #toast{top:calc(110px + env(safe-area-inset-top));max-width:calc(100% - 20px);width:max-content}
body.mobile-layout .tmsg{max-width:100%;font-size:12px}
body.mobile-layout #infobox,body.mobile-layout #selbox,body.mobile-layout #studio{position:fixed!important;left:8px!important;right:8px!important;width:auto!important;top:auto!important;bottom:calc(80px + env(safe-area-inset-bottom))!important;max-height:60dvh;overflow:auto;z-index:95!important}
body.mobile-layout #model-panel{top:calc(108px + env(safe-area-inset-top));width:calc(100vw - 16px);max-height:calc(100dvh - 195px);padding:14px}
body.mobile-layout #login{padding:12px;overflow:auto;align-items:flex-start;overscroll-behavior:contain}body.mobile-layout .lcard{width:min(420px,100%);margin:auto;max-height:calc(100dvh - 24px);overflow:auto;padding:20px}
body.mobile-layout input,body.mobile-layout select{font-size:16px!important;min-height:44px}
body.mobile-layout button.act{min-height:44px}body.mobile-layout .grid2{gap:8px}
body.mobile-layout #err{bottom:78px;max-height:25dvh;font-size:10px}
@media(max-height:500px) and (orientation:landscape){body.mobile-layout #topbar{height:calc(58px + env(safe-area-inset-top));flex-wrap:nowrap;padding:4px 12px}body.mobile-layout #speed{flex:0 0 auto;order:0;margin-left:auto}body.mobile-layout #topbar .stat{max-width:85px}body.mobile-layout #mobile-nav{left:25%;right:25%;bottom:calc(4px + env(safe-area-inset-bottom));padding:4px}body.mobile-layout #mobile-nav button{min-height:40px}body.mobile-layout #toolbar,body.mobile-layout #side{max-height:calc(100dvh - 144px);height:auto}body.mobile-layout #side{height:calc(100dvh - 144px)}body.mobile-layout #toast{top:64px}body.mobile-layout #mobile-backdrop{top:58px}}
