/* Pages about RP's 2026 GCR fund model (unofficial reconstruction). Builds on ../styles.css. */
:root {
  --rg-ink: #1a202c;
  --rg-text: #1f2937;
  --rg-muted: #4a5568;
  --rg-line: #e2e8f0;
  --rg-accent: #2b6cb0;
  --rg-bio: #eb6834;
  --rg-nuc: #2a78d6;
  --rg-ai: #1baf7a;
}

/* ---- banner, help box, section links ---- */
.rg-banner {
  border-left: 5px solid #c05621;
  background: #fffaf0;
  color: var(--rg-ink);
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}
.rg-help { border: 1px solid rgba(159, 70, 56, 0.32); border-radius: 8px; background: #fff8f1; margin: 0 0 0.8rem; }
.rg-help > summary { cursor: pointer; padding: 0.55rem 0.9rem; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.rg-help > summary::-webkit-details-marker { display: none; }
.rg-help > summary::after { content: "Show"; font-size: 0.8rem; color: #2c5282; text-decoration: underline; flex: 0 0 auto; }
.rg-help[open] > summary::after { content: "Hide"; }
.rg-help-title strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; color: #102631; }
.rg-help-title small { color: var(--rg-muted); font-size: 0.85rem; }
.rg-help-body { border-top: 1px solid rgba(159, 70, 56, 0.22); padding: 0.6rem 0.9rem 0.7rem; font-size: 0.93rem; color: var(--rg-text); }
.rg-help-body p { margin: 0 0 0.5rem; }
.rg-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.3rem 0 0; }
.rg-btn {
  display: inline-block;
  border: 1px solid var(--rg-accent);
  border-radius: 5px;
  padding: 0.25rem 0.7rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: #2c5282;
  background: #fff;
  text-decoration: none;
  cursor: pointer;
}
.rg-btn:hover, .rg-btn:focus-visible { background: #ebf4ff; }
.rg-btn.primary { background: var(--rg-accent); color: #fff; }
.rg-btn.primary:hover, .rg-btn.primary:focus-visible { background: #2c5282; }
.rg-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.rg-subnav { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; font-size: 0.9rem; border-bottom: 1px solid var(--rg-line); padding: 0.1rem 0 0.45rem; margin: 0 0 1rem; }
.rg-subnav a { text-decoration: none; }
.rg-subnav a:hover { text-decoration: underline; }
.rg-subnav a[aria-current="page"] { font-weight: 700; color: var(--rg-ink); border-bottom: 2px solid var(--rg-accent); }

/* ---- prose bits ---- */
.rg-lede { font-size: 1.04rem; color: var(--rg-text); max-width: 60rem; }
.rg-lede p { margin-bottom: 0.5rem; }
.rg-note { font-size: 0.88rem; color: var(--rg-muted); }
.rg-callout { border: 1px solid #cbd5e0; border-radius: 8px; padding: 0.6rem 0.9rem; background: #fff; margin: 0.6rem 0 1rem; }
.rg-key { border-left: 4px solid var(--rg-accent); background: #f7fafc; padding: 0.5rem 0.8rem; border-radius: 4px; margin: 0.6rem 0 1rem; }
.rg-key p:last-child, .rg-callout p:last-child { margin-bottom: 0; }

/* ---- presets ---- */
.rg-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.3rem 0 0.2rem; }
.rg-presets-label { font-weight: 700; color: #2d3748; margin-right: 0.2rem; }
.rg-presets button {
  font-size: 0.88rem;
  line-height: 1.25;
  border: 1px solid #a0aec0;
  background: #f7fafc;
  color: #2d3748;
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  cursor: pointer;
}
.rg-presets button:hover, .rg-presets button:focus-visible { border-color: var(--rg-accent); background: #ebf8ff; }
.rg-presets button.on { background: var(--rg-accent); border-color: var(--rg-accent); color: #fff; font-weight: 600; }
.rg-preset-note { font-size: 0.88rem; color: var(--rg-text); margin: 0.25rem 0 0.8rem; min-height: 1.3em; }

/* ---- run status ---- */
.rg-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; font-size: 0.88rem; color: var(--rg-text); border: 1px solid var(--rg-line); background: #f7fafc; border-radius: 6px; padding: 0.4rem 0.7rem; margin: 0 0 0.7rem; }
.rg-status .rg-progress { flex: 1 1 10rem; height: 7px; background: #e2e8f0; border-radius: 4px; overflow: hidden; min-width: 8rem; }
.rg-status .rg-progress > span { display: block; height: 100%; background: var(--rg-accent); transition: width 0.15s; }
.rg-status.err { border-color: #c53030; background: #fff5f5; }
body.rg-stale .rg-out { opacity: 0.5; transition: opacity 0.2s; }
.rg-issues { border: 1px solid #dd6b20; background: #fffaf0; border-radius: 6px; padding: 0.45rem 0.8rem; margin: 0.4rem 0; font-size: 0.9rem; }

/* ---- topline cards ---- */
.rg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 0.7rem; margin: 0.2rem 0 0.6rem; }
.rg-card { border: 1px solid var(--rg-line); border-top: 5px solid var(--fund, #a0aec0); border-radius: 8px; padding: 0.55rem 0.8rem 0.6rem; background: #fff; min-width: 0; }
.rg-card h3 { font-size: 1rem; margin: 0 0 0.25rem; color: var(--rg-ink); }
.rg-card .rg-big { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 1.5rem; font-weight: 700; color: #102631; line-height: 1.15; }
.rg-card .rg-unit-line { font-size: 0.82rem; color: var(--rg-muted); margin-bottom: 0.35rem; }
.rg-card dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.12rem 0.5rem; margin: 0; font-size: 0.85rem; }
.rg-card dt { font-weight: 400; color: var(--rg-text); }
.rg-card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--rg-ink); white-space: nowrap; }
.rg-card .harm { color: #9b2c2c; }
.rg-ratio-line { font-size: 0.93rem; color: var(--rg-text); margin: 0 0 0.8rem; }

/* ---- controls panel ---- */
.rg-panel { font-size: 0.88rem; }
.rg-panel-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem; margin: 0 0 0.45rem; }
.rg-panel-count { font-size: 0.82rem; color: var(--rg-muted); }
.rg-mini, .rg-reset, .rg-chipbtn {
  font-size: 0.78rem;
  border: 1px solid #a0aec0;
  background: #fff;
  color: #2d3748;
  border-radius: 4px;
  padding: 0.08rem 0.45rem;
  cursor: pointer;
}
.rg-mini:hover, .rg-reset:hover, .rg-chipbtn:hover, .rg-mini:focus-visible, .rg-reset:focus-visible, .rg-chipbtn:focus-visible { background: #edf2f7; border-color: #4a5568; }
.rg-chipbtn.on { background: var(--rg-accent); color: #fff; border-color: var(--rg-accent); }
.rg-group { border: 1px solid #cbd5e0; border-radius: 6px; margin: 0 0 0.45rem; background: #fff; }
.rg-group > summary { padding: 0.4rem 0.55rem; cursor: pointer; }
.rg-group-title { font-weight: 700; font-size: 0.9rem; color: #2d3748; }
.rg-group-sub { display: block; font-size: 0.8rem; color: var(--rg-muted); margin-top: 0.1rem; }
.rg-badge:not(:empty) { display: inline-block; margin-left: 0.4rem; font-size: 0.72rem; font-weight: 700; color: #44337a; background: #faf5ff; border: 1px solid #b794f4; border-radius: 10px; padding: 0 0.4rem; vertical-align: 0.1em; }
.rg-group-body { border-top: 1px solid #edf2f7; }
.rg-row { padding: 0.45rem 0.55rem 0.5rem; border-bottom: 1px solid #edf2f7; }
.rg-row.rg-changed { background: #faf5ff; }
.rg-row.rg-flash { outline: 3px solid var(--rg-accent); outline-offset: -3px; }
.rg-label { font-weight: 600; color: #2d3748; font-size: 0.86rem; }
.rg-row-input { display: flex; align-items: center; gap: 0.35rem; margin: 0.2rem 0 0.15rem; flex-wrap: wrap; }
.rg-slider { flex: 1 1 8rem; min-width: 6rem; accent-color: var(--rg-accent); }
.rg-numwrap { display: inline-flex; align-items: center; gap: 0.15rem; }
.rg-num { width: 5.6em; font-size: 0.85rem; padding: 0.05rem 0.3rem; border: 1px solid #a0aec0; border-radius: 4px; font-variant-numeric: tabular-nums; }
.rg-seed { width: 8.5em; }
.rg-unit { font-size: 0.78rem; color: var(--rg-muted); white-space: nowrap; }
.rg-select { max-width: 100%; font-size: 0.84rem; flex: 1 1 12rem; }
.rg-what { font-size: 0.8rem; color: var(--rg-text); line-height: 1.4; }
.rg-dist { font-size: 0.78rem; color: var(--rg-muted); line-height: 1.4; margin-top: 0.1rem; }
.rg-derived { font-size: 0.8rem; color: var(--rg-text); padding: 0.35rem 0.55rem; background: #f7fafc; }
.rg-derived:empty { display: none; }

/* source tags: text carries the meaning; color only helps scanning */
.rg-src { display: inline-block; border-radius: 10px; padding: 0 0.45rem; font-size: 0.72rem; font-weight: 600; border: 1px solid; white-space: nowrap; vertical-align: 0.1em; cursor: help; }
.rg-src-stated { background: #f0fff4; border-color: #9ae6b4; color: #1c4532; }
.rg-src-inferred { background: #ebf8ff; border-color: #90cdf4; color: #1a365d; }
.rg-src-assumed { background: #fffaf0; border-color: #f6ad55; color: #7b341e; }
.rg-src-user { background: #faf5ff; border-color: #b794f4; color: #44337a; }

/* ---- results ---- */
.rg-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.85rem; color: var(--rg-text); margin: 0.2rem 0 0.3rem; }
.rg-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.rg-swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; }
.rg-swatch.rp { background: #fff; border: 2px solid #1a202c; border-radius: 2px; transform: rotate(45deg); width: 0.6rem; height: 0.6rem; }
table.rg-table { font-size: 0.85rem; width: auto; max-width: 100%; }
table.rg-table td, table.rg-table th { padding: 0.25rem 0.55rem; font-variant-numeric: tabular-nums; vertical-align: top; }
table.rg-table th { font-weight: 600; }
table.rg-table td.num, table.rg-table th.num { text-align: right; white-space: nowrap; }
table.rg-table tfoot td { color: var(--rg-muted); font-size: 0.8rem; }
td.rg-ok { background: #e6fffa; }
td.rg-warn { background: #fffbea; }
td.rg-bad { background: #fff5f5; }
.rg-fig-note { font-size: 0.86rem; color: var(--rg-muted); margin: 0.2rem 0 0.8rem; }
.rg-controls-inline { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; align-items: center; margin: 0.4rem 0 0.6rem; font-size: 0.9rem; }
.rg-controls-inline label { font-weight: 600; color: #2d3748; }
.rg-controls-inline select { font-size: 0.88rem; }
.rg-factors { margin: 0.3rem 0 0.6rem; }
.rg-factor-sets { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin-bottom: 0.4rem; }
.rg-factor-sets-label { font-size: 0.85rem; font-weight: 600; color: #2d3748; }
.rg-factor-grid { display: grid; grid-template-columns: repeat(6, minmax(4.5rem, 1fr)); gap: 0.35rem; max-width: 40rem; }
.rg-factor { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--rg-text); }
.rg-factor .rg-num { width: 100%; }
.rg-score-list { margin: 0.4rem 0 0.6rem; padding-left: 1.2rem; }
.rg-score-list li { margin: 0.15rem 0; }
.rg-pos { color: #22543d; font-weight: 600; }
.rg-neg { color: #9b2c2c; font-weight: 600; }
.rg-share-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 1rem; }
.rg-question { border: 1px solid var(--rg-line); border-left: 5px solid var(--rg-accent); border-radius: 6px; padding: 0.55rem 0.9rem; margin: 0 0 0.8rem; background: #fff; }
.rg-question h3 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.rg-question p { margin: 0.2rem 0; }
.rg-question .rg-affects { font-size: 0.88rem; color: var(--rg-muted); }
.rg-compare { width: 100%; }
.rg-compare th:first-child { width: 18%; }

.panel-tabset .tab-content { padding-top: 0.6rem; }

.rg-phone-only { display: none; }

@media (max-width: 767px) {
  /* On a phone, results first (after the presets), then the detailed settings. */
  .layout-sidebar { display: flex !important; flex-direction: column; }
  .layout-sidebar > .panel-fill { order: 1; }
  .layout-sidebar > .panel-sidebar { order: 2; margin-top: 1rem; }
  .layout-sidebar .settings-hide { display: none; }
  .rg-phone-only { display: block; }
  .rg-factor-grid { grid-template-columns: repeat(3, minmax(4.5rem, 1fr)); }
  .rg-card .rg-big { font-size: 1.35rem; }
  .rg-help > summary { align-items: flex-start; }
}
