/* memoria's own styles.
 *
 * Every colour is a token. Not one literal appears here, so the
 * reader's light/dark choice resolves through theme.css and a passage
 * never paints against the wrong ground. Sheets enforces the same rule
 * with a test; memoria's equivalent is TestNoColourLiteralsInAppCSS.
 */

/* A stable gutter, so the scrollbar arriving between a short page (sign
 * in) and a long one does not shift everything sideways. */
html { scrollbar-gutter: stable; }

/* The column is rastrillo's [rst-page] (tokens.css), 64rem and padded on
 * the scale. Memoria narrowed it to 46rem once, which on a desktop left
 * results and the documents table cramped in the middle of the screen and
 * wrapped dates over four lines (Paul, 2026-10-26); it then restated the
 * column here with 4rem under it, off the scale, so it now takes Fiesta's.
 *
 * <main> is a stack (layout.html, Fiesta's "The stack"): every page's own
 * blocks are spaced by one table and by nothing else, so the rules below
 * set no margin between a page's blocks. A region that holds blocks of
 * its own is a stack too. */

/* The header is estilo's bar (chrome.css) and is not styled here. The
 * footer is exactly the column's width — [rst-page]'s 64rem less its 1rem
 * gutters — so its rule and its text start on the same line as every
 * heading and rule above it (they sat 16px to the left, polish audit
 * §B6). */
[rst-page-footer] {
  border-top: 1px solid var(--rst-line);
  box-sizing: border-box;
  margin: var(--rst-sp-6) auto 0;
  padding: var(--rst-sp-4) 0 var(--rst-sp-6);
  width: min(62rem, 100% - 2rem);
}
[rst-inline] { display: inline; }

/* Muted text. An attribute this app owns, because the design system's
 * muted utility is a class, `.rst-cell-mut`, and spelled as an attribute
 * — as every template here did, nineteen times — it styled nothing: the
 * footer, table cells, result meta and every hint rendered at full body
 * colour. The class is wrong for a sentence anyway (nowrap and an
 * ellipsis, written for a table cell), so this is colour only. */
[rst-muted] { color: var(--rst-text-muted); }

/* The search form is rastrillo's [rst-search] field box (tokens.css): the
 * border, radius and focus ring are the FORM's, and the input inside it
 * is transparent. This file used to draw a second bordered box on the
 * input, inside the first — the double border (polish audit §B3). Only
 * the spacing below it is Memoria's. */
/* The button sits inside the box with the same inset on every side
   (Paul, 2026-10-31: "Button placement is off"). On a touch screen
   rastrillo sets the box to the tap height with no vertical padding and
   the button to the same tap height, so the button filled the box edge
   to edge; a small even padding gives it room. One step, at every width:
   it was 0.3rem on a desktop and 0.25rem on a phone, the scale's
   --rst-sp-1 and a hand-typed near miss of it. The space under the box is
   the stack's. */
[rst-search] { padding: var(--rst-sp-1) var(--rst-sp-1) var(--rst-sp-1) var(--rst-sp-3); }
[rst-search-clear][hidden] { display: none; }

/* The front page with nothing searched (Paul, 2026-10-29): the wordmark
   and the box a third of the way down, and a quiet line under it. Live
   results grow below without moving the box. A page loaded with a query
   has no [rst-home] and starts at the top. On a phone the box sits
   higher, so the keyboard does not cover the results as they arrive. */
/* The typeahead (Paul, 2026-10-29): a list under the box, over the page,
   never pushing it. */
