@import url('katex/katex.min.css');
/* The 555, from Transistors · SECOND EDITION book stylesheet.
   Typography follows stodolny.org (Adobe Caslon Pro, deep-teal ink).
   Components follow the architecture of a Make:-style workbook:
   You-Will-Need lists, Fundamentals / Background / Theory sidebars,
   Caution boxes, numbered figures, and placeholder frames for art
   that is still to come. */

@font-face {
  font-family: 'Adobe Caslon Pro';
  src: url('fonts/ACaslonPro-Regular.woff2') format('woff2'),
       url('fonts/ACaslonPro-Regular.woff') format('woff');
  font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Adobe Caslon Pro';
  src: url('fonts/ACaslonPro-Italic.woff2') format('woff2'),
       url('fonts/ACaslonPro-Italic.woff') format('woff');
  font-weight: normal; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Adobe Caslon Pro';
  src: url('fonts/ACaslonPro-Bold.woff2') format('woff2'),
       url('fonts/ACaslonPro-Bold.woff') format('woff');
  font-weight: bold; font-style: normal; font-display: swap;
}

:root {
  --ink: #254a49;
  --paper: #ffffff;
  --link: #499491;
  --link-soft: #a3dec9;
  --muted: #6b8583;
  --rule: #dce8e6;
  --tint: #f3f8f7;
  --accent: #a04434;
  --accent-tint: #f9f1ef;
  --win: #2e6b4f;
  --win-tint: #eef5f0;
  --gold: #b5851f;
  --gold-tint: #faf5e9;
}

html { background: var(--paper); }
body {
  font-family: 'Adobe Caslon Pro', Georgia, serif;
  background: var(--paper); color: var(--ink);
  max-width: 47rem; margin: 0 auto; padding: 3rem 1.5rem 5rem;
  line-height: 1.55; font-size: 1.22rem;
  font-kerning: auto; font-feature-settings: 'kern', 'liga';
}

/* ---------- headings & title block ---------- */
h1 {
  font-weight: normal; font-variant: small-caps; text-align: center;
  font-size: 2.4rem; line-height: 1.1; margin: 0.3rem 0;
}
h2 {
  font-weight: bold; font-variant: small-caps; font-size: 1.45rem;
  margin-top: 2.8rem; border-top: 1px solid var(--rule); padding-top: 1.4rem;
}
h3 { font-weight: bold; font-size: 1.32rem; margin-bottom: 0.3rem; }
.kicker {
  color: var(--accent); font-size: 0.9rem; letter-spacing: 0.14em;
  text-transform: uppercase; text-align: center; margin-bottom: 0.1rem;
}
.kicker a { color: var(--muted); text-decoration: none; }
.kicker .seg { white-space: nowrap; }
.subtitle { color: var(--muted); font-style: italic; font-size: 1.2rem; margin: 0 0 1.6rem; text-align: center; }
.lead { font-size: 1.28rem; }
ul.phases { margin: 0.4rem 0 1.2rem; padding-left: 1.6rem; }
ul.phases li { margin: 0.2rem 0; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-soft); }

code, kbd {
  font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.8em;
  background: var(--tint); padding: 0.08em 0.35em; border-radius: 3px;
}
kbd { border: 1px solid var(--rule); border-bottom-width: 2px; background: #fff; }
pre {
  font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.8rem;
  background: var(--tint); border: 1px solid var(--rule); border-radius: 5px;
  padding: 0.9rem 1.1rem; overflow-x: auto; line-height: 1.5;
}
pre code { background: none; padding: 0; }

/* ---------- figures ---------- */
figure { margin: 2.2rem 0; text-align: center; }
figure img { max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 4px; }
figure video { max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); }
figure.plain img, figure.plain video, figure svg { border: none; }
figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.7rem; text-align: left; }
figcaption b:first-child, figcaption strong:first-child { color: var(--ink); font-variant: small-caps; }
figure.wide { overflow-x: auto; }
/* Three captures side by side for comparison, one per row on narrow screens. */
figure.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
figure.trio > div { margin: 0; }
figure.trio .trio-label { font-size: 0.88rem; color: var(--ink); margin: 0.35rem 0 0; text-align: left; line-height: 1.35; }
figure.trio figcaption { grid-column: 1 / -1; }
@media (max-width: 900px) { figure.trio { grid-template-columns: 1fr; } }

