/* Research explainers: data tables, a stat row and a paired-bar chart.
   Built only from article.css tokens; load after article.css. */

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; margin: 28px 0; -webkit-overflow-scrolling: touch; }
.tablewrap table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.8rem; color: var(--body); }
.tablewrap caption {
  caption-side: top; text-align: left; padding: 0 0 10px;
  font-family: var(--sans); font-size: 0.84rem; color: var(--muted); line-height: 1.5;
}
.tablewrap th, .tablewrap td { padding: 9px 12px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablewrap th:first-child, .tablewrap td:first-child { text-align: left; padding-left: 0; }
.tablewrap th:last-child, .tablewrap td:last-child { padding-right: 0; }
.tablewrap thead th { font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); }
.tablewrap tbody tr { border-top: 1px solid var(--line-soft); }
.tablewrap tbody tr:first-child { border-top: none; }
.tablewrap thead th { white-space: normal; vertical-align: bottom; line-height: 1.35; }
.tablewrap td.note { color: var(--muted); white-space: normal; min-width: 7em; }

/* ---------- A row of headline numbers ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 24px; margin: 28px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 18px 0; }
.stats .v { font-family: var(--serif); font-size: 1.9rem; font-weight: 400; line-height: 1.1; color: var(--text); }
.stats .k { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* ---------- Paired bars: share of all cells vs share within a cell type ---------- */
.jump { margin: 28px 0 0; display: flex; flex-direction: column; gap: 16px; font-family: var(--sans); }
.jrow2 { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 16px; }
.jrow2 .glabel { font-size: 0.85rem; color: var(--text); line-height: 1.2; }
.jrow2 .glabel small { display: block; color: var(--muted); font-size: 0.72rem; margin-top: 3px; }
.bars { display: flex; flex-direction: column; gap: 5px; }
.brow { display: grid; grid-template-columns: 64px 1fr 44px; align-items: center; gap: 10px; }
.btag { font-size: 0.72rem; color: var(--muted); text-align: right; }
.btrack { height: 12px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.bfill { height: 100%; border-radius: 2px; }
.bfill.global { background: var(--faint); }
.bfill.local { background: var(--accent); }
.jrow2.noise .bfill.local { background: var(--text); opacity: 0.55; }
.bnum { font-size: 0.78rem; font-variant-numeric: tabular-nums; text-align: right; color: var(--body); }
.jlegend { display: flex; gap: 8px 20px; flex-wrap: wrap; font-family: var(--sans); font-size: 0.78rem; color: var(--muted); margin: 14px 0 0; }
.jlegend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.sw.global { background: var(--faint); }
.sw.local { background: var(--accent); }
.sw.noise { background: var(--text); opacity: 0.55; }

@media (max-width: 620px) {
  .stats { grid-template-columns: 1fr; gap: 14px; }
  .stats .v { font-size: 1.6rem; }
  .jrow2 { grid-template-columns: 1fr; gap: 6px; }
}

ol.plain { margin: 0 0 20px; padding-left: 1.4em; color: var(--body); }
ol.plain li { margin-bottom: 10px; }
