/* HELIX design system: dark, one accent, quiet motion. */
:root {
  --bg: #06070a;
  --bg-2: #0b0d12;
  --bg-3: #10131a;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef1f6;
  --text-2: #a4acb9;
  --text-3: #6c7484;
  --accent: #5ef2d4;
  --accent-2: #3fd9bb;
  --accent-soft: rgba(94, 242, 212, 0.12);
  --accent-glow: rgba(94, 242, 212, 0.28);
  --green: #4ade80; --green-soft: rgba(74, 222, 128, 0.14);
  --amber: #fbbf24; --amber-soft: rgba(251, 191, 36, 0.14);
  --red: #fb7185;   --red-soft: rgba(251, 113, 133, 0.14);
  --info: #a5b4fc;  --info-soft: rgba(165, 180, 252, 0.14);
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
  --shadow-2: 0 20px 60px rgba(0, 0, 0, 0.55);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.55; color: var(--text); background: var(--bg);
  background-image: radial-gradient(900px 500px at 15% -10%, rgba(94, 242, 212, 0.07), transparent 60%);
  background-repeat: no-repeat; -webkit-font-smoothing: antialiased; font-optical-sizing: auto;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.9em; font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; font-family: var(--display); }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: 1.7rem; line-height: 1.15; letter-spacing: -0.025em; }
