#tapbit-mobile-nav {
  display: none;
}

#tapbit-mobile-nav.is-open {
  position: fixed;
  inset: 56px 0 0 0;
  z-index: 400;
  display: block;
  overflow: auto;
  background: #111;
  padding: 8px 8px 32px;
}

#tapbit-mobile-nav.is-open a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 767px) {
  /* Keep horizontal bleed clipped without creating a nested scrollport.
     Dual scroll on html/body/#root was hitching fast flings between sections. */
  html {
    overflow-x: clip;
    overflow-y: auto;
    max-width: 100%;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body,
  #root {
    overflow: visible !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    max-width: 100%;
    height: auto !important;
    min-height: 0;
  }

  header.max-md\:hidden {
    display: block !important;
  }

  img,
  video,
  canvas,
  iframe,
  svg {
    max-width: 100%;
  }

  input,
  select,
  textarea {
    max-width: 100%;
  }

  table,
  pre {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Auth forms: let the page scroll instead of trapping fields in a nested pane. */
  .overflow-auto.lg\:flex-1 {
    overflow: visible !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-bottom: calc(24px + 59px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .tap-register-form,
  form.w-full {
    max-width: 100%;
  }

  .tap-register-form input,
  .tap-register-form select,
  form.w-full input,
  form.w-full select {
    max-width: 100%;
    box-sizing: border-box;
  }

  section[aria-label="Carousel"] .overflow-x-auto,
  section[aria-label="Carousel"] [class*="overflow-x"] {
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
  }

  /* Use the desktop hero block on small screens (mobile crawl was empty). */
  .bg-bg1.hidden.md\:block[data-theme="dark"] {
    display: block !important;
  }

  .bg-bg1.md\:hidden:empty {
    display: none !important;
  }

  /* OG mobile hero is white-only (no F7F7F7 / gradient PNG). Desktop keeps the soft fade. */
  [data-theme="light"].-mt-16 {
    height: auto !important;
    min-height: 0;
    margin-top: 0 !important;
    padding-top: 72px !important;
    padding-bottom: 28px;
    background-color: #fff !important;
    background-image: none !important;
    overflow: visible !important;
  }

  /* Match tapbit.com mobile: animation above copy, centered. */
  [data-hero-content="true"] {
    flex-direction: column !important;
    align-items: center !important;
    transform: none !important;
    gap: 8px;
    text-align: center;
  }

  [data-hero-content="true"] > div:first-child {
    order: 2;
    width: 100% !important;
    max-width: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  [data-hero-content="true"] > div:last-child {
    order: 1;
    display: flex !important;
    width: min(100%, 300px) !important;
    height: 300px !important;
    max-width: 300px;
    margin: 0 auto 4px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  [data-hero-content="true"] > div:last-child video {
    width: 300px !important;
    height: 300px !important;
    max-width: 100%;
    object-fit: contain;
  }

  [data-hero-content="true"] h1 {
    font-size: 28px !important;
    line-height: 1.4 !important;
    max-width: none !important;
    text-align: center !important;
  }

  [data-hero-content="true"] h1 + div {
    text-align: center !important;
  }

  /* Match tapbit.com mobile: Sign Up button only (no email field). */
  [data-hero-content="true"] input,
  [data-hero-content="true"] input[data-hero-email] {
    display: none !important;
  }

  [data-hero-content="true"] .flex.h-14 {
    width: 100%;
    height: auto !important;
    flex-wrap: nowrap;
    gap: 0 !important;
  }

  [data-hero-content="true"] .flex.h-14 > button,
  [data-hero-content="true"] .flex.h-14 > a {
    width: 100% !important;
    height: 48px !important;
  }

  header .overflow-hidden {
    overflow: visible;
  }

  .mx-auto.mt-4.w-full.max-w-\[1200px\] {
    overflow: hidden;
  }

  .basis-1\/3 {
    flex-basis: 86% !important;
    max-width: 86%;
  }

  section[aria-label="Carousel"] button[class*="absolute"] {
    display: none !important;
  }

  .mt-\[51px\].grid {
    display: flex !important;
    flex-direction: column !important;
    margin-top: 28px !important;
    gap: 16px !important;
  }

  .mt-\[51px\].grid > div,
  .h-\[644px\],
  .h-\[504px\] {
    height: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  article.h-\[310px\] {
    height: auto !important;
    min-height: 250px;
  }

  h2.text-\[48px\],
  h2.text-5xl,
  h2.text-\[48px\] {
    font-size: 32px !important;
    line-height: 1.2 !important;
  }

  section[data-theme="dark"] .mx-auto.w-full.max-w-\[1248px\] {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 56px !important;
    padding-bottom: 40px !important;
  }

  [role="link"][aria-label^="Trade "] {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.8fr) !important;
    min-width: 0 !important;
  }

  [role="link"][aria-label^="Trade "] > div:nth-child(3),
  .grid.h-9 > div:nth-child(3) {
    display: none !important;
  }

  [role="link"][aria-label^="Trade "] > button {
    display: none !important;
  }

  /* Home popular: Pair | Price | Trade on one straight mobile row. */
  [data-home-asset-type],
  [data-home-popular-header] {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 64px !important;
    align-items: center !important;
    column-gap: 8px !important;
    min-width: 0 !important;
  }

  [data-home-asset-type] > div:nth-child(3),
  [data-home-asset-type] > div:nth-child(4),
  [data-home-popular-header] > div:nth-child(3),
  [data-home-popular-header] > div:nth-child(4) {
    display: none !important;
  }

  [data-home-asset-type] > div:last-child,
  [data-home-popular-header] > div:last-child {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }

  [data-home-asset-type] {
    height: 63px !important;
    overflow: hidden;
  }

  [data-home-asset-type] .tap-home-trade {
    width: 64px;
    height: 32px;
    flex-shrink: 0;
  }

  /* Markets table: keep Pair | Price | Trade on one level line.
     Arbitrary Tailwind grid classes from hydration may be missing from the
     prebuilt CSS, so enforce the template here. */
  [data-markets-header],
  [data-markets-panels] [data-market-row] > .grid {
    grid-template-columns: minmax(0, 1fr) minmax(4.5rem, auto) 3.75rem !important;
    align-items: center !important;
    column-gap: 8px !important;
  }

  [data-markets-panels] [data-market-row] > .grid > div:last-child {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
    min-height: 40px;
  }

  [data-markets-panels] [data-market-row] > .grid > div:last-child a {
    line-height: 1;
    white-space: nowrap;
  }

  [data-markets-header] > div:last-child {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
  }

  .rounded-r5.overflow-hidden.bg-\[\#343434\] {
    padding-bottom: 12px;
  }

  section[aria-label$=" advantages"] {
    overflow: hidden;
  }

  section[aria-label$=" advantages"] .w-full.overflow-hidden {
    overflow: hidden;
  }

  section[aria-label$=" advantages"] .aspect-\[3\/2\] {
    aspect-ratio: 556 / 320;
  }

  section.w-full.bg-black.py-\[120px\] {
    padding-top: 56px !important;
    padding-bottom: 48px !important;
  }

  section.w-full.bg-black.py-\[120px\] > .mx-auto.flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 28px !important;
  }

  [aria-label="Tapbit app futures trading"] {
    width: min(100%, 360px) !important;
    height: 360px !important;
    margin-inline: auto;
  }

  /* tapbit.com hides the link footer on mobile and uses a bottom tab bar. */
  footer.bg-bg1 {
    display: none !important;
  }

  body {
    padding-bottom: calc(59px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #tapbit-mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: calc(59px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    box-shadow: 0 -0.5px 0 0 rgba(0, 0, 0, 0.12);
  }

  #tapbit-mobile-tabs a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    min-width: 0;
    padding-top: 4px;
    color: rgba(0, 0, 0, 0.45);
    text-decoration: none;
    font-size: 10px;
    line-height: 14px;
    font-weight: 500;
  }

  #tapbit-mobile-tabs a.is-active {
    color: #111;
  }

  #tapbit-mobile-tabs .tap-tab-icon {
    position: relative;
    display: block;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  #tapbit-mobile-tabs .tap-tab-icon img {
    position: absolute;
    inset: 0;
    width: 30px;
    height: 30px;
    display: block;
    transition: opacity 0.1s;
  }

  #tapbit-mobile-tabs .tap-tab-icon-on {
    opacity: 0;
  }

  #tapbit-mobile-tabs .tap-tab-icon-off {
    opacity: 1;
  }

  #tapbit-mobile-tabs a.is-active .tap-tab-icon-on {
    opacity: 1;
  }

  #tapbit-mobile-tabs a.is-active .tap-tab-icon-off {
    opacity: 0;
  }

  #tapbit-mobile-nav {
    position: fixed;
    inset: 56px 0 59px 0;
    z-index: 400;
    display: none;
    overflow: auto;
    background: #111;
    padding: 8px 8px 32px;
  }

  #tapbit-mobile-nav.is-open {
    display: block;
  }

  #tapbit-mobile-nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (min-width: 768px) {
  #tapbit-mobile-tabs {
    display: none !important;
  }
}

/* Markets: Trade column stays vertically centered on every viewport. */
[data-markets-panels] [data-market-row] > .grid > div:last-child {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
  min-height: 40px;
}

[data-markets-panels] [data-market-row] > .grid > div:last-child a {
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 1023px) {
  [data-markets-header],
  [data-markets-panels] [data-market-row] > .grid {
    grid-template-columns: minmax(0, 1fr) minmax(4.5rem, auto) 3.75rem !important;
    align-items: center !important;
    column-gap: 8px !important;
  }

  [data-markets-header] > div:last-child {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
  }
}

