/* Perp Correlations. A page that reads as a sentence: the ticker is the headline, the controls are
   words in the sentence, and the answer follows. Colours: teal = moves together, violet = moves
   opposite, amber = the second line in Compare. The palette is validated for colour-vision
   deficiency in both modes. */

@font-face {
  font-family: "Sofia Sans";
  src: url("fonts/sofia-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  src: url("fonts/sofia-sans-extra-condensed.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #e6ece8;
  --ink: #15242b;
  --ink-2: #3c4c53;
  --quiet: #5e6b70;
  --faint: #c3cec8;
  --wash: rgba(21, 36, 43, 0.05);
  --pos: #008a7d;
  --neg: #7a4fd0;
  --pie-long: #64c6ad;  /* pastel steps of --pos / --neg for the position donut; validated for contrast and CVD */
  --pie-short: #b5a4ea;
  --amber: #b7791f;
  --tip-bg: #15242b;
  --tip-ink: #e6ece8;
  --warn: #f4e6c8;
  --raised: #f7faf8;
  --ring: rgba(21, 36, 43, 0.10);

  --sans: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Sofia Sans Extra Condensed", "Sofia Sans", system-ui, sans-serif;
  --measure: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #101b1d;
    --ink: #e4ece9;
    --ink-2: #bccac6;
    --quiet: #8e9c9f;
    --faint: #2c3b3d;
    --wash: rgba(228, 236, 233, 0.05);
    --pos: #1f9e8f;
    --neg: #8f6fe3;
    --pie-long: #11a68b;
    --pie-short: #957fd0;
    --amber: #bd8220;
    --tip-bg: #e4ece9;
    --tip-ink: #101b1d;
    --warn: #3a3220;
    --raised: #182528;
    --ring: rgba(228, 236, 233, 0.10);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101b1d;
  --ink: #e4ece9;
  --ink-2: #bccac6;
  --quiet: #8e9c9f;
  --faint: #2c3b3d;
  --wash: rgba(228, 236, 233, 0.05);
  --pos: #1f9e8f;
  --neg: #8f6fe3;
  --pie-long: #11a68b;
  --pie-short: #957fd0;
  --amber: #bd8220;
  --tip-bg: #e4ece9;
  --tip-ink: #101b1d;
  --warn: #3a3220;
  --raised: #182528;
  --ring: rgba(228, 236, 233, 0.10);
}

/* ---------- base ---------- */

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0 auto;
  max-width: var(--measure);
  padding: 0 clamp(16px, 4vw, 48px) 64px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pos); outline-offset: 3px; border-radius: 2px; }
.quiet { color: var(--quiet); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  padding: 28px 0 0;
}
.wordmark { font-weight: 700; font-size: 1rem; letter-spacing: 0.01em; text-decoration: none; }
.masthead-end { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 40px; }
#tabs { display: flex; flex-wrap: wrap; gap: 8px 28px; }
@media (max-width: 480px) { /* the theme button joins the wordmark's line; the tabs take the next one */
  .masthead-end { display: contents; }
  #tabs { order: 3; flex-basis: 100%; gap: 8px 20px; }
}
/* theme button: a sun, a moon, or half of each for auto */
.theme {
  background: none; border: 0; padding: 0; cursor: pointer;
  width: 32px; height: 32px; margin: -8px 0; border-radius: 8px; align-self: center;
  color: var(--quiet); display: inline-grid; place-items: center;
}
.theme:hover, .theme:focus-visible { color: var(--ink); background: var(--wash); }
.theme svg { display: none; width: 18px; height: 18px; }
.theme[data-mode="auto"] [data-icon="auto"], .theme[data-mode="light"] [data-icon="light"], .theme[data-mode="dark"] [data-icon="dark"] { display: block; }
#tabs a { color: var(--quiet); text-decoration: none; padding: 4px 0; }
#tabs a:hover { color: var(--ink); }
#tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }

.banner { margin: 24px 0 0; padding: 12px 16px; background: var(--warn); border-radius: 6px; }
.banner button { margin-left: 12px; }

/* ---------- the sentence (controls) ---------- */

