:root {
  --page-bg: #141414;
  --page-gradient: radial-gradient(109.3% 92.82% at 22.05% 22.29%, #13191b 0%, #000607 100%);
  --page-spot: rgba(0, 0, 0, 0);
  --surface: #000607;
  --surface-2: #252525;
  --surface-3: #262f31;
  --surface-4: #505050;
  --border: #262f31;
  --border-strong: #3d4b50;
  --text: #f5f5f5;
  --text-muted: #9294a5;
  --text-faint: #66879d;
  --accent: #f57d0f;
  --accent-hover: #ff5e00;
  --accent-shadow: rgba(245, 125, 15, 0.16);
  --success: #77db91;
  --success-dark: #1f5b37;
  --cookie-bg: #6a717d;
  --shadow: none;
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --font-body: lato, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-display: lato, ui-sans-serif, system-ui, sans-serif;
  --font-svg: "Montserrat", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 18px 24px 108px;
  font-family: var(--font-body);
  color: var(--text);
  background: rgb(20, 20, 20);
  line-height: 1.4;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: none;
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1320px, 100%);
  margin: 0 auto;
}

.site-header {
  display: grid;
  grid-template-columns: auto auto minmax(280px, 1fr) auto auto;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: auto;
  height: 36px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: 13px;
  color: #bccdd5;
}

.site-nav a {
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #1a2227;
}

.search-bar i {
  color: #6c7782;
  font-size: 18px;
}

.search-bar input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #bccdd5;
  font-size: 13px;
}

.search-bar input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.search-bar:focus-within {
  border-color: #2d3e45;
}

.wallet-button,
.cookie-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.wallet-button:hover,
.cookie-button:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
  box-shadow: none;
}

.header-wallet-button {
  white-space: nowrap;
}

.menu-button,
.ghost-icon-button,
.swap-button,
.toggle-switch {
  padding: 0;
}

.menu-button {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
}

.menu-button i {
  font-size: 22px;
}

.mobile-nav {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mobile-nav[hidden] {
  display: none !important;
}

.mobile-nav a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.mobile-wallet-button {
  width: 100%;
  margin-top: 12px;
}

.dashboard {
  display: flex;
  gap: 22px;
  align-items: start;
  margin-top: 26px;
}

.swap-column,
.insights-column {
  min-width: 0;
}

.swap-column {
  flex: 1.02 1 0;
}

.insights-column {
  flex: 0.98 1 0;
}

.trade-toolbar,
.chart-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.section-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.section-tabs .tab-button {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.card-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 48px;
}

.card-tabs .tab-button {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.time-range {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  height: 48px;
  border: 0;
  background: transparent;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-button,
.range-button,
.ghost-button,
.ghost-icon-button {
  border: 0;
  background: transparent;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  color: #bccdd5;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.tab-button.small {
  padding: 0 24px;
  font-size: 14px;
}

.tab-button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.card-tabs .tab-button:not(.active) {
  color: var(--text-muted);
}

.tab-button:hover,
.range-button:hover {
  color: var(--text);
}

.ghost-button,
.ghost-icon-button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: #bccdd5;
  cursor: pointer;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
}

.chain-button {
  min-width: 132px;
  justify-content: center;
  font-weight: 600;
}

.chain-button-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ghost-icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
}

.ghost-icon-button i,
.ghost-button i {
  font-size: 18px;
}

.trade-card,
.info-card {
  padding: 14px;
  border: none;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.08);
}

.trade-card {
  border-top-left-radius: 0;
}

.info-card {
  border-top-left-radius: 0;
}

.insight-block {
  display: flex;
  flex-direction: column;
}

.insight-block > .card-tabs,
.insight-block > .chart-header-row {
  padding: 0;
}

.insight-block > .card-tabs .tab-button,
.insight-block > .chart-header-row .tab-button {
  position: relative;
  z-index: 1;
}

