/* Touch/tablet layout must not depend on a narrow CSS viewport: foldables and
   desktop-site mode still get the same unobstructed controls. */
body.compact-hud .hud,body.compact-hud #world-side,body.compact-hud #letter-dock{display:none!important}
body.compact-hud #open-avatar-studio{display:none!important}
body.compact-hud .hud-menu-toggle{position:fixed;top:max(10px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));z-index:205;display:flex;align-items:center;gap:4px;height:44px;padding:8px 12px;border:1px solid #81b7b1;border-radius:14px;background:#112d37ee;color:#edfff8;font:700 13px system-ui;cursor:pointer}
body.compact-hud .presence{position:fixed;top:max(10px,env(safe-area-inset-top))!important;left:max(12px,env(safe-area-inset-left))!important;right:auto!important;max-width:none!important;max-height:none!important;width:auto!important;margin:0!important;padding:4px 8px!important;font:600 10px/16px system-ui!important;z-index:201;pointer-events:auto}
body.compact-hud #plaza-clock{top:40px;left:max(12px,env(safe-area-inset-left));font:10px system-ui;padding:3px 7px;z-index:201}
body.compact-hud #hud-drawer{position:fixed;top:max(62px,calc(env(safe-area-inset-top) + 56px));right:max(12px,env(safe-area-inset-right));bottom:max(150px,calc(env(safe-area-inset-bottom) + 140px));width:min(410px,calc(100vw - 24px));z-index:204;background:#102932f7;color:#effbf7;border:1px solid #6b9a9e;border-radius:18px;box-shadow:0 12px 40px #0006;display:flex;flex-direction:column;overflow:hidden;font:13px/1.45 system-ui;pointer-events:auto}
body.compact-hud #hud-drawer[hidden],body.compact-hud #hud-drawer [hidden]{display:none!important}
.hud-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;flex:none;gap:8px}.hud-header strong{font-size:16px}.hud-header button{font-size:23px!important;min-width:40px}
#hud-drawer button,#hud-drawer select,#hud-drawer input{font:inherit;max-width:100%;box-sizing:border-box}#hud-drawer button{min-height:40px;border:1px solid #537981;border-radius:10px;padding:7px 10px;background:#203f4a;color:#f3fff9;cursor:pointer;touch-action:manipulation}#hud-drawer button:disabled{opacity:.45;cursor:default}
#hud-drawer input[type=checkbox]{width:20px!important;min-width:20px;height:20px;flex:none;accent-color:#82dfc8}#hud-drawer input:not([type=checkbox]):not([type=range]):not([type=color]),#hud-drawer select{font-size:16px}
#hud-drawer :focus-visible,.hud-menu-toggle:focus-visible{outline:3px solid #f7d66e;outline-offset:2px}
.hud-categories{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:0 9px 8px;flex:none}.hud-categories button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:5px 2px!important;font-size:10px!important}.hud-categories .menu-icon{margin:0;width:19px;height:19px}
#hud-drawer [aria-pressed=true]{background:#83dfc8;color:#0d2932;border-color:#b2fff0}
.hud-submenus{display:flex;flex-wrap:wrap;gap:5px;padding:0 10px 9px;border-bottom:1px solid #52747c;flex:none}.hud-submenus button{min-height:36px!important;font-size:12px!important}
.hud-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding:12px;scrollbar-width:thin;scrollbar-color:#70a99f transparent}.hud-route{min-width:0}.hud-route> *+*{margin-top:10px!important}
/* Specificity intentionally outranks the historical floating panel rules. */
body.compact-hud #hud-drawer [data-compact-hosted]{position:static!important;inset:auto!important;transform:none!important;float:none!important;width:100%!important;min-width:0!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;overflow:visible!important;pointer-events:auto!important;display:block!important}
body.compact-hud #hud-drawer details[data-compact-hosted]>summary{display:none!important}
body.compact-hud #hud-drawer .room-body,body.compact-hud #hud-drawer .xr-body,body.compact-hud #hud-drawer .build-body,body.compact-hud #hud-drawer .people-body{padding:0!important;max-height:none!important;overflow:visible!important}
body.compact-hud #hud-drawer #plaza-controls{display:flex!important;max-width:none!important;justify-content:flex-start;gap:6px}body.compact-hud #hud-drawer #plaza-status{display:none!important}
body.compact-hud #hud-drawer .stats{display:flex!important;gap:6px}body.compact-hud #hud-drawer .chip{flex:1;min-width:0;padding:9px}.hud-content .mini{max-width:150px!important;height:150px;margin:12px auto!important}
body.compact-hud #hud-drawer .touch-actions{display:flex!important;gap:6px}body.compact-hud #hud-drawer .editor{display:flex!important;flex-wrap:wrap;gap:6px}.hud-content .editor-note:not(.show){display:none!important}
body.compact-hud:not([data-plaza-mode=drive]) #hud-drawer .touch-actions{display:none!important}
body.compact-hud #hud-drawer .stats .chip{display:block!important}body.compact-hud #hud-drawer .mini{width:150px!important;margin:12px auto!important}body.compact-hud #hud-drawer #editorNote:not(.show){display:none!important}
body.compact-hud #hud-drawer .upland small,body.compact-hud #hud-drawer .upland .asset.show{display:block}.hud-content .upland h3{display:none}.hud-content #connect{min-height:44px}.hud-content .identity img{width:40px;height:40px}
body.compact-hud #hud-drawer .simple-panel>header{display:none!important}body.compact-hud #hud-drawer .simple-panel{display:block!important}#hud-drawer .simple-panel input:not([type=checkbox]):not([type=color]),#hud-drawer .simple-panel select{width:100%}
body.compact-hud .touch-controls{left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom));z-index:202}.compact-hud .touch-grid{grid-template-columns:44px 44px 44px;grid-template-rows:44px 44px;gap:4px}.compact-hud .touch-btn{border-radius:12px;font-size:18px}
body.compact-hud #room-mic{right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));min-width:54px;min-height:56px;width:54px;height:56px;padding:4px;border-radius:15px;font-size:10px;z-index:203}body.compact-hud #room-mic svg{width:25px;height:25px}
body.compact-hud #plaza-jump{right:76px;bottom:max(12px,env(safe-area-inset-bottom));width:54px;height:56px;font-size:12px;z-index:203}body.compact-hud #jump-bonus{right:76px;bottom:max(73px,calc(env(safe-area-inset-bottom) + 61px));font-size:9px;padding:2px 5px;max-width:105px;text-align:center}
/* A single quick grab is always reachable. Extra actions appear only while
   holding a brick; all inventory controls remain under Create > Bricks. */
