/* PDA Compass — Research hub (A09). Page layout only: tokens and components come from css/site.css,
   the controls from js/explorer/*.css. */

/* ---------- headings with an "i" ---------- */
.rs-section-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.rs-section-head h2 { margin: 0; }
.rs-head-info, .rs-cite { --it-size: 20px; }
/* Inline citation "i": sits in the running text, 44px hit area comes from info-tip.css (.it-btn::after). */
.rs-cite { margin-left: 4px; vertical-align: 0.15em; --it-size: 18px; --it-btn-font: 0.68rem; }
.rs-cite + .rs-cite { margin-left: 6px; }
.rs-prose p { max-width: var(--measure); }
.rs-prose strong { color: var(--accent-deep); }

/* ---------- hero: on-this-page chips ---------- */
.rs-toc ul { list-style: none; padding: 0; margin: 0; }
.rs-toc .chip { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- the timeline slider (one per page, floats) ---------- */
.rs-time { position: relative; z-index: 6; }
/* The site header is sticky at top:0 (z 100); the slider sits just under it. The kit puts its `.rs` class and
   `data-sticky` on the mount element itself (#rs-time), so the selector must be `.rs-time.rs`, not `.rs-time .rs`
   (regression: 2026-10-21-research-slider-sticky-phone — the descendant form never matched, so on phones the
   ~300px slider stayed stuck at the top of the screen and covered the page). */
.rs-time.rs[data-sticky] { top: var(--header-h); border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius-m) var(--radius-m); box-shadow: var(--shadow-1); padding: 8px 12px; margin: 0 -12px; }
.rs-time:empty { display: none; }
/* On a phone the control is tall, so it scrolls with the page instead of covering it. */
@media (max-width: 759px) { .rs-time.rs[data-sticky] { position: static; margin: 0; border-radius: var(--radius-m); border: 1px solid var(--line); } }

