.swap-page {
  min-width: 320px;
  background: var(--white);
}

.swap-page button,
.swap-page input {
  font-family: var(--text);
}

.wallet-connect {
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.wallet-connect.is-connected {
  border: 1px solid var(--paper-rule);
  background: var(--white);
  color: var(--ink);
}

.swap-hero {
  display: grid;
  min-height: 420px;
  place-items: center;
  padding: 96px 24px 104px;
  background: var(--white);
  text-align: center;
}

.swap-hero__copy {
  max-width: 850px;
}

.swap-hero h1 {
  margin: 0;
  padding-top: 8px;
  color: var(--black);
  font-family: var(--display);
  font-size: 80px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.swap-hero .hero__intro {
  max-width: 580px;
  color: var(--ink);
}

.swap-surface {
  background: linear-gradient(to bottom, var(--white), var(--paper));
  color: var(--ink);
}

.swap-surface .closing,
.swap-workspace {
  background: transparent;
}

.swap-page .footer {
  background: var(--paper);
}

.swap-workspace {
  padding: 120px 0;
}

.swap-workspace__inner {
  width: 87.5%;
  max-width: 1050px;
  margin: 0 auto;
}

.swap-workspace__title {
  margin: 0 0 48px;
  font-family: var(--display);
  font-size: 56px;
  font-weight: 600;
  line-height: 1.0714285714;
  letter-spacing: -0.005em;
}

.swap-workspace__grid {
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(240px, 1fr);
  align-items: start;
  gap: 80px;
}

.swap-stats {
  display: grid;
  gap: 40px;
  margin: 40px 0 0;
}

.swap-stats dt,
.swap-stats dd span {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2857742857;
  letter-spacing: -0.016em;
}

.swap-stats dd {
  margin: 6px 0 0;
}

.swap-stats strong {
  display: block;
  min-height: 1em;
  font-family: var(--display);
  font-size: 40px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.swap-stats dd span {
  display: block;
  margin-top: 6px;
}

.swap-card {
  min-width: 0;
  padding: 40px;
  border-radius: 28px;
  background: var(--paper);
}

.swap-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.swap-card__heading h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1428571429;
  letter-spacing: 0.007em;
}

.swap-card__heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4285914286;
  letter-spacing: -0.016em;
}

.slippage-control {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 4px;
  padding-inline-start: 16px;
  border: 1px solid var(--paper-rule);
  border-radius: 980px;
  background: var(--white);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2857742857;
  letter-spacing: -0.016em;
}

.token-fields {
  position: relative;
  display: grid;
  margin-top: 28px;
  gap: 8px;
}

.token-field {
  min-width: 0;
  padding: 20px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--white);
  transition: border-color 160ms ease, background 160ms ease;
}

.token-field:focus-within {
  border-color: var(--paper-rule);
  background: var(--white);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.token-field__label-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.token-field__label-row label {
  color: var(--ink);
  font-weight: 600;
}

.token-field__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.token-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}

.token-field input::placeholder {
  color: #b7b7bc;
  opacity: 1;
}

.token-field input[readonly] {
  cursor: default;
}

.token-field input[aria-invalid="true"] {
  color: var(--red);
}

.beui-dropdown {
  position: relative;
}

.beui-dropdown__trigger {
  border: 0;
  outline: 0;
  color: var(--ink);
  cursor: pointer;
}

.beui-dropdown__trigger:focus-visible {
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--ink);
}

.beui-dropdown__trigger[data-beui-pointer-focus]:focus-visible {
  box-shadow: none;
}

.beui-dropdown__trigger svg {
  width: 16px;
  height: 16px;
  color: var(--muted-dark);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

/* Apple pop-up button menu: translucent material, leading checkmark, 17px labels. */
.beui-dropdown__menu {
  position: absolute;
  z-index: 30;
  display: grid;
  gap: 0;
  padding: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  background: rgba(250, 250, 252, 0.8);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.06);
  transform-origin: top right;
}

