main.app.tab-mode {
  padding: 0;
}
.tab-deck {
  position: relative;
  width: 100%;
  height: var(--shell-height, 100dvh);
  overflow: hidden;
  touch-action: pan-y;
}
/* Safari must not scroll the deck to a fragment behind the live room. */
html:is(.site-flow, .site-pane) .tab-deck { overflow: clip; }
.tab-deck[hidden] { display: none; }
.tab-deck > .swiper-wrapper {
  height: 100%;
  display: flex;
  transition-property: transform;
}
.tab-deck .swiper-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
  transform: translateZ(0);
}
/* Only a moving deck needs a layer per slide. Layout containment keeps a slide
   the containing block of its fixed composer once the transform is gone. */
@supports (contain: layout) {
  .tab-deck .swiper-slide { contain: layout; }
  .tab-deck.deck-rest .swiper-slide { transform: none; }
}
/* A resting deck renders the slide on screen. The others skip their content. */
.tab-deck .slide-away:not([data-tab="live"]) { content-visibility: hidden; }
@supports not (content-visibility: hidden) {
  .tab-deck .slide-away:not([data-tab="live"]) { visibility: hidden; }
}
/* The live room lays out its chat while away, so it only stops painting. A picture
   still decoding in the slide, or feeding a floating window, keeps it painted. */
html:not(.live-mini):not(.live-pip) .tab-deck .slide-away[data-tab="live"]:not(:has(#live-player:not([hidden]), .live-screen:not([hidden]))) { visibility: hidden; }
html[data-page] .tab-deck .swiper-slide > .page {
  display: block;
  min-height: 100%;
  padding-bottom: var(--dock-clearance, 82px);
}
html[data-page] .tab-deck #live.live-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding-bottom: 0;
}

.app:has(.tab-deck.live-in-transit:not([hidden])) + .nav { display: none; }
/* Keep edge drags reachable over the live chat's own pointer handlers. */
.tab-deck #live::before,
.tab-deck .live-back-edge,
.tab-deck #live::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: calc(var(--composer-size, 48px) + env(safe-area-inset-bottom));
  width: 28px;
  z-index: 8;
}
.tab-deck #live::before, .tab-deck .live-back-edge { left: 0; }
.tab-deck .live-back-edge { touch-action: pan-y pinch-zoom; }
.tab-deck #live::after { right: 0; }
.tab-deck img { -webkit-user-drag: none; }
/* These pictures keep the box the page CSS already gives them, and stay invisible until loaded. */
img[data-page-src]:not(.page-img-ready) { visibility: hidden; }
.welfare-rule-panels > img { aspect-ratio: 1188 / 1228; }

/* Let drags through the dock padding reach the slide beneath it. */
.app.tab-mode + .nav { pointer-events: none; }
.app.tab-mode + .nav > [data-page] { pointer-events: auto; }

.app.back-preview { overflow-x: clip; }
.back-preview .back-preview-source {
  position: relative;
  z-index: 2;
  min-height: 100%;
  background: inherit;
  transform: translate3d(var(--back-offset, 0px), 0, 0);
}
.back-preview .back-preview-under {
  position: absolute;
  inset: var(--back-top) 0 auto;
  height: 100%;
  overflow: auto;
  background-color: #100832;
  pointer-events: none;
}
.app.back-preview + .nav.back-preview-nav { display: grid; pointer-events: none; }
.back-settling .back-preview-source { transition: transform 150ms ease-out; }
.back-settling + .back-preview-nav { transition: clip-path 150ms ease-out; }

html[data-page] .tab-deck #profile:has(#profile-user:not([hidden]) .profile-card:not([hidden])) {
  display: flex;
  flex-direction: column;
}
#profile-user:not([hidden]):has(.profile-card:not([hidden])) {
  flex: 1;
  display: flex;
  flex-direction: column;
}
#profile-user .profile-card { flex: 1; }
#profile-logout { margin-top: auto; }

.profile-back-active { position: relative; isolation: isolate; }
#profile .profile-back-parent {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translate3d(calc(var(--profile-enter-from) + var(--profile-back-x, 0px)),0,0);
}
#profile .profile-card.profile-back-parent { display: flex; }
#profile .profile-back-source {
  position: relative;
  z-index: 1;
  min-height: calc(var(--shell-height, 100dvh) - var(--dock-clearance, 82px) - 22px);
  align-content: start;
  background: radial-gradient(ellipse at top,#2a0a62,transparent 55%),#100832;
  transform: translate3d(var(--profile-back-x, 0px),0,0);
  user-select: none;
}
.profile-back-active:has(> .profile-back-settling) > .profile-back-parent,
.profile-back-source.profile-back-settling { transition: transform 160ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .profile-back-active:has(> .profile-back-settling) > .profile-back-parent,
.profile-back-source.profile-back-settling { transition: none; }
}
