/* Page additions for elicitation-or-expansion. project.css and colors_and_type.css are kept identical
   to the template; this file styles the figures and interactive widgets.
   Data series use the paper's figure colors: baseline #8D8D8D, optimized #E21500,
   stronger reference #2D2D2D. */

:root {
  --hp-base: #8D8D8D;
  --hp-opt: #E21500;
  --hp-ref: #2D2D2D;
  --hp-rule: #D4D4D4;
  --hp-muted: #F4F4F4;
  --hp-ink: #151515;
  --hp-text: #444444;
  --hp-soft: #7F7F7F;
}

html { scroll-padding-top: 24px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--hp-opt);
  outline-offset: 2px;
}


/* As on the MetaCurate page, headings stay centered while body paragraphs sit in an
   800px column, justified with automatic hyphenation. */
.fig figcaption, .card p, .callout p { text-wrap: pretty; }
.section__head .section__lede,
.section__lede--center,
.fig figcaption {
  align-self: center;
  width: 100%;
  max-width: 752px;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
  hyphens: auto;
}
/* Captions are short and small; ragged-right avoids wide justified word gaps.
   Narrow screens use ragged-right body text for the same reason. */
.fig figcaption { text-align: left; hyphens: manual; }
@media (max-width: 639px) {
  .section__head .section__lede, .section__lede--center { text-align: left; hyphens: manual; }
}

/* Small helpers used by the figure markup. */
.text-core { color: var(--hp-opt); }
.muted { color: var(--hp-soft); }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

/* ---------- Hero additions ---------- */
.hero__subtitle { margin: -8px 0 0; font-size: clamp(20px, 2.4vw, 26px); font-weight: 500; line-height: 1.3; color: var(--hp-text); text-wrap: balance; }
.hero__affiliations span { display: inline-block; white-space: nowrap; }
.hero__notes { margin-top: -4px; }
@media (max-width: 479px) {
  .hero__notes { font-size: 13px; }
}
/* "What we did / What we found" summary under the hero buttons: a label column and
   text separated by hairlines, left-aligned. */
.hero__summary { width: 100%; max-width: 920px; margin: 32px 0 0; text-align: left; border-top: 1px solid var(--hp-ink); }
.hero__row { display: grid; gap: 6px 32px; padding: 20px 0; border-bottom: 1px solid var(--hp-rule); }
.hero__row:last-child { border-bottom-color: var(--hp-ink); }
@media (min-width: 640px) {
  .hero__row { grid-template-columns: 11rem minmax(0, 1fr); gap: 6px 32px; }
}
.hero__summary dt { margin: 0; padding-top: 8px; white-space: nowrap; font-size: 15px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--hp-opt); }
.hero__summary dd { margin: 0; font-size: 24px; line-height: 1.5; color: var(--hp-text); text-wrap: balance; }
.hero__summary dd strong { font-weight: 700; color: var(--hp-ink); }
@media (max-width: 639px) {
  .hero__summary dd { font-size: 19px; }
}

