/* Shared structure, kept quiet. Each site's identity lives in its .t-* block. */
:root {
  --page: #ffffff;
  --panel: #ffffff;
  --ink: #17191e;
  --ink-2: #474b54;
  --ink-3: #676c76;
  --rule: #dde0e5;
  --accent: #1f4fa8;
  --accent-ink: #ffffff;
  --ok: #1d6b38;
  --warn: #8a5a00;
  --bad: #a3241b;
  --radius: 3px;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--body);
  --size: 17.5px;
  --lead: 1.6;
  --text: 680px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: var(--size)/var(--lead) var(--body); font-variant-numeric: lining-nums; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--page); padding: 8px 12px; z-index: 10; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Header: wordmark left, sections right. */
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 28px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.wordmark { font: 700 18px/1.2 var(--display); color: inherit; text-decoration: none; }
nav.top { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 15px; }
nav.top a { color: inherit; opacity: 0.78; text-decoration: none; padding: 10px 0; border-bottom: 2px solid transparent; }
nav.top a:hover { opacity: 1; }
nav.top a[aria-current="page"] { opacity: 1; border-bottom-color: currentColor; }

/* Page head: headline and the lede. The lede is the answer in brief. */
main { padding: 0 0 56px; }
.page-head { padding: 52px 0 8px; }
h1 { font: 700 clamp(32px, 4.6vw, 48px)/1.1 var(--display); margin: 0 0 16px; letter-spacing: -0.01em; max-width: 22ch; }
.dek p { margin: 0; max-width: 660px; }
.dek .lede { font-size: 22px; line-height: 1.42; color: var(--ink); }
.dek .rest { font-size: 17px; line-height: 1.6; color: var(--ink-2); margin-top: 10px; }
h2 { font: 700 26px/1.25 var(--display); margin: 56px 0 12px; max-width: var(--text); }
h3 { font: 700 19px/1.35 var(--display); margin: 30px 0 6px; max-width: var(--text); }
.body > p, .body > ul, .body > ol, .body > blockquote, .body > details, .faq, .sources, dl.glossary { max-width: var(--text); }
.body ul, .body ol { padding-left: 22px; }
.body li { margin: 6px 0; }
.body blockquote { margin: 20px 0; padding: 0 0 0 18px; border-left: 2px solid var(--rule); color: var(--ink-2); }
.table-wrap { overflow-x: auto; margin: 20px 0 26px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
td { font-variant-numeric: tabular-nums lining-nums; }
th, caption { font-variant-numeric: lining-nums proportional-nums; }
th, td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 600; font-size: 14px; color: var(--ink-2); border-bottom: 1.5px solid var(--ink); vertical-align: bottom; }
caption { text-align: left; padding: 8px 0 0; font-size: 13px; color: var(--ink-3); caption-side: bottom; }
details { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 12px 0; margin: 16px 0; }
details + details { margin-top: -17px; }
summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 8px; }
.faq h3 { font-size: 18px; }
.sources ol { font-size: 15px; color: var(--ink-2); padding-left: 22px; }
.sources .checked { color: var(--ink-3); }
dl.glossary dt { font: 700 19px/1.35 var(--display); margin-top: 24px; }
dl.glossary dd { margin: 4px 0 0; }
.updated { margin: 52px 0 0; font-size: 14px; color: var(--ink-3); }
.updated a { color: inherit; }

/* Call to action */
.cta { margin: 20px 0 0; padding: 20px 0 0; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.cta p { margin: 0; color: var(--ink-2); max-width: 560px; font-size: 16px; }
.cta a.button { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; padding: 12px 18px; border-radius: var(--radius); white-space: nowrap; }

footer.site { border-top: 1px solid var(--rule); font-size: 14.5px; color: var(--ink-2); }
footer.site .wrap { padding-top: 28px; padding-bottom: 36px; display: grid; grid-template-columns: 1fr; gap: 6px; }
footer.site h2 { font: 600 15px/1.4 var(--body); margin: 0 0 6px; max-width: none; }
footer.site ul { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
footer.site .fine { color: var(--ink-3); margin: 0; }

/* Controls */
button, .btn { font: 600 15px/1 var(--body); padding: 12px 16px; min-height: 44px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; }
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
input[type="text"], input[type="number"], select { font: 17px/1.2 var(--body); padding: 9px 10px; min-height: 44px; border: 1px solid var(--ink-3); border-radius: var(--radius); background: var(--panel); color: var(--ink); width: 100%; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }

/* Reviews */
.review { margin: 0 0 22px; break-inside: avoid; }
.review blockquote { margin: 0; padding: 0; border: 0; color: var(--ink); }
.review blockquote p { margin: 0; }
.review figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-3); }