.lede { margin: clamp(40px, 8vw, 88px) 0 0; }
.lede-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.35em; }
.ticker {
  font: 800 clamp(4.25rem, 13vw, 8.75rem)/0.86 var(--display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 2ch;
  max-width: 100%;
  field-sizing: content;
  caret-color: var(--pos);
}
.ticker::placeholder { color: var(--quiet); opacity: 0.35; } /* the current ticker, ghosted while you search */
.ticker.measure { position: absolute; left: 0; top: 0; visibility: hidden; white-space: pre; pointer-events: none; width: auto !important; }
.ticker.measured { max-width: none; } /* sized in pixels by the script (Safari); a percentage cap here would resolve against its own wrapper and stop it growing */
.measure-text { position: absolute; visibility: hidden; white-space: pre; pointer-events: none; font-variant-numeric: tabular-nums; }
.add .ticker.measure { text-transform: none; }
.ticker::-webkit-calendar-picker-indicator, .ticker::-webkit-list-button { display: none !important; }
.ticker:hover { color: var(--ink-2); }
.ticker:focus-visible {
  outline: none; border-radius: 0;
  background: linear-gradient(var(--pos), var(--pos)) no-repeat 0 calc(100% - 0.1em) / 100% 3px; /* a bar under the letters */
}
/* a quiet magnifier on hover says "this is a search" */
.search::after {
  content: ""; position: absolute; top: 50%; right: -30px; width: 20px; height: 20px; margin-top: -10px;
  background: var(--quiet); opacity: 0; pointer-events: none; transition: opacity 120ms;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='6' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M13 13l5 5' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='6' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M13 13l5 5' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.search:hover::after { opacity: 0.6; }
.search:focus-within::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .search::after { transition: none; } }
.joiner { font: 600 clamp(2rem, 5vw, 3.5rem)/1 var(--display); color: var(--quiet); margin: 0 0.5em; }
.phrase {
  margin: 20px 0 0;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.35;
  color: var(--ink-2);
  max-width: 34em;
}
.menu-button, .phrase input, .options input[type="text"], .options input[type="number"], .position input[type="text"] {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0 0.1em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--pos);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  cursor: pointer;
  field-sizing: content;
  min-width: 1ch;
}
.phrase input, .options input, .position input { cursor: text; font-variant-numeric: tabular-nums; }
.phrase input.usd, .position input.usd { padding: 0; } /* "$100,000," reads as one figure */
.phrase input.number::placeholder { color: var(--quiet); opacity: 0.55; } /* the current figure, ghosted while you type */
@supports not (field-sizing: content) { /* Safari: size from the text, with a little room so nothing clips */
  .phrase input[type="number"], .options input[type="number"] { width: calc(var(--w, 3ch) + 1ch); }
  .phrase input[type="text"], .position input[type="text"] { width: calc(var(--w, 9ch) + 0.5ch); }
  .ticker { width: auto; }
}
.phrase input[type="number"], .options input[type="number"] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* menu button: an underlined word with a small chevron */
.menu-wrap { position: relative; display: inline-block; }
.menu-button { display: inline-flex; align-items: baseline; gap: 0.25em; font-size: inherit; line-height: inherit; }
.menu-button::after {
  content: ""; width: 0.36em; height: 0.36em; margin-left: 0.05em;
  border-right: 2px solid var(--quiet); border-bottom: 2px solid var(--quiet);
  transform: translateY(-0.28em) rotate(45deg);
}
.menu-button[aria-expanded="true"]::after { transform: translateY(-0.05em) rotate(225deg); }