h3 { font-size: 1.05rem; font-family: var(--font); }
p { margin: 0 0 1em; }
b, strong { font-weight: 600; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 0.86rem; }
.kicker { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
[hidden] { display: none !important; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 7, 10, 0.72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; letter-spacing: 0.06em; color: var(--text); font-size: 1rem; }
.brand:hover { text-decoration: none; }
.brand svg { width: 24px; height: 24px; display: block; }
.nav-links { display: flex; gap: 2px; }
.nav-links a { color: var(--text-2); padding: 7px 11px; border-radius: 7px; font-weight: 500; font-size: 0.92rem; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* forms */
select, input {
  font: inherit; color: var(--text); background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 9px 11px; outline: none; width: 100%; font-variant-numeric: tabular-nums;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
select { width: auto; cursor: pointer; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=range] { padding: 0; background: none; border: none; accent-color: var(--accent); height: 34px; cursor: pointer; }
input[type=range]:focus { box-shadow: none; }
input::placeholder { color: var(--text-3); }
label { display: flex; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: var(--text-2); font-weight: 500; margin: 0 0 6px; }
.field { margin-bottom: 12px; min-width: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

/* buttons */
.btn {
  font: inherit; font-weight: 500; font-size: 0.92rem; cursor: pointer; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); border-radius: 9px; padding: 10px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; line-height: 1.2;
  transition: transform 140ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.24); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary:disabled { background: var(--accent-soft); color: var(--accent); border-color: transparent; opacity: 0.6; }
.btn-primary, .btn-connect { background: var(--accent); color: #04110e; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover, .btn-connect:hover { background: #7ff5de; border-color: #7ff5de; box-shadow: 0 8px 30px var(--accent-glow); }
.btn-danger { color: var(--red); border-color: rgba(251, 113, 133, 0.4); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn svg { display: block; }

/* tags, pills */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.01em; line-height: 1.5; vertical-align: middle; }
.tag-ok { background: var(--green-soft); color: var(--green); }
.tag-warn { background: var(--amber-soft); color: var(--amber); }
.tag-bad { background: var(--red-soft); color: var(--red); }
.tag-info { background: var(--info-soft); color: var(--info); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 0.8rem; }
.pill.warn { border-color: rgba(251, 191, 36, 0.45); color: var(--amber); background: var(--amber-soft); gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.warn { background: var(--amber); }

/* landing: hero */
.hero { position: relative; padding: 104px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 20%, transparent 75%);
}
.hero .wrap { position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; }
.hero h1 { max-width: 12ch; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { font-size: 1.2rem; color: var(--text-2); max-width: 42ch; margin: 22px 0 30px; line-height: 1.5; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.helix-art { width: 100%; max-width: 380px; margin: 0 auto; display: block; filter: drop-shadow(0 0 28px rgba(94, 242, 212, 0.18)); }
@keyframes flow { to { stroke-dashoffset: -440; } }
.helix-art .strand { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 12 10; animation: flow 14s linear infinite; }
.helix-art .strand.a { stroke: var(--accent); }
.helix-art .strand.b { stroke: rgba(255, 255, 255, 0.45); animation-direction: reverse; }
.helix-art .rung { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.5; }
.helix-art .node { fill: var(--accent); }
.helix-art .ring { fill: none; stroke: rgba(94, 242, 212, 0.18); stroke-width: 1; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 72px; }
.fact { padding: 22px 20px 22px 0; }
.fact + .fact { padding-left: 24px; border-left: 1px solid var(--line); }
.fact .n { font-family: var(--display); font-size: 2.1rem; letter-spacing: -0.03em; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.fact .l { color: var(--text-3); font-size: 0.86rem; margin-top: 8px; }

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head .small { color: var(--text-3); }
.section-intro { color: var(--text-2); max-width: 56ch; margin: -14px 0 30px; font-size: 1.02rem; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 22px 20px; min-height: 150px; position: relative; transition: border-color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .step:hover { border-color: rgba(94, 242, 212, 0.35); } }
.step .n { font-family: var(--mono); font-size: 0.74rem; color: var(--accent); letter-spacing: 0.1em; margin-bottom: 22px; }
.step h3 { font-family: var(--display); font-size: 1.12rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.step p { color: var(--text-2); font-size: 0.95rem; margin: 0; line-height: 1.5; }

.notice { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-lg); padding: 20px 22px; color: var(--text-2); font-size: 1rem; }
.notice b { color: var(--text); }
.notice p:last-child { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.tile .n { font-family: var(--display); font-size: 2rem; letter-spacing: -0.03em; font-weight: 600; line-height: 1; color: var(--accent); }
.tile .l { color: var(--text-2); margin-top: 12px; font-size: 0.95rem; line-height: 1.5; }

.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 0.78rem; padding: 0 12px 10px 0; border-bottom: 1px solid var(--line-2); letter-spacing: 0.02em; }
.table td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.table td:first-child { color: var(--text); font-weight: 600; font-family: var(--display); font-size: 1.05rem; }
.table .num { font-family: var(--mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.table-wrap { overflow-x: auto; }

.defs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.def { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.def .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.def .ic svg { width: 18px; height: 18px; }
.def h3 { font-family: var(--display); font-size: 1.05rem; margin-bottom: 8px; }
.def p { color: var(--text-2); font-size: 0.93rem; margin: 0; line-height: 1.5; }
.status-line { margin-top: 28px; display: flex; gap: 10px 22px; flex-wrap: wrap; color: var(--text-3); font-size: 0.88rem; font-family: var(--mono); }
.status-line span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 9px; vertical-align: middle; }

footer { border-top: 1px solid var(--line); padding: 30px 0 48px; color: var(--text-3); font-size: 0.86rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--text-2); }

/* app: stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.stat .k { font-size: 0.78rem; color: var(--text-3); font-weight: 500; }
.stat .v { font-family: var(--mono); font-size: 1rem; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .s { font-size: 0.76rem; color: var(--text-3); margin-top: 4px; line-height: 1.4; }
.banner { border: 1px solid rgba(251, 191, 36, 0.4); background: var(--amber-soft); color: #fde68a; border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-size: 0.92rem; }

/* app: panels */
.app-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; align-items: stretch; }
.app-grid > div { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.app-grid > div > .panel { margin: 0 !important; }
.app-grid > div > .panel:last-child { flex: 1; }
.app-grid > .wide { grid-column: 1 / -1; }
.pos-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pos-list.one { grid-template-columns: 1fr; }
.pos-list > .pos { margin: 0; }
.pos-list > .empty { grid-column: 1 / -1; }
.escrow { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.86rem; }
.escrow .k { color: var(--text-3); margin-right: 8px; }
.escrow .v { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.escrow .btn { margin-left: auto; }
#params .kv.more { display: none; }
#params.open .kv.more { display: flex; }
.params-toggle { margin-top: 12px; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; position: relative; }
.panel::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(94, 242, 212, 0.5), transparent); }
.panel h3 { margin-bottom: 4px; font-family: var(--display); font-size: 1.25rem; letter-spacing: -0.015em; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.panel-head h3 { margin: 0; }
.plabel { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.input-wrap { position: relative; }
.input-wrap input { padding: 12px 56px 12px 14px; font-family: var(--mono); font-size: 1.05rem; }
.input-wrap .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 0.76rem; color: var(--text-3); pointer-events: none; letter-spacing: 0.04em; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.lev { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 10px; margin: 2px 0 12px; }
.lev-head { display: flex; justify-content: space-between; align-items: baseline; }
.lev-label { font-size: 0.82rem; color: var(--text-2); font-weight: 500; }
.lev-val { font-family: var(--display); font-size: 1.7rem; font-weight: 600; color: var(--accent); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.lev input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 8px 0 0; --p: 36%; }
.lev input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) 0 var(--p), rgba(255, 255, 255, 0.14) var(--p) 100%); }
.lev input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-3); margin-top: -7px; box-shadow: 0 0 0 1px rgba(94, 242, 212, 0.55), 0 0 16px var(--accent-glow); cursor: pointer; }
.lev input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); }
.lev input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.lev input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-3); box-shadow: 0 0 0 1px rgba(94, 242, 212, 0.55), 0 0 16px var(--accent-glow); }
.lev-scale { position: relative; height: 16px; font-family: var(--mono); font-size: 0.68rem; color: var(--text-3); margin: 0 9px; }
.lev-scale span { position: absolute; transform: translateX(-50%); }
.lev-scale span:first-child { transform: none; }
.lev-scale span:last-child { transform: translateX(-100%); }
.lev-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.lev-picks { display: flex; gap: 6px; }
.chip-pick { font: inherit; font-family: var(--mono); font-size: 0.74rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease, transform 140ms var(--ease-out); }
.chip-pick:hover { border-color: rgba(94, 242, 212, 0.5); color: var(--text); }
.chip-pick:active { transform: scale(0.96); }
.chip-pick.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.preview-head { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); padding: 10px 0 2px; }
.panel .sub { color: var(--text-2); font-size: 0.88rem; margin-bottom: 16px; line-height: 1.5; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-2); }
.kv .v { font-family: var(--mono); font-size: 0.84rem; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.preview { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 14px; margin: 8px 0 14px; }
.pos { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; background: var(--bg-3); }
.pos-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pos-head b { font-family: var(--mono); font-weight: 500; }
.pos-head > :last-child { margin-left: auto; }
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; font-size: 0.84rem; }
.pos-grid .k { color: var(--text-3); font-size: 0.76rem; }
.pos-grid .v { font-family: var(--mono); font-size: 0.82rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pos-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.rp { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.empty { color: var(--text-3); font-size: 0.88rem; padding: 24px 18px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface); }
.tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px; max-width: 100%; }
.tab { padding: 7px 14px; border: none; background: none; color: var(--text-3); font: inherit; font-weight: 500; font-size: 0.9rem; cursor: pointer; border-radius: 7px; white-space: nowrap; transition: color 150ms ease, background-color 150ms ease; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.tabpane { display: none; }
.tabpane.active { display: block; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* wallet chip + menu */
.chip { position: relative; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-family: var(--mono);
  font-size: 0.8rem; cursor: pointer; transition: border-color 150ms ease;
}
.chip-btn:hover { border-color: rgba(94, 242, 212, 0.5); }
.chip-btn img { width: 18px; height: 18px; border-radius: 5px; }
.chip-net { font-family: var(--font); font-size: 0.72rem; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 6px; box-shadow: var(--shadow-2); z-index: 60; display: flex; flex-direction: column;
  transform-origin: top right; opacity: 1; transform: scale(1);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
@starting-style { .menu { opacity: 0; transform: scale(0.96); } }
.menu.out { opacity: 0; transform: scale(0.97); transition-duration: 120ms; }
.menu button, .menu a { text-align: left; background: none; border: none; color: var(--text); font: inherit; font-size: 0.88rem; padding: 8px 10px; border-radius: 7px; cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu .danger { color: var(--red); }

/* toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 100; max-width: 380px; }
.toast {
  background: var(--bg-3); border: 1px solid var(--line-2); border-left: 3px solid var(--text-3); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 0.88rem; box-shadow: var(--shadow-2); color: var(--text);
  opacity: 1; transform: translateY(0); transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translateY(12px); } }
.toast.out { opacity: 0; transform: translateY(6px); transition-duration: 150ms; }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
.toast a { font-family: var(--mono); font-size: 0.8rem; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 4, 6, 0.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
  opacity: 1; transition: opacity 200ms var(--ease-out);
}
@starting-style { .modal-backdrop { opacity: 0; } }
.modal-backdrop.out { opacity: 0; transition-duration: 150ms; }
.modal {
  width: 100%; max-width: 400px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-2); transform-origin: center; opacity: 1; transform: scale(1);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
@starting-style { .modal { opacity: 0; transform: scale(0.96); } }
.modal-backdrop.out .modal { opacity: 0; transform: scale(0.97); transition-duration: 150ms; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.modal-x { background: none; border: 1px solid var(--line); color: var(--text-2); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1.1rem; }
.modal-x:hover { color: var(--text); border-color: var(--line-2); }
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 140ms var(--ease-out); text-decoration: none;
}
@media (hover: hover) and (pointer: fine) { .wallet-item:hover { border-color: rgba(94, 242, 212, 0.5); background: var(--surface-2); text-decoration: none; } }
.wallet-item:active { transform: scale(0.98); }
.wallet-item img, .wallet-item .ph { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.wallet-item .ph { background: var(--surface-2); }
.wallet-item .sub { display: block; font-weight: 400; color: var(--text-3); font-size: 0.78rem; }
.wallet-item.install { border-style: dashed; }

/* docs */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding: 44px 0 96px; }
.toc { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; font-size: 0.86rem; padding-right: 8px; }
.toc a { display: block; color: var(--text-3); padding: 4px 10px; border-left: 2px solid transparent; line-height: 1.4; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.sub { padding-left: 22px; font-size: 0.8rem; }
.toc .grp { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin: 18px 10px 6px; }
.doc { max-width: 780px; }
.doc .lede { font-size: 1.15rem; color: var(--text-2); line-height: 1.6; }
.doc h1 { font-size: 2.4rem; margin-bottom: 12px; }
.doc h2 { font-size: 1.5rem; margin-top: 64px; padding-top: 26px; border-top: 1px solid var(--line); }
.doc h2:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }
.doc h3 { margin-top: 34px; font-size: 1.05rem; }
.doc p, .doc li { color: var(--text-2); line-height: 1.65; }
.doc li { margin-bottom: 6px; }
.doc ol, .doc ul { padding-left: 22px; }
.doc pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.55; }
.doc code { background: var(--surface-2); padding: 0 5px; border-radius: 4px; font-size: 0.86em; color: var(--text); }
.doc pre code { background: none; padding: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 14px 0 22px; display: block; overflow-x: auto; }
.doc th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 0.78rem; padding: 0 12px 9px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.doc td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.doc td:first-child { color: var(--text); }
.doc .fn { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px 6px; margin: 18px 0; background: var(--bg-2); }
.doc .fn h3 { margin-top: 0; font-family: var(--mono); font-size: 0.92rem; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.doc .fn .meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 18px 0; color: var(--text); }
.callout p:last-child { margin: 0; }
.callout.warn { border-left-color: var(--amber); background: var(--amber-soft); }
.callout.bad { border-left-color: var(--red); background: var(--red-soft); }
.formula { font-family: var(--mono); font-size: 0.86rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin: 10px 0 18px; overflow-x: auto; line-height: 1.7; color: var(--text); }
.plain p { font-size: 1.08rem; color: var(--text); line-height: 1.65; }

@media (prefers-reduced-motion: reduce) {
  .helix-art .strand { animation: none; }
  .btn:active, .wallet-item:active { transform: none; }
  .toast, .menu, .modal, .modal-backdrop { transition-duration: 120ms; transform: none !important; }
  html { scroll-behavior: auto; }
}
@media (max-width: 960px) {
  .hero-grid, .app-grid, .docs { grid-template-columns: 1fr; }
  .pos-list { grid-template-columns: 1fr; }
  .helix-art { max-width: 260px; }
  .steps, .defs, .tiles { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .fact:nth-child(3) { border-left: none; padding-left: 0; }
  .toc { position: static; max-height: none; }
  .hero { padding: 56px 0 40px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .steps, .defs, .tiles, .facts { grid-template-columns: 1fr; }
  .fact + .fact { border-left: none; padding-left: 0; border-top: 1px solid var(--line); }
  .pos-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; }
}

footer .wrap > div:last-child { display: flex; gap: 18px; flex-wrap: wrap; }
