/* Shared by the landing form and the exchange workspace. */
.exchange-screen .swap-shell {
  --well-send: #242425;
  --well-line: #414143;
  --figure: #f6f4ef;
  --result: #fff8ef;
  --flip-face: #333436;
  --flip-hover: #414245;
  --flip-ink: #f6f4ef;
  --surface-edge: #373737;
  container: swap-window / inline-size;
  isolation: isolate;
  border: 1px solid var(--surface-edge);
  border-radius: 22px;
  background: var(--trade-panel);
  box-shadow: 0 18px 44px -32px #0009;
}
[data-theme=light] .exchange-screen .swap-shell {
  --well-send: #f0efec;
  --well-line: #d3d0ca;
  --figure: #191919;
  --result: #191817;
  --flip-face: #fffefa;
  --flip-hover: #faf9f7;
  --flip-ink: #252525;
  --surface-edge: #d7d5d0;
}
.exchange-screen .swap-shell .swap-card {
  --inset: clamp(15px, 4.6cqi, 29px);
  padding: var(--inset) var(--inset) 4px;
}
.exchange-screen .swap-shell .swap-workspace-heading {
  margin: 0 0 clamp(15px, 4cqi, 24px);
  padding: 0;
  align-items: center;
  text-align: start;
}
.exchange-screen .swap-shell #swap-panel-heading {
  margin: 0;
  color: var(--figure);
  font: 510 clamp(27px, 6.2cqi, 35px)/1.06 var(--display);
  letter-spacing: -.047em;
}
.exchange-screen .swap-shell .card-heading p {
  margin: 6px 0 0;
  color: var(--trade-copy);
  font: 460 13px/1.4 var(--sans);
}
.swap-shell #btn-requote {
  flex: none;
  margin: 0;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: 0;
  border-radius: 11px;
  color: var(--ink);
  background: var(--well-send);
}
.exchange-screen .swap-shell .amount-shell {
  position: relative;
  border: 0;
  border-radius: 16px 16px 0 0;
  background: var(--well-send);
  box-shadow: none;
}
.exchange-screen .swap-shell .receive-shell { border-radius: 0 0 16px 16px; }
.exchange-screen .swap-shell .amount-shell:has(#send-amount:focus-visible) {
  box-shadow: inset 3px 0 var(--trade-accent-text);
}
.exchange-screen .swap-shell .amount-block {
  padding: clamp(11px, 2.8cqi, 17px) clamp(13px, 3.8cqi, 23px) clamp(16px, 3.8cqi, 24px);
}
.exchange-screen .swap-shell .amount-top {
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
}
.exchange-screen .swap-shell .amount-top > .caption {
  color: var(--trade-copy);
  font: 510 14px/1.35 var(--sans);
  letter-spacing: -.01em;
}
.exchange-screen .swap-shell .amount-mid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(6px, 2cqi, 12px);
  margin: 9px 0 0;
}
.swap-shell .amount-value { container-type: inline-size; }
.exchange-screen .swap-shell :is(#send-amount, #recv-amount) {
  display: block;
  margin: 0;
  padding: 0 0 .045em;
  width: 100%;
  min-width: 0;
  height: auto;
  text-align: start;
  color: var(--figure);
  font: 555 clamp(25px, 28cqi, 62px)/1.10 var(--display);
  letter-spacing: -.044em;
  font-variant-numeric: tabular-nums;
  background: transparent;
}
.exchange-screen .swap-shell #recv-amount {
  color: var(--result);
  min-block-size: calc(clamp(25px, 28cqi, 62px) * 1.145);
  align-content: center;
  font-size: clamp(16px, min(28cqi, 158cqi / var(--figure-chars, 6)), 62px);
  overflow-wrap: anywhere;
}
.exchange-screen .swap-shell .asset-picker {
  --coin-size: 38px;
  --coin-gap: 10px;
  --coin-type: 23px;
  --coin-text-width: 60px;
  --chain-size: 14px;
  --chain-type: 13px;
  --chevron-size: 22px;
  display: grid;
  grid-template-columns: var(--coin-size) var(--coin-text-width) var(--chevron-size);
  align-items: center;
  justify-self: end;
  gap: var(--coin-gap);
  min-height: 48px;
  max-inline-size: none;
  padding: 2px 0;
  border: 0;
  border-radius: 4px;
  color: var(--figure);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.swap-shell .asset-picker .token-icon {
  display: block;
  width: var(--coin-size);
  height: var(--coin-size);
  border-radius: 50%;
}
.swap-shell .asset-picker :is(.token-icon,.token-info) { z-index: 3; }
.swap-shell .asset-picker .token-info {
  display: grid;
  justify-items: start;
  gap: 3px;
  text-align: start;
}
.swap-shell .asset-picker .token-ticker {
  font: 620 var(--coin-type)/1.04 var(--display);
  letter-spacing: -.028em;
  color: var(--figure);
}
.swap-shell .asset-picker .net-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--trade-copy);
  font: 490 var(--chain-type)/1.2 var(--sans);
  white-space: nowrap;
}
.swap-shell .asset-picker .coin-chain-icon {
  width: var(--chain-size);
  height: var(--chain-size);
  flex: none;
  border-radius: 50%;
}
.swap-shell .asset-picker .asset-picker-chevron {
  display: block;
  width: var(--chevron-size);
  height: var(--chevron-size);
  padding: 4px;
  border-radius: 50%;
  color: var(--trade-copy);
  background-color: transparent;
}
.exchange-screen .swap-shell .amount-bot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(30px, auto);
  align-items: center;
  gap: 6px;
  margin-block: 10px -6px;
}
.swap-shell .amount-bot[inert] { visibility: hidden; }
.swap-shell :is(.pct-row, .balance-value)[hidden] { display: none !important; }
.exchange-screen .swap-shell .balance-value {
  justify-self: start;
  max-inline-size: 100%;
  min-inline-size: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exchange-screen .swap-shell .pct-row { gap: 2px; }
.exchange-screen .swap-shell .pct-row > button { min-width: 30px; padding-inline: 4px; }
.exchange-screen .swap-shell .divider {
  --rail-inset: clamp(13px, 3.8cqi, 23px);
  position: relative;
  height: 16px;
  align-items: center;
  background: var(--well-send);
}
.exchange-screen .swap-shell .divider::before {
  content: "";
  position: absolute;
  inset-inline: var(--rail-inset);
  top: 50%;
  height: 1px;
  background: var(--well-line);
}
.exchange-screen .swap-shell .flip {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 4px solid var(--well-send);
  border-radius: 50%;
  background: var(--flip-face);
  color: var(--flip-ink);
  box-shadow: inset 0 0 0 1px var(--well-line);
  -webkit-tap-highlight-color: transparent;
}
.exchange-screen .swap-shell .flip svg { width: 20px; height: 20px; }
.exchange-screen .swap-shell :is(.flip, .asset-picker):focus-visible {
  outline: 2px solid var(--figure);
  outline-offset: 2px;
}
.swap-shell .custom-checkbox { pointer-events: none; }
.swap-shell .custom-recipient-field { margin: 4px 0 1px; }
.exchange-screen .swap-shell .custom-recipient-label {
  min-height: 43px;
  color: var(--trade-copy);
  font: 510 13px/1.4 var(--sans);
}
.exchange-screen .swap-shell #btn-swap {
  position: relative;
  overflow: hidden;
  margin: 3px 0 0;
  min-height: 52px;
  padding: 12px 44px;
  border-radius: 10px;
  font: 565 16px/1.25 var(--sans);
}
.exchange-screen .swap-shell #btn-swap::after { right: 18px; }
.swap-shell .swap-status-slot {
  display: grid;
  align-items: center;
  min-block-size: 1lh;
  margin-top: 6px;
  font: 12px/1.5 var(--sans);
  overflow-wrap: anywhere;
}
.exchange-screen .swap-shell #swap-legend { margin: 0; min-height: 0; font: inherit; }
.exchange-screen .swap-shell #fee-details { margin: 7px 0 0; border: 0; }
.exchange-screen .swap-shell #fee-details > summary {
  min-height: 44px;
  padding: 10px 0;
  color: var(--trade-copy);
  font: 540 13px/1.4 var(--sans);
}
.exchange-screen .swap-shell #fee-total-short { color: var(--figure); font-weight: 580; }
/* In the paired desktop layout the amount wells absorb the available height. */
@media (min-width: 761px) {
  #home-swap-slot,
  #home-swap-slot > .swap-shell {
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }
  #home-swap-slot > .swap-shell,
  #home-swap-slot .swap-card {
    flex: 1 0 auto;
  }
  #home-swap-slot .swap-card {
    display: flex;
    flex-direction: column;
    padding: clamp(20px, 4.8cqi, 32px) clamp(20px, 4.8cqi, 32px) 6px;
  }
  #home-swap-slot .swap-shell { border-radius: clamp(22px, 2vw, 32px); }
  #home-swap-slot .swap-workspace-heading { margin-bottom: clamp(15px, 4cqi, 24px); }
  #home-swap-slot .amount-shell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1 0 auto;
  }
  #home-swap-slot .amount-block { padding: 15px clamp(14px, 3.8cqi, 22px) 20px; }
  #home-swap-slot .custom-recipient-field { margin-block: 7px 4px; }
  #home-swap-slot .swap-shell #fee-details { margin-top: 8px; }
}
@container swap-window (max-width: 420px) {
  .swap-shell .swap-status-slot { min-block-size: 2lh; }
  .exchange-screen .swap-shell .asset-picker {
    --coin-size: 32px;
    --coin-gap: 7px;
    --coin-type: 20px;
    --coin-text-width: 53px;
    --chain-size: 12px;
    --chain-type: 12px;
    --chevron-size: 20px;
  }
}
@container swap-window (max-width: 315px) {
  .exchange-screen .swap-shell .asset-picker {
    --coin-size: 26px;
    --coin-gap: 5px;
    --coin-type: 17px;
    --coin-text-width: 47px;
    --chain-type: 11px;
    --chain-size: 11px;
    --chevron-size: 16px;
    min-height: 44px;
  }
  .swap-shell .asset-picker .asset-picker-chevron { padding: 2px; }
  .exchange-screen .swap-shell .amount-top { flex-wrap: wrap; gap: 0 6px; }
  .exchange-screen .swap-shell .amount-bot { grid-template-columns: minmax(0, 1fr); }
  .exchange-screen .swap-shell [data-block=send] .amount-bot { grid-template-rows: repeat(2, minmax(30px, auto)); }
  .exchange-screen .swap-shell .pct-row { justify-self: start; }
  .exchange-screen .swap-shell .balance-value { max-width: 100%; }
  .exchange-screen .swap-shell #btn-swap { padding-inline: 8px; }
  .exchange-screen .swap-shell #btn-swap::after { display: none; }
}
@container swap-window (max-width: 250px) {
  .swap-shell .swap-status-slot { min-block-size: 3lh; }
  .exchange-screen .swap-shell #fee-details > summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 6px;
  }
  .swap-shell #fee-total-short { grid-column: 1; min-block-size: 1lh; }
  .swap-shell #fee-details .summary-chevron { grid-area: 1 / 2 / 3; }
  .swap-shell #fee-details .detail-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    text-align: start;
  }
  .exchange-screen .swap-shell .amount-mid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .exchange-screen .swap-shell .asset-picker { justify-self: start; }
}
@media (hover: hover) {
  .swap-shell #btn-requote:hover:not(:disabled) { outline: 1px solid var(--trade-secondary); outline-offset: -1px; }
  .exchange-screen .swap-shell .asset-picker:hover:not(:disabled) {
    color: var(--figure);
    background: transparent;
    box-shadow: none;
  }
  .swap-shell .asset-picker:hover:not(:disabled) .asset-picker-chevron {
    color: var(--figure);
    background-color: color-mix(in srgb, var(--figure) 8%, transparent);
  }
  .exchange-screen .swap-shell .flip:hover:not(:disabled) {
    background: var(--flip-hover);
    color: var(--flip-ink);
    border-color: var(--well-send);
    box-shadow: inset 0 0 0 1px var(--well-line), 0 3px 8px -5px rgb(0 0 0 / 24%);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .swap-shell :is(#btn-requote svg, .flip path) { transition: transform 150ms cubic-bezier(.2,0,0,1); }
  .exchange-screen .swap-shell .flip { transition: background-color 140ms, box-shadow 140ms, scale 150ms ease-out; }
  .exchange-screen .swap-shell .flip:active:not(:disabled) { scale: .96; }
  @media (hover: hover) {
    .swap-shell .asset-picker .asset-picker-chevron { transition: background-color 140ms, color 140ms; }
    .swap-shell .asset-picker .asset-picker-chevron use { transition: transform 140ms cubic-bezier(.2,0,0,1); }
    .swap-shell .asset-picker:hover:not(:disabled) .asset-picker-chevron use { transform: translateY(1px); }
    .swap-shell .flip:hover:not(:disabled) .flip-up { transform: translateY(-1.5px); }
    .swap-shell .flip:hover:not(:disabled) .flip-down { transform: translateY(1.5px); }
  }
  .swap-shell #btn-requote:active svg { transform: rotate(60deg); }
  .swap-shell #fee-details[open] > .details-body { animation: swap-reveal 230ms cubic-bezier(.19,.76,.24,1); }
  @keyframes swap-reveal { from { opacity: .3; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
.exchange-screen .swap-shell #fee-details .summary-chevron { font-size: 0; }
@media (forced-colors: active) {
  .exchange-screen .swap-shell :is(.asset-picker,.amount-shell,.flip) { border: 1px solid ButtonText; }
  .exchange-screen .swap-shell .amount-shell:has(#send-amount:focus-visible) { outline: 2px solid Highlight; }
}
