/* elara_paper.css: the academic paper template. Loaded by the paper pages (/AI/research/tr-2026-01,
   /AI/research/gimps) and by nothing else, under the same isolation rule as elara_pricing.css: what is about a
   PAPER lives here (title block, abstract, numbered sections, theorem environments, numbered equations, figure
   and table captions, the reference list, footnotes); the bands, the wrap, the prose and table primitives stay
   in elara_pages.css, which every page loads first.

   WHY (founder, 2026-09-13): "the research papers must be formatted the same way all research is formatted, it
   must be embedded LaTeX so that we retain the academic look, you can have commentary at the top". So the paper
   sits on the white ground of a .pg-band.pg-paper band, in the paper face (--ff-paper resolves to KaTeX_Main,
   the Computer Modern face the maths renderer ships, then Latin Modern, then Georgia), inside a 42rem column
   (--measure-paper) that reads as a printed page on a desktop and as one column on a phone. The mathematics is
   authored as LaTeX in the page and rendered by the self-hosted KaTeX (vendor/katex, same origin, so the CSP's
   default-src 'self' holds); nothing here restyles KaTeX's own output.

   NUMBERS ARE COUNTERS, NOT TEXT. Section, equation, theorem, figure and table numbers are CSS counters, so the
   page's visible text carries no numeral that is not a measurement or a citation (tools/tier1_pages_measure.py
   reads every digit on a page against the receipts and docs/proof/page_allowlist.json). A paper that numbers
   its tables from zero, as TR-2026-01 does, says so with .paper.tbl0 rather than by typing "Table 0".

   TOKENS ONLY, same ratchet as every other sheet: tools/design_scan.py at zero, and this file is in the SHEETS
   list of tools/tier1_pages_measure.py so it cannot escape the gate. Square corners, no shadow, one accent: the
   section numerals carry --gold2 (which .pg-paper remaps to the deep paper gold), nothing else does. Inside the
   paper band --ink, --mut, --line and --gold2 already resolve to the paper palette, so no colour is remapped here.

   Every display equation scrolls inside its own overflow container (.eq-m), so a long formula on a phone never
   widens the document; tests/uiux/paper_render_proof.py measures scrollWidth against innerWidth at 390px. */

/* ── the commentary band: the Institute's plain-English note, on navy, before the paper ─────────────────── */
.paper-commentary .pg-p{max-width:var(--measure)}
.paper-commentary .pg-qa{margin-top:var(--sp4)}

/* ── the paper column ─────────────────────────────────────────────────────────────────────────────────────── */
.paper{counter-reset:sec subsec eqn thm defn prop fig tbl;font-family:var(--ff-paper);color:var(--ink);
  font-size:var(--fs-step-0);line-height:var(--lb-step-0);font-weight:var(--w-regular);letter-spacing:var(--tr-none)}
.paper.tbl0{counter-reset:sec subsec eqn thm defn prop fig tbl -1}
/* prose blocks take the paper measure; a table or a figure may run to the wide column, like .pg-table does */
.paper p,.paper h2,.paper h3,.paper h4,.paper .paper-abstract,.paper .paper-keywords,.paper .thm,.paper .defn,.paper .prop,
.paper .eq,.paper .paper-refs,.paper .paper-footnotes,.paper .paper-head,.paper ol,.paper ul,.paper dl{max-width:var(--measure-paper)}
.paper .pg-scroll,.paper figure,.paper .tbl{max-width:var(--measure-wide)}
.paper p{margin:0 0 var(--sp2)}
.paper b{font-weight:var(--w-bold)}
.paper i,.paper em{font-style:italic}
.paper a{color:var(--gold2)}
.paper code{font-family:var(--ff-mono);font-size:var(--fs-step--1);background:var(--tint-ink);padding:0 var(--sp-half)}

/* ── the title block ──────────────────────────────────────────────────────────────────────────────────────── */
/* A <div>, not a <header>: elara_chat_header.css styles the bare header element as the chrome's flex row, and a
   <header> inside the article inherited it -- measured 2026-09-13 at 390px, the title block laid out as one row
   and the document scrolled to 606px (TR) and 660px (GIMPS). The class is the contract; the tag is not. */