[rst-suggest] { position: relative; }
[rst-suggest-box] {
  position: absolute;
  top: calc(100% - 0.75rem);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--rst-surface);
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius);
  box-shadow: var(--rst-shadow-pop);
  overflow: hidden;
}
[rst-suggest-box][hidden] { display: none; }
[rst-suggest-list] { list-style: none; margin: 0; padding: var(--rst-sp-1) 0; }
[rst-suggest-item] {
  display: flex;
  align-items: baseline;
  gap: var(--rst-sp-2);
  padding: var(--rst-sp-2) var(--rst-sp-4);
  color: var(--rst-text);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
[rst-suggest-item]:hover,
[rst-suggest-item][rst-suggest-active] { background: var(--rst-accent-soft); }
[rst-suggest-title] { font-weight: 550; }
/* The answer row wraps rather than clip: on a phone the number and the
   document's name do not fit on one line. */
[rst-suggest-fact-row] { align-items: center; display: flex; border-bottom: 1px solid var(--rst-line); }
[rst-suggest-fact-row] [rst-suggest-item] { flex: 1; min-width: 0; border-bottom: 0; }
[rst-suggest-copy] {
  background: var(--rst-surface);
  border: 1px solid var(--rst-line);
  border-radius: 999px;
  color: var(--rst-text-muted);
  cursor: pointer;
  flex: none;
  font: inherit;
  font-size: 0.8125rem;
  margin-right: var(--rst-sp-3);
  padding: var(--rst-sp-1) var(--rst-sp-3);
}
[rst-suggest-copy]:hover { border-color: var(--rst-accent); color: var(--rst-accent-strong); }
[rst-suggest-copy][hidden] { display: none; }
[rst-suggest-fact] {
  border-bottom: 1px solid var(--rst-line);
  padding-block: var(--rst-sp-3);
  flex-wrap: wrap;
  white-space: normal;
  row-gap: var(--rst-sp-1);
}
[rst-suggest-fact] strong { font-size: 1.125rem; }
[rst-suggest-fact-label] { color: var(--rst-text-muted); font-size: 0.875rem; }
[rst-suggest-all] { color: var(--rst-text-muted); font-size: 0.875rem; justify-content: space-between; }
[rst-suggest-notice] { color: var(--rst-text-muted); font-size: 0.8125rem; padding: var(--rst-sp-2) var(--rst-sp-4); }

/* The box's middle on the screen's middle: the page's top padding is
   half the screen less the bar, the main area's own padding and half the
   box. The lists below it grow downwards and never move it. */
[rst-home] {
  /* spacing-allow: centres the search box on the screen; it is geometry, not rhythm */
  padding-top: max(1rem, calc(50svh - 9.5rem));
  min-height: 70svh;
}
[rst-home-notice] { font-size: 0.8125rem; }
[rst-home-try] {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.875rem;
  gap: var(--rst-sp-2);
}
[rst-home-chip] {
  background: var(--rst-surface);
  border: 1px solid var(--rst-line);
  border-radius: 999px;
  color: var(--rst-text);
  padding: var(--rst-sp-1) var(--rst-sp-3);
  text-decoration: none;
}
[rst-home-chip]:hover { border-color: var(--rst-accent); color: var(--rst-accent-strong); }
[rst-home-lists] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--rst-sp-5) var(--rst-sp-6);
}
[rst-home-lists] [hidden] { display: none; }
[rst-home-label] {
  align-items: center;
  color: var(--rst-text-muted);
  display: flex;
  font-size: 0.75rem;
  font-weight: 600;
  justify-content: space-between;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
[rst-home-clear] {
  background: none;
  border: 0;
  color: var(--rst-text-muted);
  cursor: pointer;
  font: inherit;
  letter-spacing: normal;
  padding: 0;
  text-decoration: underline;
  text-transform: none;
}
[rst-home-clear]:hover { color: var(--rst-text); }
[rst-home-list] { list-style: none; margin: 0; padding: 0; }
/* The front page's lists are rastrillo's list rows; a little tighter
   than its default, as a secondary part of a page. */
[rst-home-list] [rst-row] { padding: var(--rst-sp-2); margin: 0 calc(-1 * var(--rst-sp-2)); border-radius: 0.375rem; border-top: 0; border-bottom: 1px solid var(--rst-line); }
[rst-home-list] [rst-row-main] > a { font-weight: 500; }
[rst-home-list] [rst-row-main] > a,
[rst-home-list] [rst-row-sub] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[rst-home-list] [rst-row-main] > a { display: block; }
@media (max-width: 640px) {
  [rst-home] { padding-top: 18svh; /* spacing-allow: on a phone the box sits higher, clear of the keyboard; geometry, not rhythm */ }
}

/* A section of a page opens under a rule. The stack puts --rst-sp-5
 * above it (rst-section); this is the rule and the space under it. Only
 * a <section>: the front page's lists open a section of the stack too,
 * with no rule. */
section[rst-section] { border-top: 1px solid var(--rst-line); padding-top: var(--rst-sp-4); }
/* A section's heading and its one action share a line. */
[rst-section-head] {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--rst-sp-3) var(--rst-sp-4);
  justify-content: space-between;
}
[rst-section-head] :is(h1, h2) { margin: 0; }

/* A form is a stack (tokens.css): label to field and field to hint
 * --rst-sp-2, a field to the next label --rst-sp-3, and its buttons
 * (rst-actions) --rst-sp-4 clear. Only the labels' weight is Memoria's.
 *
 * form[rst-stack], here and in the field rules below, and never a bare
 * [rst-stack]: <main> is a stack too, and a bare one would reach every
 * field on every page, the search box's and the sign-in door's among
 * them. */
form[rst-stack] > label { font-weight: 560; }
/* A hint inside a label is quiet: muted and regular weight, not the
 * label's 560 (polish audit r3 B7). */