/* floating panels: the one place with a raised surface */
.search { position: relative; display: inline-block; max-width: 100%; }
.popup {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0;
  margin: 0; padding: 6px; list-style: none;
  background: var(--raised); color: var(--ink);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--ring), 0 14px 36px rgba(8, 18, 22, 0.16);
  font: 400 0.95rem/1.35 var(--sans);
  max-height: min(380px, 60vh); overflow-y: auto;
}
.popup:focus { outline: none; }
.popup li { border-radius: 6px; cursor: pointer; touch-action: manipulation; }
.popup li.active { background: var(--wash); }
.menu { min-width: 100%; white-space: nowrap; }
.menu li { padding: 8px 14px 8px 32px; position: relative; }
.menu li[aria-selected="true"] { font-weight: 600; }
.menu li[aria-selected="true"]::before {
  content: ""; position: absolute; left: 13px; top: 50%;
  width: 5px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--pos); border-bottom: 2px solid var(--pos); transform: rotate(45deg);
}
.results { width: min(440px, calc(100vw - 32px)); top: calc(100% + 12px); }
.results li:not(.none) {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "sym vol" "sector vol";
  column-gap: 16px; padding: 8px 12px;
}
.results .sym { grid-area: sym; font-weight: 600; }
.results .sym mark { background: none; color: var(--pos); }
.results .sector { grid-area: sector; color: var(--quiet); font-size: 0.85rem; }
.results .vol { grid-area: vol; align-self: center; color: var(--quiet); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.results .none { padding: 10px 12px; color: var(--quiet); cursor: default; }
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 18px 0 0;
  color: var(--quiet);
  font-size: 0.95rem;
}
.options label { display: inline-flex; align-items: baseline; gap: 0.35em; cursor: pointer; }
.with-info { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.info-wrap { display: inline-flex; } /* the tip anchors to .with-info so it starts at the row's left edge */
.info {
  width: 17px; height: 17px; padding: 0; border-radius: 50%;
  border: 1.5px solid currentColor; background: none; color: var(--quiet);
  font: 700 11px/1 var(--sans); cursor: help;
  display: inline-grid; place-items: center;
}
.info:hover, .info[aria-expanded="true"] { color: var(--ink); }
.tip {
  width: min(340px, calc(100vw - 32px)); left: 0; top: calc(100% + 10px);
  max-height: none; overflow: visible; /* a tip is read whole, never scrolled inside */
  padding: 12px 16px; font-size: 0.9rem; line-height: 1.45; cursor: default;
}
.tip p { margin: 0; }
.tip p + p { margin-top: 8px; }
.options input[type="checkbox"] { accent-color: var(--pos); width: 15px; height: 15px; transform: translateY(2px); cursor: pointer; }
.options input::placeholder { color: var(--quiet); opacity: 0.7; }

/* build a basket: one row per position, then the add box */
.positions { display: grid; gap: 4px 0; flex: 1 1 360px; min-width: 0; }
.position {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.6em;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.35; color: var(--ink-2);
}
.position .ticker { font-size: clamp(2.5rem, 7vw, 4.5rem); line-height: 1; min-width: 3ch; }
.position .search::after { right: -26px; width: 16px; height: 16px; margin-top: -8px; }
.position .amount { display: inline-flex; align-items: baseline; }
.remove {
  background: none; border: 0; padding: 0 0.25em; cursor: pointer;
  color: var(--quiet); font: inherit; font-size: 1.15em; line-height: 1;
}
.remove:hover, .remove:focus-visible { color: var(--neg); }
.add { margin-top: 6px; }
.add .ticker { font-size: clamp(1.5rem, 4vw, 2.25rem); }
.add .ticker::placeholder { text-transform: none; opacity: 0.55; }
.add-under { flex-basis: 100%; margin-top: -4px; } /* with one position: its own line right under the big ticker */

/* the position donut beside the rows: drag a boundary to move dollars between two neighbours */
.pie-wrap { flex: 0 0 auto; align-self: center; margin: 0 0 0 32px; }
@media (max-width: 719px) { .pie-wrap { margin: 12px 0 0; } }
.pie { display: block; max-width: 100%; height: auto; overflow: visible; }
.pie .slice { stroke: var(--paper); stroke-width: 2; }
.pie .slice.long { fill: var(--pie-long); }
.pie .slice.short { fill: var(--pie-short); }
.pie .slice:hover { filter: brightness(0.94); }
.pie text { fill: var(--ink); font: 600 13px/1 var(--sans); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pie .centre { fill: var(--ink-2); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pie .handle { stroke: transparent; stroke-width: 18; stroke-linecap: round; pointer-events: stroke; cursor: grab; touch-action: none; }
.pie.dragging .handle { cursor: grabbing; }

/* ---------- views ---------- */

#view { margin-top: clamp(40px, 6vw, 64px); transition: opacity 160ms; }
#view.stale { opacity: 0.45; }
@media (prefers-reduced-motion: reduce) { #view { transition: none; } }

.answer { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.35; max-width: 36em; }
.context { margin: 10px 0 0; color: var(--quiet); max-width: 44em; }
.note { margin: 40px 0 0; color: var(--quiet); font-size: 0.9rem; max-width: 60em; }
.flag { margin: 16px 0 0; padding: 10px 14px; background: var(--warn); border-radius: 6px; max-width: 44em; }
.ladder { margin: 10px 0 0; color: var(--quiet); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.ladder a { color: var(--ink-2); text-decoration: none; padding: 0 0.15em; white-space: nowrap; }
.ladder a:hover { color: var(--ink); }
.ladder a.used { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--pos); }
.problem { font-size: 1.15rem; max-width: 36em; }
.problem a { text-decoration-color: var(--pos); text-underline-offset: 0.2em; }
.textbutton {
  background: none; border: 0; padding: 0; margin-left: 0.25em;
  text-decoration: underline; text-decoration-color: var(--pos); text-decoration-thickness: 2px;
  text-underline-offset: 0.22em; cursor: pointer;
}
h2 { font-size: 1rem; font-weight: 700; margin: 0 0 12px; }

/* correlations: two ranked lists */
.lists { display: grid; gap: 48px 64px; grid-template-columns: 1fr; margin-top: 48px; }
@media (min-width: 900px) { .lists { grid-template-columns: 1fr 1fr; } }
.rank { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 3.2em 84px;
  align-items: center;
  gap: 16px;
  padding: 9px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  text-decoration: none;
}
.row:hover, .row:focus-visible { background: var(--wash); }
.who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who strong { font-weight: 600; }
.who span { color: var(--quiet); font-size: 0.875rem; margin-left: 0.5em; }
.value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.empty { color: var(--quiet); padding: 9px 0; }
.row .strip { opacity: 0.6; }
.row:hover .strip, .row:focus-visible .strip { opacity: 1; }
@media (max-width: 520px) {
  .row { grid-template-columns: minmax(0, 1fr) 64px 3em; }
  .row .strip { display: none; }
}

/* the −1…+1 track with a dot where the correlation sits */
.track { position: relative; height: 14px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--faint); }
.track::after { content: ""; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 1px; background: var(--faint); }
.dot {
  position: absolute; top: 50%; left: var(--x);
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: var(--pos); z-index: 1;
}
.dot.neg { background: var(--neg); }

/* movers: the coin box's prompt, the day, a looked-up coin's card and the ranked rows */
.lookup .ticker::placeholder { text-transform: none; } /* "Look up a coin" reads as a prompt, not a ticker */
.day-step { display: inline-flex; align-items: baseline; gap: 0.25em; white-space: nowrap; }
.day { color: var(--ink); }
/* the day's arrows: bold drawn chevrons in the colour of things you can change, each a fingertip-sized target */
.step { position: relative; align-self: center; width: 1.15em; height: 1.15em; padding: 0; background: none; border: 0; font: inherit; cursor: pointer; border-radius: 4px; }
.step::before { content: ""; position: absolute; left: 50%; top: 50%; width: 0.4em; height: 0.4em; border: 0 solid var(--pos); }
.step.prev::before { border-width: 0 0 3px 3px; transform: translate(-30%, -50%) rotate(45deg); }
.step.next::before { border-width: 3px 3px 0 0; transform: translate(-70%, -50%) rotate(45deg); }
.step::after { content: ""; position: absolute; inset: max(-0.5em, -12px); } /* about 44 px across on a phone */
.step:hover:not(:disabled) { background: var(--wash); }
.step:disabled { cursor: default; }
.step:disabled::before { border-color: var(--faint); }
/* the looked-up coin: its move in rows as on its alert card, where it ranks with its links, a key naming the chart's
   lines after the span menu, and the chart. The rows sit on the lists' grid, so their columns line up with the lists':
   the coin's row, then the move's two parts indented alike behind the track's marks, then its own move on a normal day,
   set apart under the coin's name */
.coin-move { display: grid; grid-template-columns: 1fr; gap: 0 64px; margin: 0 0 8px; }
@media (min-width: 900px) { .coin-move { grid-template-columns: 1fr 1fr; } }
.coin-move .part:hover { background: none; }
.coin-move .part .who { grid-column: 1 / span 2; position: relative; padding-left: 30px; white-space: normal; color: var(--ink-2); }
.coin-move .part .who span { margin: 0; font-size: inherit; color: inherit; } /* over .who span, the sector's look */
.coin-move .part.normal { margin-top: 10px; }
.coin-move .part.normal .who { padding-left: 0; }
.coin-move .part .value { font-weight: 400; }
.coin-move .mark { position: absolute; top: 50%; transform: translateY(-50%); } /* centred on the label's line */
.coin-move .mark.implied { left: 4px; width: 12px; height: 12px; border: 2px solid var(--quiet); border-radius: 50%; box-sizing: border-box; background: var(--paper); }
.coin-move .mark.bar { left: 0; width: 20px; height: 6px; border-radius: 3px; opacity: 0.5; }
.coin .standing { color: var(--quiet); font-size: 0.95rem; margin: 0 0 14px; }
.coin .standing p { margin: 0; }
.coin .standing p + p { margin-top: 2px; }
.chart-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin: 0 0 8px; font-size: 0.9rem; color: var(--ink-2); }
.chart-key > span { display: inline-flex; align-items: center; gap: 7px; }
.chart-key .info-wrap { position: relative; } /* each list of perps opens under its own entry */
.chart-key .info-word { display: inline-flex; align-items: center; gap: 7px; }
.chart-key .tip { white-space: normal; }
.line-chart.swatch { width: 24px; height: 8px; display: inline-block; flex: none; }
.top-switch { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--pos); cursor: pointer; }
/* at the end of the key's line: Reset zoom (in its place but unseen until a zoom) and the chart's step */
.chart-key > .chart-tools { margin-left: auto; display: inline-flex; align-items: baseline; gap: 16px; } /* over .chart-key > span */
.chart-tools .reset-zoom[hidden] { display: inline; visibility: hidden; }
.step-switch { display: inline-flex; gap: 12px; }
.step-switch button { background: none; border: 0; padding: 2px 0; font: inherit; color: var(--quiet); cursor: pointer; font-variant-numeric: tabular-nums; }
.step-switch button[aria-pressed="true"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--pos); }
.step-switch button:disabled { opacity: 0.4; cursor: default; }
.step-switch button:not(:disabled):hover { color: var(--ink); }
.top-switch:hover { text-decoration: underline; text-underline-offset: 3px; }
.info-word { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.info-word:hover, .info-word[aria-expanded="true"] { color: var(--ink); }
/* the lists follow the Correlations page's; each row's track has a ring at the part of the move its benchmark accounts
   for, a dot at the move, and the bar between them, its own move */
.movers.lists:first-child { margin-top: 0; }
.movers .row { grid-template-columns: minmax(0, 1fr) 120px 4.6em 3.2em; }
.movers .row.picked { box-shadow: inset 0 0 0 2px var(--pos); }
.gap { position: relative; height: 14px; }
.gap::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--faint); }
.gap .zero { position: absolute; top: 2px; bottom: 2px; width: 1px; background: var(--faint); }
.gap .bar { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; opacity: 0.5; }
.gap .implied, .gap .landed { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; box-sizing: border-box; }
.gap .implied { border: 1.5px solid var(--quiet); background: var(--paper); }
.gap .landed { z-index: 1; }
.row.strong .bar, .row.strong .landed { background: var(--pos); }
.row.weak .bar, .row.weak .landed { background: var(--neg); }
.row.flat .bar, .row.flat .landed { background: var(--ink-2); }
.movers .score { text-align: right; color: var(--quiet); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .movers .row { grid-template-columns: minmax(0, 1fr) 64px 4.4em 2.8em; } }
/* every perp, ranked, in place of the two lists: one column, each row numbered by its place, a page at a time */
.see-all { grid-column: 1 / -1; margin: 0; }
.see-all .textbutton, .all-head .textbutton { margin-left: 0; }
.lists.all { grid-template-columns: 1fr; }
.all-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 16px; }
.all-head .textbutton { font-size: 0.95rem; }
.who .n { display: inline-block; min-width: 2.1em; margin: 0 0.35em 0 0; color: var(--quiet); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-top: 14px; color: var(--quiet); }
.pager .pages { display: inline-flex; align-items: center; gap: 0.4em; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pager .range { min-width: 7.2em; text-align: center; }

/* compare */
.verdict { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 18px; margin: 0; }
.verdict .figure { font: 800 clamp(3.5rem, 9vw, 6rem)/0.9 var(--display); font-variant-numeric: tabular-nums; }
.verdict .figure.pos { color: var(--pos); }
.verdict .figure.neg { color: var(--neg); }
.verdict .what { font-size: clamp(1.15rem, 2vw, 1.4rem); color: var(--ink-2); }
.pair { display: grid; gap: 48px 64px; grid-template-columns: 1fr; margin-top: 56px; }
@media (min-width: 900px) { .pair { grid-template-columns: auto 1fr; } }
.heat { border-collapse: separate; border-spacing: 3px; margin-left: -3px; font-variant-numeric: tabular-nums; }
.heat th { font-weight: 400; color: var(--quiet); font-size: 0.875rem; padding: 4px 10px; text-align: right; }
.heat th[scope="row"] { text-align: left; padding-left: 0; }
.heat td { padding: 8px 12px; text-align: right; border-radius: 4px; min-width: 4.2em; }
.heat td.cur { box-shadow: inset 0 0 0 2px var(--ink); font-weight: 700; }
.pair .strip { width: 100%; max-width: 420px; height: auto; } /* scales down on phones */
.chart { margin-top: 56px; }
.chart h2 { margin-bottom: 4px; }

/* basket */
.methods { display: grid; gap: 40px 56px; grid-template-columns: 1fr; margin-top: 48px; }
@media (min-width: 960px) { .methods { grid-template-columns: repeat(3, 1fr); } }
.method-head { margin-bottom: 14px; }
.method h2 { font-size: 1.05rem; margin: 0; }
.volatility { font: 800 2.4rem/1 var(--display); font-variant-numeric: tabular-nums; margin: 0; }
.volatility { cursor: help; outline: none; }
.volatility:focus-visible small { text-decoration: underline dotted; }
.volatility small { font: 400 0.95rem var(--sans); color: var(--quiet); margin-left: 0.4em; text-underline-offset: 0.2em; }
.volatility:hover small { text-decoration: underline dotted; } /* the only hint that the figure has a daily reading */
.cut { margin: 6px 0 18px; color: var(--ink-2); }
.cut .held-alts { display: block; margin-top: 4px; color: var(--quiet); font-size: 0.9rem; }
.legs { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.legs td { padding: 5px 0; }
.legs td + td { padding-left: 12px; }
.legs .side { width: 4.2em; }
.legs .chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; line-height: 1.45; color: var(--ink-2); }
.legs .chip.long { background: color-mix(in srgb, var(--pie-long) 24%, transparent); }
.legs .chip.short { background: color-mix(in srgb, var(--pie-short) 26%, transparent); }
/* your positions, a dotted rule, then the hedge legs */
.legs tbody.yours tr:last-child td { padding-bottom: 9px; }
.legs tbody.hedge tr:first-child td { border-top: 1px dotted var(--faint); padding-top: 9px; }
.legs .usd { text-align: right; }
.legs .w { text-align: right; color: var(--quiet); width: 3.6em; }
.legs tr.main td { font-weight: 600; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 16px 0 0; color: var(--quiet); font-size: 0.9rem; }
.facts dt { margin: 0; }
.facts dd { margin: 0; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* about: one reading column; the condensed face carries the headings and the worked figures */
.about { margin-top: clamp(0px, 3vw, 24px); }
.about > :not(h1) { max-width: 42rem; } /* the headline may run wider than the reading column */
.about h1 { font: 800 clamp(3rem, 9vw, 5.75rem)/0.9 var(--display); letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.standfirst { margin: 20px 0 0; font-size: clamp(1.2rem, 2.2vw, 1.45rem); line-height: 1.4; color: var(--ink-2); max-width: 34em; }
.about section { margin-top: clamp(48px, 7vw, 72px); }
.about h2 { font: 800 clamp(1.75rem, 3.6vw, 2.25rem)/1.05 var(--display); margin: 0 0 14px; text-wrap: balance; }
.about h3 { font-size: 1rem; font-weight: 700; margin: 28px 0 6px; }
.about p { margin: 0 0 14px; line-height: 1.6; }
.about p:last-child { margin-bottom: 0; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 2.4rem; margin: 0 0 16px; line-height: 1.6; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0.05em; font: 800 1.6rem/1 var(--display); color: var(--pos); }
.scale { margin: 28px 0 24px; max-width: 30rem; }
.scale-bar { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--neg), var(--faint) 50%, var(--pos)); }
.scale figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--quiet); font-size: 0.875rem; line-height: 1.35; }
.scale figcaption span { display: flex; flex-direction: column; }
.scale figcaption span:nth-child(2) { align-items: center; text-align: center; }
.scale figcaption span:last-child { align-items: flex-end; text-align: right; }
.scale strong { color: var(--ink); font-size: 1rem; }
.worked { border-collapse: collapse; font-variant-numeric: tabular-nums; margin: 6px 0 20px; }
.worked th, .worked td { padding: 6px 0 6px 32px; text-align: right; }
.worked th:first-child, .worked td:first-child { padding-left: 0; text-align: left; }
.worked thead th { font-weight: 400; color: var(--quiet); font-size: 0.875rem; }
.worked tbody td:first-child { color: var(--quiet); }
.worked tfoot th, .worked tfoot td { border-top: 1.5px solid var(--ink); font-weight: 700; padding-top: 8px; }
.about .verdict { margin: 26px 0 22px; }
.about .verdict .what { font-variant-numeric: tabular-nums; }
.pull { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 18px; margin: 20px 0 26px; }
.pull .part { display: flex; flex-direction: column; }
.pull .part strong { font: 800 2.4rem/1 var(--display); font-variant-numeric: tabular-nums; }
.pull .part span { margin-top: 4px; color: var(--quiet); font-size: 0.85rem; }
.pull .own strong { color: var(--pos); }
.pull .op { font: 600 2rem/1.2 var(--display); color: var(--quiet); }
.terms { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 4px 0 20px; line-height: 1.5; }
.terms dt { font-weight: 700; }
.terms dd { margin: 0; }
@media (max-width: 520px) {
  .terms { grid-template-columns: 1fr; gap: 2px; }
  .terms dd + dt { margin-top: 10px; }
  .pull { gap: 10px 12px; }
  .pull .part strong { font-size: 2rem; }
}
.about .facts { max-width: 30rem; margin: 0 0 20px; font-size: 0.95rem; }
.links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.links a, .about p a {
  font-weight: 600; text-decoration-color: var(--pos); text-decoration-thickness: 2px; text-underline-offset: 0.22em;
}

