/* SUNDEX p190 — transaction scroll integrity.
 * Keep exactly one intentional scroll owner per step and propagate a finite
 * height through compositor wrappers before asking the coin rail to scroll. */

/* Withdraw verification Step 3: the p189 motion pass made the list the scroll
 * owner, but the React motion host did not inherit the stage height. Without
 * this chain the rail expands to its contents and is then clipped by the stage. */
body.sundex-transaction-system.sx127-withdraw-layout.sx123-verification-coins
  .stx-stage.sx123-stage {
  display: flex !important;
  min-height: 0 !important;
  flex-direction: column !important;
  align-items: stretch !important;
  overflow: hidden !important;
}

body.sundex-transaction-system.sx127-withdraw-layout.sx123-verification-coins
  .stx-stage.sx123-stage
  > .stx-vf-motion-host {
  box-sizing: border-box !important;
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex: 1 1 0% !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body.sundex-transaction-system.sx127-withdraw-layout.sx123-verification-coins
  .stx-stage.sx123-stage
  > .stx-vf-motion-host
  > .sx135-deposit-clone {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex: 1 1 0% !important;
  overflow: hidden !important;
}

body.sundex-transaction-system.sx127-withdraw-layout.sx123-verification-coins
  .sx135-deposit-clone
  > :where(.sx132-coins-head, .sx134-step1-search, .sx132-networks, .sx132-required-amount, .sx132-submit) {
  flex: 0 0 auto !important;
}

body.sundex-transaction-system.sx127-withdraw-layout.sx123-verification-coins
  .sx135-deposit-clone
  > .sx134-step1-list {
  position: relative !important;
  min-height: 112px !important;
  max-height: none !important;
  flex: 1 1 0% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  pointer-events: auto !important;
  scrollbar-gutter: stable !important;
  clip-path: none !important;
}

/* Withdraw Step 1 already has a measured rail. These properties make wheel,
 * trackpad and touch scrolling deterministic without changing its geometry. */
body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select
  .sx156-coin-scroll {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  pointer-events: auto !important;
}

/* Later Withdraw steps use the stage itself as their document viewport. */
body.sundex-transaction-system.sx127-withdraw-layout[data-sx127-withdraw-stage="network"]
  .stx-stage,
body.sundex-transaction-system.sx127-withdraw-layout[data-sx127-withdraw-stage="details"]
  .stx-stage,
body.sundex-transaction-system.sx127-withdraw-layout.sx123-verification-deposit
  .stx-stage.sx123-stage {
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

/* Other asset pickers keep their existing sizes; this only guarantees that a
 * scroll gesture reaches their current scroll container. */
body.sundex-transaction-system .sx110-coin-scroll,
body.sx149-swap main[aria-label="Swap assets"] .sx149-coin-menu {
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

@media (max-width: 640px) {
  body.sundex-transaction-system.sx127-withdraw-layout.sx123-verification-coins
    .sx135-deposit-clone
    > .sx134-step1-list {
    min-height: 96px !important;
    scrollbar-gutter: auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sundex-transaction-system
    :where(.sx110-coin-scroll, .sx156-coin-scroll, .sx134-step1-list, .sx149-coin-menu) {
    scroll-behavior: auto !important;
  }
}
