:root {
  --bg: #0b0e13;
  --surface: #12161d;
  --surface-2: #181d26;
  --line: #222833;
  --line-strong: #333b48;
  --text: #eceef2;
  --muted: #8e96a3;
  --dim: #5e6673;
  --accent: #ff8a3d;
  --accent-hover: #ff9d5c;
  --warn: #f2766b;
  --radius: 14px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.02em; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: min(1120px, 100% - 40px); margin: 0 auto; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 14px; }
.wrap-any { overflow-wrap: anywhere; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(11, 14, 19, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.brand img { display: block; border-radius: 6px; }
.brand.small { font-size: 15px; }
.nav { display: flex; gap: 22px; margin-right: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--text); }

/* Buttons */
.btn { border: 1px solid var(--line-strong); background: transparent; border-radius: 10px; padding: 9px 16px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:disabled { background: var(--surface-2); color: var(--dim); border-color: var(--line); }
.btn.wide { width: 100%; height: 54px; font-size: 16px; border-radius: 12px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.link:hover { color: var(--text); }
.link.plain { text-decoration: none; color: var(--text); font-size: inherit; text-align: right; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 64px; align-items: start; padding: 88px 0 104px; }
.hero h1 { font-size: clamp(44px, 6.4vw, 80px); line-height: 1; letter-spacing: -0.04em; max-width: 9ch; }
.lede { margin-top: 26px; font-size: 20px; color: var(--muted); max-width: 31ch; }
.facts { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 40px 0 0; }
.facts div { border-left: 1px solid var(--line-strong); padding-left: 14px; }
.facts dt { font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; }
.ca { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 36px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; max-width: 560px; }
.ca-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.ca code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; flex: 1; min-width: 200px; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.swap { padding: 18px; width: 100%; max-width: 460px; justify-self: end; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 14px; }
.card-head h2 { font-size: 18px; }

.field { background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius); padding: 14px 16px 12px; }
.field:focus-within { border-color: var(--line-strong); }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--muted); }
.field-top label, .field-top .label { color: var(--muted); }
.bal { font-size: 13px; color: var(--dim); display: inline-flex; gap: 8px; align-items: baseline; }
.bal .link { font-size: 13px; }
.field-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.amount { flex: 1; width: 0; min-width: 0; background: none; border: 0; color: var(--text); font: 600 32px/1.2 var(--sans); letter-spacing: -0.02em; padding: 0; outline: none; font-feature-settings: "tnum" 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount::placeholder { color: var(--dim); }
.amount.out { display: block; }
.amount.loading { color: var(--dim); }
.token { flex: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 650; font-size: 16px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token:hover { border-color: var(--muted); }
.field-sub { min-height: 20px; margin-top: 2px; font-size: 13px; color: var(--dim); }

.flip-row { display: flex; justify-content: center; margin: -9px 0; position: relative; z-index: 1; }
.flip { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px 12px; font-size: 13px; color: var(--muted); }
.flip:hover { color: var(--text); }

.details { margin: 14px 4px 14px; display: grid; gap: 8px; font-size: 14px; }
.details > div { display: flex; justify-content: space-between; gap: 16px; }
.details dt { color: var(--muted); flex: none; }
.details dd { margin: 0; text-align: right; }
.details .route-row { align-items: flex-start; }
.route-line { display: block; }
.route-line .hop { color: var(--muted); }
.warn { color: var(--warn); }
.swap > .btn.wide { margin-top: 14px; }
.details + .btn.wide { margin-top: 0; }

.status { min-height: 22px; margin-top: 12px; font-size: 14px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.status a { color: var(--text); }
.status.error { color: var(--warn); }
.progress { margin-top: 6px; font-size: 13px; color: var(--dim); text-align: center; }

/* Sections */
.section { border-top: 1px solid var(--line); padding: 96px 0; }
.section h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -0.03em; max-width: 16ch; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { border-top: 1px solid var(--line-strong); padding-top: 20px; }
.steps .num { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.steps h3 { font-size: 22px; margin: 10px 0 8px; }
.steps p { color: var(--muted); max-width: 34ch; }
.prose { display: grid; gap: 16px; color: var(--muted); font-size: 17px; margin-top: 24px; }
.two > .prose { margin-top: 6px; }
.bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.bullets li { padding-left: 22px; position: relative; }
.bullets li::before { content: "—"; position: absolute; left: 0; color: var(--dim); }
.addresses { margin: 12px 0 0; display: grid; gap: 10px; font-size: 14px; }
.addresses dt { color: var(--dim); }
.addresses dd { margin: 2px 0 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

.panel { padding: 22px; }
.panel h3 { font-size: 17px; margin-bottom: 12px; }
.details.tight { margin: 0; }
.rounds { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.rounds th { text-align: left; font-weight: 500; color: var(--dim); border-bottom: 1px solid var(--line); padding: 6px 0; }
.rounds td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.rounds th:last-child, .rounds td:last-child { text-align: right; }

.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--dim); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--muted); margin-top: 10px; max-width: 60ch; }

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; }
.foot-inner { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.foot-inner a { color: var(--muted); }

/* Dialogs */
dialog.sheet { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 18px; padding: 0; width: min(460px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 48px)); overflow: hidden; }
dialog.sheet.narrow { width: min(380px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.sheet-inner { display: flex; flex-direction: column; gap: 14px; padding: 18px; max-height: calc(min(640px, calc(100vh - 48px)) - 2px); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { font-size: 17px; }
.search, .custom input { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 11px 12px; font: inherit; outline: none; }
.search:focus, .custom input:focus { border-color: var(--line-strong); }
.list { list-style: none; margin: 0 -6px; padding: 0; overflow-y: auto; min-height: 0; }
.list button { width: 100%; display: flex; align-items: baseline; gap: 10px; text-align: left; background: none; border: 0; border-radius: 10px; padding: 10px; }
.list button:hover, .list button:focus-visible { background: var(--surface-2); }
.list .sym { font-weight: 650; }
.list .name { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.list .tag { font-size: 12px; color: var(--dim); flex: none; }
.list .addr { font-family: var(--mono); font-size: 12px; color: var(--dim); flex: none; }
.hint { font-size: 13px; color: var(--dim); }
.hint a { color: var(--muted); }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; }
.chips button { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 0; font-weight: 600; }
.chips button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.custom { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.custom input { width: 90px; }

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; padding: 56px 0 72px; }
  .swap { justify-self: stretch; max-width: none; }
  .two { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .steps { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .top-inner { justify-content: space-between; }
  .amount { font-size: 28px; }
}
