/* Layout, density and motion values follow the reference documentation page (measured from its stylesheet):
   topbar 60px, sidebar 284px, content max 1120px, 15px/1.6 body, radii 18/12/9, hover lift 3px,
   hover transitions .12-.15s ease, drawer .2s ease, 3s linear title sweep.
   Colours: tokens.css only. Tints are mixed from tokens, never typed as literals. */
:root {
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --accent: var(--blue);
  --accent-2: var(--indigo);
  --text: var(--ink);
  --text-muted: color-mix(in srgb, var(--ink) 62%, var(--surface));
  --link: var(--blue);
  --line: color-mix(in srgb, var(--ink) 10%, transparent);
  --line-strong: color-mix(in srgb, var(--indigo) 20%, transparent);
  --card: color-mix(in srgb, var(--surface) 82%, transparent);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --shadow: 0 8px 24px color-mix(in srgb, var(--indigo) 12%, transparent);
  --shadow-glow: 0 6px 18px color-mix(in srgb, var(--blue) 35%, transparent);
  --topbar-h: 60px;
  --stack-h: 124px;
  --sidebar-w: 284px;
  --tap: 44px;
  --sweep: linear-gradient(-225deg, var(--deep) 2%, var(--indigo) 29%, var(--magenta) 47%, var(--violet) 100%);
  --rule: linear-gradient(90deg, var(--blue), var(--cyan), var(--magenta));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--blue) 30%, transparent) transparent; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 85% -5%, color-mix(in srgb, var(--cyan) 28%, transparent), transparent 55%),
    radial-gradient(1100px 800px at 5% 10%, color-mix(in srgb, var(--magenta) 18%, transparent), transparent 55%),
    radial-gradient(1000px 900px at 60% 100%, color-mix(in srgb, var(--violet) 16%, transparent), transparent 55%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 40%, var(--surface) 100%);
  background-attachment: fixed;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@keyframes sweep { to { background-position: 200% center; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- STACK (top bar + contract slot) */
.stack { position: sticky; top: 0; z-index: 100; }
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-bottom: 1px solid;
  border-image: var(--rule) 1;
  background:
    radial-gradient(900px 300px at 80% 100%, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 60%),
    radial-gradient(900px 300px at 10% 100%, color-mix(in srgb, var(--magenta) 10%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--blue) 8%, var(--surface)));
  box-shadow: var(--shadow);
  backdrop-filter: blur(40px) brightness(105%);
  -webkit-backdrop-filter: blur(40px) brightness(105%);
}
.icon-btn {
  width: var(--tap); height: var(--tap);
  border-radius: var(--radius-xs);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-2); background: transparent; border: 0; cursor: pointer; flex: 0 0 auto; padding: 0;
  transition: background .12s ease;
}
.icon-btn:hover { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

.brand { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 8px; border-radius: var(--radius-xs); font-weight: 900; font-size: 20px; text-transform: uppercase; color: var(--accent-2); }
.brand:hover { text-decoration: none; background: color-mix(in srgb, var(--blue) 6%, transparent); }

.search { flex: 1 1 auto; max-width: 520px; margin: 0 auto; position: relative; }
.search-toggle { display: none; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: var(--accent-2); pointer-events: none; }
.search input {
  width: 100%; height: var(--tap);
  border-radius: 9px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  padding: 0 14px 0 42px;
  font-family: var(--font); font-size: 16px; font-weight: 600; color: var(--text); outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }

.right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: auto; }
.social-link {
  width: var(--tap); height: var(--tap);
  border-radius: var(--radius-xs);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
  color: var(--accent-2);
  transition: transform .12s ease, border-color .12s ease;
}
.social-link:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.social-link .mark { width: 20px; height: 20px; fill: currentColor; display: block; }
.social-link.is-inert { opacity: .42; cursor: not-allowed; box-shadow: none; }
.social-link.is-inert:hover { transform: none; border-color: var(--line); }

/* contract slot */
.ca {
  border-bottom: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}