[rst-hint] { font-weight: 400; }
/* border-box: the fields are width 100% PLUS their padding otherwise,
 * which ran 22px past the column at 1440 and off the screen at 390
 * (polish audit §B6). Password fields are here too: the Notion token
 * fields were the browser's own. */
form[rst-stack] input[type="text"],
form[rst-stack] input[type="email"],
form[rst-stack] input[type="password"],
form[rst-stack] textarea {
  background: var(--rst-bg);
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius-sm, 6px);
  box-sizing: border-box;
  color: var(--rst-text);
  font: inherit;
  max-inline-size: 100%;
  padding: var(--rst-sp-2) var(--rst-sp-3);
  width: 100%;
}
form[rst-stack] input[type="text"]:focus-visible,
form[rst-stack] input[type="email"]:focus-visible,
form[rst-stack] input[type="password"]:focus-visible,
form[rst-stack] textarea:focus-visible {
  border-color: var(--rst-accent);
  outline: 2px solid var(--rst-accent);
  outline-offset: 1px;
}
/* iOS zooms the page into any text control under 16px, and tokens.css
 * brings controls up to 16px where the pointer is coarse. The fields
 * above set `font: inherit` with a selector that outweighs tokens.css's
 * bare `input` and `textarea`, and fell back to 14px: Add content's
 * title and body, and the Notion token. Same rule, same max(), restated
 * here at their weight. TestNoZoomOnTap (make browser) measures them. */
@media (pointer: coarse) {
  form[rst-stack] input[type="text"],
  form[rst-stack] input[type="email"],
  form[rst-stack] input[type="password"],
  form[rst-stack] textarea {
    font-size: max(1rem, 1em);
  }
}
/* Pasted prose is prose: the body font, not a code box. */
form[rst-stack] textarea { resize: vertical; }

/* The file chooser. The native control stays — it is what works with no
 * script, and it says which files were chosen — but its button is drawn
 * as the app's buttons are, instead of the browser's grey "Choose Files". */
form[rst-stack] input[type="file"] { color: var(--rst-text-muted); font: inherit; font-size: var(--rst-fs-sm); max-inline-size: 100%; }
form[rst-stack] input[type="file"]::file-selector-button {
  background: var(--rst-surface);
  border: 1px solid var(--rst-line-strong);
  border-radius: var(--rst-radius-sm, 6px);
  color: var(--rst-text);
  cursor: pointer;
  font: inherit;
  font-weight: 560;
  margin-inline-end: var(--rst-sp-3);
  /* spacing-allow: drawn as the app's buttons are, at rastrillo's [rst-btn] padding */
  padding: 0.45rem 0.75rem;
}
form[rst-stack] input[type="file"]::file-selector-button:hover { background: var(--rst-surface-2); }

/* The drop zone. Nothing here paints until static/drop.js has proved it
 * can put a file in the input and written rst-dropzone="ready" — so a
 * page whose script did not load shows an ordinary file input inside an
 * invisible wrapper, rather than a dashed box that swallows drops. The
 * bare [rst-dropzone] selector is deliberately styled with nothing.
 */
[rst-dropzone~="ready"] {
  border: 1px dashed var(--rst-line-strong, var(--rst-line));
  border-radius: var(--rst-radius-sm, 6px);
  padding: var(--rst-sp-3);
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
/* A file is over the page. The whole document is the drop target — the
 * zone is where it lands, not where it must be aimed — so this has to be
 * visible from wherever the pointer happens to be.
 */
[rst-dropzone~="over"] {
  background: var(--rst-accent-soft, var(--rst-surface-2));
  border-color: var(--rst-accent, var(--rst-line-strong));
  border-style: solid;
}
[rst-dropzone-hint], [rst-dropzone-note] { font-size: 0.8125rem; margin: var(--rst-sp-2) 0 0; }
/* Muted, and not with .rst-cell-mut: that utility exists only as a class,
 * so `rst-cell-mut` written as an attribute selects nothing — and the
 * class itself is a table-cell rule (nowrap, ellipsis) that would clip
 * this sentence at the edge of the zone.
 */
[rst-dropzone-hint] { color: var(--rst-text-muted); }
/* drop.js unhides the note while it is still empty, so the live region is
 * in the accessibility tree before it ever has to announce a refusal. An
 * empty paragraph with a top margin would push the Store it button down
 * by half a line for no reason anyone could see, so while it is empty it
 * takes no space at all.
 */
[rst-dropzone-note]:empty { margin: 0; }
[rst-dropzone-note~="good"] { color: var(--rst-tone-positive-fg); }
[rst-dropzone-note~="danger"] { color: var(--rst-tone-negative-fg); }
@media (prefers-reduced-motion: reduce) {
  [rst-dropzone~="ready"] { transition: none; }
}

/* The upload tray.
 *
 * It is in the DOM from the moment drop.js runs, because
 * [rst-tray-status] is a live region and a live region has to be in the
 * accessibility tree before it has anything to announce. So "not open"
 * cannot be display:none — that would take the region back out again.
 * Instead the head and the list are hidden, the panel paints nothing,
 * and an empty status paragraph is zero-height, which leaves a fixed
 * element of no size in the corner. pointer-events go with it: an
 * invisible box that swallows clicks over the corner of the page would
 * be worse than a visible one.
 */
[rst-tray] {
  bottom: 1rem;
  font-size: 0.8125rem;
  inset-inline-end: 1rem;
  position: fixed;
  width: min(22rem, calc(100vw - 2rem));
  z-index: 30;
}
[rst-tray]:not([rst-tray~="open"]) { pointer-events: none; }
[rst-tray]:not([rst-tray~="open"]) [rst-tray-head],
[rst-tray]:not([rst-tray~="open"]) [rst-tray-list] { display: none; }
[rst-tray~="open"] {
  background: var(--rst-surface);
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius, 8px);
  box-shadow: var(--rst-shadow-pop, none);
  padding: var(--rst-sp-2) var(--rst-sp-3);
}
[rst-tray-head] {
  align-items: center;
  display: flex;
  gap: var(--rst-sp-2);
  justify-content: space-between;
}
[rst-tray-title] { font-weight: 620; }
/* 40vh so a drop of twenty-five files scrolls inside the tray rather
 * than growing a panel taller than the window. */
