/* safe-top.css: keeps the page clear of the iPhone status bar.

   WHY THIS FILE EXISTS
   The live iOS app build 1.21 (Natively) draws the web page full screen, under
   the status bar, and its web view reports a safe area of 0. So
   env(safe-area-inset-top) is 0 there, and every top bar sits under the clock.
   Later app builds start the page below the status bar, which fixes it on the
   native side. Once 1.21 is gone, delete this file and its <link> tags
   (lib/html.js page() and the consumer pages in public/).

   HOW IT WORKS
   --bb-safe-top is the room left at the top of the page. It starts as
   env(safe-area-inset-top). That is 0 in a browser tab and the real inset in an
   installed web app. A portrait page exactly as tall as the phone's screen can
   only be drawn under the status bar. So for each iPhone screen height, a rule
   below sets that model's status bar height. A browser tab is shorter than the
   screen. So is any app build whose page starts below the status bar. None of
   these rules match there, and nothing on the page moves.

   Loaded right after theme.css by lib/html.js page() and by every consumer page
   in public/. The business portal and admin console do not load it. */

:root{ --bb-safe-top:env(safe-area-inset-top, 0px); }

/* Home button iPhones: SE, 6, 7, 8 and the Plus sizes. */
@media (device-height:568px) and (min-height:567px),
       (device-height:667px) and (min-height:666px),
       (device-height:736px) and (min-height:735px){
  :root{ --bb-safe-top:max(env(safe-area-inset-top, 0px), 20px); }
}
/* X, XS, 11 Pro, 12 mini, 13 mini. */
@media (device-height:812px) and (min-height:811px){
  :root{ --bb-safe-top:max(env(safe-area-inset-top, 0px), 50px); }
}
/* 12, 13, 14, 16e, plus 12 Pro Max, 13 Pro Max, 14 Plus. */
@media (device-height:844px) and (min-height:843px),
       (device-height:926px) and (min-height:925px){
  :root{ --bb-safe-top:max(env(safe-area-inset-top, 0px), 47px); }
}
/* XR, XS Max, 11, 11 Pro Max. */
@media (device-height:896px) and (min-height:895px){
  :root{ --bb-safe-top:max(env(safe-area-inset-top, 0px), 48px); }
}
/* Dynamic Island: 14 Pro, 15, 15 Pro, 16, plus their large sizes. */
@media (device-height:852px) and (min-height:851px),
       (device-height:932px) and (min-height:931px){
  :root{ --bb-safe-top:max(env(safe-area-inset-top, 0px), 59px); }
}
/* 16 Pro, 16 Pro Max, the 17 family and Air. */
@media (device-height:874px) and (min-height:873px),
       (device-height:912px) and (min-height:911px),
       (device-height:956px) and (min-height:955px){
  :root{ --bb-safe-top:max(env(safe-area-inset-top, 0px), 62px); }
}

/* Push the app shell down by the inset. .mn is the public menu page
   (pages/menus/[id].js), which has its own shell. */
.bb-app, .mn{ padding-top:var(--bb-safe-top); }

/* Sticky top bars stop below the status bar, not under it. */
.bb-topbar{ top:var(--bb-safe-top); }

/* A band behind the status bar. Content that scrolls up under the clock stays
   readable. It uses the same glass as the top bar, and it is 0 tall wherever
   the inset is 0. Sheets and dialogs (z-index 60 and up) still cover it. */
.bb-app::before, .mn::before{
  content:""; position:fixed; top:0; left:0; right:0; height:var(--bb-safe-top);
  z-index:45; pointer-events:none;
  background:rgba(4,13,29,0.86); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}