.beui-dropdown__menu[data-state="open"] {
  animation: beui-dropdown-enter 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.beui-dropdown__menu[data-state="closed"] {
  pointer-events: none;
  animation: beui-dropdown-exit 180ms cubic-bezier(0.4, 0, 1, 1) both;
}

.beui-dropdown__menu[hidden] {
  display: none;
}

.beui-dropdown__highlight {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: width 180ms cubic-bezier(0.16, 1, 0.3, 1), height 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 100ms linear;
}

.beui-dropdown__menu [data-dropdown-item] {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border: 0;
  border-radius: 12px;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2353641176;
  letter-spacing: -0.022em;
  text-align: left;
  cursor: default;
}

.beui-dropdown__menu [data-dropdown-item]:focus-visible {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.token-selector {
  display: grid;
  grid-template-columns: 36px minmax(52px, 1fr) 16px;
  align-items: center;
  width: 164px;
  min-height: 58px;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: var(--white);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.016em;
}

.token-selector > span {
  text-align: center;
}

.token-selector img,
.token-dropdown__menu img,
.pool-row__logos img {
  border-radius: 50%;
  object-fit: cover;
}

.token-dropdown__menu {
  top: calc(100% + 8px);
  right: 0;
  width: 212px;
}

.token-dropdown__menu [data-dropdown-item] {
  grid-template-columns: 16px 32px minmax(0, 1fr);
  gap: 10px;
  min-height: 48px;
  font-weight: 400;
}

.dropdown-check {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  opacity: 0;
}

[data-dropdown-item][aria-selected="true"] .dropdown-check {
  opacity: 1;
}

[data-dropdown-item][aria-selected="true"] > span {
  font-weight: 600;
}

.slippage-trigger {
  display: inline-grid;
  grid-template-columns: auto 16px;
  align-items: center;
  min-height: 46px;
  gap: 4px;
  padding: 0 14px 0 4px;
  border-radius: 980px;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2353641176;
  letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
}

.slippage-menu {
  top: calc(100% + 8px);
  right: 0;
  width: 168px;
}

@keyframes beui-dropdown-enter {
  from { opacity: 0; clip-path: inset(0 0 92% 92% round 18px); transform: scale(0.96); }
  to { opacity: 1; clip-path: inset(0 round 18px); transform: scale(1); }
}

@keyframes beui-dropdown-exit {
  from { opacity: 1; clip-path: inset(0 round 18px); transform: scale(1); }
  to { opacity: 0; clip-path: inset(0 0 92% 92% round 18px); transform: scale(0.96); }
}

/* SF Symbols arrow.up.arrow.down on a white control that bridges both fields. */
.reverse-pair {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 56px;
  height: 56px;
  padding: 0;
  place-items: center;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--white);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  color: var(--ink);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background 150ms ease;
}

.reverse-pair:active {
  background: #e8e8ed;
}

.reverse-pair:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.reverse-pair svg {
  width: 24px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reverse-pair.is-flipped svg {
  transform: rotate(180deg);
}

.quote-details {
  display: grid;
  margin: 26px 2px 0;
  gap: 10px;
}

.quote-details > div,
.route-details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.quote-details dt,
.quote-details dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.quote-details dd {
  color: var(--ink);
  text-align: end;
}

.swap-action {
  width: 100%;
  min-height: 58px;
  margin-top: 28px;
  padding: 14px 22px;
  border: 0;
  border-radius: 980px;
  background: var(--blue);
  color: var(--white);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.1764805882;
  letter-spacing: -0.022em;
  cursor: pointer;
}

.swap-action:disabled {
  background: #b7d8f8;
  cursor: wait;
}

.swap-status,
.swap-transaction,
.approval-note,
.noscript-note {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: -0.006em;
  text-align: center;
}

.swap-status[data-tone="success"] {
  color: var(--green);
}

.swap-status[data-tone="error"] {
  color: var(--red);
}

.swap-status[data-tone="pending"] {
  color: #9a6700;
}

.swap-transaction a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.approval-note {
  padding-top: 14px;
  border-top: 1px solid var(--paper-rule);
}

.pool-details__inner {
  width: 87.5%;
  max-width: 1050px;
  margin: 0 auto;
}

.pool-details__heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  text-wrap: balance;
}

/* Pool details: a paper section directly below the hero. */

.pool-details {
  position: relative;
  padding: 112px 0 96px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

.pool-details__heading {
  display: flex;
  align-items: last baseline;
  justify-content: space-between;
  gap: 24px 48px;
  padding-bottom: 48px;
}

.pool-details__heading h2 {
  font-size: 56px;
  line-height: 1.0714285714;
  letter-spacing: -0.005em;
}

.pool-details__links {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 0 28px;
}

.pool-details__links a,
.pool-sentence__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 3px;
  color: var(--link);
  font-size: 17px;
  line-height: 1.2353641176;
  letter-spacing: -0.022em;
}

.pool-logos {
  display: inline-flex;
  flex: none;
  vertical-align: middle;
}

.pool-logos img {
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--white);
  object-fit: cover;
}

