:root {
  color-scheme: light;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f5f5f5;
  --border: #eaeaea;
  --border-strong: #d4d4d4;
  --text: #171717;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.08);
  --good: #0d9373;
  --good-soft: rgba(13, 147, 115, 0.1);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.1);
  --bad: #db2777;
  --bad-soft: rgba(219, 39, 119, 0.1);
  --swap-cta: #f02cc5;
  --swap-cta-soft: #fdeafa;
  --grid-line: rgba(0, 0, 0, 0.04);
  --radius: 8px;
  --radius-sm: 6px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --max: 1120px;
  --topbar-bg: rgba(255, 255, 255, 0.86);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font, Inter), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input {
  font: inherit;
}

button {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.site {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  max-width: var(--max);
  height: 56px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #000000;
  color: #ffffff;
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  line-height: 0.95;
}

.brand small {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.1;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.tabs button {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 550;
  transition: color 0.15s, background 0.15s;
}

.tabs button:hover,
.tabs button.active {
  background: var(--surface-hover);
  color: var(--text);
}

.wallet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.primary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.primary-button svg,
.ghost-button svg,
.icon-button svg,
.action-tile svg,
.flow-notice svg,
.inline-alert svg,
.readiness-item svg,
.hero-pill svg,
.terminal-head svg,
.wallet-chip svg,
.advanced-disclosure summary svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.primary-button {
  padding: 0 13px;
  background: var(--text);
  color: #ffffff;
}

.primary-button:hover {
  background: #333333;
}

.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary-button:disabled:hover {
  background: var(--text);
}

.ghost-button,
.icon-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}

.ghost-button {
  padding: 0 12px;
}

.ghost-button:hover,
.icon-button:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.icon-button {
  width: 32px;
  padding: 0;
}

.wide {
  width: 100%;
}

.main {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.focused-layout {
  width: min(100%, 680px);
  margin: 28px auto 0;
}

.hero {
  padding: 46px 0 28px;
  text-align: center;
}

.hero-center {
  max-width: 760px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
}

.hero-pill span,
.hero-pill a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hero-pill a {
  color: var(--text);
  font-weight: 600;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 64px;
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 700;
}

h1 span {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
}

.hero p {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

h2 {
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 650;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 16px;
}

.bridge-page {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(280px, 1fr);
  align-items: start;
  justify-content: center;
  gap: 16px;
}

.bridge-card,
.market-panel,
.quick-routes,
.plain-panel,
.account-panel,
.signature-panel,
.action-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.bridge-card {
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bridge-card.large {
  max-width: 720px;
}

.flow-hub.simplified {
  width: 100%;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.06);
}

.swap-card {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.finance-card {
  overflow: visible;
  border: 0;
  background: transparent;
}

.page-card-head,
.trade-head,
.price-hero,
.price-readout.large,
.price-calculator,
.tools-section,
.wallet-account-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
}

.page-card-head,
.trade-head,
.price-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  margin-bottom: 12px;
  background: #f7f7f8;
}

.page-card-head h2,
.trade-head h2,
.price-hero h2 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.1;
}

.page-card-head p,
.trade-head p,
.price-hero p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.price-readout.large {
  padding: 24px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.trade-head {
  margin-bottom: 12px;
}

.trade-surface {
  margin-bottom: 12px;
}

.trade-actions {
  padding-top: 0;
}

.trade-page > .inline-alert {
  margin: 12px 4px;
}

.exchange-layout {
  width: min(100%, 760px);
}

.exchange-card {
  display: grid;
  gap: 12px;
}

.exchange-controls,
.token-info-panel,
.market-source-card,
.token-price-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
}

.exchange-controls {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.network-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.network-selector {
  display: grid;
  gap: 8px;
}

.network-selector > span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.network-selector > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-subtle);
}

.network-selector button {
  min-height: 38px;
  border-radius: 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 750;
}

.network-selector button:hover,
.network-selector button.active {
  background: var(--surface);
  color: var(--text);
}

.exchange-asset-selector {
  padding: 0;
}

.exchange-decision {
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 22px;
}

.exchange-decision div {
  display: grid;
  gap: 4px;
}

.exchange-decision span {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.token-info-panel {
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: var(--border);
}

.token-price-card,
.market-source-card {
  border: 0;
  border-radius: 0;
}

.token-price-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}

.token-price-head h2,
.market-source-card h2 {
  margin: 0;
  font-size: 18px;
}

.price-readout.embedded {
  border-bottom: 0;
  padding-bottom: 8px;
}

.market-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
}

.market-source-card {
  padding: 18px 20px;
}

