/* SUNDEX transaction system p28 — compact material split, built around the task. */
body.sundex-transaction-system {
  --tx-bg: #020407;
  --tx-panel: #070b10;
  --tx-panel-raised: #0b1017;
  --tx-field: #060a0f;
  --tx-ink: #f2f5f9;
  --tx-text: #d6dee8;
  --tx-muted: #98a4b3;
  --tx-dim: #6f7b8b;
  --tx-line: rgba(197, 211, 229, 0.11);
  --tx-line-strong: rgba(197, 211, 229, 0.2);
  --tx-metal: #bacbe0;
  --tx-danger: #d99aa5;
  --tx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--tx-bg) !important;
}

body.sundex-transaction-system .platform-main {
  padding: 28px 24px 64px !important;
  background: var(--tx-bg) !important;
  scrollbar-gutter: stable;
}

/* The page is deliberately smaller than the viewport: a task, not a hero. */
body.sundex-transaction-system .stx-shell {
  position: relative;
  isolation: isolate;
  display: grid !important;
  width: min(1120px, 100%) !important;
  max-width: 1120px !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  grid-template-columns: minmax(400px, 2fr) minmax(620px, 3fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "context head"
    "context progress"
    "context stage";
  column-gap: 20px;
  align-items: start;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* One material plane, no card-inside-card. */
body.sundex-transaction-system .stx-context {
  grid-area: context;
  position: sticky;
  top: 96px;
  min-width: 0;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--tx-line);
  border-radius: 28px;
  color: var(--tx-text);
  background: #05080c;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.035);
}

body.sundex-transaction-system .stx-context::before {
  content: "";
  position: absolute;
  inset: -22% -45% 35% -25%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(ellipse at 70% 72%, transparent 0 20px, rgba(177, 201, 230, 0.032) 21px 22px),
    radial-gradient(ellipse at 68% 68%, rgba(80, 108, 143, 0.13), transparent 58%);
  transform: rotate(-10deg);
}

body.sundex-transaction-system .stx-context::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 28%, rgba(2, 4, 7, 0.18) 48%, rgba(2, 4, 7, 0.92) 78%);
}

body.sundex-transaction-system .stx-material-object {
  position: absolute;
  inset: 0;
  height: auto;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background:
    linear-gradient(124deg, rgba(255, 255, 255, 0.025), transparent 28% 76%, rgba(165, 192, 224, 0.035)),
    repeating-linear-gradient(116deg, transparent 0 27px, rgba(185, 207, 234, 0.022) 28px 29px),
    linear-gradient(145deg, #0b1119, #05080d 62%, #020406);
  box-shadow: none;
  transform: none;
}

body.sundex-transaction-system .stx-material-object::after {
  content: "";
  position: absolute;
  top: 44%;
  right: -8%;
  width: 88%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(183, 207, 236, 0.42), transparent);
  box-shadow: 0 0 20px rgba(124, 164, 213, 0.16);
  transform: rotate(-7deg);
}

body.sundex-transaction-system .stx-material-brand {
  position: absolute;
  top: 25px;
  left: 27px;
  color: rgba(238, 244, 251, 0.78);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.13em;
}

body.sundex-transaction-system .stx-material-object i {
  display: none;
}

body.sundex-transaction-system .stx-material-object b {
  position: absolute;
  top: 26px;
  right: 27px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(198, 218, 242, 0.8);
  box-shadow: 0 0 14px rgba(151, 190, 237, 0.45);
}

body.sundex-transaction-system .stx-context-copy {
  position: absolute;
  z-index: 1;
  right: 30px;
  bottom: 31px;
  left: 30px;
}

body.sundex-transaction-system .stx-context-label {
  display: block;
  margin: 0 0 11px;
  color: var(--tx-metal);
  font-size: 12px;
  font-weight: 560;
}

