/* Data Research (research-page.js), Guide (guide-page.js) and the embedded data catalogue.
   Builds on pages.css / components.css; only tokens from tokens.css. Prefix rp- (research page), gp- (guide). */

.researchPage section, .guidePage section, .theoryPage section { scroll-margin-top: 12px; }
.rp-section { margin-top: 8px; }
.rp-section + .rp-section { border-top: 1px solid var(--border); margin-top: 22px; }
.rp-small { display: block; font-size: var(--fs-12); color: var(--muted); line-height: 1.55; }
.sectionPage p.rp-small { color: var(--muted); }
.sectionPage h4 { font-size: 13px; margin: 14px 0 4px; color: var(--text); }

/* a. research map entry */
.rp-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 16px 18px; background: linear-gradient(110deg, var(--panel-3), var(--panel)); margin-top: 14px; }
.rp-hero h2 { margin-top: 0; }
.rp-hero-text { flex: 1 1 420px; min-width: 0; }
.rp-hero-text p { margin: 6px 0; }
.rp-hero-cta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.rp-cta { font-size: var(--fs-14); padding: 10px 18px; }

/* d. methods */
.rp-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.rp-method { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.rp-method h3 { margin: 0; font-size: var(--fs-14); color: var(--text); }
.sectionPage .rp-method p { margin: 0; font-size: var(--fs-12); line-height: 1.5; flex: 1; }
.rp-theory { font-size: var(--fs-12); color: var(--accent-2); text-decoration: none; white-space: nowrap; }
.rp-theory:hover { text-decoration: underline; }
/* method card: the question as the heading, the technical name once, small (content pass, Nov 2026) */
.sectionPage .rp-method p.rp-method-use { flex: none; padding-top: 6px; border-top: 1px solid var(--border); color: var(--muted); }
.rp-hero .rp-more { margin-bottom: 0; }
.rp-method-use b { color: var(--text-2); font-weight: 650; }
.rp-method-tech { display: block; margin-top: 4px; font-size: 11px; letter-spacing: .02em; }
/* role of the page, stated at the top */
.rp-role { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 12px 16px; margin: 12px 0 6px; }
.rp-role h2 { margin-top: 0; }
.sectionPage .rp-role p { margin: 6px 0; }
.rp-role b { color: var(--text); }

/* b. validation: three groups */
.rp-io { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.rp-io-col { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 12px 12px 10px 44px; }
.rp-io-col h3 { margin: 0 0 4px; font-size: var(--fs-14); }
.rp-io-col ul { margin: 0; padding-left: 16px; }
.sectionPage .rp-io-col li, .sectionPage .rp-io-col p { font-size: var(--fs-12); line-height: 1.5; margin: 2px 0; }
.rp-io-n { position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-12); font-weight: 800; border: 1px solid var(--border-strong); color: var(--text-2); }
.rp-io-ref { border-color: var(--warn); background: linear-gradient(180deg, var(--warn-bg), var(--panel) 70%); }
.rp-io-ref .rp-io-n { border-color: var(--warn); color: var(--warn); }

.rp-zone { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.rp-zone > div { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 8px 10px; min-width: 0; }
.rp-zone small { display: block; color: var(--muted); font-size: 11.5px; }
.rp-zone strong { display: block; font-size: var(--fs-18); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-zone > div:first-child { border-color: var(--border-strong); background: var(--panel-2); }

.rp-headline { margin-top: 14px; }
.rp-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.rp-metric strong { font-size: var(--fs-18); font-variant-numeric: tabular-nums; }
.rp-ci { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.rp-explorer { margin-top: 14px; }
.rp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 6px 0 8px; }
.rp-controls .rp-small { display: inline; }
.rp-controls select, .rp-controls select.text { width: auto; max-width: 100%; }
.rp-table th[scope=row] { background: transparent; color: var(--text); font-weight: 600; min-width: 190px; }
.rp-table td b { font-weight: 700; color: var(--text); }
.rp-conf { white-space: nowrap; font-size: var(--fs-12); }
.rp-conf .tp { color: var(--good); } .rp-conf .fp, .rp-conf .fn { color: var(--warn); }

.rp-decomp { margin-top: 16px; }
.rp-bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; margin: 6px 0; }
.rp-bar-label b { display: block; font-size: var(--fs-12); color: var(--text); }
.rp-bar { display: flex; height: 22px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--bg-2); }
.rp-bar > span { display: block; height: 100%; min-width: 0; flex-grow: 0; flex-shrink: 0; }
.rp-bar > span + span { box-shadow: inset 1px 0 0 #0006; }
.rp-keys { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sectionPage .rp-keys li { font-size: 11.5px; line-height: 1.4; display: flex; align-items: center; gap: 6px; color: var(--text-2); }

.rp-noprob { margin: 14px 0 10px; font-size: 13px; }
.rp-noprob b { color: var(--warn); }
.rp-more { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); margin: 8px 0; }
.rp-more > summary { cursor: pointer; padding: 9px 12px; font-weight: 650; font-size: 13px; color: var(--text); list-style-position: inside; }
.rp-more > summary:hover { color: var(--accent); }
.rp-more[open] > summary { border-bottom: 1px solid var(--border); }
.rp-more-body { padding: 4px 14px 10px; }
.sectionPage .rp-more-body li, .sectionPage .rp-more-body p { font-size: 12.5px; line-height: 1.6; }
.rp-audit code, .rp-more-body code { font-size: 11.5px; overflow-wrap: anywhere; }
.rp-actions { margin: 12px 0 4px; }

/* c. embedded catalogue */
.dataCatalog h3 { color: var(--text); }
.dataCatalog .dropzone { min-height: 96px; }
.dataCatalog #productTable { position: relative; }
.dataCatalog .table-wrap:has(#productTable) { max-height: 70vh; overflow: auto; }
.dataCatalog #productTable thead th { position: sticky; top: 0; z-index: 1; }
.dataCatalog #productTable { min-width: 820px; }
.dataCatalog #productTable td:nth-child(2) { overflow-wrap: anywhere; max-width: 340px; }
.dataCatalog #productTable td:nth-child(5) { min-width: 120px; }

/* Guide */
.gp-steps { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.gp-steps li { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 10px 12px; }
.gp-steps b { color: var(--text); }
.sectionPage .gp-steps p { margin: 2px 0 0; font-size: 13px; line-height: 1.55; }
.gp-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; }
.gp-classes .swatch { width: 22px; height: 14px; border-color: var(--border-strong); }
.gp-classes th[scope=row] { background: transparent; color: var(--text); font-weight: 600; }
.gp-three { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; margin: 12px 0 6px; }
.gp-three > div:not(.gp-ne) { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 10px 12px; }
.gp-three b { color: var(--text); }
.sectionPage .gp-three p { margin: 4px 0 0; font-size: var(--fs-12); line-height: 1.5; }
.gp-ne { display: grid; place-items: center; font-size: var(--fs-24); color: var(--warn); font-weight: 700; }
/* guide step: the "You will see" line, and the short task list under the lead */
.gp-steps .gp-k { color: var(--text-2); font-weight: 650; }
.gp-can { margin: 8px 0 14px; padding-left: 20px; }
.sectionPage .gp-can li { margin: 3px 0; line-height: 1.55; }
.gp-cmd { display: inline-block; margin-top: 4px; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); user-select: all; }

@media (max-width: 760px) {
  .rp-io { grid-template-columns: 1fr; }
  .rp-bar-row { grid-template-columns: 1fr; gap: 4px; }
  .gp-three { grid-template-columns: 1fr; }
  .gp-ne { transform: rotate(90deg); font-size: var(--fs-18); }
  .rp-hero { padding: 14px; }
}
