/* Layout only: bars, the per-tab navigation stacks and their scrollers. The iOS 6 skin is ios6.css. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
/* Bars are fixed and every screen's scroller fills the window, padded clear of them, so content scrolls under the
   bars. html never scrolls: iOS 26 blurs the top and bottom edges of a scrolling page in the
   home-screen app (washing out the nav and tab bar) and has no switch for it; inner scrollers don't get it. */
:root { --nav-h: calc(44px + env(safe-area-inset-top)); --tab-h: calc(49px + env(safe-area-inset-bottom)); }
body {
  overscroll-behavior: none;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; margin: 0; }

/* Nav bar: 44px below the status bar (or the notch). */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 3; height: var(--nav-h); }
.nav-stack { position: absolute; left: 0; right: 0; top: env(safe-area-inset-top); height: 44px; }
.nav-item {
  position: absolute; inset: 0; visibility: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 4px;
  padding: 0 max(5px, env(safe-area-inset-right)) 0 max(5px, env(safe-area-inset-left));
}
.nav-left { justify-self: start; min-width: 0; max-width: calc(100% - 8px); display: flex; } /* room before the title (not on the button: a % of a shrink-to-fit box truncated every label) */ /* capped to its column: a long Back label ends in "…" */
.nav-right { justify-self: end; min-width: 0; max-width: 100%; display: flex; gap: 5px; }
.nav-title { margin: 0; max-width: calc(100vw - 180px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Screens: one .tab-stack per tab, its .pages stacked root first; each page scrolls on its own. */
#screens { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
.tab-stack, .page { position: absolute; inset: 0; }
.tab-stack, .nav-stack { visibility: hidden; } /* every stack covers the screen: only its shown page may take touches */
.page { visibility: hidden; } /* later pages paint over earlier ones: the top is always the last child */
.page-body {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-y; /* horizontal moves are the edge swipe's */
  /* 20px under the last thing on every page, so a closing note never sits against the tab bar */
  padding: var(--nav-h) env(safe-area-inset-right) calc(var(--tab-h) + 20px) env(safe-area-inset-left);
}
.page-shade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
/* Every tab has its own nav and screen stack, all in the same spot; the inactive ones (later in the DOM) would
   paint over the active one and take its taps even with their contents hidden. The stacks themselves never take
   taps; only their pages and nav items do, and hidden ones can't. */
.nav-stack, .tab-stack { pointer-events: none; }
.nav-item, .page { pointer-events: auto; }
.tab-stack.is-active > .page.is-top, .tab-stack.is-active > .page.is-moving,
.nav-stack.is-active > .nav-item.is-top, .nav-stack.is-active > .nav-item.is-moving { visibility: visible; }
/* Always on their own compositor layers: toggling will-change at the start and end of a slide would re-lay out
   the screens (it changes their containing block), which is the one thing a slide must not do. Hidden pages
   cost no tiles. */
.page, .nav-item { will-change: transform; }
.nav-item, .page-shade { will-change: transform, opacity; }
.edge-swipe { position: absolute; z-index: 2; left: 0; top: 0; bottom: 0; width: 20px; touch-action: none; }
.edge-swipe.off { pointer-events: none; }
html.nav-moving #screens, html.nav-moving .navbar { pointer-events: none; } /* no taps mid-slide */

/* Tab bar: 49px above the home indicator. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex;
  height: var(--tab-h);
  padding: 0 max(2px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(2px, env(safe-area-inset-left));
}
.tab { flex: 1; min-width: 0; position: relative; touch-action: manipulation; text-decoration: none; }

/* The app draws its own UINavigationBar/UITabBar (R3): hide ours and give the screens the whole web view. */
html.native .navbar, html.native .tabbar { display: none; }

.empty { margin: 40px 20px; text-align: center; }
/* F152: a page whose only content is its empty-state note shows it in the middle of the page, as a loading page's
   spinner (packages.css .page-body > .loading), not stuck near the top of the empty space. */
.page-body > .empty:only-child { display: flex; align-items: center; justify-content: center; height: 72%; margin: 0 20px; }
[hidden] { display: none !important; }
