/* Spread — spread.fail
 *
 * Brand is fixed and not mine to move: Ink #0A0A0A, Pink #FF3D81, Paper #FFFFFF, Space Grotesk.
 * Neutrals are pulled a few degrees toward magenta so the greys read as chosen rather than inherited.
 * Space Mono carries every number, ticker and label — the brand sheet's own specimen row sets that.
 *
 * Structure: the seam. Two-sided things are split by a hairline, because the mark is one circle cut and
 * pulled apart. Data modules get square-ish corners and hairline grids; only the hero card is soft.
 *
 * Colour discipline: pink is the one accent hue. In data it takes a single job — down, and short — which is
 * how the brand sheet already draws the SHORT pill. Green is semantic (up) and is not a second accent.
 */

:root {
  --ink: #0A0A0A;
  --pink: #FF3D81;
  --paper: #FFFFFF;
  --blush: #FFEBF3;
  --grey: #6E666A;
  --grey-soft: #9A9297;
  --rule: #E7E2E5;
  --rule-soft: #F1EDEF;
  --surface: #F8F6F7;
  --up: #12855A;
  --up-soft: #E6F4EE;

  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 1440px;
  --gutter: clamp(16px, 3.2vw, 52px);
  --r: 4px;

  --t--2: 0.69rem;
  --t--1: clamp(0.76rem, 0.74rem + 0.08vw, 0.81rem);
  --t-0: clamp(0.92rem, 0.9rem + 0.1vw, 0.99rem);
  --t-1: clamp(1.06rem, 1rem + 0.3vw, 1.25rem);
  --t-2: clamp(1.3rem, 1.12rem + 0.9vw, 1.85rem);
  --t-3: clamp(1.8rem, 1.35rem + 2.1vw, 3rem);
  --t-4: clamp(2.6rem, 1.4rem + 5.6vw, 6.2rem);
}

:root:not([data-theme="light"]) { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #FAF8F9;
    --paper: #090809;
    --blush: #2E1222;
    --grey: #9C939A;
    --grey-soft: #6A6268;
    --rule: #241F26;
    --rule-soft: #171419;
    --surface: #121016;
    --up: #34C98A;
    --up-soft: #10241C;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #FAF8F9;
  --paper: #090809;
  --blush: #2E1222;
  --grey: #9C939A;
  --grey-soft: #6A6268;
  --rule: #241F26;
  --rule-soft: #171419;
  --surface: #121016;
  --up: #34C98A;
  --up-soft: #10241C;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-0);
  font-weight: 300;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }
.band { border-top: 1px solid var(--rule); padding-block: clamp(44px, 5.5vw, 84px); }
.pink { color: var(--pink); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--pink); }

.eyebrow {
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--grey-soft); margin: 0;
}
.note { font-family: var(--mono); font-size: var(--t--1); color: var(--grey-soft); line-height: 1.7; }

.section-head {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: clamp(20px, 3vw, 48px); align-items: end; margin-bottom: clamp(26px, 3vw, 40px);
}
.section-head h2 { font-size: var(--t-3); max-width: 16ch; margin-top: 14px; }
.section-head p { color: var(--grey); max-width: 52ch; }

/* ---------------------------------------------------------------- mark */

.mark { display: block; overflow: visible; }
.mark .half-l { fill: var(--ink); }
.mark .half-r { fill: var(--pink); }

@media (prefers-reduced-motion: no-preference) {
  .mark--animate .half-l { animation: split-l 900ms cubic-bezier(.22,.9,.24,1) both; }
  .mark--animate .half-r { animation: split-r 900ms cubic-bezier(.22,.9,.24,1) both; }
}
@keyframes split-l { from { transform: translateX(6px); } to { transform: translateX(0); } }
@keyframes split-r { from { transform: translateX(-6px); } to { transform: translateX(0); } }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.topbar__inner {
  display: flex; align-items: center; gap: clamp(12px, 2vw, 26px);
  padding-block: 13px; flex-wrap: wrap;
}
.wordmark {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.32rem; letter-spacing: -0.035em; text-decoration: none;
}
.topbar nav { display: flex; gap: clamp(10px, 1.5vw, 22px); }
.topbar nav a {
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--grey); text-decoration: none;
}
.topbar nav a:hover { color: var(--ink); }