[rst-tray-list] {
  list-style: none;
  margin: var(--rst-sp-2) 0 0;
  max-height: 40vh;
  overflow-y: auto;
  padding: 0;
}
[rst-tray-row] {
  border-top: 1px solid var(--rst-line);
  display: grid;
  gap: var(--rst-sp-1) var(--rst-sp-2);
  grid-template-columns: 1fr auto;
  padding: var(--rst-sp-2) 0;
}
[rst-tray-row]:first-child { border-top: 0; }
/* A filename has no spaces to break at, and the tray is narrow. */
[rst-tray-name] { font-weight: 560; overflow-wrap: anywhere; }
[rst-tray-phase] { color: var(--rst-text-muted); text-align: end; }
[rst-tray-row~="good"] [rst-tray-phase] { color: var(--rst-tone-positive-fg); }
/* A refusal is a sentence, not a word: it gets the whole row width and
 * reads left to right under the name it belongs to.
 */
[rst-tray-row~="danger"] [rst-tray-phase] {
  color: var(--rst-tone-negative-fg);
  grid-column: 1 / -1;
  text-align: start;
}
/* accent-color rather than ::-webkit-progress-value and friends, and
 * that is not a detail: styling those pseudo-elements replaces the
 * browser's indeterminate rendering with a static bar, and the
 * indeterminate state is the whole point of phase two — a bar that
 * stops moving while the server works reads as broken.
 */
[rst-tray-bar] {
  accent-color: var(--rst-accent, var(--rst-text));
  block-size: 0.35rem;
  grid-column: 1 / -1;
  inline-size: 100%;
}
[rst-tray-status] { margin: var(--rst-sp-2) 0 0; }
/* Unhidden and empty from the moment the script runs, so it must cost no
 * space until it says something — and the obvious "fix" for a stray
 * half-line in the corner is to hide the region again, which is the bug
 * this whole arrangement exists to avoid.
 */
[rst-tray-status]:empty { margin: 0; }
[rst-tray-listed] { color: var(--rst-text-muted); margin: var(--rst-sp-2) 0 0; }

[rst-results] { list-style: none; margin: 0; padding: 0; }
[rst-result] { border-top: 1px solid var(--rst-line); padding: var(--rst-sp-4) 0; }
/* The whole result opens it (Paul, 2026-10-26). search.js does the
 * clicking and marks the list once it can; without the script the title
 * is the link, as ever. Not a stretched overlay: that made snippet text
 * impossible to select (review, 2026-10-26). */
[rst-results-clickable] [rst-result] { cursor: pointer; }
@media (hover: hover) {
  [rst-results-clickable] [rst-result] { border-radius: var(--rst-radius-sm, 6px); margin-inline: calc(-1 * var(--rst-sp-3)); padding-inline: var(--rst-sp-3); }
  [rst-results-clickable] [rst-result]:hover { background: var(--rst-surface-2, var(--rst-line)); }
}
[rst-result]:first-child { border-top: 0; }
/* The document's ancestry in its source, above the title. Sits above
   rather than below because it is read as a location — "Handbook ›
   Onboarding ›" then the page — and colours come from tokens so light
   and dark both resolve through theme.css. */
