/*
 * QPRIME — shared design system.
 *
 * Token values are taken verbatim from the brand reference; nothing here is approximated.
 * Chrome is monochrome. Hue is spent only on live state — a colour on anything that is not
 * live state is a bug, not a flourish.
 *
 * Dark only. The brand has one mode.
 */

:root {
  /* chrome */
  --bg: #0A0A0B;
  --panel: #141416;
  --chip: #202024;
  --sunken: #101011;
  --border: #26262A;
  --border-strong: #444448;
  --text: #F2F2F0;
  --text-dim: #8A8A8E;
  --text-faint: #7c7c82; /* 4.8:1 on --bg; the reference value was 2.7:1 */
  --white: #FFFFFF;

  /* state — the only hues in the product */
  --live: #5EC8F2;
  --warn: #E0A93B;
  --positive: #45C48A;
  --negative: #F0645F;

  --radius: 14px;
  --gutter: clamp(20px, 4vw, 64px);
  --maxw: 1320px;

  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: 110px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.3px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.hairline { border: 0; border-top: 1px solid var(--border); margin: 0; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }

/* Textures ---------------------------------------------------------------- */
.dots {
  background-color: var(--sunken);
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 14px 14px;
}
.dots-hero {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1px, transparent 1px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 15%, transparent 75%);
  mask-image: linear-gradient(to bottom, black 0%, black 15%, transparent 75%);
}
.ruled {
  background-image: repeating-linear-gradient(90deg,
    rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px,
    transparent 1px, transparent 46px);
}

/* Nav --------------------------------------------------------------------- */
.nav-outer { position: sticky; top: 0; z-index: 60; padding: 20px var(--gutter) 0; }
.nav {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(20,20,22,0.72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 10px 10px 20px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-weight: 700; font-size: 15px; letter-spacing: 0.2px; text-decoration: none;
}
.nav-brand svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  text-decoration: none; color: var(--text-dim); font-size: 14px;
  transition: color 0.2s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; width: 236px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--sunken); color: var(--text-faint);
  transition: width .2s ease, border-color .2s ease;
}
.nav-search:focus-within { width: 320px; border-color: var(--border-strong); }
.nav-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font-family: var(--sans); font-size: 13px; outline: none; }
.nav-search input::placeholder { color: var(--text-faint); }
.nav-search input::-webkit-search-cancel-button { display: none; }
.nav-search kbd { font-family: var(--mono); font-size: 10px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.nav-acct { display: flex; gap: 8px; }
.acct-cell {
  display: flex; align-items: center; gap: 10px; padding: 5px 12px; min-height: 38px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); color: var(--text);
  font-family: var(--sans); text-decoration: none; text-align: left; cursor: pointer; transition: border-color .2s ease;
}
.acct-cell:hover { border-color: var(--border-strong); }
.acct-text { display: grid; gap: 1px; line-height: 1.2; }
.acct-text .l1 { display: flex; align-items: baseline; gap: 6px; }
.acct-text .l1 b { font-size: 14px; font-weight: 500; }
.acct-text .l1 span { font-size: 12px; color: var(--text-faint); }
.acct-text em { font-style: normal; font-size: 12px; color: var(--text); }
.acct-text em.dim { color: var(--text-dim); }
.acct-text em.up { color: var(--positive); }
.acct-text em.down { color: var(--negative); }
.acct-text em .ago { color: var(--text-faint); margin-left: 4px; }
.acct-av {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; color: #fff; background: var(--chip); border: 1px solid var(--border); flex-shrink: 0;
}
@media (max-width: 1400px) { .nav-links { gap: 20px; } }
@media (max-width: 1300px) { .nav-search { display: none; } }
@media (max-width: 480px)  { #acct-cash { display: none; } }
.nav-mobile {
  display: none; max-width: var(--maxw); margin: 8px auto 0;
  gap: 6px; overflow-x: auto; scrollbar-width: none;
}
.nav-mobile::-webkit-scrollbar { display: none; }
.nav-mobile a {
  flex-shrink: 0; text-decoration: none; font-size: 13px; color: var(--text-dim);
  border: 1px solid transparent; border-radius: 999px; padding: 6px 12px;
}
.nav-mobile a[aria-current="page"] { color: var(--text); border-color: var(--border); background: var(--chip); }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-mobile { display: flex; }
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; padding: 13px 24px;
  font-family: var(--sans); font-size: 14px; text-decoration: none;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.btn-primary { background: var(--white); border-color: var(--white); color: var(--bg); font-weight: 700; }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { border-color: var(--border); background: rgba(255,255,255,0.02); color: var(--text); font-weight: 500; }
.btn-outline:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.05); }
.btn-ghost { color: var(--text-dim); font-weight: 500; }
.btn-ghost:hover { color: var(--text); background: var(--chip); }
.btn-pill { border-radius: 999px; padding: 10px 20px; }
.btn-sm { padding: 9px 16px; font-size: 13px; }