.ca-inner { max-width: 1440px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.ca-label { flex: 0 0 auto; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
.ca-value {
  flex: 1 1 280px; min-width: 0;
  margin: 0; padding: 4px 0; min-height: var(--tap);
  display: flex; align-items: center;
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(20px, 1.1vw + 12px, 28px);
  line-height: 1.25;
  overflow-wrap: anywhere; word-break: break-all;
  color: var(--text); text-align: left; background: none; border: 0; cursor: copy;
}
button.ca-value:hover { color: var(--accent); }
.ca-value.is-inert { color: var(--text-muted); font-family: var(--font); font-weight: 800; cursor: not-allowed; }
.ca-hint { display: none; flex: 0 0 auto; font-size: 12px; color: var(--text-muted); }
.ca-date { flex: 0 0 auto; font-size: 13px; color: var(--text-muted); }
.ca-copy {
  flex: 0 0 auto; min-width: var(--tap); min-height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px;
  font: 700 13px/1 var(--font); color: var(--surface);
  background: var(--accent); border: 1px solid var(--line-strong); border-radius: var(--radius-xs); cursor: pointer;
  transition: opacity .12s ease, background .12s ease;
}
.ca-copy svg { width: 14px; height: 14px; fill: currentColor; }
.ca-copy:hover { background: var(--accent-2); }
.ca-copy:disabled { background: transparent; color: var(--text-muted); border-color: var(--line); cursor: not-allowed; opacity: .6; }
.ca.copied .ca-copy { background: var(--accent-2); }
.ca-toast { flex: 0 0 auto; min-height: 1px; font-size: 13px; font-weight: 800; color: var(--accent-2); }

/* ---------------------------------------------------------------- LAYOUT */
.layout { display: flex; align-items: stretch; min-height: calc(100vh - var(--stack-h)); }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: var(--stack-h); height: calc(100vh - var(--stack-h));
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
}
.nav-tree { list-style: none; margin: 0; padding: 12px 10px 16px; overflow-y: auto; flex: 1 1 auto; scrollbar-width: thin; }
.nav-tree ul { list-style: none; margin: 0; padding: 0; }
.nav-tree .children { display: none; }
.nav-tree .node.open > .children { display: block; }
.nav-row { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-xs); padding-right: 8px; margin: 2px 0; }
.nav-row:hover { background: color-mix(in srgb, var(--blue) 6%, transparent); }
.node.active > .nav-row { background: linear-gradient(90deg, color-mix(in srgb, var(--blue) 15%, transparent), color-mix(in srgb, var(--magenta) 10%, transparent)); }
.node.active > .nav-row .nav-link { color: var(--accent); font-weight: 700; }
.twisty { width: var(--tap); height: var(--tap); flex: 0 0 var(--tap); display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; cursor: pointer; color: var(--text-muted); border-radius: var(--radius-xs); padding: 0; }
.twisty:hover { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.twisty svg { width: 14px; height: 14px; fill: currentColor; transition: transform .15s ease; }
.node.open > .nav-row .twisty svg { transform: rotate(90deg); }
.twisty.leaf { visibility: hidden; cursor: default; }
.nav-link { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 6px; font-size: 15px; font-weight: 600; color: var(--text); border-radius: var(--radius-xs); min-width: 0; }
.nav-link:hover { text-decoration: none; }
.nav-link .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link .tag { margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.nav-link.is-inert { color: var(--text-muted); cursor: not-allowed; }
.children .nav-row { margin-left: 8px; }

/* ---------------------------------------------------------------- CONTENT */
.content-wrap { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; padding: 28px 40px 80px; }
.content { width: 100%; max-width: 1120px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb .sep { color: var(--accent-2); opacity: .5; }
h1.page-title {
  font-size: 32px; line-height: 1.12; font-weight: 900; letter-spacing: -.02em; margin: 12px 0 8px; text-transform: uppercase;
  background-image: var(--sweep); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: sweep 3s linear infinite;
}
.content h2 { font-size: 24px; font-weight: 800; margin: 40px 0 12px; padding-bottom: 8px; border-bottom: 2px solid; border-image: var(--rule) 1; scroll-margin-top: calc(var(--stack-h) + 16px); color: var(--accent-2); }
.content h3 { font-size: 19px; font-weight: 700; margin: 28px 0 8px; scroll-margin-top: calc(var(--stack-h) + 16px); }
.content p { margin: 0 0 14px; hyphens: auto; -webkit-hyphens: auto; }
.content ul, .content ol { margin: 0 0 16px; padding-left: 26px; }

/* panels */
.panel {
  display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius); margin: 0 0 22px; align-items: center;
  border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); background: var(--card);
  box-shadow: var(--shadow); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.panel:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.panel .p-icon { flex: 0 0 26px; width: 26px; height: 26px; align-self: flex-start; }
.panel .p-icon svg { width: 26px; height: 26px; fill: var(--accent); }
.panel .p-body { flex: 1 1 auto; min-width: 0; }
.panel .p-body > :last-child { margin-bottom: 0; }
.panel .p-art { flex: 0 0 96px; width: 96px; height: 96px; display: block; }

/* table of contents */
.toc-macro { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 14px 22px; margin: 0 0 26px; box-shadow: var(--shadow); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.toc-macro:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.toc-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; margin-bottom: 4px; color: var(--accent-2); }
.toc-head svg { width: 18px; height: 18px; fill: var(--accent); }
.toc-macro ol { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 28px; counter-reset: toc; }
.toc-macro li { counter-increment: toc; break-inside: avoid; margin: 0; }
.toc-macro a { display: flex; align-items: center; min-height: var(--tap); }
.toc-macro a::before { content: counter(toc) ". "; white-space: pre; color: var(--magenta); font-weight: 700; }
.toc-macro a.spy { font-weight: 700; }

/* stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 12px 0 30px; }
.stat {
  display: flex; flex-direction: column; gap: 4px; padding: 18px; min-width: 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--blue), var(--cyan), var(--magenta)); opacity: 0; transition: opacity .14s ease; }
.stat:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.stat:hover::before { opacity: 1; }
.stat-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.stat-value { font-size: 22px; font-weight: 900; color: var(--accent-2); line-height: 1.25; min-height: 28px; display: flex; align-items: center; overflow-wrap: anywhere; }
.stat-value a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 900; }
.stat-value .mono { font-family: var(--mono); font-size: 14px; font-weight: 700; word-break: break-all; }
.stat-value .dash { display: inline-block; width: 28px; height: 4px; border-radius: 2px; background: var(--text-muted); opacity: .5; }
.stat-meta { font-size: 13px; color: var(--text-muted); }
.stat.is-inert { background: color-mix(in srgb, var(--surface) 50%, transparent); }

/* journey */
.qs-journey { list-style: none; margin: 14px 0 30px; padding: 0; position: relative; }
.qs-journey::before { content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--blue), var(--cyan), var(--magenta), var(--violet)); opacity: .35; }
.qs-step { position: relative; display: flex; gap: 18px; padding: 6px 0 22px; }
.qs-step:last-child { padding-bottom: 0; }
.qs-num { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--blue), var(--magenta)); box-shadow: var(--shadow-glow); z-index: 1; }
.qs-num svg { width: 26px; height: 26px; fill: var(--surface); }
.qs-body { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); padding: 14px 18px; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.qs-body:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.qs-body h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--accent-2); }
.qs-body p { margin: 0 0 10px; font-size: 14px; color: var(--text-muted); }
.qs-links { display: flex; flex-wrap: wrap; gap: 8px; }
.qs-chip { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--accent-2); background: color-mix(in srgb, var(--blue) 7%, transparent); border: 1px solid var(--line-strong); transition: border-color .12s ease, background .12s ease; }
.qs-chip:hover { text-decoration: none; border-color: var(--accent); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.qs-chip.is-inert { color: var(--text-muted); background: transparent; border-style: dashed; cursor: not-allowed; }
.qs-chip.is-inert:hover { border-color: var(--line-strong); background: transparent; }

/* link list */
.link-list { list-style: none; margin: 0 0 24px; padding: 0; }
.link-list li { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; flex-wrap: wrap; }
.link-list li:last-child { border-bottom: 0; }
.link-list .when { font-family: var(--mono); font-size: 13px; color: var(--text-muted); flex: 0 0 auto; }
.link-list li.is-inert { color: var(--text-muted); }

/* cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 12px 0 30px; }
.doc-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px; min-height: var(--tap); border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); box-shadow: var(--shadow); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; position: relative; overflow: hidden; }
.doc-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--blue), var(--cyan), var(--magenta)); opacity: 0; transition: opacity .14s ease; }
.doc-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.doc-card:hover::before { opacity: 1; }
.doc-card .ic { flex: 0 0 44px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.doc-card .ic svg { width: 32px; height: 32px; fill: var(--violet); }
.doc-card .tx { min-width: 0; }
.doc-card .tx h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--accent-2); }
.doc-card .tx p { margin: 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.45; }

/* footer */
.site-footer { border-top: 3px solid; border-image: var(--rule) 1; background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 8%, transparent), color-mix(in srgb, var(--surface) 90%, transparent)); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); }
.site-footer-inner { max-width: 1120px; margin: 0 auto; padding: 14px 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-link { margin: 0; font-size: 15px; }
.footer-link a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 900; background-image: var(--sweep); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.footer-social { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 12px; }

/* search results */
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 70vh; overflow-y: auto; padding: 6px; z-index: 95; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.search-results[hidden] { display: none; }
.search-empty { padding: 14px 12px; font-size: 14px; color: var(--text-muted); }
.search-list { list-style: none; margin: 0; padding: 0; }
.search-result-link { display: block; padding: 9px 12px; min-height: var(--tap); border-radius: var(--radius-xs); color: var(--text); }
.search-result-link:hover, .search-result-link.active { background: color-mix(in srgb, var(--blue) 8%, transparent); text-decoration: none; }
.search-result-title { display: block; font-size: 14px; font-weight: 800; color: var(--accent-2); margin-bottom: 2px; }
.search-result-excerpt { display: block; font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }
.search-results mark { background: var(--lilac); color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------------------------------------------------------------- MARKET */
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
@keyframes marquee { to { transform: translateX(-50%); } }

.sk { display: block; height: 14px; min-width: 48px; border-radius: 7px; background: linear-gradient(90deg, var(--line) 0%, color-mix(in srgb, var(--blue) 14%, transparent) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; }
.sk-logo { width: 36px; height: 36px; min-width: 0; border-radius: 50%; }
.sk-bar { width: 110px; }
.fill { display: inline-block; animation: rise .35s ease both; }

.logo-wrap { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: inline-flex; flex: 0 0 auto; background: var(--surface-2); animation: rise .35s ease both; }
.logo-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile { width: 100%; height: 100%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px; color: var(--surface); }
.hue-0 { background: linear-gradient(135deg, var(--blue), var(--cyan)); }
.hue-1 { background: linear-gradient(135deg, var(--indigo), var(--violet)); }
.hue-2 { background: linear-gradient(135deg, var(--violet), var(--magenta)); }
.hue-3 { background: linear-gradient(135deg, var(--deep), var(--blue)); }
.tile-dim { display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--line); }
.chg-up { color: var(--blue); }
.chg-down { color: color-mix(in srgb, var(--magenta) 72%, var(--ink)); }
.chg-up::before { content: "\25B2\00a0"; font-size: .7em; }
.chg-down::before { content: "\25BC\00a0"; font-size: .7em; }

/* ticker */
.ticker { display: flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 8px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 70%, transparent); overflow: hidden; }
.t-toggle { width: var(--tap); height: var(--tap); flex: 0 0 var(--tap); display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--accent-2); cursor: pointer; transition: background .12s ease; }
.t-toggle:hover { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.t-toggle:disabled { opacity: .4; cursor: not-allowed; }
.t-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.t-toggle .p-play { display: none; }
.ticker.paused .t-toggle .p-bars { display: none; }
.ticker.paused .t-toggle .p-play { display: inline; }
.t-view { flex: 1 1 auto; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, var(--ink) 24px, var(--ink) calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, var(--ink) 24px, var(--ink) calc(100% - 24px), transparent); }
.t-track { display: flex; align-items: center; width: max-content; gap: 28px; }
.t-set { display: flex; gap: 28px; padding-right: 28px; }
.ticker:not(.is-skel):not(.is-error):not(.is-inert) .t-track { animation: marquee var(--t-dur, 40s) linear infinite; gap: 0; }
.ticker:hover .t-track, .ticker:focus-within .t-track, .ticker.paused .t-track { animation-play-state: paused; }
.t-item { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-item .logo-wrap, .t-item .sk-logo { width: 24px; height: 24px; }
.t-item .tile { font-size: 12px; }
.t-sym { color: var(--accent-2); font-weight: 900; }
.t-price { color: var(--text); }
.t-msg { font-size: 13px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.ticker.is-inert { background: transparent; }

/* panel */
.market { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); padding: 6px 16px 14px; margin: 0 0 30px; }
.market.is-inert { background: color-mix(in srgb, var(--surface) 50%, transparent); box-shadow: none; }
.market.is-inert .m-rows { opacity: .5; }
.m-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; min-height: var(--tap); }
.m-title { font-weight: 800; color: var(--accent-2); }
.m-status { font-size: 13px; color: var(--text-muted); margin-right: auto; }
.m-status[data-kind="error"] { color: color-mix(in srgb, var(--magenta) 72%, var(--ink)); font-weight: 700; }
.m-retry { min-height: var(--tap); padding: 0 16px; font: 700 13px/1 var(--font); color: var(--surface); background: var(--accent); border: 0; border-radius: var(--radius-xs); cursor: pointer; }
.m-retry:hover { background: var(--accent-2); }
.m-retry[hidden] { display: none; }
.m-cols, .m-row { display: grid; grid-template-columns: 32px minmax(160px, 2.2fr) minmax(88px, 1fr) minmax(88px, .9fr) minmax(88px, 1fr) minmax(88px, 1fr) var(--tap); gap: 12px; align-items: center; }
.m-cols { padding: 6px 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.m-cols span:nth-child(n+3):nth-child(-n+6) { text-align: right; }
.m-rows { list-style: none; margin: 0; padding: 0; }
.m-row { min-height: 60px; padding: 8px 0; border-top: 1px solid var(--line); }
.m-rank { color: var(--text-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.m-token { display: flex; align-items: center; gap: 10px; min-width: 0; }
.m-logo { display: inline-flex; flex: 0 0 36px; width: 36px; height: 36px; }
.m-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.m-sym { font-weight: 900; color: var(--accent-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sym .sk { width: 64px; }
.m-full { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-cell { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; }
.m-cell .sk { width: 64px; }
.m-cell .dash, .m-sym .dash { width: 20px; }
.m-act { display: flex; justify-content: flex-end; }
.m-copy { width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--accent-2); background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius-xs); cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.m-copy svg { width: 18px; height: 18px; fill: currentColor; }
.m-copy:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.m-copy:disabled { opacity: .4; cursor: not-allowed; }
.m-copy.copied { color: var(--surface); background: var(--accent); border-color: var(--accent); }
.m-foot { margin: 8px 0 0; font-size: 12.5px; color: var(--text-muted); }
.m-row.is-dash .m-cell, .m-row.is-dash .m-sym { color: var(--text-muted); }

@media (max-width: 1024px) {
  .m-cols { display: none; }
  .m-row { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) var(--tap); grid-template-areas: "rank token token act" ". price chg ." ". vol liq ."; gap: 4px 12px; padding: 12px 0; }
  .m-rank { grid-area: rank; }
  .m-token { grid-area: token; }
  .m-act { grid-area: act; }
  .m-price { grid-area: price; } .m-chg { grid-area: chg; } .m-vol { grid-area: vol; } .m-liq { grid-area: liq; }
  .m-cell { text-align: left; align-items: flex-start; }
  .m-cell::before { content: attr(data-label); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
}

/* ---------------------------------------------------------------- MOTION LAYER */
@keyframes mesh-shift { 0% { background-position: 0% 0%, 100% 0%, 50% 100%, 0 0; } 100% { background-position: 100% 60%, 0% 100%, 60% 0%, 0 0; } }
@keyframes drift-a { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(40px, 26px, 0) scale(1.12); } }
@keyframes drift-b { 0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); } 50% { transform: translate3d(-48px, 20px, 0) scale(.92); } }
@keyframes drift-c { 0%, 100% { transform: translate3d(0, 0, 0) scale(.95); } 50% { transform: translate3d(22px, -34px, 0) scale(1.1); } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0) rotate(0); } 50% { transform: translate3d(0, -12px, 0) rotate(8deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -10px, 0); } }
@keyframes ping { 75%, 100% { transform: scale(3); opacity: 0; } }
@keyframes flash-up { from { background: color-mix(in srgb, var(--blue) 30%, transparent); } to { background: transparent; } }
@keyframes flash-down { from { background: color-mix(in srgb, var(--magenta) 30%, transparent); } to { background: transparent; } }
@keyframes sk-out { to { opacity: 0; } }