.market-source-card .account-lines {
  margin-top: 14px;
}

.compact-links {
  margin-top: 8px;
}

.compact-links .text-link {
  margin: 8px 12px 0 0;
}

.price-chart {
  display: grid;
  gap: 10px;
  padding: 0 20px 18px;
}

.price-chart svg {
  width: 100%;
  height: 120px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 100% 30px, 64px 100%;
}

.price-chart polyline {
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-chart.bad polyline {
  stroke: var(--bad);
}

.price-chart > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.price-chart strong {
  color: var(--text);
  font-family: var(--mono);
}

.pool-stats {
  margin-top: 12px;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  align-items: center;
}

.source-links .text-link {
  margin: 14px 4px 20px;
}

.price-readout.large strong {
  font-size: 48px;
}

.price-calculator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.65fr);
  gap: 12px;
  align-items: stretch;
  padding: 18px;
  margin-bottom: 12px;
}

.price-calculator .field {
  align-content: center;
}

.price-calculator .field input {
  min-height: 54px;
  font-size: 20px;
}

.calc-result {
  display: grid;
  align-content: center;
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-subtle);
}

.calc-result span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
}

.calc-result strong {
  margin-top: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 22px;
}

.market-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--border);
}

.market-stat-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.clean-link {
  margin-left: 4px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.tools-section {
  overflow: hidden;
  margin-bottom: 12px;
  padding: 0;
}

.endpoint-panel {
  padding: 20px;
}

.wallet-stack {
  display: grid;
  gap: 12px;
}

.wallet-account-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.wallet-account-card h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.swap-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 8px 12px;
}

.swap-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
}

.swap-tabs button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 700;
}

.swap-tabs button:hover,
.swap-tabs button.active {
  background: var(--surface-hover);
  color: var(--text);
}

.settings-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text-secondary);
}

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

.settings-button svg {
  width: 20px;
  height: 20px;
}

.swap-surface {
  position: relative;
  display: grid;
  gap: 0;
}

.swap-panel {
  min-height: 188px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid transparent;
  background: #f7f7f8;
}

.from-panel {
  border-radius: 28px;
}

.to-panel {
  border-color: var(--border);
  border-radius: 28px;
  background: var(--surface);
}

.swap-panel-top,
.swap-amount-row,
.swap-subline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.swap-panel-top > span {
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 650;
}

.network-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.amount-input,
.amount-output {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 50px;
  font-weight: 500;
  line-height: 1;
  outline: none;
}

.amount-input::placeholder {
  color: #a1a1aa;
}

.amount-output {
  display: block;
  color: var(--text);
}

