/* SUNDEX p168 — stable, compact mobile Wallet and funding flows. */

@media (max-width: 760px) {
  body:has(.wallet-premium.wallet65-ready)
    .wallet-premium.wallet65-ready
    .wallet-action-grid {
    position: relative !important;
    inset: auto !important;
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  body:has(.wallet-premium.wallet65-ready)
    .wallet-premium.wallet65-ready
    .wallet-action-grid
    > .wallet-action {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    gap: 6px !important;
    padding: 0 8px !important;
    border-radius: 15px !important;
    transform: none !important;
  }

  body:has(.wallet-premium.wallet65-ready)
    .wallet-action
    .wallet-action-copy {
    display: block !important;
    min-width: 0 !important;
    order: 2 !important;
    overflow: hidden !important;
  }

  body:has(.wallet-premium.wallet65-ready)
    .wallet-action
    .wallet-action-copy
    small {
    display: none !important;
  }

  body:has(.wallet-premium.wallet65-ready)
    .wallet-action
    .wallet-action-copy
    strong {
    display: block !important;
    overflow: hidden !important;
    font-size: 12.5px !important;
    font-weight: 580 !important;
    line-height: 1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:has(.wallet-premium.wallet65-ready)
    .wallet-action
    .wallet-action-icon {
    position: relative !important;
    z-index: 2 !important;
    display: inline-flex !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    flex: 0 0 18px !important;
    align-items: center !important;
    justify-content: center !important;
    order: 1 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body:has(.wallet-premium.wallet65-ready)
    .wallet-action
    .wallet-action-icon
    svg {
    width: 17px !important;
    height: 17px !important;
  }
}

@media (max-width: 700px) {
  html:has(body.sundex-transaction-system),
  body.sundex-transaction-system {
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.sundex-transaction-system .platform-shell {
    height: calc(100vh - 70px) !important;
    min-height: 0 !important;
    max-height: calc(100vh - 70px) !important;
    overflow: hidden !important;
  }

  @supports (height: 100svh) {
    body.sundex-transaction-system .platform-shell {
      height: calc(100svh - 70px) !important;
      max-height: calc(100svh - 70px) !important;
    }
  }

  html body.sundex-transaction-system
    .platform-shell
    .platform-main.platform-main {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    scrollbar-gutter: auto !important;
  }

  html body.sundex-transaction-system
    .platform-shell
    .platform-main
    .stx-shell.stx-shell {
    position: relative !important;
    display: grid !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: max-content max-content minmax(0, 1fr) !important;
    grid-template-areas: "head" "progress" "stage" !important;
    align-content: stretch !important;
    overflow: hidden !important;
    border-radius: 18px !important;
    transform: none !important;
    animation: none !important;
    overflow-anchor: none !important;
  }

  body.sundex-transaction-system .stx-ticket-frame {
    border-radius: 18px !important;
  }

  html body.sundex-transaction-system
    .platform-shell
    .platform-main
    .stx-head.stx-head {
    min-height: 0 !important;
    padding: 17px 18px 8px !important;
  }

  body.sundex-transaction-system .stx-head h1 {
    font-size: 20px !important;
    line-height: 1.1 !important;
    letter-spacing: -0.02em !important;
  }

  body.sundex-transaction-system .stx-step-meta {
    margin: 5px 0 0 !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  body.sundex-transaction-system .stx-progress {
    min-height: 0 !important;
    padding: 0 18px 8px !important;
  }

  body.sundex-transaction-system .stx-progress > div {
    min-height: 22px !important;
    gap: 4px !important;
  }

  html body.sundex-transaction-system
    .platform-shell
    .platform-main
    .stx-stage.stx-stage {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    transform: none !important;
    animation: none !important;
    overflow-anchor: none !important;
  }

  html body.sundex-transaction-system
    .platform-shell
    .platform-main
    .stx-stage.stx-stage
    > div {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100% !important;
    padding: 8px 18px max(18px, env(safe-area-inset-bottom)) !important;
    transform: none !important;
    animation: none !important;
  }

  body.sundex-transaction-system .stx-stage h2 {
    font-size: 22px !important;
    line-height: 1.16 !important;
    letter-spacing: -0.02em !important;
    text-wrap: balance !important;
  }

  body.sundex-transaction-system .stx-stage h2 + p {
    margin-top: 6px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    text-wrap: pretty !important;
  }

  body.sundex-transaction-system .stx-order-form > button:last-of-type,
  body.sundex-transaction-system .stx-stage button.w-full.rounded-full,
  body.sundex-transaction-system .stx-stage button.w-full.py-3 {
    position: static !important;
    inset: auto !important;
  }

  body.sundex-transaction-system.sx110-deposit-select .stx-stage,
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select .stx-stage,
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select .stx-stage-coins {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.sundex-transaction-system.sx110-deposit-select .stx-stage > .w-full,
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select .stx-stage > .w-full {
    height: 100% !important;
    min-height: 0 !important;
  }

  body.sundex-transaction-system.sx110-deposit-select .stx-stage > .w-full > .space-y-4,
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select .stx-stage > .w-full > .space-y-4 {
    display: flex !important;
    height: 100% !important;
    min-height: 0 !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  body.sundex-transaction-system.sx110-deposit-select
    .stx-stage
    > .w-full
    > .space-y-4
    > *,
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select
    .stx-stage
    > .w-full
    > .space-y-4
    > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  body.sundex-transaction-system.sx110-deposit-select .sx110-select-heading,
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select .sx156-select-heading {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding-right: 82px !important;
  }

  body.sundex-transaction-system.sx110-deposit-select
    .stx-stage
    > .w-full
    > .space-y-4
    > :nth-child(2),
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select
    .stx-stage
    > .w-full
    > .space-y-4
    > :nth-child(2) {
    min-height: 52px !important;
    flex: 0 0 52px !important;
  }

  body.sundex-transaction-system.sx110-deposit-select .sx110-coin-scroll,
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select .sx156-coin-scroll {
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    margin: 0 !important;
    padding: 2px 2px max(72px, calc(56px + env(safe-area-inset-bottom))) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    scrollbar-gutter: auto !important;
    clip-path: inset(0 round 15px) !important;
  }

  body.sundex-transaction-system.sx110-deposit-select .sx110-coin-scroll > button,
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select .sx156-coin-scroll > button {
    box-sizing: border-box !important;
    min-width: 0 !important;
    min-height: 66px !important;
    padding: 10px 13px !important;
  }

  body.sundex-transaction-system.sx110-deposit-select .sx110-deposit-back,
  body.sundex-transaction-system.sx127-withdraw-layout.sx156-withdraw-select .sx156-withdraw-back {
    min-width: 72px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 9px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wallet-premium.wallet65-ready .wallet-action,
  body.sundex-transaction-system .stx-stage,
  body.sundex-transaction-system .stx-stage > div {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
