:root {
  --bg: #fdfcf8; --fg: #1d1c1a; --muted: #5f5b53; --line: #ddd8cc; --accent: #7a2e1d; --accent-2: #2b5d8a;
  --panel: #f4f1e9; --mark: #fff3c4; --notice: #fbf3e2; --notice-line: #d9b56b; --link: #234f7a;
  --font-text: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181a; --fg: #e6e2d8; --muted: #a8a294; --line: #3a3a38; --accent: #e09a7f; --accent-2: #8bb8e0;
    --panel: #212224; --mark: #4a3f17; --notice: #2a2519; --notice-line: #8a6d2c; --link: #9cc4ec;
  }
}
:root[data-theme="dark"] {
  --bg: #17181a; --fg: #e6e2d8; --muted: #a8a294; --line: #3a3a38; --accent: #e09a7f; --accent-2: #8bb8e0;
  --panel: #212224; --mark: #4a3f17; --notice: #2a2519; --notice-line: #8a6d2c; --link: #9cc4ec;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.55 var(--font-text); overflow-x: hidden; }
a { color: var(--link); }
header.top { position: sticky; top: 0; z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line);
  font-family: var(--font-ui); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 16px; }
header.top .site { font-weight: 600; color: var(--fg); text-decoration: none; }
nav.crumbs { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav.crumbs a { color: var(--muted); text-decoration: none; }
nav.crumbs a:hover { text-decoration: underline; }
nav.crumbs .sep { color: var(--muted); margin: 0 4px; }
form.refbox { display: flex; gap: 4px; }
form.refbox input { width: 15em; max-width: 46vw; font: inherit; padding: 3px 6px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 4px; }
form.refbox button, .tools button, .tools select { font: inherit; padding: 3px 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 4px; cursor: pointer; }
.tools { display: flex; gap: 6px; align-items: center; }
.refmsg { color: var(--accent); font-size: 13px; }
.status { font-family: var(--font-ui); font-size: 13px; color: var(--muted); padding: 6px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.status a { color: inherit; }
.layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 0 4.5rem; max-width: 76rem; margin: 0 auto; padding: 0 16px; }
aside.toc { position: sticky; top: 90px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; font-family: var(--font-ui);
  font-size: 13px; padding: 16px 0; border-right: 1px solid var(--line); padding-right: 12px; }
aside.toc ol { list-style: none; margin: 0; padding: 0 0 0 10px; }
aside.toc > ol { padding-left: 0; }
aside.toc li { margin: 1px 0; }
aside.toc a { color: var(--fg); text-decoration: none; }
aside.toc a:hover { text-decoration: underline; }
aside.toc details > summary { cursor: pointer; }
aside.toc .k { color: var(--muted); }
main.text { min-width: 0; padding: 16px 0 48px; max-width: 46rem; position: relative; }
main.text h1 { font-size: 1.6rem; line-height: 1.25; margin: .6em 0 .2em; }
main.text .byline { color: var(--muted); margin: 0 0 1.2em; }
main.text p { margin: .5em 0; hyphens: auto; }
section.item { position: relative; scroll-margin-top: 100px; }
section.item:target, .anc:target + *, .eqn:target { background: var(--mark); }
section.item:target { box-shadow: -10px 0 0 var(--mark); }
section.item.sec1 > p:first-of-type, section.item.sec1 > h1, section.item.sec1 > h2, section.item.sec1 > h3 { font-weight: 600; margin-top: 1.4em; font-size: 1.05em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.itemtools { position: absolute; left: -4.2rem; width: 3.8rem; top: .15em; font-family: var(--font-ui); font-size: 11px; display: flex; flex-direction: row; justify-content: flex-end; align-items: baseline; gap: 5px; }
.itemtools .cite { visibility: hidden; }
section.item:hover > .itemtools .cite, section.item:focus-within > .itemtools .cite { visibility: visible; }
.itemtools .permalink { opacity: .5; }
.itemtools a, .itemtools button { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.itemtools .citedby { color: var(--accent-2); }
/* 30 Nov 2026 (07d_papers.py): the papers of ours that cite the statement */
.ourpapers { margin: .35em 0 .8em; font-family: var(--font-ui); font-size: 12px; color: var(--muted); }
.ourpapers a { color: var(--accent-2); text-decoration: none; }
.ourpapers a:hover { text-decoration: underline; }
.stacks-cited { font-family: var(--font-ui); font-size: 13px; line-height: 1.5; color: var(--muted); margin: .4em 0 0; }
.stacks-cited a.official { font-size: 12px; color: var(--muted); }
.stacks-unit { margin: .2em 0 1em; }
a.pb { position: absolute; right: -4.4rem; font-family: var(--font-ui); font-size: 11px; color: var(--muted); text-decoration: none; white-space: nowrap; }
span.pb-inline { font-family: var(--font-ui); font-size: 11px; color: var(--muted); }
a.ref { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--link) 35%, transparent); }
a.ref:hover { border-bottom-color: var(--link); }
a.ref[data-level="unit"] { border-bottom-style: dotted; }
a.ref[data-level="work"], a.ref[data-level="external"] { border-bottom-style: dashed; }
.cite-plain { }
span.corr { border-bottom: 1px dotted var(--notice-line); }
.math.display { display: block; overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.eqn { display: flex; align-items: center; gap: 1em; scroll-margin-top: 100px; }
.eqn > .math.display { flex: 1 1 auto; min-width: 0; }
.eqnos { font-size: .95em; white-space: nowrap; order: -1; }
figure.diagram { margin: 1em 0; overflow-x: auto; scroll-margin-top: 100px; display: flex; align-items: center; gap: 1em; }
figure.diagram img { max-width: none; height: auto; display: block; margin: 0 auto; }
figure.diagram figcaption { order: -1; white-space: nowrap; font-size: .95em; }
:root[data-theme="dark"] figure.diagram img { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) figure.diagram img { filter: invert(1) hue-rotate(180deg); } }
/* 29 Nov 2026: a diagram drawn inside a statement or list item, set as figure.diagram is */
.diagram-inline { display: flex; align-items: center; gap: 1em; margin: .8em 0; overflow-x: auto; scroll-margin-top: 100px; text-indent: 0; }
.diagram-inline img { max-width: none; height: auto; display: block; margin: 0 auto; }
.diagram-inline .dg-label { order: -1; white-space: nowrap; font-size: .95em; }
:root[data-theme="dark"] .diagram-inline img { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .diagram-inline img { filter: invert(1) hue-rotate(180deg); } }
p.li { padding-left: 2.2em; text-indent: -2.2em; }
p.li.d2 { padding-left: 4.4em; } p.li.d3 { padding-left: 6.6em; }
.li-label { display: inline-block; min-width: 2em; }
p.toc-line a { color: var(--fg); }
.footnotes { font-size: .9em; border-top: 1px solid var(--line); margin-top: 2em; }
.notice { background: var(--notice); border: 1px solid var(--notice-line); border-radius: 6px; padding: 12px 14px; margin: 16px 0; font-family: var(--font-ui); font-size: 15px; }
footer.bottom { border-top: 1px solid var(--line); margin-top: 32px; padding: 16px; font-family: var(--font-ui); font-size: 13px; color: var(--muted); }
footer.bottom .rights { max-width: 60rem; }
footer.bottom .nav { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.popup { position: absolute; z-index: 40; max-width: min(36rem, calc(100vw - 32px)); max-height: 60vh; overflow: auto; background: var(--bg);
  color: var(--fg); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 10px 14px; font-size: 15px; }
.popup .ph { font-family: var(--font-ui); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.popup input { width: 100%; font: 13px var(--font-ui); margin: 2px 0 6px; }
table.state { border-collapse: collapse; font-family: var(--font-ui); font-size: 13px; margin: 8px 0 16px; }
table.state th, table.state td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.wrapx { overflow-x: auto; max-width: 100%; }
.st-text { color: #2f6b2f; } .st-stub { color: var(--muted); } .st-external { color: var(--accent-2); } .st-partial { color: #9a6a00; }
.page { max-width: 60rem; margin: 0 auto; padding: 16px; }
.page h1 { font-size: 1.7rem; }
.langs a { margin-right: 12px; }
.drawer-btn { display: none; }
@media (max-width: 900px) {
  .layout { display: block; padding: 0 16px; }
  aside.toc { display: none; position: fixed; inset: 0 auto 0 0; top: 0; width: min(85vw, 22rem); max-height: none; height: 100vh; z-index: 50;
    background: var(--panel); padding: 16px; border-right: 1px solid var(--line); }
  aside.toc.open { display: block; }
  .drawer-btn { display: inline-block; }
  header.top { position: static; }
  section.item, .eqn, figure.diagram { scroll-margin-top: 8px; }
  .itemtools { position: static; width: auto; justify-content: flex-start; gap: 10px; }
  .itemtools .cite { visibility: visible; }
  a.pb { position: static; display: block; text-align: right; }
  form.refbox input { width: 10em; }
  body { font-size: 16px; }
}

/* the search interface in the site's colours: Pagefind's defaults (#393939 text, a white field) are unreadable on
   the dark theme (30 Nov 2026) */
#search .pagefind-ui { --pagefind-ui-primary: var(--link); --pagefind-ui-text: var(--fg); --pagefind-ui-background: var(--bg);
  --pagefind-ui-border: var(--line); --pagefind-ui-tag: var(--panel); }
/* the mark at a text page's page mark that opens the AI-written companion's commentary on that page (W5 step 8, D4;
   30 Nov 2026): a label after the mark, never the commentary itself */
.cmark { font-family: var(--font-ui); font-size: 11px; color: var(--link); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.cmark:hover, .cmark:focus { text-decoration: underline; }