.paper-head{margin:0 0 var(--sp6);padding:0 0 var(--sp4);border-bottom:var(--bw-hair) solid var(--line);text-align:center}
.paper-series{margin:0 0 var(--sp3);font-family:var(--ff-paper-sans);font-size:var(--fs-step--2);line-height:var(--lb-step--2);
  font-weight:var(--w-semi);letter-spacing:var(--tr-wide);text-transform:uppercase;color:var(--mut)}
.paper-title{margin:0 0 var(--sp3);font-size:var(--fs-step-5);line-height:var(--lbh-step-5);font-weight:var(--w-bold);
  letter-spacing:var(--tr-none);color:var(--ink)}
.paper-subtitle{margin:0 0 var(--sp3);font-size:var(--fs-step-1);line-height:var(--lb-step-1);font-style:italic;color:var(--ink)}
.paper-authors{margin:0 0 var(--sp-half);font-size:var(--fs-step-1);line-height:var(--lb-step-1);color:var(--ink)}
.paper-affil{margin:0;font-size:var(--fs-step--1);line-height:var(--lb-step--1);color:var(--mut)}
.paper-affil a{color:var(--mut)}
.paper-date{margin:var(--sp2) 0 0;font-size:var(--fs-step--1);line-height:var(--lb-step--1);color:var(--mut);font-variant-numeric:tabular-nums}

/* ── abstract and keywords: indented from both sides, one step down, the head as a small-caps run-in ─────── */
.paper-abstract{margin:0 var(--sp5) var(--sp3);font-size:var(--fs-step--1);line-height:var(--lb-step--1)}
.paper-abstract p{margin:0 0 var(--sp1half);text-align:justify;hyphens:auto}
.paper-runin{font-variant-caps:small-caps;font-weight:var(--w-bold);letter-spacing:var(--tr-wide);margin-right:var(--sp-half)}
.paper-keywords{margin:0 var(--sp5) var(--sp6);font-size:var(--fs-step--1);line-height:var(--lb-step--1);color:var(--mut)}
.paper-keywords .paper-runin{color:var(--ink)}

/* ── numbered sections and subsections: the numeral is the one accent, tabular so the rail lines up ──────── */
.paper h3{counter-increment:sec;counter-reset:subsec;margin:var(--sp6) 0 var(--sp2);font-size:var(--fs-step-2);line-height:var(--lbh-step-2);
  font-weight:var(--w-bold);letter-spacing:var(--tr-none);color:var(--ink)}
.paper h3::before{content:counter(sec) "  ";color:var(--gold2);font-variant-numeric:tabular-nums;white-space:pre}
.paper h4{counter-increment:subsec;margin:var(--sp4) 0 var(--sp2);font-size:var(--fs-step-1);line-height:var(--lbh-step-1);
  font-weight:var(--w-bold);color:var(--ink)}
.paper h4::before{content:counter(sec) "." counter(subsec) "  ";color:var(--gold2);font-variant-numeric:tabular-nums;white-space:pre}
.paper h3.unnumbered{counter-increment:none}
.paper h3.unnumbered::before,.paper h4.unnumbered::before{content:none}
.paper .paper-sec>p:first-of-type{margin-top:0}