[rst-result-path] {
  /* --rst-text-muted, not --rst-text-mut. This rule was written by
   * copying the trail rule above while it still carried that typo: an
   * undefined token with no fallback makes the whole declaration invalid
   * at computed-value time, so the path would have rendered as ordinary
   * body text — muted in the markup, not muted on the screen. The merge
   * brought the fix and the test that catches the class of it.
   */
  color: var(--rst-text-muted);
  display: block;
  font-size: 0.8125rem;
}
/* Row titles — a result's, and a document's in the index table — are
 * the row's subject, in the text colour like every list title in the
 * suite, and underlined only on hover. The base link rule (estilo
 * base.css) is zero-specificity, so these win without a fight; prose
 * links (the fact box's citation, "Back to search") keep the accent and
 * the underline, because colour alone must not carry "this is a link". */
[rst-result-title],
[rst-table] td > a:not([rst-btn]) {
  color: var(--rst-text);
  text-decoration: none;
}
[rst-result-title]:hover,
[rst-table] td > a:not([rst-btn]):hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
[rst-result-title] { font-size: 1.0625rem; font-weight: 600; }
[rst-table] td > a:not([rst-btn]) { font-weight: 550; }
[rst-result-trail] {
  /* The token is --rst-text-muted. This said --rst-text-mut, which
   * theme.css does not define and which had no fallback, so the whole
   * declaration was invalid at computed-value time — not "grey went
   * wrong", but the colour rule silently absent, leaving the trail in
   * ordinary body text: muted in the markup, not muted on the screen.
   * TestEveryTokenReferencedHereIsDefinedOrHasAFallback now catches the
   * whole class of that mistake.
   */
  color: var(--rst-text-muted);
  display: block;
  font-size: 0.8125rem;
}
/* The snippet keeps a readable measure inside the wider column: lines
 * much past 75 characters are hard to follow back to their start. */
[rst-result-snippet] { line-height: 1.55; margin: var(--rst-sp-2) 0 var(--rst-sp-1); max-width: 80ch; }
/* Softer highlights: no padding, so a run of matched words reads as one
 * phrase rather than a row of separate chips. */
[rst-result-snippet] mark {
  background: var(--rst-accent-soft, var(--rst-line));
  border-radius: 2px;
  color: inherit;
  padding: 0;
}
[rst-result-meta] { font-size: 0.8125rem; margin: 0; }

/* The primed result: the one Enter goes to. Deliberately the same mark
   as [rst-passage]:target on the document page, because it means the
   same thing in both places — this is the one you are being sent to.
   Set by the server, never by the script; see internal/memoria/query. */
[rst-result-primed] {
  border-inline-start: 3px solid var(--rst-accent, var(--rst-text));
  padding-inline-start: var(--rst-sp-3);
}
[rst-result-primed]:first-child { border-top: 0; }
/* Arrowing into the list moves real focus, so the browser's own ring is
   the selection indicator. It is stated here only to give it room: the
   default ring sits tight against 600-weight text and is easy to miss
   when the eye is on the input. */
[rst-result-title]:focus-visible {
  outline: 2px solid var(--rst-accent, var(--rst-text));
  outline-offset: 3px;
}

/* The document page (Paul, 2026-10-30): a document on a paper card. In
   light mode the card is white on the grey page; in dark it is the raised
   surface. Passages run on as one document; the one a citation points at
   is marked, in the margin, without moving the text. */
[rst-doc-meta] { font-size: 0.875rem; margin-inline: auto; max-width: 46rem; inline-size: 100%; }
[rst-doc-nav] { margin-inline: auto; max-width: 46rem; inline-size: 100%; }
[rst-paper] {
  background: var(--rst-surface);
  border: 1px solid var(--rst-line);
  border-radius: calc(var(--rst-radius) * 1.5);
  box-shadow: var(--rst-shadow-lift);
  /* <main> is a flex column, where auto margins shrink a box to its
     content: the width is stated. 51rem is the 46rem measure the text
     has always had, inside the card's padding. */
  box-sizing: border-box;
  inline-size: 100%;
  margin-inline: auto;
  max-width: 51rem;
  padding: var(--rst-sp-6);
  line-height: 1.65;
}
[rst-doc-title] { font-size: 2rem; letter-spacing: -0.02em; margin: 0 0 var(--rst-sp-5); }
[rst-doc-heading] { margin: var(--rst-sp-5) 0 var(--rst-sp-2); }
h2[rst-doc-heading] { font-size: 1.35rem; }
h3[rst-doc-heading] { font-size: 1.1rem; }
[rst-doc-subhead] { font-size: 1rem; margin: var(--rst-sp-4) 0 var(--rst-sp-2); }
[rst-passage] { scroll-margin-top: 5rem; border-radius: 0.375rem; margin: 0 calc(-1 * var(--rst-sp-3)); padding: var(--rst-sp-1) var(--rst-sp-3); }
[rst-passage]:target { background: var(--rst-accent-soft); box-shadow: inset 3px 0 0 var(--rst-accent); }
/* The document's own text: a paragraph, a list, a quote, a block of code
 * or a table ends one step above the next (and the passage's padding
 * gives the last one room inside its mark). A list indents by one wide
 * step a level. */