/* Pills / chips ----------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid; border-radius: 8px; padding: 4px 9px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.pill-neutral { background: var(--chip); border-color: var(--border); color: var(--text-dim); }
.pill-solid   { background: var(--white); border-color: var(--white); color: var(--bg); }
.pill-live    { background: rgba(94,200,242,0.10); border-color: rgba(94,200,242,0.40); color: var(--live); }
.pill-warn    { background: rgba(224,169,59,0.10); border-color: rgba(224,169,59,0.40); color: var(--warn); }
.pill-pos     { background: rgba(69,196,138,0.10); border-color: rgba(69,196,138,0.40); color: var(--positive); }
.pill-neg     { background: rgba(240,100,95,0.10); border-color: rgba(240,100,95,0.40); color: var(--negative); }
.pill-round { border-radius: 999px; }

.eyebrow {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-faint); margin: 0 0 12px;
}

/* Section rhythm ---------------------------------------------------------- */
.section { padding: 76px 0 0; }
.section .lede { margin-bottom: 0; }

/* Type -------------------------------------------------------------------- */
h1, h2, h3, h4 { letter-spacing: -0.3px; text-wrap: balance; }
.h-display { font-size: clamp(32px, 5vw, 54px); font-weight: 500; line-height: 1.18; letter-spacing: -0.5px; margin: 0; }
.h-section { font-size: clamp(24px, 3.4vw, 36px); font-weight: 500; line-height: 1.3; margin: 0; }
.h-block { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.lede { color: var(--text-dim); font-size: 16px; line-height: 24px; margin: 20px 0 0; max-width: 62ch; }

/* Cards / panels ---------------------------------------------------------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.card-visual {
  position: relative; height: 240px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 20px;
}
.icon-badge {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--chip); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.icon-badge svg { width: 15px; height: 15px; }

/* Metrics strip ----------------------------------------------------------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 48px; }
.metric { position: relative; padding-top: 26px; }
.metric::before, .metric::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 1px;
}
.metric::before { background: var(--border); }
.metric::after {
  background: var(--white); transform: scaleX(0); transform-origin: left;
  transition: transform 1.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.metric.in-view::after { transform: scaleX(1); }
.metric .k {
  font-family: var(--mono); font-size: 10.5px; line-height: 1.6; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 26px;
}
.metric .v {
  display: flex; align-items: flex-start;
  font-weight: 300; font-size: clamp(36px, 4.6vw, 60px);
  letter-spacing: -1.5px; font-variant-numeric: tabular-nums;
}
.metric .v .u { font-size: 15px; font-weight: 400; color: var(--text-faint); letter-spacing: 0; margin: 10px 0 0 4px; }
@media (max-width: 760px) { .metrics { grid-template-columns: 1fr 1fr; gap: 32px; } }

/* Spec table -------------------------------------------------------------- */
.spec { overflow: hidden; }
.spec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.spec-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.spec-head .rev { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.spec-row { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--border); align-items: center; }
.spec-row:last-child { border-bottom: none; }
.spec-row .label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.3px; color: var(--text-faint); }
.spec-row .value { font-size: 16px; line-height: 24px; }
@media (max-width: 700px) { .spec-row { grid-template-columns: 1fr; gap: 4px; } }

/* Tables ------------------------------------------------------------------ */
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 21px; }
th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-faint); font-weight: 500;
}
tbody tr:last-child td { border-bottom: none; }
td.dim { color: var(--text-dim); }

/* Footer ------------------------------------------------------------------ */
.site-footer { padding: 80px var(--gutter) 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; border-top: 1px solid var(--border); padding-top: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; }
.footer-brand { max-width: 280px; }
.footer-brand .row { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; margin-bottom: 12px; }
.footer-brand .row svg { width: 18px; height: 18px; }
.footer-brand p { color: var(--text-dim); font-size: 15px; line-height: 23px; margin: 0 0 8px; }
.footer-brand .loc { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h5 { margin: 0 0 14px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.3px; color: var(--text-faint); text-transform: uppercase; }
.footer-col a { display: block; text-decoration: none; color: var(--text-dim); font-size: 13.5px; margin-bottom: 11px; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: var(--maxw); margin: 34px auto 0; padding-top: 20px;
  border-top: 1px solid var(--border); display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-faint);
}
@media (max-width: 640px) { .footer-cols { flex-direction: column; gap: 28px; } }

/* Disclosure -------------------------------------------------------------- */
.disclosure {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--sunken); padding: 14px 16px;
  font-size: 13.5px; line-height: 21px; color: var(--text-dim);
}
.disclosure.warn { border-color: rgba(224,169,59,0.30); background: rgba(224,169,59,0.06); color: var(--warn); }
.disclosure .ico { flex-shrink: 0; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .metric::after { transform: scaleX(1); }
}

/* Docs -------------------------------------------------------------------- */
.docs-wrap {
  max-width: var(--maxw); margin: 0 auto; padding: 34px var(--gutter) 0;
  display: grid; grid-template-columns: 232px minmax(0, 1fr) 208px; gap: 44px;
  align-items: start;
}
@media (max-width: 1100px) { .docs-wrap { grid-template-columns: 210px minmax(0,1fr); } .docs-toc { display: none; } }
@media (max-width: 820px)  { .docs-wrap { grid-template-columns: 1fr; gap: 24px; } }

.docs-side { position: sticky; top: 104px; max-height: calc(100vh - 130px); overflow-y: auto; }
@media (max-width: 820px) {
  .docs-side { position: static; max-height: none; border-bottom: 1px solid var(--border); padding-bottom: 18px; }
}
.docs-side .dg { margin-bottom: 24px; }
.docs-side h5 {
  margin: 0 0 10px; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint);
}
.docs-side a {
  display: block; text-decoration: none; color: var(--text-dim);
  font-size: 13.5px; line-height: 1.4; padding: 6px 10px; margin-left: -10px;
  border-radius: 7px; transition: color 0.2s ease, background 0.2s ease;
}
.docs-side a:hover { color: var(--text); background: var(--panel); }
.docs-side a.on { color: var(--text); background: var(--chip); }

