:root{
  /* Set by JS from the actual TabBar height. */
  --tabbar-h: 64px;
  /* When the TabBar is hidden (scrolling up), this will be set to 0px by JS. */
  --tabbar-visible-h: var(--tabbar-h);
}

/*
  Swipe tabs layout:
  - `.swipe-pager` is the gesture area and MUST use `touch-action: pan-y` so vertical scroll remains native.
  - Horizontal movement is driven by `.swipe-track { transform: translate3d(x,0,0) }` (no scroll-snap, no scrollLeft).
*/

.swipe-tabs{
  position: fixed;
  inset: 0;
  z-index: 1;
}

.swipe-pager{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(100dvh - var(--tabbar-visible-h));
  overflow: hidden;
  touch-action: pan-y;
  z-index: 1;
}

.swipe-track{
  height: 100%;
  display: flex;
  transform: translate3d(0px, 0px, 0px);
  will-change: transform;
}

.swipe-page{
  flex: 0 0 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Allow scroll chaining to the document to preserve native pull-to-refresh. */
  overscroll-behavior-y: auto;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  padding: 12px 12px 24px;
}

/* Full-screen non-pager screens (user profile, post detail). */
.screen{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(100dvh - var(--tabbar-visible-h));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Allow scroll chaining to the document to preserve native pull-to-refresh. */
  overscroll-behavior-y: auto;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  background: linear-gradient(180deg, #07080b 0%, var(--bg) 60%, #07080b 100%);
  padding: 12px 12px 24px;
  z-index: 3;
}

/* TabBar: keep fixed; height is measured by JS and reflected into `--tabbar-h`. */
.bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
}