body.sundex-transaction-system .stx-context-title {
  max-width: 11ch;
  margin: 0;
  color: var(--tx-ink);
  font-size: 40px;
  font-weight: 620;
  line-height: 1.01;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

body.sundex-transaction-system .stx-context-body {
  max-width: 33ch;
  margin: 18px 0 0;
  color: var(--tx-muted);
  font-size: 13px;
  line-height: 1.55;
  text-wrap: pretty;
}

body.sundex-transaction-system .stx-context-rows {
  display: none !important;
}

/* One quiet working surface on the right. */
body.sundex-transaction-system .stx-ticket-frame {
  z-index: -1;
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: stretch;
  min-height: 520px;
  pointer-events: none;
  border: 1px solid var(--tx-line-strong);
  border-radius: 28px;
  background: linear-gradient(145deg, #080d14, #05080c 72%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.035);
  clip-path: none;
}

body.sundex-transaction-system .stx-head {
  grid-area: head;
  display: flex !important;
  min-width: 0;
  min-height: 72px;
  align-items: center !important;
  gap: 14px !important;
  margin: 0 !important;
  padding: 20px 28px 10px !important;
}

body.sundex-transaction-system .stx-head > div {
  min-width: 0;
  flex-wrap: nowrap !important;
  gap: 10px !important;
}

body.sundex-transaction-system .stx-funding-shell .stx-head > div > div:first-child {
  display: none !important;
}

body.sundex-transaction-system .stx-head h1 {
  color: var(--tx-ink) !important;
  font-size: 21px !important;
  font-weight: 620 !important;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

body.sundex-transaction-system .stx-head > button {
  width: 40px !important;
  height: 40px !important;
  flex: 0 0 40px;
  padding: 0 !important;
  border: 1px solid var(--tx-line) !important;
  border-radius: 12px !important;
  color: var(--tx-text) !important;
  background: rgba(213, 225, 240, 0.035) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035) !important;
}

body.sundex-transaction-system .stx-step-meta {
  margin-left: 2px;
  color: var(--tx-muted);
  font-size: 12px;
  font-weight: 460;
  white-space: nowrap;
}

body.sundex-transaction-system .stx-progress,
body.sundex-transaction-system .stx-head + div:has(> .stx-progress) {
  grid-area: progress;
}

body.sundex-transaction-system .stx-head + div:has(> .stx-progress) {
  margin: 0 !important;
  padding: 0 28px 13px !important;
}

body.sundex-transaction-system .stx-progress {
  display: flex !important;
  width: 100%;
  min-width: 0;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 28px 13px !important;
}

body.sundex-transaction-system div:has(> .stx-progress) > .stx-progress {
  padding: 0 !important;
}

body.sundex-transaction-system .stx-progress > div {
  display: flex !important;
  min-width: 0;
  min-height: 30px !important;
  flex: 1 1 0 !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 6px !important;
}

body.sundex-transaction-system .stx-progress > div > div:first-child {
  width: 100% !important;
  height: 2px !important;
  flex: none !important;
  overflow: hidden;
  border-radius: 99px !important;
  background: #151b23 !important;
  box-shadow: none !important;
}

body.sundex-transaction-system .stx-progress > div > div:first-child > div {
  display: block !important;
  height: 100% !important;
  border-radius: inherit;
  background: var(--tx-metal) !important;
}

body.sundex-transaction-system .stx-progress > div::after {
  display: none !important;
}

body.sundex-transaction-system .stx-progress > div > span {
  max-width: 100%;
  overflow: hidden;
  color: var(--tx-dim) !important;
  font-size: 10px !important;
  font-weight: 510 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis;
  text-transform: none !important;
  white-space: nowrap;
}

body.sundex-transaction-system .stx-progress > div.stx-is-current > span {
  color: var(--tx-text) !important;
  font-weight: 600 !important;
}

body.sundex-transaction-system .stx-progress > div.stx-is-complete > span {
  color: rgba(186, 203, 224, 0.68) !important;
}

body.sundex-transaction-system .stx-stage {
  grid-area: stage;
  min-width: 0;
  min-height: 0;
  margin: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.sundex-transaction-system .stx-stage > div {
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 13px 28px 30px !important;
}

body.sundex-transaction-system .buy-sell-intro,
body.sundex-transaction-system .stx-stage .text-center {
  margin: 0 0 22px !important;
  text-align: left !important;
}

body.sundex-transaction-system .buy-sell-intro > small,
body.sundex-transaction-system .buy-sell-option-copy > small {
  display: none !important;
}

body.sundex-transaction-system .buy-sell-intro h2,
body.sundex-transaction-system .stx-stage h2 {
  margin: 0;
  color: var(--tx-ink) !important;
  font-size: 22px !important;
  font-weight: 610 !important;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

body.sundex-transaction-system .buy-sell-intro p,
body.sundex-transaction-system .stx-stage h2 + p {
  margin-top: 7px !important;
  color: var(--tx-muted) !important;
  font-size: 13px !important;
  line-height: 1.5;
}

/* Funding method and coin rows are compact controls, not presentation cards. */
body.sundex-transaction-system .buy-sell-options {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px !important;
}

body.sundex-transaction-system .buy-sell-intro {
  grid-column: 1 / -1;
}

body.sundex-transaction-system .buy-sell-option,
body.sundex-transaction-system .stx-stage button.group {
  min-width: 0;
  min-height: 82px !important;
  gap: 13px !important;
  padding: 15px 16px !important;
  border: 1px solid var(--tx-line) !important;
  border-radius: 17px !important;
  color: var(--tx-text) !important;
  background: var(--tx-panel-raised) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.028) !important;
  transition: border-color 180ms var(--tx-ease), background-color 180ms var(--tx-ease), transform 180ms var(--tx-ease) !important;
}

body.sundex-transaction-system .buy-sell-option.signature-ring {
  border-color: rgba(194, 214, 239, 0.43) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035) !important;
}

body.sundex-transaction-system .buy-sell-icon,
body.sundex-transaction-system .stx-stage button.group > .w-14 {
  width: 40px !important;
  height: 40px !important;
  flex: 0 0 40px;
  border: 0 !important;
  border-radius: 12px !important;
  color: var(--tx-metal) !important;
  background: rgba(184, 203, 224, 0.055) !important;
  box-shadow: none !important;
}

body.sundex-transaction-system .buy-sell-option-copy strong,
body.sundex-transaction-system .stx-stage button.group p.font-bold {
  color: var(--tx-ink) !important;
  font-size: 14px !important;
  font-weight: 610 !important;
}

body.sundex-transaction-system .buy-sell-option-copy p,
body.sundex-transaction-system .stx-stage button.group p.text-muted-foreground {
  color: var(--tx-muted) !important;
  font-size: 12px !important;
  line-height: 1.4;
}

body.sundex-transaction-system .buy-sell-arrow {
  margin-left: auto;
  color: var(--tx-dim) !important;
}

body.sundex-transaction-system .stx-order-form {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.sundex-transaction-system .stx-order-form label,
body.sundex-transaction-system .stx-stage label {
  color: var(--tx-text) !important;
  font-size: 12px !important;
  font-weight: 560 !important;
}

body.sundex-transaction-system .stx-order-form > div:has(> label) > div > button,
body.sundex-transaction-system .stx-stage input,
body.sundex-transaction-system .stx-stage select {
  min-height: 54px !important;
  border: 1px solid var(--tx-line) !important;
  border-radius: 14px !important;
  color: var(--tx-ink) !important;
  background: var(--tx-field) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025) !important;
}

body.sundex-transaction-system .stx-stage input::placeholder {
  color: #9ca8b7 !important;
  opacity: 1;
}

/* Deposit amount: remove the nested card and restore normal control scale. */
body.sundex-transaction-system .stx-funding-shell .stx-stage .space-y-5 > .flex.items-center.justify-center:has(> img) {
  justify-content: flex-start !important;
  padding: 4px 0 2px !important;
}

body.sundex-transaction-system .stx-funding-shell .stx-stage .space-y-5 > .bg-card {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.sundex-transaction-system .stx-funding-shell .stx-stage .space-y-5 > .bg-card input {
  height: 64px !important;
  min-height: 64px !important;
  padding: 0 18px !important;
  border: 1px solid var(--tx-line-strong) !important;
  border-radius: 15px !important;
  background: var(--tx-field) !important;
  color: var(--tx-ink) !important;
  font-size: 30px !important;
  font-weight: 560 !important;
  line-height: 1 !important;
  text-align: left !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025) !important;
}

body.sundex-transaction-system .stx-funding-shell .stx-stage .space-y-5 > .bg-card p {
  margin-top: 10px !important;
  color: var(--tx-muted) !important;
  text-align: left !important;
}

body.sundex-transaction-system .stx-funding-shell .stx-stage .bg-destructive\/5 {
  padding: 3px 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.sundex-transaction-system .stx-funding-shell .stx-stage .bg-destructive\/5 p,
body.sundex-transaction-system .stx-funding-shell .stx-stage .bg-destructive\/5 svg {
  color: var(--tx-danger) !important;
}

body.sundex-transaction-system .stx-quick-assets {
  display: flex !important;
  min-height: 40px;
  align-items: center;
  gap: 7px !important;
}

body.sundex-transaction-system .stx-quick-label {
  margin-right: 4px;
  color: var(--tx-dim);
  font-size: 11px;
}

body.sundex-transaction-system .stx-quick-assets > button {
  min-width: 58px;
  min-height: 40px !important;
  justify-content: center;
  border: 1px solid var(--tx-line) !important;
  border-radius: 12px !important;
  background: var(--tx-panel-raised) !important;
  box-shadow: none !important;
}

body.sundex-transaction-system .stx-quick-assets > button[aria-pressed="true"] {
  border-color: rgba(194, 214, 239, 0.46) !important;
}

body.sundex-transaction-system .stx-quick-overflow {
  display: none !important;
}

/* Dark material CTA: same vocabulary as the header controls. */
body.sundex-transaction-system .stx-stage button.w-full.rounded-full,
body.sundex-transaction-system .stx-stage button.w-full.py-3,
body.sundex-transaction-system .stx-order-form > button:last-of-type,
body.sundex-transaction-system .stx-swap-ticket > button:not(.stx-quick-assets button) {
  min-height: 52px !important;
  border: 1px solid transparent !important;
  border-radius: 15px !important;
  color: var(--tx-ink) !important;
  background:
    linear-gradient(180deg, #0d131b, #070b10) padding-box,
    linear-gradient(130deg, #aebdce, #313b47 36%, #77879a 70%, #c4d1df) border-box !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055), 0 10px 26px rgba(0, 0, 0, 0.22) !important;
  font-size: 14px !important;
  font-weight: 620 !important;
}

body.sundex-transaction-system button:disabled {
  border-color: var(--tx-line) !important;
  color: rgba(214, 222, 232, 0.38) !important;
  background: #0b1017 !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.02) !important;
  opacity: 1 !important;
}

body.sundex-product-surface.sundex-transaction-system .stx-stage button:disabled {
  justify-content: center !important;
  padding: 0 18px !important;
  border-color: var(--tx-line) !important;
  color: rgba(214, 222, 232, 0.38) !important;
  background: #0b1017 !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.02) !important;
}

body.sundex-transaction-system .stx-disabled-reason {
  margin: -1px 0 0;
  color: var(--tx-dim);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

body.sundex-transaction-system :where(button, a):focus-visible {
  outline: 2px solid rgba(219, 231, 246, 0.82) !important;
  outline-offset: 3px !important;
}

body.sundex-product-surface.sundex-transaction-system .stx-stage :where(input, select, textarea):focus-visible {
  outline: 2px solid transparent !important;
  border-color: rgba(194, 214, 239, 0.34) !important;
  box-shadow: 0 0 0 2px rgba(160, 185, 216, 0.12), inset 0 1px rgba(255, 255, 255, 0.025) !important;
}

/* Swap uses the same compact split without an additional page card. */
body.stx-swap-route .stx-swap-main {
  width: min(1120px, 100%);
  margin-inline: auto;
}

body.stx-swap-route .sundex-swap-page-head {
  width: min(760px, calc(100% - 360px));
  margin: 0 0 10px auto;
}

body.stx-swap-route .stx-swap-layout {
  display: grid !important;
  min-height: 520px;
  grid-template-columns: minmax(400px, 2fr) minmax(620px, 3fr);
  align-items: stretch !important;
  justify-content: stretch !important;
  gap: 20px;
  padding: 0 !important;
}

body.stx-swap-route .stx-swap-layout > .stx-context {
  grid-area: auto;
  grid-column: 1;
  grid-row: 1;
  min-height: 520px;
}

body.stx-swap-route .stx-swap-ticket {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 28px !important;
  border: 1px solid var(--tx-line-strong) !important;
  border-radius: 28px !important;
  background: linear-gradient(145deg, #080d14, #05080c 72%) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.035) !important;
  clip-path: none !important;
}

body.stx-swap-route .stx-swap-ticket > .rounded-2xl {
  padding: 18px !important;
  border: 1px solid var(--tx-line) !important;
  border-radius: 18px !important;
  background: var(--tx-field) !important;
  box-shadow: none !important;
}

body.stx-swap-route .stx-swap-ticket .uppercase {
  font-size: 12px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Dialogs keep the product vocabulary, without the theatrical frame. */
body.sundex-product-surface .stx-dialog,
body.sundex-transaction-system .stx-dialog {
  max-width: min(720px, calc(100vw - 28px)) !important;
  border: 1px solid var(--tx-line-strong) !important;
  border-radius: 24px !important;
  color: var(--tx-text) !important;
  background: #070b10 !important;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.58), inset 0 1px rgba(255, 255, 255, 0.035) !important;
}

@media (hover: hover) and (pointer: fine) {
  body.sundex-transaction-system .buy-sell-option:hover,
  body.sundex-transaction-system .stx-stage button.group:hover {
    border-color: rgba(197, 211, 229, 0.22) !important;
    background: #0d131b !important;
    transform: translateY(-1px);
  }

  body.sundex-transaction-system .stx-stage button:not(:disabled):hover,
  body.sundex-transaction-system .stx-head > button:hover {
    filter: brightness(1.08);
  }
}

body.sundex-transaction-system button:active,
body.sundex-transaction-system a:active {
  transform: scale(0.985);
}

@media (max-width: 980px) {
  body.sundex-transaction-system .platform-main {
    padding: 20px 16px 44px !important;
  }

  body.sundex-transaction-system .stx-shell,
  body.stx-swap-route .stx-swap-layout {
    width: min(720px, 100%) !important;
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "head" "progress" "stage";
    gap: 0;
  }

  body.sundex-transaction-system .stx-context {
    display: none !important;
  }

  body.sundex-transaction-system .stx-ticket-frame {
    grid-column: 1;
    grid-row: 1 / 4;
    min-height: 0;
    border-radius: 24px;
  }

  body.stx-swap-route .sundex-swap-page-head {
    width: min(720px, 100%);
    margin: 0 auto 10px;
  }

  body.stx-swap-route .stx-swap-layout {
    display: block !important;
    min-height: 0 !important;
  }

  body.stx-swap-route .stx-swap-ticket {
    padding: 26px !important;
    border-radius: 24px !important;
  }
}

@media (max-width: 620px) {
  body.sundex-transaction-system .platform-main {
    padding: 10px 8px 28px !important;
  }

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

  body.sundex-transaction-system .stx-head {
    min-height: 62px;
    padding: 15px 16px 8px !important;
  }

  body.sundex-transaction-system .stx-head h1 {
    font-size: 19px !important;
  }

  body.sundex-transaction-system .stx-step-meta {
    margin-left: auto;
    font-size: 11px;
  }

  body.sundex-transaction-system .stx-head + div:has(> .stx-progress) {
    padding: 0 16px 10px !important;
  }

  body.sundex-transaction-system .stx-progress {
    padding: 0 16px 10px !important;
  }

  body.sundex-transaction-system div:has(> .stx-progress) > .stx-progress {
    padding: 0 !important;
  }

  body.sundex-transaction-system .stx-progress > div > span {
    font-size: 9px !important;
  }

  body.sundex-transaction-system .stx-stage > div {
    padding: 12px 16px 26px !important;
  }

  body.sundex-transaction-system .buy-sell-options {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sundex-transaction-system .stx-quick-label {
    width: 100%;
  }

  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,
  body.stx-swap-route .stx-swap-ticket > button {
    position: sticky;
    z-index: 5;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  body.stx-swap-route .stx-swap-ticket {
    padding: 20px 16px 88px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sundex-transaction-system *,
  body.sundex-transaction-system *::before,
  body.sundex-transaction-system *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
