/* The app header owns the top safe area; do not apply it a second time on body. */
body:is(.free-home-modern,.ux-modern){padding-top:0!important}
body:is(.free-home-modern,.ux-modern)>main{margin-inline:auto;min-width:0}
@media(orientation:landscape){
  body.free-home-modern>header,body.free-home-modern>main{padding-left:max(20px,env(safe-area-inset-left,0px))!important;padding-right:max(20px,env(safe-area-inset-right,0px))!important}
  body.ux-modern>header,body.ux-modern>main{padding-left:max(16px,env(safe-area-inset-left,0px))!important;padding-right:max(16px,env(safe-area-inset-right,0px))!important}
  body:is(.free-home-modern,.ux-modern) :is(nav.free-bottom-nav,#pkNav){left:max(14px,env(safe-area-inset-left,0px))!important;right:max(14px,env(safe-area-inset-right,0px))!important}
}
/* Restore native-dialog centring after the global margin reset. No display rule:
   showModal()/close() continue to own the open and closed states. */
body:is(.free-home-modern,.ux-modern) :is(.lh-dialog,#pkActivityDialog){
  --layout-dialog-top:max(12px,env(safe-area-inset-top,0px));
  --layout-dialog-bottom:max(12px,env(safe-area-inset-bottom,0px));
  --layout-dialog-left:max(12px,env(safe-area-inset-left,0px));
  --layout-dialog-right:max(12px,env(safe-area-inset-right,0px));
  position:fixed;inset:var(--layout-dialog-top) var(--layout-dialog-right) var(--layout-dialog-bottom) var(--layout-dialog-left);
  box-sizing:border-box;margin:auto;min-width:0;height:fit-content;
  max-width:calc(100% - var(--layout-dialog-left) - var(--layout-dialog-right));
  max-height:calc(100vh - var(--layout-dialog-top) - var(--layout-dialog-bottom));
  max-height:calc(100dvh - var(--layout-dialog-top) - var(--layout-dialog-bottom));
  overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;overflow-wrap:anywhere;
}
body:is(.free-home-modern,.ux-modern) .lh-dialog{width:440px}
body:is(.free-home-modern,.ux-modern) #pkActivityDialog{width:420px}