/* ---------- charts ---------- */

svg text { fill: var(--quiet); font: 400 12px var(--sans); }
.strip { display: block; overflow: visible; }
.strip .pos { fill: var(--pos); }
.strip .neg { fill: var(--neg); }
.strip .hit { fill: transparent; }
.baseline { stroke: var(--faint); stroke-width: 1; }
.gridline { stroke: var(--faint); stroke-width: 1; opacity: 0.6; }
.line-chart { width: 100%; height: auto; display: block; touch-action: pan-y; } /* sideways and two-finger gestures go to the chart */
.chart-wrap .plot { position: relative; }
.reset-zoom { font-size: 0.85rem; }
.plot > .reset-zoom { position: absolute; right: 0; top: -2.12em; } /* on the legend's line, which keeps room for it */
.chart-wrap .legend { padding-right: 6.5em; }
.line-chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; }
.line-chart .series.s1 { stroke: var(--pos); }
.line-chart .series.s2 { stroke: var(--amber); }
.line-chart .dot { stroke: var(--paper); stroke-width: 2; }
.line-chart .dot.s1 { fill: var(--pos); }
.line-chart .dot.s2 { fill: var(--amber); }
.line-chart .direct { fill: var(--ink-2); font-size: 13px; font-weight: 600; }
/* the looked-up coin's chart: the coin solid in its list's colour, each benchmark's prediction dotted, the top three faint */
.line-chart .series.coin { stroke-width: 2.5; }
.line-chart .series.coin.strong { stroke: var(--pos); }
.line-chart .series.coin.weak { stroke: var(--neg); }
.line-chart .series.coin.flat { stroke: var(--ink); }
.line-chart .series.pred { stroke: var(--quiet); stroke-width: 1.8; stroke-linecap: round; }
.line-chart .series.btceth { stroke-dasharray: 7 5; }
.line-chart .series.sector { stroke-dasharray: 2 5; }
.line-chart .series.peers { stroke-dasharray: 10 4 2 4; }
.line-chart .series.context { stroke: var(--quiet); stroke-width: 1.2; opacity: 0.45; }
.line-chart .dot.coin.strong, .key.coin.strong { fill: var(--pos); background: var(--pos); }
.line-chart .dot.coin.weak, .key.coin.weak { fill: var(--neg); background: var(--neg); }
.line-chart .dot.coin.flat, .key.coin.flat { fill: var(--ink); background: var(--ink); }
.line-chart .dot.pred, .key.pred, .line-chart .dot.context, .key.context { fill: var(--quiet); background: var(--quiet); }
.line-chart .crosshair { stroke: var(--quiet); stroke-width: 1; opacity: 0.6; }
.legend { display: flex; gap: 20px; margin: 0 0 8px; color: var(--quiet); font-size: 0.875rem; }
.key { display: inline-block; width: 16px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 1px; }
.key.s1 { background: var(--pos); }
.key.s2 { background: var(--amber); }