.topbar__spacer { flex: 1; }

.statusline {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: var(--t--1); color: var(--grey-soft);
  letter-spacing: 0.04em; white-space: nowrap;
}
.statusline b { font-weight: 400; color: var(--ink); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pink); display: inline-block; }

.btn {
  font-family: var(--mono); font-size: var(--t--1); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 10px 16px; border-radius: var(--r); border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer;
  white-space: nowrap; transition: opacity 140ms ease;
}
.btn:hover { opacity: 0.82; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { border-color: var(--pink); color: var(--pink); opacity: 1; }

/* ---------------------------------------------------------------- hero */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: clamp(28px, 4vw, 64px); align-items: center;
  padding-block: clamp(36px, 5vw, 76px) clamp(36px, 4vw, 60px);
}
.hero h1 { font-size: var(--t-4); max-width: 11ch; }
.hero h1 em { font-style: italic; color: var(--pink); }
.hero__sub { font-size: var(--t-1); color: var(--grey); max-width: 42ch; margin-top: 22px; line-height: 1.45; }
.hero__sub strong { color: var(--ink); font-weight: 500; }
.hero__cta { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }

.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--pink); color: var(--pink);
  padding: 6px 11px; border-radius: var(--r); margin-bottom: 22px;
}
.tag + .tag__meta {
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--grey-soft); margin-left: 12px;
}

/* deepest pools panel */
.panel { border: 1px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.panel__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 15px; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--grey-soft);
}
.panel__foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 15px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: var(--t--1); color: var(--grey-soft);
}
.panel__foot a { color: var(--ink); text-decoration: none; }
.panel__foot a:hover { color: var(--pink); }

.prow {
  display: grid; grid-template-columns: 22px minmax(0,1fr) auto;
  gap: 12px; align-items: center;
  padding: 11px 15px; border-bottom: 1px solid var(--rule-soft);
}
.prow:last-of-type { border-bottom: none; }
.prow__n { font-family: var(--mono); font-size: var(--t--1); color: var(--grey-soft); }
.prow__sym { font-weight: 700; font-size: var(--t-0); letter-spacing: -0.01em; }
.prow__mc { font-family: var(--mono); font-size: var(--t--1); color: var(--grey); margin-left: 7px; }
/* block, not inline: height and margin do nothing on an inline box, which left this bar either invisible
 * or rendered as an oversized slab depending on what sat next to it. */
.prow__bar { display: block; height: 3px; background: var(--rule); margin-top: 7px; border-radius: 2px; overflow: hidden; }
.prow__bar i { display: block; height: 100%; background: var(--ink); }
.prow__right { text-align: right; font-family: var(--mono); font-size: var(--t--1); font-variant-numeric: tabular-nums; }
.prow__right small { display: block; color: var(--grey-soft); font-size: var(--t--2); letter-spacing: 0.1em; }

