/* =========================================================
   /research/ — study pages and the section hub.
   Loaded only by /benchmark/ and /research/**, so it does not touch the
   global cache-buster on the other 550 pages.

   Three of these classes existed in markup but nowhere in CSS:
   .tbl-wrap, .ci and .note were used throughout /benchmark/ and had no
   rules at all. The practical effect was that a 540px results table sat
   in a 358px column with overflow-x:visible, so on any phone the 95%
   confidence-interval column — the column that makes the study credible —
   was clipped and unreachable. Tables now use the site's existing
   .cmp-wrap scroll container; .tbl-wrap is kept as a working alias so a
   page that still uses the old name is not silently broken again.
   ========================================================= */

/* Fallback scroll container. .cmp-wrap is the designed component and is
   preferred; this exists so the old class name is never inert. */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Confidence intervals sit beside the estimate they qualify. Tabular
   figures so the brackets line up down the column, and a step down in
   weight so the point estimate stays the thing you read first. */
.ci {
  color: var(--muted, #6b7591);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A caveat attached to the claim directly above it. Deliberately quieter
   than body copy but not hidden — these carry the limitations, which are
   the part of a study most worth reading. */
.note {
  color: var(--muted, #6b7591);
  font-size: 14.5px;
  line-height: 1.65;
  border-left: 2px solid var(--border, #e6e9f1);
  padding-left: 14px;
  margin-top: 14px;
}

/* Numbers in a results table should align on the decimal. */
.cmp-table td,
.cmp-table th { font-variant-numeric: tabular-nums; }

/* ---------- study index on /research/ ---------- */

.rs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 6px;
}

.rs-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px;
  border: 1px solid var(--border, #e6e9f1);
  border-radius: var(--radius, 14px);
  background: var(--surface, #fff);
  text-decoration: none;
  color: inherit;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.rs-card:hover,
.rs-card:focus-visible {
  border-color: var(--brand, #3788d8);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -20px rgba(15, 23, 41, .45);
}

.rs-card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink, #0f1729);
  text-wrap: balance;
}

.rs-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2, #344056);
}

/* Study number + status. The numbering is real: studies are published in
   order and cite each other, so 01 precedes 02 in more than layout. */
.rs-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #6b7591);
  font-variant-numeric: tabular-nums;
}

.rs-tag b {
  color: var(--brand, #3788d8);
  font-weight: 700;
}

.rs-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted, #6b7591);
  font-variant-numeric: tabular-nums;
}

.rs-figures b {
  color: var(--ink, #0f1729);
  font-weight: 700;
}

/* ---------- honest-gaps block ---------- */

/* Used for "what we have not measured". Amber rather than red: these are
   open questions, not defects. */
.rs-gaps {
  border: 1px solid var(--border, #e6e9f1);
  border-left: 3px solid var(--amber, #f59e0b);
  border-radius: 0 var(--radius, 14px) var(--radius, 14px) 0;
  background: var(--surface, #fff);
  padding: 20px 24px;
}

.rs-gaps ul { margin: 12px 0 0; padding-left: 20px; }
.rs-gaps li { margin-bottom: 10px; line-height: 1.62; }
.rs-gaps li:last-child { margin-bottom: 0; }

/* ---------- citation block ---------- */

.rs-cite {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
  background: #f7f9fc;
  border: 1px solid var(--border, #e6e9f1);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 18px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2, #344056);
}

@media (max-width: 640px) {
  .rs-card { padding: 18px 18px; }
  .rs-gaps { padding: 16px 18px; }
}
