
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body { margin: 0; }
img { max-width: 100%; }

  :root {
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --paper: #f7f6f3;
    --card: #ffffff;
    --ink: #1b1d21;
    --ink-soft: #55595f;
    --ink-faint: #85898f;
    --rule: #e0ddd6;
    --accent: #9a4a1f;          /* burnt sienna: the reconstruction's orange, taken down to an ink */
    --accent-soft: #f3e6dd;
    --panel: #0e1013;           /* the viewer's own ground, so swatches read true */
    --panel-ink: #d8dade;
    --ok: #2f6b3f;
    --warn: #8a5a00;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper: #131417;
      --card: #191b1f;
      --ink: #e8e6e1;
      --ink-soft: #a9adb4;
      --ink-faint: #7d818a;
      --rule: #2b2e34;
      --accent: #e08a4c;
      --accent-soft: #2a211a;
      --panel: #0a0b0d;
      --panel-ink: #d8dade;
      --ok: #7ec08c;
      --warn: #d8ab5a;
    }
  }
  :root[data-theme="dark"] {
    --paper: #131417;
    --card: #191b1f;
    --ink: #e8e6e1;
    --ink-soft: #a9adb4;
    --ink-faint: #7d818a;
    --rule: #2b2e34;
    --accent: #e08a4c;
    --accent-soft: #2a211a;
    --panel: #0a0b0d;
    --panel-ink: #d8dade;
    --ok: #7ec08c;
    --warn: #d8ab5a;
  }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  .wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; padding-block: 0 72px; }

  header.masthead { border-bottom: 2px solid var(--ink); padding-block: 40px 18px; margin-bottom: 8px; }
  .eyebrow {
    font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em;
    text-transform: uppercase; color: var(--accent);
  }
  h1 {
    font-family: var(--serif); font-weight: 600; font-size: clamp(2.1rem, 5.5vw, 3.2rem);
    line-height: 1.05; margin: 10px 0 12px; text-wrap: balance; letter-spacing: -0.01em;
  }
  .standfirst { font-size: 1.12rem; color: var(--ink-soft); max-width: 62ch; }
  .standfirst a { color: var(--accent); }

  .cols { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 46px; align-items: start; }
  /* minmax(0, 1fr), not 1fr: a bare `1fr` is minmax(auto, 1fr), so the column refused to shrink below its widest
     table and the whole page scrolled sideways on anything narrower than 860 px — the desktop rule above already
     said minmax(0, 1fr) and only this one did not. */
  @media (max-width: 860px) { .cols { grid-template-columns: minmax(0, 1fr); gap: 24px; } nav.toc { position: static !important; } }

  /* A sticky list taller than the window cannot be scrolled: everything below the fold was unreachable, which on
     RESULTS was most of 366 sections (docs-audit A2). It scrolls on its own now. */
  nav.toc { position: sticky; top: 18px; font-size: 14px; border-left: 2px solid var(--rule); padding-left: 14px;
            max-height: calc(100vh - 36px); overflow-y: auto; overscroll-behavior: contain; }
  nav.toc input[type=search] { width: 100%; box-sizing: border-box; margin: 4px 0 8px; padding: 6px 8px;
            font: inherit; font-size: 13px; border: 1px solid var(--rule); border-radius: 4px;
            background: transparent; color: inherit; }
  nav.toc input[type=search]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  nav.toc a { display: block; color: var(--ink-soft); text-decoration: none; padding: 3px 0; }
  nav.toc a:hover { color: var(--accent); }
  nav.toc .grp {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-faint); margin-top: 14px;
  }

  section { padding-block: 26px 4px; scroll-margin-top: 16px; }
  h2 {
    font-family: var(--serif); font-weight: 600; font-size: 1.62rem; margin: 0 0 6px;
    text-wrap: balance;
  }
  h2 .num {
    font-family: var(--mono); font-size: .78rem; color: var(--accent); margin-right: 10px;
    vertical-align: 3px;
  }
  h3 { font-family: var(--serif); font-weight: 600; font-size: 1.16rem; margin: 22px 0 4px; }
  p { margin: 8px 0; max-width: 68ch; }
  ul, ol { margin: 8px 0; padding-left: 20px; max-width: 68ch; }
  li { margin: 5px 0; }
  a { color: var(--accent); }
  strong { font-weight: 600; }
  code, kbd {
    font-family: var(--mono); font-size: .86em;
  }
  code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
  kbd {
    border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
    background: var(--card); font-size: .8em; white-space: nowrap;
  }

  .tool { border-top: 1px solid var(--rule); padding-block: 16px 4px; }
  .tool:first-of-type { border-top: 0; }
  .tool h3 { margin-top: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .tool h3 .btn {
    font-family: var(--mono); font-size: .76rem; font-weight: 400;
    border: 1px solid var(--rule); border-radius: 6px; padding: 2px 8px; background: var(--card); color: var(--ink-soft);
  }
  .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 30px; }
  .lab {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink-faint); display: block; margin-top: 8px;
  }
  .limit { color: var(--warn); }
  .limit .lab { color: var(--warn); opacity: .75; }

  .legend { background: var(--panel); color: var(--panel-ink); border-radius: 10px; padding: 18px 20px; margin: 14px 0; }
  .legend h3 { color: #fff; margin-top: 0; }
  .legend ul { list-style: none; padding: 0; max-width: none; }
  .legend li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid #1e2127; }
  .legend li:last-child { border-bottom: 0; }
  .sw { width: 26px; height: 3px; border-radius: 2px; flex: none; transform: translateY(-3px); }
  .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; transform: translateY(1px); margin-left: 9px; }
  .legend .what { color: #f0f1f3; font-weight: 600; }
  .legend .who { color: #9aa1ab; }

  table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 10px 0; }
  th, td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
  th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 400; }
  td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 14px; }
  .scroll { overflow-x: auto; }

  .note {
    border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 8px 8px 0;
    margin: 14px 0; max-width: 68ch;
  }
  .note p:first-child { margin-top: 0; } .note p:last-child { margin-bottom: 0; }

  .steps { counter-reset: s; list-style: none; padding-left: 0; }
  .steps li { counter-increment: s; position: relative; padding-left: 38px; margin: 10px 0; }
  .steps li::before {
    content: counter(s); position: absolute; left: 0; top: 1px;
    font-family: var(--mono); font-size: 12px; color: var(--accent);
    border: 1px solid var(--accent); border-radius: 50%; width: 22px; height: 22px;
    display: grid; place-items: center;
  }
  footer { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--ink-faint); font-size: 14px; }

  .backbar {
    position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 8px 20px; font-size: 14px;
  }
  .backbar a { color: var(--accent); text-decoration: none; font-family: var(--mono); font-size: 12.5px; }
  .backbar a:hover { text-decoration: underline; }
  /* The site search (viz/sitesearch.py): one box in every top bar, a dropdown of results as you type. */
  .gsearch { float: right; position: relative; margin: -3px 0 -3px 12px; }
  .gsearch input { font: 13px var(--sans); width: 17em; max-width: 46vw; padding: 4px 8px; border: 1px solid var(--rule);
    border-radius: 6px; background: var(--card); color: var(--ink); }
  .gsearch input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
  .gsearch.busy input { background-image: linear-gradient(90deg, var(--accent-soft), var(--card)); }
  .gsearch ul { position: absolute; right: 0; top: calc(100% + 4px); width: min(34em, 92vw); max-height: 70vh;
    overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; background: var(--card); color: var(--ink);
    border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); z-index: 20;
    font: 13px/1.35 var(--sans); }
  .gsearch li[role=option] { padding: 6px 12px; cursor: pointer; }
  .gsearch li[role=option].on, .gsearch li[role=option]:hover { background: var(--accent-soft); }
  .gsearch .gshead { padding: 7px 12px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ink-faint); }
  .gsearch .gst { font-weight: 600; }
  .gsearch .gssec { color: var(--ink-soft); }
  .gsearch .gssn { display: block; color: var(--ink-soft); font-size: 12.5px; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .gsearch .gssn b { color: var(--ink); }
  .gsearch .gsall { border-top: 1px solid var(--rule); color: var(--accent); }
  .gsearch .gsnone { padding: 8px 12px; color: var(--ink-faint); }
  @media (pointer: coarse) { .gsearch li[role=option] { padding: 11px 12px; } }
  @media (max-width: 640px) { .gsearch { float: none; margin: 0 0 6px; } .gsearch input { width: 100%; max-width: none; } }

/* --- documentation pages (rendered from the repository's markdown) --- */
.doc h1 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 4.6vw, 2.6rem); line-height: 1.1;
  margin: 24px 0 14px; text-wrap: balance;
}
.doc h2 { border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 30px; }
.doc h3 { margin-top: 20px; }
.doc table { font-size: 14.5px; }
/* Wide tables scroll inside this box rather than widening the page. */
.doc .tablewrap { overflow-x: auto; max-width: 100%; }
.doc .tablewrap table { margin: 0; }
.doc th { white-space: nowrap; }
.doc pre {
  background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px;
  overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
}
.doc pre code { background: none; padding: 0; }
/* An S3 path or a filename in running text is one unbreakable word; on a phone it pushed the page 170 px sideways.
   Inline code may wrap anywhere it has to. Code BLOCKS keep their lines and scroll instead. */