.doc-body { min-width: 0; padding-bottom: 20px; }
.doc-body > h1 {
  margin: 0 0 10px; font-size: clamp(28px, 3.6vw, 38px); font-weight: 500; letter-spacing: -0.5px;
}
.doc-body .doc-lede { margin: 0 0 32px; color: var(--text-dim); font-size: 17px; line-height: 26px; max-width: 68ch; }
.doc-body h2 {
  margin: 44px 0 12px; font-size: 21px; font-weight: 700; scroll-margin-top: 110px;
  padding-top: 22px; border-top: 1px solid var(--border);
}
.doc-body h3 { margin: 28px 0 10px; font-size: 16px; font-weight: 700; scroll-margin-top: 110px; }
.doc-body p { margin: 0 0 16px; color: var(--text-dim); max-width: 70ch; }
.doc-body strong { color: var(--text); font-weight: 700; }
.doc-body ul, .doc-body ol { margin: 0 0 16px; padding-left: 20px; color: var(--text-dim); max-width: 70ch; }
.doc-body li { margin-bottom: 8px; }
.doc-body a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.doc-body a:hover { text-decoration-color: var(--text); }
.doc-body code {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  background: var(--chip); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
}
.doc-body pre {
  background: var(--sunken); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; margin: 0 0 18px;
}
.doc-body pre code { background: none; border: 0; padding: 0; font-size: 12.5px; line-height: 20px; }
.doc-body .tablewrap { margin-bottom: 18px; }
.doc-body .callout {
  display: flex; gap: 10px; border: 1px solid var(--border); border-left: 2px solid var(--border-strong);
  background: var(--sunken); border-radius: 8px; padding: 14px 16px; margin: 0 0 18px;
  font-size: 14px; line-height: 21px; color: var(--text-dim);
}
.doc-body .callout.warn { border-color: rgba(224,169,59,0.3); border-left-color: var(--warn); background: rgba(224,169,59,0.05); }
.doc-body .callout.live { border-color: rgba(94,200,242,0.3); border-left-color: var(--live); background: rgba(94,200,242,0.05); }
.doc-body .callout p:last-child { margin-bottom: 0; }

.doc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0 0; }
@media (max-width: 640px) { .doc-cards { grid-template-columns: 1fr; } }
.doc-card {
  display: block; text-decoration: none; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  transition: border-color 0.2s ease;
}
.doc-card:hover { border-color: var(--border-strong); }
.doc-card h4 { margin: 0 0 6px; font-size: 15.5px; font-weight: 700; }
.doc-card p { margin: 0; font-size: 13.5px; line-height: 20px; color: var(--text-dim); }

.docs-toc { position: sticky; top: 104px; }
.docs-toc h5 {
  margin: 0 0 12px; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint);
}
.docs-toc a {
  display: block; text-decoration: none; color: var(--text-faint);
  font-size: 12.5px; line-height: 1.45; padding: 5px 0 5px 12px;
  border-left: 1px solid var(--border); transition: color 0.2s ease, border-color 0.2s ease;
}
.docs-toc a:hover { color: var(--text-dim); }
.docs-toc a.active { color: var(--text); border-left-color: var(--text); }
.docs-toc a.lvl3 { padding-left: 24px; }

.docs-pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--border); }
.docs-pager .pg {
  display: flex; flex-direction: column; gap: 3px; text-decoration: none;
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px;
  min-width: 180px; transition: border-color 0.2s ease;
}
.docs-pager .pg:hover { border-color: var(--border-strong); }
.docs-pager .pg.next { text-align: right; margin-left: auto; }
.docs-pager .pg span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); }
.docs-pager .pg b { font-size: 14px; font-weight: 500; color: var(--text); }

/* PTP — Pre-Tokenization Platform ------------------------------------------ */
.subnav-outer { padding: 14px var(--gutter) 0; }
.subnav {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); padding: 8px 18px;
}
.subnav-brand {
  font-size: 12px; font-weight: 500; letter-spacing: 1px;
  border-right: 1px solid var(--border); padding-right: 18px;
}
.subnav-links { display: flex; gap: 20px; flex-wrap: wrap; }
.subnav-links a {
  text-decoration: none; color: var(--text-dim); font-size: 13px;
  transition: color 0.2s ease;
}
.subnav-links a:hover, .subnav-links a.on { color: var(--text); }
.subnav-tag { margin-left: auto; font-size: 10px; letter-spacing: 0.6px; color: var(--text-faint); }
@media (max-width: 860px) { .subnav-tag { display: none; } }

/* stat strip */
.statstrip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.statstrip > div { padding: 18px 20px; border-right: 1px solid var(--border); }
.statstrip > div:last-child { border-right: none; }
.statstrip .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); }
.statstrip .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 24px; margin-top: 8px; }
.statstrip .s { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
@media (max-width: 900px) {
  .statstrip { grid-template-columns: 1fr 1fr; }
  .statstrip > div:nth-child(2n) { border-right: none; }
  .statstrip > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 520px) {
  .statstrip { grid-template-columns: 1fr; }
  .statstrip > div { border-right: none; border-bottom: 1px solid var(--border); }
  .statstrip > div:last-child { border-bottom: none; }
}

/* target company cards */
.targets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .targets { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .targets { grid-template-columns: 1fr; } }
.target {
  display: block; text-decoration: none; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  transition: border-color 0.2s ease;
}
.target:hover { border-color: var(--border-strong); }
.target .row1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.target .co { display: flex; align-items: center; gap: 10px; }
.target .glyph {
  width: 32px; height: 32px; border-radius: 8px; background: var(--chip);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim); flex-shrink: 0;
}
.target .name { font-size: 15.5px; font-weight: 700; }
.target .sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; font-family: var(--mono); }
.target .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.target .grid2 .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.6px; color: var(--text-faint); text-transform: uppercase; }
.target .grid2 .v { font-family: var(--mono); font-size: 14px; margin-top: 4px; }

