/* Spreador — single stylesheet (design spec v1, DESIGN.md). Dark by default, light via
   prefers-color-scheme or the saved toggle (html[data-theme]). System fonts only.
   Venue tile colours (.vc-*) are emitted inline by the server from app/content/venues.py. */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: dark;
  --bg: #0b0e13; --bg-2: #0e1218; --panel: #11161d; --panel-2: #161c25; --panel-3: #1c2330;
  --border: #1f2733; --border-2: #2b3543;
  --text: #e8ecf1; --text-2: #aab4c2; --muted: #7d8a9b; --th: #8b97a8;
  --accent: #5b9cff; --on-accent: #0b1220; --accent-soft: rgb(91 156 255 / 0.14);
  --pos-rgb: 46 204 136; --neg-rgb: 240 97 109; --warn-rgb: 242 180 75;
  --pos-t: #44d494; --neg-t: #f47781; --warn-t: #f2b44b; --info-t: #8db4ff; --strong-t: #ffffff;
  --row-hover: rgb(255 255 255 / 0.035); --col-focus: rgb(255 255 255 / 0.02);
  --shadow-1: none; --shadow-pop: 0 8px 24px rgb(0 0 0 / 0.45);
  --vb-ring: none;
  --brand-tile: #111821;
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --hdr-h: 52px; --row-h: 36px; --hgrp-h: 24px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f7f9; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #f3f5f8; --panel-3: #eceff4;
    --border: #e3e7ed; --border-2: #d3d9e2;
    --text: #0e1621; --text-2: #3a4555; --muted: #5d6878; --th: #5d6878;
    --accent: #2563eb; --on-accent: #ffffff; --accent-soft: rgb(37 99 235 / 0.09);
    --pos-rgb: 16 170 102; --neg-rgb: 222 52 66; --warn-rgb: 214 140 10;
    --pos-t: #056b40; --neg-t: #b3202e; --warn-t: #8a5a00; --info-t: #1f56c9; --strong-t: #0b1220;
    --row-hover: rgb(15 23 34 / 0.035); --col-focus: rgb(15 23 34 / 0.022);
    --shadow-1: 0 1px 2px rgb(15 23 34 / 0.05); --shadow-pop: 0 8px 24px rgb(15 23 34 / 0.12);
    --vb-ring: inset 0 0 0 1px rgb(15 23 34 / 0.12);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #f3f5f8; --panel-3: #eceff4;
  --border: #e3e7ed; --border-2: #d3d9e2;
  --text: #0e1621; --text-2: #3a4555; --muted: #5d6878; --th: #5d6878;
  --accent: #2563eb; --on-accent: #ffffff; --accent-soft: rgb(37 99 235 / 0.09);
  --pos-rgb: 16 170 102; --neg-rgb: 222 52 66; --warn-rgb: 214 140 10;
  --pos-t: #056b40; --neg-t: #b3202e; --warn-t: #8a5a00; --info-t: #1f56c9; --strong-t: #0b1220;
  --row-hover: rgb(15 23 34 / 0.035); --col-focus: rgb(15 23 34 / 0.022);
  --shadow-1: 0 1px 2px rgb(15 23 34 / 0.05); --shadow-pop: 0 8px 24px rgb(15 23 34 / 0.12);
  --vb-ring: inset 0 0 0 1px rgb(15 23 34 / 0.12);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
/* the hidden attribute must win over component display rules (.btn is inline-flex) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); overflow-x: clip; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; padding-bottom: 40px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 620; margin: 14px 0 4px; }
.sec-h { margin: 28px 0 10px; }
p { margin: 0 0 10px; }
code, pre, kbd { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 4px; overflow-wrap: anywhere; }
pre { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; overflow-x: auto; }
pre code { border: 0; padding: 0; background: none; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
small { color: var(--muted); font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 50; padding: 6px 12px; background: var(--accent); color: var(--on-accent); border-radius: var(--r-sm); }
.skip:focus { top: 8px; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.t-pos { color: var(--pos-t); } .t-neg { color: var(--neg-t); }
.js .nojs, .js .nojs-note, html:not(.js) #more { display: none; }
/* controls that only work with the script */
html:not(.js) .theme-btn, html:not(.js) .chip-acts, html:not(.js) .js-only, html:not(.js) .kbd { display: none !important; }