/* Disclosures are separate reading blocks, whether open or closed. */
details { margin: 1.2rem 0; }
summary { cursor: pointer; font-weight: bold; }
details[open] > summary { margin-bottom: 0.8rem; }

/* Placeholder frame for art still to come. The .ph-brief inside is the
   art direction: exactly what to draw or photograph. */
figure.placeholder .ph-box {
  border: 2px dashed var(--gold); border-radius: 6px; background: var(--gold-tint);
  padding: 1.4rem 1.6rem; text-align: left;
}
figure.placeholder .ph-tag {
  display: block; font-variant: small-caps; letter-spacing: 0.1em;
  color: var(--gold); font-weight: bold; margin-bottom: 0.4rem; font-size: 0.95rem;
}
figure.placeholder .ph-brief { margin: 0; font-size: 1.02rem; color: var(--ink); font-style: italic; }

/* ---------- set-off matter ----------
   Procedure and Caution stay in the body serif, with labels in the
   margin where space permits. You Will Need shares the highlight-block
   styling of Fundamentals, Background and Theory: sans-serif text,
   quiet tints, small label icons, and consistent spacing. */

/* -- register 1: instruction -- */
ol.steps { position: relative; margin: 2.2rem 0; }
ol.steps::before {
  display: block; font-variant: small-caps; font-weight: bold;
  letter-spacing: 0.1em; font-size: 0.95rem; line-height: 1.3;
  color: var(--ink); margin-bottom: 0.45rem;
}
ol.steps::before { content: 'Procedure'; }
/* Hang the label in the margin only where the margin is free. The label
   reaches 8.7rem left of the 47rem column, so the viewport must be at
   least 47rem + 2 x 8.7rem, about 1031px; below that it stays in the
   flow above its block. Below 1280px there is no contents rail; from
   1536px the rail sits far enough left (see .side-toc) to leave room.
   Between the two, the label stays in the flow. */
@media (min-width: 1040px) and (max-width: 1279px), (min-width: 1536px) {
  ol.steps::before {
    position: absolute; right: 100%; top: 0.35rem; width: 7.5rem;
    margin: 0 1.2rem 0 0; text-align: right;
  }
}
.youwillneed h3 { display: none; }
.youwillneed ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 2rem; }
.youwillneed li { margin: 0; break-inside: avoid; }
.youwillneed.checklist label {
  display: grid; grid-template-columns: 1.4rem 2.2rem 1fr; align-items: baseline;
  padding: 0.2rem 0; cursor: pointer;
}
.youwillneed input[type="checkbox"] { margin: 0.35em 0 0; align-self: start; accent-color: var(--link); }
.youwillneed .qty { font-variant-numeric: tabular-nums; }
.youwillneed input:checked ~ .item { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule); }
.youwillneed li em { color: var(--muted); }

/* ---------- resources: files to download, at the top of a chapter ---------- */
.resources h3 { display: none; }
.resources ul { margin: 0; padding: 0; list-style: none; }
.resources li {
  display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 1rem; align-items: baseline;
  padding: 0.45rem 0; border-top: 1px solid rgba(62, 99, 120, 0.15);
}
.resources li:first-child { border-top: 0; padding-top: 0.15rem; }
.resources .file { font-weight: bold; }
.resources .meta { color: var(--muted); white-space: nowrap; font-size: 0.85rem; }
.resources .desc { grid-column: 1 / -1; color: var(--muted); }
@media (max-width: 560px) { .resources li { grid-template-columns: 1fr; } .resources .meta { white-space: normal; } }