.doc :not(pre) > code { overflow-wrap: anywhere; }
/* Running text and headings break a word only when it cannot fit (a RESULTS heading carried a 60-character
   UNDERSCORE_VERDICT token and pushed /docs/results 57 px sideways at 400 px, 2026-11-11). */
.doc p, .doc li, .doc dd, .doc blockquote, .doc h1, .doc h2, .doc h3, .doc h4 { overflow-wrap: anywhere; }
/* The same path written WITHOUT backticks is plain text (RESULTS: "per-site rows scratchpad/lf2/existence/
   existence_{653980,648434,685222}.json" pushed /docs/results 101 px sideways at 400 px). Prose blocks break such a
   word only when it would overflow; break-word, unlike anywhere, leaves table min-content sizing alone. */
.doc p, .doc li, .doc blockquote, .doc dd { overflow-wrap: break-word; }
.doc blockquote {
  border-left: 3px solid var(--rule); margin: 12px 0; padding: 2px 0 2px 14px; color: var(--ink-soft);
}
.doc hr { border: 0; border-top: 1px solid var(--rule); margin: 26px 0; }
.doc img { max-width: 100%; }
.doc > footer { margin-top: 40px; }
nav.toc a.here { color: var(--accent); font-weight: 600; }
.backbar .lvl {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}
.backbar .src { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.index .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 12px 0 26px; }
.index .card {
  display: block; text-decoration: none; color: var(--ink); background: var(--card);
  border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px;
}
.index .card:hover { border-color: var(--accent); }
.index .card .t { display: block; font-family: var(--serif); font-size: 1.14rem; font-weight: 600; }
.index .card .b { display: block; color: var(--ink-soft); font-size: 14.5px; margin-top: 4px; }
.index .card .f { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); margin-top: 8px; }
.index h2 { border-top: 1px solid var(--rule); padding-top: 16px; }