/* ------------------------------------------------------------------ header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg-2); border-bottom: 1px solid var(--border); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: color-mix(in srgb, var(--bg-2) 88%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
}
.hdr { display: flex; align-items: center; gap: 20px; height: var(--hdr-h); }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--text); flex: none; }
.logo:hover { text-decoration: none; }
.logo-mark { display: block; flex: none; }
.wm { font: 750 17px/1 var(--font); letter-spacing: -0.03em; color: var(--text); }
.wm-tail { color: var(--text-2); }
.nav { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav a { position: relative; display: block; padding: 0 10px; line-height: var(--hdr-h); color: var(--text-2); font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.nav a:hover { color: var(--text); text-decoration: none; }
/* the tab of the page ("page") or of a page under it, e.g. a venue page under Exchanges ("true") */
.nav a[aria-current] { color: var(--text); }
.nav a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); }
.hdr-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.live { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--r-pill); font: 500 12px var(--font); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; cursor: default; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--pos-t); box-shadow: 0 0 0 3px rgb(var(--pos-rgb) / 0.18); flex: none; }
.live .lv-sep { margin: 0 -4px; }
.live.is-stale { color: var(--warn-t); border-color: rgb(var(--warn-rgb) / 0.4); }
.live.is-stale i { background: var(--warn-t); box-shadow: 0 0 0 3px rgb(var(--warn-rgb) / 0.18); }
.live.is-none { color: var(--neg-t); border-color: rgb(var(--neg-rgb) / 0.4); }
.live.is-none i { background: var(--neg-t); box-shadow: 0 0 0 3px rgb(var(--neg-rgb) / 0.18); }
.lang-btn, .theme-btn { display: inline-flex; align-items: center; justify-content: center; height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: var(--r-md); background: transparent; color: var(--text-2); font: 600 12px var(--font); cursor: pointer; }
.theme-btn { padding: 0 4px; }
.lang-btn:hover, .theme-btn:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.theme-btn svg path, .theme-btn svg circle { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* dark theme shows the sun (switch to light); light theme shows the moon */
.theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: inline; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-btn .i-moon { display: inline; }
  :root:not([data-theme]) .theme-btn .i-sun { display: none; }
}
.banner { background: rgb(var(--warn-rgb) / 0.10); border-bottom: 1px solid rgb(var(--warn-rgb) / 0.3); color: var(--warn-t); font-size: 12.5px; padding: 6px 0; }
.banner-bad { background: rgb(var(--neg-rgb) / 0.10); border-color: rgb(var(--neg-rgb) / 0.3); color: var(--neg-t); }
.banner-inline { background: rgb(var(--warn-rgb) / 0.10); border: 1px solid rgb(var(--warn-rgb) / 0.3); color: var(--warn-t); border-radius: var(--r-md); padding: 8px 12px; font-size: 13px; }