/* ── theorem, definition and proposition environments: bold run-in label, italic body, LaTeX's amsthm look ── */
.thm,.defn,.prop{margin:var(--sp3) 0;padding:0 0 0 var(--sp3);border-left:var(--bw-hair) solid var(--line)}
.thm{counter-increment:thm;font-style:italic}
.defn{counter-increment:defn}
.prop{counter-increment:prop;font-style:italic}
.thm p,.defn p,.prop p{margin:0 0 var(--sp1)}
.thm p:last-child,.defn p:last-child,.prop p:last-child{margin-bottom:0}
.thm::before,.defn::before,.prop::before{font-weight:var(--w-bold);font-style:normal;margin-right:var(--sp-half)}
.thm::before{content:"Theorem " counter(thm) "."}
.defn::before{content:"Definition " counter(defn) "."}
.prop::before{content:"Proposition " counter(prop) "."}
.thm[data-name]::before{content:"Theorem " counter(thm) " (" attr(data-name) ")."}
.defn[data-name]::before{content:"Definition " counter(defn) " (" attr(data-name) ")."}
.prop[data-name]::before{content:"Proposition " counter(prop) " (" attr(data-name) ")."}
/* a paper's own labels (the GIMPS statements are T0 to T7 in the paper): the label replaces the counter */
.thm[data-label]::before{content:attr(data-label) "."}
.thm[data-label]{counter-increment:none}
.paper .proof{margin:0 0 var(--sp3);padding:0 0 0 var(--sp3)}
.paper .proof::before{content:"Proof.";font-style:italic;margin-right:var(--sp-half)}
.paper .proof::after{content:"\25A1";float:right}
/* the body of a theorem is italic; the mathematics inside it is set upright by KaTeX itself, so nothing to undo */

/* ── numbered display equations: the formula centred in its own scroll box, the number on the right rail ─── */
.eq{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:var(--sp2);margin:var(--sp2) 0 var(--sp3);
  counter-increment:eqn}
.eq-m{min-width:0;overflow-x:auto;overflow-y:hidden}
.eq::after{content:"(" counter(eqn) ")";font-variant-numeric:tabular-nums;color:var(--mut)}
.eq.unnumbered{counter-increment:none}
.eq.unnumbered::after{content:none}
/* an inline formula that is wider than the column still scrolls rather than breaking the measure */
.paper .katex-display{overflow-x:auto;overflow-y:hidden}

/* ── figures and tables: caption above a table (the printed convention), below a figure ─────────────────── */
.paper figure{margin:var(--sp4) 0;padding:0;counter-increment:fig}
.paper figure .fig-absent{padding:var(--sp3);border:var(--bw-hair) solid var(--line);color:var(--mut);
  font-size:var(--fs-step--1);line-height:var(--lb-step--1);font-style:italic;text-align:center}
.paper figcaption{margin:var(--sp1) 0 0;font-size:var(--fs-step--1);line-height:var(--lb-step--1);color:var(--mut)}
.paper figcaption::before{content:"Figure " counter(fig) ".";font-weight:var(--w-bold);color:var(--ink);margin-right:var(--sp-half)}
.paper .tbl{margin:var(--sp4) 0;counter-increment:tbl}
.paper .tbl-cap{margin:0 0 var(--sp1);font-size:var(--fs-step--1);line-height:var(--lb-step--1);color:var(--mut)}
.paper .tbl-cap::before{content:"Table " counter(tbl) ".";font-weight:var(--w-bold);color:var(--ink);margin-right:var(--sp-half)}
.paper .tbl .pg-scroll{margin:0}
.paper .tbl .pg-table{font-family:var(--ff-paper)}
.paper .tbl .pg-table th{font-family:var(--ff-paper-sans)}
.paper .tbl-note{margin:var(--sp1) 0 0;font-size:var(--fs-step--2);line-height:var(--lb-step--2);color:var(--mut)}

/* ── the protocol list and the limitations list keep the site's own primitives, in the paper's face ──────── */
.paper .pg-qa dt{font-family:var(--ff-paper-sans)}
.paper .pg-steps li::before{font-family:var(--ff-paper-sans)}

/* ── references: [n] on a hanging indent, one step down ───────────────────────────────────────────────────── */
.paper-refs{margin:0;padding:0;list-style:none;counter-reset:ref}
.paper-refs li{position:relative;counter-increment:ref;margin:0 0 var(--sp1half);padding:0 0 0 var(--sp5);
  font-size:var(--fs-step--1);line-height:var(--lb-step--1);color:var(--ink)}
.paper-refs li::before{content:"[" counter(ref) "]";position:absolute;left:0;top:0;font-variant-numeric:tabular-nums;color:var(--mut)}
.paper-refs i{font-style:italic}
.paper .cite{text-decoration:none;color:var(--ink);font-variant-numeric:tabular-nums}
.paper .cite:hover,.paper .cite:focus-visible{color:var(--gold2)}