/* ---------- vertical timeline ---------- */
.rs-timeline__count { margin: 0 0 var(--space-4); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rs-tl { list-style: none; margin: 0; padding: 0; position: relative; max-width: 820px; }
.rs-tl::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--line-strong); border-radius: 2px; }
.rs-tl:empty { display: none; }
.rs-tl__item { position: relative; padding: 0 0 var(--space-5) 40px; }
.rs-tl__item:last-child { padding-bottom: var(--space-2); }
.rs-tl__dot { position: absolute; left: 4px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.rs-tl__item--paper .rs-tl__dot { background: var(--warm); box-shadow: 0 0 0 2px var(--warm); }
.rs-tl__year { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--accent-deep); line-height: 1.1; display: block; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.rs-tl__title { margin: 0 0 var(--space-1); font-size: 1.05rem; display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.rs-tl__detail { margin: 0 0 var(--space-2); max-width: 60ch; }
.rs-tl__source { font-size: 0.875rem; color: var(--ink-muted); margin: 0; }
.rs-tl__source a { display: inline-flex; align-items: center; min-height: 44px; } /* 44px target (measured 18px in the first run) */
.rs-tl__empty { max-width: 820px; }
.rs-tl__empty:empty { display: none; }

/* ---------- the main choice (study type chips) + "More filters" (X3, 2026-10-21) ---------- */
.rs-quick { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 6px 12px; align-items: start; margin: var(--space-3) 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface-2); min-width: 0; }
.rs-row__title { display: flex; align-items: center; gap: 6px; margin: 0; min-height: 44px; font-weight: 600; }
.rs-row__chips { display: flex; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.rs-chip { /* position: relative keeps the chip's visually-hidden span inside the scrolling strip (regression: 2026-10-21-strip-sr-overflow) */
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1.2; cursor: pointer; text-align: left;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.rs-chip:hover { background: var(--surface-2); }
.rs-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.rs-chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rs-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.rs-chip__count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; padding: 0 5px; border-radius: 999px; background: var(--surface-2); font-size: 0.75rem; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.rs-chip[aria-pressed="true"] .rs-chip__count { background: var(--accent); color: var(--accent-ink); }
#explorer { display: grid; gap: var(--space-3); min-width: 0; }
#explorer .de-facet[data-facet="study"] { display: none; }
#explorer .de-bar { align-items: center; }
#explorer input.ks-input { padding: 0 calc(var(--ks-touch, 44px) + 4px) 0 40px; border-radius: var(--ks-radius, 999px); } /* same site.css clash as the library (regression 2026-10-21-search-icon-overlap) */
.rs-more-wrap { display: inline-flex; align-items: center; gap: 4px; }
.rs-more-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.rs-more-btn:hover { background: var(--surface-2); }
.rs-more-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rs-more-btn[aria-expanded="true"], .rs-more-btn[data-active] { border-color: var(--accent); }
.rs-more-btn[data-active] { background: var(--accent-soft); }
.rs-more-btn__n { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.rs-more-btn__n[hidden] { display: none; }
.rs-more-btn__chev { font-size: 0.75rem; opacity: 0.7; transition: transform var(--fast) var(--ease); }
.rs-more-btn[aria-expanded="true"] .rs-more-btn__chev { transform: rotate(180deg); }
.rs-more-panel { padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); min-width: 0; }
.rs-more-panel[hidden] { display: none; }
.rs-row__short { display: none; }
.rs-row__strip { min-width: 0; max-width: 100%; }
.rs-chip { white-space: nowrap; }
/* phones: ONE row that scrolls sideways on its own (never the page); search + More filters on one line; count + Reset on one line */
@media (max-width: 720px) {
  .rs-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 6px 0 6px 12px; margin-inline: calc(-1 * var(--space-4)); max-width: calc(100% + 2 * var(--space-4)); min-width: 0; border-inline: 0; border-radius: 0; }
  .rs-row__title { flex: 0 0 auto; font-size: 0.875rem; }
  .rs-row__long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rs-row__short { display: inline; }
  .rs-row__strip { flex: 1 1 0; min-width: 0; overflow-x: auto; overflow-y: hidden; padding: 2px 12px 2px 2px; scrollbar-width: thin; scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .rs-row__chips { flex-wrap: nowrap; width: max-content; gap: 6px; }
  .rs-chip { flex: none; scroll-snap-align: start; font-size: 0.875rem; padding-inline: 10px; }
  #explorer { gap: 8px; }
  #explorer .de-bar { flex-wrap: nowrap; gap: 6px; }
  #explorer .de-search { flex: 1 1 6rem; min-width: 0; }
  .rs-more-wrap { flex: none; width: auto; }
  .rs-more-btn { padding: 0 10px; font-size: 0.875rem; white-space: nowrap; }
  #explorer .de-status { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; }
  #explorer .de-countwrap { grid-column: 1; grid-row: 1; min-width: 0; }
  #explorer .de-count { white-space: normal; }
  #explorer .de-reset { grid-column: 2; grid-row: 1; margin-left: 0; }
  #explorer .de-chips { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- papers toolbar + grid ---------- */
.rs-papers__lede { max-width: var(--measure); }
.rs-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: var(--space-4) 0 var(--space-3); }
.rs-toolbar__sort { display: inline-flex; align-items: center; gap: 8px; }
.rs-toolbar__sort label { flex: none; white-space: nowrap; }
.rs-sort { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); }
.rs-status { margin: 0; font-size: 0.875rem; }
.rs-status:empty { display: none; }
.rs-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); min-width: 0; }
@media (min-width: 900px) { .rs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rs-grid > * { min-width: 0; }
.rs-grid:empty { display: none; }
.rs-missing { margin-top: var(--space-4); }
.rs-missing[hidden] { display: none; }

/* ---------- a paper card (composes .card from site.css) ---------- */
.card--paper .card__title { font-size: 1.15rem; }
.card--paper .card__title a { overflow-wrap: anywhere; }
.card--paper .card__meta { overflow-wrap: anywhere; }
.rs-finding { padding: var(--space-3) var(--space-4); border-radius: var(--radius-m); background: var(--surface-2); }
.rs-finding h4 { margin: 0 0 4px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-deep); }
.rs-finding p { margin: 0; }
.rs-finding--limits { background: color-mix(in srgb, var(--caution-soft) 70%, var(--surface)); }
.rs-finding--limits h4 { color: var(--caution); }
.pill--oa { background: var(--ok-soft); color: var(--ok); }
.pill--closed { background: var(--surface); border-color: var(--line); color: var(--ink-muted); }
.pill--study { background: var(--accent-soft); color: var(--accent-deep); }
.pill--sample { background: var(--surface); border-color: var(--line); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.card--paper .card__actions { flex-wrap: wrap; }
.card--paper .card__links { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.875rem; align-items: center; }
.card--paper .card__links a { min-height: 44px; display: inline-flex; align-items: center; }
.ks-hit { background: var(--accent-soft); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- debate ---------- */
.rs-debate__lede { max-width: var(--measure); }
.rs-position .card__body h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.rs-position .card__body p { margin: 0; }

/* ---------- study types ---------- */
.rs-types { display: grid; gap: var(--space-3); margin: 0 0 var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 720px) { .rs-types { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .rs-types { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rs-type { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: var(--space-4) var(--space-5); min-width: 0; }
.rs-type dt { font-weight: 700; margin-bottom: 4px; }
.rs-type dd { margin: 0; color: var(--ink-muted); }
.rs-howto__note { max-width: 820px; }
.rs-howto__note p:last-child { margin: 0; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) { .rs-tl__dot, .card--paper, .rs-chip, .rs-more-btn, .rs-more-btn__chev { transition: none; } }
:root[data-reduce-motion="true"] .rs-chip, :root[data-reduce-motion="true"] .rs-more-btn, :root[data-reduce-motion="true"] .rs-more-btn__chev { transition: none; }