/* Pool highlights gallery, after the iPhone Duo "Get the highlights" cards. */

.pool-highlights__track {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0 max(6.25%, calc((100% - 1050px) / 2));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  list-style: none;
  scroll-padding-inline: max(6.25%, calc((100% - 1050px) / 2));
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.pool-highlights__track::-webkit-scrollbar {
  display: none;
}

.pool-highlights__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 40px;
}

.pool-dotnav {
  display: flex;
  align-items: center;
  height: 56px;
  margin: 0;
  padding: 0 16px;
  border-radius: 28px;
  background: #e8e8ed;
  list-style: none;
}

.pool-dotnav li {
  display: flex;
}

.pool-dotnav__dot {
  display: grid;
  height: 44px;
  padding: 0 8px;
  place-items: center;
  border: 0;
  border-radius: 22px;
  background: transparent;
  cursor: pointer;
}

.pool-dotnav__progress {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  transition: width 250ms ease, background 250ms linear;
}

.pool-dotnav__dot[aria-current="true"] .pool-dotnav__progress {
  width: 36px;
}

.pool-dotnav__progress::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: #29292a;
  content: "";
}

.pool-dotnav__dot[aria-current="true"] .pool-dotnav__progress::after {
  width: 100%;
}

.pool-highlights.is-playing .pool-dotnav__dot[aria-current="true"] .pool-dotnav__progress::after {
  animation: pool-highlight-progress 5s linear forwards;
}

@keyframes pool-highlight-progress {
  from { width: 0; }
  to { width: 100%; }
}

.pool-dotnav__dot:focus-visible,
.pool-highlights__play:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.pool-highlights__play {
  display: grid;
  width: 56px;
  height: 56px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e8e8ed;
  color: var(--ink);
  cursor: pointer;
  transition: background 100ms linear;
}

.pool-highlights__play svg {
  width: 56px;
  height: 56px;
  fill: currentColor;
}

.pool-highlights__play[data-state="paused"] .pool-highlights__icon-pause,
.pool-highlights__play[data-state="playing"] .pool-highlights__icon-play {
  display: none;
}

/* Pool cards: one sentence caption, large logos, and an Add liquidity link. */

.pool-sentence {
  position: relative;
  display: flex;
  flex: 0 0 100%;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 600px;
  padding: 56px 48px 48px;
  border-radius: 28px;
  background: var(--white);
  scroll-snap-align: start;
  text-align: center;
}

.pool-sentence h3 {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1428571429;
  letter-spacing: 0.007em;
  text-wrap: balance;
}

.pool-sentence h3 span {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pool-sentence > .pool-logos {
  display: flex;
  flex: 1;
  align-items: center;
  padding: 40px 0;
}

.pool-sentence .pool-logos img {
  width: 200px;
  height: 200px;
  border-width: 6px;
}

.pool-sentence .pool-logos img + img {
  margin-left: -44px;
}

.pool-sentence__meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.381002381;
  letter-spacing: 0.011em;
}

.pool-sentence__meta strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pool-sentence__link {
  margin-top: 8px;
}