/* trade ticket */
.ticket { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.ticket-tabs { display: inline-flex; gap: 4px; border: 1px solid var(--border); border-radius: 999px; padding: 4px; background: var(--sunken); }
.ticket-tabs button {
  border: 0; background: none; cursor: pointer; color: var(--text-dim);
  font-family: var(--sans); font-size: 13px; padding: 6px 18px; border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.ticket-tabs button[aria-selected="true"] { background: var(--chip); color: var(--text); }
.ticket .amt {
  width: 100%; height: 52px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--sunken); color: var(--text); padding: 0 14px;
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 20px;
}
.ticket .amt:focus { border-color: var(--text); outline: none; }
.chipset { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chipset button {
  border: 1px solid var(--border); background: var(--sunken); color: var(--text-dim);
  border-radius: 999px; padding: 5px 12px; font-family: var(--mono); font-size: 11.5px; cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.chipset button:hover { color: var(--text); border-color: var(--border-strong); }
.chipset button[aria-pressed="true"] { background: var(--chip); color: var(--text); border-color: var(--text); }

.split { border-top: 1px solid var(--border); margin-top: 16px; }
.split .r { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-dim); }
.split .r:last-child { border-bottom: 0; }
.split .r b { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text); font-weight: 400; }
.split .r.total b { font-size: 15px; }
.split .r .tag { font-size: 11px; color: var(--text-faint); }

/* fee ladder */
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 720px) { .ladder { grid-template-columns: 1fr 1fr; } }
.rung {
  border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); padding: 14px;
}
.rung.on { border-color: var(--text); background: var(--chip); }
.rung .band { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px; color: var(--text-faint); text-transform: uppercase; }
.rung .pct { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 26px; margin: 8px 0 6px; }
.rung .brk { font-size: 11.5px; line-height: 17px; color: var(--text-dim); }
.rung.on .brk { color: var(--text-dim); }

/* state machine */
.states { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 860px) { .states { grid-template-columns: 1fr 1fr; } }
.state { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 16px; }
.state .n { font-family: var(--mono); font-size: 10px; letter-spacing: 0.6px; color: var(--text-faint); }
.state h4 { margin: 8px 0 8px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.5px; }
.state p { margin: 0; font-size: 12.5px; line-height: 19px; color: var(--text-dim); }
.state.now { border-color: var(--live); background: rgba(94,200,242,0.05); }
.state.now h4 { color: var(--live); }

/* two-path diagram */
.paths { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; }
@media (max-width: 860px) { .paths { grid-template-columns: 1fr; } }
.path { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 20px; }
.path h4 { margin: 0 0 4px; font-size: 15.5px; font-weight: 700; }
.path .fl { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); margin-bottom: 12px; }
.path p { margin: 0 0 14px; font-size: 13.5px; line-height: 21px; color: var(--text-dim); }
.path .out { border-top: 1px solid var(--border); padding-top: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--text); }
.paths .sep {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 22px; color: var(--text-faint);
}

/* portfolio rows */
.prow {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr auto; gap: 16px; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.prow:last-child { border-bottom: 0; }
.prow .who { display: flex; align-items: center; gap: 12px; }
.prow .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.6px; color: var(--text-faint); text-transform: uppercase; display: block; margin-bottom: 3px; }
.prow .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14px; }
.prow .vs { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); }
@media (max-width: 900px) { .prow { grid-template-columns: 1fr 1fr; gap: 12px; } }

/* Logos -------------------------------------------------------------------- */
.logo {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--white); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.logo img { width: 82%; height: 82%; object-fit: contain; display: block; }
.logo-lg { width: 46px; height: 46px; border-radius: 10px; }
.logo-sm { width: 30px; height: 30px; border-radius: 7px; }
/* Some marks ship with their own opaque background (SpaceX, OpenAI, xAI, Figure).
   Those get no plate at all and bleed to the edge; a white plate behind a white-on-black
   wordmark is how you end up with an empty box. */
.logo.cover { background: transparent; border-color: var(--border); }
.logo.cover img { width: 100%; height: 100%; object-fit: cover; }

/* Pool table (Uniswap-style rows) ------------------------------------------ */
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filterbar .grow { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.select {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 10px; padding: 9px 14px; font-family: var(--sans); font-size: 13.5px; font-weight: 500;
  transition: border-color 0.2s ease;
}
.select:hover { border-color: var(--border-strong); }
.searchbox { position: relative; }
.searchbox input {
  height: 38px; width: 240px; max-width: 100%; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  padding: 0 12px 0 34px; font-family: var(--sans); font-size: 13.5px;
}
.searchbox input:focus { border-color: var(--text); outline: none; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--chip);
  border: 1px solid var(--border); position: relative; transition: background 0.2s ease;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text-faint); transition: transform 0.2s ease, background 0.2s ease;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch input:checked + .track { background: var(--white); border-color: var(--white); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--bg); }

