/* Charts for research posts. Marks are ink, context marks are gray, text uses text tokens. */
.bl-prose .rc {
  --rc-surface: var(--chalk);
  --rc-mark: var(--ink);
  --rc-ctx: #B9B9B0;
  --rc-track: #E8E8E2;
  margin: 40px 0;
  padding: 32px 32px 24px;
  border-radius: 16px;
  background: var(--rc-surface);
  view-timeline: --rc block;
}
.rc-head { display: grid; gap: 6px; margin: 0 0 28px; padding: 0; font-size: inherit; color: inherit; }
.rc-eyebrow { font: 500 12px/1.3 "Geist Mono", monospace; color: var(--ink-4); }
.rc-title { font-size: 21px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; color: var(--ink); text-wrap: balance; }
.rc-sub { font-size: 15px; line-height: 1.45; color: var(--ink-3); }
.bl-prose .rc-note { margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--line-strong); font-size: 13px; line-height: 1.5; color: var(--ink-4); }
.bl-prose .rc ol, .bl-prose .rc ul { margin: 0; padding: 0; list-style: none; }
.bl-prose .rc li + li { margin-top: 0; }

.rc-name { font-size: 15px; line-height: 1.3; font-weight: 500; color: var(--ink); }
.rc-name small { display: block; margin-top: 3px; font-size: 13px; line-height: 1.4; font-weight: 400; color: var(--ink-3); }
.rc-val { display: flex; gap: 8px; align-items: baseline; justify-content: flex-end; font: 500 13px/1 "Geist Mono", monospace; font-variant-numeric: tabular-nums; color: var(--ink); }
.rc--key .rc-row:not(.is-ctx) .rc-val b, .rc--key .rc-urow:not(.is-ctx) .rc-val b { margin: -4px -6px; padding: 4px 6px; border-radius: 5px; background: var(--yellow); }
.rc-val em { min-width: 4ch; font-style: normal; font-weight: 400; text-align: right; color: var(--ink-4); }

/* Meter list: one row per name, bars on one baseline */
.rc-meters { display: grid; gap: 2px; }
.rc-row { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 76px; gap: 16px; align-items: center; padding: 7px 0; transition: opacity .2s ease; }
.rc-track { display: block; height: 12px; border-radius: 4px; background: var(--rc-track); overflow: hidden; }
.rc-track i { display: block; width: var(--v); height: 100%; border-radius: 0 4px 4px 0; background: var(--rc-mark); transform-origin: left center; }
.is-ctx .rc-track i { background: var(--rc-ctx); }
.rc-meters--count .rc-track { background: none; }
.rc-meters--count .rc-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 76px; align-items: start; padding: 10px 0; }
.rc-meters--count .rc-track, .rc-meters--count .rc-val { margin-top: 4px; }
.rc-meters--count .rc-val em { min-width: 0; }
/* Rate rows: the percentage, then the two counts behind it */
.rc-meters--rate .rc-row { grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 196px; }
.rc-meters--rate .rc-val { justify-content: flex-start; gap: 14px; }
.rc-meters--rate .rc-val b { min-width: 5ch; text-align: right; }
.rc-meters--rate .rc-val em { min-width: 0; white-space: nowrap; }
.rc-meters--rate .rc-track i { min-width: 2px; }
/* Unit rows: one number with its unit */
.rc-meters--unit .rc-row { grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 112px; }
.rc-meters--unit .rc-val b { white-space: nowrap; }
.rc--key .rc-meters--unit .rc-row:not(.is-ctx) .rc-val b { margin-right: 0; }
.bl-prose .rc-group { margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.3; font-weight: 600; color: var(--ink); }
.rc-head + .rc-group { margin-top: 0; padding-top: 0; border-top: 0; }
.rc-group small { display: block; margin-top: 3px; font-size: 13px; line-height: 1.4; font-weight: 400; color: var(--ink-3); }
@media (hover: hover) {
  .rc-meters:hover .rc-row:not(:hover), .rc-ulist:hover .rc-urow:not(:hover) { opacity: .45; }
}

