/* Only an installed iPhone app draws under the status bar. Keep a solid brand
   surface there, while the existing page backgrounds remain below the inset. */
html.iphone-home-screen {
  --ios-safe-top: env(safe-area-inset-top, 0px);
  --ios-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ios-safe-left: env(safe-area-inset-left, 0px);
  --ios-safe-right: env(safe-area-inset-right, 0px);
  --ios-page-height: calc(100dvh - var(--ios-safe-top) - var(--ios-safe-bottom));
  background: #151411;
  overscroll-behavior-y: none;
}
html.iphone-home-screen body {
  background: #151411;
  padding: var(--ios-safe-top) var(--ios-safe-right) var(--ios-safe-bottom) var(--ios-safe-left);
  min-height: 100dvh;
  box-sizing: border-box;
  overscroll-behavior-y: none;
  overflow-x: clip;
}
html.iphone-home-screen body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  height: var(--ios-safe-top);
  background: #151411;
  z-index: 2147483647;
  pointer-events: none;
}
html.iphone-home-screen #root {
  background: #f7f5f1;
  min-height: var(--ios-page-height);
}
html.iphone-home-screen #root :is(.app-shell, .main, .login-screen, .client-portal, .screen-loader) {
  min-height: var(--ios-page-height) !important;
}
/* Fixed controls do not inherit body padding. Offset these separately. */
html.iphone-home-screen #root .app-shell .sidebar {
  top: var(--ios-safe-top) !important;
  bottom: var(--ios-safe-bottom) !important;
  height: var(--ios-page-height) !important;
}
html.iphone-home-screen #root .main > .topbar.dashboard-topbar .dashboard-top-actions {
  position: fixed !important;
  top: calc(var(--ios-safe-top) + 18px) !important;
}
html.iphone-home-screen #root .sidebar-toggle-collapsed {
  top: calc(var(--ios-safe-top) + 18px) !important;
}
html.iphone-home-screen .modal-backdrop {
  padding-top: max(16px, var(--ios-safe-top));
  padding-bottom: max(16px, var(--ios-safe-bottom));
}