/* ---------- Sections ---------- */
.section h2 .muted { color: var(--hp-soft); }
.section__head--sub { margin-top: 32px; }
.section__head--sub h3 { margin: 0; font-size: 22px; font-weight: 700; color: var(--hp-ink); }
.grid--three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.bench-chips { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bench-chips li { border: 1px solid var(--hp-rule); border-radius: 9999px; background: #FFFFFF; padding: 6px 14px; font-size: 14px; }
.bench-chips strong { margin-right: 6px; color: var(--hp-ink); }
.details { align-self: center; width: 100%; }
.details summary { cursor: pointer; width: fit-content; margin: 0 auto 12px; font-size: 14px; font-weight: 700; color: var(--hp-ink); }
.details summary:hover { color: var(--hp-opt); }
/* overflow-x alone would make overflow-y auto too, and KaTeX's tall delimiters then show a
   scrollbar beside the formula; clip vertically and leave room for the delimiters instead. */
.callout__math { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 8px 0; color: var(--hp-ink); }
.callout__math .katex-display { margin: 0; padding: 2px 0; }
@media (max-width: 479px) {
  .callout__math .katex-display { font-size: 0.82em; }
}

/* ---------- Figures ---------- */
.fig { margin: 0; }
.fig img { display: block; height: auto; max-width: 100%; }
.fig figcaption { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--hp-text); }
.tag {
  display: inline-block;
  margin: 0 6px 4px 0;
  background: var(--hp-muted);
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--hp-text);
}
.tag-illustrative { background: #FBE7E4; color: #440A07; }
.panels { display: grid; gap: 12px 16px; }
.panels-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panels-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .panels-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
  .panels-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.panel-title { margin: 0 0 4px; text-align: center; font-size: 14px; font-weight: 700; color: var(--hp-ink); }
.panel-group { margin: 0; font-size: 14px; font-weight: 700; color: var(--hp-ink); }
.panel-group span { margin-left: 8px; font-weight: 500; color: var(--hp-soft); }
.html-legend { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; color: var(--hp-text); }
.html-legend li { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Candidate examples (section 03) ---------- */
.cand-grid { display: grid; gap: 28px; }
@media (min-width: 768px) {
  .cand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }
}
.cand-panel { min-width: 0; max-width: 26rem; justify-self: center; width: 100%; }
.cand-panel img { margin: 0 auto; }
.cand-legend { justify-content: center; gap: 2px 14px; margin-bottom: 6px; font-size: 13px; }
.lg-line { display: inline-block; width: 22px; height: 0; border-top: 3px solid; }
.cand-widget .cand-legend { margin-bottom: 14px; }
.cand-widget .cand-panel { max-width: 27rem; }
.cand-widget svg { display: block; width: 100%; height: auto; }
.cand-note { font: 700 11px var(--font-sans); paint-order: stroke; stroke: #FFFFFF; stroke-width: 3px; stroke-linejoin: round; }
.lg-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #000000; }

/* ---------- Illustrative schematic ---------- */
.schematic-grid { display: grid; gap: 24px 28px; grid-template-columns: minmax(0, 1fr); max-width: 18rem; margin: 0 auto; }
@media (min-width: 640px) {
  .schematic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
}
.schematic { display: block; width: 100%; height: auto; }
.schematic .s-title { font: 700 14px var(--font-sans); fill: var(--hp-ink); }
.schematic .s-axis { stroke: var(--hp-ink); stroke-width: 1; }
.schematic .s-grid { stroke: var(--hp-rule); stroke-width: 1; stroke-dasharray: 3 3; }
.schematic .s-base { fill: var(--hp-base); }
.schematic .s-opt { fill: var(--hp-opt); }
.schematic .s-ylabel { font: 500 10.5px var(--font-sans); fill: var(--hp-soft); text-anchor: middle; }
.schematic .s-zero { font: 500 10px var(--font-mono); fill: var(--hp-base); text-anchor: middle; }
.schematic .s-new { font: 700 10px var(--font-sans); fill: var(--hp-opt); text-anchor: middle; }
.schematic .s-label { font: 500 10px var(--font-sans); fill: var(--hp-base); }
.schematic .s-sub { font: 700 12px var(--font-sans); fill: var(--hp-ink); }

/* ---------- Interactive figures (static/js/explorer.js) ---------- */
.js-only { display: none; }
.has-widget .js-only { display: inline; }
.has-widget .static-fallback { display: none; }

.explorer, .outcomes { border: 1px solid var(--hp-rule); background: #FFFFFF; padding: 16px; }
@media (min-width: 640px) {
  .explorer, .outcomes { padding: 22px 26px; }
}
.ex-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.ex-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-tab {
  border: 1.5px solid var(--hp-rule);
  border-radius: 9999px;
  background: #FFFFFF;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--hp-text);
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.ex-tab:hover { border-color: var(--hp-opt); color: var(--hp-opt); }
.ex-tab[aria-pressed="true"] { border-color: #000000; background: #000000; color: #FFFFFF; }
.ex-tab-sm { padding: 4px 11px; font-size: 13px; }
.ex-strata .ex-tab[aria-pressed="true"] { border-color: var(--hp-opt); background: var(--hp-opt); }
.ex-strata[hidden] { display: none; }

.ex-body { display: grid; gap: 16px; margin-top: 16px; }
/* A narrower plot keeps the curves' shape readable on the log-scaled k axis. */
.ex-chart { width: 100%; max-width: 28rem; justify-self: center; }
@media (min-width: 900px) {
  .ex-body { grid-template-columns: minmax(0, 28rem) 16rem; justify-content: center; align-items: start; gap: 40px; }
}
.ex-chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.ex-grid { stroke: #ECECEC; stroke-width: 1; }
.ex-ytick, .ex-xtick { font: 500 11px var(--font-mono); fill: var(--hp-base); }
.ex-ytick { text-anchor: end; }
.ex-xtick { text-anchor: middle; }
.ex-axis { font: 500 11px var(--font-sans); fill: var(--hp-base); text-anchor: middle; }
.ex-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.ex-baseline { stroke: var(--hp-base); stroke-width: 2.5; }
.ex-optimized { stroke: var(--hp-opt); stroke-width: 2.5; opacity: 0.85; }
.ex-reference { stroke: var(--hp-ref); stroke-width: 2; stroke-dasharray: 6 5; }
.ex-band { fill: rgba(226, 21, 0, 0.14); stroke: none; }
.ex-run { stroke: var(--hp-opt); stroke-width: 1.2; opacity: 0.45; }
.ex-run-mark { fill: var(--hp-opt); opacity: 0.6; }
.ex-optimized.ex-mean { stroke-width: 3.2; opacity: 1; }
.ex-ro-sd { font-weight: 500; color: var(--hp-text); }
.ex-ro-run { padding-left: 24px; font-size: 13px; color: var(--hp-text); }
.ex-ro-run .ex-ro-val { font-weight: 500; color: var(--hp-text); }
.ex-ro-glyph { flex: none; width: 12px; font-size: 11px; color: var(--hp-opt); opacity: 0.8; }
.ex-cursor { stroke: #000000; stroke-width: 1; stroke-dasharray: 2 3; }
.ex-dot { stroke: #FFFFFF; stroke-width: 1.5; }
.ex-dot-baseline { fill: var(--hp-base); }
.ex-dot-optimized { fill: var(--hp-opt); }
.ex-dot-reference { fill: var(--hp-ref); }

.ex-readout { font-size: 14px; }
.ex-readout ul { margin: 6px 0 0; padding: 0; list-style: none; }
.ex-ro-head { margin: 0; font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--hp-ink); }
.ex-ro-gap { margin-top: 14px; color: var(--hp-text); }
.ex-ro-list { display: grid; gap: 5px; }
.ex-ro-list li { display: flex; align-items: baseline; gap: 8px; }
.ex-ro-name { flex: 1; line-height: 1.35; color: var(--hp-text); }
.ex-ro-val { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--hp-ink); }
.ex-ro-val.up { color: var(--hp-opt); }
.ex-ro-val.down { color: var(--hp-text); }
.ex-sw { flex: none; display: inline-block; width: 16px; height: 0; border-top: 3px solid; transform: translateY(-3px); }
.ex-sw-baseline { border-color: var(--hp-base); }
.ex-sw-optimized { border-color: var(--hp-opt); }
.ex-sw-reference { border-color: var(--hp-ref); border-top-style: dashed; }

.ex-slider-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ex-play { flex: none; width: 36px; height: 36px; border: 0; border-radius: 9999px; background: #000000; color: #FFFFFF; font-size: 13px; cursor: pointer; }
.ex-play.playing { background: var(--hp-opt); }
.ex-slider-label { flex: 1; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--hp-text); }
.ex-slider-label span { flex: none; }
.ex-slider-label input { flex: 1; min-width: 0; width: 100%; accent-color: var(--hp-opt); }
@media (max-width: 479px) {
  .ex-slider-label span { display: none; }
}
.ex-k { flex: none; min-width: 72px; font-family: var(--font-mono); font-weight: 500; color: var(--hp-ink); }
.ex-note { margin: 12px 0 0; border-left: 3px solid var(--hp-opt); padding-left: 12px; font-size: 15px; line-height: 1.55; color: var(--hp-text); }

.oc-legend { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; color: var(--hp-text); }
.oc-legend li { display: inline-flex; align-items: center; gap: 8px; }
.oc-sw { display: inline-block; width: 14px; height: 14px; }
.oc-rows { display: grid; gap: 14px; margin-top: 16px; }
.oc-name { margin: 0; font-size: 14px; font-weight: 700; color: var(--hp-ink); }
.oc-bar { display: flex; overflow: hidden; height: 32px; margin-top: 5px; background: var(--hp-muted); }
.oc-seg { display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; transition: width .5s ease; }
@media (prefers-reduced-motion: reduce) {
  .oc-seg { transition: none; }
}
.oc-never { background: var(--hp-ref); color: #FFFFFF; }
.oc-sometimes { background: var(--hp-rule); color: var(--hp-ink); }
.oc-always { background: var(--hp-opt); color: #FFFFFF; }
.oc-summary { margin: 16px 0 0; font-size: 15px; line-height: 1.55; color: var(--hp-text); }
.oc-summary strong { font-variant-numeric: tabular-nums; color: var(--hp-ink); }
