:root {
  --mobile-nav-content-height: 64px;
  --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-nav-total-height: calc(var(--mobile-nav-content-height) + var(--mobile-safe-bottom));
}

html {
  min-height: 100%;
  background: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  background: #fff;
}

button,
input,
select,
textarea {
  font: inherit;
}

@media (max-width: 800px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    min-height: 100dvh;
    padding-bottom: var(--mobile-nav-total-height) !important;
    overscroll-behavior-y: none;
  }

  #app {
    min-height: 100svh;
    min-height: 100dvh;
  }

  input,
  select,
  textarea {
    min-height: 46px;
    font-size: 16px !important;
  }

  button,
  [role="button"],
  .button,
  .outline,
  .login,
  .buy {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: var(--mobile-nav-total-height) !important;
    min-height: var(--mobile-nav-total-height) !important;
    padding: 0 0 var(--mobile-safe-bottom) !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.98) !important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    contain: layout paint;
    isolation: isolate;
    will-change: transform;
    z-index: 90 !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .mobile-bottom-nav a {
    min-width: 0 !important;
    min-height: var(--mobile-nav-content-height);
    padding: 6px clamp(1px, 0.8vw, 3px) 5px;
    line-height: 1.15;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    overflow: visible;
    white-space: nowrap !important;
    word-break: keep-all;
    font-size: clamp(9px, 2.7vw, 11px);
    letter-spacing: -0.025em;
  }

  .mobile-bottom-nav a > span {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    white-space: nowrap !important;
    word-break: keep-all;
  }

  .mobile-bottom-nav .nav-beta {
    flex: 0 0 auto;
    margin-left: 2px;
  }

  .mobile-bottom-nav a b {
    min-height: 23px;
    display: grid;
    place-items: center;
  }

  .mobile-bottom-nav a.mobile-party-find {
    min-height: var(--mobile-nav-content-height);
    margin: 0;
    padding: 6px 3px 5px;
    border-radius: 0;
    background: transparent;
    color: #1a1c1f !important;
    font-weight: 900;
    box-shadow: none;
    transform: none;
  }

  .mobile-bottom-nav a.mobile-party-find b {
    width: 31px;
    min-height: 27px;
    margin: 0 auto 1px;
    border-radius: 9px;
    background: #ffc94a;
    color: #1a1c1f;
  }

  .mobile-bottom-nav a.mobile-party-find.on {
    background: transparent;
    color: #1a1c1f !important;
  }

  .mobile-bottom-nav a.on {
    position: relative;
    color: #339cff !important;
  }

  .mobile-bottom-nav a.on::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 26px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: #339cff;
    transform: translateX(-50%);
  }

  .mobile-bottom-nav a.mobile-party-find.on::before {
    display: none;
  }

  .mobile-bottom-nav a.mobile-party-create {
    color: #1a1c1f !important;
    font-weight: 850;
  }

  .mobile-bottom-nav a.mobile-party-create b {
    width: 31px;
    min-height: 27px;
    margin: 0 auto 1px;
    border-radius: 9px;
    background: #339cff;
    color: #fff;
    font-size: 23px;
    font-weight: 500;
  }

  .mobile-bottom-nav a.mobile-party-create.on {
    color: #1684e5 !important;
  }

  .mobile-bottom-nav a.mobile-party-create.on::before {
    display: none;
  }

  .footer {
    padding-bottom: calc(36px + var(--mobile-nav-total-height)) !important;
  }

  .mobile-purchase-bar {
    bottom: var(--mobile-nav-total-height) !important;
    min-height: 78px;
    padding-bottom: 11px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    transform: translate3d(0, 0, 0);
    z-index: 89 !important;
  }

  .detail-layout {
    padding-bottom: calc(166px + var(--mobile-safe-bottom)) !important;
  }

  .detail-layout > .purchase {
    max-height: min(82dvh, 680px) !important;
    overscroll-behavior: contain;
    padding-bottom: calc(22px + var(--mobile-safe-bottom)) !important;
  }

  .purchase-backdrop {
    height: 100dvh;
  }

  body.profile-open .mobile-bottom-nav {
    transform: translate3d(0, 110%, 0) !important;
  }

  .profile-panel,
  .modal,
  .dialog,
  .sheet {
    max-height: calc(100dvh - 24px);
    overscroll-behavior: contain;
  }

  .party-scroll,
  .content-grid,
  .ott-service-rail,
  .ops-tabs,
  .table-scroll {
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .home .featured-parties .party-scroll {
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  .party-scroll::-webkit-scrollbar,
  .content-grid::-webkit-scrollbar,
  .ott-service-rail::-webkit-scrollbar,
  .ops-tabs::-webkit-scrollbar,
  .table-scroll::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 380px) {
  .wrap {
    width: calc(100% - 28px);
  }

  .mobile-bottom-nav a {
    font-size: 10px;
  }

  .mobile-bottom-nav .nav-beta {
    display: none;
  }

  .mobile-purchase-bar {
    gap: 10px;
    padding-right: 13px;
    padding-left: 13px;
  }

  .mobile-purchase-bar > div {
    min-width: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-nav,
  .detail-layout > .purchase {
    transition: none !important;
  }
}
