:root {
  --sps-exchange-bg: #03060a;
  --sps-exchange-line: rgba(190, 204, 223, 0.13);
  --sps-exchange-muted: rgba(202, 212, 228, 0.62);
}

.sundex-card-story + .sps-trade-stage.sps-exchange-stage {
  margin-top: -1px;
}

.sps-trade-stage.sps-exchange-stage {
  min-height: 0;
  overflow: hidden;
  background: var(--sps-exchange-bg);
}

.sps-trade-stage.sps-exchange-stage::before {
  z-index: 1;
  background:
    linear-gradient(180deg, #03060a 0, transparent 12%, transparent 88%, #03060a 100%);
}

.sps-exchange-shell {
  position: relative;
  display: grid;
  width: min(100%, 1780px);
  height: clamp(590px, 45vw, 680px);
  grid-template-columns: 39.5% 60.5%;
  margin: 0 auto;
  overflow: hidden;
  background: #03060a;
}

.sps-exchange-visual {
  position: absolute;
  z-index: 0;
  inset: 0 60.5% 0 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

.sps-exchange-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 32% center;
  filter: saturate(0.3) brightness(0.5) contrast(1.2);
  transform: scale(1.02);
}

.sps-exchange-visual span {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 6, 10, 0.46) 0%, rgba(3, 6, 10, 0.12) 48%, #03060a 100%),
    linear-gradient(180deg, #03060a 0%, transparent 22%, transparent 76%, #03060a 100%);
}

.sps-exchange-copy {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(100%, 500px);
  align-self: center;
  flex-direction: column;
  align-items: flex-start;
  margin-left: clamp(42px, 5vw, 92px);
}

.sps-section .sps-exchange-copy h2 {
  max-width: 610px;
  margin: 0;
  font-size: clamp(3.8rem, 5.25vw, 6.15rem);
  font-weight: 590;
  letter-spacing: -0.055em;
  line-height: 0.91;
  text-wrap: balance;
}

.sps-exchange-copy p {
  max-width: 21rem;
  margin: 26px 0 0;
  color: rgba(213, 221, 233, 0.72);
  font-size: 1.08rem;
  line-height: 1.46;
}

.sps-exchange-copy > a.scc-card-cta {
  min-width: 160px;
  min-height: 48px;
  justify-content: center;
  margin-top: 28px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 590;
  letter-spacing: -0.012em;
}

.sps-exchange-panel {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100%, 920px);
  align-self: center;
  justify-self: center;
  padding: 0 clamp(30px, 2.5vw, 48px);
  border: 0;
  border-radius: 0;
  color: var(--sps-ink);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sps-exchange-panel::after {
  content: none;
}

.sps-exchange-row {
  display: grid;
  min-width: 0;
  min-height: 146px;
  grid-template-columns: minmax(250px, 0.82fr) minmax(300px, 1.18fr);
  align-items: center;
  gap: clamp(28px, 2.5vw, 46px);
}

.sps-exchange-asset {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 64px minmax(0, auto) auto 18px;
  align-items: center;
  gap: 13px;
  padding: 10px 0;
}

.sps-exchange-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: rgba(230, 235, 243, 0.78);
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
  font-weight: 650;
}

.sps-exchange-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sps-exchange-mark-fiat {
  width: 64px;
  height: 64px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: rgba(230, 235, 243, 0.78);
  background: none;
  box-shadow: none;
  font-size: clamp(2.75rem, 3.15vw, 3.7rem);
  font-weight: 470;
  letter-spacing: -0.055em;
  line-height: 0.82;
  transform: translateY(-0.08em);
}