/* scroll progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 130; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--rule); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); box-shadow: 0 0 10px color-mix(in srgb, var(--blue) 60%, transparent); }

/* reveal: hidden only while JS is about to animate it */
.js-reveal :is(.content > h2, .content > h3, .content > p, .content > .panel, .toc-macro, .stat, .qs-step, .doc-card, .market, .link-list li, .hero):not(.in) { opacity: 0; }

/* hero */
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 300px; margin: 14px 0 24px; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-mesh {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 80% at 15% 20%, color-mix(in srgb, var(--blue) 34%, transparent), transparent 70%),
    radial-gradient(55% 75% at 85% 15%, color-mix(in srgb, var(--magenta) 28%, transparent), transparent 70%),
    radial-gradient(70% 90% at 55% 100%, color-mix(in srgb, var(--cyan) 30%, transparent), transparent 70%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  background-size: 160% 160%, 160% 160%, 160% 160%, 100% 100%;
  animation: mesh-shift 16s ease-in-out infinite alternate;
}
.layer { position: absolute; inset: 0; pointer-events: none; transform: translate3d(var(--px, 0), var(--py, 0), 0); will-change: transform; }
.blob { position: absolute; border-radius: 50%; filter: blur(34px); opacity: .75; }
.blob.b1 { width: 220px; height: 220px; left: -40px; top: -50px; background: var(--violet); animation: drift-a 11s ease-in-out infinite; }
.blob.b2 { width: 180px; height: 180px; right: 20%; bottom: -70px; background: var(--cyan); animation: drift-b 13s ease-in-out infinite; }
.blob.b3 { width: 150px; height: 150px; right: -30px; top: 10%; background: var(--magenta); animation: drift-c 9s ease-in-out infinite; }
.rings { display: flex; align-items: center; justify-content: flex-end; padding-right: 7%; }
.rings span { position: absolute; right: calc(7% - 60px); width: 340px; height: 340px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--blue) 28%, transparent); }
.rings span:nth-child(2) { width: 260px; height: 260px; right: calc(7% - 20px); border-style: dashed; border-color: color-mix(in srgb, var(--violet) 40%, transparent); animation: spin 48s linear infinite; }
.rings span:nth-child(3) { width: 420px; height: 420px; right: calc(7% - 100px); border-color: color-mix(in srgb, var(--cyan) 22%, transparent); }
.spark { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); animation: bob 5s ease-in-out infinite; }
.spark.s1 { left: 46%; top: 16%; }
.spark.s2 { left: 58%; top: 74%; width: 7px; height: 7px; background: var(--magenta); animation-duration: 6.5s; }
.spark.s3 { left: 36%; top: 82%; width: 14px; height: 14px; background: var(--cyan); opacity: .8; animation-duration: 7.5s; }
.spark.s4 { left: 70%; top: 12%; width: 8px; height: 8px; background: var(--violet); animation-duration: 5.5s; }
.art { display: flex; align-items: center; justify-content: flex-end; padding-right: 7%; }
.art img { width: 210px; height: 210px; display: block; animation: float 7s ease-in-out infinite; filter: drop-shadow(0 18px 30px color-mix(in srgb, var(--indigo) 45%, transparent)); }
.copy { display: flex; flex-direction: column; justify-content: center; padding: 28px 32px; pointer-events: auto; }
.hero-kicker { margin: 0 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }
.hero h1.page-title { font-size: clamp(44px, 7vw, 76px); margin: 0 0 6px; }
.hero-sub { margin: 0; max-width: 360px; font-size: 17px; font-weight: 600; color: var(--text); }

