:root {
  color-scheme: dark;
  --tc-background: #040404;
  --tc-surface: #0e0e10;
  --tc-text: #ffffff;
  --tc-muted: #9699a8;
  --tc-border: #ffffff14;
  --tc-accent: #ff5050;
  --tc-warm: #fff3b0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 85% 0, #ff50500b, transparent 640px), var(--tc-background);
  color: var(--tc-text);
  font: 400 16px/1.6 Inter, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, p, dl, dd { margin: 0; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--tc-warm);
  outline-offset: 5px;
}

::selection { background: #ff505040; color: var(--tc-text); }

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 10px 18px;
  background: var(--tc-warm);
  color: var(--tc-background);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 48px;
}

.brand { display: inline-flex; flex-shrink: 0; }
.brand img { display: block; width: 188px; height: auto; }

.site-nav {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--tc-border);
  border-radius: 999px;
  font-size: 13px;
}

.site-nav a {
  padding: 8px 20px;
  border-radius: inherit;
  color: var(--tc-muted);
}

.site-nav a:hover { color: var(--tc-text); }
.site-nav [aria-current="page"] { color: var(--tc-text); background: #ffffff08; }

.mode-badge, .eyebrow, .network-label, .wallet-details dt, .offer-details dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mode-badge { display: flex; align-items: center; gap: 9px; color: var(--tc-muted); }
.mode-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tc-warm); }

.wallet-shell { max-width: 1280px; margin: 0 auto; padding: 0 48px; }

.wallet-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: end;
  gap: 64px;
  padding: 56px 0 40px;
}

