#mobile-tools-toggle{display:none}
@media(max-width:700px){
 .viewtools{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important;max-height:calc(100dvh - 180px);overflow:visible}
 .viewtools>*{order:3}
 .viewtools>#home{order:0}.viewtools>#walk{order:1}.viewtools>#mobile-tools-toggle{order:2}
 .viewtools:not(.tools-expanded)>:not(#home):not(#walk):not(#mobile-tools-toggle):not(#types-toggle){display:none!important}
 .viewtools>#mobile-tools-toggle{display:flex;align-items:center;justify-content:center;gap:5px;width:100%;min-width:0;min-height:36px;padding:5px 3px;border:1px solid var(--ui-line);border-radius:8px;background:var(--ui-surface);color:var(--ui-text);font:600 10px system-ui;cursor:pointer}
 #mobile-tools-toggle svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
 #mobile-tools-toggle[aria-expanded=true] svg{transform:rotate(180deg)}
 #mobile-tools-toggle:focus-visible{outline:2px solid #d7c8a3;outline-offset:2px}
 .viewtools.tools-expanded{overflow:visible}
 .viewtools.tools-expanded>.presentation-select{display:block}
 body:not(.walking) #joystick-wrap,body:not(.walking) #look-wrap{display:none!important}
 body.walking #joystick-wrap,body.walking #look-wrap{display:flex;bottom:calc(var(--mobile-dock-height,48px) + 20px + env(safe-area-inset-bottom))!important;z-index:3}
 body.workspace-open.walking #joystick-wrap,body.workspace-open.walking #look-wrap,body.tool-panel-open.walking #joystick-wrap,body.tool-panel-open.walking #look-wrap{visibility:hidden}
 #joystick,#look-joystick{width:78px;height:78px}
 #joystick-knob,#look-knob{top:50%;left:50%;width:32px;height:32px}
 .model-panel,.tool-panel{bottom:calc(var(--mobile-dock-height,48px) + 16px + env(safe-area-inset-bottom))!important;max-height:calc(100dvh - var(--mobile-dock-height,48px) - 92px);overscroll-behavior:contain}
 #element-inspector,#element-restore,#measure-result{bottom:calc(var(--mobile-dock-height,48px) + 16px + env(safe-area-inset-bottom))!important}
 #element-inspector:not([hidden])~#element-restore{bottom:calc(var(--mobile-dock-height,48px) + 84px + env(safe-area-inset-bottom))!important}
 html[data-theme=light] #mobile-tools-toggle{background:#f0eee9;border-color:#b8c1b7;color:#27332f}
 html[data-theme=light] #mobile-tools-toggle:hover{background:#e1e7df;border-color:#93a794}
 html[data-theme=light] #mobile-tools-toggle:focus-visible{outline-color:#506e56}
}
@media(prefers-reduced-motion:reduce){#mobile-tools-toggle svg{transition:none}}
/* Touch sticks never appear outside the mobile walking state. */
@media(min-width:701px){#joystick-wrap,#look-wrap{display:none!important}}
/* At tablet widths the workspace is the legend; avoid covering the dock. */
@media(min-width:701px) and (max-width:900px){#model-legend{display:none}}