ol.steps { counter-reset: step; list-style: none; padding: 0; font-size: 1.05rem; }
ol.steps > li {
  counter-increment: step; position: relative;
  padding-left: 2rem; margin-bottom: 0.85rem;
}
ol.steps > li::before {
  content: counter(step) '.'; position: absolute; left: 0; top: 0;
  font-weight: bold; font-variant-numeric: tabular-nums;
}


/* -- shared highlight blocks -- */
.youwillneed, .resources, .fundamentals, .background, .theory, .caution {
  background: var(--sidebar-tint); padding: 1.3rem 1.6rem 1.2rem; margin: 2.4rem -1.6rem;
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.92rem; line-height: 1.55; color: var(--ink);
}
.caution {
  --sidebar-tint: #fbf3ef;
  --sidebar-accent: #9a4937;
  --sidebar-icon: url('icons/caution.svg');
}
.youwillneed {
  --sidebar-tint: #f5f4f8;
  --sidebar-accent: #665779;
  --sidebar-icon: url('icons/you-will-need.svg');
}
.resources {
  --sidebar-tint: #f1f5f8;
  --sidebar-accent: #3e6378;
  --sidebar-icon: url('icons/resources.svg');
}
.fundamentals {
  --sidebar-tint: #f3f8f7;
  --sidebar-accent: #326b60;
  --sidebar-icon: url('icons/fundamentals.svg');
}
.background {
  --sidebar-tint: #faf6ef;
  --sidebar-accent: #805c30;
  --sidebar-icon: url('icons/background.svg');
}
.theory {
  --sidebar-tint: #f3f5fa;
  --sidebar-accent: #4f6088;
  --sidebar-icon: url('icons/theory.svg');
}
.youwillneed::before, .resources::before, .fundamentals::before, .background::before, .theory::before, .caution::before {
  display: block; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: bold; color: var(--sidebar-accent); margin-bottom: 0.3rem;
  padding-left: 1.55rem; min-height: 1.1rem; line-height: 1.1rem;
  background: var(--sidebar-icon) no-repeat left center / 1rem 1rem;
}
.youwillneed::before { content: 'You will need'; }
.resources::before { content: 'Resources'; }
.fundamentals::before { content: 'Fundamentals'; }
.background::before { content: 'Background'; }
.theory::before { content: 'Theory'; }
.caution::before { content: 'Caution'; }
.youwillneed h4, .fundamentals h4, .background h4, .theory h4, .caution h4 {
  margin: 0 0 0.6rem; font-size: 1.15rem; font-weight: bold; line-height: 1.25;
}
.youwillneed p, .resources p, .fundamentals p, .background p, .theory p, .caution p { margin: 0 0 0.8rem; }
.youwillneed figure, .fundamentals figure, .background figure, .theory figure, .caution figure { margin: 1.2rem 0; }
.youwillneed figcaption, .fundamentals figcaption, .background figcaption, .theory figcaption, .caution figcaption { font-size: 0.85rem; }
.youwillneed code, .fundamentals code, .background code, .theory code, .caution code { background: var(--paper); }
/* Trim only the outside edge; preserve gaps between unlike content blocks. */
.youwillneed > :last-child, .fundamentals > :last-child, .background > :last-child, .theory > :last-child, .caution > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .youwillneed, .fundamentals, .background, .theory, .caution { margin-left: -1rem; margin-right: -1rem; padding: 1.1rem 1rem; }
  .youwillneed ul { columns: 1; }
}

/* ---------- tables ---------- */
table { border-collapse: collapse; margin: 1.4rem 0; font-size: 1rem; width: 100%; }
td, th { border: 1px solid var(--rule); padding: 0.5rem 0.8rem; text-align: left; vertical-align: top; }
th { background: var(--tint); font-weight: bold; }
.num { font-variant-numeric: tabular-nums; }
td.mouser a { white-space: nowrap; }

/* A numbered chain of reasoning, plain numbers, no Procedure label */
ol.chain { margin: 1.4rem 0; padding-left: 1.6rem; }
ol.chain > li { margin: 0.6rem 0; }

