/* ============================================================
   paper.css - CANONICAL stylesheet for research.calvinpak.dev papers.
   SOURCE OF TRUTH: the 'Confused Deputy' (agent-proxy) paper.
   Every paper links this via <link rel="stylesheet" href="../paper.css">.
   Edit ONCE here; all papers stay consistent. Component blocks:
     header.band  .draftnote  h1.title  .subtitle  .authorline  .affil
     .abstractbox .lbl .keywords   .cols (2-col body)  h2/h3 (numbered)
     .defblock .theorem (boxed formalism)  figure .fullwidth (full-width)
     .refs ol.reflist (2-col references)
   ============================================================ */
  :root{
    --ink:#111;
    --rule:#222;
    --soft:#666;
    --accent:#1a4f8b;
    --shade:#f6f5f2;
    --box:#cfcabd;
  }
  *{box-sizing:border-box;}
  html{ -webkit-text-size-adjust:100%; }
  body{
    margin:0;
    background:#fff;
    color:var(--ink);
    font-family:"Source Serif 4", Georgia, "Times New Roman", serif;
    font-size:10.5px;
    line-height:1.5;
  }
  .page{
    max-width:8.5in;
    margin:0 auto;
    padding:0.75in 0.75in 1in;
  }
  /* ---------- header band ---------- */
  header.band{
    column-span:all;
    text-align:center;
    border-bottom:1.5px solid var(--rule);
    padding-bottom:14px;
    margin-bottom:18px;
  }
  h1.title{
    font-family:"Source Serif 4", Georgia, serif;
    font-weight:700;
    font-size:21px;
    line-height:1.22;
    letter-spacing:-0.01em;
    margin:4px 0 10px;
  }
  .authorline{ font-size:13px; font-weight:600; margin:2px 0; }
  .affil{ font-size:9.5px; color:var(--soft); font-style:italic; margin:2px 0; }
  .affil.disc{ font-size:.84em; opacity:.85; }   /* COI disclosure line under the affiliation */
  .draftnote{ font-size:9px; color:var(--soft); letter-spacing:.04em; text-transform:uppercase; margin-top:6px; }
  .abstractbox{
    text-align:left;
    margin:16px auto 4px;
    max-width:6.4in;
    background:var(--shade);
    border:1px solid var(--box);
    padding:12px 16px;
    font-size:9.8px;
    line-height:1.5;
  }
  .abstractbox .lbl{
    font-family:"Inter",sans-serif;
    font-weight:700;
    font-size:9px;
    letter-spacing:.10em;
    text-transform:uppercase;
    display:block;
    margin-bottom:5px;
  }
  .abstractbox p{ margin:0 0 6px; text-align:justify; }
  .keywords{ font-size:9px; margin-top:6px; }
  .keywords b{ font-family:"Inter",sans-serif; }

  /* ---------- two-column body ---------- */
  .cols{
    column-count:2;
    column-gap:26px;
    counter-reset:sec;
    text-align:justify;
    hyphens:auto;
  }
  .cols p{ margin:0 0 8px; }
  .cols > section{ break-inside:auto; }

  h2{
    font-family:"Inter",sans-serif;
    font-weight:700;
    font-size:11.5px;
    margin:14px 0 6px;
    break-after:avoid;
    counter-increment:sec;
    counter-reset:sub;
  }
  h2::before{ content:counter(sec) "  "; }
  h2.nonum::before{ content:""; }
  h3{
    font-family:"Inter",sans-serif;
    font-weight:600;
    font-size:10.2px;
    margin:10px 0 4px;
    break-after:avoid;
    counter-increment:sub;
  }
  h3::before{ content:counter(sec) "." counter(sub) "  "; }
  h4{
    font-family:"Inter",sans-serif;
    font-weight:600;
    font-size:9.8px;
    margin:8px 0 3px;
    break-after:avoid;
  }

  code, .mono{ font-family:"JetBrains Mono","Source Code Pro",monospace; font-size:9px; }
  .defblock{
    break-inside:avoid;
    border:1px solid var(--box);
    background:#fafaf8;
    padding:9px 11px;
    margin:8px 0;
    font-family:"JetBrains Mono","Source Code Pro",monospace;
    font-size:8.6px;
    line-height:1.55;
  }
  .defblock .h{ font-family:"Inter",sans-serif; font-weight:700; font-size:8.6px; letter-spacing:.04em; display:block; margin-bottom:5px; text-transform:uppercase;}
  .theorem{
    break-inside:avoid;
    border-left:2.5px solid var(--accent);
    background:#f6f8fb;
    padding:8px 11px;
    margin:9px 0;
    font-size:9.6px;
  }
  .theorem .h{ font-family:"Inter",sans-serif; font-weight:700; font-size:9.4px; margin-right:5px;}
  .theorem em.lbl{ font-style:italic; }

  ul,ol{ margin:4px 0 8px; padding-left:16px; }
  li{ margin-bottom:3px; }

  figure{ break-inside:avoid; margin:10px 0 12px; text-align:center; }
  figure svg{ max-width:100%; height:auto; }
  figcaption{ font-size:8.8px; color:#222; text-align:left; margin-top:5px; line-height:1.4; }
  figcaption b{ font-family:"Inter",sans-serif; font-weight:700; }

  table{ border-collapse:collapse; width:100%; font-size:8.6px; margin:4px 0; }
  table caption{ caption-side:top; font-size:8.8px; text-align:left; margin-bottom:4px; }
  table caption b{ font-family:"Inter",sans-serif; }
  th,td{ border:0.6px solid #bbb; padding:3px 5px; text-align:left; vertical-align:top; }
  thead th{ background:var(--shade); font-family:"Inter",sans-serif; font-weight:600; font-size:8.2px; }
  td.y{ text-align:center; font-weight:700; }
  td.n{ text-align:center; color:#999; }

  .fullwidth{ column-span:all; break-inside:avoid; margin:14px 0; }

  .refs{ column-span:all; border-top:1.5px solid var(--rule); margin-top:18px; padding-top:10px; }
  .refs h2{ break-before:avoid; }
  ol.reflist{ font-size:8.8px; padding-left:22px; column-count:2; column-gap:26px; }
  ol.reflist li{ margin-bottom:5px; text-align:left; break-inside:avoid; }

  .small{ font-size:8.6px; color:var(--soft); }
  .accent{ color:var(--accent); }
  .tbd{ font-family:"JetBrains Mono",monospace; font-size:8.4px; color:#8a5a00; }

  @page{ size:Letter; margin:0.75in; }
  @media print{
    .page{ padding:0; max-width:none; }
    body{ font-size:10px; }
  }

  /* subtitle — optional centered tagline (Deputy folds its subtitle into the title;
     Missing Ledger uses this slot, placed between h1.title and .authorline) */
  .subtitle{ font-family:"Source Serif 4",Georgia,serif; font-style:italic; font-size:13px;
    color:var(--soft); margin:2px 0 8px; }

  /* ---------- inline-SVG figure label classes ----------
     Used by Missing Ledger figures: .term = MDP/decision-theoretic label,
     .biz = the business-term gloss (blue accent), .mono = monospace annotation.
     Text fills set explicitly per-element in the SVG override these where present. */
  svg text{ font-family:"Inter",sans-serif; }
  svg .term{ font-family:"Inter",sans-serif; font-weight:600; }
  svg .biz{ font-family:"Source Serif 4",Georgia,serif; font-style:italic; fill:var(--accent); }
  svg .mono, svg tspan.mono{ font-family:"JetBrains Mono","Source Code Pro",monospace; }