.sps-exchange-name {
  overflow: hidden;
  color: #f2f5f9;
  font-size: 1.14rem;
  font-weight: 590;
  letter-spacing: -0.018em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sps-exchange-code {
  color: rgba(198, 208, 223, 0.54);
  font-size: 0.82rem;
  font-weight: 560;
  white-space: nowrap;
}

.sps-exchange-chevron {
  color: rgba(217, 227, 241, 0.56);
  font-size: 1rem;
  transform: translateY(-2px);
}

.sps-exchange-asset select {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.sps-exchange-asset:focus-within {
  outline: 0;
  box-shadow: inset 0 -1px 0 rgba(211, 224, 243, 0.82);
}

.sps-exchange-amount {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
}

.sps-exchange-amount input,
.sps-exchange-output {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 0;
  color: #f4f6fa;
  background: transparent;
  font: inherit;
  font-size: clamp(3.8rem, 4.7vw, 5.6rem);
  font-weight: 430;
  letter-spacing: -0.062em;
  line-height: 0.92;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sps-exchange-amount input {
  padding: 8px 0;
  outline: 0;
  caret-color: #d8e6f9;
  appearance: textfield;
  -moz-appearance: textfield;
}

.sps-exchange-amount input::-webkit-outer-spin-button,
.sps-exchange-amount input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.sps-exchange-amount:focus-within {
  box-shadow: inset 0 -1px 0 rgba(213, 227, 246, 0.68);
}

.sps-exchange-output {
  display: block;
  align-self: center;
  font-variant-numeric: tabular-nums;
}

.sps-exchange-amount input[data-number-length="long"],
.sps-exchange-output[data-number-length="long"] {
  font-size: clamp(3.35rem, 4.05vw, 4.85rem);
}

.sps-exchange-amount input[data-number-length="extended"],
.sps-exchange-output[data-number-length="extended"] {
  font-size: clamp(2.8rem, 3.45vw, 4.05rem);
}

.sps-exchange-divider {
  position: relative;
  height: 1px;
  margin: 0;
  background: linear-gradient(90deg, transparent 0, var(--sps-exchange-line) 14%, var(--sps-exchange-line) 86%, transparent 100%);
}

.sps-exchange-swap {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(210, 222, 238, 0.28);
  border-radius: 50%;
  color: #edf3fb;
  background: rgba(7, 11, 17, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8),
    0 10px 28px rgba(0, 0, 0, 0.34);
  font: inherit;
  font-size: 1rem;
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: filter 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
  -webkit-tap-highlight-color: transparent;
}

.sps-exchange-swap-glyph {
  display: flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
}

.sps-exchange-swap-glyph span:first-child {
  transform: translateY(1px);
}

.sps-exchange-swap-glyph span:last-child {
  transform: translateY(-1px);
}

.sps-exchange-swap:focus-visible,
.sps-exchange-submit:focus-visible {
  outline: 2px solid rgba(208, 226, 250, 0.98);
  outline-offset: 4px;
}

.sps-exchange-meta {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-top: 30px;
  color: rgba(194, 207, 225, 0.58);
  font-size: 0.82rem;
}

.sps-exchange-meta span + span {
  padding-left: 34px;
  border-left: 1px solid var(--sps-exchange-line);
}

.sps-exchange-meta strong {
  color: rgba(230, 236, 245, 0.84);
  font-weight: 560;
}

.sps-exchange-submit {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  padding: 0 28px;
  border: 1px solid rgba(241, 246, 252, 0.68);
  border-radius: 14px;
  color: #f5f7fb;
  background: rgba(3, 6, 10, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 28px rgba(0, 0, 0, 0.18);
  font: inherit;
  font-size: 1rem;
  font-weight: 560;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
  -webkit-tap-highlight-color: transparent;
}

.sps-exchange-note {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.sps-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

@media (hover: hover) and (pointer: fine) {
  .sps-exchange-asset:hover .sps-exchange-chevron {
    color: rgba(242, 247, 252, 0.92);
  }

  .sps-exchange-swap:hover {
    border-color: rgba(226, 236, 249, 0.52);
    filter: brightness(1.08);
  }

  .sps-exchange-swap:active {
    transform: translate(-50%, -50%) scale(0.96);
  }

  .sps-exchange-submit:hover {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.055);
  }

  .sps-exchange-submit:active {
    transform: scale(0.98);
  }
}

@media (max-width: 1040px) {
  .sps-exchange-shell {
    grid-template-columns: 37% 63%;
  }

  .sps-exchange-visual {
    right: 63%;
  }

  .sps-exchange-panel {
    padding-inline: 34px;
  }

  .sps-exchange-row {
    grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.86fr);
    gap: 18px;
  }

  .sps-exchange-asset {
    grid-template-columns: 54px minmax(0, auto) auto 16px;
  }

  .sps-exchange-mark,
  .sps-exchange-mark-fiat {
    width: 54px;
    height: 54px;
  }

  .sps-exchange-amount input,
  .sps-exchange-output {
    font-size: clamp(3rem, 5.2vw, 4.2rem);
  }
}

@media (max-width: 800px) {
  .sps-exchange-shell {
    height: auto;
    grid-template-columns: 1fr;
  }

  .sps-exchange-visual {
    inset: 0 0 auto;
    height: 390px;
  }

  .sps-exchange-visual img {
    object-position: 32% center;
  }

  .sps-exchange-visual span {
    background:
      linear-gradient(180deg, rgba(3, 6, 10, 0.22), rgba(3, 6, 10, 0.18) 48%, #03060a 100%),
      linear-gradient(90deg, rgba(3, 6, 10, 0.38), rgba(3, 6, 10, 0.2));
  }

  .sps-exchange-copy {
    min-height: 390px;
    align-self: auto;
    justify-content: center;
    margin: 0;
    padding: 64px 28px 48px;
  }

  .sps-section .sps-exchange-copy h2 {
    font-size: clamp(3.6rem, 12vw, 5rem);
  }

  .sps-exchange-panel {
    width: 100%;
    padding: 40px 28px 70px;
  }
}

@media (max-width: 560px) {
  .sps-exchange-visual,
  .sps-exchange-copy {
    min-height: 340px;
    height: 340px;
  }

  .sps-exchange-copy {
    padding-inline: 20px;
  }

  .sps-section .sps-exchange-copy h2 {
    font-size: clamp(3.15rem, 16vw, 4.35rem);
  }

  .sps-exchange-copy p {
    margin-top: 18px;
    font-size: 0.94rem;
  }

  .sps-exchange-copy > a.scc-card-cta {
    margin-top: 18px;
  }

  .sps-exchange-panel {
    padding: 32px 20px 58px;
  }

  .sps-exchange-row {
    min-height: 148px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 10px;
  }

  .sps-exchange-asset {
    grid-template-columns: 48px minmax(0, auto) auto 16px;
  }

  .sps-exchange-mark,
  .sps-exchange-mark-fiat {
    width: 48px;
    height: 48px;
  }

  .sps-exchange-mark-fiat {
    font-size: 2.5rem;
  }

  .sps-exchange-amount,
  .sps-exchange-output {
    justify-content: flex-start;
    text-align: left;
  }

  .sps-exchange-amount input,
  .sps-exchange-output {
    font-size: clamp(3rem, 14vw, 4rem);
    text-align: left;
  }

  .sps-exchange-swap {
    width: 50px;
    height: 50px;
  }

  .sps-exchange-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
  }

  .sps-exchange-meta span + span {
    padding-left: 0;
    border-left: 0;
  }

  .sps-exchange-submit {
    min-height: 56px;
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sps-exchange-swap,
  .sps-exchange-submit {
    transition-duration: 0.01ms !important;
  }
}