/* The running flaw list (generated by _meta/tools/flaws.py, Experiments 3 to 9) */
table.flaws { font-size: 0.95rem; }
table.flaws th { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
table.flaws th:first-child, table.flaws td:first-child { text-align: center; color: var(--muted); width: 1.6rem; }
table.flaws td:nth-child(2) { font-weight: bold; }
table.flaws td.meaning { color: var(--muted); font-size: 0.9rem; }
table.flaws tr.here td { background: var(--win-tint); }
table.flaws tr.new td { background: var(--gold-tint); }
table.flaws .badge {
  display: inline-block; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.68rem; font-weight: bold; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.12em 0.55em; border-radius: 999px; margin-right: 0.3em; vertical-align: 0.1em; white-space: nowrap;
}
table.flaws .badge.fixed { background: var(--win); color: #fff; }
table.flaws .badge.open { background: var(--gold); color: #fff; }
table.flaws .badge.new { background: var(--accent); color: #fff; }
/* Phones: one card per flaw instead of five narrow columns. The header row
   goes; the Found and Status cells carry their own labels. */
@media (max-width: 640px) {
  table.flaws, table.flaws tbody, table.flaws tr, table.flaws td { display: block; width: auto; }
  table.flaws { overflow: visible; }
  table.flaws tr:first-child { display: none; }
  table.flaws tr { border: 1px solid var(--rule); border-radius: 6px; padding: 0.7rem 0.9rem; margin: 0 0 0.8rem; }
  table.flaws tr.here { background: var(--win-tint); }
  table.flaws tr.new { background: var(--gold-tint); }
  table.flaws td, table.flaws tr.here td, table.flaws tr.new td { border: 0; padding: 0.2rem 0; background: none; }
  table.flaws td:first-child { display: inline; width: auto; text-align: left; margin-right: 0.5rem; }
  table.flaws td:nth-child(2) { display: inline; }
  table.flaws td.meaning { margin: 0.3rem 0 0.4rem; }
  table.flaws td:nth-child(4)::before, table.flaws td:nth-child(5)::before {
    color: var(--muted); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 0.5em;
  }
  table.flaws td:nth-child(4)::before { content: "Found"; }
  table.flaws td:nth-child(5)::before { content: "Status"; }
  table.flaws td:nth-child(4):has(.badge)::before { content: none; }
}

/* ---------- quick check (quiet quiz) ---------- */
.quickcheck { border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 0.5rem; }
.quickcheck h2 { border-top: none; margin-top: 1.2rem; padding-top: 0; }
.quickcheck .q { margin-bottom: 1.6rem; }
.quickcheck button {
  display: block; width: 100%; text-align: left; margin: 0.35rem 0;
  font-family: inherit; font-size: 0.98rem; padding: 0.5rem 0.9rem;
  background: #fff; border: 1px solid var(--rule); border-radius: 5px;
  cursor: pointer; color: var(--ink);
}
.quickcheck button:hover { border-color: var(--ink); }
.quickcheck button.right { background: var(--win-tint); border-color: var(--win); }
.quickcheck button.wrong { background: var(--accent-tint); border-color: var(--accent); }
.quickcheck .explain { display: none; font-size: 0.95rem; color: var(--muted); margin-top: 0.45rem; font-style: italic; }

/* ---------- navigation ---------- */
.btn {
  display: inline-block; background: var(--link); color: #fff;
  padding: 0.55rem 1.3rem; border-radius: 5px; text-decoration: none;
  font-size: 1rem; margin: 0.3rem 0.4rem 0.3rem 0;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn.ghost { background: none; color: var(--link); border: 1px solid var(--link); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); }

.booknav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3.5rem; border-top: 1px solid var(--rule); padding-top: 1.4rem;
  font-size: 1rem;
}
.booknav a { text-decoration: none; border: 1px solid var(--rule); border-radius: 6px; padding: 0.7rem 1rem; flex: 1; }
.booknav a:hover { border-color: var(--link); }
.booknav .dir { display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.booknav .next { text-align: right; }
.booknav a.next.is-next {
  border-color: var(--link); border-width: 2px; background: var(--tint); color: var(--link);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 18%, transparent);
}
.booknav a.next.is-next .dir { color: var(--link); }

.footer-note {
  margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1.2rem;
  font-size: 0.98rem; color: var(--muted);
}
footer.site {
  margin-top: 4rem; text-align: center; font-variant: small-caps;
  font-size: 0.85rem; color: var(--muted);
}
footer.site a { color: var(--muted); }

/* ---------- contents page ---------- */
.hero { margin: 2rem 0; }
.hero img { width: 100%; border: 1px solid var(--rule); border-radius: 6px; }
.contents-group { margin: 2.4rem 0 3rem; }
.contents-group h3 { font-size: 1.5rem; font-weight: normal; margin: 0; line-height: 1.25; }
.contents-stage {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 0.35rem;
}
.contents-summary { font-size: 1rem; margin: 0.35rem 0 1rem; }
ol.contents, ul.contents { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.contents li { margin: 0; border-bottom: 1px solid var(--rule); }
.contents a {
  display: flex; align-items: baseline; gap: 1rem; position: relative;
  padding: 0.85rem 1.5rem 0.85rem 0.5rem; text-decoration: none; color: var(--ink);
}
.contents a:hover { background: var(--tint); color: var(--ink); }
.contents a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.contents-number {
  flex: 0 0 1.8rem; font-variant-numeric: tabular-nums;
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.75rem; color: var(--muted);
}
.contents-entry { min-width: 0; }
.contents-title { display: block; font-size: 1.15rem; line-height: 1.3; }
.contents .blurb {
  display: block; margin-top: 0.2rem; font-size: 0.88rem; line-height: 1.5;
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #526d6b;
}
.contents a.done::after { position: absolute; right: 0.35rem; top: 0.85rem; }
@media (max-width: 640px) {
  .contents a { gap: 0.6rem; }
  .contents-number { flex-basis: 1.4rem; }
}

/* Guard against horizontal overflow on narrow screens: long code tokens
   break, wide tables scroll within themselves instead of widening the page. */
body { overflow-wrap: break-word; }
code { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  table { display: block; overflow-x: auto; max-width: 100%; }
}
@media (max-width: 640px) {
  body { padding: 1.5rem 1rem 3rem; font-size: 1.05rem; }
  h1 { font-size: 1.8rem; }
  .booknav { flex-direction: column; }
  .booknav .next { text-align: left; }
}
@media print {
  body { max-width: none; font-size: 10.5pt; }
  .booknav, .quickcheck button { display: none; }
}

/* ---- contents rail (built by book-nav.js): drawer on narrow screens,
   gutter rail on wide; matches the single-document edition's rail ---- */
.side-toc {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
  width: min(82vw, 19rem); background: var(--paper);
  transform: translateX(-105%); transition: transform 0.25s ease;
  overflow-y: auto; overscroll-behavior: contain;
  font-size: 0.92rem; line-height: 1.4; padding: 1rem 0.9rem 2rem 0.4rem;
  scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}
.side-toc.open { transform: translateX(0); box-shadow: 0 0 30px rgba(37,74,73,0.25); }
.side-toc a {
  display: block; color: var(--muted); text-decoration: none;
  padding: 0.22rem 0.55rem; border-left: 2px solid var(--rule);
}
.side-toc a:hover { color: var(--ink); }
.side-toc a.active { color: var(--link); border-left-color: var(--link); background: var(--tint); }
.side-toc .toc-title {
  font-variant: small-caps; font-size: 1.05rem; color: var(--ink);
  border-left: none; padding-left: 0.57rem; margin-bottom: 0.55rem;
}
.side-toc .toc-stage {
  font-variant: small-caps; letter-spacing: 0.05em; font-weight: bold;
  font-size: 0.85rem; color: var(--accent);
  margin: 0.9rem 0 0.15rem; padding-left: 0.57rem;
}
.side-toc .n { display: inline-block; min-width: 1.25rem; font-variant-numeric: tabular-nums; color: var(--link); }
.side-toc a.done::after { content: " ✓"; color: var(--link); font-weight: bold; }
.toc-scrim {
  position: fixed; inset: 0; z-index: 40; background: rgba(37,74,73,0.35);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.toc-scrim.open { opacity: 1; pointer-events: auto; }
.toc-toggle {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  width: 3.1rem; height: 3.1rem; border-radius: 50%;
  background: var(--link); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 2px 10px rgba(37,74,73,0.35);
  display: flex; align-items: center; justify-content: center;
}
.toc-toggle:hover { background: var(--ink); }
html.toc-locked, html.toc-locked body { overflow: hidden; }
@media (min-width: 1280px) {
  .side-toc {
    top: 1.5rem; bottom: 1.5rem; left: max(0.75rem, calc(50vw - 48rem));
    width: 14.5rem; transform: none; transition: none;
    box-shadow: none; background: transparent; z-index: auto;
    font-size: 0.82rem; line-height: 1.35; padding: 0.25rem 0.6rem 1rem 0;
  }
  .side-toc a { padding: 0.16rem 0.55rem; }
  .side-toc .toc-title { font-size: 0.95rem; }
  .side-toc .toc-stage { font-size: 0.78rem; }
  .side-toc .n { min-width: 1.15rem; }
  .toc-toggle, .toc-scrim { display: none; }
}

/* ---- reading progress (localStorage, reader's browser only) ---- */
.progress-mark { text-align: center; margin: 2.4rem 0 0; }
.progress-mark button {
  font: inherit; font-size: 0.95rem; cursor: pointer;
  color: var(--link); background: var(--tint);
  border: 1px solid var(--rule); border-radius: 5px; padding: 0.5rem 1.1rem;
}
.progress-mark button:hover { border-color: var(--link); }
.progress-mark button.is-done { color: var(--muted); background: var(--paper); }
ol.contents a.done::after, ul.contents a.done::after { content: " ✓"; color: var(--link); font-weight: bold; }
.progress-summary { color: var(--muted); font-style: italic; }
@media print { .side-toc, .toc-toggle, .toc-scrim, .progress-mark { display: none; } }

/* ---------- equipment checklist ---------- */
.checklist h3 { margin: 1.3rem 0 0.3rem; }
.checklist label { display: block; padding: 0.28rem 0; cursor: pointer; }
.checklist input[type="checkbox"] { margin-right: 0.55rem; accent-color: var(--link); }
.checklist input:checked + span { color: var(--muted); }

/* ---------- equations (KaTeX, rendered at authoring time by _meta/tools/katex/render.mjs) ---------- */
.tex .katex { font-size: 1.08em; }
div.tex { margin: 1.2rem 0; }
div.tex .katex-display { margin: 0; overflow-x: auto; overflow-y: hidden; padding: 0.5em 0; }
div.tex .katex-display > .katex { white-space: nowrap; }

/* ---------- proof accordion ---------- */
details.proof {
  border: 1px solid var(--rule); border-radius: 5px; margin: 1.2rem 0; padding: 0 1.2rem;
  background: var(--paper); font-family: 'Adobe Caslon Pro', Georgia, serif; font-size: 1.05rem; line-height: 1.6;
}
details.proof summary {
  cursor: pointer; padding: 0.7rem 0; font-weight: bold; color: var(--accent); list-style: none;
}
details.proof summary::before { content: '▸ '; display: inline-block; width: 1.1em; }
details.proof[open] summary::before { content: '▾ '; }
details.proof summary::-webkit-details-marker { display: none; }
details.proof[open] summary { border-bottom: 1px solid var(--rule); margin-bottom: 0.8rem; }
details.proof > p:last-child { margin-bottom: 1rem; }
details.proof summary .tag {
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.68rem; font-weight: bold; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--rule); border-radius: 3px;
  padding: 0.1em 0.45em; margin-left: 0.6em; vertical-align: middle;
}
