/* Pivot. A broadsheet market page: warm paper, ink, moss for long, brick for short. Night keeps the roles. */

:root, [data-theme="paper"] {
  --paper: #F1ECE2;
  --sheet: #F8F5EE;
  --sunk: #E7E1D3;
  --ink: #1A1916;
  --ink-2: #3B3832;
  --muted: #6E685D;
  --rule: #D9D2C3;
  --rule-strong: #1A1916;
  --long: #2E6B47;
  --long-wash: #DCE8DB;
  --on-long: #FFFFFF;
  --short: #B5442C;
  --short-wash: #F2DED5;
  --on-short: #FFFFFF;
  --shadow: 0 1px 0 rgba(26, 25, 22, .04), 0 12px 32px -18px rgba(26, 25, 22, .28);
  color-scheme: light;
}
[data-theme="night"] {
  --paper: #13120F;
  --sheet: #1B1A16;
  --sunk: #26241E;
  --ink: #EDE7DA;
  --ink-2: #CFC8B8;
  --muted: #9A9384;
  --rule: #302D26;
  --rule-strong: #EDE7DA;
  --long: #7CC293;
  --long-wash: #1C2B21;
  --on-long: #0F1A13;
  --short: #E88B6D;
  --short-wash: #301F18;
  --on-short: #1F120D;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 36px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
:root {
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --text: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1200px;
  --r: 14px;
  --ease: cubic-bezier(.34, 1.36, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--text); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
sub { font-size: .68em; vertical-align: -.25em; line-height: 0; margin: 0 .05em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
main { outline: none; min-height: 60vh; }

h1, h2, h3 {
  font-family: var(--display); font-weight: 500; margin: 0;
  font-variation-settings: 'SOFT' 100, 'WONK' 0; letter-spacing: -.012em; line-height: 1.08;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--rule); background: var(--sheet); color: var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn.ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.ink:hover { background: var(--ink-2); }
.btn.small { height: 32px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn.quiet { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--rule); background: transparent;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.icon-btn svg path:only-child { fill: currentColor; stroke: none; }
.demo-tag {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 4px 7px 5px; border-radius: 999px; background: var(--sunk); color: var(--ink-2);
}

/* $PIVOT address bar: shown on every page once CONFIG.ca is set */
.ca-bar { background: var(--ink); color: var(--paper); font-size: 14px; }
.ca-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; min-height: 40px; padding: 6px 0; }
.ca-row b { font-weight: 700; }
.ca-addr { font-variant-numeric: tabular-nums; letter-spacing: .01em; overflow-wrap: anywhere; min-width: 0; }
.ca-addr .short { display: none; }
.ca-copy { border: 1px solid color-mix(in srgb, var(--paper) 35%, transparent); background: transparent; color: inherit; border-radius: 8px; padding: 3px 10px; font-size: 13px; font-weight: 600; }
.ca-copy:hover { border-color: var(--paper); }
.ca-bar a { color: inherit; font-weight: 600; }
.coin-rules .addr { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; font-weight: 500; }

/* Masthead */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.top-row { display: flex; align-items: center; gap: 30px; height: 66px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark { display: inline-flex; }
.brand-mark svg { width: 30px; height: 30px; color: var(--ink); }
.brand .word { font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: -.025em; font-variation-settings: 'SOFT' 100, 'WONK' 1; line-height: 1; padding-bottom: 3px; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 8px 13px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.nav a:hover { background: var(--sunk); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wallet-btn .demo-tag { margin-left: 2px; }

.dateline {
  display: flex; flex-wrap: wrap; gap: 4px 22px; padding: 10px 0 11px;
  font-size: 13.5px; color: var(--muted); border-bottom: 3px double var(--rule-strong);
}
.dateline b { color: var(--ink); font-weight: 600; }
.dl-feed::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 7px; vertical-align: 1px; }
.dl-feed.live::before { background: var(--long); }
.dl-feed.stale::before, .dl-feed.down::before { background: var(--short); }
.dl-demo { margin-left: auto; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; padding: 64px 0 36px; }
.hero h1 { font-size: clamp(46px, 6.2vw, 80px); line-height: .98; letter-spacing: -.028em; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.lede { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 31em; margin: 22px 0 28px; }
.paste { display: flex; gap: 8px; max-width: 520px; }
.paste input {
  flex: 1; width: 0; min-width: 0; height: 50px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--rule); background: var(--sheet); font-size: 15px;
}
.paste input::placeholder { color: var(--muted); }
.paste input:focus { outline: none; border-color: var(--ink); }
.paste .btn { height: 50px; padding: 0 22px; }
.paste-msg { min-height: 1.5em; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.paste-msg.bad { color: var(--short); }
.fine { font-size: 14px; color: var(--muted); margin: 6px 0 0; max-width: 36em; }

.hero-fig { margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 22px; padding: 18px 22px 20px; box-shadow: var(--shadow); }
.fig-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.fig-coin { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-size: 15px; }
.fig-coin b { font-weight: 700; }
.fig-coin .num { color: var(--muted); }
.fig-note { font-size: 13.5px; color: var(--muted); }
.fig-ends { display: none; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.fig-ends b { margin-left: 4px; }
.fig-cap { font-size: 15px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }
.fig-cap a { font-weight: 600; white-space: nowrap; margin-left: 4px; }

.hero-beam { width: 100%; height: auto; display: block; margin: 4px 0 2px; overflow: visible; }
.hero-beam .ground { stroke: var(--rule); stroke-width: 2; stroke-linecap: round; }
.hero-beam .fulcrum { fill: var(--ink); stroke: var(--ink); stroke-width: 8; stroke-linejoin: round; }
.hero-beam .beam { fill: var(--ink); }
.hero-beam .scale line { stroke: var(--sheet); stroke-width: 1.6; stroke-linecap: round; opacity: .55; }
.hero-beam .pin { fill: var(--sheet); }
.hero-beam .beam-arm, .hero-beam .end { transition: transform 1.1s var(--ease); transform-box: view-box; }
.hero-beam .beam-arm { transform-origin: 320px 196px; }
.hero-beam .tag rect { fill: var(--paper); stroke: var(--rule); stroke-width: 1.5; }
.hero-beam .end.win .tag rect { stroke: none; }
.hero-beam .end-long.win .tag rect { fill: var(--long); }
.hero-beam .end-short.win .tag rect { fill: var(--short); }
.hero-beam .t-side { font: 600 15px var(--text); fill: var(--muted); }
.hero-beam .t-pnl { font: 600 19px var(--text); font-variant-numeric: tabular-nums; fill: var(--ink); }
.hero-beam .end-long.win text { fill: var(--on-long); }
.hero-beam .end-short.win text { fill: var(--on-short); }
.hero-beam .end:not(.win) .t-pnl { fill: var(--ink-2); }

/* Sections */
.block { margin-top: 30px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  border-top: 1px solid var(--rule-strong); padding-top: 14px; margin-bottom: 18px;
}
.section-head h2 { font-size: 31px; }
.aside { font-size: 14px; color: var(--muted); }
.aside-link { font-size: 15px; font-weight: 600; }
.tabs { display: inline-flex; gap: 2px; background: var(--sunk); padding: 4px; border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; }
.tabs button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Movers */
.movers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mover {
  display: grid; gap: 8px; padding: 16px 16px 14px; border-radius: 18px;
  background: var(--sheet); border: 1px solid var(--rule); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.mover:hover { border-color: var(--ink); text-decoration: none; }
.mv-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mv-id { display: grid; min-width: 0; line-height: 1.25; }
.mv-id b { font-weight: 700; }
.mv-id small, .cn small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mv-price { font-size: 19px; font-weight: 600; }
.mv-foot { font-size: 13px; color: var(--muted); }
.mover.skeleton { min-height: 170px; }
.mover.skeleton span { display: block; height: 14px; border-radius: 6px; background: var(--sunk); }
.mover.skeleton span:nth-child(2) { height: 40px; }
.empty-line { color: var(--muted); margin: 6px 0; }

.mini-beam { width: 100%; max-width: 150px; height: auto; justify-self: center; margin: 2px 0; }
.mini-beam .fulcrum { fill: var(--ink); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.mini-beam .beam { fill: var(--ink); }
.mini-beam .end-dot { fill: var(--sheet); }
.mini-beam.up .beam { fill: var(--long); }
.mini-beam.down .beam { fill: var(--short); }

/* Change and flow */
.chg { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg.up { color: var(--long); }
.chg.down { color: var(--short); }
.chg.flat { color: var(--muted); }
.flow { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--short); overflow: hidden; vertical-align: middle; }
.flow i { display: block; height: 100%; background: var(--long); }
.flow.empty { background: var(--sunk); }
.flow-n { font-size: 13px; color: var(--muted); margin-left: 8px; font-variant-numeric: tabular-nums; display: inline-block; min-width: 3ch; text-align: right; }

/* Board */
.board-tools { display: flex; align-items: center; gap: 10px; }
.filter { height: 38px; width: 240px; max-width: 100%; padding: 0 14px; border-radius: 10px; border: 1px solid var(--rule); background: var(--sheet); font-size: 14px; }
.filter:focus { outline: none; border-color: var(--ink); }
.board-wrap { overflow-x: auto; }
.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.board th { text-align: right; padding: 0 12px 10px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.board th button { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.board th button:hover { color: var(--ink); }
.board th[aria-sort="ascending"] button, .board th[aria-sort="descending"] button { color: var(--ink); font-weight: 600; }
.board th button[data-dir="down"]::after { content: ' \2193'; }
.board th button[data-dir="up"]::after { content: ' \2191'; }
.board td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.board th.coin, .board td.coin { text-align: left; padding-left: 4px; }
.board tbody tr { cursor: pointer; }
.board tbody tr:hover td { background: var(--sheet); }
.board td.coin a { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.cn { display: grid; line-height: 1.25; min-width: 0; }
.cn b { font-weight: 700; }
.cn small { max-width: 190px; }
.board-empty { text-align: center !important; color: var(--muted); padding: 34px 12px !important; white-space: normal !important; }
.board-note { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; max-width: 60em; }

/* Logos */
.logo { width: var(--s); height: var(--s); flex: none; border-radius: 50%; overflow: hidden; background: var(--sunk); display: grid; place-items: center; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo .glyph { width: 62%; height: 62%; color: var(--muted); }

/* Wire and desk */
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; margin-bottom: 30px; }
.wire { list-style: none; margin: 0; padding: 0; }
.wire li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.wire time { color: var(--muted); font-size: 14px; padding-top: 1px; }
.wire p { margin: 0; font-size: 15px; color: var(--ink-2); }
.wire a { font-weight: 700; color: var(--ink); text-decoration: none; }
.wire a:hover { text-decoration: underline; }
.wire .wire-empty { display: block; color: var(--muted); }
.empty-card { display: grid; justify-items: start; gap: 10px; padding: 22px; border: 1px dashed var(--rule); border-radius: 18px; }
.empty-card p { margin: 0; color: var(--ink-2); }
.empty-card.big { justify-items: center; text-align: center; padding: 48px 24px; border-style: solid; }
.empty-card.big p { max-width: 30em; }
.empty-card h2 { font-size: 28px; }
.empty-mark { width: 42px; height: 42px; color: var(--muted); }
.mini-pos { list-style: none; padding: 0; margin: 0 0 10px; }
.mini-pos li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.mini-pos a { text-decoration: none; }
.side { font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.side.long { background: var(--long-wash); color: var(--long); }
.side.short { background: var(--short-wash); color: var(--short); }

/* Pages */
.page-head { padding: 48px 0 26px; }
.page-head h1 { font-size: clamp(40px, 5vw, 60px); letter-spacing: -.025em; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.page-head .lede { margin-bottom: 0; }
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 20px; padding: 22px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { font-size: 23px; }
.state-page { padding: 90px 0 110px; display: grid; justify-items: center; text-align: center; gap: 14px; }
.state-page h1 { font-size: clamp(36px, 5vw, 54px); font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.state-page p { color: var(--ink-2); margin: 0 0 8px; max-width: 34em; }
.state-mark { width: 56px; height: 56px; color: var(--muted); }
.state-beam { width: 220px; }
.state-beam .mini-beam { max-width: none; }
.warn { background: var(--short-wash); color: var(--short); padding: 12px 16px; border-radius: 12px; font-weight: 500; }

/* Coin page */
.coin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 34px 0 22px; }
.ch-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ch-id h1 { font-size: 46px; letter-spacing: -.02em; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.ch-meta a { color: var(--ink-2); }
.copy { border: 1px solid var(--rule); background: transparent; border-radius: 8px; padding: 2px 8px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.copy:hover { border-color: var(--ink); }
.ch-price { text-align: right; }
.ch-price .big { font-family: var(--text); font-size: 38px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.ch-sub { font-size: 15px; }

.trade-grid { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 22px; align-items: start; padding-bottom: 40px; }
.chart { position: relative; height: 330px; margin: 0 -6px; }
.chart-svg { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.chart-svg .grid { stroke: var(--rule); stroke-width: 1; }
.chart-svg .axis { font: 500 12px var(--text); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-svg .k-up line { stroke: var(--long); stroke-width: 1.2; }
.chart-svg .k-up rect { fill: var(--long); }
.chart-svg .k-down line { stroke: var(--short); stroke-width: 1.2; }
.chart-svg .k-down rect { fill: var(--short); }
.chart-svg .live-line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-svg .live-tag rect { fill: var(--ink); }
.chart-svg .live-tag text { font: 600 12px var(--text); fill: var(--paper); font-variant-numeric: tabular-nums; }
.chart-svg .cross { stroke: var(--ink); stroke-width: 1; opacity: .35; }
.chart-svg .mark line { stroke-width: 1.3; stroke-dasharray: 6 4; }
.chart-svg .mark text { font: 600 12px var(--text); }
.chart-svg .mark.long line { stroke: var(--long); } .chart-svg .mark.long text { fill: var(--long); }
.chart-svg .mark.short line { stroke: var(--short); } .chart-svg .mark.short text { fill: var(--short); }
.chart-svg .mark.liq line { stroke: var(--muted); } .chart-svg .mark.liq text { fill: var(--muted); }
.chart-empty { display: grid; place-items: center; height: 100%; margin: 0; color: var(--muted); }
.chart .tip {
  position: absolute; top: 8px; display: grid; gap: 2px; padding: 9px 11px; min-width: 150px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow);
  font-size: 13px; font-variant-numeric: tabular-nums; pointer-events: none;
}
.chart .tip i { font-style: normal; font-weight: 600; }
.chart .tip i.up { color: var(--long); } .chart .tip i.down { color: var(--short); }
.chart-src { font-size: 13px; color: var(--muted); margin: 8px 0 18px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 18px; margin: 0; padding-top: 16px; border-top: 1px solid var(--rule); }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 3px 0 0; font-size: 18px; font-weight: 600; }
.stats dd .muted { font-weight: 500; font-size: 14px; }

.moves, .pos, .rules { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.moves th, .moves td, .pos th, .pos td { padding: 10px 10px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.moves thead th, .pos thead th { font-size: 13px; font-weight: 500; color: var(--muted); border-bottom-color: var(--rule-strong); }
.moves th:first-child, .moves td:first-child, .pos th:first-child, .pos td:first-child { text-align: left; padding-left: 0; }
.moves tbody th { font-weight: 500; }
.pos td:last-child { padding-right: 0; }
.pos a { text-decoration: none; }
.table-scroll { overflow-x: auto; }

/* Ticket */
.ticket { position: sticky; top: 84px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 20px; box-shadow: var(--shadow); }
.ticket .sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; background: none; }
.ticket .sides button {
  display: grid; gap: 1px; padding: 11px 10px 10px; border-radius: 12px; text-align: center;
  border: 1px solid var(--rule); background: var(--paper); font-weight: 700; font-size: 17px; color: var(--ink-2);
}
.ticket .sides small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.ticket .sides [data-side="long"][aria-checked="true"] { background: var(--long); border-color: var(--long); color: var(--on-long); }
.ticket .sides [data-side="short"][aria-checked="true"] { background: var(--short); border-color: var(--short); color: var(--on-short); }
.ticket .sides [aria-checked="true"] small { color: inherit; opacity: .85; }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.stake-row { display: flex; align-items: center; border: 1px solid var(--rule); background: var(--paper); border-radius: 12px; padding: 0 14px; height: 50px; }
.stake-row:focus-within { border-color: var(--ink); }
.stake-row input { flex: 1; width: 0; min-width: 0; border: 0; background: none; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; outline: none; }
.unit { font-size: 14px; color: var(--muted); }
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.chips button { height: 32px; border-radius: 9px; border: 1px solid var(--rule); background: transparent; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chips button:hover { border-color: var(--ink); }

.lever { width: 100%; height: auto; display: block; overflow: visible; }
.lever .ground { stroke: var(--rule); stroke-width: 1.5; stroke-linecap: round; }
.lever .beam { fill: var(--ink); }
.lever .fulcrum { fill: var(--ink); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.lever .pivot { transition: transform .7s var(--ease); }
.lever .load.stake { fill: var(--muted); }
.lever .load.size { fill: var(--long); transition: height .5s var(--ease), y .5s var(--ease); }
.ticket.is-short .lever .load.size { fill: var(--short); }
.lever .lbl { font: 500 12.5px var(--text); fill: var(--muted); }
.lever .val { font: 600 15px var(--text); fill: var(--ink); font-variant-numeric: tabular-nums; }
.levs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.levs button { height: 40px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); font-weight: 700; font-variant-numeric: tabular-nums; }
.levs button[aria-checked="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.levs button:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.lev-note { font-size: 13px; color: var(--muted); margin: 0; min-height: 1.5em; }

.tpsl { border-top: 1px solid var(--rule); padding-top: 10px; }
.tpsl summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.tpsl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.tpsl label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.pct-in { display: flex; align-items: center; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); padding: 0 10px; height: 40px; }
.pct-in input { flex: 1; width: 0; min-width: 0; border: 0; background: none; outline: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.pct-in i { font-style: normal; color: var(--muted); }
.tpsl .small { margin: 8px 0 0; }

.quote { margin: 4px 0 0; border-top: 1px solid var(--rule); padding-top: 8px; }
.quote div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; }
.quote dt { color: var(--muted); }
.quote dd { margin: 0; font-weight: 600; }
.btn.go { height: 54px; font-size: 17px; border-radius: 14px; background: var(--long); color: var(--on-long); border-color: var(--long); margin-top: 4px; }
.ticket.is-short .btn.go { background: var(--short); color: var(--on-short); border-color: var(--short); }
.btn.go:hover { filter: brightness(1.06); }
.ticket-msg { margin: 0; font-size: 14px; color: var(--short); font-weight: 500; }
.ticket-msg:empty { display: none; }
.ticket-note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }

/* Portfolio */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 0 0 18px; }
.summary dt { font-size: 13.5px; color: var(--muted); }
.summary dd { margin: 4px 0 0; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.pf { padding-bottom: 40px; }
.reset-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

/* Pool */
.pool-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; padding-bottom: 40px; }
.pool-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 0; padding-top: 0; }
.pool-stats dd { font-size: 24px; }
.oi { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--rule); }
.oi .mini-beam { max-width: none; }
.oi-cap { margin: 0; color: var(--ink-2); }
.pool-grid .card + .card { margin-top: 0; }

/* Docs */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; align-items: start; padding-bottom: 60px; }
.toc { position: sticky; top: 92px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: block; padding: 6px 0; font-size: 14.5px; color: var(--ink-2); text-decoration: none; }
.toc a::before { content: counter(toc) '  '; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.prose { max-width: 680px; }
.prose section { scroll-margin-top: 90px; padding-bottom: 14px; }
.prose h2 { font-size: 28px; margin: 18px 0 12px; }
.prose section:first-child h2 { margin-top: 0; }
.prose p, .prose li { font-size: 17px; line-height: 1.62; color: var(--ink-2); }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 20px; margin: 0 0 14px; }
.prose li { margin-bottom: 8px; }
.prose b { color: var(--ink); }
.card.prose { max-width: none; }
.card.prose h2 { font-size: 23px; }
.card.prose p { font-size: 16px; }
.rules { margin: 4px 0 18px; font-size: 16px; }
.rules td, .rules th { padding: 10px 0; border-bottom: 1px solid var(--rule); text-align: left; }
.rules td:last-child, .rules th:last-child { text-align: right; font-weight: 600; }
.rules thead th { font-size: 13px; font-weight: 500; color: var(--muted); border-bottom-color: var(--rule-strong); }
.doc-fig { margin: 8px 0 18px; padding: 20px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px; }
.lever-doc { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
.lever-doc .beam { fill: var(--ink); }
.lever-doc .fulcrum { fill: var(--ink); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.lever-doc .lbl { font: 700 14px var(--text); fill: var(--ink); }
.lever-doc .lbl.small { font: 500 11.5px var(--text); fill: var(--muted); }

/* Footer */
.foot { margin-top: 30px; border-top: 3px double var(--rule-strong); padding: 30px 0 34px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) auto; gap: 24px 40px; align-items: start; }
.foot-brand { display: flex; gap: 12px; align-items: flex-start; }
.foot-brand .brand-mark svg { width: 26px; height: 26px; }
.foot p { margin: 0 0 6px; font-size: 14.5px; color: var(--ink-2); }
.foot .muted { color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14.5px; }
.foot-fine { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.foot-fine p { font-size: 13px; color: var(--muted); margin: 0; }
.foot-fine .nfa { font-size: 11px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 50; max-width: min(560px, calc(100% - 32px));
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 13px 18px; border-radius: 14px;
  font-size: 15px; font-weight: 500; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5);
  transition: opacity .2s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-left: 5px solid var(--long); }
.toast.bad { border-left: 5px solid var(--short); }

/* Narrower screens */
@media (max-width: 1080px) {
  .c-m5, .c-flow { display: none; }
  .trade-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 40px; }
  .movers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .c-h24, .c-liq { display: none; }
  .trade-grid { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
  .trade-main { display: contents; }
  .trade-grid .card + .card { margin-top: 0; }
  .chart-card { order: 1; }
  .ticket { position: static; order: 2; }
  .trade-main > .card:not(.chart-card) { order: 3; }
  .pool-grid { grid-template-columns: minmax(0, 1fr); }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .toc { position: static; border-bottom: 1px solid var(--rule); padding-bottom: 12px; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .dl-demo { margin-left: 0; }
}
@media (max-width: 640px) {
  .top-row { flex-wrap: wrap; height: auto; padding: 10px 0 0; gap: 10px 14px; }
  .ca-addr .full { display: none; }
  .ca-addr .short { display: inline; }
  .ca-row { gap: 4px 12px; font-size: 13.5px; }
  .nav { order: 3; width: 100%; overflow-x: auto; margin: 0 -4px; padding-bottom: 8px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 12px; font-size: 14.5px; }
  .wallet-btn { height: 40px; padding: 0 12px; font-size: 14px; }
  .dateline { font-size: 12.5px; gap: 2px 14px; }
  .dateline span:first-child { width: 100%; }
  .lede { font-size: 17px; }
  .paste { flex-direction: column; }
  .paste input { flex: none; width: 100%; height: 50px; }
  .paste .btn { width: 100%; }
  .hero-fig { padding: 14px 14px 16px; border-radius: 18px; }
  .hero-beam .end { display: none; }
  .fig-ends { display: flex; margin-top: 2px; }
  .section-head h2 { font-size: 26px; }
  .movers { grid-template-columns: minmax(0, 1fr); }
  .c-mc { display: none; }
  .board { font-size: 14.5px; }
  .board td, .board th { padding-left: 6px; padding-right: 6px; }
  .cn small { max-width: 120px; }
  .filter { width: 100%; }
  .board-tools { width: 100%; }
  .ch-id h1 { font-size: 36px; }
  .ch-price { text-align: left; }
  .ch-price .big { font-size: 30px; }
  .chart { height: 250px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; border-radius: 16px; }
  .moves th, .moves td { padding: 9px 6px; font-size: 14px; }
  .oi { grid-template-columns: minmax(0, 1fr); }
  .oi .mini-beam { max-width: 200px; }
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .prose p, .prose li { font-size: 16px; }
  .wire li { grid-template-columns: 58px minmax(0, 1fr); }
  .summary dd { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