/* status pill with a pulsing dot */
.m-status { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: 13px; font-weight: 700; color: var(--text-muted); margin-right: auto; }
.m-status .dot { position: relative; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.m-status .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; }
.m-status[data-kind="loading"] .dot::after, .m-status[data-kind="retry"] .dot::after, .m-status[data-kind="live"] .dot::after { animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
.m-status[data-kind="loading"] .dot::after { animation-duration: 1.1s; }
.m-status[data-kind="live"] { color: var(--accent-2); border-color: color-mix(in srgb, var(--blue) 40%, transparent); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.m-status[data-kind="live"] .dot { background: var(--blue); }
.m-status[data-kind="retry"] .dot, .m-status[data-kind="error"] .dot { background: color-mix(in srgb, var(--magenta) 72%, var(--ink)); }
.m-status[data-kind="error"] { border-color: color-mix(in srgb, var(--magenta) 45%, transparent); }

/* spotlight */
.qs-body, .toc-macro, .m-row { position: relative; }
.m-row { border-radius: 10px; }
.doc-card::after, .stat::after, .qs-body::after, .panel::after, .toc-macro::after, .m-row::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--blue) 15%, transparent), color-mix(in srgb, var(--magenta) 6%, transparent) 45%, transparent 72%);
}
.doc-card:hover::after, .stat:hover::after, .qs-body:hover::after, .panel:hover::after, .toc-macro:hover::after, .m-row:hover::after { opacity: 1; }