/* ------------------------------------------------------------------ hero, KPI strip */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 24px; flex-wrap: wrap; padding: 18px 0 14px; }
.hero-main { min-width: 0; }
.hero h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead { color: var(--text-2); margin: 4px 0 0; font-size: 13.5px; max-width: 96ch; }
.hero-asof { margin: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.hero-asof.stale { color: var(--warn-t); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 14px 0 0; padding: 0; font-size: 12.5px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border-2); }
.crumbs a { color: var(--muted); }
.crumbs + .hero { padding-top: 8px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.kpi { background: var(--panel); padding: 10px 16px 11px; min-width: 0; }
.kpi dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--th); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi dd { margin: 4px 0 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-v { font: 650 22px/1.15 var(--mono); letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-v.kpi-t { font: 650 16px/1.4 var(--font); letter-spacing: -0.01em; white-space: normal; }
.kpi-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
span.kpi-sub:not(.stack) { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kpi-sub a { color: var(--text); font-weight: 600; }
.kpi-sub b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.kpi-line .kpi-v { flex: none; }
.kpi-unit { font-size: 13px; color: var(--text-2); }
.kpi-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 0 6px; }
.kpi-list li + li::before { content: "\00b7"; margin-right: 6px; color: var(--muted); }
.legs .vb { vertical-align: -3px; margin-right: 4px; }
.legs .to { color: var(--muted); margin: 0 4px; }

/* ------------------------------------------------------------------ top pair cards */
.sec-head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin: 22px 0 10px; }
.sec-note { color: var(--muted); font-size: 12px; }
.sec-link { margin-left: auto; font-size: 12.5px; }
.top-cards { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pcard { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 12px 10px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; box-shadow: var(--shadow-1); min-width: 0; }
.pcard:hover { border-color: var(--border-2); }
.pc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.pc-coin { color: var(--text); font-size: 16px; font-weight: 750; letter-spacing: -0.01em; }
.pc-rank { color: var(--muted); font: 500 11.5px var(--mono); }
.pc-calc { margin-left: auto; font-size: 12px; white-space: nowrap; flex: none; }
.pc-legs { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); }
.leg { display: flex; align-items: center; gap: 6px; min-width: 0; }
.side { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font: 700 10px/1 var(--mono); }
.side-l { color: var(--pos-t); background: rgb(var(--pos-rgb) / 0.14); }
.side-s { color: var(--neg-t); background: rgb(var(--neg-rgb) / 0.14); }
.pc-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.pc-main > div { display: flex; flex-direction: column; }
.pc-v { font: 650 24px/1.05 var(--mono); letter-spacing: -0.03em; }
.pc-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }
.pc-spark { line-height: 0; flex: none; }
.pc-spark.pos, .c-trend.pos, .c-spark.pos { color: var(--pos-t); }
.pc-spark.neg, .c-trend.neg, .c-spark.neg { color: var(--neg-t); }
.pc-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.pc-facts { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 4px 6px; margin: 0; min-width: 0; }
.pc-facts dt { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pc-facts dd { margin: 1px 0 0; font: 600 13px var(--mono); white-space: nowrap; }
.pc-cta { display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.pc-cta .btn-open { height: 26px; margin: 0; padding: 0 4px 0 3px; gap: 2px; }

/* ------------------------------------------------------------------ toolbar and form controls */
.toolbar { position: relative; margin: 20px 0 8px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 12px; box-shadow: var(--shadow-1); }
.tb-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tb-more { flex: 1 1 auto; min-width: 0; }
.tb-more > summary { display: none; }
.tb-in { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tb-btns { display: flex; gap: 6px; margin-left: auto; }
input[type="number"], input[type="search"], input[type="text"], select { height: 32px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--bg); color: var(--text); font: 13.5px var(--font); min-width: 0; font-variant-numeric: tabular-nums; }
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.fld-q { position: relative; flex: 0 0 220px; }
.fld-q input { width: 100%; padding-left: 30px; padding-right: 28px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%237d8a9b' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px 50%; }
.kbd { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid var(--border-2); border-radius: 4px; color: var(--muted); font-size: 11px; line-height: 16px; text-align: center; pointer-events: none; }
.fld-q input:focus + .kbd { display: none; }
.fld-i { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--bg); overflow: hidden; }
.fld-i:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fld-i > span { padding: 0 8px 0 10px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--border); height: 100%; display: flex; align-items: center; white-space: nowrap; }
.fld-i input, .fld-i select { border: 0; border-radius: 0; height: 30px; width: 52px; padding: 0 4px 0 8px; background: transparent; }
.fld-i input:focus-visible, .fld-i select:focus-visible { outline: 0; }
.fld-i select { width: auto; padding-right: 6px; }
.fld-i > i { font-style: normal; color: var(--muted); font-size: 12px; padding-right: 9px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.fld > span:first-child { font-weight: 500; }
.tgl { position: relative; }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tgl span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-pill); font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; white-space: nowrap; }
.tgl span::before { content: ""; width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--muted); flex: none; }
.tgl span:hover { color: var(--text); }
.tgl input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.tgl input:checked + span::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--panel); }
.tgl input:focus-visible + span, .chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-2); }
.btn-ghost:hover { color: var(--text); background: var(--panel-2); filter: none; }
.btn-sm { height: 32px; padding: 0 12px; }
.btn-cta { height: 40px; padding: 0 18px; font-size: 14px; }
.lnk-btn { background: none; border: 0; padding: 2px 4px; color: var(--accent); font: 500 12.5px var(--font); cursor: pointer; border-radius: 4px; }
.lnk-btn:hover { text-decoration: underline; }
.lnk { font-size: 12.5px; }
/* venues dropdown (details/summary: works without the script) */
.dd { position: relative; }
.dd > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--bg); cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); margin-left: 2px; }
.dd[open] > summary { border-color: var(--accent); }
.dd > summary b { font: 600 12px var(--mono); color: var(--text); }
.dd-l { font-size: 12px; color: var(--muted); }
.stack { display: inline-flex; }
.stack .vb { width: 14px; height: 14px; font-size: 7.5px; border-radius: 4px; margin-left: -3px; box-shadow: 0 0 0 1.5px var(--bg); }
.kpi .stack .vb { box-shadow: 0 0 0 1.5px var(--panel); margin-top: 3px; }
.stack .vb:first-child { margin-left: 0; }
.dd-panel { position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; width: min(560px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 12px; }
.venues { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip span { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 4px; border: 1px solid var(--border-2); border-radius: var(--r-pill); font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.chip span:hover { color: var(--text); }
.chip input:checked + span { color: var(--text); background: var(--panel-2); }
.chip input:not(:checked) + span .vb { filter: grayscale(1); opacity: 0.45; }
.chip .ref-mark { font-size: 10.5px; color: var(--muted); font-weight: 500; }
/* CEX tag after a venue name (chips, table legs, cards) */
.kt { font: 700 9px/13px var(--font); letter-spacing: .04em; color: var(--muted); border: 1px solid var(--border-2); border-radius: var(--r-xs); padding: 0 3px; margin-left: -2px; }
.chip-acts { display: flex; gap: 4px; }
.chip-acts .lnk-btn { min-height: 32px; padding: 0 8px; }
/* no script: the popover cannot be nudged into the window, so it hangs from the toolbar */
html:not(.js) .venues-dd { position: static; }
html:not(.js) .dd-panel { left: 12px; }

/* ------------------------------------------------------------------ venue monogram tiles */
.vb { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 5px; background: var(--vc, #8592a3); color: #0b1220; font: 700 9.5px/1 var(--font); letter-spacing: -0.02em; font-style: normal; box-shadow: var(--vb-ring); }
.vb-xs, .btn-open .vb, .legs-m .vb { width: 16px; height: 16px; border-radius: 4px; font-size: 8.5px; }
.vb-md { width: 24px; height: 24px; border-radius: 6px; font-size: 11.5px; }
.vb-lg { width: 40px; height: 40px; border-radius: 10px; font-size: 17px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--vc, #8592a3); flex: none; }

/* ------------------------------------------------------------------ tables */
.table-meta { display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap; min-height: 22px; font-size: 12px; color: var(--muted); margin: 8px 2px 6px; font-variant-numeric: tabular-nums; }
.tm-right { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.trust { display: inline-flex; align-items: center; gap: 5px; }
.trust::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pos-t); }
.m-sort { display: none; align-items: center; gap: 6px; }
.m-sort select { height: 28px; font-size: 12.5px; padding: 0 6px; max-width: 170px; }
.status { color: var(--muted); }
.status.err { color: var(--neg-t); }
/* "All pairs ↓" lands on the filters: the table itself sits in a scroller, where Chrome
   ignores scroll-margin, so the sticky header would cover its first rows */
#controls { scroll-margin-top: calc(var(--hdr-h) + 12px); }
.table-wrap { position: relative; overflow: auto; max-height: calc(100vh - var(--hdr-h) - 24px); max-height: calc(100dvh - var(--hdr-h) - 24px); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-1); overscroll-behavior-x: contain; }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table-wrap.is-loading::before { content: ""; position: sticky; top: 0; left: 0; z-index: 6; display: block; height: 2px; margin-bottom: -2px; background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat; background-size: 40% 100%; animation: lbar 1.1s linear infinite; }
.table-wrap.is-loading tbody { opacity: 0.55; }
@keyframes lbar { from { background-position: -60% 0; } to { background-position: 160% 0; } }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.data th, .data td { height: var(--row-h); padding: 0 10px; white-space: nowrap; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data tbody tr:last-child > * { border-bottom: 0; }
.data td.num { text-align: right; font: 12.5px var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.data th.num { text-align: right; }
.data thead th, .data thead td { position: sticky; top: 0; z-index: 2; height: 30px; background: var(--panel-2); color: var(--th); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border-2); }
.data.pairs thead tr:last-child > * { top: var(--hgrp-h); }
/* the two long labels ("On capital 3×", "Net, 14d") may take two lines: the table fits 1440 in RU */
.data.pairs thead th.c-net, .data.pairs thead th.c-cap { line-height: 1.2; }
.data.pairs thead th.c-net span, .data.pairs thead th.c-cap span { display: inline-block; max-width: 88px; white-space: normal; vertical-align: middle; }
.data.markets thead th { white-space: normal; line-height: 1.2; padding-top: 4px; padding-bottom: 4px; }
.data thead tr.hgrp > * { top: 0; height: var(--hgrp-h); border-bottom: 0; padding-top: 4px; padding-bottom: 0; text-align: center; font-size: 10.5px; color: var(--muted); }
.data thead tr.hgrp th.grp span { display: block; padding-bottom: 3px; border-bottom: 1px solid var(--border-2); }
.data thead th button { all: unset; cursor: pointer; border-radius: 4px; }
.data thead th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.data thead th button:hover, .data thead th[aria-sort="descending"], .data thead th[aria-sort="ascending"] { color: var(--text); }
.data thead th[aria-sort="descending"] button > span:last-child::after { content: "\a0\25BE"; color: var(--accent); }
.data thead th[aria-sort="ascending"] button > span:last-child::after { content: "\a0\25B4"; color: var(--accent); }
.data thead th.h-long button::before, .data thead th.h-short button::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: var(--pos-t); vertical-align: 1px; }
.data thead th.h-short button::before { background: var(--neg-t); }
.data tbody tr:hover > * { box-shadow: inset 0 0 0 9999px var(--row-hover); }
.data tbody tr:focus-within > * { box-shadow: inset 0 0 0 9999px var(--row-hover); }
.data tbody tr:focus-within > th[scope="row"] { box-shadow: inset 2px 0 0 var(--accent), inset 0 0 0 9999px var(--row-hover); }
/* first column stays visible while the table scrolls sideways */
.data tbody th[scope="row"], .data.pairs:not(.no-coin) thead tr:last-child > th:first-child, .data.markets thead th:first-child { position: sticky; left: 0; }
.data tbody th[scope="row"] { z-index: 1; background: var(--panel); font-weight: 650; }
.data.pairs:not(.no-coin) thead tr:last-child > th:first-child, .data.markets thead th:first-child { z-index: 3; }
.c-coin a { color: var(--text); font-weight: 700; }
.c-coin a:hover { color: var(--accent); }
.legs-m { display: none; }
.legs-m .vb ~ .vb { position: relative; margin-left: 14px; }
.legs-m .vb ~ .vb::before { content: "\2192"; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 400 11px/1 var(--font); }
.vchip { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 500; }
.vchip:hover { color: var(--accent); text-decoration: none; }
.data td.c-7d { font-weight: 650; }
.data .c-7d, .data .c-net { box-shadow: inset 0 0 0 9999px var(--col-focus); }
.data .c-net { border-left: 1px solid var(--border-2); }
.c-trend { width: 84px; }
td.c-trend { line-height: 0; }
.c-flags { white-space: nowrap; }
.c-open { white-space: nowrap; }
.data tbody tr:has(.f-stale) > td.num { opacity: 0.7; }
.spark { display: block; overflow: visible; }
.spark .sz { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; opacity: 0.55; fill: none; }
.spark .sl { stroke: currentColor; stroke-width: 1.4; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.c-spark { line-height: 0; }
.c-spark .spark-zero { stroke: var(--muted); stroke-opacity: 0.55; }
tr.empty td { text-align: center; color: var(--muted); padding: 28px 10px; height: auto; white-space: normal; }
.empty-msg { display: block; margin-bottom: 10px; }
.empty-acts { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.table-foot { display: flex; justify-content: center; margin: 10px 0 0; }
.table-foot .nojs-note { color: var(--muted); font-size: 12.5px; }
.note, .cta-note, .empty-note { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
/* glossary under pair tables (tooltips are not reachable on touch screens) */
.legend { margin: 10px 0 0; font-size: 12.5px; color: var(--text-2); }
.legend summary { cursor: pointer; color: var(--accent); width: max-content; max-width: 100%; }
.legend .facts { margin-top: 6px; max-width: 110ch; }
.legend .facts > div { grid-template-columns: 140px minmax(0, 1fr); }

/* APR colours: text everywhere, background only on decision columns (.heat) */
.apr.z { color: var(--muted); }
.apr.p1, .apr.p2, .apr.p3, .apr.p4, .apr.p5 { color: var(--pos-t); }
.apr.n1, .apr.n2, .apr.n3, .apr.n4, .apr.n5 { color: var(--neg-t); }
.apr.p1:not(.heat), .apr.n1:not(.heat) { opacity: 0.85; }
.heat.p1 { background: rgb(var(--pos-rgb) / 0.06); }
.heat.p2 { background: rgb(var(--pos-rgb) / 0.12); }
.heat.p3 { background: rgb(var(--pos-rgb) / 0.20); }
.heat.p4 { background: rgb(var(--pos-rgb) / 0.30); color: var(--strong-t); }
.heat.p5 { background: rgb(var(--pos-rgb) / 0.42); color: var(--strong-t); }
.heat.n1 { background: rgb(var(--neg-rgb) / 0.06); }
.heat.n2 { background: rgb(var(--neg-rgb) / 0.12); }
.heat.n3 { background: rgb(var(--neg-rgb) / 0.20); }
.heat.n4 { background: rgb(var(--neg-rgb) / 0.30); color: var(--strong-t); }
.heat.n5 { background: rgb(var(--neg-rgb) / 0.42); color: var(--strong-t); }

/* badges */
.badge { display: inline-block; padding: 0 6px; border-radius: var(--r-xs); font-size: 11px; font-weight: 600; line-height: 18px; border: 1px solid transparent; white-space: nowrap; vertical-align: middle; cursor: default; }
.badge + .badge { margin-left: 4px; }
.b-ok { color: var(--pos-t); background: rgb(var(--pos-rgb) / 0.12); border-color: rgb(var(--pos-rgb) / 0.28); }
.b-warn { color: var(--warn-t); background: rgb(var(--warn-rgb) / 0.12); border-color: rgb(var(--warn-rgb) / 0.32); }
.b-bad { color: var(--neg-t); background: rgb(var(--neg-rgb) / 0.12); border-color: rgb(var(--neg-rgb) / 0.32); }
.b-muted { color: var(--muted); background: var(--panel-2); border-color: var(--border-2); }
.b-info { color: var(--info-t); background: var(--accent-soft); border-color: rgb(91 156 255 / 0.3); }
.v-id .badge { font-size: 12px; line-height: 20px; }
.perk { display: inline-block; padding: 0 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; line-height: 20px; color: var(--pos-t); background: rgb(var(--pos-rgb) / 0.14); white-space: nowrap; }

/* outbound buttons */
.btn-open { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px 0 3px; margin-right: 4px; border: 1px solid var(--border-2); border-radius: var(--r-sm); color: var(--text-2); font-size: 12px; font-weight: 500; background: var(--panel); vertical-align: middle; }
.btn-open:last-child { margin-right: 0; }
.btn-open::after { content: "\2197"; font-size: 11px; color: var(--muted); }
.btn-open .nm { padding: 0 1px 0 2px; }
.btn-open:hover { text-decoration: none; color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.btn-open:hover::after { color: var(--accent); }
.data.markets .btn-open, .c-open-btns .btn-open { height: 28px; padding: 0 8px 0 5px; }

/* ------------------------------------------------------------------ cards, facts, venue page */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-1); min-width: 0; }
.card > h2 { margin: 0 0 8px; }
.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts.compact > div { grid-template-columns: 96px minmax(0, 1fr); padding: 5px 0; font-size: 13px; }
.v-hero { align-items: center; }
.v-id { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.v-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 360px; }
.v-cta .disclosure { margin: 0; text-align: right; }
.venue-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.venue-grid.solo { grid-template-columns: minmax(0, 1fr); }
.cta-card { position: sticky; top: calc(var(--hdr-h) + 16px); }
.cta-card h3 { font-size: 13px; color: var(--text-2); }
.cta-card p { font-size: 13px; color: var(--text-2); }
.cta-card > :last-child { margin-bottom: 0; }
.disclosure { font-size: 12px !important; color: var(--muted) !important; margin-top: 6px; }
.benefit { color: var(--pos-t) !important; }
.geo { color: var(--warn-t) !important; font-size: 12.5px !important; }
.sources { font-size: 12.5px; padding-left: 18px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ calculator */
.calc-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.cf { border: 0; margin: 0; padding: 12px 0 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.cf:last-of-type { border-bottom: 0; padding-bottom: 2px; }
.cf:first-of-type { padding-top: 2px; }
.cf legend, .leg-h { padding: 0; margin: 0 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--th); }
.cf legend { float: left; width: 100%; }
.cf legend + * { clear: both; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid2 .fld input, .grid2 .fld select, .grid3 .fld input, .leg-p .fld input, .leg-p .fld select { width: 100%; }
.sel-v { display: flex; align-items: center; gap: 8px; }
.sel-v select { flex: 1 1 auto; width: 100%; }
.inp-u { position: relative; display: block; }
.inp-u input { padding-right: 28px; }
.inp-u i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 12px; pointer-events: none; }
.fill-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.legs2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.leg-p { display: grid; gap: 10px; align-content: start; padding: 10px 12px 12px; border: 1px solid var(--border); border-top: 2px solid var(--pos-t); border-radius: var(--r-md); background: var(--bg-2); }
.leg-p.leg-s { border-top-color: var(--neg-t); }
.leg-p .leg-h { margin: 0; }
.calc-out { position: sticky; top: calc(var(--hdr-h) + 16px); }
.r-head { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 12px; }
.r-tile { background: var(--panel-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r-l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--th); }
.r-big { font: 650 28px/1.15 var(--mono); letter-spacing: -0.03em; }
.r-mid { font: 650 22px/1.3 var(--mono); letter-spacing: -0.03em; }
.r-bar { margin: 0 0 10px; }
.rb { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--panel-3); }
.rb-f { background: var(--pos-t); }
.rb-c { background: var(--neg-t); }
.rb-l { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.rb-l b { font: 600 12px var(--mono); }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.sw-f { background: var(--pos-t); } .sw-c { background: var(--neg-t); }
.results { margin: 0; }
.results > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.results > div:last-child { border-bottom: 0; }
.results dt { color: var(--text-2); font-size: 13px; }
.results dd { margin: 0 0 0 auto; text-align: right; font: 600 14px var(--mono); }
.results dd small { display: block; font: 400 12px var(--font); max-width: 34ch; text-align: right; margin-left: auto; }
.out.pos { color: var(--pos-t); }
.out.neg { color: var(--neg-t); }
.calc-open { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.c-open-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ exchanges directory */
.ex-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 20px 0 8px; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--bg); }
.seg a { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13px; font-weight: 500; }
.seg a:hover { color: var(--text); text-decoration: none; }
.seg a[aria-current] { background: var(--panel-3); color: var(--text); }
.seg b { font: 600 11.5px var(--mono); color: var(--muted); }
.ex-q { display: flex; align-items: center; gap: 6px; }
.ex-info { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.data.ex thead th { white-space: normal; line-height: 1.2; }
.data.ex thead th:first-child { position: sticky; left: 0; z-index: 3; }
.data.ex tbody tr[data-href] { cursor: pointer; }
.data.ex .c-ex .badge { margin-left: 6px; }
.data.ex tr.is-closed td { color: var(--muted); }
.ell { display: inline-block; max-width: 168px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.c-chain, .c-pts { color: var(--text-2); }
.ex-acc { margin-top: 8px; scroll-margin-top: calc(var(--hdr-h) + 12px); }
.ex-acc .lead { margin: 0 0 6px; }
.ex-guide > summary { cursor: pointer; color: var(--accent); font-size: 13px; width: max-content; max-width: 100%; }
.ex-guide .prose { margin-top: 4px; }

/* ------------------------------------------------------------------ spreads tab (/spreads, coin "Prices now") */
.sp-asof { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sp-asof i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.sp-asof.is-live i { background: var(--pos-t); box-shadow: 0 0 0 3px rgb(var(--pos-rgb) / 0.18); }
.sp-asof.is-delayed, .sp-asof.is-marks { color: var(--warn-t); }
.sp-asof.is-delayed i, .sp-asof.is-marks i { background: var(--warn-t); }
.sp-asof.is-none { color: var(--neg-t); }
.sp-asof.is-none i { background: var(--neg-t); }
.sp-ago { color: var(--muted); }
.sp-note { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--border-2); border-radius: var(--r-md); font-size: 13px; }
.sp-note.is-warn { background: rgb(var(--warn-rgb) / 0.10); border-color: rgb(var(--warn-rgb) / 0.3); color: var(--warn-t); }
.sp-note.is-bad { background: rgb(var(--neg-rgb) / 0.08); border-color: rgb(var(--neg-rgb) / 0.3); color: var(--neg-t); }
.sp-src { margin: 0 0 4px; font-size: 12.5px; color: var(--text-2); }
.sp-src > summary { cursor: pointer; color: var(--accent); width: max-content; max-width: 100%; }
.sp-src ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sp-src li { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 5px; border: 1px solid var(--border-2); border-radius: var(--r-pill); white-space: nowrap; }
.sp-src li small { font-family: var(--mono); }
.sp-src li.st-down { color: var(--neg-t); border-color: rgb(var(--neg-rgb) / 0.35); }
.sp-src li.st-marks { color: var(--muted); border-style: dashed; }
.data .sp-pos { color: var(--pos-t); }
.data .sp-neg { color: var(--neg-t); }
.data .sp-z { color: var(--muted); }
.data.spreads td.s-sp { font-weight: 600; box-shadow: inset 0 0 0 9999px var(--col-focus); }
.data.spreads td.s-sp.pers { font-weight: 800; }
.data.spreads .s-net { border-left: 1px solid var(--border-2); }
.data.spreads td.s-ask, .data.spreads td.s-bid, .data.spreads td.s-age { color: var(--text-2); }
.data.spreads .c-coin .badge { margin-left: 6px; }
.data.spreads thead th:first-child, .data.matrix thead th:first-child { position: sticky; left: 0; z-index: 3; }
.table-wrap.is-old tbody { opacity: 0.45; }
.prices { margin-top: 28px; scroll-margin-top: calc(var(--hdr-h) + 12px); }
.prices .sec-head { margin-top: 0; }
.prices .sp-asof { margin: 0 0 8px; }
.sp-cls { margin: 18px 0 4px; }
.sp-best { font-size: 13px; color: var(--text-2); margin: 4px 0 8px; }
.data.matrix th, .data.matrix td { height: 32px; }
.data.matrix thead th { white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 11.5px; line-height: 1.2; padding-top: 4px; padding-bottom: 4px; vertical-align: bottom; }
.mx-v { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--text); }
.mx-px { display: block; font: 400 11px var(--mono); color: var(--muted); margin-top: 1px; }
.mx-corner { font-size: 10.5px !important; color: var(--muted) !important; }
.data.matrix tbody th[scope="row"] { line-height: 1.15; font-weight: 400; }
.data.matrix td.sp-neg { color: var(--muted); }   /* crossed books are the news, not the usual minus */
.data.matrix td.self { color: var(--muted); font-style: italic; background: var(--panel-2); }
.data.matrix td.hatch { background-image: repeating-linear-gradient(135deg, rgb(125 138 155 / 0.16) 0 3px, transparent 3px 7px); }
.data.matrix td.best { box-shadow: inset 0 0 0 2px var(--pos-t); font-weight: 700; }
.sp-quotes { margin-top: 8px; font-size: 12.5px; }
.sp-quotes > summary { cursor: pointer; color: var(--accent); width: max-content; max-width: 100%; }
.sp-quotes .table-wrap { margin-top: 6px; max-height: 420px; }
.data.sp-qt tr.is-stale > * { opacity: 0.55; }

/* ------------------------------------------------------------------ prose (methodology, about) */
.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.prose { max-width: 72ch; color: var(--text-2); }
.prose h2, .ex-guide .prose h3 { color: var(--text); font-size: 18px; margin: 28px 0 8px; scroll-margin-top: calc(var(--hdr-h) + 12px); }
.prose[id] { scroll-margin-top: calc(var(--hdr-h) + 12px); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.toc { display: none; }
.toc-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--th); margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--border); display: grid; gap: 6px; font-size: 12.5px; }
.toc a { color: var(--text-2); }
.faq details { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); margin: 8px 0; box-shadow: var(--shadow-1); }
.faq summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--text); }
.faq details > *:not(summary) { padding: 0 14px; }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }

/* ------------------------------------------------------------------ errors */
.err { text-align: center; padding: 56px 0 64px; display: flex; flex-direction: column; align-items: center; }
.err .logo-mark { margin-bottom: 16px; }
.err-code { font: 800 56px/1 var(--font); color: var(--muted); margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.err .lead { margin: 10px auto 20px; }

/* ------------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); color: var(--muted); font-size: 12.5px; padding: 28px 0 24px; }
.ftr { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px 32px; }
.ftr-brand p { margin: 8px 0 0; max-width: 52ch; color: var(--text-2); }
.ftr-brand .wm { font-size: 16px; }
.ftr-brand .ftr-asof { color: var(--muted); font-variant-numeric: tabular-nums; }
.ftr-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--th); margin: 4px 0 8px; font-weight: 600; }
.ftr-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ftr-col a { color: var(--text-2); }
.ftr-small { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------ responsive */
@media (min-width: 1100px) {
  .doc:has(.toc) { grid-template-columns: minmax(0, 72ch) 220px; gap: 56px; }
  .toc { display: block; position: sticky; top: calc(var(--hdr-h) + 20px); align-self: start; margin-top: 28px; }
}
@media (max-width: 1439px) { .data th, .data td { padding: 0 8px; } }
@media (max-width: 1199px) { .top-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* narrower headers: the pill keeps only "Live" or the age (full text stays for screen readers) */
@media (max-width: 1024px) {
  .hdr { gap: 12px; }
  .nav a { padding: 0 8px; }
  .nav a[aria-current]::after { left: 8px; right: 8px; }
  .live { padding: 0 8px; }
  .live.is-live .lv-sep, .live.is-live .lv-t, .live.is-stale .lv-l, .live.is-stale .lv-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .venue-grid, .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .calc-out, .cta-card { position: static; }
  .v-cta { align-items: flex-start; }
  .v-cta .disclosure { text-align: left; }
}
@media (max-width: 760px) {
  .site-header { position: static; background: var(--bg-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hdr { flex-wrap: wrap; height: auto; gap: 0 10px; padding-top: 8px; }
  .hdr-tools { margin-left: auto; }
  .nav { order: 3; flex-basis: calc(100% + 32px); margin: 4px -16px 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav ul { padding: 0 16px; width: max-content; }
  .nav a { line-height: 40px; }
  .hero { padding-top: 14px; }
  .kpi dt { white-space: normal; }
  h1 { font-size: 19px; }
  .top-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; gap: 10px; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .top-cards::-webkit-scrollbar { display: none; }
  .pcard { flex: 0 0 88%; scroll-snap-align: start; }
  .pc-foot { flex-wrap: wrap; }
  .pc-cta { margin-left: auto; }
  .fld-q, .ex-q { flex: 1 1 100%; }
  .kbd { display: none; }
  .tb-btns { margin-left: 0; }
  .dd-panel { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; max-height: 70vh; overflow: auto; }
  .facts > div, .legend .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ftr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ftr-brand { grid-column: 1 / -1; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legs2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .tb-more > summary { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-md); cursor: pointer; font-size: 13px; color: var(--text-2); list-style: none; }
  .tb-more > summary::-webkit-details-marker { display: none; }
  .tb-more[open] > summary { margin-bottom: 8px; border-color: var(--accent); }
  .tb-n { font: 600 11px/18px var(--mono); min-width: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); text-align: center; }
  .trust { display: none; }
  .m-sort { display: inline-flex; }
  .data.pairs:not(.no-coin) .c-long, .data.pairs:not(.no-coin) .c-short,
  .data.pairs .c-now, .data.pairs .c-24h, .data.pairs .c-30d, .data.pairs .c-trend,
  .data.pairs thead tr.hgrp { display: none; }
  .data.pairs thead tr:last-child > * { top: 0; }
  .legs-m { display: flex; align-items: center; margin-top: 2px; font-weight: 400; }
  .data.pairs tbody th[scope="row"] { height: 46px; min-width: 96px; line-height: 1.2; }
  .data th, .data td { padding: 0 8px; }
  .data.ex .c-chain { display: none; }
  /* spreads: coin + legs, spread, net, quality, volume, flags, open */
  .data.spreads .s-buy, .data.spreads .s-sell, .data.spreads .s-ask, .data.spreads .s-bid,
  .data.spreads .s-max, .data.spreads .s-age, .data.spreads .s-fund { display: none; }
  .data.spreads tbody th[scope="row"] { height: 46px; min-width: 96px; line-height: 1.2; }
  /* the sticky name column wraps its badges instead of filling the screen */
  .data.ex tbody th.c-ex { white-space: normal; min-width: 128px; max-width: 150px; height: auto; padding-top: 6px; padding-bottom: 6px; line-height: 1.2; }
  .data.ex .c-ex .badge { margin: 3px 4px 0 0; }
  .table-wrap { max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); }
}
@media (max-width: 420px) {
  .kpi-list { flex-direction: column; }
  .kpi-list li + li::before { content: none; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .ftr { grid-template-columns: minmax(0, 1fr); }
  .toolbar { padding: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .btn-open, .chip span, .tgl span, .nav a, .lang-btn, .theme-btn, .pcard, .dd > summary { transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
}
@media (prefers-reduced-motion: reduce) {
  .table-wrap.is-loading::before { animation: none; background: var(--accent); background-size: auto; }
}
@media print {
  .site-header, .toolbar, .table-foot, .site-footer, .banner, .top, .c-open, .c-trend, .sp-src { display: none; }
  .table-wrap { max-height: none; overflow: visible; box-shadow: none; }
}
