/* Inside V12.14.8 — reserve the native titlebar in Safari's macOS Dock web app.
   Unlike iOS, macOS safe-area-inset-top may be 0 even with native window controls.
   The 44px strip belongs to the OS: no brand logo, hamburger or account actions there.
   Never apply this to normal Safari tabs or Chromium standalone apps. */
:root{--gc-macos-dock-titlebar:44px}
html.gc-macos-dock body{
  background:linear-gradient(to bottom,#fff 0,#fff var(--gc-macos-dock-titlebar),var(--bg) var(--gc-macos-dock-titlebar));
}
html.gc-macos-dock #app-shell{padding-top:var(--gc-macos-dock-titlebar)}
html.gc-macos-dock #login-screen{padding-top:var(--gc-macos-dock-titlebar)}
html.gc-macos-dock #sidebar{
  top:var(--gc-macos-dock-titlebar);
  height:calc(100dvh - var(--gc-macos-dock-titlebar));
  min-height:calc(100dvh - var(--gc-macos-dock-titlebar));
}
html.gc-macos-dock .topbar{top:var(--gc-macos-dock-titlebar)}
html.gc-macos-dock #menu-btn.global-menu-toggle{
  top:calc(var(--gc-macos-dock-titlebar) + 12px)!important;
}
/* Dock window resized to tablet/mobile width: preserve the mobile drawer and popup,
   but never put their controls over the OS traffic lights or right-hand toolbar. */
@media(max-width:840px){
  html.gc-macos-dock #menu-btn.global-menu-toggle{
    top:calc(var(--gc-macos-dock-titlebar) + 16px)!important;
  }
  html.gc-macos-dock .sidebar-overlay{top:var(--gc-macos-dock-titlebar)}
  html.gc-macos-dock .notification-menu{
    top:calc(var(--gc-macos-dock-titlebar) + 75px + 8px);
    max-height:calc(100dvh - var(--gc-macos-dock-titlebar) - 75px - 24px);
  }
}
/* iPhone / iPad installed PWA: WebKit exposes physical cutouts as safe-area insets.
   Keep the existing topbar inset handling; additionally protect the mobile drawer,
   menu button, notification panel and right-hand actions in portrait and landscape.
   Do not add the macOS 44px offset to iOS. */
@media(max-width:840px){
  html.gc-ios-installed #sidebar{
    padding-top:env(safe-area-inset-top,0px);
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  html.gc-ios-installed .topbar{
    padding-right:max(12px,calc(12px + env(safe-area-inset-right,0px)));
  }
  html.gc-ios-installed #menu-btn.global-menu-toggle:not(.is-drawer-open){
    left:calc(14px + env(safe-area-inset-left,0px))!important;
  }
  html.gc-ios-installed .notification-menu{
    left:calc(12px + env(safe-area-inset-left,0px));
    right:calc(12px + env(safe-area-inset-right,0px));
  }
}
/* In iPhone landscape the CSS viewport can exceed 840px: keep the main
   chrome away from the notch without changing desktop navigation breakpoints. */
@media(min-width:841px){
  html.gc-ios-installed .topbar{
    height:calc(88px + env(safe-area-inset-top,0px));
    padding-top:env(safe-area-inset-top,0px);
    padding-left:max(25px,calc(25px + env(safe-area-inset-left,0px)));
    padding-right:max(25px,calc(25px + env(safe-area-inset-right,0px)));
  }
  html.gc-ios-installed #sidebar{
    padding-top:env(safe-area-inset-top,0px);
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  html.gc-ios-installed #menu-btn.global-menu-toggle{
    top:calc(12px + env(safe-area-inset-top,0px))!important;
  }
}