.pooltable { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.pt-head, .pt-row {
  display: grid; grid-template-columns: minmax(0,2.4fr) 1fr 1fr 1fr 1fr;
  gap: 16px; align-items: center; padding: 14px 20px;
}
.pt-head {
  background: var(--sunken); border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-faint);
}
.pt-head .num, .pt-row .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pt-row { border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: background 0.2s ease; }
.pt-row:last-child { border-bottom: none; }
.pt-row:hover { background: var(--sunken); }
.pair { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pairnames { min-width: 0; }
.pairnames b { display: block; font-size: 14.5px; font-weight: 500; line-height: 1.3; }
.pairnames span { display: block; font-family: var(--mono); font-size: 11.5px; line-height: 1.4; color: var(--text-faint); }
.pt-row .num b { font-size: 14px; font-weight: 400; }
.sub-row .pairnames b { font-size: 13.5px; }
.sub-row .pairnames span { font-size: 11px; }
@media (max-width: 900px) {
  .pt-head { display: none; }
  .pt-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pt-row .pair { grid-column: 1 / -1; }
  .pt-row .num { text-align: left; }
  .pt-row .num::before { content: attr(data-k); display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 3px; }
}

.sublist { background: var(--sunken); border-bottom: 1px solid var(--border); }
.sublist[hidden] { display: none; }
.sub-row {
  display: grid; grid-template-columns: minmax(0,2.4fr) 1fr 1fr 1fr 1fr; gap: 16px;
  align-items: center; padding: 10px 20px 10px 44px; text-decoration: none; color: inherit;
  border-top: 1px solid var(--border);
}
.sub-row:hover { background: var(--panel); }
.sub-row .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }
@media (max-width: 900px) { .sub-row { grid-template-columns: 1fr 1fr; padding-left: 20px; } .sub-row .num { text-align: left; } }

/* points / participation */
.pointgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .pointgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pointgrid { grid-template-columns: 1fr; } }
.pointcard { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 20px; }
.pointcard .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); }
.pointcard .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 30px; margin: 10px 0 4px; }
.pointcard .s { font-size: 12.5px; line-height: 18px; color: var(--text-dim); }
.emptystate {
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--sunken);
  padding: 40px 24px; text-align: center; color: var(--text-dim); font-size: 14px; line-height: 22px;
}

/* X_TP leverage tree ------------------------------------------------------- */
.tree { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.tree-group { border-bottom: 1px solid var(--border); }
.tree-group:last-child { border-bottom: none; }

/* the root: the underlying stock */
.tree-root {
  display: grid; grid-template-columns: minmax(0,2.4fr) 1fr 1fr 1fr 1fr; gap: 16px;
  align-items: center; padding: 16px 20px; text-decoration: none; color: inherit;
}
.tree-root .pair { gap: 12px; }
.tree-root b { font-size: 15px; font-weight: 500; }

/* the branches: each leverage tier hanging off the root */
.tree-kids { padding: 0 0 8px 0; position: relative; }
.tree-kid {
  position: relative;
  display: grid; grid-template-columns: minmax(0,2.4fr) 1fr 1fr 1fr 1fr; gap: 16px;
  align-items: center; padding: 9px 20px 9px 54px;
  text-decoration: none; color: inherit; transition: background 0.2s ease;
}
.tree-kid:hover { background: var(--sunken); }
/* trunk: a single rule running down through the children */
.tree-kid::before {
  content: ''; position: absolute; left: 33px; top: 0; bottom: 0;
  border-left: 1px solid var(--border);
}
.tree-kid:last-child::before { bottom: 50%; }
/* elbow into each child */
.tree-kid::after {
  content: ''; position: absolute; left: 33px; top: 50%; width: 13px;
  border-top: 1px solid var(--border);
}
.tree-kid .lev {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 13.5px; font-weight: 500;
}
.tree-kid .lev .x {
  border: 1px solid var(--border); background: var(--chip); color: var(--text);
  border-radius: 5px; padding: 1px 6px; font-size: 11px;
}
.tree-kid .side { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.tree-kid .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.tree-head {
  display: grid; grid-template-columns: minmax(0,2.4fr) 1fr 1fr 1fr 1fr; gap: 16px;
  padding: 13px 20px; background: var(--sunken); border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-faint);
}
.tree-head .num, .tree-root .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .tree-head { display: none; }
  .tree-root, .tree-kid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tree-root .pair, .tree-kid .lev { grid-column: 1 / -1; }
  .tree-root .num, .tree-kid .num { text-align: left; }
  .tree-root .num::before, .tree-kid .num::before {
    content: attr(data-k); display: block; font-family: var(--mono); font-size: 10px;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 3px;
  }
  .tree-kid { padding-left: 40px; }
  .tree-kid::before { left: 22px; }
  .tree-kid::after { left: 22px; width: 10px; }
}

/* Relay card — sits beside the hero copy, not as a strip beneath it */
.hero-split { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 40px; align-items: start; }
@media (max-width: 1000px) { .hero-split { grid-template-columns: 1fr; gap: 28px; } }