.asset-pill {
  min-height: 48px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

.asset-pill strong {
  font-size: 16px;
  font-weight: 750;
}

.asset-pill small {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
}

.asset-dot {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e9fff3;
  color: #16a34a;
  font-size: 13px;
  font-weight: 800;
}

.swap-subline {
  min-height: 22px;
  color: var(--text-secondary);
  font-size: 14px;
}

.swap-subline strong {
  color: var(--bad);
  font-family: var(--mono);
  font-size: 13px;
}

.swap-center-button {
  position: relative;
  z-index: 2;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: -18px auto;
  border: 6px solid var(--bg);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
}

.swap-center-button:hover {
  background: var(--surface-hover);
}

.swap-center-button svg {
  width: 24px;
  height: 24px;
  transform: rotate(90deg);
}

.asset-selector {
  display: grid;
  gap: 8px;
  padding: 12px 4px 0;
}

.asset-selector > span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.asset-selector > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.asset-selector button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.asset-selector button:hover,
.asset-selector button.active {
  border-color: rgba(99, 102, 241, 0.36);
  background: var(--accent-soft);
  color: var(--accent);
}

.route-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.route-summary-line strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.swap-card .action-form {
  padding: 12px 0 0;
}

.swap-card .button-row {
  padding-top: 0;
}

.swap-card .button-row .primary-button {
  min-height: 58px;
  border-radius: 22px;
  background: var(--swap-cta-soft);
  color: var(--swap-cta);
  font-size: 18px;
  font-weight: 800;
}

.swap-card .button-row .primary-button:hover {
  background: #fbdcf5;
}

.swap-card .button-row .ghost-button {
  min-height: 58px;
  border-radius: 22px;
  font-size: 15px;
}

.bridge-card-head,
.panel-headline,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.simple-head {
  align-items: flex-start;
}

.card-subtitle {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.market-badge {
  min-width: 118px;
  display: grid;
  gap: 2px;
  justify-items: end;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  text-align: right;
}

.market-badge span,
.market-badge small {
  color: var(--text-tertiary);
  font-size: 11px;
}

.market-badge strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.section-heading {
  padding: 0 0 14px;
  margin-bottom: 16px;
}

.section-heading.compact {
  padding: 0;
  border-bottom: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.flow-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.human-chooser {
  display: grid;
  gap: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--border);
}

.route-builder {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.route-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.chain-card,
.what-card {
  display: grid;
  gap: 10px;
}

.chain-card > span,
.what-card > span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.chain-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 72px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.chain-options button {
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-align: left;
}

.chain-options button:hover,
.chain-options button.active {
  background: var(--surface);
  color: var(--text);
}

.chain-options button.active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chain-options strong,
.chain-options span {
  display: block;
}

.chain-options strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.chain-options span {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.swap-route-button {
  width: 44px;
  height: 44px;
  align-self: end;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
}

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

.swap-route-button svg {
  width: 17px;
  height: 17px;
}

.chooser-block {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  background: var(--surface);
}

.chooser-block h3,
.human-outcome h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented-control button,
.asset-choice-grid button {
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.segmented-control button {
  padding: 12px;
}

.segmented-control button:hover,
.segmented-control button.active,
.asset-choice-grid button:hover,
.asset-choice-grid button.active {
  border-color: rgba(99, 102, 241, 0.42);
  background: #fbfbff;
  color: var(--text);
}

.segmented-control button.active,
.asset-choice-grid button.active {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.segmented-control strong,
.segmented-control span,
.asset-choice-grid strong,
.asset-choice-grid small {
  display: block;
}

.segmented-control strong,
.asset-choice-grid strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.segmented-control span,
.asset-choice-grid small {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.asset-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.asset-choice-grid button {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
}

.asset-choice-grid svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--accent);
}

.human-outcome {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.human-outcome p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.chain-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.chain-path span {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.chain-path svg {
  width: 16px;
  height: 16px;
  justify-self: center;
  color: var(--text-tertiary);
}

.route-mini {
  display: grid;
  grid-template-columns: 1fr 34px 1fr 1fr;
  gap: 8px;
  align-items: stretch;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.route-mini > div,
.route-icon {
  min-height: 54px;
  display: grid;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.route-mini > div {
  padding: 10px;
}

.route-mini span {
  color: var(--text-secondary);
  font-size: 11px;
}

.route-mini strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.route-icon {
  place-items: center;
  color: var(--text-tertiary);
}

.route-icon svg {
  width: 15px;
  height: 15px;
}

.flow-picker button {
  min-height: 116px;
  padding: 16px;
  background: var(--surface);
  color: var(--text-secondary);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.flow-picker button:hover,
.flow-picker button.active {
  background: var(--bg-subtle);
  color: var(--text);
}

.flow-picker button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.flow-picker strong,
.flow-picker span,
.flow-picker small {
  display: block;
}

.flow-picker strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.flow-picker span {
  max-width: 260px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
}

.flow-picker small {
  margin-top: 10px;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.35;
}

.flow-stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.flow-stepper li {
  min-height: 0;
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.flow-stepper li:last-child {
  border-bottom: 0;
}

.step-index {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.flow-stepper strong,
.flow-stepper small {
  display: block;
}

.flow-stepper strong {
  font-size: 12px;
  font-weight: 650;
}

.flow-stepper small {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
}

.soft-disclosure {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.soft-disclosure summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 20px;
  cursor: pointer;
  list-style: none;
}

.soft-disclosure summary::-webkit-details-marker {
  display: none;
}

.soft-disclosure summary span {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.soft-disclosure summary small {
  color: var(--text-tertiary);
  font-size: 12px;
}

.soft-disclosure[open] summary {
  border-bottom: 1px solid var(--border);
}

.soft-disclosure .flow-stepper,
.disclosure-body,
.review-block {
  padding: 14px 20px 18px;
}

.soft-disclosure .button-row {
  margin: 0 20px 18px;
}

.soft-disclosure.compact .disclosure-body {
  display: grid;
  gap: 10px;
}

.flow-notice {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.flow-notice strong,
.flow-notice p {
  display: block;
}

.flow-notice strong {
  font-size: 13px;
  font-weight: 650;
}

.flow-notice p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
}

.asset-field span,
.field span,
.market-panel span,
.data-line span,
.metric span,
.route-chip small,
.plain-panel p,
.action-tile small,
.flow-stepper small,
.flow-notice p,
.review-block span,
.review-block p,
.wallet-check span,
.wallet-chip small {
  color: var(--text-secondary);
}

.bridge-form,
.signature-panel {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
}

.wallet-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.wallet-check strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.wallet-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.wallet-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.wallet-chip.ready {
  border-color: rgba(13, 147, 115, 0.28);
  color: var(--good);
}

.wallet-chip small {
  font-size: 11px;
}

.review-block {
  display: grid;
  gap: 10px;
  border: 0;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--border);
}

.review-grid div {
  min-height: 58px;
  padding: 10px;
  background: var(--surface);
}

.review-grid span,
.review-grid strong {
  display: block;
}

.review-grid span {
  font-size: 11px;
}

.review-grid strong {
  margin-top: 5px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.review-block p {
  font-size: 12px;
  line-height: 1.45;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.preset-row button {
  min-height: 32px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.preset-row button:hover,
.preset-row button.active {
  background: var(--surface);
  color: var(--text);
}

.preset-row button.active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.asset-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.asset-field strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.asset-field small {
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 13px;
  font-weight: 550;
}

.field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.field small {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button-row .primary-button,
.button-row .ghost-button {
  min-height: 40px;
}

.flow-hub .button-row .primary-button {
  flex: 1;
}

.market-panel,
.quick-routes,
.plain-panel,
.account-panel {
  overflow: hidden;
}

.price-readout {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.price-readout strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 650;
  letter-spacing: 0;
}

.price-readout small {
  display: block;
  margin-top: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.market-list,
.data-list,
.account-lines,
.readiness-list {
  display: grid;
}

.market-list {
  padding: 0 20px;
}

.text-link {
  display: inline-flex;
  margin: 14px 20px 20px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

.quick-routes {
  margin-top: 16px;
}

.route-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
}

.route-chip {
  min-height: 92px;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: background 0.15s;
}

.route-chip:hover {
  background: var(--bg-subtle);
}

.route-chip span,
.route-chip small {
  display: block;
}

.route-chip span {
  font-size: 14px;
  font-weight: 650;
}

.route-chip small {
  margin-top: 6px;
  font-size: 12px;
}

.side-stack {
  display: grid;
  gap: 10px;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.plain-panel,
.account-panel {
  padding: 18px;
}

.plain-panel p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.action-tile {
  display: flex;
  width: 100%;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: var(--text);
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.action-tile:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.action-tile strong,
.action-tile small {
  display: block;
}

.action-tile strong {
  font-size: 13px;
  font-weight: 650;
}

.action-tile small {
  margin-top: 3px;
  font-size: 11px;
}

.tile-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.terminal-box {
  overflow: hidden;
  border: 1px solid #262626;
  border-radius: var(--radius-sm);
  background: #09090b;
  color: #fafafa;
}

.terminal-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-head span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 650;
}

.terminal-head .icon-button {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
}

.terminal-box pre {
  margin: 0;
  overflow-x: auto;
  padding: 14px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
}

.signature-panel {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-subtle);
}

.advanced-disclosure summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  cursor: pointer;
  list-style: none;
}

.advanced-disclosure summary::-webkit-details-marker {
  display: none;
}

.advanced-disclosure summary strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.advanced-disclosure[open] summary {
  border-bottom: 1px solid var(--border);
}

.advanced-disclosure .section-heading {
  margin: 0;
  padding: 14px 20px 0;
}

.advanced-disclosure > .field,
.advanced-disclosure > .two-col,
.advanced-disclosure > .button-row,
.advanced-disclosure > .inline-alert {
  margin-left: 20px;
  margin-right: 20px;
}

.advanced-disclosure > .field {
  margin-top: 14px;
}

.advanced-disclosure > .button-row {
  margin-top: 10px;
  margin-bottom: 20px;
}

.advanced-disclosure > .inline-alert {
  margin-bottom: 20px;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-pill.idle {
  color: var(--text-tertiary);
}

.status-pill.loading {
  border-color: rgba(180, 83, 9, 0.25);
  color: var(--warn);
}

.status-pill.success {
  border-color: rgba(13, 147, 115, 0.28);
  color: var(--good);
}

.status-pill.error {
  border-color: rgba(219, 39, 119, 0.25);
  color: var(--bad);
}

.inline-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.45;
}

.bridge-card > .inline-alert,
.market-panel > .inline-alert {
  margin: 12px 20px 20px;
}

.inline-alert.success {
  border-color: rgba(13, 147, 115, 0.28);
  background: var(--good-soft);
  color: var(--good);
}

.inline-alert.error {
  border-color: rgba(219, 39, 119, 0.25);
  background: var(--bad-soft);
  color: var(--bad);
}

.inline-alert.neutral {
  border-color: rgba(99, 102, 241, 0.24);
  background: var(--accent-soft);
  color: var(--accent);
}

.inline-alert a {
  display: inline-flex;
  margin-left: auto;
}

.data-line,
.readiness-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.data-line:last-child,
.readiness-item:last-child {
  border-bottom: 0;
}

.data-line strong,
.readiness-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.wallet-grid,
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-panel h1,
.status-grid h1 {
  font-family: inherit;
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}

.account-panel .primary-button {
  margin-top: 16px;
  min-height: 40px;
}

.wallet-balances {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

.metric {
  min-height: 78px;
  padding: 14px;
  background: var(--surface);
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.readiness-item {
  justify-content: flex-start;
}

.readiness-item span {
  flex: 1;
}

.readiness-item svg {
  color: var(--good);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(420px, calc(100% - 40px));
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.toast.success {
  border-color: rgba(13, 147, 115, 0.28);
  color: var(--good);
}

.toast.error {
  border-color: rgba(219, 39, 119, 0.25);
  color: var(--bad);
}

.spin {
  animation: spin 1s linear infinite;
}

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

@media (max-width: 980px) {
  h1 {
    font-size: 56px;
  }

  .topbar-inner {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 16px;
  }

  .tabs {
    order: 10;
    flex: 0 0 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tabs button {
    white-space: nowrap;
  }

  .workspace-grid,
  .bridge-page,
  .wallet-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .market-panel {
    order: -1;
  }

  .route-strip,
  .flow-picker,
  .wallet-balances {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools-grid,
  .market-stat-grid,
  .market-stat-grid.compact {
    grid-template-columns: 1fr;
  }

  .network-selectors,
  .market-source-grid {
    grid-template-columns: 1fr;
  }

  .price-calculator {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 24px 12px 44px;
  }

  .brand small {
    display: none;
  }

  .wallet-actions {
    width: 100%;
  }

  .wallet-actions button {
    flex: 1;
  }

  h1 {
    font-size: 40px;
  }

  .hero {
    padding: 28px 0 22px;
  }

  .hero p {
    font-size: 14px;
  }

  .hero-pill {
    flex-wrap: wrap;
  }

  .two-col,
  .preset-row,
  .route-strip,
  .flow-picker,
  .route-builder-grid,
  .segmented-control,
  .asset-choice-grid,
  .review-grid,
  .wallet-balances {
    grid-template-columns: 1fr;
  }

  .chain-path {
    grid-template-columns: 1fr;
  }

  .chain-path svg {
    transform: rotate(90deg);
  }

  .swap-route-button {
    width: 100%;
    border-radius: var(--radius-sm);
  }

  .swap-route-button svg {
    transform: rotate(90deg);
  }

  .chain-options {
    min-height: 0;
  }

  .focused-layout {
    margin-top: 12px;
  }

  .route-mini {
    grid-template-columns: 1fr;
  }

  .simple-head {
    flex-direction: column;
  }

  .market-badge {
    width: 100%;
    justify-items: start;
    text-align: left;
  }

  .route-mini {
    gap: 6px;
  }

  .route-icon {
    min-height: 34px;
  }

  .button-row,
  .wallet-actions,
  .wallet-check {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row button,
  .button-row a,
  .wallet-actions button,
  .wallet-chip {
    width: 100%;
  }

  .wallet-chip-row {
    justify-content: stretch;
  }

  .bridge-card-head,
  .panel-headline,
  .section-heading {
    align-items: flex-start;
  }

  .plain-panel,
  .account-panel {
    padding: 16px;
  }

  .swap-tabs-row {
    padding-left: 0;
    padding-right: 0;
  }

  .swap-tabs {
    gap: 4px;
  }

  .swap-tabs button {
    padding: 0 10px;
    font-size: 13px;
  }

  .swap-panel {
    min-height: 168px;
    padding: 18px;
    border-radius: 20px;
  }

  .swap-amount-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .amount-input,
  .amount-output {
    font-size: 42px;
  }

  .asset-pill {
    align-self: flex-end;
  }

  .route-summary-line,
  .swap-subline {
    align-items: flex-start;
    flex-direction: column;
  }

  .swap-card .button-row .primary-button,
  .swap-card .button-row .ghost-button {
    min-height: 52px;
    border-radius: 18px;
  }

  .page-card-head,
  .trade-head,
  .price-hero {
    flex-direction: column;
    border-radius: 20px;
    padding: 18px;
  }

  .price-readout.large,
  .price-calculator,
  .tools-section,
  .wallet-account-card,
  .market-stat-grid {
    border-radius: 20px;
  }

  .price-readout.large strong {
    font-size: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