[rst-passage] p { margin: 0 0 var(--rst-sp-4); }
[rst-passage] a { overflow-wrap: anywhere; }
[rst-doc-list] { margin: 0 0 var(--rst-sp-4); padding-left: var(--rst-sp-5); }
[rst-doc-list] li { margin: var(--rst-sp-1) 0; }
[rst-doc-list] li[rst-depth="1"] { margin-left: var(--rst-sp-5); }
[rst-doc-list] li[rst-depth="2"] { margin-left: 3rem; /* spacing-allow: a third level is two indents in, 2 x --rst-sp-5 */ }
[rst-doc-list] li[rst-depth="3"] { margin-left: 4.5rem; /* spacing-allow: a fourth level is three indents in, 3 x --rst-sp-5 */ }
[rst-doc-list] li[rst-doc-todo] { list-style: none; margin-left: calc(-1 * var(--rst-sp-5)); }
[rst-doc-props] {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: var(--rst-sp-2) var(--rst-sp-5);
  margin: 0 0 var(--rst-sp-4);
  padding: var(--rst-sp-3) var(--rst-sp-4);
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius);
  background: var(--rst-surface-2);
}
[rst-doc-props] dt { color: var(--rst-text-muted); }
[rst-doc-props] dd { margin: 0; }
[rst-doc-quote] { border-inline-start: 3px solid var(--rst-line-strong); color: var(--rst-text-muted); margin: 0 0 var(--rst-sp-4); padding: 0 0 0 var(--rst-sp-4); }
[rst-doc-code] { background: var(--rst-surface-2); border-radius: var(--rst-radius); font-size: 0.875rem; margin: 0 0 var(--rst-sp-4); overflow-x: auto; padding: var(--rst-sp-3) var(--rst-sp-4); }
[rst-doc-table] { margin: 0 0 var(--rst-sp-4); overflow-x: auto; }
[rst-doc-table] table { border-collapse: collapse; font-size: 0.9375rem; }
[rst-doc-table] th, [rst-doc-table] td { border: 1px solid var(--rst-line); padding: var(--rst-sp-1) var(--rst-sp-2); text-align: left; vertical-align: top; }
[rst-doc-table] th { background: var(--rst-surface-2); }
@media (max-width: 640px) {
  [rst-paper] { padding: var(--rst-sp-5) var(--rst-sp-4); border-radius: var(--rst-radius); }
  [rst-doc-title] { font-size: 1.6rem; }
  [rst-doc-props] { grid-template-columns: 1fr; gap: 0 0; }
  [rst-doc-props] dd { margin-bottom: var(--rst-sp-2); }
}

[rst-table] { border-collapse: collapse; width: 100%; }
[rst-table] th, [rst-table] td {
  border-bottom: 1px solid var(--rst-line);
  padding: var(--rst-sp-2) var(--rst-sp-2) var(--rst-sp-2) 0;
  text-align: start;
}
[rst-table] th { font-size: 0.8125rem; font-weight: 560; }
[rst-table] [rst-num] { font-variant-numeric: tabular-nums; text-align: end; }
[rst-table] time { white-space: nowrap; }
/* The documents list: the title takes the spare width, and every other
 * column is as narrow as its content and never wraps. */
[rst-docs] td:not(:first-child),
[rst-docs] th:not(:first-child) { white-space: nowrap; width: 1%; }
[rst-docs] td:last-child { text-align: end; }
/* One Delete per row is a column of identical bordered buttons; it reads
 * as quiet text until the row is hovered or the button is focused. */
[rst-docs] td:last-child [rst-btn] { background: transparent; border-color: transparent; box-shadow: none; color: var(--rst-text-muted); }
[rst-docs] tr:hover td:last-child [rst-btn],
[rst-docs] td:last-child [rst-btn]:focus-visible { border-color: var(--rst-line-strong, var(--rst-line)); color: var(--rst-text); }
@media (hover: none) {
  [rst-docs] td:last-child [rst-btn] { border-color: var(--rst-line); color: var(--rst-text); }
}
[rst-docs] th, [rst-docs] td { padding-inline-end: var(--rst-sp-4); }
[rst-docs] th:last-child, [rst-docs] td:last-child { padding-inline-end: 0; }
/* A wide table scrolls inside its own box rather than widening the page
 * past a phone's screen. */