.relaycard {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 20px; position: relative; overflow: hidden;
}
.relaycard .who {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px;
}
.relaycard .who .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--live); }
.relaycard .q { margin: 0 0 18px; font-size: 15px; line-height: 22px; color: var(--text); }
.relaycard .q .qmark { color: var(--live); }
.relaycard .rows { border-top: 1px solid var(--border); }
.relaycard .rows > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; color: var(--text-faint);
}
.relaycard .rows > div:last-child { border-bottom: 0; }
.relaycard .rows b { color: var(--text-dim); font-weight: 400; text-align: right; }

/* Market table: view toggle, clickable rows, slide-over ticket ------------- */
.mkt-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.mkt-toolbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.viewtoggle {
  position: relative; display: inline-flex; padding: 4px; gap: 2px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel);
}
.viewtoggle button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  color: var(--text-dim); font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 7px 16px; border-radius: 999px; white-space: nowrap;
  transition: color 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.viewtoggle button[aria-selected="true"] { color: var(--text); }
.viewtoggle .thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; z-index: 0;
  background: var(--chip); border-radius: 999px;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.viewtoggle .count {
  margin-left: 7px; font-family: var(--mono); font-size: 11px; color: var(--text-faint);
}

/* rows swap with a short rise, not a cut */
.mkt-body { transition: opacity 0.18s ease, transform 0.18s ease; }
.mkt-body.swapping { opacity: 0; transform: translateY(6px); }

.mkt-row {
  display: grid; gap: 16px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left; font-family: var(--sans); color: inherit;
  transition: background 0.18s ease;
}
.mkt-row:last-child { border-bottom: none; }
.mkt-row:hover, .mkt-row:focus-visible { background: var(--sunken); }
.mkt-row[aria-selected="true"] { background: var(--chip); }
.mkt-row .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14px; }
.mkt-row .num .sub { display: block; font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.mkt-head {
  display: grid; gap: 16px; padding: 13px 20px;
  background: var(--sunken); border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-faint);
}
.mkt-head .num { text-align: right; }
/* the "paired with" count gets its own emphasis, since it is the point of the row */
.paircount {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--sunken); border-radius: 999px;
  padding: 3px 10px; font-family: var(--mono); font-size: 11.5px; color: var(--text);
}
.paircount .n { font-weight: 500; }
.paircount .l { color: var(--text-faint); }
@media (max-width: 900px) {
  .mkt-head { display: none; }
  .mkt-row { grid-template-columns: 1fr 1fr !important; }
  .mkt-row .ident { grid-column: 1 / -1; }
  .mkt-row .num { text-align: left; }
  .mkt-row .num::before {
    content: attr(data-k); display: block; font-family: var(--mono); font-size: 10px;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 3px;
  }
}

/* ---- inline ticket: the table makes room, nothing overlays the page ---- */
.mkt-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0px;
  column-gap: 0;
  align-items: start;
  transition: grid-template-columns 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              column-gap 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.mkt-shell.open { grid-template-columns: minmax(0, 1fr) 380px; column-gap: 18px; }
.mkt-main { min-width: 0; }

.mkt-side { min-width: 0; overflow: hidden; }
.ticket-panel {
  position: sticky; top: 100px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
  width: 380px;                       /* fixed, so it does not reflow while the column grows */
  opacity: 0; transform: translateX(10px);
  transition: opacity 0.26s ease 0.06s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.06s;
}
.mkt-shell.open .ticket-panel { opacity: 1; transform: none; }

.ticket-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.ticket-close {
  border: 1px solid var(--border); background: var(--sunken); color: var(--text-dim);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ticket-close:hover { color: var(--text); border-color: var(--border-strong); }
.ticket-body { padding: 18px; }
.ticket-foot { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--sunken); }

.d-price { display: flex; align-items: baseline; gap: 10px; margin: 0 0 16px; }
.d-price b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 400; }
.d-amt {
  width: 100%; height: 46px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--sunken); color: var(--text); padding: 0 12px;
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 17px;
}
.d-amt:focus { border-color: var(--text); outline: none; }

/* Below the split the table would be too narrow, so the ticket stacks above it instead. */
@media (max-width: 1080px) {
  .mkt-shell, .mkt-shell.open { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .mkt-side { order: -1; max-height: 0; transition: max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1); }
  .mkt-shell.open .mkt-side { max-height: 900px; margin-bottom: 18px; }
  .ticket-panel { position: static; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .mkt-shell, .ticket-panel, .mkt-side, .viewtoggle .thumb, .mkt-body { transition: none !important; }
}


/* Group rows roll their children out in place ------------------------------ */
.mkt-row .caret {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; flex-shrink: 0; color: var(--text-faint);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}
.mkt-row:hover .caret { color: var(--text-dim); }
.mkt-row.expanded .caret { transform: rotate(90deg); color: var(--text); }

/* The container simply shows or hides; the reveal is carried by the rows themselves, which
   fade and rise on a stagger. Animating the container height was tried two ways —
   grid-template-rows fr interpolation and a measured max-height — and both could leave the
   group open at zero height. A reveal that always works beats a smoother one that sometimes
   does not. */
.mkt-kids { display: none; background: var(--sunken); }
.mkt-kids.open { display: block; }
.mkt-kids .mkt-row {
  padding-left: 46px; border-bottom: 1px solid var(--border);
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease;
}
.mkt-kids.open .mkt-row { opacity: 1; transform: none; }
.mkt-kids.open .mkt-row:nth-child(1) { transition-delay: 0.06s; }
.mkt-kids.open .mkt-row:nth-child(2) { transition-delay: 0.09s; }
.mkt-kids.open .mkt-row:nth-child(3) { transition-delay: 0.12s; }
.mkt-kids.open .mkt-row:nth-child(4) { transition-delay: 0.15s; }
.mkt-kids.open .mkt-row:nth-child(n+5) { transition-delay: 0.18s; }
.mkt-kids .mkt-row:hover { background: var(--panel); }
.mkt-kids .mkt-row:last-child { border-bottom: 0; }
@media (max-width: 900px) { .mkt-kids .mkt-row { padding-left: 20px; } }
@media (prefers-reduced-motion: reduce) {
  .mkt-kids, .mkt-kids .mkt-row, .mkt-row .caret { transition: none !important; }
}

/* Groups vs their children ------------------------------------------------- */
/* A stock row and a paired-market row are different kinds of thing with different columns,
   so they read differently: the group sits on the panel, its children on a recessed step
   behind a trunk line. Monochrome — the difference is depth, not hue. */
.mkt-row:not(.is-child) .pairnames b { font-size: 15px; font-weight: 500; }
.mkt-row:not(.is-child) { background: var(--panel); }
.mkt-row.expanded { background: var(--chip); }

.mkt-subhead {
  display: grid; gap: 16px; padding: 9px 20px 9px 46px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-faint);
  background: var(--bg);
}
.mkt-subhead .num { text-align: right; }
@media (max-width: 900px) { .mkt-subhead { display: none; } }

