html { --sil-notch: env(safe-area-inset-top, 0px); }
@media (display-mode: standalone) {
  html { --sil-notch: max(54px, env(safe-area-inset-top, 54px)); }
}
html.sil-pwa-standalone {
  --sil-notch: max(54px, env(safe-area-inset-top, 54px));
}
html.sil-pwa-standalone header,
html.sil-pwa-standalone #pos-header,
html.sil-pwa-standalone #pos-header.pos-topbar,
html.sil-pwa-standalone .pos-topbar,
html.sil-pwa-standalone .bk-topbar,
html.sil-pwa-standalone .bk-app header,
html.sil-pwa-standalone .crm-topbar,
html.sil-pwa-standalone .app-topbar,
html.sil-pwa-standalone #admin-header,
html.sil-pwa-standalone .admin-topbar {
  padding-top: var(--sil-notch) !important;
  box-sizing: border-box;
}
html.sil-pwa-standalone body.login-hub,
html.sil-pwa-standalone body.login-page,
html.sil-pwa-standalone body.login-company {
  padding-top: 0 !important;
}
html.sil-pwa-standalone .login-logo-corner {
  top: 0 !important;
  height: calc(var(--sil-notch) + 3.25rem) !important;
  padding-top: var(--sil-notch) !important;
  align-items: center !important;
  box-sizing: border-box !important;
}
html.sil-pwa-standalone #tenant-banner {
  top: 0 !important;
  height: calc(var(--sil-notch) + 3.25rem) !important;
  min-height: calc(var(--sil-notch) + 3.25rem) !important;
  padding-top: var(--sil-notch) !important;
  padding-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}
#siliscia-back-to-top { display: none !important; }

/* Phone: keep overlays below clock / camera (Safari + PWA) */
@media (max-width: 767px) {
  #stock-count-modal,
  #product-profile-modal,
  #pos-tools-panel,
  [data-modal-type].fixed.inset-0,
  .fixed.inset-0.z-50.flex.items-end {
    padding-top: max(10px, env(safe-area-inset-top, 10px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    box-sizing: border-box;
    align-items: flex-end !important;
  }
  #stock-count-modal .modal-shell,
  [data-modal-type] .modal-shell,
  .fixed.inset-0.z-50 .modal-shell {
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top, 12px)) - 8px) !important;
  }
}