/* value flash and skeleton exit */
.m-cell { border-radius: 6px; }
.flash-up { animation: flash-up .9s ease-out; }
.flash-down { animation: flash-down .9s ease-out; }
.sk-leaving .sk { animation: sk-out .2s ease forwards; }
.fill { animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }

@media (max-width: 720px) {
  .hero { min-height: 250px; }
  .copy { padding: 22px 20px; justify-content: flex-end; }
  .art { align-items: flex-start; padding: 18px 16px 0 0; }
  .art img { width: 132px; height: 132px; }
  .rings span { width: 220px; height: 220px; right: -30px; }
  .rings span:nth-child(2) { width: 170px; height: 170px; right: -5px; }
  .rings span:nth-child(3) { width: 280px; height: 280px; right: -60px; }
  .hero-sub { font-size: 15px; }
}

/* ---------------------------------------------------------------- RESPONSIVE */
.menu-toggle { display: none; }
.scrim { display: none; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .sidebar { position: fixed; top: var(--stack-h); bottom: 0; left: 0; z-index: 90; height: auto; max-width: 86vw; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); background: var(--surface); }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { display: block; position: fixed; inset: var(--stack-h) 0 0 0; background: color-mix(in srgb, var(--indigo) 35%, transparent); z-index: 80; }
  .content-wrap { padding: 20px 18px 70px; }
  .site-footer-inner { padding: 8px 18px; }
  .toc-macro ol { columns: 2; }
}

