:root {
  --bg: #EFEDE6; --panel: #FFFFFF; --panel2: #F7F6F2; --ink: #16181A; --muted: #6B6A64; --line: #DEDBD2; --line2: #C9C5BA;
  --red: #E8432E; --up: #1E8A57; --down: #D2362A; --hook: #BDB8AB; --chipbg: #F2F0EA;
  --mono: 'JetBrains Mono', ui-monospace, monospace; --sans: 'Archivo', system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111214; --panel: #1A1C1F; --panel2: #202327; --ink: #ECE9E1; --muted: #9A978F; --line: #2C2F34; --line2: #3A3E44;
  --red: #F05A44; --up: #3DBB7C; --down: #F0604F; --hook: #34373C; --chipbg: #24272B;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono, .num { font-family: var(--mono); font-feature-settings: 'tnum'; }
#lines { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hdr, .main, .foot { position: relative; z-index: 1; }
.in { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* header */
.hdr { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.hdr .in { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 21px; text-decoration: none; letter-spacing: -.02em; }
.nav { display: flex; gap: 2px; margin-left: 10px; }
.nav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--panel2); }
.nav a[aria-current] { color: var(--ink); background: var(--chipbg); }
.chain { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.chain i { width: 8px; height: 8px; border-radius: 50%; background: #CCFF00; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.theme { background: none; border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.theme:hover { color: var(--ink); }
.wbtn, .btn { text-decoration: none; display: inline-block; text-align: center; background: var(--ink); color: var(--bg); border: 0; border-radius: 9px; padding: 9px 16px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.wbtn.on { background: var(--panel2); color: var(--ink); border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; font-weight: 500; }
.btn.red { background: var(--red); color: #fff; }
.btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; padding: 13px; font-size: 16px; }

/* layout */
.main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.pad { padding: 18px 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.sp { flex: 1; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.stack > * + * { margin-top: 18px; }
.sticky { position: sticky; top: 78px; }

/* foot */
.foot { border-top: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.foot .in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 18px; padding-bottom: 18px; }
.foot span:first-child { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot .muted { margin-left: auto; }

/* chips */
.chip { font-size: 12px; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.soon { border-style: dashed; }
.tag.live { color: var(--up); border-color: currentColor; }

/* pools page */
.busy { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.busy a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-decoration: none; min-width: 0; }
.busy a:hover { border-color: var(--line2); }
.busy b { display: block; font-size: 14px; }
.busy span { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.top p { color: var(--muted); max-width: 560px; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.stats > div { padding: 14px 18px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats b { display: block; font: 600 20px var(--mono); margin-top: 2px; }
.stats span { font-size: 13px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.filters button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.filters button i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters select, .filters input { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 9px; font-size: 13px; }
.filters input { width: 170px; }
table.pools { width: 100%; border-collapse: collapse; }
.pools th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pools th.r, .pools td.r { text-align: right; }
.pools td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pools tr:last-child td { border-bottom: 0; }
.pools tbody tr { cursor: pointer; }
.pools tbody tr:hover td { background: var(--panel2); }
.pools .nm { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.ic { border-radius: 9px; object-fit: cover; flex: none; background: var(--chipbg); }
.nm b { display: block; font-weight: 700; }
.nm small { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.house { font-size: 11px; font-weight: 700; color: var(--red); margin-left: 6px; }
td.num { font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.chg.up { color: var(--up); } .chg.down { color: var(--down); }
.fu { animation: fu 1.1s; } .fd { animation: fd 1.1s; }
@keyframes fu { 0% { color: var(--up); } 100% { color: inherit; } }
@keyframes fd { 0% { color: var(--down); } 100% { color: inherit; } }
.feed { display: flex; gap: 8px; overflow: hidden; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.feed span { font-family: var(--mono); color: var(--muted); }
.feed b.up { color: var(--up); } .feed b.down { color: var(--down); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* pool page */
.phead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.phead h1 { font-size: 26px; }
.phead .sub { color: var(--muted); font-size: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ca { font-family: var(--mono); font-size: 13px; background: var(--chipbg); border: 0; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.kv > div { padding: 14px 18px; border-left: 1px solid var(--line); }
.kv > div:first-child { border-left: 0; }
.kv span { font-size: 12px; color: var(--muted); display: block; }
.kv b { font: 600 18px var(--mono); }
canvas.ch { width: 100%; height: 280px; display: block; }
.trades { width: 100%; border-collapse: collapse; font-size: 13px; }
.trades td { padding: 7px 18px; border-top: 1px solid var(--line); font-family: var(--mono); }
.trades td.r { text-align: right; }
.up { color: var(--up); } .down { color: var(--down); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--chipbg); padding: 4px; border-radius: 10px; margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 8px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.amt { display: flex; align-items: center; border: 1px solid var(--line2); border-radius: 10px; padding: 4px 4px 4px 14px; background: var(--panel); }
.amt input { flex: 1; border: 0; background: none; font: 500 22px var(--mono); padding: 8px 0; min-width: 0; outline: none; }
.amt em { font-style: normal; font-weight: 600; padding: 0 10px; color: var(--muted); }
.quick { display: flex; gap: 6px; margin: 8px 0 14px; }
.quick button { flex: 1; border: 1px solid var(--line); background: var(--panel); border-radius: 7px; padding: 5px; font: 12px var(--mono); cursor: pointer; }
.qrows { font-size: 13px; margin-bottom: 14px; }
.qrows div { display: flex; justify-content: space-between; padding: 4px 0; }
.qrows div span:first-child { color: var(--muted); }
.qrows b { font-family: var(--mono); font-weight: 500; }
.blist > div { padding: 14px 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 12px 1fr; gap: 4px 12px; }
.blist > div > i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-top: 6px; }
.blist b { font-weight: 700; }
.blist p { grid-column: 2; color: var(--muted); font-size: 14px; }
.blist .st { grid-column: 2; font: 12px var(--mono); color: var(--muted); }
.calls { display: flex; flex-wrap: wrap; gap: 4px; }
.calls code { font: 12px var(--mono); background: var(--chipbg); padding: 2px 6px; border-radius: 5px; }
.hdr2 { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.hdr2 h2 { font-size: 16px; }
.hdr2 .muted { font-size: 13px; }
.routed > div { display: flex; justify-content: space-between; padding: 8px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.routed b { font-family: var(--mono); font-weight: 500; }

/* launch */
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.fld input[type=text], .fld textarea, .fld select { width: 100%; border: 1px solid var(--line2); background: var(--panel); border-radius: 9px; padding: 10px 12px; outline: none; }
.fld textarea { resize: vertical; min-height: 64px; }
.fld input:focus, .fld textarea:focus { border-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.up-img { display: flex; align-items: center; gap: 14px; }
.up-img label { width: 72px; height: 72px; border: 1px dashed var(--line2); border-radius: 12px; display: grid; place-items: center; cursor: pointer; overflow: hidden; background: var(--panel2); color: var(--muted); font-size: 26px; }
.up-img label img { width: 100%; height: 100%; object-fit: cover; }
.up-img input { display: none; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; border: 1px solid var(--line2); background: var(--panel); border-radius: 9px; padding: 9px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bk { border-top: 1px solid var(--line); }
.bk > header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; cursor: pointer; }
.bk > header i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.bk > header div { flex: 1; min-width: 0; }
.bk > header p { font-size: 13px; color: var(--muted); }
.bk .body { padding: 0 20px 16px 42px; display: none; }
.bk.on .body { display: block; }
.bk.off-soon { opacity: .6; }
.sw { position: relative; width: 40px; height: 23px; flex: none; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; background: var(--line2); border-radius: 12px; transition: background .15s; }
.sw span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw input:checked + span { background: var(--ink); }
.sw input:checked + span::after { transform: translateX(17px); }
.sw input:disabled { cursor: not-allowed; }
.rng { display: grid; grid-template-columns: 1fr 110px; gap: 4px 14px; align-items: center; margin-top: 10px; }
.rng label { font-size: 13px; color: var(--muted); grid-column: 1 / -1; display: flex; justify-content: space-between; }
.rng label b { font: 500 13px var(--mono); color: var(--ink); }
.rng input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--ink); }
canvas.fee { width: 100%; height: 140px; display: block; }
.prev .nm { display: flex; gap: 12px; align-items: center; }
.sum > div { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sum b { font-family: var(--mono); font-weight: 500; text-align: right; }
.flags { font-size: 12px; color: var(--muted); }

/* blocks / docs */
.cat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cat article { padding: 18px 20px; }
.cat article header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cat article header i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.cat article p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.cat table { width: 100%; font-size: 13px; border-collapse: collapse; margin-bottom: 12px; }
.cat td { padding: 5px 0; border-top: 1px solid var(--line); }
.cat td:last-child { text-align: right; font-family: var(--mono); }
.doc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.doc nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.doc nav a { text-decoration: none; color: var(--muted); padding: 5px 10px; border-radius: 7px; }
.doc nav a:hover { color: var(--ink); background: var(--panel); }
.doc section { padding: 24px 28px; margin-bottom: 14px; scroll-margin-top: 80px; }
.doc section h2 { margin-bottom: 10px; }
.doc section p, .doc section li { color: var(--ink); max-width: 680px; }
.doc section p + p { margin-top: 10px; }
.doc section ul, .doc section ol { padding-left: 20px; margin: 10px 0 0; }
.doc section li + li { margin-top: 5px; }
.doc table { border-collapse: collapse; margin-top: 12px; font-size: 14px; width: 100%; max-width: 680px; }
.doc td, .doc th { text-align: left; padding: 7px 10px 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
.doc th { font-size: 12px; color: var(--muted); font-weight: 600; }
.doc td:last-child { font-family: var(--mono); font-size: 13px; }
.doc code { font: 13px var(--mono); background: var(--chipbg); padding: 1px 5px; border-radius: 4px; }

/* wallet dialog */
.wd { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(380px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); }
.wd::backdrop { background: rgba(10, 10, 12, .55); }
.wd h3 { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.wd h3 button { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.wd ul { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow: auto; }
.wd li.wh { font-size: 12px; color: var(--muted); padding: 10px 12px 4px; font-weight: 600; }
.wd li button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; font-weight: 500; }
.wd li button:hover { background: var(--panel2); }
.wd li img { width: 28px; height: 28px; border-radius: 7px; }
.wd li em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); }
.wd p { font-size: 13px; color: var(--muted); padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .2s; z-index: 50; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* small screens */
@media (max-width: 960px) {
  .grid2 { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .cat { grid-template-columns: 1fr; }
  .doc { grid-template-columns: 1fr; }
  .doc nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .hide-md { display: none; }
}
@media (max-width: 700px) {
  .in { padding: 0 16px; }
  .main { padding: 20px 16px 48px; }
  .hdr .in { gap: 10px; height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav { order: 5; width: 100%; margin: 0; overflow-x: auto; }
  .chain { display: none; }
  .theme { margin-left: auto; }
  h1 { font-size: 25px; }
  .busy { grid-template-columns: 1fr 1fr; } .busy a:nth-child(n+5) { display: none; }
  .stats, .kv { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3), .kv > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3), .kv > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hide-sm { display: none; }
  .pools .nm { min-width: 0; }
  .pools td, .pools th { padding: 10px 8px; }
  .two { grid-template-columns: 1fr; }
  .doc section { padding: 18px; }
  .foot .muted { margin-left: 0; }
  canvas.ch { height: 220px; }
}
.ph { font-size: 26px; margin: 4px 0 16px; }
.bk > header i, .blist > div > i { display: none; }
.blist > div { grid-template-columns: 1fr; }
.blist p, .blist .st { grid-column: 1; }
.bk .body { padding-left: 20px; }
.bag { font-size: 13px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.bag div { display: flex; justify-content: space-between; padding: 3px 0; }
.bag div span { color: var(--muted); }
.bag em { font-style: normal; font-weight: 500; margin-left: 4px; }
.bag p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.bag p button { font: inherit; color: var(--ink, inherit); background: none; border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; margin-left: 4px; cursor: pointer; }
.bag b { font-family: var(--mono); font-weight: 500; }