[rst-scroll-x] { overflow-x: auto; }
/* ?explain=facts: a value is never broken over two lines. */
[rst-explain-table] td:first-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 320px is the reflow floor the suite holds itself to. The search form
 * stays one row: stacked, rastrillo's align-items: center shrank the input
 * to a clipped 180px in the middle of the column. */
@media (max-width: 26rem) {
  [rst-table] { font-size: 0.875rem; }
}
/* The documents table keeps Title, Updated and Delete below 40rem. With
 * its narrow columns unwrapped, all five ran past a 417px screen and
 * pushed Delete off it (review, 2026-10-26). Source and Passages are on
 * the document's own page. */
@media (max-width: 40rem) {
  [rst-docs] th:nth-child(2), [rst-docs] td:nth-child(2),
  [rst-docs] th:nth-child(3), [rst-docs] td:nth-child(3) { display: none; }
}

/* A typing request's note that §8.9 was deferred; never shown. */
[rst-facts-deferred] { display: none; }

/* The Sources page's lists: rows with a rule between them. They were
 * rastrillo's rounded rst-list card holding bare <li>s, so browser bullets
 * sat inside the card with the text touching its edge. */
[rst-sources] { border-top: 1px solid var(--rst-line); list-style: none; margin: 0; padding: 0; }
[rst-sources] > li { border-bottom: 1px solid var(--rst-line); display: grid; gap: var(--rst-sp-2); padding: var(--rst-sp-3) 0; }
[rst-sources] > li > p { margin: 0; }
[rst-source-name] { font-weight: 600; }

/* The Notion import's figures: a two-column list, not the browser's
 * indented one-per-line definition list. */
[rst-facts] { display: grid; gap: var(--rst-sp-2) var(--rst-sp-4); grid-template-columns: minmax(0, max-content) minmax(0, 1fr); margin: 0; }
[rst-facts] dt { color: var(--rst-text-muted); }
[rst-facts] dd { margin: 0; }
@media (max-width: 26rem) {
  [rst-facts] { grid-template-columns: minmax(0, 1fr); }
  [rst-facts] dd { margin-bottom: var(--rst-sp-2); }
}

/* §8.8's fact box: a validated fact lifted out of the passages below,
   with its citation. Sits between the withholding notice and the result
   list, and is styled to read as an answer rather than as a result —
   the value is the thing the eye should land on. */
/* §8.10's answer card: label on top, the value large, the citation
 * under it, and "Is this wrong?" small and grey at the bottom right. */
[rst-fact-box] {
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius);
  padding: var(--rst-sp-4) var(--rst-sp-4) var(--rst-sp-3);
  background: var(--rst-surface);
}
[rst-fact] {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: var(--rst-sp-1) var(--rst-sp-2);
  margin: 0;
}
[rst-fact-label] { flex-basis: 100%; }
[rst-fact-cite] { flex-basis: 100%; }
/* One answer: the value in large type, Google-style. clamp keeps a
 * phone number on one line at 320px. */
[rst-fact-one] [rst-fact-value] { font-size: clamp(1.125rem, 6vw, 2rem); line-height: 1.15; }
/* A guess is quieter than an answer, and says what it is. */
[rst-fact-guess] [rst-fact-value] { font-weight: 500; }
[rst-fact-chip] {
  background: var(--rst-tone-warning-bg, var(--rst-surface-2));
  border-radius: 999px;
  color: var(--rst-tone-warning-fg, var(--rst-text));
  font-size: 0.75rem;
  font-weight: 600;
  /* spacing-allow: a pill's word sits on its centre line, a hair inside the edge */
  padding: 0.1rem 0.5rem;
}
[rst-fact-report] {
  font-size: 0.75rem;
  margin: var(--rst-sp-2) 0 0;
  text-align: end;
}
[rst-fact-report] a { color: var(--rst-text-muted); }
[rst-fact] + [rst-fact],
[rst-fact-note] + [rst-fact] {
  margin-top: var(--rst-sp-2);
  padding-top: var(--rst-sp-2);
  border-top: 1px solid var(--rst-line);
}
[rst-fact-label] {
  color: var(--rst-text-muted);
  font-size: 0.8125rem;
}
/* A value is never broken: "+353 (0)1 / 547 7854" over two lines reads
 * as two numbers. */
[rst-fact-value] {
  font-size: 1.1875rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  overflow-wrap: anywhere;
}
[rst-fact-value][rst-nowrap] { overflow-wrap: normal; white-space: nowrap; }
[rst-fact-cite] {
  font-size: 0.8125rem;
}
/* §8.8's ?explain=facts account: a plain disclosure under the box. */
[rst-fact-explain] {
  font-size: 0.8125rem;
}
[rst-fact-explain] summary { cursor: pointer; color: var(--rst-text-muted); }

