:root {
  color-scheme: dark;
  --ink: #fff3da;
  --soft: #d3cee4;
  --line: #9389bb;
  --dim-line: #625e91;
  --glass: #262160;
  --well: #221e55;
  --mint: #a4ead3;
}
.swap-page {
  min-height: 100svh;
  color: var(--ink);
  background: radial-gradient(ellipse at 79% 63%, #33292e 0%, transparent 52%), radial-gradient(ellipse at 25% 35%, #202138, transparent 53%), #121215;
  font-family: var(--mono);
}
.wallet-icon { position: relative; width: 16px; height: 12px; border: 1px solid; border-radius: 2px; }
.wallet-icon::after { content: ''; position: absolute; width: 5px; height: 4px; top: 2px; right: 0; border: 1px solid; }
main { width: min(1380px, 94%); margin: clamp(16px, 3vh, 42px) auto 0; padding-bottom: 24px; }
.console {
  padding: clamp(9px, 1.15vw, 18px) clamp(9px, 1.15vw, 18px) 0;
  border: 1px solid #797477;
  border-radius: 19px;
  background: linear-gradient(130deg, #5f5c5e, #39373a 36%, #454145 73%, #353337);
  box-shadow: inset 2px 2px 2px #c5bcc173, inset -3px -4px 3px #151319, 0 25px 65px #08080ca6;
}
.screen {
  padding: clamp(20px, 3.2vw, 48px);
  border: 5px solid #191722;
  border-radius: 13px;
  background-color: var(--glass);
  background-image: repeating-linear-gradient(0deg, #0000000c, #0000000c 1px, transparent 1px, transparent 4px), radial-gradient(ellipse at 41% 0%, #413b90, transparent 72%);
  box-shadow: 0 1px 1px #b1a7ad80, inset 0 0 32px #110c3b9c;
}
.screen-heading, .swap-meta, .amount-label, .asset-row, .route-heading, .dialog-heading, .case-trim { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.screen-heading { padding-bottom: 15px; margin-bottom: clamp(16px,2.4vw,27px); border-bottom: 3px double var(--line); }
h1, h2 { font: 520 clamp(27px, 3vw, 44px)/1.05 var(--display); letter-spacing: -.035em; }
h1 { font-style: italic; text-shadow: 0 0 12px #fff3cc3b; }
.exchange { display: grid; position: relative; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: stretch; }
.amount-box { min-width: 0; padding: clamp(15px,2vw,25px); background: #201d5085; border: 1px solid var(--dim-line); border-top: 2px solid var(--line); }
.amount-label { min-height: 26px; font-size: .83rem; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
#amount, #out { width: 100%; min-width: 0; display: block; margin: 13px 0 14px; padding: 0; border: 0; background: transparent; color: var(--ink); font: 500 clamp(36px,4vw,64px)/1.17 var(--mono); letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
#amount:focus { outline: none; caret-color: var(--ink); }
#out { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#amount::placeholder, #out:not(.quoted) { color: #d3cfe0; opacity: 1; }
.asset-row { flex-wrap: wrap; gap: 6px; min-height: 38px; }
.asset-row > span { color: var(--soft); font-size: .75rem; overflow-wrap: anywhere; }
button { color: inherit; }
.token-button, .icon-button, .max, .presets button { border: 1px solid var(--line); border-radius: 2px; background: var(--well); }
.token-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 5px; font-weight: 650; }
.token-button > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; max-width: 10ch; }
.chevron { width: 7px; height: 7px; border: solid var(--soft); border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.token-icon { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: #dfdedd; }
.token-icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: contain; }
.token-icon img[src$="/hype.svg"] { padding: 4px; background: #103c36; }
.token-icon.wrapped::after { content: ''; position: absolute; inset: -2px; border: 1px solid #b6b5c5; border-radius: inherit; }
.generic-token::after { content: ''; width: 42%; aspect-ratio: 1; border: 2px solid #707079; transform: rotate(45deg); }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; font-size: 1.25rem; }
.reverse { position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #38316f; box-shadow: 0 0 0 4px #302b6e; }
.max { padding: 4px 8px; font-size: .72rem; color: var(--ink); }
.token-button:hover:not(:disabled), .icon-button:hover:not(:disabled), .max:hover:not(:disabled), .presets button:hover { border-color: var(--ink); background: #403976; }
.swap-meta { margin: 15px 0; }
.plain { border: 0; background: transparent; padding: 5px 0; color: var(--soft); font-size: .83rem; }
#slippage-show { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 48px; padding: 10px 16px; background: var(--ink); color: #28224e; border: 1px solid #fff9e6; border-radius: 2px; box-shadow: 3px 3px 0 #161239; font: 700 1rem var(--mono); }
.primary:hover:not(:disabled) { background: white; }
.primary:focus-visible { outline-color: var(--mint); }
.action-arrow { font-size: 1.4rem; }
#execute {
  justify-content: center;
  min-height: 52px;
  font-size: 1.15rem;
  color: #152e2b;
  background: var(--mint);
  border-color: #d7fff1;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 #eafff8, 0 3px 0 #477d70;
}
#execute:hover:not(:disabled) { background: #c4f7e6; }
#execute:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #477d70; }
#execute:disabled { background: #cdcbd9; border-color: #aaa5bd; box-shadow: none; }
.route-panel { margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--line); }
.route-heading { flex-wrap: wrap; margin-bottom: 10px; }
.route-heading h2 { font-size: 1.55rem; }
#route-subtitle, .quote-status { color: var(--soft); font-size: .76rem; }
.route-empty { display: flex; align-items: baseline; gap: 12px; padding: 12px 14px; background: #16133e80; border-left: 2px solid var(--line); font-size: .8rem; }
.route-empty h3, .route-empty p { display: inline; font: inherit; line-height: 1.5; }
.route-empty h3 { font-weight: 700; margin-right: .7ch; }
.route-empty p { color: var(--soft); }
.prompt, .best { color: var(--mint); }
.route-list { display: grid; align-content: start; gap: 6px; max-height: clamp(130px,24svh,260px); overflow: auto; }
.route-option { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; width: 100%; border: 1px solid var(--dim-line); border-left: 3px solid transparent; padding: 10px; text-align: left; background: var(--well); font-size: .8rem; }
.route-option[aria-pressed="true"], .route-option:hover { border-color: var(--line); border-left-color: var(--mint); background: #3a336d; }
.route-option:focus-visible { outline-offset: -2px; }
.route-option strong, .route-path { overflow-wrap: anywhere; }
.route-option strong { text-align: right; }
.route-option small { grid-column: 1/-1; color: var(--soft); line-height: 1.4; }
.route-details { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--dim-line); }
.route-details p { display: flex; justify-content: space-between; gap: 9px; padding: 5px 0; }
.route-details p, .route-details summary { font-size: .78rem; line-height: 1.45; color: var(--soft); }
.route-details strong { color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.route-details summary { cursor: pointer; margin-top: 5px; text-decoration: underline; }
.quote-status { margin: 12px 0; }
.message, .transaction { font-size: .86rem; line-height: 1.5; overflow-wrap: anywhere; }
.message { margin-top: 12px; }
.message[data-kind="error"] { color: #ffd2be; }
.message[data-kind="success"], .transaction { color: var(--mint); }
.transaction { display: inline-block; margin: 10px 0; text-decoration: underline; }
#check-pending { margin-top: 12px; }
.case-trim { height: 39px; padding: 0 12px; justify-content: flex-start; gap: 6px; color: #eee9dd; }
.case-trim b { font: italic 700 15px var(--display); }
.case-trim img { width: 26px; }
.case-trim i { width: 84px; height: 10px; margin-left: auto; background: repeating-linear-gradient(90deg, #211e21 0 2px,#71696e 2px 3px,transparent 3px 5px); }
dialog { width: min(450px, calc(100vw - 24px)); max-height: calc(100dvh - 26px); overflow: auto; padding: 22px; background: #29235b; color: var(--ink); border: 2px solid #b7adca; border-radius: 4px; box-shadow: 5px 5px 0 #191426,0 20px 70px #080810b3; }
dialog::backdrop { background: #0c0817c7; }
.dialog-heading { margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.dialog-heading h2 { font-size: 1.8rem; }
.search, .percent-field { width: 100%; background: var(--well); border: 1px solid var(--line); color: var(--ink); padding: 12px; }
.search::placeholder { color: var(--soft); }
.token-list { display: grid; gap: 3px; max-height: 47vh; overflow: auto; margin-top: 10px; }
.token-item { display: flex; align-items: center; gap: 12px; border: 1px solid transparent; background: transparent; padding: 9px; text-align: left; }
.token-item:hover:not(:disabled) { background: #3c346f; border-color: var(--line); }
.token-item strong, .token-item small { display: block; overflow-wrap: anywhere; }
.token-item small, .dialog-description { color: var(--soft); font-size: .8rem; line-height: 1.5; }
.dialog-description { margin-bottom: 12px; }
#wallet-address { overflow-wrap: anywhere; }
#disconnect-wallet { justify-content: center; }
.percent-field { display: flex; }
.percent-field input { border: 0; background: transparent; color: inherit; width: 100%; }
.presets { display: flex; gap: 8px; margin: 12px 0; }
.presets button { flex: 1; padding: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 761px) {
  .screen { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: clamp(20px, 2.5vw, 36px); align-items: start; }
  .screen-heading { grid-column: 1 / -1; }
  .route-panel { margin: 0; padding: 0 0 0 clamp(16px, 1.8vw, 26px); border: 0; border-left: 1px solid var(--line); }
}
@media (max-width: 1100px) {
  .exchange { grid-template-columns: 1fr; gap: 20px; }
  .reverse { transform: translate(-50%, -50%) rotate(90deg); }
}
@media (max-width: 760px) {
  main { width: min(96%, 580px); margin-top: 14px; }
  .amount-box { padding: 12px 15px; }
  #amount, #out { margin: 5px 0 8px; }
  .screen { padding: clamp(12px,3.8vw,22px); }
  .case-trim { height: 31px; }
}
@media (max-width: 360px) {
  .screen-heading { flex-wrap: wrap; gap: 6px; }
}