/* ── footnotes: a superior mark in the text, the notes under a hairline at the foot of the paper ─────────── */
.paper sup.fnref{font-size:var(--fs-step--3);line-height:var(--lb-step--3);vertical-align:super}
.paper sup.fnref a{text-decoration:none;color:var(--gold2);font-variant-numeric:tabular-nums}
.paper-footnotes{margin:var(--sp6) 0 0;padding:var(--sp2) 0 0 var(--sp3);border-top:var(--bw-hair) solid var(--line);
  font-size:var(--fs-step--2);line-height:var(--lb-step--2);color:var(--mut)}
.paper-footnotes li{margin:0 0 var(--sp1)}
.paper-footnotes a{color:var(--mut)}
.paper-foot{margin:var(--sp6) 0 0;padding:var(--sp3) 0 0;border-top:var(--bw-hair) solid var(--line);
  font-family:var(--ff-paper-sans);font-size:var(--fs-step--2);line-height:var(--lb-step--2);color:var(--mut)}
.paper-foot p{margin:0 0 var(--sp1)}

/* ── what the laboratories' paper pages carry (fetched live 2026-09-13, artifacts/tier1-2026-09-13/research-parity/):
   subjects under the date (arXiv "Subjects"), an action row (arXiv "View PDF", OpenAI and Anthropic "Read the paper",
   "Share"), a citation block with the plain form and BibTeX and the version line (arXiv "Cite as", "export BibTeX",
   "Submission history"), and related work (arXiv "Related Papers", OpenAI and Anthropic related links). The scholarly
   meta tags ride the head; elara_chat_space.head_meta turns them into ScholarlyArticle structured data. ───────── */
.paper-subjects{margin:var(--sp2) 0 0;font-family:var(--ff-paper-sans);font-size:var(--fs-step--1);line-height:var(--lb-step--1);color:var(--mut)}
.paper-subjects .paper-runin{color:var(--ink)}
/* Links, not buttons. arXiv's own action row ("View PDF", "Cite as", "export BibTeX") is a row of links, and a filled
   button pair was the generic idiom this system does not use; the buttons that stood here for one morning went with the
   rest of the 2026-09-13 revert. */
.paper-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--sp1) var(--sp3);margin:var(--sp3) 0 0;
  font-family:var(--ff-paper-sans);font-size:var(--fs-step--1);line-height:var(--lb-step--1)}
.paper-cite{margin:var(--sp6) 0 0;padding:var(--sp3) 0 0;border-top:var(--bw-hair) solid var(--line)}
.paper-cite h3{margin-top:var(--sp2)}
.paper-cite-line,.paper-ids{font-size:var(--fs-step--1);line-height:var(--lb-step--1)}
.paper-bibtex{max-width:var(--measure-paper);margin:0 0 var(--sp2);padding:var(--sp2) var(--sp3);background:var(--panel2);border:var(--bw-hair) solid var(--line);
  font-family:var(--ff-mono);font-size:var(--fs-step--2);line-height:var(--lb-step--2);color:var(--ink);overflow-x:auto;white-space:pre}
.paper-related{margin:0;padding:0 0 0 var(--sp3);font-size:var(--fs-step--1);line-height:var(--lb-step--1)}
.paper-related li{margin:0 0 var(--sp1)}

/* ── phone: the abstract and keywords give up their side indents so the column stays the wrap's ───────────── */
@media(max-width:640px){
  .paper-abstract,.paper-keywords{margin-left:0;margin-right:0}
  .paper-head{text-align:left}
  .paper-title{font-size:var(--fs-step-4);line-height:var(--lbh-step-4)}
  .thm,.defn,.prop,.paper .proof{padding-left:var(--sp2)}
  .paper-actions{justify-content:flex-start}
}
.pg-idioms{--strobe-edge:var(--strobe-edge);--cta-gold-fill:var(--cta-gold-fill);--chip-fill:var(--chip-fill);--chip-line:var(--chip-line);--scrim-image:var(--scrim-image)}
