:root {
  --page: #2747E8;
  --page-dot: #3152EE;
  --ink: #0E1433;
  --paper: #fff;
  --soft: #F3F5FC;
  --band: #E6EBFF;
  --line: #E1E5F2;
  --muted: #5B6385;
  --sun: #FFD23F;
  --coral: #FF6B3D;
  --up: #0F8A55;
  --down: #D63B42;
  --r: 20px;
  --r-sm: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--page);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='4' cy='4' r='2' fill='%233152EE'/%3E%3Ccircle cx='18' cy='18' r='2' fill='%233152EE'/%3E%3C/svg%3E");
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.num, td, .fig b { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* header */
.top { color: #fff; }
.top-in { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.brand span { font-family: 'Bricolage Grotesque', 'Manrope', sans-serif; font-weight: 800; font-size: 25px; letter-spacing: -0.02em; }
.brand.sm svg { width: 26px; height: 26px; }
.brand.sm span { font-size: 19px; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; color: #DCE3FF; }
.top nav a:hover { color: #fff; background: #3657F0; }
.top nav a[aria-current] { background: #fff; color: var(--ink); }
#wallet { position: relative; }
.menu { position: absolute; right: 0; top: 46px; background: var(--paper); color: var(--ink); border-radius: var(--r-sm); border: 1px solid var(--line); min-width: 170px; padding: 6px; z-index: 20; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--soft); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); margin-right: 7px; }
.preview-note { background: var(--ink); color: #C9D1FF; font-size: 13px; padding: 7px 0; }
.preview-note a { color: var(--sun); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; background: var(--sun); color: var(--ink); font-weight: 700; padding: 10px 18px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #FFDC5E; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.top .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1px #6A84F5; }
.btn.ink { background: var(--ink); color: #fff; }
.btn.ink:hover { background: #222A52; }
.btn.wide { width: 100%; padding: 13px; font-size: 16px; }
.btn[disabled] { background: var(--soft); color: #9AA1BE; cursor: not-allowed; }
.pill { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.pill[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* panels */
.panel { background: var(--paper); border-radius: var(--r); padding: 20px; }
.panel h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.badge.ok { background: #DDF5E9; color: #0B6B42; }

/* token marks */
.mk { width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; flex: none; line-height: 1; overflow: hidden; }
.mk-tt { position: relative; display: inline-flex; flex: none; }
.mk-tt i { position: absolute; left: -3px; right: -3px; bottom: -1px; height: 6px; border-radius: 3px; background: var(--sun); box-shadow: 0 0 0 2px var(--paper); transform: rotate(-12deg); }

/* tilt */
.tilt path { fill: var(--ink); }
.tilt rect { fill: #B7C2EC; transition: transform .4s; }
.tilt.out rect { fill: var(--coral); }

/* home */
.intro { color: #fff; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 34px 0 22px; }
.intro h1 { margin: 0 0 6px; font-size: 34px; letter-spacing: -0.02em; line-height: 1.1; }
.intro p { margin: 0; color: #DCE3FF; max-width: 560px; font-size: 16px; }
.figs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--paper); border-radius: var(--r); margin-bottom: 14px; }
.fig { padding: 14px 18px; border-left: 1px solid var(--line); }
.fig:first-child { border-left: 0; }
.fig span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fig b { font-size: 20px; font-weight: 800; }
.board-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.board-tools .grow { flex: 1; }
.search { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; width: 200px; background: var(--soft); }
.sort { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; background: var(--paper); font-weight: 600; font-size: 13.5px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
.board tbody tr { cursor: pointer; }
.board tbody tr:hover td { background: var(--soft); }
.sw { display: flex; align-items: center; gap: 11px; }
.sw b { display: block; font-size: 15.5px; }
.sw small { color: var(--muted); font-size: 12.5px; }
.gapcell { display: flex; align-items: center; gap: 8px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.flow { margin-top: 14px; }
.flow-bar { display: flex; height: 44px; border-radius: 12px; overflow: hidden; margin: 6px 0 12px; }
.flow-bar div { display: grid; place-items: center; font-weight: 800; font-size: 13px; min-width: 0; overflow: hidden; }
.flow-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.flow-legend div { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.flow-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; margin-top: 4px; }
.flow-legend b { display: block; font-size: 16px; }

/* seesaw page */
.crumb { color: #DCE3FF; padding: 22px 0 12px; font-size: 14px; }
.crumb a { color: #fff; }
.head { display: flex; align-items: center; gap: 14px; color: #fff; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; }
.head p { margin: 2px 0 0; color: #DCE3FF; }
.head .badge { background: #3657F0; color: #fff; }
.head .badge.ok { background: #DDF5E9; color: #0B6B42; }
.layout { display: grid; grid-template-columns: 1fr 370px; gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.stats > div { padding: 4px 16px 10px; border-left: 1px solid var(--line); }
.stats > div:nth-child(3n+1) { border-left: 0; padding-left: 0; }
.stats > div:nth-child(n+4) { padding-top: 12px; border-top: 1px solid var(--line); }
.stats span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stats b { font-size: 18px; }
.stats small { font-size: 12.5px; }
.chart-tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.chart-tabs .grow { flex: 1; }
.chart { position: relative; height: 270px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .ax { font-size: 11px; fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .band { fill: var(--band); }
.chart .edge { stroke: #9FB0F2; stroke-dasharray: 4 4; stroke-width: 1; }
.chart .ln { fill: none; stroke: var(--page); stroke-width: 2; stroke-linejoin: round; }
.chart .ln.alt { stroke: var(--coral); }
.chart .zero { stroke: var(--ink); stroke-width: 1; shape-rendering: crispEdges; }
.chart .cross { stroke: var(--ink); stroke-width: 1; shape-rendering: crispEdges; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; }
.chart-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.acts td { font-size: 14px; padding: 9px 10px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.tag.wrap { background: #FFF4C7; color: #6E5300; }
.tag.unwrap { background: #FFE3D8; color: #8A2E0C; }
.tag.buy { background: #DDF5E9; color: #0B6B42; }
.tag.sell { background: #FCE1E2; color: #9B2228; }
.addr-link { color: var(--muted); text-decoration: none; font-size: 13px; }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--soft); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 8px 0; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.field { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 10px; }
.field:focus-within { border-color: var(--page); }
.field label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field .in { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.field input { border: 0; outline: 0; font-size: 24px; font-weight: 700; width: 100%; min-width: 0; background: none; padding: 0; }
.field .unit { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.linkish { border: 0; background: none; padding: 0; color: var(--page); font-weight: 700; cursor: pointer; font-size: 12.5px; }
.lines { margin: 4px 0 14px; font-size: 13.5px; }
.lines div { display: flex; justify-content: space-between; padding: 4px 0; }
.lines span { color: var(--muted); }
.slip { display: flex; gap: 6px; align-items: center; font-size: 13px; margin-bottom: 12px; }
.slip span { color: var(--muted); flex: 1; }
.form-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.fee-table td, .fee-table th { padding: 7px 0; font-size: 13.5px; }
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 12px 0 8px; }
.kv { font-size: 13.5px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.kv div:last-child { border: 0; }
.kv span { color: var(--muted); }

/* portfolio */
.sum { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; }
.sum > div { padding: 2px 18px; border-left: 1px solid var(--line); }
.sum > div:first-child { border: 0; padding-left: 0; }
.sum span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sum b { font-size: 22px; }
.gate { text-align: center; padding: 48px 20px; }
.gate h2 { font-size: 20px; }

/* create */
.create { display: grid; grid-template-columns: 1fr 380px; gap: 14px; align-items: start; padding-top: 6px; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.choice button { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 10px; cursor: pointer; text-align: left; display: flex; gap: 9px; align-items: center; font-weight: 700; }
.choice button small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.choice button[aria-pressed="true"] { border-color: var(--page); box-shadow: inset 0 0 0 1px var(--page); background: #F4F6FF; }
.choice.two { grid-template-columns: 1fr 1fr; }
.lbl { font-size: 13px; font-weight: 700; margin: 16px 0 8px; display: block; }
.lbl:first-child { margin-top: 0; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.textin { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-family: ui-monospace, monospace; font-size: 13.5px; }
.range { width: 100%; accent-color: var(--page); }
.steps { margin: 0; padding-left: 20px; font-size: 13.5px; }
.steps li { padding: 3px 0; }

/* docs */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; padding-top: 26px; }
.toc { position: sticky; top: 16px; color: #fff; font-size: 14px; }
.toc a { display: block; padding: 5px 0; color: #DCE3FF; text-decoration: none; }
.toc a:hover { color: #fff; }
.doc { padding: 34px 40px; }
.doc h1 { margin: 0 0 10px; font-size: 30px; letter-spacing: -0.02em; }
.doc h2 { font-size: 21px; margin: 40px 0 10px; padding-top: 6px; scroll-margin-top: 16px; }
.doc h3 { font-size: 16px; margin: 22px 0 6px; }
.doc p, .doc li { max-width: 680px; }
.doc table { max-width: 620px; margin: 12px 0; }
.doc code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: 13.5px; }
.doc dt { font-weight: 800; margin-top: 12px; }
.doc dd { margin: 2px 0 0; max-width: 680px; }

/* footer */
.foot { color: #DCE3FF; margin-top: 50px; padding: 26px 0 34px; border-top: 1px solid #4462F0; }
.foot-in { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.foot p { margin: 0; flex: 1; font-size: 14px; min-width: 240px; }
.foot .brand { color: #fff; }
.foot-links { display: flex; gap: 16px; font-size: 14px; }

/* modal + toast */
.modal { border: 0; border-radius: var(--r); padding: 24px; max-width: 420px; width: calc(100% - 32px); }
.modal::backdrop { background: rgba(14, 20, 51, .55); }
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--muted); margin: 0 0 18px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 80px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; transition: transform .25s; z-index: 50; max-width: calc(100% - 32px); }
.toast.on { transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .layout, .create, .docs { grid-template-columns: 1fr; }
  .toc { display: none; }
  .figs { grid-template-columns: repeat(2, 1fr); }
  .figs .fig:nth-child(odd) { border-left: 0; }
  .figs .fig:nth-child(n+3) { border-top: 1px solid var(--line); }
  .figs .fig:last-child { grid-column: span 2; }
  .flow-legend { grid-template-columns: 1fr 1fr; }
  .sum { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .sum > div:nth-child(3) { border: 0; padding-left: 0; }
}
@media (max-width: 720px) {
  .top-in { gap: 10px; height: auto; padding-top: 12px; padding-bottom: 8px; flex-wrap: wrap; }
  .top nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .brand { flex: 1; }
  .intro { flex-direction: column; align-items: flex-start; padding-top: 24px; }
  .intro h1 { font-size: 28px; }
  .panel { padding: 16px; }
  .board thead { display: none; }
  .board tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 0; border-bottom: 1px solid var(--line); row-gap: 4px; }
  .board tr:last-child { border: 0; }
  .board td { border: 0; padding: 0 2px; }
  .board td[data-k] { font-size: 13px; color: var(--muted); }
  .board td[data-k]::before { content: attr(data-k) ' '; }
  .board td[data-k] b, .board td[data-k] span { color: var(--ink); }
  .board td.r { text-align: right; }
  .board td.go { display: none; }
  .board td:nth-child(3) { order: 1; justify-self: end; }
  .board td:nth-child(3)::before { content: none; }
  .board td:nth-child(2) { order: 2; align-self: center; }
  .board td:nth-child(4) { order: 3; justify-self: end; }
  .board td:nth-child(5) { order: 4; text-align: left; }
  .board td:nth-child(6) { order: 5; justify-self: end; }
  .board td:nth-child(7) { order: 6; text-align: left; }
  .search { width: 100%; order: 5; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div, .stats > div:nth-child(3n+1) { border-left: 0; padding: 8px 0; border-top: 1px solid var(--line); }
  .stats > div:nth-child(-n+2) { border-top: 0; }
  .stats > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
  .chart { height: 220px; }
  .acts .hide-m { display: none; }
  .doc { padding: 22px 18px; }
  .choice { grid-template-columns: 1fr; }
  .flow-legend { grid-template-columns: 1fr; }
  .sum b { font-size: 18px; }
  .sum > div { padding: 0 12px; }
}
img.mk { display: inline-block; object-fit: cover; background: var(--soft); }
.tokens .pill { display: inline-flex; align-items: center; gap: 7px; padding-left: 7px; }
