/* All layout rules are scoped to phone/tablet widths; desktop stays unchanged. */
#pfPhoneNav,#pfPhoneHeading,#pfPhoneView,#pfPhoneFiles,#pfPhoneGraphicActions,#pfPhoneSearchModels{display:none}
@media(max-width:920px){
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open){height:100dvh;overflow:hidden;--pf-phone-panel:min(40dvh,360px);--pf-phone-dock:62px}
 body[data-pf-phone-ui=true][data-pf-phone-collapsed=true]{--pf-phone-panel:0px!important}
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open)>main{display:block!important;height:auto!important;overflow:hidden}
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open) #pfPhoneSearchModels{display:block;position:fixed;top:calc(var(--pf-phone-header,110px) + 4px);left:8px;right:8px;width:calc(100% - 16px);height:34px;padding:6px 12px;text-align:left;z-index:46;background:var(--app-card);color:var(--app-accent);border:1px solid var(--app-border);border-radius:7px;font:600 14px system-ui}
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open) #stage{position:fixed!important;inset:calc(var(--pf-phone-header,110px) + 40px) 0 calc(var(--polish-footer-height,32px) + var(--pf-phone-dock) + var(--pf-phone-panel))!important;height:auto!important;min-height:0!important;padding:6px 8px!important;gap:4px!important}
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open) #canvasframe{min-height:0!important;overflow:hidden}
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open) #controls{position:fixed!important;left:0;right:0;bottom:calc(var(--polish-footer-height,32px) + var(--pf-phone-dock));height:var(--pf-phone-panel);max-height:calc(100dvh - var(--pf-phone-header,110px) - var(--polish-footer-height,32px) - var(--pf-phone-dock) - 80px);overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;touch-action:pan-y;scroll-padding-top:50px;padding:0 12px 26px!important;border:0!important;border-top:1px solid var(--app-border)!important;background:var(--app-panel)!important;z-index:40;-webkit-overflow-scrolling:touch}
 body[data-pf-phone-ui=true][data-pf-phone-collapsed=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open) #controls{visibility:hidden;padding:0!important;border:0!important}
 body[data-pf-phone-ui=true] #controls>.pf-phone-inactive{display:none!important}
 body[data-pf-phone-ui=true] #controls>#packformaAbout{display:none!important}
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open) #pfPhoneNav{position:fixed;display:flex;left:0;right:0;bottom:var(--polish-footer-height,32px);height:var(--pf-phone-dock);overflow-x:auto;overscroll-behavior:contain;align-items:stretch;gap:2px;padding:4px 6px;background:var(--app-card);border-top:1px solid var(--app-border);z-index:45;scrollbar-width:none}
 #pfPhoneNav button{display:flex;flex:1 0 54px;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:48px;padding:4px 3px;font:11px/1.1 system-ui;border:1px solid transparent;border-radius:6px;color:var(--app-muted)!important;background:transparent!important}
 #pfPhoneNav svg{width:22px;height:22px;flex:none}
 #pfPhoneNav button[aria-selected=true]{color:var(--app-accent)!important;background:var(--app-hover)!important;border-color:var(--app-accent);font-weight:750}
 #pfPhoneNav button[aria-expanded=true]{box-shadow:inset 0 -3px var(--app-accent)}
 body[data-pf-phone-ui=true] #pfPhoneHeading{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 0;margin:0 0 6px;background:var(--app-panel);border-bottom:1px solid var(--app-border);z-index:2;font-size:13px}
 #pfPhoneHeading button{min-height:34px;padding:6px 10px;font-size:12px;color:var(--app-muted)!important;background:var(--app-card)!important}
 body[data-pf-phone-ui=true] #pfPhoneView,body[data-pf-phone-ui=true] #pfPhoneFiles,body[data-pf-phone-ui=true] #pfPhoneGraphicActions{display:block;margin:0 0 12px}
 .pf-phone-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .pf-phone-actions button{min-height:42px;padding:8px;font-size:12px;line-height:1.3;white-space:normal;color:var(--app-text)!important;background:var(--app-card)!important;border-color:var(--app-border)}
 .pf-phone-actions button[aria-pressed=true]{background:var(--app-hover)!important;border-color:var(--app-accent);color:var(--app-accent)!important;font-weight:750;box-shadow:inset 3px 0 var(--app-accent)}
 body[data-pf-phone-ui=true] #controls .panel{padding:9px 0;margin:0;border-bottom:1px solid var(--app-border)}
 body[data-pf-phone-ui=true] #controls .panel>summary{min-height:40px;padding:9px 2px;font-size:13px}
 body[data-pf-phone-ui=true] #controls label{font-size:12px}
 body[data-pf-phone-ui=true] #controls input:not([type=range]):not([type=checkbox]):not([type=color]),body[data-pf-phone-ui=true] #controls select{min-height:40px;font-size:14px}
 body[data-pf-phone-ui=true] #controls .labelcard{margin:8px 0;padding:9px}
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open) #stage .stats{max-height:22dvh;overflow:auto;padding:3px 7px}
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open) #statsToggle{min-height:28px;font-size:11px}
 body[data-pf-phone-ui=true] #mobileActionMenu:not([hidden]){top:calc(var(--pf-phone-header,110px) + 4px)!important;max-height:calc(100dvh - var(--pf-phone-header,110px) - var(--polish-footer-height,32px) - 16px)!important;overscroll-behavior:contain;padding-bottom:18px}
 body[data-pf-phone-ui=true] #appFileMenu{max-height:calc(100dvh - var(--polish-footer-height,32px) - 120px)}
 body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open) #toast{bottom:calc(var(--polish-footer-height,32px) + var(--pf-phone-dock) + 8px)}
 #pfPBRDialog .pf-pbr-tabs button{min-height:44px;font-size:12px}
 #pfPBRDialog .pf-pbr-scroll{overscroll-behavior:contain;padding-bottom:22px}
 #pfPBRDialog .pf-pbr-tabs button::before{content:'';display:block;width:18px;height:18px;margin:0 auto 3px;background:currentColor;mask:var(--pf-phone-tab-icon) center/contain no-repeat;-webkit-mask:var(--pf-phone-tab-icon) center/contain no-repeat}
 #pfPBRTabLight{--pf-phone-tab-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%207a5%205%200%201%200%200%2010%205%205%200%200%200%200-10ZM12%201v3m0%2016v3M1%2012h3m16%200h3M4%204l2%202m12%2012%202%202M4%2020l2-2M18%206l2-2%22%2F%3E%3C%2Fsvg%3E")} #pfPBRTabFloor{--pf-phone-tab-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v16h18M3%2019l8-8h10M11%2011V3%22%2F%3E%3C%2Fsvg%3E")} #pfPBRTabCamera{--pf-phone-tab-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207h4l2-3h6l2%203h4v14H3ZM12%2010a4%204%200%201%200%200%208%204%204%200%200%200%200-8%22%2F%3E%3C%2Fsvg%3E")} 
 @media(max-height:540px){body[data-pf-phone-ui=true]:not(.presentation):not(.pf-pbr-active):not(.viewer-open){--pf-phone-panel:min(44dvh,240px);--pf-phone-dock:54px}#pfPhoneNav button{min-height:44px}#pfPhoneNav svg{width:18px;height:18px}}
}
