/* Mona Sans, served from this site (no third-party request in the way of the first paint). */
@font-face {
  font-family: 'Mona Sans';
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url(/fonts/mona-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Mona Sans';
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url(/fonts/mona-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --page: #FFFFFF;
  --ink: #131B24;
  --muted: #5E6B79;
  --rule: #E3E7EC;
  --hover: #F5F7F9;
  --select: #2B54D9;
  --up: #0F8F7A;          /* marks: sparklines (colorblind-checked pair) */
  --down: #E8662E;
  --up-text: #0B7565;     /* text: >= 4.5:1 on the page */
  --down-text: #B5441A;
  --s-price: #2A78D6;     /* chart series: price and market cap (colorblind-checked pair) */
  --s-cap: #D55181;
  /* volume bars: neutral, behind the series; follows --muted in dark mode */
  --vol: color-mix(in oklab, var(--muted) 38%, transparent);

  --gutter: 24px;
  --max: 1280px;
  color-scheme: light;
}

/* Dark follows the system unless the viewer picked a theme with the toggle (data-theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #12181F;
    --ink: #E4E9EE;
    --muted: #8B97A5;
    --rule: #26303A;
    --hover: #171E26;
    --select: #7F9CFF;
    --up: #1F9E88;
    --down: #E3652F;
    --up-text: #3FC2A8;
    --down-text: #F2844F;
    --s-price: #3987E5;
    --s-cap: #D55181;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #12181F;
  --ink: #E4E9EE;
  --muted: #8B97A5;
  --rule: #26303A;
  --hover: #171E26;
  --select: #7F9CFF;
  --up: #1F9E88;
  --down: #E3652F;
  --up-text: #3FC2A8;
  --down-text: #F2844F;
  --s-price: #3987E5;
  --s-cap: #D55181;
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
img { display: block; }

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

.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;
}

/* ---------- top bar: wordmark, list tabs, search, theme toggle ---------- */
/* One row that sticks to the top; the table head sticks just below it (--bar-h). The fixed
   footer is --foot-h tall (the script keeps it measured, as it's taller on phones), and the
   page leaves that much room at the bottom. */
:root { --bar-h: 64px; --foot-h: 48px; }
html { scroll-padding-top: calc(var(--bar-h) + 48px); scroll-padding-bottom: calc(var(--foot-h) + 8px); }
.bar {
  position: sticky; top: 0; z-index: 3;
  max-width: var(--max);
  height: var(--bar-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  background: var(--page);
  display: flex;
  align-items: center;
  gap: 12px 32px;
}
.bar::after {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0;
  border-bottom: 1px solid var(--rule);
}
.tabs { display: flex; gap: 24px; align-self: stretch; }
.tabs a {
  position: relative; display: flex; align-items: center;
  color: var(--muted); text-decoration: none;
  font-size: 15px; font-weight: 600; font-stretch: 112%; white-space: nowrap;
}
.tabs a:hover, .tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  height: 2px; border-radius: 2px; background: var(--ink);
}
.bar .search { flex: 0 1 320px; margin-left: auto; min-width: 0; }
.theme {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--rule); border-radius: 9px; background: var(--hover); color: var(--muted); cursor: pointer;
}
.theme:hover { color: var(--ink); }
/* The icon follows the theme in CSS, so it's right before the script runs. */
.theme .i-sun { display: none; }
:root[data-theme="dark"] .theme .i-sun { display: block; }
:root[data-theme="dark"] .theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme .i-moon { display: none; }
}
.mark {
  flex: none;
  margin: 0;
  color: inherit;
  text-decoration: none;
  font-size: 21px;
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.01em;
}
/* The period is the chart's live dot: it takes the colour of the whole market's last 24 hours
   (up or down, as in the table), and pulses once when new prices arrive. Until there's a reading
   it's plain ink, like a period. */
.mark-dot {
  position: relative;
  display: inline-block;          /* empty of in-flow text, so it sits on the baseline */
  width: 0.3em; height: 0.3em;
  margin: 0 0.06em 0 0.05em;
  border-radius: 50%;
  background: var(--ink);
  transition: background-color 0.6s;
}
.mark-dot > span { position: absolute; inset: 0; overflow: hidden; color: transparent; }
.mark[data-market="up"] .mark-dot { background: var(--up); }
.mark[data-market="down"] .mark-dot { background: var(--down); }
.mark-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; opacity: 0; pointer-events: none;
}
.mark-dot.pulse::after { animation: dot-pulse 1.6s cubic-bezier(0.2, 0.6, 0.3, 1); }
@keyframes dot-pulse { from { transform: scale(1); opacity: 0.5; } to { transform: scale(3.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .mark-dot { transition: none; }
  .mark-dot.pulse::after { animation: none; }
}
.search { position: relative; display: block; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 38px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--hover);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.search input:hover { border-color: color-mix(in oklab, var(--muted) 40%, var(--rule)); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 2px solid var(--select); outline-offset: -1px; border-color: transparent; }
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  min-width: 20px; padding: 1px 6px;
  border: 1px solid var(--rule); border-radius: 4px;
  color: var(--muted); font: 500 12px/1.4 inherit; text-align: center;
  pointer-events: none;
}
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--hover); border: 1px solid var(--rule); color: var(--down-text); font-size: 13px; }