.tooltip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--tip-bg); color: var(--tip-ink);
  border-radius: 6px; padding: 6px 10px; font-size: 0.8rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tip-row span:last-child { opacity: 0.75; }

/* ---------- colophon ---------- */

.colophon { margin-top: 96px; color: var(--quiet); font-size: 0.85rem; max-width: 60em; }

/* Movers' live day: the stamp and the flash switch after the floor, a tint on a number that changes (teal up, violet
   down) fading over 0.7 s, numbers greyed while the stream is paused */
.options .asof { color: var(--quiet); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.options .sep { color: var(--quiet); font-size: 0.875rem; }
.options .flashes { font-size: 0.875rem; }
.movers .value, .movers .score { border-radius: 4px; padding: 1px 4px; margin: -1px -4px; }
@keyframes tick-up { from { background-color: color-mix(in srgb, var(--pos) 24%, transparent); } to { background-color: transparent; } }
@keyframes tick-down { from { background-color: color-mix(in srgb, var(--neg) 24%, transparent); } to { background-color: transparent; } }
.tick-up { animation: tick-up 0.7s ease-out; }
.tick-down { animation: tick-down 0.7s ease-out; }
@media (prefers-reduced-motion: reduce) { .tick-up, .tick-down { animation: none; } }
#view.paused .movers .value, #view.paused .movers .score { color: var(--quiet); }

/* a live coin's chart while its hours since midnight load */
.chart-loading { height: 300px; display: grid; place-items: center; color: var(--quiet); font-size: 0.95rem; border-radius: 8px;
  background: repeating-linear-gradient(90deg, transparent 0 79px, color-mix(in srgb, var(--quiet) 12%, transparent) 79px 80px); }
@media (max-width: 599px) { .chart-loading { height: 240px; } }

/* The Alerts page: the webhook box is the headline (smaller once a webhook is saved, as it then shows where it goes),
   and the log is one Movers list */
.lookup .hook { text-transform: none; }
.lookup .hook:not(:placeholder-shown) { font-size: clamp(1.5rem, 4vw, 2.5rem); line-height: 1.2; }
.alerts .status { margin-top: 0; }
.lists.alerts-log { display: block; }