.eyebrow { margin-bottom: 20px; color: #e6cba3; }

.wallet-hero h1 {
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.wallet-hero h1 span { display: block; }
.title-muted { color: #84879a; }
.hero-description { max-width: 34ch; padding-bottom: 4px; color: var(--tc-muted); line-height: 1.75; }

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 7px 13px;
  border: 1px solid var(--tc-border);
  border-radius: 999px;
  color: var(--tc-text);
  font-size: 12px;
}

.network-label { color: var(--tc-muted); }

.panel {
  position: relative;
  min-width: 0;
  border: 1px solid var(--tc-border);
  border-radius: 14px;
  background: var(--tc-surface);
}

.panel::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 20px;
  left: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #fff3b047, #ff505047, transparent);
}

.connection-panel { padding: 26px 28px; }
.connection-heading, .holdings-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.connection-heading h2 { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.wallet-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid #ffffff26;
  border-radius: 4px;
  background: transparent;
  color: var(--tc-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms, color 120ms;
}

.button-primary { border-color: transparent; background: var(--tc-accent); color: var(--tc-background); }
.button-outline { border-color: transparent; background: linear-gradient(var(--tc-surface), var(--tc-surface)) padding-box, linear-gradient(110deg, #fff3b0, #ff7373) border-box; }
.button:disabled { opacity: .35; cursor: not-allowed; }
.button:not(:disabled):hover { border-color: #ffffff55; background-color: #ffffff08; }
.button-primary:not(:disabled):hover { border-color: transparent; background: #ff6b6b; }
.button-outline:not(:disabled):hover { background: linear-gradient(#1a1819, #1a1819) padding-box, linear-gradient(110deg, #fff3b0, #ff7373) border-box; }

.button.is-loading { position: relative; color: transparent; }
.button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  border: 2px solid #ffffffb3;
  border-radius: 50%;
  border-right-color: transparent;
  animation: tc-spin 600ms linear infinite;
}
@keyframes tc-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .button.is-loading::after { animation: none; }
}

#wallet-status {
  margin: 22px 0;
  padding: 12px 15px;
  border: 1px solid var(--tc-border);
  border-radius: 7px;
  background: #ffffff03;
  color: #c2c4d0;
  font-size: 13px;
}

.wallet-details { display: grid; grid-template-columns: minmax(0, 2.5fr) repeat(2, minmax(0, 1fr)); gap: 24px; }
.wallet-details > div { min-width: 0; }
.wallet-details > div + div { padding-left: 24px; border-left: 1px solid var(--tc-border); }
.wallet-details dt { margin-bottom: 8px; color: var(--tc-muted); }
.wallet-details dd { color: #d9dbe5; font-size: 13px; overflow-wrap: anywhere; }
.wallet-details .ledger-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.connection-help { margin-top: 20px; color: var(--tc-muted); font-size: 12px; }

.holdings-panel { margin-top: 24px; }
.holdings-heading { padding: 26px 28px 16px; }
.holdings-heading h2 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.holdings-note { max-width: 88ch; padding: 0 28px 24px; color: var(--tc-muted); font-size: 13px; line-height: 1.7; }
.balance-table { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 0 0 14px 14px; }
.balance-table:focus-visible { outline-offset: -3px; }

.balance-table table { width: 100%; min-width: 900px; border-collapse: collapse; text-align: left; }
.balance-table th { padding: 14px 24px; background: #ffffff03; color: var(--tc-muted); font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.balance-table td { padding: 22px 24px; border-top: 1px solid var(--tc-border); vertical-align: top; font-size: 14px; }
.balance-table tr.row-chosen td { background: #ff505012; }
.balance-table tr.row-chosen td:first-child { box-shadow: inset 3px 0 0 var(--tc-accent); }
.balance-table td:first-child { min-width: 260px; }
.amount { text-align: right; }
.balance-table tbody tr:hover { background: #ffffff02; }
.token-name { font-weight: 600; }
.balance-table small { display: block; max-width: 34ch; margin-top: 7px; color: var(--tc-muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.balance-table .token-admin { max-width: none; white-space: nowrap; overflow-wrap: normal; }
.amount { white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.scroll-hint { display: none; }

.history-panel { margin-top: 24px; }
.history-panel [hidden], .positions-panel [hidden] { display: none; }
.positions-panel .balance-table td:first-child { min-width: 0; }
.positions-panel .balance-table th, .positions-panel .balance-table td { padding-left: 16px; padding-right: 16px; }
.positions-panel .balance-table .button { min-height: 32px; margin-top: 8px; padding: 0 12px; font-size: 10px; }
.position-panel { max-width: none; margin-top: 24px; }
.history-panel .balance-table td { vertical-align: middle; }
.history-panel .balance-table th, .history-panel .amount { text-align: left; }
.history-panel .balance-table td:first-child, .history-panel .balance-table td:nth-child(2) { min-width: 0; white-space: nowrap; }
.history-panel .balance-table td:last-child { white-space: nowrap; }
.swap-status { display: inline-block; padding: 2px 10px; border: 1px solid var(--tc-border); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.swap-status-pending { color: var(--tc-warm); }
.swap-status-completed { color: #9be7b0; }
.swap-status-failed { color: #ffaaaa; }
.swap-status-cancelled { color: var(--tc-muted); }
.position-in-range { color: #9be7b0; }
.position-out-of-range { color: var(--tc-warm); }
.position-withdrawn { color: var(--tc-muted); }
.copy-button { min-height: 0; margin-left: 6px; padding: 0 4px; font-size: 11px; line-height: 1.4; letter-spacing: 0; }
.history-pager { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 28px 24px; border-top: 1px solid var(--tc-border); }

.balance-state { display: grid; place-content: center; min-height: 190px; padding: 36px 28px; border-top: 1px solid var(--tc-border); color: var(--tc-muted); font-size: 14px; text-align: center; }
.balance-state::before { content: ""; width: 10px; height: 10px; margin: 0 auto 20px; border: 1px solid #e6cba3; transform: rotate(45deg); }
.balance-state-error, .config-alert { color: #ffaaaa; }
.balance-state-error::before { border-color: currentColor; }
.config-alert { padding: 22px 28px; border: 1px solid #ff505044; border-radius: 14px; background: #ff505008; }
.wallet-footer { max-width: 94ch; padding: 28px 0 56px; color: var(--tc-muted); font-size: 12px; line-height: 1.8; }

.form-panel { max-width: 720px; margin-bottom: 56px; padding: 26px 28px; }
.transfers-panel { max-width: none; }
.deposit-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.form-panel h2 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.deposit-pool { color: var(--tc-muted); font-size: 13px; }
.form-group { margin: 22px 0 0; padding: 22px 0 0; border: 0; border-top: 1px solid var(--tc-border); }
.form-group legend { float: left; width: 100%; margin-bottom: 16px; padding: 0; }
.form-group legend, .form-label { color: var(--tc-muted); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.form-fields { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-field { display: grid; gap: 8px; min-width: 0; }

.form-input, .form-quote {
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--tc-border);
  border-radius: 7px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.form-input { width: 100%; background: #ffffff03; color: var(--tc-text); font-family: inherit; }
.form-input::placeholder { color: #5d6070; }
.form-input:focus-visible { outline: 2px solid var(--tc-warm); outline-offset: 2px; }
.form-quote { display: flex; align-items: center; border-style: dashed; color: var(--tc-muted); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 26px; }
.form-tos { display: flex; align-items: center; gap: 10px; margin-top: 22px; color: #c2c4d0; font-size: 13px; }
.form-tos input { width: 16px; height: 16px; margin: 0; accent-color: var(--tc-warm); }
.form-tos a { color: var(--tc-text); text-decoration: underline; }
.status-line { margin-top: 18px; padding: 12px 15px; border: 1px solid var(--tc-border); border-radius: 7px; background: #ffffff03; color: #c2c4d0; font-size: 13px; }

.deposit-price-unit, .deposit-current-price { display: flex; align-items: center; min-height: 48px; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.deposit-price-unit { color: var(--tc-text); }
.deposit-current-price { color: var(--tc-warm); font-weight: 500; font-variant-numeric: tabular-nums; }
.deposit-summary { margin-top: 24px; padding: 20px; border: 1px solid var(--tc-border); border-radius: 10px; background: #ffffff03; }
.deposit-summary h3 { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.deposit-summary p { color: var(--tc-muted); font-size: 14px; }
.deposit-summary-amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.deposit-summary-amounts > .form-field + .form-field { padding-left: 20px; border-left: 1px solid var(--tc-border); }
.deposit-summary .form-label { color: var(--tc-text); font-size: 14px; letter-spacing: 0; text-transform: none; }
.deposit-summary .form-quote { min-height: 32px; padding: 0; border: 0; color: var(--tc-text); font-size: 20px; overflow-wrap: anywhere; }

.offer-summary { margin-top: 12px; color: var(--tc-muted); font-size: 14px; }
.offer-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--tc-border); }
.offer-details > div { min-width: 0; }
.offer-details dt { margin-bottom: 8px; color: var(--tc-muted); }
.offer-details dd { color: #d9dbe5; font-size: 13px; overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .site-header { padding: 24px; }
  .wallet-shell { padding: 0 24px; }
  .wallet-hero { grid-template-columns: 1fr 1fr; gap: 36px; padding-top: 40px; }
  .scroll-hint { display: block; margin: 0 28px 16px; color: var(--tc-muted); font-size: 12px; }
}

@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; gap: 20px; padding: 20px; }
  .brand img { width: 164px; }
  .mode-badge { margin-left: auto; }
  .site-nav { order: 1; justify-content: center; width: 100%; }
  .site-nav a { flex: 1; text-align: center; }
  .wallet-shell { padding: 0 20px; }
  .wallet-hero { grid-template-columns: 1fr; gap: 24px; padding: 28px 0; }
  .wallet-hero h1 { font-size: clamp(44px, 12vw, 64px); }
  .eyebrow { margin-bottom: 16px; }
  .hero-description { max-width: none; font-size: 15px; }
  .network-badge { margin-top: 16px; }
  .connection-panel { padding: 22px 20px; }
  .connection-heading, .holdings-heading { flex-direction: column; align-items: stretch; gap: 18px; }
  .wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .wallet-actions .button { min-width: 0; padding: 0 12px; font-size: 10px; letter-spacing: .08em; }
  .wallet-details { grid-template-columns: 1fr; gap: 16px; }
  .wallet-details > div + div { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--tc-border); }
  .holdings-heading { padding: 22px 20px 16px; }
  .holdings-heading h2 { font-size: 22px; }
  .holdings-note { padding: 0 20px 22px; }
  .scroll-hint { margin-left: 20px; }
  .balance-state { min-height: 170px; padding: 28px 20px; }
  .wallet-footer { padding-bottom: 36px; }
  .form-panel { padding: 22px 20px; }
  .deposit-heading { flex-direction: column; gap: 6px; }
  .form-fields, .offer-details { grid-template-columns: 1fr; gap: 16px; }
  .deposit-summary-amounts { grid-template-columns: 1fr; gap: 16px; }
  .deposit-summary-amounts > .form-field + .form-field { padding: 16px 0 0; border-top: 1px solid var(--tc-border); border-left: 0; }
  .form-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}

/* Trade page: the swap card, after tradecraft.fi. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.swap-card { max-width: 570px; margin: 8px auto 56px; padding: 28px; border-radius: 12px; }
.swap-card [hidden] { display: none; }

.swap-form { display: grid; }

.swap-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 100px;
  padding: 20px 28px;
  border: 1px solid #ffffff0d;
  border-radius: 12px;
  background: #ffffff05;
}

.swap-amount { flex: 1; min-width: 0; }

.swap-amount-input, .swap-amount-value {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tc-text);
  font-family: inherit;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  -moz-appearance: textfield;
}

.swap-amount-input::placeholder, .swap-amount-value[data-state="empty"] { color: var(--tc-text); opacity: .9; }
.swap-amount-input:focus { outline: none; }
.swap-amount-input::-webkit-outer-spin-button, .swap-amount-input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.swap-box:focus-within { border-color: #ffffff26; }

.swap-flip {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: -14px auto;
  border: 1px solid #ffffff1a;
  border-radius: 50%;
  background: var(--tc-surface);
  color: var(--tc-text);
  cursor: pointer;
}

.swap-flip-icon::before { content: "↓"; font-size: 20px; line-height: 1; }
.swap-flip:not(:disabled):hover .swap-flip-icon::before { content: "⇅"; }
.swap-flip:disabled { cursor: not-allowed; opacity: .5; }

.swap-flip[data-state="loading"] .swap-flip-icon::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid #ffffff33;
  border-top-color: var(--tc-warm);
  border-radius: 50%;
  animation: swap-spin 800ms linear infinite;
}

@keyframes swap-spin { to { transform: rotate(360deg); } }

.swap-note { margin-top: 28px; color: var(--tc-muted); font-size: 15px; line-height: 1.6; }
.swap-state:empty { display: none; }
.trade-hint { margin-top: 12px; color: var(--tc-muted); font-size: 13px; }
.trade-hint-error { color: #ffaaaa; }

.swap-next { width: 100%; min-height: 54px; margin-top: 28px; font-size: 14px; letter-spacing: 1.5px; }

.swap-confirm { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--tc-border); }
.swap-confirm dl { display: grid; gap: 10px; }
.swap-confirm dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.swap-confirm dt { color: var(--tc-muted); font-size: 14px; }
.swap-confirm dd { font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.swap-confirm .swap-next { margin-top: 22px; }

.swap-back {
  display: block;
  margin: 16px auto 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--tc-warm);
  font-size: 14px;
  cursor: pointer;
}

.swap-back:not(:disabled):hover { text-decoration: underline; }
.swap-back:disabled { cursor: not-allowed; opacity: .5; }

/* Token pill and dialog */

.swap-token { flex-shrink: 0; }

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px 0 8px;
  border: 1px solid #ffffff14;
  border-radius: 999px;
  background: #ffffff0d;
  color: var(--tc-text);
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.token-pill::after {
  content: "";
  width: 8px;
  height: 8px;
  margin: -4px 0 0 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.token-pill:not(:disabled):hover { background: #ffffff17; }
.token-pill:disabled { cursor: not-allowed; opacity: .6; }

.token-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tc-warm), var(--tc-accent));
  color: var(--tc-background);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.token-icon:empty { display: none; }
.token-pill:has(.token-icon:empty) { padding-left: 16px; }

.token-backdrop { position: fixed; inset: 0; z-index: 40; background: #000000a6; backdrop-filter: blur(8px); }

.token-dialog {
  position: fixed;
  top: max(24px, 10dvh);
  left: 50%;
  z-index: 41;
  display: flex;
  flex-direction: column;
  width: min(456px, calc(100vw - 32px));
  max-height: calc(100dvh - max(48px, 20dvh));
  padding: 22px 20px 12px;
  border: 1px solid var(--tc-border);
  border-radius: 16px;
  background: #0b0b0c;
  box-shadow: 0 24px 64px #000000b3;
  transform: translateX(-50%);
}

.token-dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.token-dialog-heading h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }

.token-dialog-close {
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--tc-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.token-dialog-close:hover { color: var(--tc-text); }

.token-search {
  width: 100%;
  min-height: 52px;
  padding: 0 16px 0 44px;
  border: 1px solid #ffffff1a;
  border-radius: 10px;
  background: #ffffff08 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239699a8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center;
  color: var(--tc-text);
  font: inherit;
  font-size: 18px;
}

.token-search::placeholder { color: var(--tc-muted); }
.token-search:focus-visible { outline: 2px solid var(--tc-warm); outline-offset: 2px; }

.token-list-label { margin: 22px 4px 8px; color: var(--tc-muted); font-size: 15px; }
.token-list { margin: 0; padding: 0; overflow-y: auto; list-style: none; }

.token-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--tc-text);
  font-size: 18px;
  text-align: left;
  cursor: pointer;
}

.token-row .token-icon { width: 38px; height: 38px; font-size: 16px; }
.token-row:not(:disabled):hover { background: #ffffff0d; }
.token-row:disabled { cursor: not-allowed; opacity: .4; }
.token-empty { padding: 16px 12px; color: var(--tc-muted); font-size: 14px; }

@media (max-width: 640px) {
  .swap-card { padding: 20px; }
  .swap-box { min-height: 88px; padding: 16px 18px; }
  .swap-amount-input, .swap-amount-value { font-size: 24px; }
  .token-pill { min-height: 42px; font-size: 16px; }
  .swap-note { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .swap-flip[data-state="loading"] .swap-flip-icon::before { animation-duration: 2400ms; }
}

/* Activity: the header button, the toasts and the panel. */

.activity-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--tc-border);
  border-radius: 4px;
  background: transparent;
  color: var(--tc-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}

.activity-button:hover, .activity-button[aria-expanded="true"] { border-color: #ffffff55; color: var(--tc-text); }
.activity-count { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--tc-accent); color: var(--tc-background); font-size: 10px; line-height: 18px; text-align: center; }

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 16px;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
  background: var(--tc-surface);
  box-shadow: 0 12px 32px #00000080;
  pointer-events: auto;
}

.toast[data-state="succeeded"], .activity-entry[data-state="succeeded"] { border-color: #fff3b066; }
.toast[data-state="failed"], .toast[data-state="cancelled"], .toast[data-state="unconfirmed"],
.activity-entry[data-state="failed"], .activity-entry[data-state="cancelled"], .activity-entry[data-state="unconfirmed"] { border-color: #ff505099; }

.toast-heading, .activity-entry-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.toast-title, .activity-title { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4; }

/* A completed action shows a checkmark before its title, centred on the
   first line. The status text already says so, so the mark is an image. */
.toast[data-state="succeeded"] .toast-title,
.activity-entry[data-state="succeeded"] .activity-title { display: flex; align-items: flex-start; }

.toast[data-state="succeeded"] .toast-title::before,
.activity-entry[data-state="succeeded"] .activity-title::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: calc(.7em - 8px) 8px 0 0;
  border-radius: 50%;
  background: #9be7b0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23040404' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 8.2 2.3 2.3 4.7-4.9'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.toast-status, .activity-status { margin: 6px 0 0; color: var(--tc-muted); font-size: 12px; line-height: 1.5; }
.toast-dismiss { padding: 0 4px; border: 0; background: transparent; color: var(--tc-muted); font-size: 16px; line-height: 1; cursor: pointer; }
.toast-dismiss:hover { color: var(--tc-text); }
.toast-progress { display: block; width: 100%; height: 3px; margin-top: 12px; accent-color: var(--tc-accent); }
.toast-progress[hidden] { display: none; }

.notification-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; color: var(--tc-muted); font-size: 11px; }
.notification-steps li::before { content: "○"; margin-right: 5px; }
.notification-steps li[data-state="done"] { color: var(--tc-text); }
.notification-steps li[data-state="done"]::before { content: "●"; }
.notification-steps li[data-state="active"] { color: var(--tc-warm); }
.notification-steps li[data-state="active"]::before { content: "◐"; }
.notification-steps li[data-state="failed"], .notification-steps li[data-state="cancelled"] { color: var(--tc-accent); }
.notification-steps li[data-state="failed"]::before, .notification-steps li[data-state="cancelled"]::before { content: "✕"; }
.notification-steps li[data-state="unconfirmed"] { color: var(--tc-accent); }
.notification-steps li[data-state="unconfirmed"]::before { content: "?"; }

.activity-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(420px, 100vw);
  height: 100dvh;
  padding: 24px;
  overflow-y: auto;
  border-left: 1px solid var(--tc-border);
  background: var(--tc-background);
}

.activity-panel[hidden] { display: none; }
.activity-heading { display: flex; align-items: center; gap: 10px; }
.activity-heading h2 { margin: 0 auto 0 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.activity-heading .button { min-height: 32px; padding: 0 12px; font-size: 10px; }
.activity-empty { margin: 0; color: var(--tc-muted); font-size: 13px; }
.activity-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.activity-entry { padding: 14px; border: 1px solid var(--tc-border); border-radius: 6px; background: var(--tc-surface); }
.activity-time { flex-shrink: 0; color: var(--tc-muted); font-size: 11px; }
.activity-detail { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--tc-muted); font-size: 11px; }
.activity-detail .ledger-value { color: var(--tc-text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .toast-region { right: 16px; bottom: 16px; left: 16px; width: auto; }
}