/* Unit chart: one square per headline */
.rc-units { position: relative; padding-bottom: 76px; }
.rc-ulist { display: grid; gap: 2px; }
.rc-urow { display: grid; grid-template-columns: minmax(0, 1fr) 236px 28px; gap: 16px; align-items: start; padding: 10px 0; transition: opacity .2s ease; }
.rc-sqs { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 1px !important; }
.rc-sq { width: 20px; height: 20px; border-radius: 4px; background: var(--rc-mark); cursor: default; outline: none; transition: background-color .15s ease, box-shadow .15s ease; }
.is-ctx .rc-sq { background: var(--rc-ctx); }
.rc-urow .rc-val { padding-top: 4px; }
.rc-sq:hover, .rc-sq:focus { background: var(--yellow); }
.rc-sq:hover { box-shadow: 0 0 0 2px var(--rc-surface), 0 0 0 4px var(--ink); }
.rc-tip, .bl-prose .rc-hint { position: absolute; left: 0; right: 0; bottom: 0; min-height: 60px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line-strong); font-size: 15px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.rc-tip { visibility: hidden; opacity: 0; background: var(--rc-surface); pointer-events: none; transition: opacity .15s ease; }
.rc-tip b { margin-right: 6px; font-weight: 600; color: var(--ink); }
.rc-sq:hover .rc-tip, .rc-sq:focus .rc-tip { visibility: visible; opacity: 1; }
.bl-prose .rc-hint { color: var(--ink-4); transition: opacity .15s ease; }
.rc-units:has(.rc-sq:hover) .rc-hint, .rc-units:has(.rc-sq:focus) .rc-hint { opacity: 0; }

/* Dumbbell: two counts per buyer on one scale */
.rc-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 20px !important; font-size: 14px; line-height: 1.3; color: var(--ink-2); }
.rc-legend li { display: flex; gap: 8px; align-items: center; }
.rc-key { width: 12px; height: 12px; border-radius: 50%; background: var(--rc-mark); }
.rc-key--home { background: var(--rc-ctx); }
.rc-dumb { display: grid; gap: 2px; }
.rc-drow { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px 0; }
.rc-dtrack { position: relative; display: block; height: 14px; margin: 0 40px 0 28px; background: linear-gradient(var(--rc-track), var(--rc-track)) left center / 100% 1px no-repeat; }
.rc-dline { position: absolute; top: 6px; left: var(--a); width: calc(var(--b) - var(--a)); height: 2px; background: var(--rc-ctx); transform-origin: left center; }
.rc-dot { position: absolute; top: 0; left: var(--x); width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--rc-mark); box-shadow: 0 0 0 2px var(--rc-surface); }
.rc-dot--home { background: var(--rc-ctx); }
.rc-dot b { position: absolute; top: 1px; font: 500 13px/1 "Geist Mono", monospace; font-variant-numeric: tabular-nums; color: var(--ink); }
.rc-dot--page b { right: 22px; }
.rc-dot--home b { left: 22px; }

/* Headline numbers */
.bl-prose .rc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 32px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.rc-stats div { padding: 22px 0 20px 20px; border-left: 1px solid var(--line); }
.rc-stats div:first-child { padding-left: 0; border-left: 0; }
.rc-stats dd { margin: 0; font-size: clamp(34px, 4.4vw, 48px); line-height: 1; letter-spacing: -0.045em; font-weight: 600; color: var(--ink); }
.rc-stats dt { margin-top: 8px; font-size: 14px; line-height: 1.3; color: var(--ink-3); }

@media (max-width: 720px) {
  .bl-prose .rc { margin: 32px -4px; padding: 24px 18px 18px; border-radius: 14px; }
  .rc-title { font-size: 19px; }
  .rc-row, .rc-meters--count .rc-row, .rc-meters--rate .rc-row, .rc-meters--unit .rc-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 9px 0; }
  .rc-row .rc-name { grid-column: 1; grid-row: 1; }
  .rc-row .rc-val { grid-column: 2; grid-row: 1; align-self: start; margin-top: 2px; }
  .rc-row .rc-track { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  .rc-meters--rate .rc-val { flex-direction: row-reverse; }
  .rc--key .rc-meters--rate .rc-row:not(.is-ctx) .rc-val b { margin-right: 0; }
  .rc-urow { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 12px 0; }
  .rc-urow .rc-name { grid-column: 1; grid-row: 1; }
  .rc-urow .rc-val { grid-column: 2; grid-row: 1; }
  .rc-urow .rc-sqs { grid-column: 1 / -1; grid-row: 2; }
  .rc-units { padding-bottom: 104px; }
  .rc-tip, .bl-prose .rc-hint { min-height: 88px; }
  .rc-drow { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .bl-prose .rc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .rc-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Marks draw in as the chart scrolls into view */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .rc-track i, .rc-dline { animation: rc-grow linear both; animation-timeline: --rc; animation-range: entry 15% entry 85%; }
    .rc-sq, .rc-dot { animation: rc-fade linear both; animation-timeline: --rc; animation-range: entry 15% entry 70%; }
  }
}
@keyframes rc-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rc-fade { from { opacity: 0; } to { opacity: 1; } }
@media (forced-colors: active) {
  .rc-track i, .rc-sq, .rc-dot, .rc-key { forced-color-adjust: none; }
}