.mkt-kids { position: relative; }
/* trunk down the left of a group's children */
.mkt-kids.open::before {
  content: ''; position: absolute; left: 33px; top: 0; bottom: 0;
  border-left: 1px solid var(--border);
}
.mkt-kids .mkt-row.is-child { background: var(--sunken); }
.mkt-kids .mkt-row.is-child:hover { background: var(--panel); }
.mkt-kids .mkt-row.is-child .pairnames b { font-size: 13.5px; font-weight: 500; }
.mkt-kids .mkt-row.is-child .pairnames span { font-size: 10.5px; }

/* Theme strip above a table ------------------------------------------------ */
.themes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.themes-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.themes-head a { font-size: 13px; color: var(--text-dim); text-decoration: none; }
.themes-head a:hover { color: var(--text); }

.themes {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none; scroll-snap-type: x proximity;
}
.themes::-webkit-scrollbar { display: none; }
.theme {
  flex: 0 0 auto; width: 196px; scroll-snap-align: start; cursor: pointer; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 16px; font-family: var(--sans); color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s cubic-bezier(0.22,1,0.36,1);
}
.theme:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.theme[aria-pressed="true"] { border-color: var(--text); background: var(--chip); }
.theme .stack { display: flex; margin-bottom: 14px; }
.theme .stack .logo {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--white); box-shadow: 0 0 0 2px var(--panel);
}
.theme .stack .logo img { width: 100%; height: 100%; object-fit: cover; }
.theme .stack .logo:not(:first-child) { margin-left: -11px; }
.theme .stack .more {
  width: 34px; height: 34px; border-radius: 50%; margin-left: -11px;
  background: var(--chip); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10.5px; color: var(--text-dim);
}
.theme .tname { display: block; font-size: 15px; font-weight: 700; }
.theme .tcount { display: block; font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin-top: 3px; }

/* Live entropy cards — shared by /relay and /relay/live */
.lv-card { border:1px solid var(--border); border-radius:var(--radius); background:var(--panel);
  padding:15px 16px; opacity:0; animation:lv-in .45s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes lv-in { from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }
.lv-card.ok { border-color:color-mix(in srgb, var(--live) 32%, var(--border)); }
.lv-card.stale { border-color:color-mix(in srgb, var(--warn) 38%, var(--border)); }
.lv-card.off { opacity:0; animation:lv-in .45s cubic-bezier(.16,1,.3,1) forwards; }
.lv-card header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.lv-card header b { font-size:14px; }
.lv-card-a { font-size:9.5px; letter-spacing:0.6px; text-transform:uppercase; color:var(--text-faint); margin-top:5px; }
.lv-sig { display:block; width:100%; height:46px; margin:12px 0 10px; }
.lv-card p { margin:0; font-size:12px; line-height:17px; color:var(--text-dim); }
.lv-card footer { display:flex; justify-content:space-between; gap:8px; margin-top:11px; padding-top:9px;
  border-top:1px solid var(--border); font-size:10px; color:var(--text-faint); }
@keyframes lv-in { to { opacity: 1; transform: none; } }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

/* Launch pages (PREtp and Xtp) ------------------------------------------- */
.lc-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; margin-top: 32px; align-items: start; }
@media (max-width: 1000px) { .lc-grid { grid-template-columns: 1fr; } }
.launch-form { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.stepnum { font-size: 10.5px; letter-spacing: 0.6px; color: var(--text-faint); margin-bottom: 8px; }
.fieldnote { color: var(--text-dim); font-size: 13.5px; line-height: 21px; margin: 0 0 16px; max-width: 62ch; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.3px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.field .unit { text-transform: none; float: right; }
.field input, .field textarea { width: 100%; border-radius: 10px; border: 1px solid var(--border); background: var(--sunken); color: var(--text); padding: 12px; font-family: var(--sans); font-size: 14px; resize: vertical; }
.field input { height: 44px; padding: 0 12px; }
.field input:focus, .field textarea:focus { border-color: var(--text); outline: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.ack { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 20px; color: var(--text-dim); cursor: pointer; }
.ack input { margin-top: 3px; flex-shrink: 0; }
.lc-side { position: sticky; top: 160px; }
.glyph-lg { width: 44px; height: 44px; border-radius: 10px; background: var(--chip); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--text); overflow: hidden; flex-shrink: 0; }
.glyph-lg img { width: 60%; height: 60%; object-fit: contain; }
.hint { font-size: 12px; line-height: 18px; color: var(--text-faint); margin: 0; }
.lc-warn { margin-top: 12px; border: 1px solid rgba(224,169,59,.45); background: rgba(224,169,59,.07); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 19px; color: var(--text-dim); }
.lc-warn b { color: var(--warn); }

.picker { border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); overflow: hidden; }
.picker-q { width: 100%; height: 42px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); padding: 0 14px; font-family: var(--sans); font-size: 14px; outline: none; }
.picker-q::placeholder { color: var(--text-faint); }
.picker-list { max-height: 264px; overflow-y: auto; scrollbar-width: thin; }
.picker-row { width: 100%; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 9px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); text-align: left; cursor: pointer; transition: background .14s ease; }
.picker-row:last-child { border-bottom: 0; }
.picker-row:hover { background: var(--panel); }
.picker-row[aria-selected="true"] { background: var(--chip); }
.picker-row .pn b { display: block; font-size: 13.5px; }
.picker-row .pn span { display: block; font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-row .pc { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.picker-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--text-faint); }

