/* Follow the system safe area; do not force a fullscreen top offset. */
@media (max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px) {
 :root {
  --mobile-safe-top:0px;
  --mobile-safe-bottom:20px;
  --mobile-safe-left:0px;
  --mobile-safe-right:0px;
 }
 .topbar {
  height:calc(66px + var(--mobile-safe-top));
  padding-top:var(--mobile-safe-top);
  padding-bottom:0;
  padding-left:calc(18px + var(--mobile-safe-left));
  padding-right:calc(18px + var(--mobile-safe-right));
  position:sticky;top:0;z-index:20;
 }
 .topbar .login-button,.topbar .menu-button {
  min-width:44px;min-height:44px;
 }
 .topbar .auth-avatar {width:44px;height:44px;min-width:44px;}
 .topbar .language-wrap select {min-height:44px;}
 .sidebar {
  padding-top:calc(24px + var(--mobile-safe-top));
  padding-bottom:calc(20px + var(--mobile-safe-bottom));
  padding-left:calc(23px + var(--mobile-safe-left));
  overflow-y:auto;
 }
 dialog {
  top:var(--mobile-safe-top);bottom:var(--mobile-safe-bottom);
  max-height:calc(100vh - var(--mobile-safe-top) - var(--mobile-safe-bottom) - 24px);
  max-height:calc(100dvh - var(--mobile-safe-top) - var(--mobile-safe-bottom) - 24px);
  max-width:calc(100% - var(--mobile-safe-left) - var(--mobile-safe-right) - 32px);
  margin:auto;overflow-y:auto;overscroll-behavior:contain;
 }
 #toast {bottom:calc(24px + var(--mobile-safe-bottom));}
}

@supports (padding-top:env(safe-area-inset-top)) {
 @media (max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px) {
  :root {
   --mobile-safe-top:env(safe-area-inset-top,0px);
   --mobile-safe-bottom:env(safe-area-inset-bottom,20px);
   --mobile-safe-left:env(safe-area-inset-left,0px);
   --mobile-safe-right:env(safe-area-inset-right,0px);
  }
 }
}
