/* Reserve the status-bar area once, including installed web-app navigation.
   Root spacing preserves the existing body, header and login margins. */
html {
  --nova-safe-area-top: env(safe-area-inset-top, 0px);
  --nova-safe-area-bottom: env(safe-area-inset-bottom, 0px);
  padding-top: var(--nova-safe-area-top) !important;
  scroll-padding-top: calc(var(--nova-safe-area-top) + 12px);
  box-sizing: border-box;
}

/* Fixed overlays and native top-layer dialogs do not inherit root padding. */
@media(max-width:760px){
  dialog:not(#nr-training-share){
    top:calc(var(--nova-safe-area-top) + 12px)!important;
    bottom:calc(var(--nova-safe-area-bottom) + 12px)!important;
    max-height:calc(100dvh - var(--nova-safe-area-top) - var(--nova-safe-area-bottom) - 24px)!important;
  }
  .training-modal{
    padding-top:calc(var(--nova-safe-area-top) + 12px)!important;
    padding-bottom:calc(var(--nova-safe-area-bottom) + 12px)!important;
    box-sizing:border-box;
  }
  .training-modal-dialog{
    max-height:calc(100dvh - var(--nova-safe-area-top) - var(--nova-safe-area-bottom) - 24px)!important;
  }
}
