/* The layout, the radii, and the type scale copy the Uniswap interface swap
   page. The accent is the Solana purple, because the chain is a Solana
   sidechain. */
:root {
  color-scheme: dark;
  --surface1: #131313;
  --surface1-hover: #1a1a1a;
  --surface2: #1f1f1f;
  --surface2-hover: #242424;
  --surface3: rgba(255, 255, 255, 0.12);
  --surface3-solid: #393939;
  --surface3-hover: rgba(255, 255, 255, 0.16);
  --neutral1: #ffffff;
  --neutral2: rgba(255, 255, 255, 0.65);
  --neutral3: rgba(255, 255, 255, 0.38);
  --accent1: #9945ff;
  --accent1-hover: #8134e8;
  --accent2: rgba(153, 69, 255, 0.12);
  --success: #14f195;
  --critical: #ff5c5c;
  --font: Basel, -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface1);
  color: var(--neutral1);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: var(--font); }

/* the top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface1);
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; white-space: nowrap; }
.brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #9945ff 0%, #14f195 100%);
  color: var(--surface1);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 600;
}

.tabs { display: flex; gap: 4px; margin-left: 16px; }
.tab {
  background: transparent;
  border: none;
  color: var(--neutral2);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}
.tab:hover { color: var(--neutral1); background: var(--surface1-hover); }
.tab.is-on { color: var(--neutral1); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.pill {
  background: var(--surface2);
  border: none;
  color: var(--neutral2);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.wallet-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--accent2);
  color: var(--accent1);
  cursor: pointer;
  font-weight: 500;
}
.wallet-pill:hover { background: rgba(153, 69, 255, 0.2); }
.wallet-balance { opacity: 0.8; }

/* the views */
main { padding: 48px 16px 64px; }
.view { display: flex; justify-content: center; }
.view.hidden { display: none; }
.hidden { display: none; }

.swap-card { width: 100%; max-width: 480px; }
.card {
  background: var(--surface2);
  border-radius: 20px;
  padding: 16px;
  width: 100%;
  max-width: 480px;
}
.card.wide { max-width: 920px; }
.two-up { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); max-width: 920px; width: 100%; }

.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 4px; }
.card-head h2 { font-size: 20px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.slippage {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--neutral2);
  font-size: 14px;
  background: transparent;
  border-radius: 999px;
  padding: 4px 6px;
}
.slippage select {
  width: auto;
  background: transparent;
  border: none;
  color: var(--neutral2);
  font-size: 14px;
  padding: 2px;
}

/* the two panels of the swap */
.panel {
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 16px;
}
.panel + .panel { margin-top: 4px; }
.panel:focus-within { border-color: var(--surface3); }
.panel-head { font-size: 14px; color: var(--neutral2); margin-bottom: 12px; }
.panel-row { display: flex; align-items: center; gap: 12px; }
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--neutral2);
  min-height: 22px;
}

.amount {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--neutral1);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.02em;
  padding: 0;
  outline: none;
}
.amount::placeholder { color: var(--neutral3); }
output.amount { display: block; }
.small-amount { font-size: 28px; }

.token-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface3);
  border: none;
  color: var(--neutral1);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.token-pill:hover { background: var(--surface3-hover); }
.badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #101010;
}
.chev { color: var(--neutral2); font-size: 10px; }

.flip {
  display: block;
  margin: -14px auto;
  position: relative;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 16px;
  border: 4px solid var(--surface1);
  background: var(--surface3-solid);
  color: var(--neutral1);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.flip:hover { background: #454545; }

.plus { text-align: center; color: var(--neutral2); margin: 8px 0; }

.details { margin: 12px 8px 0; padding: 0; font-size: 14px; }
.details div { display: flex; justify-content: space-between; padding: 6px 0; }
.details dt { color: var(--neutral2); margin: 0; }
.details dd { margin: 0; color: var(--neutral1); }
.details.hidden { display: none; }

.action {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  border: none;
  border-radius: 20px;
  background: var(--accent1);
  color: var(--neutral1);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
}
.action:hover { background: var(--accent1-hover); }
.action:disabled { background: var(--surface3); color: var(--neutral3); cursor: default; }

.link {
  background: transparent;
  border: none;
  color: var(--accent1);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.link:hover { color: var(--accent1-hover); }

.mini {
  background: var(--surface3);
  border: none;
  color: var(--neutral2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.mini:hover { color: var(--neutral1); background: var(--surface3-hover); }

.status { font-size: 14px; margin: 12px 8px 0; min-height: 20px; word-break: break-word; color: var(--neutral2); }
.status.good { color: var(--success); }
.status.bad { color: var(--critical); }
.muted { color: var(--neutral2); }
.small { font-size: 14px; }

.field { margin-bottom: 12px; }
label { display: block; color: var(--neutral2); font-size: 14px; margin-bottom: 8px; }
input, select {
  background: var(--surface3);
  border: 1px solid transparent;
  color: var(--neutral1);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 16px;
  width: 100%;
  outline: none;
}
input:focus, select:focus { border-color: var(--surface3-solid); }
input::placeholder { color: var(--neutral3); }
.panel input, .panel output { background: transparent; padding: 0; border-radius: 0; }

/* the pool table */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--neutral2); font-weight: 500; font-size: 14px; }
th, td { padding: 14px 10px; border-bottom: 1px solid var(--surface3); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface2-hover); }

/* the dialogs */
dialog {
  border: none;
  border-radius: 24px;
  background: var(--surface2);
  color: var(--neutral1);
  padding: 16px;
  width: min(420px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dialog-head h3 { margin: 0; font-size: 18px; font-weight: 500; }
.icon { background: transparent; border: none; color: var(--neutral2); font-size: 16px; cursor: pointer; }
.icon:hover { color: var(--neutral1); }

.token-list { list-style: none; margin: 16px -16px -16px; padding: 0; max-height: 340px; overflow-y: auto; }
.token-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--neutral1);
  padding: 10px 16px;
  cursor: pointer;
  text-align: left;
}
.token-list button:hover { background: var(--surface2-hover); }
.token-list .left { display: flex; align-items: center; gap: 12px; }
.token-list .badge { width: 36px; height: 36px; font-size: 14px; }
.token-list .sym { font-size: 16px; font-weight: 500; display: block; }
.token-list .addr { color: var(--neutral2); font-size: 14px; }
.token-list .bal { color: var(--neutral2); font-size: 15px; }

.holdings { list-style: none; margin: 16px 0; padding: 0; }
.holdings li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 16px;
}
.holdings .symbol { color: var(--neutral2); }
.holdings .empty { color: var(--neutral2); font-size: 14px; }

.big-balance { font-size: 36px; font-weight: 400; margin: 16px 0 8px; letter-spacing: -0.02em; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; color: var(--neutral2); }

footer { color: var(--neutral3); font-size: 13px; padding: 24px 20px 40px; max-width: 920px; margin: 0 auto; text-align: center; }
footer p { margin: 6px 0; }

@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
  .tabs { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .wallet-balance { display: none; }
  .amount { font-size: 30px; }
  main { padding: 20px 12px 40px; }
}