/* §8.8's narrowing line: which of the reader's words chose the rows
   above, and how many candidates that left out. Quiet, under the rows. */
[rst-fact-note] {
  color: var(--rst-text-muted);
  font-size: 0.8125rem;
  margin: var(--rst-sp-2) 0 0;
}

/* §8.9: a row a model pointed at, rather than one a checksum validated.
   Distinct at a glance, and quieter — the value is still the document's
   bytes, but the claim that it is an address is the model's. */
[rst-fact-model] [rst-fact-value] { font-weight: 500; }
[rst-fact-by] {
  color: var(--rst-text-muted);
  font-size: 0.75rem;
}

/* §8.10's correction page and the person's own reports. */
[rst-correct] fieldset { border: 0; margin: 0; padding: 0; }
[rst-correct] legend { font-weight: 600; margin-bottom: var(--rst-sp-2); }
[rst-correct-form] + [rst-correct-form] { border-top: 1px solid var(--rst-line); padding-top: var(--rst-sp-4); }
[rst-correct-option] {
  align-items: baseline;
  border-top: 1px solid var(--rst-line);
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: var(--rst-sp-1) var(--rst-sp-2);
  padding: var(--rst-sp-2) 0;
}
/* Phone numbers, eircodes and VAT numbers stay whole; an email or an
 * IBAN can be long and wraps rather than widening the page. */
[rst-correct-value] { font-variant-numeric: tabular-nums; font-weight: 600; overflow-wrap: anywhere; }
[rst-correct-value][rst-nowrap] { overflow-wrap: normal; white-space: nowrap; }
[rst-correct] textarea { width: 100%; }
[rst-report-list] { list-style: none; margin: 0; padding: 0; }
[rst-report] { border-top: 1px solid var(--rst-line); padding: var(--rst-sp-3) 0; }
[rst-report] p { margin: 0 0 var(--rst-sp-1); }
[rst-report-note] { color: var(--rst-text-muted); white-space: pre-wrap; }

/* §8.11's AI answer: marked 🤖 and named, quieter than a checked answer,
 * with its citations as links. */
[rst-answer-pending]:empty { display: none; }
[rst-ai-answer] {
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius);
  background: var(--rst-surface);
  padding: var(--rst-sp-3) var(--rst-sp-4);
}
[rst-ai-by] { color: var(--rst-text-muted); font-size: 0.8125rem; margin: 0 0 var(--rst-sp-2); }
[rst-ai-text] { line-height: 1.6; margin: 0 0 var(--rst-sp-2); }
[rst-ai-text]:last-child { margin-bottom: 0; }
[rst-ai-list] { line-height: 1.6; margin: 0 0 var(--rst-sp-2); padding-left: var(--rst-sp-5); }
[rst-ai-list]:last-child { margin-bottom: 0; }
[rst-ai-list] li + li { margin-top: var(--rst-sp-1); }
[rst-ai-feedback] {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--rst-sp-1);
  margin: var(--rst-sp-2) 0 0;
  font-size: 0.8125rem;
}
[rst-ai-cite] { font-size: 0.8125rem; text-decoration: none; }
[rst-ai-state] { font-size: 0.875rem; margin: 0; }

/* The footer is one quiet line; the egress statement opens under it. */
[rst-foot-details] summary { cursor: pointer; font-size: 0.8125rem; list-style: none; }
[rst-foot-details] summary::-webkit-details-marker { display: none; }
[rst-foot-details] p { font-size: 0.8125rem; margin: var(--rst-sp-2) 0 0; }

/* A table row or list item whose main link opens it (Paul, 2026-10-31:
   any list item with a link should be clickable as a whole). Where a
   list can be rastrillo's own list row ([rst-row] / [rst-row-main], the
   front page's lists) it is; this is for what cannot — a table row, which
   [rst-row] would turn into a flex box, and the sources list's grid.
   Memoria's own attribute names, because [rst-row] is rastrillo's.

   The link's ::after stretches over the row on layer 1, so the whole row
   is the link with no script, and every other control in the row — a
   Delete — sits on layer 2 and keeps its own click. The link itself is
   static, because a shared stylesheet makes links position: relative,
   which kept the stretch inside the link's own text (found by the browser
   test). */
[rst-click-row] { position: relative; }
[rst-click-row] [rst-click-link] { position: static; }
[rst-click-link]::after { content: ""; inset: 0; position: absolute; z-index: 1; }
[rst-click-row] a:not([rst-click-link]),
[rst-click-row] button,
[rst-click-row] form { position: relative; z-index: 2; }
[rst-click-row]:hover { background: var(--rst-surface-2); }