/* ---------------------------------------------------------------- stat strip */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  background: var(--rule);
  gap: 1px;
}
.stat { background: var(--paper); padding: 20px clamp(14px, 1.6vw, 24px) 22px; min-width: 0; }
.stat dt {
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--grey-soft);
}
.stat dd {
  margin: 8px 0 5px; font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.stat span { font-size: var(--t--1); color: var(--grey); }

/* ---------------------------------------------------------------- ticker */

.ticker { border-bottom: 1px solid var(--rule); overflow: hidden; }
.ticker__track { display: flex; width: max-content; }
@media (prefers-reduced-motion: no-preference) {
  .ticker__track { animation: marquee 64s linear infinite; }
  .ticker:hover .ticker__track { animation-play-state: paused; }
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tick {
  display: flex; align-items: baseline; gap: 9px;
  padding: 11px 22px; border-right: 1px solid var(--rule);
  font-family: var(--mono); font-size: var(--t--1); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tick b { font-family: var(--sans); font-weight: 700; font-size: var(--t-0); letter-spacing: -0.01em; }
.tick i { font-style: normal; color: var(--grey-soft); }

/* ---------------------------------------------------------------- distribution */

.dist { border: 1px solid var(--rule); border-radius: var(--r); padding: clamp(16px, 2vw, 28px); }
.dist svg { width: 100%; height: auto; display: block; }

/* ---------------------------------------------------------------- coins table */

.tablewrap { border: 1px solid var(--rule); border-radius: var(--r); overflow-x: auto; }
table.coins { width: 100%; border-collapse: collapse; min-width: 980px; }

table.coins thead th {
  font-family: var(--mono); font-size: var(--t--1); font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey-soft);
  text-align: right; padding: 12px 8px; border-bottom: 1px solid var(--rule);
  white-space: nowrap; background: var(--surface);
}
table.coins thead th:first-child, table.coins thead th.l { text-align: left; }
table.coins thead th[data-key] { cursor: pointer; user-select: none; }
table.coins thead th[data-key]:hover { color: var(--ink); }

table.coins tbody td {
  padding: 11px 8px; border-bottom: 1px solid var(--rule-soft); text-align: right;
  font-family: var(--mono); font-size: var(--t--1); font-variant-numeric: tabular-nums;
  color: var(--grey); white-space: nowrap;
}
table.coins tbody tr:last-child td { border-bottom: none; }
table.coins tbody tr:hover td { background: var(--surface); }
table.coins td.l { text-align: left; }
table.coins td.strong { color: var(--ink); }

.coincell { display: flex; align-items: center; gap: 11px; }
/* One badge, four sizes, set by --s. It holds the coin's logo when we have one and its initials when we do
 * not — same box either way, so a row never reflows when the image file lands. */
.logo {
  width: var(--s, 28px); height: var(--s, 28px); flex: none;
  border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center; vertical-align: middle;
  font-family: var(--mono); font-size: calc(var(--s, 28px) * 0.34); font-weight: 700; line-height: 1;
  background: var(--surface); border: 1px solid var(--rule); color: var(--grey-soft);
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coincell__name { font-family: var(--sans); font-weight: 700; font-size: var(--t-0); color: var(--ink); letter-spacing: -0.01em; }
.coincell__sub { font-family: var(--mono); font-size: var(--t--2); color: var(--grey-soft); }

.tier-tag {
  font-family: var(--mono); font-size: var(--t--2); letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--rule); border-radius: var(--r); padding: 3px 8px; color: var(--grey);
}
.spark { display: block; }

.trade { display: inline-flex; gap: 6px; }
.trade button {
  font-family: var(--mono); font-size: var(--t--2); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 7px 13px; border-radius: var(--r); cursor: pointer; border: 1px solid transparent;
  transition: opacity 140ms ease;
}
.trade button:hover { opacity: 0.8; }
.trade .long { background: var(--ink); color: var(--paper); }
.trade .short { background: var(--blush); color: var(--pink); border-color: var(--blush); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chipstat {
  font-family: var(--mono); font-size: var(--t--1);
  border: 1px solid var(--rule); border-radius: var(--r); padding: 7px 11px; color: var(--grey);
}
.chipstat b { color: var(--ink); font-weight: 400; margin-left: 7px; }

/* ---------------------------------------------------------------- builder */

.builder { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: clamp(22px, 3vw, 44px); align-items: start; }
.controls {
  display: flex; flex-direction: column; gap: 22px;
  border: 1px solid var(--rule); border-radius: var(--r); padding: 22px; background: var(--surface);
}
.field { display: flex; flex-direction: column; gap: 9px; }
.field > label, .field__legend {
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--grey-soft);
}
select {
  font-family: var(--sans); font-size: var(--t-0); font-weight: 500; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 11px 13px; width: 100%; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) calc(50% + 1px), calc(100% - 14px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border: 0; padding: 0; margin: 0; }
.side-toggle button {
  font-family: var(--mono); font-size: var(--t--1); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 11px 6px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--paper); color: var(--grey); cursor: pointer; transition: all 140ms ease;
}
.side-toggle button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.side-toggle button[data-side="short"][aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #fff; }

.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.slider-head output { font-family: var(--mono); font-size: var(--t-0); font-weight: 700; font-variant-numeric: tabular-nums; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--rule); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--rule); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); margin-top: -7px; border: 0; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 0; }