.mkt-create {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 54px;
  font-size: 13px; color: var(--text-dim); text-decoration: none;
  border-top: 1px dashed var(--border); transition: color .16s ease, background .16s ease;
}
.mkt-create:hover { color: var(--text); background: var(--panel); }
.mkt-create .plus { width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; }

/* Third level: tickers launched against a leverage market. One more step in, one more step down.
   The trunk moves with the indent so the branch reads as a branch, not a stray line. */
.mkt-kids .mkt-kids { background: var(--bg); }
.mkt-kids .mkt-kids .mkt-row { padding-left: 74px; }
.mkt-kids .mkt-kids .mkt-subhead { padding-left: 74px; }
.mkt-kids .mkt-kids .mkt-create { padding-left: 74px; }
.mkt-kids .mkt-kids.open::before { left: 61px; }
.mkt-kids .mkt-kids .mkt-row.is-child .pairnames b { font-size: 13px; }
.mkt-kids .mkt-kids .mkt-row.is-child:hover { background: var(--sunken); }
/* A row that both trades and expands: make the caret read as its own target. */
.mkt-row[data-depth="1"][aria-expanded] .caret { width: 22px; height: 22px; border-radius: 6px; margin-left: -4px; }
.mkt-row[data-depth="1"][aria-expanded] .caret:hover { background: var(--chip); color: var(--text); }
@media (max-width: 900px) {
  .mkt-kids .mkt-kids .mkt-row, .mkt-kids .mkt-kids .mkt-subhead, .mkt-kids .mkt-kids .mkt-create { padding-left: 34px; }
  .mkt-kids .mkt-kids.open::before { left: 24px; }
}

/* Explore strip — the card grid above the market tables ------------------- */
.xp { margin: 0 0 24px; }
.xp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.xp-title h2 { display: inline; margin: 0 10px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.xp-count { font-size: 11px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; vertical-align: 3px; }
.xp-title p { margin: 6px 0 0; font-size: 13.5px; color: var(--text-dim); max-width: 52ch; }
.xp-ctl { display: flex; gap: 8px; flex-wrap: wrap; }
.xp-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); }
.xp-tabs button { border: 0; background: none; color: var(--text-dim); font-family: var(--sans); font-size: 13px; padding: 6px 13px; border-radius: 999px; cursor: pointer; transition: color .18s ease, background .18s ease; white-space: nowrap; }
.xp-tabs button:hover { color: var(--text); }
.xp-tabs button[aria-selected="true"] { background: var(--chip); color: var(--text); }
.xp-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1240px) { .xp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .xp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .xp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.xp-card { text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 8px 8px 10px; color: var(--text); cursor: pointer; font-family: var(--sans); transition: border-color .18s ease; min-width: 0; }
.xp-card:hover { border-color: var(--border-strong); }
.xp-img { position: relative; aspect-ratio: 1; border-radius: 8px; background: var(--sunken); border: 1px solid var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 9px; }
.xp-img img { width: 58%; height: 58%; object-fit: contain; }
.xp-img img.cover { width: 100%; height: 100%; object-fit: cover; }
.xp-img .ph { color: var(--text-faint); font-size: 22px; }
.xp-badge { position: absolute; top: 6px; left: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .4px; padding: 2px 7px; border-radius: 999px; background: var(--chip); color: var(--text-dim); border: 1px solid var(--border); }
.xp-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xp-tick { font-size: 11px; color: var(--text-faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xp-mc { display: flex; align-items: baseline; gap: 5px; margin-top: 6px; }
.xp-mc b { font-size: 14px; font-weight: 500; }
.xp-mc span { font-size: 10px; color: var(--text-faint); letter-spacing: .4px; }
.xp-prog { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.xp-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--chip); overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: var(--positive); border-radius: 2px; }
.xp-prog span { font-size: 10.5px; color: var(--text-dim); }
.xp-foot { display: flex; justify-content: space-between; margin-top: 7px; font-size: 10px; color: var(--text-faint); }
.xp-foot .t { color: var(--positive); }