body.compact-hud #brick-quick{left:auto;right:max(12px,env(safe-area-inset-right));bottom:max(100px,calc(env(safe-area-inset-bottom) + 88px));transform:none;width:auto;max-width:calc(100vw - 165px);display:flex;padding:3px;gap:3px;border-radius:13px;font-size:11px;z-index:203}
body.compact-hud #brick-quick .brick-quick-preview,body.compact-hud #brick-quick .brick-quick-help,body.compact-hud #brick-quick small{display:none!important}body.compact-hud #brick-quick .brick-quick-actions{gap:3px}body.compact-hud #brick-quick button{min-height:38px;padding:5px 8px;font-size:11px}body.compact-hud #brick-quick:not([data-holding=true]) [data-do=place],body.compact-hud #brick-quick:not([data-holding=true]) [data-do=toss]{display:none}
body.compact-hud #brick-hud{bottom:152px;max-width:min(310px,80vw);text-align:center}body.compact-hud .toast{top:67px;max-width:75vw;white-space:normal;text-align:center;z-index:203}
body.compact-hud #brick-quick[data-holding=true] [data-do=grab]{display:none}
body.compact-hud #shared-video{display:none!important}body.compact-hud.xr-active #hud-drawer,body.compact-hud.xr-active #hud-menu-toggle,body.compact-hud.xr-active #brick-quick,body.compact-hud.xr-active .presence,body.compact-hud.avatar-open #hud-menu-toggle,body.compact-hud.avatar-open #hud-drawer{display:none!important}
@media(min-width:1100px) and (pointer:fine){body.compact-hud #hud-drawer{bottom:150px;width:420px}}
@media(max-height:480px){body.compact-hud #hud-drawer{top:8px;bottom:8px;right:108px;width:min(400px,calc(100vw - 272px))}.hud-header{padding:4px 10px}.hud-categories{padding-bottom:4px}.hud-submenus{padding-bottom:5px}.hud-content{padding:8px}.hud-categories .menu-icon{display:none}.hud-categories button{min-height:32px!important}}