.cap-hint { font-family: var(--mono); font-size: var(--t--1); color: var(--grey-soft); line-height: 1.6; }

.readout { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.readout__market { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.readout__pair { font-size: var(--t-2); font-weight: 700; letter-spacing: -0.025em; }
.readout__pair .vs { color: var(--grey-soft); font-weight: 300; }
.readout__index { font-family: var(--mono); font-size: var(--t--1); color: var(--grey); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; margin: 0; }
.tile { background: var(--paper); padding: 15px 15px 17px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tile dt { font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey-soft); }
.tile dd { margin: 0; font-family: var(--mono); font-size: clamp(1rem, 0.86rem + 0.6vw, 1.3rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tile__foot { font-family: var(--sans); font-size: var(--t--1); color: var(--grey); font-weight: 300; }
.tile--accent dd { color: var(--pink); }

.scale { display: flex; flex-direction: column; gap: 8px; }
.scale svg { width: 100%; height: auto; display: block; }
.scale__caption { font-size: var(--t--1); color: var(--grey); }
.warn { font-family: var(--mono); font-size: var(--t--1); line-height: 1.6; color: var(--ink); background: var(--blush); border-radius: var(--r); padding: 12px 14px; }

/* ---------------------------------------------------------------- docs */

.docs { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.docs__toc { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 9px; }
.docs__toc a {
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.06em; color: var(--grey);
  text-decoration: none; padding-left: 12px; border-left: 1px solid var(--rule);
}
.docs__toc a:hover { color: var(--ink); border-left-color: var(--pink); }

.docs__body { display: flex; flex-direction: column; gap: 38px; min-width: 0; }
.doc h3 { font-size: var(--t-1); margin-bottom: 10px; }
.doc p { color: var(--grey); max-width: 68ch; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 12px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.doc li { color: var(--grey); padding-left: 20px; position: relative; max-width: 66ch; }
.doc li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 1px; background: var(--grey-soft); }
.doc code {
  font-family: var(--mono); font-size: 0.88em; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 3px; padding: 1px 5px; color: var(--ink);
}

.kv { display: grid; grid-template-columns: minmax(0,1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; margin-top: 16px; }
.kv > div { background: var(--paper); display: flex; justify-content: space-between; gap: 16px; padding: 11px 15px; font-family: var(--mono); font-size: var(--t--1); }
.kv span:first-child { color: var(--grey); }
.kv span:last-child { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- flow / tokenomics */

.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.flow__step { background: var(--paper); padding: 22px 20px 24px; display: flex; flex-direction: column; gap: 9px; }
.flow__step h4 { font-size: var(--t-1); }
.flow__step p { color: var(--grey); font-size: var(--t--1); line-height: 1.65; }
.flow__step .eyebrow { margin-bottom: 4px; }
.flow__step--accent h4 { color: var(--pink); }

.equation { border: 1px solid var(--rule); border-radius: var(--r); padding: clamp(20px, 2.4vw, 30px); display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.equation__row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-family: var(--mono); font-size: var(--t--1); font-variant-numeric: tabular-nums; }
.equation__row span:first-child { color: var(--grey); }
.equation__rule { height: 1px; background: var(--rule); }
.equation__total { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-family: var(--mono); font-weight: 700; font-size: var(--t-1); font-variant-numeric: tabular-nums; }
.equation__state { font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink); }

.split2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: clamp(24px, 3vw, 56px); align-items: start; }
.prose p { color: var(--grey); max-width: 54ch; }
.prose p + p { margin-top: 14px; }

/* ---------------------------------------------------------------- footer */

.foot { border-top: 1px solid var(--rule); padding-block: 38px 52px; display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap; }
.foot__left { display: flex; flex-direction: column; gap: 12px; max-width: 46ch; }
.foot__links { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.foot__links a { font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey-soft); text-decoration: none; }
.foot__links a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- narrow */

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0,1fr); }
  .builder { grid-template-columns: minmax(0,1fr); }
  .split2 { grid-template-columns: minmax(0,1fr); }
  .docs { grid-template-columns: minmax(0,1fr); }
  .docs__toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .docs__toc a { border-left: none; border-bottom: 1px solid var(--rule); padding: 0 0 6px; }
  .section-head { grid-template-columns: minmax(0,1fr); align-items: start; }
}

@media (max-width: 760px) {
  .topbar nav, .statusline { display: none; }
  .hero h1 { max-width: none; }
}

/* A pool that has fallen below the listing floor since the census still appears in the table — hiding it
 * would make the floor look like a boundary nothing ever crosses. It is shown, and it is not tradeable. */
table.coins tbody tr.below td { opacity: 0.55; }
.tier-tag--none { border-style: dashed; color: var(--grey-soft); }
.trade button[disabled] { opacity: 0.3; cursor: not-allowed; }
.trade button[disabled]:hover { opacity: 0.3; }

/* A twelve-column table will out-run the viewport at some width whatever the padding, and the one column you
 * came to use must not be the one that falls off the edge. Pin it; the rest scrolls under it. */
table.coins th:last-child, table.coins td:last-child {
  position: sticky; right: 0; z-index: 1;
  background: var(--paper); border-left: 1px solid var(--rule);
  /* so a column scrolling underneath reads as overlapped rather than as a truncated value */
  box-shadow: -11px 0 11px -11px rgba(0, 0, 0, 0.5);
}
table.coins thead th:last-child { background: var(--surface); }
table.coins tbody tr:hover td:last-child { background: var(--surface); }

/* ---------------------------------------------------------------- search */

.search { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.search__field {
  flex: 1 1 340px; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--ink); border-radius: var(--r); padding: 0 12px 0 14px; background: var(--paper);
}
.search__field:focus-within { outline: 2px solid var(--pink); outline-offset: 2px; }
.search__icon { font-size: 1.1rem; color: var(--grey-soft); line-height: 1; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
  font-family: var(--mono); font-size: var(--t-0); padding: 13px 0;
}
.search input::placeholder { color: var(--grey-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search__clear {
  border: 0; background: transparent; cursor: pointer; color: var(--grey-soft);
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.1em; text-transform: uppercase; padding: 6px;
}
.search__clear:hover { color: var(--pink); }
.search__count { margin-top: 12px; margin-bottom: 14px; }
.search__count b { color: var(--ink); font-weight: 400; }

td.empty { color: var(--grey); font-family: var(--sans) !important; white-space: normal !important; padding: 26px 16px !important; max-width: 70ch; }
td.empty b { color: var(--ink); font-family: var(--mono); }
.nodata { font-family: var(--mono); font-size: var(--t--2); color: var(--grey-soft); letter-spacing: 0.06em; }

a.coincell { text-decoration: none; }
a.coincell:hover .coincell__name { color: var(--pink); }

button.chipstat { cursor: pointer; background: var(--paper); font-family: var(--mono); }
button.chipstat:hover { border-color: var(--pink); color: var(--pink); }

/* The mint under the pair name: the answer to "is this a real token" should be on the page, not implied. */
.mintline { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-top: 6px; font-size: var(--t--2); color: var(--grey-soft); }
.mintline span { overflow-wrap: anywhere; }
.mintline a { color: var(--grey); text-decoration: none; white-space: nowrap; }
.mintline a:hover { color: var(--pink); }

/* logo placements */
.prow .logo { margin-right: 8px; }
.tick .logo { margin-right: 2px; }
.readout__pair { display: flex; align-items: center; gap: 12px; }
.readout__pair .logo { border-width: 1px; }
.coincell .logo { border-radius: 50%; }

/* ---------------------------------------------------------------- wallet, ticket, positions, toasts */

.walletbar {
  display: none; align-items: center; gap: 18px; padding-block: 9px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: var(--t--1); color: var(--grey);
}
body.is-connected .walletbar { display: flex; }
.walletbar button {
  margin-left: auto; border: 0; background: transparent; cursor: pointer; color: var(--grey-soft);
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.1em; text-transform: uppercase;
}
.walletbar button:hover { color: var(--pink); }

.nav__badge { font-family: var(--mono); font-size: var(--t--2); color: var(--pink); margin-left: 5px; }

/* the order ticket */
.ticket { display: flex; flex-direction: column; gap: 10px; }
.ticket__status { font-size: var(--t--1); color: var(--grey-soft); display: flex; align-items: center; gap: 8px; }
.dot--ok { background: var(--up); }
.btn--place {
  width: 100%; padding: 15px 18px; font-size: var(--t-0); letter-spacing: 0.14em;
  border-radius: var(--r); border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-weight: 700; text-transform: uppercase; cursor: pointer;
}
.btn--place:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--place:not(:disabled):hover { opacity: 0.85; }
.ticket__note { margin-top: 2px; }

/* positions */
table.positions { min-width: 720px; }
table.positions td.l, table.positions th.l { text-align: left; }
.pos__q { display: block; font-size: var(--t--2); color: var(--grey-soft); }
.side {
  font-family: var(--mono); font-size: var(--t--2); font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 4px 9px; border-radius: var(--r);
}
.side--long { background: var(--ink); color: var(--paper); }
.side--short { background: var(--blush); color: var(--pink); }
.tag-open, .tag-pending {
  font-family: var(--mono); font-size: var(--t--2); letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: var(--r); padding: 4px 9px; border: 1px solid var(--rule); color: var(--grey);
}
.tag-open { border-color: var(--up); color: var(--up); }
.tag-pending { border-style: dashed; border-color: var(--pink); color: var(--pink); }
tr.pending td { opacity: 0.78; }
.positions__empty { color: var(--grey); font-size: var(--t-0); padding: 26px 0; }
.btn-close {
  font-family: var(--mono); font-size: var(--t--2); font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 7px 13px; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer;
}
.btn-close:hover:not(:disabled) { border-color: var(--pink); color: var(--pink); }
.btn-close:disabled { opacity: 0.4; cursor: not-allowed; }
table.positions td a { color: var(--grey); text-decoration: none; font-size: var(--t--2); }
table.positions td a:hover { color: var(--pink); }

/* toasts — fixed, so a confirmation is visible wherever you are on the page */
.toasts {
  position: fixed; right: clamp(12px, 2vw, 24px); bottom: clamp(12px, 2vw, 24px); z-index: 90;
  display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  position: relative; pointer-events: auto;
  background: var(--paper); border: 1px solid var(--ink); border-radius: var(--r);
  padding: 14px 34px 14px 15px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.5);
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 220ms cubic-bezier(.22,.9,.24,1) both; }
}
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast--ok { border-color: var(--up); }
.toast--warn { border-color: var(--pink); }
.toast__title { font-weight: 700; font-size: var(--t-0); letter-spacing: -0.01em; }
.toast__body { color: var(--grey); font-size: var(--t--1); margin-top: 5px; line-height: 1.55; }
.toast__link {
  display: inline-block; margin-top: 9px; font-family: var(--mono); font-size: var(--t--1);
  letter-spacing: 0.08em; color: var(--pink); text-decoration: none; border-bottom: 1px solid currentColor;
}
.toast__sig { font-family: var(--mono); font-size: var(--t--2); color: var(--grey-soft); margin-top: 4px; }
.toast__close {
  position: absolute; top: 8px; right: 9px; border: 0; background: transparent; cursor: pointer;
  color: var(--grey-soft); font-size: 1.2rem; line-height: 1; padding: 3px 6px;
}
.toast__close:hover { color: var(--ink); }

@media (max-width: 760px) {
  .toasts { left: 12px; right: 12px; width: auto; }
}

/* ---------------------------------------------------------------- onward cards */

.onward { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.onward__card {
  background: var(--paper); padding: 26px 24px 28px; text-decoration: none;
  display: flex; flex-direction: column; gap: 9px; transition: background 140ms ease;
}
.onward__card:hover { background: var(--surface); }
.onward__card h3 { font-size: var(--t-1); }
.onward__card p:not(.eyebrow) { color: var(--grey); font-size: var(--t--1); line-height: 1.6; }
.onward__go {
  margin-top: auto; padding-top: 10px;
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--pink);
}

/* A standalone docs page wants the first band flush with the topbar, not floating below a hero. */
body.page main > .band:first-child { border-top: none; padding-top: clamp(30px, 4vw, 54px); }