@media (hover: hover) {
  .pool-dotnav__dot:hover .pool-dotnav__progress {
    background: rgba(0, 0, 0, 0.64);
  }

  .pool-highlights__play:hover {
    background: #dcdce1;
  }

  .pool-details__links a:hover,
  .pool-sentence__link:hover,
  .swap-transaction a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .swap-action:hover:not(:disabled) {
    background: var(--blue-hover);
  }

  .reverse-pair:hover {
    background: var(--paper-light);
  }

  .token-field:hover {
    background: var(--paper-light);
  }

  .token-field:focus-within:hover {
    background: var(--white);
  }
}

@media (min-width: 834px) {
  .swap-page .site-header__inner {
    grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
  }

  .swap-page .site-header__buy {
    justify-self: end;
  }
}

@media (max-width: 1068px) {
  .swap-hero h1 {
    font-size: 64px;
    line-height: 1.0625;
    letter-spacing: -0.009em;
  }

  .swap-workspace {
    padding-top: 96px;
    padding-bottom: 96px;
  }

  .swap-workspace__title {
    font-size: 48px;
    line-height: 1.0834933333;
    letter-spacing: -0.003em;
  }

  .swap-workspace__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }

  .swap-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin-top: 0;
  }

  .pool-details {
    padding-top: 96px;
    padding-bottom: 96px;
  }

  .pool-details__heading h2 {
    font-size: 48px;
    line-height: 1.0834933333;
    letter-spacing: -0.003em;
  }
}

@media (max-width: 833px) {
  .swap-hero {
    min-height: 340px;
    padding: 72px 20px 80px;
  }

  .swap-hero h1 {
    padding-top: 6px;
    font-size: 48px;
    line-height: 1.0834933333;
    letter-spacing: -0.003em;
  }

  .swap-workspace {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .swap-workspace__inner {
    width: calc(100% - 24px);
  }

  .swap-workspace__title {
    margin: 0 0 32px;
    padding: 0 calc(6.25vw - 12px);
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: 0;
  }

  .swap-stats {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0 calc(6.25vw - 12px);
  }

  .swap-stats strong {
    font-size: 32px;
    line-height: 1.125;
  }

  .swap-card {
    padding: 32px;
  }

  .token-selector {
    width: 156px;
  }

  .token-field input {
    font-size: 38px;
  }

  .pool-details {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .pool-details__heading {
    display: block;
    padding-bottom: 32px;
  }

  .pool-details__heading h2 {
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: 0;
  }

  .pool-details__links {
    margin-top: 12px;
  }

  .pool-highlights__controls {
    margin-top: 28px;
  }

  .pool-sentence {
    min-height: 0;
    padding: 48px 24px 40px;
  }

  .pool-sentence h3 {
    font-size: 24px;
    line-height: 1.1666666667;
    letter-spacing: 0.009em;
  }

  .pool-sentence .pool-logos img {
    width: 120px;
    height: 120px;
    border-width: 4px;
  }

  .pool-sentence .pool-logos img + img {
    margin-left: -28px;
  }
}

@media (max-width: 430px) {
  .wallet-connect {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .swap-card {
    padding: 20px;
  }

  .swap-card__heading {
    align-items: center;
  }

  .slippage-control > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .slippage-control {
    padding-inline-start: 4px;
  }

  .token-field {
    padding: 18px 16px;
  }

  .token-field__label-row {
    font-size: 12px;
  }

  .token-field__main {
    gap: 10px;
  }

  .token-field input {
    font-size: clamp(32px, 9vw, 36px);
  }

  .token-selector {
    grid-template-columns: 32px minmax(44px, 1fr) 16px;
    width: 142px;
    min-height: 54px;
    gap: 6px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .token-selector img {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .swap-page *,
  .swap-page *::before,
  .swap-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .beui-dropdown__menu[data-state] {
    animation-duration: 1ms;
    clip-path: none;
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .beui-dropdown__menu {
    background: var(--white);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .pool-dotnav__progress::after {
    background: CanvasText;
    forced-color-adjust: none;
  }

  .swap-card,
  .token-field,
  .pool-sentence,
  .beui-dropdown__menu {
    border: 1px solid CanvasText;
  }
}