/* Tools */
.tool { margin: 12px 0 36px; }
.tool .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.tool .prompt { font-size: 1.08em; line-height: 1.5; margin: 6px 0 12px; }
.tool .correct { color: var(--ok); }
.tool .follows, .tool .close { color: var(--warn); }
.tool .wrong { color: var(--bad); }
.quiz-card { padding: 4px 0 12px; }
ol.solution { padding-left: 22px; max-width: var(--text); }
ol.solution li { margin: 6px 0; }

/* Paper LBO worksheet */
.worksheet { border: 1px solid var(--rule); background: var(--panel); padding: 20px; }
.worksheet .ws-grid { display: grid; grid-template-columns: 1fr; gap: 8px 40px; }
.worksheet .ws-h { font-size: 18px; margin: 14px 0 6px; padding: 0; border: 0; }
dl.assume { margin: 10px 0 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; font-size: 15px; }
dl.assume div { padding: 6px 0; border-bottom: 1px solid var(--rule); }
dl.assume dt { color: var(--ink-3); font-size: 13px; }
dl.assume dd { margin: 1px 0 0; font-weight: 600; }
.worksheet .steps { display: grid; margin-top: 6px; }
.worksheet .step { display: grid; grid-template-columns: 1fr 132px; gap: 2px 14px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--rule); }
.worksheet .step label { display: flex; gap: 10px; align-items: baseline; font-weight: 600; font-size: 15px; }
.worksheet .step .n { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 1.1em; text-align: right; }
.worksheet .step .result { grid-column: 1 / -1; font-size: 14px; margin: 0; }
.worksheet .step .result:empty { display: none; }
.worksheet .field { position: relative; display: block; }
.worksheet .field input { text-align: right; padding-right: 10px; }
.worksheet .field.pre input { padding-left: 22px; }
.worksheet .field.pre::before { content: attr(data-unit); position: absolute; left: 9px; top: 50%; transform: translateY(-52%); color: var(--ink-3); pointer-events: none; }
.worksheet .field.post input { padding-right: 26px; }
.worksheet .field.post::after { content: attr(data-unit); position: absolute; right: 10px; top: 50%; transform: translateY(-52%); color: var(--ink-3); pointer-events: none; }
.worksheet .actions { margin-top: 16px; }
.worksheet .clock { margin-left: auto; font-variant-numeric: tabular-nums; }
.worksheet .ws-solution { margin-top: 14px; }
@media (min-width: 860px) {
  .worksheet .ws-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .worksheet .ws-problem { position: sticky; top: 12px; align-self: start; }
}