.layout { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) var(--foot-h); }

/* ---------- table ---------- */
.coins {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.coins th {
  position: sticky; top: var(--bar-h); z-index: 1;
  background: var(--page);
  padding: 0;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.coins th button {
  display: flex; align-items: center; gap: 4px;
  width: 100%; height: 40px; padding: 0 10px;
  border: 0; background: none; cursor: pointer;
  color: inherit; font-weight: inherit; text-align: inherit;
}
.coins th.c-num button { justify-content: flex-end; }
.coins th button:hover { color: var(--ink); }
.coins th[aria-sort] button { color: var(--ink); font-weight: 600; }
.coins th[aria-sort="ascending"] button::after { content: "↑"; }
.coins th[aria-sort="descending"] button::after { content: "↓"; }
.coins th.c-spark { padding: 0 10px; }

.coins td {
  height: 48px;
  padding: 0 10px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.coins tbody tr:last-child td { border-bottom: 0; }   /* the footer's line closes the table */
.coins tbody tr[data-id] { cursor: pointer; }
.coins tbody tr:hover td { background: var(--hover); }
.coins tbody tr:hover .coin-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.c-rank { width: 44px; color: var(--muted); }
.coins td.c-rank { font-size: 12px; }
.c-num, .coins th.c-num { text-align: right; }
.c-spark { width: 116px; }

.coin { display: flex; align-items: center; gap: 10px; max-width: 280px; color: inherit; text-decoration: none; }
.coin img { width: 20px; height: 20px; border-radius: 50%; flex: none; }
.coin-name { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.coin-sym { color: var(--muted); font-size: 12px; }

.c-price { font-weight: 550; }
.chg { display: block; }
.chg-usd { display: block; margin-top: 1px; font-size: 11px; color: var(--muted); }
.chg-usd:empty { display: none; }

/* ---------- footer: fixed to the bottom of the window ---------- */
/* One row: rows shown, update time and the terms link on the left, pager on the right. Narrower
   screens drop the rows shown; phones get short words and 32px buttons (40px in all). */
.foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  max-width: var(--max);
  margin: 0 auto; padding: 7px var(--gutter);
  background: var(--page);
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 24px;
}
.foot::before {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 0;
  border-top: 1px solid var(--rule);
}
.foot-info { display: flex; align-items: baseline; gap: 6px 20px; min-width: 0; }
.foot-info p { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.upd-short, .legal-short { display: none; }
.foot-info .foot-legal { font-size: 12px; }
.foot-legal a { color: var(--muted); text-underline-offset: 2px; }
.foot-legal a:hover { color: var(--ink); }
#range { color: var(--ink); }
#updated { color: var(--muted); }
#range:empty { display: none; }
/* On a coin page the footer only shows how fresh prices are. */
body:has(#list[hidden]) :is(#range, #pager) { display: none; }
.pager-btns { display: flex; align-items: center; gap: 4px; }
.pager-btns button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; min-width: 34px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--page); cursor: pointer;
  font-weight: 550; font-size: 13px; font-variant-numeric: tabular-nums;
}
.pager-btns .pager-num { padding: 0; }
.pager-btns button:hover:not(:disabled) { border-color: var(--muted); }
.pager-btns button[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.pager-btns button:disabled { color: var(--muted); opacity: 0.5; cursor: default; }
.pager-chev { display: none; }
.pager-go { margin-left: 12px; }
.pager-go label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pager-go input {
  width: 48px; height: 34px; padding: 0 6px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--page); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 550; text-align: center; font-variant-numeric: tabular-nums;
}
.pager-go input:hover { border-color: var(--muted); }
.pager-go input:focus { outline: 2px solid var(--select); outline-offset: -1px; border-color: transparent; }
.up-t { color: var(--up-text); }
.down-t { color: var(--down-text); }
.flat-t { color: var(--muted); }

.spark { display: block; overflow: visible; }
.spark polyline { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark.up polyline { stroke: var(--up); }
.spark.down polyline { stroke: var(--down); }
.spark.flat polyline { stroke: var(--muted); }

.flash-up { animation: flash-up 1.4s ease-out; }
.flash-down { animation: flash-down 1.4s ease-out; }
@keyframes flash-up { from { background: color-mix(in oklab, var(--up) 22%, transparent); } }
@keyframes flash-down { from { background: color-mix(in oklab, var(--down) 22%, transparent); } }

.empty td { height: auto; padding: 48px 10px; text-align: center; color: var(--muted); white-space: normal; }
.coins tbody tr.empty:hover td { background: none; }
.link-btn {
  margin-left: 8px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--select); font-weight: 550; text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- coin page ---------- */
.detail { padding: 8px 0 32px; }
.back {
  display: inline-flex; align-items: center; height: 32px;
  color: var(--muted); text-decoration: none; font-weight: 550;
}
.back:hover { color: var(--ink); }
.detail-head { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.detail-head img { width: 36px; height: 36px; border-radius: 50%; }
.detail-head h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 750; font-stretch: 118%; letter-spacing: -0.015em; }
.detail-head h1 span { margin-left: 4px; font-size: 16px; font-weight: 500; font-stretch: 100%; color: var(--muted); letter-spacing: 0; }
/* Price, market cap and volume above the chart, one row at every width. Price and market cap carry
   their line's color; the volume tile switches the bars on and off.
   Every tile spans the same three rows (label, number, small print), so a line that wraps in one
   tile can't knock the numbers in the others out of line. The numbers share one size, which the
   script shrinks for the whole row when one of them doesn't fit (--metric-fs). */
.metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 28px; margin-top: 18px;
}
.metric {
  display: grid; grid-row: span 3; grid-template-rows: subgrid; gap: 0; min-width: 0;
  padding: 0; border: 0; background: none; text-align: left; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.metric-label { padding-bottom: 6px; }
.metric-change { padding-top: 3px; }
button.metric { cursor: pointer; }
.metric-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; font-stretch: 112%; color: var(--muted); white-space: nowrap; }
.metric-value { align-self: end; font-size: var(--metric-fs, 30px); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-change { font-size: 13px; color: var(--muted); }
.metric-change :is(.up-t, .down-t, .flat-t) { font-weight: 600; }
button.metric:hover .metric-label { color: var(--ink); }
.metric[aria-pressed="false"] .metric-value, .metric[aria-pressed="false"] .metric-change { opacity: 0.45; }
.metric[aria-pressed="false"] .swatch, .legend[aria-pressed="false"] .swatch { background: none; box-shadow: inset 0 0 0 1.5px currentColor; height: 8px; width: 14px; }
.metric:focus-visible { outline: 2px solid var(--select); outline-offset: 4px; border-radius: 4px; }
.narrow-only { display: none; }
.metric-value sub { font-size: 0.55em; line-height: 0; vertical-align: -0.15em; margin: 0 0.04em; }
.swatch { display: inline-block; flex: none; width: 14px; height: 3px; border-radius: 2px; background: currentColor; }
.swatch.s-price { color: var(--s-price); }
.swatch.s-cap { color: var(--s-cap); }
.swatch.s-vol { width: 9px; height: 11px; color: var(--vol); }

/* ---------- chart card: full width, one panel per series or both combined ---------- */
.chart-card { margin-top: 28px; }
.chart-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.chart-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--hover); border: 1px solid var(--rule); }
.seg button {
  height: 28px; min-width: 40px; padding: 0 10px;
  border: 0; border-radius: 6px; background: none; cursor: pointer;
  font-size: 13px; font-weight: 550; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--page); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.btn-small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-icon { display: inline-flex; align-items: center; gap: 7px; }
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--page); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }

.charts { display: grid; gap: 6px; }
.chart { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { display: block; overflow: visible; cursor: crosshair; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .baseline { stroke: color-mix(in oklab, var(--muted) 45%, var(--rule)); stroke-width: 1; }
.chart .xtick { stroke: color-mix(in oklab, var(--muted) 45%, var(--rule)); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chart .axis-title text { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart .axis-title line { stroke-width: 3; stroke-linecap: round; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* The line underneath is drawn wider, so where both lines coincide (price and market cap usually
   move together) its color still shows along the edges of the top line. */
.chart .line.under { stroke-width: 4; }
.chart .s-price { stroke: var(--s-price); }
.chart .s-cap { stroke: var(--s-cap); }
.chart .vol { fill: var(--vol); }
/* lines the viewer drew, in ink so they read as annotations rather than data */
.chart .drawn { stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; }
.chart .drawn.draft { stroke-dasharray: 5 4; }
.chart-sel { position: absolute; background: color-mix(in oklab, var(--select) 14%, transparent); border-inline: 1px solid color-mix(in oklab, var(--select) 55%, transparent); pointer-events: none; }
.chart-x { position: absolute; width: 1px; background: var(--muted); opacity: 0.5; pointer-events: none; }
.chart-dot {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--page); pointer-events: none;
}
.chart-dot.s-price { background: var(--s-price); }
.chart-dot.s-cap { background: var(--s-cap); }
/* The end of each line: a dot, and the latest value in a flag just above or below it. An outlined
   tag keeps the number in ink, readable in both themes; the outline carries the line's color, and
   the page-colored fill hides whatever line runs behind it. */
.chart .end-dot { stroke: var(--page); stroke-width: 2; }
.chart .flag { pointer-events: none; }
.chart .flag rect { fill: var(--page); stroke: var(--c); stroke-width: 1.5; }
.chart .flag text { fill: var(--ink); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart .flag .flag-sub { font-size: 8px; }
.chart-hint { margin: 2px 0 0; color: var(--muted); font-size: 12px; text-align: right; }
.chart-source { margin: 10px 0 0; color: var(--muted); font-size: 12px; max-width: 72ch; }
.chart-msg { display: grid; place-content: center; justify-items: center; gap: 10px; min-height: 446px; color: var(--muted); text-align: center; }
.chart-msg p { margin: 0; max-width: 40ch; }

/* Full screen: the card covers the window (and the screen, where the browser allows it). */
.chart-card.full {
  position: fixed; inset: 0; z-index: 20; margin: 0;
  padding: 16px max(16px, 2vw) 10px;
  background: var(--page); overflow: hidden;
}
body:has(.chart-card.full) { overflow: hidden; }
.full-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.full-head img { width: 24px; height: 24px; border-radius: 50%; }
.full-head strong { font-size: 17px; font-weight: 700; font-stretch: 112%; }
.full-price { font-size: 17px; font-weight: 600; }
.legends { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.legend {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--page); color: var(--ink);
  font-size: 13px; font-weight: 550; cursor: pointer;
}
.legend[aria-pressed="false"] { color: var(--muted); }

/* Everything else, under the chart */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 14px 24px;
  margin: 32px 0 0; padding: 16px 0 0; border-top: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.stat { display: grid; align-content: start; gap: 2px; }
.stat dt { color: var(--muted); font-size: 12px; }
.stat dd { margin: 0; font-size: 16px; font-weight: 600; }
.stat-extra { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
/* 24h range: where the price sits between the day's low and high */
.range-bar { position: relative; display: block; height: 4px; margin: 9px 5px 8px; border-radius: 2px; background: var(--rule); }
.range-bar i { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--page); }
.range-ends { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 500; }

.perf {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); row-gap: 12px;
  margin: 16px 0 0; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.perf div { display: grid; gap: 2px; }
.perf dt { color: var(--muted); font-size: 12px; }
.perf dd { margin: 0; font-size: 16px; font-weight: 600; }
.perf-usd { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }

/* ---------- terms page ---------- */
.doc-back { margin-left: auto; color: var(--muted); font-size: 14px; font-weight: 550; text-decoration: none; }
.doc-back:hover { color: var(--ink); }
.doc { max-width: calc(68ch + 2 * var(--gutter)); margin: 0 auto; padding: 40px var(--gutter) 72px; }
.doc h1 { margin: 0; font-size: 28px; font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; }
.doc-date { margin: 6px 0 28px; color: var(--muted); font-size: 13px; }
.doc h2 { margin: 28px 0 6px; font-size: 16px; font-weight: 700; font-stretch: 112%; }
.doc p { margin: 0 0 12px; font-size: 15px; line-height: 1.65; }
.doc a { color: inherit; text-underline-offset: 2px; }

.about { margin-top: 32px; max-width: 72ch; }
.about h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; font-stretch: 112%; }
.about p { margin: 0 0 12px; line-height: 1.6; color: var(--ink); }
.about .link-btn { margin-left: 0; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.links a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 8px;
  color: var(--ink); text-decoration: none; font-weight: 550; font-size: 13px;
}
.links a:hover { border-color: var(--muted); }

.btn {
  height: 32px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--page); cursor: pointer; font-weight: 550;
}
.btn:hover { border-color: var(--muted); }
.detail-error { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; color: var(--down-text); }
.detail-error p { margin: 0; }
.detail-loading { color: var(--muted); }

.tip {
  position: fixed; z-index: 10; pointer-events: none;
  padding: 6px 9px; border-radius: 6px;
  background: var(--ink); color: var(--page);
  font-size: 12px; line-height: 1.35; font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
}
.tip b { font-weight: 650; }
.tip-date { display: block; margin-bottom: 3px; opacity: 0.75; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row b { margin-left: auto; padding-left: 14px; }
/* the tooltip is inverted (ink background), so the volume swatch takes the page color */
.tip .swatch.s-vol { color: color-mix(in oklab, var(--page) 55%, transparent); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .c-1h, .c-spark { display: none; }   /* market cap and volume outlast the extras */
}
@media (max-width: 800px) {
  /* 12 + 40 (wordmark, search, toggle) + 4 + 44 (tabs) = 100px */
  :root { --bar-h: 100px; }
  .bar { flex-wrap: wrap; align-content: flex-start; padding-top: 12px; gap: 4px 12px; }
  .bar .search { flex: 1 1 0; order: 1; }
  .theme { order: 2; }
  .tabs { order: 3; flex-basis: 100%; height: 44px; gap: 20px; }
  /* The two-row bar slides away while you scroll down, and the column headings take its place;
     any scroll up brings it back (the script sets .bar-away on <html>). */
  .bar { transition: transform 0.2s ease; }
  .coins th { transition: top 0.2s ease; }
  .bar-away .bar { transform: translateY(-100%); }
  .bar-away .coins th { top: 0; }
}
@media (max-width: 1100px) {
  /* The name column takes whatever width is left and truncates, so the table never runs past the gutter. */
  .coins .c-name { width: 100%; max-width: 0; }
  .coin { max-width: none; }
}
@media (max-width: 900px) {
  /* Footer: one row. The page box already says where you are, so the range goes. */
  #range { display: none; }
  .foot-info { gap: 4px 14px; }
  .foot-info p, .foot-info .foot-legal { font-size: 12px; }
}
@media (max-width: 720px) {
  /* Phones: arrows either side of the page box */
  .pager-btns .pager-num, .pager-word { display: none; }
  .pager-chev { display: block; }
  .pager-btns .pager-step { width: 34px; padding: 0; }
  .pager-go { order: 1; margin: 0 4px; }
  .pager-next { order: 2; }
  .pager-btns:not(:has(.pager-go)) .pager-num { display: inline-flex; }   /* 2–3 pages: just show them */
  /* Phones: the footer as shallow as it goes, one row of 32px controls and short words */
  .foot { padding-top: 4px; padding-bottom: 4px; column-gap: 10px; }
  .pager-btns button, .pager-go input { height: 32px; min-width: 32px; }
  .pager-btns .pager-step { width: 32px; }
  .upd-long, .legal-long { display: none; }
  .upd-short, .legal-short { display: inline; }
}
@media (max-width: 400px) {
  .tabs { gap: 12px; }   /* five tabs fit down to 320px */
  .pager-go-word { display: none; }   /* the box and "of 10" say enough */
  .pager-go input { width: 42px; }
}
@media (max-width: 820px) {
  .c-vol, .c-cap30 { display: none; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .search input { font-size: 16px; } /* below 16px, iPhones zoom in on focus */
  .search input { padding-right: 12px; }  /* no "/" hint on phones */
  .pager-go input { font-size: 16px; }     /* below 16px, iPhones zoom in on focus */
  .mark { font-size: 19px; }
  .search kbd { display: none; }
  .c-mcap, .c-7d { display: none; }
  /* stablecoins on phones: market cap and its 7-day change, the parts that move */
  .coins.stable .c-mcap { display: table-cell; }
  .coins.stable .c-price-col, .coins.stable .c-cap24 { display: none; }
  .detail-head h1 { font-size: 22px; }
  /* Phones: the three tiles stay on one row; price gets a little more room, and the small print
     drops to the change itself (the range buttons right below say over what). */
  .metrics { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; margin-top: 14px; }
  .metric-value { font-size: var(--metric-fs, 24px); }
  .metric-label { gap: 5px; font-size: 12px; }
  .metric-change { font-size: 12px; }
  .wide-only, .chg-words { display: none; }
  .narrow-only { display: inline; }
  .chart-msg { min-height: 306px; }
  .chart-card.full .chart-bar { gap: 8px; }
  .chart-hint { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  .perf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coins th button, .coins td { padding-left: 6px; padding-right: 6px; }
  .c-rank { width: 32px; }
  .coin { gap: 8px; }
  .coin-sym { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .flash-up, .flash-down { animation: none; }
  .bar, .coins th { transition: none; }
}