@media (max-width: 720px) {
  .search { flex: 0 0 auto; margin: 0 0 0 auto; max-width: none; position: static; }
  .search-toggle { display: inline-flex; }
  .search-field { display: none; }
  .search.open .search-field { display: block; position: fixed; top: var(--topbar-h); left: 0; right: 0; padding: 8px 12px; background: color-mix(in srgb, var(--surface) 96%, transparent); border-bottom: 1px solid var(--line-strong); z-index: 96; }
  .search.open .search-field svg { left: 26px; }
  .search.open .search-results { position: fixed; top: calc(var(--topbar-h) + 56px); left: 0; right: 0; border-radius: 0; border-left: 0; border-right: 0; max-height: calc(100vh - var(--topbar-h) - 56px); }
  .right { margin-left: 0; }
  .toc-macro ol { columns: 1; }
}

@media (max-width: 540px) {
  .market { padding: 6px 12px 12px; }
  .m-row { grid-template-areas: "rank token token act" "price price chg chg" "vol vol liq liq"; }
  .brand { font-size: 18px; padding: 0 4px; }
  .topbar { padding: 0 8px; gap: 4px; }
  .ca-inner { padding: 6px 12px 4px; gap: 0 10px; }
  .ca-label { flex: 1 1 auto; }
  .ca-hint { display: inline; }
  .ca-copy { display: none; }
  .ca-date, .ca-toast { order: 2; }
  .ca-value { order: 3; flex: 1 1 100%; }
  .panel { flex-wrap: wrap; }
  .panel .p-art { order: -1; }
  .panel .p-icon { display: none; }
  .qs-step { gap: 12px; }
  .qs-num { flex-basis: 36px; width: 36px; height: 36px; }
  .qs-journey::before { left: 17px; }
  .qs-body { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  h1.page-title { background-size: 100% auto; }
  .sk { background-size: 100% 100%; }
  .layer { transform: none; }
  .hero-mesh { background-position: 0 0; }
  .progress span { box-shadow: none; }
  .t-view { overflow-x: auto; }
  .t-toggle { display: none; }
  .panel:hover, .toc-macro:hover, .stat:hover, .qs-body:hover, .doc-card:hover, .social-link:hover { transform: none; }
}