.token-panel {
  padding: 14px 15px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.token-label {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.token-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.token-select {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}

.token-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.token-avatar img:not(.token-chain) {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.asset-avatar {
  width: 32px;
  height: 32px;
}

.token-chain {
  position: absolute;
  right: -4px;
  bottom: -1px;
  width: 16px;
  height: 16px;
  border: 1px solid #000;
  border-radius: 50%;
  background: #1a1b1f;
  z-index: 1;
}

.token-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.token-copy strong {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.token-copy small {
  color: var(--text-faint);
  font-size: 12px;
}

.token-select i {
  color: #7d8591;
  font-size: 17px;
}

.token-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.token-amount {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 2rem;
  letter-spacing: -0.02em;
  background: none;
  border: none;
  outline: none;
  color: inherit;
  text-align: right;
  width: 100%;
  padding: 0;
  min-width: 0;
  cursor: text;
  caret-color: var(--text);
}

.token-amount:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}

.token-amount[readonly] {
  pointer-events: none;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.token-amount::placeholder {
  color: var(--text-faint);
  opacity: 0.5;
}

.token-usd {
  color: var(--text-faint);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.token-balance {
  margin: 12px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}

.swap-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -8px auto;
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #213036;
  color: #cad1d8;
  cursor: pointer;
  box-shadow: none;
}

.swap-button i {
  font-size: 19px;
  transition: transform 0.3s ease;
}

.swap-button.is-flipped i {
  transform: rotate(180deg);
}

.quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 2px 0;
  color: #bccdd5;
  font-size: 11px;
}

.quote-row strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.primary-wallet-button {
  width: 100%;
  height: 44px;
  margin-top: 14px;
  border-radius: 14px;
  font-size: 14px;
}

.mode-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 4px 10px;
}

.mode-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.shield-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: #dde5ec;
  flex: 0 0 auto;
}

.mode-copy strong {
  font-family: var(--font-display);
  font-size: 15px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 10px;
  padding: 0 8px;
  border-radius: 999px;
  background: #505050;
  color: #edf0f4;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.mode-copy p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 30px;
  border: 1px solid #868c96;
  border-radius: 999px;
  background: #8b929a;
  cursor: pointer;
  flex: 0 0 auto;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.toggle-switch.active {
  background: #8b929a;
  border-color: #868c96;
}

.toggle-switch.active .toggle-thumb {
  transform: translateX(22px);
  background: #fbfbfc;
}

.stats-table {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 5px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.stats-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stats-row strong {
  color: var(--text);
  text-align: right;
  font-weight: 500;
}

.quote-row i {
  color: #79808a;
}

.min-row-table {
  margin-top: 8px;
}

.min-row {
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #43494a;
  color: #afb3b5;
  font-size: 9px;
  font-weight: 700;
  flex: 0 0 auto;
  cursor: default;
}

.insights-column {
  display: grid;
  gap: 18px;
}

.route-card {
  min-height: 320px;
}

.route-visual {
  margin-top: 12px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.route-svg {
  display: block;
  width: 100%;
  height: auto;
}

.route-node {
  fill: #535962;
}

.route-node-small {
  fill: #4f545d;
}

.route-label,
.route-sub-label {
  font-family: var(--font-svg);
  font-weight: 700;
}

.route-label {
  fill: #f3f6fb;
  font-size: 12px;
}

.route-sub-label {
  fill: #adb4be;
  font-size: 10px;
}

.route-sub-lower {
  fill: #99a0ab;
}

.route-flow-pink {
  fill: url(#routePink);
}

.route-flow-yellow {
  fill: url(#routeYellow);
}

.route-flow-green {
  fill: url(#routeGreen);
}

.route-flow-gold {
  fill: url(#routeGold);
}

.route-flow-blue {
  fill: url(#routeBlue);
}

.route-flow-purple {
  fill: url(#routePurple);
}

.route-flow-rose {
  fill: url(#routeRose);
}

.route-flow-cyan {
  fill: url(#routeCyan);
}

.route-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.legend-swatch {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.legend-swatch.pink {
  background: #ef5d98;
}

.legend-swatch.red {
  background: #d62d4f;
}

.legend-swatch.yellow {
  background: #d5b11f;
}

.legend-swatch.green {
  background: #6dd449;
}

.legend-swatch.blue {
  background: #2f84f4;
}

.legend-swatch.purple {
  background: #6a46ee;
}

.legend-swatch.cyan {
  background: #4ecbaf;
}

.legend-swatch.gold {
  background: #d7b245;
}

.legend-swatch.rose {
  background: #ed5ea0;
}

.chart-card {
  min-height: 308px;
}

.chart-asset-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.asset-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.chart-pane[hidden] {
  display: none !important;
}

.chart-frame {
  position: relative;
  min-height: 230px;
  margin-top: 12px;
  padding-right: 46px;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

#chartSvg {
  display: block;
  width: 100%;
  height: 230px;
}

.chart-grid line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.chart-area {
  fill: url(#chartAreaGradient);
  opacity: 0.56;
}

.chart-line {
  fill: none;
  stroke: var(--success);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#chartGlow);
}

.chart-y-axis {
  position: absolute;
  top: 18px;
  right: 10px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.chart-y-axis span,
.chart-x-axis span {
  color: var(--text-faint);
  font-size: 11px;
}

.chart-x-axis {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  padding: 10px 6px 0;
}

.time-range {
  margin-left: auto;
}

.range-button {
  min-width: 36px;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  color: #bccdd5;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.range-button.active {
  background: #505050;
  color: #fff;
  box-shadow: none;
}

.transaction-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.transaction-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #1b1c20;
}

.transaction-route {
  font-weight: 700;
}

.transaction-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.transaction-amount {
  font-family: var(--font-display);
  font-weight: 700;
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #28372b;
  color: #9ad7a5;
  font-size: 11px;
  font-weight: 700;
}

.cookie-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  background: var(--cookie-bg);
  color: #eef2f7;
  font-size: 11px;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.24);
}

.cookie-banner p {
  margin: 0;
  max-width: 980px;
}

.cookie-banner.is-hidden {
  display: none;
}

.cookie-button {
  height: 36px;
  padding-inline: 16px;
  flex: 0 0 auto;
}

@media (prefers-reduced-motion: no-preference) {
  .trade-card,
  .info-card {
    animation: rise-in 0.42s ease;
  }

  .ghost-button:hover,
  .ghost-icon-button:hover,
  .menu-button:hover,
  .swap-button:hover {
    background: #25272c;
    border-color: #4a4e56;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto auto 1fr auto;
  }

  .dashboard {
    flex-direction: column;
    align-items: stretch;
  }

  .route-legend {
    gap: 8px 14px;
  }
}

@media (max-width: 900px) {
  body {
    padding: 18px 18px 102px;
  }

  .site-header {
    grid-template-columns: auto 1fr auto auto;
  }

  .site-nav {
    display: none;
  }

  .menu-button {
    display: grid;
  }

  .search-bar {
    grid-column: 1 / -1;
    order: 4;
  }
}

@media (max-width: 820px) {
  .transaction-row {
    grid-template-columns: 1fr;
  }

  .transaction-amount {
    text-align: left;
  }

  .status-pill {
    justify-self: start;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 16px;
  }

  .cookie-banner p {
    font-size: 10px;
    line-height: 1.35;
  }
}

@media (max-width: 620px) {
  body {
    padding: 12px 10px 62px;
  }

  .site-header {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }

  .brand img {
    height: 26px;
  }

  .brand-name {
    font-size: 17px;
  }

  .header-wallet-button {
    display: none;
  }

  .search-bar {
    height: 38px;
    padding: 0 12px;
  }

  .search-bar input {
    font-size: 12px;
  }

  .search-bar input::placeholder {
    font-size: 12px;
  }

  .dashboard {
    gap: 14px;
    margin-top: 14px;
  }

  .trade-toolbar {
    gap: 6px;
  }

  .section-tabs {
    overflow-x: auto;
    flex-shrink: 1;
    min-width: 0;
  }

  .card-tabs,
  .time-range {
    overflow-x: auto;
  }

  .tab-button {
    padding: 0 16px;
    height: 40px;
    font-size: 13px;
    white-space: nowrap;
  }

  .tab-button.small {
    padding: 0 14px;
    font-size: 13px;
  }

  .range-button {
    min-width: 32px;
    height: 36px;
    padding: 0 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .ghost-button.settings-button span {
    display: none;
  }

  .ghost-button.settings-button {
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
  }

  .route-legend {
    gap: 6px 10px;
  }

  .trade-card,
  .info-card,
  .mobile-nav {
    border-radius: 16px;
  }

  .trade-card,
  .info-card {
    padding: 12px;
  }

  .trade-card {
    border-top-left-radius: 0;
  }

  .info-card {
    border-top-left-radius: 0;
  }

  .token-panel {
    padding: 12px;
  }

  .token-label {
    margin-bottom: 8px;
    font-size: 11px;
  }

  .token-row {
    gap: 8px;
  }

  .token-select {
    gap: 8px;
  }

  .token-copy strong {
    font-size: 16px;
  }

  .token-copy small {
    font-size: 11px;
  }

  .token-amount {
    font-size: max(16px, 1.15rem);
    line-height: 1.5rem;
  }

  .token-usd {
    font-size: 12px;
  }

  .token-balance {
    margin-top: 8px;
    font-size: 11px;
  }

  .swap-button {
    margin: -6px auto;
    width: 34px;
    height: 34px;
  }

  .primary-wallet-button {
    height: 42px;
    font-size: 13px;
    border-radius: 12px;
    margin-top: 12px;
  }

  .quote-row {
    font-size: 11px;
    padding-top: 8px;
  }

  .mode-row {
    padding: 12px 2px 6px;
    gap: 12px;
  }

  .mode-copy strong {
    font-size: 13px;
  }

  .mode-copy p {
    font-size: 11px;
    margin-top: 3px;
  }

  .shield-badge {
    width: 26px;
    height: 26px;
  }

  .pill {
    height: 18px;
    font-size: 9px;
    padding: 0 6px;
    margin-left: 6px;
  }

  .stats-table {
    margin-top: 8px;
    padding: 4px 10px;
  }

  .stats-row {
    font-size: 11px;
    padding: 4px 0;
  }

  .min-row-table {
    margin-top: 6px;
  }

  .chart-frame {
    min-height: 204px;
    padding-right: 42px;
  }

  #chartSvg {
    height: 204px;
  }

  .chart-x-axis span,
  .chart-y-axis span {
    font-size: 10px;
  }

  .chart-asset-row {
    gap: 8px;
  }

  .asset-heading {
    font-size: 16px;
    gap: 8px;
  }

  .route-card {
    min-height: 260px;
  }

  .chart-card {
    min-height: 270px;
  }

  .insights-column {
    gap: 14px;
  }

  .limit-controls {
    flex-direction: column;
  }

  .expiry-panel {
    width: 100%;
    flex: 1;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 14px;
    font-size: 10px;
  }

  .cookie-banner p {
    font-size: 10px;
    line-height: 1.3;
  }

  .cookie-button {
    height: 32px;
    font-size: 12px;
    border-radius: 6px;
  }

  .legend-chip {
    font-size: 10px;
  }

  .mobile-nav {
    margin-top: 12px;
    padding: 12px;
  }

  .mobile-nav a {
    padding: 10px 12px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  body {
    padding: 8px 6px 56px;
  }

  .site-header {
    gap: 8px;
  }

  .brand img {
    height: 22px;
  }

  .brand-name {
    font-size: 15px;
  }

  .search-bar {
    height: 34px;
    gap: 8px;
    padding: 0 10px;
  }

  .search-bar i {
    font-size: 16px;
  }

  .search-bar input {
    font-size: 11px;
  }

  .search-bar input::placeholder {
    font-size: 11px;
  }

  .dashboard {
    gap: 12px;
    margin-top: 10px;
  }

  .trade-toolbar {
    gap: 4px;
  }

  .tab-button {
    padding: 0 12px;
    height: 38px;
    font-size: 12px;
  }

  .tab-button.small {
    padding: 0 10px;
    font-size: 12px;
  }

  .trade-card,
  .info-card {
    padding: 10px;
  }

  .token-panel {
    padding: 10px;
  }

  .token-label {
    margin-bottom: 6px;
  }

  .token-avatar {
    width: 28px;
    height: 28px;
  }

  .token-chain {
    width: 13px;
    height: 13px;
  }

  .token-select {
    gap: 7px;
  }

  .token-copy strong {
    font-size: 15px;
  }

  .token-copy small {
    font-size: 10px;
  }

  .token-amount {
    font-size: 15px;
    line-height: 1.4rem;
  }

  .token-usd {
    font-size: 10px;
  }

  .token-balance {
    margin-top: 6px;
    font-size: 10px;
  }

  .swap-button {
    width: 30px;
    height: 30px;
    margin: -5px auto;
  }

  .swap-button i {
    font-size: 16px;
  }

  .primary-wallet-button {
    height: 38px;
    font-size: 12px;
    border-radius: 10px;
    margin-top: 10px;
  }

  .quote-row {
    font-size: 10px;
    padding-top: 6px;
  }

  .mode-row {
    gap: 10px;
    padding: 10px 2px 4px;
  }

  .mode-title-row {
    gap: 8px;
  }

  .shield-badge {
    width: 22px;
    height: 22px;
  }

  .shield-badge i {
    font-size: 12px;
  }

  .mode-copy strong {
    font-size: 12px;
  }

  .mode-copy p {
    font-size: 10px;
    margin-top: 2px;
  }

  .pill {
    height: 16px;
    font-size: 8px;
    padding: 0 5px;
    margin-left: 4px;
  }

  .toggle-switch {
    width: 42px;
    height: 24px;
  }

  .toggle-thumb {
    width: 16px;
    height: 16px;
    top: 3px;
    left: 3px;
  }

  .toggle-switch.active .toggle-thumb {
    transform: translateX(18px);
  }

  .stats-table {
    margin-top: 6px;
    padding: 2px 8px;
  }

  .stats-row {
    font-size: 10px;
    gap: 6px;
    padding: 3px 0;
  }

  .min-row-table {
    margin-top: 4px;
  }

  .cookie-banner {
    padding: 8px 10px;
    gap: 6px;
  }

  .cookie-banner p {
    font-size: 9px;
    line-height: 1.3;
  }

  .cookie-button {
    height: 30px;
    font-size: 11px;
    padding: 0 12px;
  }

  .menu-button {
    width: 34px;
    height: 34px;
  }

  .menu-button i {
    font-size: 20px;
  }

  .ghost-icon-button {
    width: 34px;
    height: 34px;
  }

  .ghost-button.settings-button {
    width: 34px;
    height: 34px;
  }

  .route-card {
    min-height: 240px;
  }

  .chart-card {
    min-height: 250px;
  }

  .chart-frame {
    min-height: 190px;
    padding-right: 38px;
  }

  #chartSvg {
    height: 190px;
  }

  .insights-column {
    gap: 10px;
  }

  .range-button {
    min-width: 28px;
    height: 34px;
    padding: 0 6px;
    font-size: 12px;
  }

  .chart-x-axis {
    padding: 6px 4px 0;
  }

  .route-legend {
    gap: 4px 8px;
    margin-top: 10px;
  }

  .legend-chip {
    font-size: 9px;
    gap: 5px;
  }

  .legend-swatch {
    width: 6px;
    height: 6px;
  }

  .mobile-nav a {
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* Settings Modal */

.selection-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.selection-backdrop[hidden] {
  display: none;
}

.selection-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(95vw, 980px);
  max-width: 980px;
  min-width: 0;
  min-height: 80vh;
  height: auto;
  max-height: 80vh;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  z-index: 50;
  color: var(--text);
  overflow: hidden;
  transform: translate(-50%, -50%) scale(0.96);
  opacity: 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.selection-modal[open] {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.selection-shell {
  display: flex;
  width: 100%;
  height: 100%;
  max-height: 80vh;
  min-width: 0;
}

.selection-sidebar {
  display: none;
  width: 222px;
  border-right: 1px solid var(--border);
  flex-direction: column;
}

.selection-sidebar-header {
  display: flex;
  align-items: center;
  height: 80px;
  padding: 0 24px;
}

.selection-sidebar-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.selection-sidebar-scroll {
  height: 100%;
  overflow-y: auto;
}

.selection-chains-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 24px;
}

.selection-main {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-height: 80vh;
}

.selection-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 16px;
  padding: 0 24px;
}

.selection-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selection-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-link, #bccdd5);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.selection-pill.is-active {
  background: var(--surface-4);
  color: var(--text);
}

.selection-close-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.selection-close-inline i {
  font-size: 18px;
}

.selection-search-wrap {
  padding: 0 24px 16px;
}

.selection-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.selection-search i {
  color: #9ca3af;
  font-size: 18px;
}

.selection-search input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 16px;
}

.selection-mobile-chains {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.selection-mobile-chains small,
.selection-tokens-header small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.selection-mobile-chains small {
  padding: 0 24px;
}

.selection-mobile-chains-scroll {
  width: 100%;
  overflow-x: auto;
}

.selection-mobile-chains-list {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 16px;
  width: max-content;
}

.selection-tokens-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
}

.selection-tokens-header {
  padding: 0 24px;
}

.selection-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 0 12px 24px;
}

.selection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.selection-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.selection-item.is-selected {
  background: rgba(255, 255, 255, 0.06);
}

.selection-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.selection-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  overflow: hidden;
  flex: 0 0 auto;
}

.selection-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selection-item-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.selection-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-item-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 0 0 auto;
}

.selection-chain-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-link, #bccdd5);
  padding: 8px 10px;
  cursor: pointer;
}

.selection-chain-item.is-active {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--accent);
}

.selection-chain-item-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.selection-chain-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  overflow: hidden;
  flex: 0 0 auto;
}

.selection-chain-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selection-chain-item-label {
  font-size: 14px;
  font-weight: 400;
}

.selection-chain-item.is-active .selection-chain-item-label {
  font-weight: 600;
}

.selection-check {
  font-size: 16px;
}

@media (min-width: 768px) {
  .selection-sidebar {
    display: flex;
  }

  .selection-mobile-chains {
    display: none;
  }
}

@media (max-width: 620px) {
  .selection-modal {
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: translateY(100%);
    opacity: 1;
  }

  .selection-modal[open] {
    transform: translateY(0);
  }

  .selection-shell {
    max-height: 100vh;
  }

  .selection-main {
    max-height: 100vh;
  }

  .selection-topbar {
    height: 60px;
    padding: 0 16px;
  }

  .selection-search-wrap {
    padding: 0 16px 12px;
  }

  .selection-mobile-chains small {
    padding: 0 16px;
  }

  .selection-mobile-chains-list {
    padding: 0 16px 12px;
  }

  .selection-tokens-header {
    padding: 0 16px;
  }

  .selection-list {
    padding: 0 8px 24px;
  }

  .settings-modal {
    width: 100vw;
    max-width: 100vw;
  }

  .settings-content {
    padding: 0 16px 32px;
    gap: 20px;
  }

  .settings-header {
    height: 60px;
    padding: 0 16px;
  }

  .segmented-control {
    gap: 2px;
  }

  .segment {
    min-height: 48px;
    padding: 6px 2px;
  }

  .segment-label {
    font-size: 0.75rem;
  }

  .segment-value {
    font-size: 0.625rem;
  }

  .slippage-control {
    grid-template-columns: repeat(3, 1fr);
  }

  .settings-desc {
    font-size: 0.8125rem;
  }
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  z-index: 40;
  transition: opacity 0.3s ease;
}

.settings-backdrop[hidden] {
  display: none;
}

.settings-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(95vw, 600px);
  max-width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 0;
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.4);
  z-index: 50;
  color: var(--text);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-modal[open] {
  transform: translateX(0);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
}

.settings-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.close-button {
  background: transparent;
  border: 0;
  padding: 8px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.close-button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.close-button i {
  font-size: 24px;
}

.settings-content {
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.settings-row.compact {
  align-items: center;
}

.settings-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.settings-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}

.settings-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.settings-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.source-filter-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
  cursor: pointer;
}

.source-count {
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.source-filter-button i {
  font-size: 20px;
  color: var(--text-muted);
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 8px;
}

.slippage-control {
  grid-template-columns: repeat(5, 1fr);
}

.segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 8px 4px;
  cursor: pointer;
  transition: background 0.2s ease;
  min-height: 54px;
}

.segment:hover:not(.active):not(.input-segment) {
  background: rgba(255, 255, 255, 0.04);
}

.segment.active {
  background: var(--surface-4);
}

.segment-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.segment.active .segment-label {
  color: var(--text);
}

.segment-value {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.segment.active .segment-value {
  color: var(--text);
}

.input-segment {
  cursor: default;
  padding: 4px;
  gap: 4px;
}

.input-segment input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 0.875rem;
  text-align: center;
  font-family: inherit;
}

.input-segment input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.settings-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.reset-button {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.reset-button:hover {
  background: rgba(245, 125, 15, 0.2);
}

.app-shell[data-trade-mode="market"] [data-mode-content="limit"],
.app-shell[data-trade-mode="limit"] [data-mode-content="market"] {
  display: none !important;
}

.limit-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.limit-price-panel {
  flex: 1;
  min-width: 0;
  padding: 14px 15px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.limit-price-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.limit-price-header .token-avatar {
  width: 32px;
  height: 32px;
}

.limit-price-header .token-copy strong {
  font-size: 15px;
}

.limit-price-header .token-copy small {
  font-size: 11px;
}

.limit-price-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}

.limit-amount {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.limit-pair-label {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
}

.swap-pair-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.swap-pair-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.limit-shortcuts {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.shortcut-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.shortcut-button:hover {
  color: var(--accent-hover);
}

.shortcut-button.active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.expiry-panel {
  width: 110px;
  flex: 0 0 auto;
  padding: 14px 15px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.expiry-label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.expiry-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}

.expiry-number {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.expiry-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.expiry-select:hover {
  color: var(--accent-hover);
}

.expiry-select i {
  font-size: 14px;
}

.limit-warning {
  padding: 14px 16px;
  border-radius: 12px;
  background: #1a2020;
  border-left: 3px solid var(--accent);
  margin-top: 10px;
}

.limit-warning-title {
  margin: 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.limit-warning-text {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.limit-warning-strong {
  background: rgba(245, 125, 15, 0.06);
}

.limit-warning-strong p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.network-fees-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 2px 0;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.network-fees-row i {
  color: #79808a;
}

.network-fees-row strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 500;
}

.network-fees-row strong i {
  color: var(--success);
  font-size: 14px;
}

.active-orders-card {
  min-height: 240px;
}

.orders-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.orders-pane[hidden] {
  display: none !important;
}

.orders-pane-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.orders-pane-title i {
  font-size: 20px;
  color: var(--text-muted);
}

.orders-pane-description {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.orders-wallet-button {
  padding: 0 32px;
}

.token-balance-limit {
  margin: 12px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}