/* DCF calculator as a spreadsheet */
.sheet-note { font-size: 14px; color: var(--ink-3); margin: 0 0 10px; max-width: var(--text); }
.sheets { display: grid; grid-template-columns: 1fr; gap: 18px 28px; }
@media (min-width: 820px) { .sheets { grid-template-columns: 1fr 1fr; align-items: start; } }
table.sheet { border: 1px solid var(--sheet-line, #c9cfd8); font-size: 14.5px; }
table.sheet caption { caption-side: top; text-align: left; font-size: 14px; font-weight: 600; color: var(--ink); padding: 0 0 6px; }
table.sheet th, table.sheet td { border: 1px solid var(--sheet-line, #c9cfd8); padding: 0 8px; height: 34px; vertical-align: middle; }
table.sheet th { font-weight: 400; color: var(--ink-2); background: var(--sheet-head, #f5f6f8); }
table.sheet td.in { padding: 0; width: 34%; }
table.sheet td.in input, table.sheet td.in select { border: 0; border-radius: 0; min-height: 34px; height: 34px; padding: 0 8px; text-align: right; color: var(--input-blue, #0a3fd0); font-weight: 600; background: transparent; }
table.sheet td.in select { text-align: left; }
table.sheet td.in input:focus, table.sheet td.in select:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--panel); }
table.sheet td.unit { width: 1%; white-space: nowrap; color: var(--ink-3); font-size: 13px; }
table.sheet.out td { text-align: right; color: var(--ink); }
table.sheet.out thead th { text-align: right; background: var(--sheet-head, #f5f6f8); color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--sheet-line, #c9cfd8); }
table.sheet.out thead th:first-child { text-align: left; }
table.sheet.out tbody th { white-space: nowrap; }
table.sheet.out.summary td { font-weight: 600; }
table.sheet.out caption { caption-side: bottom; font-weight: 400; font-size: 13px; color: var(--ink-3); padding-top: 6px; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  header.site .wrap { min-height: 0; padding-top: 12px; padding-bottom: 0; }
  nav.top { width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 0 18px; scrollbar-width: none; }
  nav.top a { white-space: nowrap; padding: 12px 0; }
  .page-head { padding-top: 32px; }
  .dek .lede { font-size: 19px; }
  .dek .rest { font-size: 16px; }
  h2 { font-size: 23px; margin-top: 44px; }
  .worksheet { padding: 14px; }
  .worksheet .step { grid-template-columns: 1fr 116px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ============================================================
   1. Comparison: a broker research report. Navy masthead, comps
      tables with the pick highlighted the way an analyst would.
   ============================================================ */
.t-comps {
  --page: #ffffff; --ink: #18202b; --ink-2: #3d4757; --ink-3: #5d6776; --rule: #d6dbe3;
  --accent: #173866; --mast: #173866; --highlight: #fff1b0; --radius: 2px;
  --body: "Libre Franklin", Arial, sans-serif; --display: var(--body); --size: 17px;
}
.t-comps header.site { background: var(--mast); color: #ffffff; }
.t-comps header.site nav.top a[aria-current="page"] { border-bottom-color: var(--highlight); }
.t-comps h1 { font-weight: 600; letter-spacing: -0.02em; }
.t-comps h2 { font-weight: 600; border-top: 1px solid var(--ink); padding-top: 14px; max-width: none; }
.t-comps .body > h2:first-child { margin-top: 36px; }
.t-comps thead th { color: var(--mast); border-bottom: 2px solid var(--mast); }
.t-comps td:first-child { font-weight: 500; }
.t-comps tbody tr.pick td { background: var(--highlight); }
.t-comps tbody tr.pick td:first-child { font-weight: 700; padding-left: 8px; }
.t-comps .cta { border-top: 2px solid var(--mast); }

/* ============================================================
   2. paperlbo.org: a green engineering pad with a red margin.
   ============================================================ */
.t-pad {
  --page: #e8f1e1; --panel: #ffffff; --ink: #1f2a22; --ink-2: #405044; --ink-3: #5a695e; --rule: #c4d6b8;
  --accent: #245236; --pencil: #b3261e; --grid: rgba(78, 128, 88, 0.14); --radius: 0px; --focus-bg: #f2f8ec;
  --body: "Barlow", Arial, sans-serif; --display: "Barlow Semi Condensed", "Barlow", Arial, sans-serif; --size: 17.5px;
  --bad: #b3261e;
}
body.t-pad {
  background-color: var(--page);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
}
.t-pad header.site { background: #1e3a28; color: #f3f8ef; }
.t-pad h1, .t-pad h2, .t-pad h3, .t-pad .wordmark, .t-pad dl.glossary dt { font-weight: 700; letter-spacing: 0; }
.t-pad h1 { font-size: clamp(34px, 5vw, 52px); }
.t-pad main .wrap { background: #fbfdf8; border-left: 2px solid var(--pencil); padding-left: 32px; padding-right: 32px; padding-bottom: 32px; margin-top: 28px; }
.t-pad .page-head { padding-top: 34px; }
.t-pad .worksheet { border: 1px solid var(--rule); border-top: 3px solid var(--accent); }
.t-pad .worksheet input[type="text"] { font: 600 18px/1.2 var(--display); border: 0; border-bottom: 2px solid var(--ink-2); border-radius: 0; background: transparent; min-height: 40px; }
.t-pad .worksheet input[type="text"]:focus { background: var(--focus-bg); }
.t-pad .tool .correct::before { content: "\2713  "; }
.t-pad .tool .wrong::before { content: "\2717  "; }
.t-pad .cta { border-top: 1px solid var(--pencil); }
.t-pad footer.site { background: #fbfdf8; }
@media (max-width: 640px) { .t-pad main .wrap { padding-left: 18px; padding-right: 14px; margin-top: 12px; } }

/* ============================================================
   3. Reviews: a magazine page. The quotes are the design.
   ============================================================ */
.t-quotes {
  --page: #f3f4f7; --panel: #ffffff; --ink: #1c2028; --ink-2: #454b57; --ink-3: #626977; --rule: #d6dae1;
  --accent: #5a2a6e; --radius: 2px;
  --body: "Karla", Arial, sans-serif; --display: "Crimson Pro", Georgia, serif; --size: 17.5px;
}
.t-quotes header.site { border-bottom: 1px solid var(--ink); }
.t-quotes .wordmark { font-size: 22px; font-weight: 600; }
.t-quotes h1 { font-weight: 600; font-size: clamp(42px, 7vw, 72px); letter-spacing: -0.02em; line-height: 1.02; }
.t-quotes h2, .t-quotes h3, .t-quotes dl.glossary dt { font-weight: 600; }
.t-quotes h2 { font-size: 30px; }
.t-quotes .body:has(> figure.review + figure.review) { columns: 2 320px; column-gap: 40px; }
.t-quotes .body:has(> figure.review + figure.review) > *:not(figure) { column-span: all; }
.t-quotes .review { border-top: 1px solid var(--rule); padding: 16px 0 6px; display: inline-block; width: 100%; margin: 0 0 14px; }
.t-quotes .review blockquote p { font: 400 23px/1.36 var(--display); }
.t-quotes .review blockquote p::before { content: "\201C"; margin-left: -0.42em; color: var(--accent); }
.t-quotes .review blockquote p::after { content: "\201D"; color: var(--accent); }
.t-quotes .review figcaption { font-weight: 600; color: var(--accent); }
.t-quotes .body > figure.review:first-of-type:has(+ figure.review) { border-top: 2px solid var(--ink); padding-top: 22px; margin-bottom: 26px; }
.t-quotes .body > figure.review:first-of-type:has(+ figure.review) blockquote p { font-size: clamp(30px, 4.4vw, 40px); line-height: 1.18; }
.t-quotes .cta { border-top-color: var(--ink); }

/* ============================================================
   4. Superday: the day's printed agenda.
   ============================================================ */
.t-agenda {
  --page: #ffffff; --ink: #14161c; --ink-2: #434855; --ink-3: #626876; --rule: #e0e2e8;
  --accent: #7d1a39; --radius: 2px;
  --body: "Archivo", Arial, sans-serif; --display: var(--body); --size: 17px;
}
.t-agenda header.site { border-top: 6px solid var(--accent); border-bottom: 1px solid var(--rule); }
.t-agenda .wordmark { font-stretch: 80%; font-size: 20px; font-weight: 750; }
.t-agenda h1 { font-weight: 800; font-stretch: 78%; font-size: clamp(38px, 6.4vw, 64px); line-height: 1.0; letter-spacing: -0.005em; max-width: 16ch; }
.t-agenda h2 { font-weight: 750; font-stretch: 85%; font-size: 28px; }
.t-agenda h3 { font-stretch: 92%; }
.t-agenda td:first-child, .t-agenda tbody th { font-weight: 700; font-stretch: 80%; white-space: nowrap; }
figure.agenda { margin: 30px 0 18px; border: 1.5px solid var(--ink); max-width: 760px; }
figure.agenda figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; }
figure.agenda figcaption span:last-child { font-weight: 400; opacity: 0.85; }
figure.agenda ol { list-style: none; margin: 0; padding: 4px 16px; }
figure.agenda li { display: grid; grid-template-columns: 78px 150px 1fr; gap: 4px 16px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--rule); }
figure.agenda li:last-child { border-bottom: 0; }
figure.agenda time { font-weight: 800; font-stretch: 75%; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
figure.agenda li strong { font-weight: 650; }
figure.agenda li span { color: var(--ink-2); font-size: 15.5px; }
figure.agenda li.iv time { color: var(--accent); }
.agenda-foot { margin: 0; padding: 10px 16px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-3); }
@media (max-width: 640px) {
  figure.agenda li { grid-template-columns: 62px 1fr; }
  figure.agenda li span { grid-column: 2; }
  figure.agenda time { font-size: 20px; }
}

/* ============================================================
   5. Questions: a study guide, questions numbered in the margin.
   ============================================================ */
.t-guide {
  --page: #fcfcfa; --ink: #1b1d19; --ink-2: #474a42; --ink-3: #63675e; --rule: #dddfd6;
  --accent: #1c5638; --radius: 2px;
  --body: "Alegreya Sans", "Gill Sans", Arial, sans-serif; --display: "Alegreya", Georgia, serif; --size: 18.5px; --lead: 1.55;
}
.t-guide header.site { border-bottom: 3px double var(--ink); }
.t-guide .wordmark { font-weight: 700; font-size: 20px; }
.t-guide h1 { font-weight: 700; font-size: clamp(36px, 5.4vw, 56px); line-height: 1.05; }
.t-guide h2 { font-weight: 700; font-size: 28px; }
.t-guide .body { counter-reset: q; }
.t-guide .body h3 { counter-increment: q; position: relative; font: 700 22px/1.32 var(--display); margin-top: 38px; }
.t-guide .body h3::before { content: counter(q); position: absolute; left: -54px; width: 40px; text-align: right; color: var(--accent); }
.t-guide .body h2 + h3 { margin-top: 18px; }
.t-guide .body p.difficulty { margin: -2px 0 8px; font-size: 14px; color: var(--ink-3); }
@media (max-width: 1180px) { .t-guide .body h3::before { position: static; display: inline-block; width: auto; margin-right: 10px; } }

/* ============================================================
   6. DCF: a script read aloud, and a model in blue and black.
   ============================================================ */
.t-script {
  --page: #ffffff; --ink: #16181d; --ink-2: #444852; --ink-3: #646a75; --rule: #e0e3e8;
  --accent: #1d4aa0; --input-blue: #0a3fd0; --radius: 3px;
  --body: "Schibsted Grotesk", Arial, sans-serif; --display: "Newsreader", Georgia, serif; --size: 17.5px;
}
.t-script header.site { border-bottom: 1px solid var(--rule); }
.t-script td { font-variant-numeric: lining-nums; }
.t-script .wordmark { font-family: var(--display); font-weight: 600; font-size: 21px; }
.t-script h1 { font-weight: 500; font-size: clamp(40px, 6.6vw, 68px); line-height: 1.02; letter-spacing: -0.02em; }
.t-script h2 { font-family: var(--display); font-weight: 600; font-size: 30px; }
.t-script .body blockquote { border-left: 3px solid var(--accent); padding: 2px 0 2px 22px; color: var(--ink); font: 400 22px/1.5 var(--display); max-width: 720px; }
.t-script .body blockquote p { margin: 0 0 12px; }
.t-script .body blockquote p:last-child { margin-bottom: 0; }

/* ============================================================
   Dark mode
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; }
  body[class] { --page: #141619; --panel: #1b1e23; --ink: #eceef2; --ink-2: #c6cad2; --ink-3: #9aa0ab; --rule: #33373f; --ok: #6fcf8f; --warn: #e6b450; --bad: #f08a8a; --accent-ink: #141619; --sheet-line: #3a3f48; --sheet-head: #20242a; }
  body.t-comps { --accent: #9bbcf2; --mast: #10213d; --highlight: #3a3418; }
  body.t-comps thead th { color: var(--ink); border-bottom-color: var(--ink-2); }
  body.t-comps .cta { border-top-color: var(--ink-2); }
  body.t-pad { --page: #121c16; --panel: #18241d; --rule: #2d4034; --accent: #8fd1a5; --pencil: #ef8a80; --grid: rgba(143, 209, 165, 0.07); --focus-bg: #22362a; }
  body.t-pad main .wrap, body.t-pad footer.site { background: #18241d; }
  body.t-pad header.site { background: #0e1712; }
  body.t-quotes { --accent: #d5a9e8; }
  body.t-agenda { --accent: #e88aa6; }
  body.t-agenda figure.agenda { border-color: var(--ink-2); }
  body.t-agenda figure.agenda figcaption { background: #5e1730; }
  body.t-guide { --accent: #8fd1ad; }
  body.t-script { --accent: #9db8ff; --input-blue: #9db8ff; }
  thead th { border-bottom-color: var(--ink-2); }
}
