/* Mobile app mode: open on the real Adventure Builder home screen. */
body.app-mode {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background: #071316;
  padding-bottom: 76px;
}

/* Remove website-only chrome inside the dedicated /app/ version. */
body.app-mode > header,
body.app-mode > footer,
body.app-mode .mode-switch-banner,
body.app-mode .app-menu,
body.app-mode #menu-button,
body.app-mode .app-update-banner {
  display: none !important;
}

body.app-mode main {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-height: calc(100dvh - 76px);
  margin: 0 !important;
  padding: 0 !important;
}

/* The app must always start on the approved main home screen. */
body.app-mode.dashboard-home-view main#top > .home-v117 {
  display: block !important;
}
body.app-mode.dashboard-home-view main#top > :not(.home-v117) {
  display: none !important;
}

/* Once a bottom-nav item is chosen, show only that feature page. */
body.app-mode.dashboard-feature-view main#top > .dashboard-page-hidden {
  display: none !important;
}
body.app-mode.dashboard-feature-view .home-v117 {
  display: none !important;
}

body.app-mode .mobile-nav {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
body.app-mode .mobile-nav a,
body.app-mode .mobile-nav button {
  min-width: 0;
}

@media (min-width: 760px) {
  body.app-mode {
    max-width: 520px;
    margin: 0 auto;
    border-left: 1px solid rgba(255,255,255,.12);
    border-right: 1px solid rgba(255,255,255,.12);
  }
  body.app-mode .mobile-nav {
    width: min(520px, 100%);
    margin-inline: auto;
  }
}

/* Build 131 Section 4: dependable five-tab mobile navigation. */
body.app-mode .mobile-nav,
.mobile-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  isolation: isolate;
}
.mobile-nav > a,
.mobile-nav > button {
  position: relative;
  min-width: 0;
  min-height: 56px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mobile-nav > a small,
.mobile-nav > button small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
}
.mobile-nav > a::after,
.mobile-nav > button::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 2px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(.45);
  transition: opacity .16s ease, transform .16s ease;
}
.mobile-nav > .is-current::after {
  opacity: 1;
  transform: scaleX(1);
}
.mobile-nav > a:active,
.mobile-nav > button:active {
  transform: translateY(1px);
  opacity: .78;
}
.mobile-nav > a:focus-visible,
.mobile-nav > button:focus-visible {
  outline: 3px solid #f4a261;
  outline-offset: -3px;
}
@media (max-width: 360px) {
  .mobile-nav > a,
  .mobile-nav > button { font-size: 10px !important; }
  .mobile-nav > a span,
  .mobile-nav > button span { font-size: 20px !important; }
}
.mobile-nav > [hidden] { display: none !important; }
@media (max-width:700px) {
  body { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  main#top > section:last-of-type { scroll-margin-bottom: 92px; }
}
