/* A way out of every page (pages/app-nav.ts, which loads this on every page). Two rules, nothing else lives here.

   1. Signed out, in the Home Screen app only (html.standalone: no browser bar, so no Back), a back control before the
      logo. A browser never shows it; nor does the door with nothing behind it (html.at-start). */
.an-back { display: none; }
html.standalone:not(.at-start) .an-back { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: -12px; border-radius: 8px; color: inherit; text-decoration: none; }
html.standalone .an-back:active { background: rgb(255 255 255 / .08); }
.an-back .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* the kit's bar is a grid of the logo and the right side: the back control takes a column of its own */
html.standalone:not(.at-start) .bx-top:has(> .an-back) { grid-template-columns: auto 1fr auto; column-gap: 4px; }
/* a landing page's own top spreads its ends apart: the logo stays beside the back control */
.bx-ln-top:has(> .an-back) .bx-logo { margin-right: auto; }

/* 2. Signed in, the bottom bar (frame.css .st-tabs, on a phone) on the pages drawn on the signed-out shell (.bx-out):
      the frame's grid is the signed-in frame's, not this shell's; the page ends clear of the bar, and a docked button
      (a shop's ad page, .sh-bar) sits on the bar, never under it. */
.app.st-app.bx-out { display: block; }
@media (max-width: 760px) {
  .bx-out:has(> .st-tabs) .bx-main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .bx-out:has(> .st-tabs):has(.bx-ln) .bx-main { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  /* a page sized to the window (a moment, /free, a shop's ad on its stage, its email step) is sized to what the bar leaves */
  .bx-out:has(> .st-tabs) { --an-tabs: calc(68px + env(safe-area-inset-bottom)); }
  .bx-out:has(> .st-tabs) .bx-mo { min-height: calc(100svh - var(--an-tabs)); }
  .bx-out:has(> .st-tabs) .bx-ln-pl:not(.bx-fr) .bx-ln-play { min-height: calc(var(--win-h, 100svh) - 64px - var(--an-tabs)); }
  .bx-out:has(> .st-tabs) .bx-ln-in { min-height: calc(var(--win-h, 100svh) - var(--an-tabs)); }
  .bx-out:has(> .st-tabs) .sh-bar { bottom: calc(68px + env(safe-area-inset-bottom)); padding-bottom: 12px; box-shadow: inset 0 1px 0 var(--line); }
  .bx-out:has(> .st-tabs) .bx-main:has(.sh-bar) { padding-bottom: calc(68px + 88px + env(safe-area-inset-bottom)); }
}
@media (min-width: 360px) and (max-width: 760px) {
  .bx-out:has(> .st-tabs) .bx-fr { min-height: calc(100svh - var(--an-tabs)); }
  .bx-out:has(> .st-tabs) .bx-fr .bx-ln-play .bx-ad-stage { min-height: clamp(200px, calc(100svh - 576px - var(--an-tabs)), 56vh); }
  .bx-out:has(> .st-tabs) .bx-fr .bx-ln-play:has(.bx-ln-road) .bx-ad-stage { min-height: clamp(240px, calc(100svh - 432px - var(--an-tabs)), 56vh); }
}
