/* ===========================================================================
   Base styles. Mobile first throughout — every media query widens, never
   narrows. If you find yourself writing max-width, something has gone wrong.
   ======================================================================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

/* The hidden attribute always hides. Without this any class that sets display - .stack, a grid - draws a hidden
   element anyway: the event editor drew every outcome kind's fields at once, each one disabled (2026-10-30). */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;   /* stop iOS inflating text in landscape */
  scroll-behavior: smooth;
  /* Offset for the sticky header when jumping to an anchor */
  scroll-padding-top: 5rem;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;              /* dvh, not vh — mobile browser chrome */
  overflow-x: hidden;              /* belt and braces against overflow */
  /* Column layout so .site-footer's margin-block-start:auto pins it to the bottom
     on short pages without position:fixed stealing viewport height. */
  display: flex;
  flex-direction: column;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- Typography ---------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;              /* stops orphaned words in headings */
}

/* Each step down is a clear one. h2 sat at --text-2xl, which is 26px against the
   h1's 32px at 390px — close enough that a section heading read as a second title
   rather than as something beneath it. The whole scale shifts down one stop to keep
   the gaps even: 32 / 22 / 19 / 17 on a phone. */
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-xl);  margin-block-start: var(--space-lg); }
h3 { font-size: var(--text-lg);  margin-block-start: var(--space-md); }
h4 { font-size: var(--text-base); margin-block-start: var(--space-md); font-family: var(--font-ui); }

p, ul, ol, blockquote, table {
  margin-block-end: var(--space-sm);
}

p { text-wrap: pretty; }

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent); }

blockquote {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: var(--space-sm);
  color: var(--fg-muted);
  font-style: italic;
}

code, pre { font-family: var(--font-mono); font-size: 0.9em; }

hr {
  border: 0;
  border-block-start: 1px solid var(--border);
  margin-block: var(--space-lg);
}

/* --- Icons and ornament --------------------------------------------------
   Icons are inline SVG rendered by Components/Shared/Icon.razor, drawn for this
   project rather than downloaded — see docs/GRAPHICS.md for why. They take
   currentColor, so one drawing is correct in both themes.

   Watch out — an inline SVG is replaced content with no baseline of its own, so
   it hangs below the text beside it unless the container centres it or the icon
   is nudged. Prefer a flex container with align-items: center over per-icon
   vertical-align, which has to be re-tuned at every size. */

.icon {
  flex: 0 0 auto;
  /* For the cases that are genuinely inline — inside a badge or a sentence —
     rather than in a flex row. */
  vertical-align: -0.14em;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}
/* The wiki's marks are painted art (280), so colour no longer reaches them; their size is on the element. */
.icon { object-fit: contain; }

/* The gated badge is the one place an icon is load-bearing: it is what says the
   row is staff-only, and it is the production layer's colour, not danger's. */
.gated {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

/* Ornament, for surfaces that should read as lit rather than filled. Both are
   generated in tokens.css; these are the two ways to spend them. A game screen's
   decision panel is .veil and nothing else — see docs/DESIGN.md. */
.veil  { background-image: var(--veil); }
.grain { background-image: var(--grain); }
.veil.grain { background-image: var(--veil), var(--grain); }

/* A section break: a short length of the brass bar, its ends fading. It was the small brass flourish (280) until the
   author removed the flourishes for now (2026-11-18, FE-10), and before that the congruence lozenge. */
.prose hr {
  border: 0;
  width: min(9rem, 60%);
  height: 5px;
  margin: var(--space-xl) auto;
  background: url("../art/title-bar.png") center / 100% 100% no-repeat;
  mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
}

/* Eyebrow labels, metadata, small caps chrome */
.label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* --- Layout -------------------------------------------------------------- */

.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The reading column. Body text must never exceed this, at any width. */
.prose {
  max-width: var(--measure);
  margin-inline: auto;
}

.prose > * + * { margin-block-start: var(--space-sm); }
.prose h2 + *, .prose h3 + * { margin-block-start: var(--space-xs); }

.stack     { display: flex; flex-direction: column; gap: var(--space-sm); }
.stack-lg  { display: flex; flex-direction: column; gap: var(--space-lg); }

/* Cards reflow by available space, not viewport width, so they behave the same
   in the main column and inside a narrower sidebar. */
.grid {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
}

.card {
  background: var(--bg-raised);
  background-image: var(--depth-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm);
  /* Height says what you press (FE-10, the author 2026-11-18): a card you only read is a plate just off the page; a card
     that is a link stands higher, lifts on hover and presses in. */
  box-shadow: var(--depth-plate);
}
a.card { box-shadow: var(--depth-raised); transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
a.card:hover { box-shadow: var(--depth-raised-hover); transform: translateY(-2px); border-color: var(--accent); }
a.card:active { box-shadow: var(--depth-pressed); transform: translateY(1px); }

/* --- Header and navigation ----------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--border);
  padding-block: var(--space-2xs);
}

/* Mobile first: the brand on the left, the menu control hard right, and the links in an
   overlay beneath. Widened at 40rem into a single row.

   It was one row at every width once, with the brand pushing the nav right - and that was
   measured with the TWO links a signed-out reader sees. A signed-in admin has five, which
   left the nav a narrow column squeezed against the right edge. The header is 44px in both
   states now and at every width, because the open menu is out of flow. */
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap-min);
}

.site-header__brand {
  font-family: var(--font-display);
  /* Fixed at mobile rather than fluid: --text-lg wrapped "The Fourth Epoch" onto two
     lines at 390px once the nav was beside it, which doubled the header's height. */
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  color: var(--fg);
  white-space: nowrap;
}

/* A menu at mobile, a row at 30rem and up.

   Measured rather than assumed: the five links a signed-in admin sees need 373px at
   390px wide against 358 available. Beside the brand they wrapped into a cramped column
   against the right edge; on their own full-width row they fitted, but cost a second row
   of a STICKY header - 101px, a ninth of the screen, permanently.

   <details> is decision 108's answer: native, nothing to re-run on enhancedload, works
   with JavaScript off, and a menu built this way cannot fail to open. */
/* The control sits at the far right of the bar, on the brand's row. It used to take a
   row of its own (flex-basis: 100%), which made a 44px header into a 70px one before
   anybody had opened anything.

   WATCH OUT - the auto margin goes on the <nav>, not on .site-nav. The flex items of
   .site-header__inner are the brand and the <nav> wrapper; .site-nav is the <details>
   INSIDE that wrapper, so a margin there does nothing to where the control sits and
   reads as though it should. It was on .site-nav for one build and the button stayed
   in the middle of the bar. */
.site-header__inner > nav {
  margin-inline-start: auto;
}

.site-nav__toggle {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  /* The default triangle sits left of the word and reads as a list marker rather than as
     a control. The caret after the label is the affordance, and it turns over on open. */
  list-style: none;
}
.site-nav__toggle::-webkit-details-marker { display: none; }
/* Three drawn lines in a 44px target (the author, 2026-10-23); the summary is named Menu for a screen reader. */
.site-nav__toggle { min-width: var(--tap-min); justify-content: center; }
.site-nav__bars { display: block; }
.site-nav__toggle:hover { color: var(--accent); }

/* The links are a SIBLING of the <details>, not its children, and that is the whole fix
   for a desktop nav that was broken at every width above 30rem.

   WATCH OUT - do not move them back inside. A closed <details> contributes NO intrinsic
   size, and CSS that forces its children visible does not restore it: the element measured
   0px wide, collapsed the <nav> flex item to 0, and the links - which wrap - then took one
   line each and spilled off the right edge as an unreachable column. Measured closed vs
   open at 1280px: 0px against 56px. Forcing `display` on the panel shows the links and
   changes nothing about the sizing, and `display: contents` on the <details> does not help
   either, because the hiding follows the element rather than its box.

   As siblings there is nothing to override. The disclosure still drives the panel, through
   the adjacent combinator below, and `<details>` stays the mechanism decision 108 chose.

   It went unseen because `body` has overflow-x:hidden, so the spill CLIPPED rather than
   scrolled; because signed out there are only two links, which reads as a slightly odd
   header rather than a broken one; and because no test renders this component at a desktop
   width. The browser audit cannot see it for the overflow-x reason. */
.site-nav__items {
  display: none;
}

/* An overlay under the header rather than a panel that grows it. position:absolute takes
   the menu out of flow, so opening it neither moves the page nor makes a sticky header
   taller — it covers what is beneath, which is what a menu should do.

   Anchored to .site-header, which is the nearest positioned ancestor because it is
   sticky. top:100% puts it on the header's lower edge at any header height, so nothing
   here has to know a number that the brand's font size could change.

   Stacked and full width, because a menu that reproduces the cramped row inside a panel
   has moved the problem rather than solved it. */
.site-nav[open] + .site-nav__items {
  display: flex;
  flex-direction: column;
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: 2;
  background: var(--bg-raised);
  border-block-end: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: var(--space-2xs) var(--gutter) var(--space-xs);
}

/* NO SCRIM, deliberately, and it was tried.

   A dimmed backdrop that closes on an outside tap has to be the <summary>'s own
   pseudo-element, because with a native <details> nothing else can toggle it without
   script (108). That does not work: making the summary paint above the scrim needs a
   z-index on the summary, which gives it a stacking context — and the scrim, being its
   child, is then trapped above the panel rather than below it. The alternatives are a
   scrim that dims the control you press to dismiss it, or one that looks dismissable and
   is not, which is worse than none.

   So the panel is opaque, bordered and shadowed, and Menu toggles it. Revisit if the
   menu ever grows past a handful of rows. */

/* 40rem, not 30rem, and the number is measured. The row needs the brand plus the links:
   a signed-in admin's five come to 341px against a 219px brand, so it does not fit until
   about 620. At 30rem the header wrapped to two rows between 480 and 620 - the very thing
   the menu exists to avoid - and then unwrapped again, so widening the window made the
   header taller and then shorter. One breakpoint, at the width the row actually fits. */
@media (min-width: 40rem) {
  /* Wide enough for the row, so the disclosure goes entirely - summary and all - and the
     links lay out as the row they always were. Nothing here has to fight the user agent,
     because the links were never inside the <details>. */
  .site-nav { display: none; }

  .site-nav__items {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2xs);
    padding-block-end: 0;
  }

  /* The negative block margin that keeps a 44px target from growing the header - safe here, because this is the
     width at which the links are a row. (This rule also set padding-inline to 2xs, which the plain .site-nav__link
     rule below overrode at equal specificity: every row ever measured had 3xs. Removed 2026-10-16.) */
  .site-nav__link {
    margin-block: calc(var(--tap-min) / -2 + 0.7em);
  }

  .site-header__brand {
    font-size: var(--text-lg);
    /* Pushes the nav to the far edge, which only works once they share a row. */
    margin-inline-end: auto;
  }
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  /* The padding is what gives a text link a real hit area.

     WATCH OUT - the negative block margin that cancels the 44px in the header's row is
     in the 30rem media query, NOT here, and that is deliberate. In the open mobile menu
     these are stacked, and a negative block margin there overlaps every target with its
     neighbour: measured at 390px, five links sat 20px apart with 44px hit areas, so a
     thumb between two of them hit whichever won the z-order. It is the right trick in a
     row and a bug in a column. */
  min-height: var(--tap-min);
  padding-inline: var(--space-3xs);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
}
.site-nav__link:hover { color: var(--accent); }

.site-nav__link--button {
  background: none;
  border: 0;
  cursor: pointer;
  padding-inline: var(--space-2xs);
}

/* Log out is a button inside a form, because logging out has to be a POST. The form
   was an ordinary block-level flex item, so the button inside it did not sit on the
   row's centre line and "Log out" hung below the links beside it. display:contents
   drops the form from layout — submission is unaffected, since that is a DOM
   relationship rather than a visual one — and makes the button a direct flex child
   treated identically to the anchors.

   WATCH OUT - the selector is .site-nav__items, not .site-nav. The links moved OUT of
   the <details> to fix the desktop nav and this rule still said .site-nav for one build:
   it stopped matching, the form became an ordinary flex item again, and Log out sat
   three pixels below every other link in the row. Exactly the bug the paragraph above
   describes, reintroduced by a selector nobody re-read. */
.site-nav__items form { display: contents; }

/* The light/dark toggle: both buttons are rendered and this shows the one that changes the theme in force - the
   reader's choice (data-theme on <html>), else the device's setting, which only the browser knows. The same two ways
   into the dark palette as tokens.css. */
/* WATCH OUT - scoped by .theme-toggle on purpose. The buttons are menu rows too, and .site-menu__link's display:flex
   comes later at the same specificity: unscoped, it won, and both Dark and Light showed at once (2026-10-22). */
.theme-toggle .theme-toggle__to-light { display: none; }
.theme-toggle .theme-toggle__to-device { display: none; }
:root[data-theme] .theme-toggle .theme-toggle__to-device { display: flex; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__to-light { display: flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .theme-toggle__to-dark { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .theme-toggle__to-light { display: flex; }
}

/* The header's menus (the author's nav of 2026-10-22): Hope's Reach, Admin for a GameAuthor and the account, each a <details> whose
   summary is styled as a nav link and whose panel is a list of rows. Below 40rem they sit in the Menu overlay's column
   and each opens in place, indented under its word; from 40rem each panel drops below its word, out of flow, so
   opening one moves nothing. */
.site-menu { position: relative; }
.site-menu__toggle {
  cursor: pointer;
  list-style: none;
}
.site-menu__toggle::-webkit-details-marker { display: none; }
.site-menu__toggle::after { content: "\25BE"; margin-inline-start: 0.25em; font-size: 0.85em; }
.site-menu[open] > .site-menu__toggle::after { content: "\25B4"; }
.site-menu[open] > .site-menu__toggle { color: var(--accent); }
/* In the row a menu's summary keeps its own 44px and no negative margin: the margin that fits a link into the row
   pulled the <details> around it short, and the menus' words sat above Aropria's (the author, 2026-10-23). The
   <details> is the row's flex item, so it is the one centred. */
@media (min-width: 40rem) {
  .site-menu { display: flex; align-items: center; }
  .site-menu > .site-menu__toggle { margin-block: 0; }
}

.site-menu__panel {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-3xs) var(--space-md);
  display: flex;
  flex-direction: column;
}
.site-menu__link {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  width: 100%;
  min-height: var(--tap-min);
  padding-inline: var(--space-2xs);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-muted);
  text-align: start;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.site-menu__link:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
/* A row's painted mark, where it has one. In a menu where any row has a mark, a row without one keeps the same empty
   space, so every word starts on one line; a menu with none (Admin) keeps its words flush. */
.site-menu__link[data-icon]::before,
.site-menu__panel:has([data-icon]) .site-menu__link:not([data-icon]):not(:has(.site-menu__glyph))::before {
  content: "";
  width: 28px;
  height: 28px;
  flex: none;
  background: center / contain no-repeat;
}
/* The account's mark (a person in a circle) beside its word in the phone's Menu. */
.site-menu__account { flex: none; }
.site-menu__toggle:has(.site-menu__account) { gap: var(--space-2xs); }
@media (min-width: 40rem) { .site-menu__toggle:has(.site-menu__account) { gap: 0; } }
/* The sun and the moon: drawn, the exceptions to painted marks with the account's (the author, 2026-10-22, 2026-10-23), in the marks' 28px box. */
.site-menu__glyph { flex: none; width: 28px; }
/* The theme toggle and Log out are a group of their own under the pages. */
.site-menu__rule { border-block-start: 1px solid var(--border); margin-block-start: var(--space-3xs); padding-block-start: var(--space-3xs); }

@media (min-width: 40rem) {
  .site-menu__panel {
    position: absolute;
    top: calc(100% + var(--space-2xs));
    inset-inline-start: 0;
    z-index: 3;
    min-width: 15rem;
    padding: var(--space-3xs);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .site-menu--end .site-menu__panel { inset-inline-start: auto; inset-inline-end: 0; }
  /* In the row the account is its mark alone; the word is read aloud and shown in the phone's Menu. */
  .site-menu__word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* --- Page frame ---------------------------------------------------------- */

/* A jump to an anchor lands below the sticky header, and below an article's sticky back row: without this a heading
   reached by a link sat under them (the author, 2026-10-23). Every fragment, the game's #decide and #commit too. */
html { scroll-padding-top: 7.5rem; }

.site-main { padding-block: var(--space-lg) var(--space-2xl); }

.site-footer {
  border-block-start: 1px solid var(--border);
  padding-block: var(--space-md);
  margin-block-start: auto;
}
/* The name and the acknowledgements on the left, the Reach's week on the right; stacked on a phone. */
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-md);
}
.site-footer__inner p { margin: 0; }
.site-footer__name { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-sm); }
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  color: var(--fg-muted);
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer__link, .site-footer__week { font-family: var(--font-ui); font-size: var(--text-sm); }
.site-footer__week { font-style: italic; }

/* /privacy and /terms (the author's approval, 2026-10-23): the book's prose, a date under the title, the cookies a
   table that scrolls inside its own wrap at 390px. */
.legal__date { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--fg-muted); }
.legal__cookies code { overflow-wrap: anywhere; }
.legal__cookies td:first-child { min-width: 9rem; }

/* /about's credits: a role, then its people, one to a line. */
.about__credits { margin: 0; text-align: center; }
.about__credits dt { font-family: var(--font-ui); font-weight: 600; margin-block-start: var(--space-sm); }
.about__credits dt:first-child { margin-block-start: 0; }
.about__credits dd { margin: 0; }
/* With support from and its names sit a few steps below the credits (the author, 2026-11-18). */
.about__credits .about__support { font-size: var(--text-sm); }

/* --- Hero ---------------------------------------------------------------- */

.hero { padding-block: var(--space-lg) var(--space-xl); }
/* In the book register the page's own padding already closes the sheet, so the hero adds none below its buttons: the
   two together left an empty band of paper (the UI audit, 2026-10-19, W08). */
.site-main[data-register="book"] .hero { padding-block-end: 0; }
.site-main[data-register="book"] .hero__actions { margin-block-end: 0; }
.hero h1 { margin-block-start: var(--space-2xs); }

.lede {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--fg-muted);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin-block-start: var(--space-md);
}
/* The home page's two: the game's painted button on the book's page, centred (the author, 2026-10-22). */
.hero__actions--painted { justify-content: center; gap: var(--space-sm); }
.hero__actions--painted .btn {
  background: url("../art/button.png") center / 100% 100% no-repeat;
  border: 0;
  min-height: 52px;
  padding-inline: var(--space-lg);
  color: #FFF4DE;
  font-size: var(--text-lg);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px #1c0f2c;
  box-shadow: none;
  filter: var(--depth-drop);
}
/* WATCH OUT - the hover restates the face: .btn:hover comes later at the same specificity and set a solid purple
   background in its place (the author, 2026-10-23). */
.hero__actions--painted .btn:hover {
  background: url("../art/button.png") center / 100% 100% no-repeat;
  filter: var(--depth-drop) brightness(1.12);
  color: #FFF4DE;
  box-shadow: none;
}
.hero__actions--painted .btn:active { filter: brightness(0.92); box-shadow: none; }
/* The wiki's button is a brass-rimmed plate, so the two read as the site's two halves, not twins (the author,
   2026-10-23). A nine-slice at half the art's size: the notched ends stay whole and the plate grows to its words. */
.hero__actions--painted .btn--book,
.hero__actions--painted .btn--book:hover {
  background: none;
  border: solid transparent;
  border-width: 10px 23px;
  border-image: url("../art/plate.png") 20 46 fill / 10px 23px stretch;
  min-height: 53px;
  padding-inline: var(--space-sm);
  color: #F2E8D2;
  text-shadow: 0 1px 2px #000;
}
.hero__more { max-width: var(--measure); margin-inline: auto; }

/* --- Page index ---------------------------------------------------------- */

.page-list {
  max-width: var(--measure);
  margin-inline: auto;
  list-style: none;
  padding: 0;
}

.page-list__item {
  padding-block: var(--space-sm);
  border-block-end: 1px solid var(--border);
}

.page-list__link {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--fg);
  /* A link looks like one at rest: a phone has no hover to reveal it (the UI audit, 2026-10-19, G07, W06). The rule
     is the accent, thin and set low, so the heading still reads as a heading. */
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.page-list__link:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
.page-list__link--plain { text-decoration: none; }

/* A chronicle entry with no week of its own to open - a collapsed absence, a skipped week, a week
   the record cannot account for - is a heading rather than a link. It takes the same type so the
   list reads as one list, and NOT the hover, because a thing that lights up under the cursor is a
   thing a reader will click. Same argument as .choice[data-barred] carrying no cursor and no hover:
   nothing should look tappable that is not. */
.page-list__link--plain:hover { color: var(--fg); text-decoration: none; }

.page-list__summary {
  color: var(--fg-muted);
  margin-block: var(--space-3xs);
  line-height: 1.5;   /* running text, however small, is at least 1.5 (FE-10) */
}

/* --- Long-form article --------------------------------------------------- */

/* Images break out of the reading measure. A 66ch column is right for text and
   too narrow for a map. */
.prose img {
  width: 100%;
  max-width: var(--measure-wide);
  margin-inline: calc((100% - min(var(--measure-wide), 100%)) / 2);
  margin-block: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.prose__footer {
  margin-block-start: var(--space-xl);
  padding-block-start: var(--space-sm);
  border-block-start: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--fg-faint);
}

.notice {
  padding: var(--space-sm);
  background: var(--bg-raised);
  background-image: var(--depth-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--depth-plate);
  color: var(--fg-muted);
}

/* A notice that asks something: its answers in a row that wraps at 390px. The game-news question (009). */
.notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin-block-start: var(--space-sm);
}

/* AskFirst: a question before a form is sent, its answers two equal buttons (the author, 2026-10-23). Opened only by
   ask-first.js; a closed <dialog> is display: none, so without the script there is nothing to see. */
.ask {
  /* WATCH OUT - the reset's * { margin: 0 } takes the browser's margin: auto, which is what centres a modal. */
  margin: auto;
  width: min(32rem, calc(100vw - 2 * var(--gutter)));
  padding: var(--space-md);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
}
/* Dimmed black in both themes, as the image viewer's: the question covers the page. */
.ask::backdrop { background: rgb(0 0 0 / 0.55); }
/* The admin's note in the withheld-name question (G7): their words, set off from the game's. */
.name-ask__note { margin: 0 0 var(--space-xs); padding-inline-start: var(--space-sm); border-inline-start: 3px solid var(--rule); }
.name-ask__note > p { margin: 0; }
.ask__title { margin: 0 0 var(--space-xs); font-size: var(--text-xl); }
.ask__body > * { margin-block: 0 var(--space-xs); }
.ask__actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-block-start: var(--space-sm); }
.ask__actions .btn { flex: 1 1 12rem; }

/* The site tour (FE-6; the author, 2026-11-19). A plate, since it is read; its presses are the buttons. The server draws
   it as a bar under the header, which is what a reader without the script sees; tour.js floats it over the page beside
   the thing its stop explains (data-placed; over it where the window has no room beneath, data-above), with an arrow at
   that thing (--tour-arrow), and outlines the thing in ink - not the
   accent, which marks only what can be pressed (452), and the thing may be only read. */
.tour {
  width: min(48rem, calc(100% - 2 * var(--gutter)));
  margin: var(--space-sm) auto 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-raised);
  background-image: var(--depth-light);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--depth-plate);
  color: var(--fg);
}
.tour[data-placed] {
  position: absolute;
  z-index: var(--z-drawer);
  margin: 0;
  box-shadow: var(--shadow-lg);
}
.tour[data-placed]::before {
  content: "";
  position: absolute;
  top: -7px;
  left: calc(var(--tour-arrow, 50%) - 7px);
  width: 12px;
  height: 12px;
  background: var(--bg-raised);
  border-block-start: 1px solid var(--rule-strong);
  border-inline-start: 1px solid var(--rule-strong);
  transform: rotate(45deg);
}
.tour[data-placed][data-above]::before { top: auto; bottom: -7px; transform: rotate(225deg); }
/* Over a thing too tall to stand beside, at the window's foot: no arrow, since it is on the thing. */
.tour[data-placed][data-over]::before { display: none; }
.tour__kicker { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-xs); margin: 0; }
.tour__count { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--fg-muted); }
.tour__title { margin: var(--space-2xs) 0 0; font-family: var(--font-display); font-size: var(--text-lg); }
.tour__words { margin: var(--space-2xs) 0 0; line-height: 1.5; }
.tour__words .label { margin-inline-end: var(--space-2xs); }
/* One row at the callout's narrowest (the author, 2026-11-19): Skip at the start, Back and Next at the end. */
.tour__moves { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin-block-start: var(--space-sm); }
.tour__moves .btn { padding-inline: var(--space-sm); }
.tour__skip { margin-inline-end: auto; }
/* The last stop's question and its two answers, each on one line and as wide as the other: side by side where they
   fit, one under the other where they do not. */
.tour__ask { margin: var(--space-xs) 0 0; font-weight: 600; }
.tour__choice { display: flex; flex-wrap: wrap; flex: 1 1 100%; gap: var(--space-xs); }
.tour__choice .btn { flex: 1 1 9.5rem; white-space: nowrap; }
.tour__close { margin-inline-start: auto; }
/* A stop that reads differently with no hover (a term) draws both; the device's own shows, with no script. */
.tour__words--touch { display: none; }
@media (hover: none) {
  .tour__words--pointer { display: none; }
  .tour__words--touch { display: block; }
}
.tour--away { padding-block: var(--space-xs); }
.tour--away .tour__moves { margin-block-start: var(--space-xs); }
.tour-target { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: var(--radius); }

/* DocumentPanel: a document read over the page, wide enough to read, scrolling inside itself; Close above and below. */
.ask.doc-panel {
  width: min(46rem, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--space-sm));
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.doc-panel__body { padding: var(--space-sm) var(--space-md); }
.doc-panel__bar {
  position: sticky;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-raised);
}
.doc-panel__bar:first-child { inset-block-start: 0; border-block-end: 1px solid var(--rule); }
.doc-panel__bar:last-child { inset-block-end: 0; border-block-start: 1px solid var(--rule); }
/* The page behind does not scroll while a panel is open. */
html:has(dialog.doc-panel[open]) { overflow: hidden; }

/* The link picker (D10): the AskFirst dialog's frame, scrolling inside itself, each list a box of full-height options
   so a finger can take one at 390px; a heading indents by its level. The page behind does not scroll while it is open. */
.ask.link-picker {
  width: min(36rem, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--space-sm));
  overflow-y: auto;
  overscroll-behavior: contain;
}
html:has(dialog.link-picker[open]) { overflow: hidden; }
.link-picker__list { margin: var(--space-sm) 0 0; padding: 0; border: 0; min-inline-size: 0; }
.link-picker__list > legend { padding: 0; font-family: var(--font-ui); font-weight: 600; }
.link-picker__options {
  max-height: 14rem;
  overflow-y: auto;
  margin-block-start: var(--space-2xs);
  padding: var(--space-3xs);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.link-picker__option {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--tap-min);
  margin: 0;
  padding-inline: var(--space-2xs);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 400;
  text-align: start;
  cursor: pointer;
}
/* The general input rule stretches every input to the full width at a 44px height; a radio is its own size, beside its
   words, and the whole label is the target (the author, 2026-10-30: "a bit wonky"). */
.link-picker__option input[type="radio"] {
  flex: 0 0 auto;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.link-picker__option:has(input:checked) { background: var(--bg); border-radius: var(--radius); }
.link-picker__option--level-3 { padding-inline-start: var(--space-md); }
.link-picker__option--level-4 { padding-inline-start: var(--space-lg); }
.link-picker__preview { margin-block-start: var(--space-xs); overflow-wrap: anywhere; }

/* The Link button over a prose box (D10): on the label's own row, at its right, so it costs the box no row of its own
   (the author, 2026-10-30: trim the space); every LinkButton follows its label. Without the script the cell is empty. */
.field:has(> .editor__link-bar) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-xs);
  align-items: end;
}
.field:has(> .editor__link-bar) > * { grid-column: 1 / -1; }
.field:has(> .editor__link-bar) > label { grid-column: 1; grid-row: 1; }
.field:has(> .editor__link-bar) > .editor__link-bar { grid-column: 2; grid-row: 1; margin-block-end: var(--space-3xs); }
.editor__link-bar { display: flex; justify-content: flex-end; }
/* A secondary control beside a label: 2rem tall, above WCAG 2.2's 24px target, so the label's row stays a label's. */
.btn.editor__link { min-height: 2rem; padding-block: 0; padding-inline: var(--space-xs); font-size: var(--text-sm); }

/* The eye beside a password box (the author, 2026-11-02: "Icon only", "to the right of the password field"): on the
   box's own row, at its right, a square as tall as the box; the label above and any message below span both columns.
   Without the script the cell is empty and the box keeps the row. data-shown is the script's (160): an open eye while
   the password is hidden, a closed one once it shows. */
.field:has(> .field__show) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-2xs);
  align-items: center;
}
.field:has(> .field__show) > * { grid-column: 1 / -1; }
.field:has(> .field__show) > input { grid-column: 1; grid-row: 2; }
.field:has(> .field__show) > .field__show { grid-column: 2; grid-row: 2; display: flex; align-self: stretch; }
.btn.field__show-button { min-height: var(--tap-min); min-width: var(--tap-min); padding: 0; justify-content: center; align-self: stretch; }
.field__eye--closed,
.field__show-button[data-shown] .field__eye--open { display: none; }
.field__show-button[data-shown] .field__eye--closed { display: inline; }

/* Search is primary navigation on mobile. Nobody browses a 500-page hierarchy
   on a phone, so it stays visible in the header at every width. */
.site-search {
  flex: 1 1 auto;
  max-width: 22rem;
}

/* Drawer nav below the tablet breakpoint, persistent sidebar above it. */
.nav-toggle { display: inline-flex; }

.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: var(--z-drawer);
  width: min(20rem, 85vw);
  background: var(--bg-raised);
  border-inline-end: 1px solid var(--border);
  padding: var(--space-sm);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-100%);
  transition: transform var(--dur) var(--ease);
}
.drawer[data-open] { transform: translateX(0); }

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-drawer) - 1);
  background: rgb(0 0 0 / 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.drawer-scrim[data-open] { opacity: 1; pointer-events: auto; }

@media (min-width: 60rem) {
  .nav-toggle, .drawer-scrim { display: none; }
  .drawer {
    position: sticky;
    top: 5rem;
    transform: none;
    height: fit-content;
    max-height: calc(100dvh - 6rem);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .with-sidebar {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
  }
}

/* --- Admin ---------------------------------------------------------------- */

.admin-table { font-size: var(--text-sm); }
.admin-table th, .admin-table td { vertical-align: top; }

/* A feedback message on its admin page (407): the words as the player broke them into lines, and the screenshot within
   the page at any width. */
.feedback__words { white-space: pre-wrap; overflow-wrap: anywhere; max-width: var(--measure); }
.feedback__shot { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); }
.admin-table__email { font-weight: 600; }
.admin-table__none { color: var(--fg-faint); }

/* The roster, which is a RECORD under docs/DESIGN.md - consulted rather than read, so a table is
   right and density is not a fault. It borrows .admin-table because the shape is identical and a
   second table style would be two things to keep in step; what it adds is one rule.

   NOTE - docs/DESIGN.md used to say game screens belong in game.css. That file does not exist and
   the character sheet's .sheet rules are here too, so this follows the code. DESIGN.md now says the
   same, and FE-39 carries the move with what it costs. Do it in one pass or not at all. */
.roster__rung {
  color: var(--fg-faint);
  font-size: var(--text-xs);
  /* On its own line below the trade at 390px, beside it once there is room. A rung is a
     qualification on the trade rather than a second fact, so it should never read as a column. */
  display: block;
}

@media (min-width: 30rem) {
  .roster__rung {
    display: inline;
    margin-inline-start: var(--space-3xs);
  }
}

/* On a phone the roster is not a table to scroll sideways (the UI audit, 2026-10-19, G09): each character is a
   block of two lines - the name and their kind, then the trade with its rung and the aspect - each field named by
   its column's label, so nothing is cut at the frame's edge. The table's own header stays for a screen reader. */
@media (max-width: 29.99rem) {
  .roster, .roster tbody, .roster tr, .roster th, .roster td { display: block; }
  .roster caption { display: block; text-align: start; }
  .roster thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .roster tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-3xs) var(--space-sm);
    padding-block: var(--space-xs);
    border-block-end: 1px solid var(--border);
  }
  .roster th, .roster td { padding: 0; border: 0; min-width: 0; }
  .roster td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--fg-faint);
  }
  .roster td[data-label="Species"] { text-align: end; }
  .roster td[data-label="Species"]::before { display: none; }
  /* A date in words is long: it takes the card's whole width rather than wrapping in half of it (G6). */
  .roster td[data-label="In the Reach since"] { grid-column: 1 / -1; }
}

/* The living and present by default (the author, 2026-10-24, G6): the away, the dead and those who left are sent and
   listed, and a box shows each - by CSS alone, so the boxes need no script. A row roster.js filters out carries
   `hidden`, which the phone's grid would otherwise draw. */
.roster-view:not(:has(#roster-show-away:checked)) .roster tr[data-absent],
.roster-view:not(:has(#roster-show-dead:checked)) .roster tr[data-dead],
.roster-view:not(:has(#roster-show-left:checked)) .roster tr[data-left],
.roster tr[hidden] { display: none; }

.roster-controls__shows {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-md);
}

/* The filters and, on a phone, the sort: drawn hidden by the server and shown by roster.js (337). */
.roster-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: var(--space-2xs) var(--space-sm);
  margin-block-end: var(--space-sm);
}
/* The fold waits for roster.js (one switch for the boxes and the filters, the author's look, 2026-10-24). */
.roster-view:not([data-roster-ready]) .roster-find { display: none; }
.roster-find { margin-block-end: var(--space-sm); }
/* The boxes close over the filters: their 44px targets are the gap (the same look). */
.roster-find > .roster-controls__shows { margin-block: var(--space-2xs) 0; }
.roster-find > .roster-controls { margin-block: 0; }
/* The name box the height of the selects beside it: a search box grows with the line height, a select does not, and
   the box stood lower than the row (the author, 2026-10-24). */
.roster-controls :is(input, select) { height: var(--tap-min); }
.roster-controls .field { margin: 0; }
.roster-controls__sort { display: none; }
@media (max-width: 29.99rem) {
  .roster-controls__sort { display: block; }
}

/* A sortable heading is a button in the heading's own type, with the arrow for the way it is sorted. */
.roster__sort {
  min-height: var(--tap-min);
  margin-block: calc((var(--tap-min) - 1.5em) / -2);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.roster th[aria-sort="ascending"] > .roster__sort::after { content: " \25B4"; }
.roster th[aria-sort="descending"] > .roster__sort::after { content: " \25BE"; }

.roster__none { margin-block: var(--space-sm); color: var(--fg-muted); }

/* What the town has named somebody, under their name at every width: a title is recognition of the
   person, so it belongs with the name rather than beside it, and a name followed by "Vaticinator,
   Assessor" inline would read as a longer name. Regular weight so the name stays the row's heading. */
.roster__titles {
  display: block;
  color: var(--fg-muted);
  font-size: var(--text-xs);
  font-weight: 400;
}

/* Wraps at 390px rather than forcing the table wider than the screen. The table
   itself scrolls inside .table-wrap if it still cannot fit. */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3xs);
}

.admin-actions select { width: auto; min-width: 7rem; }

/* The calendar's draws for a week (D5), under what it asked. */
.calendar__drawn { display: block; }

/* The band over an admin's read of another player's sheet (D4). */
.sheet__admin-band { margin-block: var(--space-xs) var(--space-sm); }

/* An editor's foot (D9): keeping the draft on one side, the next step on the other, with what it does above it. */
.editor-actions { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-sm); }
.editor-actions__next { display: grid; justify-items: end; gap: var(--space-3xs); margin-inline-start: auto; text-align: end; }
.editor-actions__next .field__hint { margin: 0; }

/* The admin front page's list of every page, by group (D1). */
.admin-pages { display: grid; gap: var(--space-sm); margin-block: var(--space-md); }
@media (min-width: 48rem) { .admin-pages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.admin-pages__heading { margin: 0 0 var(--space-3xs); font-size: var(--text-lg); }
.admin-pages__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3xs); }
/* A page, its count after it, and while one of its alarms is on the warning mark: the accounts table's ⚠ in --danger,
   a .tip whose panel says the alarms (the author, 2026-11-02). */
.admin-pages__page { position: relative; display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-xs); }
.admin-pages__count { color: var(--fg-muted); font-family: var(--font-ui); font-size: var(--text-sm); }
/* The panel hangs from the page's row, not the mark, so on a phone it never runs off the column's edge. */
.tip.admin-pages__tip { position: static; display: inline-block; }
.admin-pages__tip .tip__toggle { display: inline; }
.admin-pages__warn {
  display: inline-grid;
  place-items: center;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  margin-block: calc((var(--tap-min) - 1.5em) / -2);
  color: var(--danger);
  font-size: var(--text-lg);
  cursor: pointer;
  list-style: none;
}
.admin-pages__warn::-webkit-details-marker { display: none; }
.admin-pages__tip .tip__panel { inset-inline: 0 auto; margin-inline: 0; width: min(22rem, 100%); }
.admin-pages__tip .tip__panel::before { display: none; }
.admin-pages__alarms { font-family: var(--font-ui); font-size: var(--text-sm); }
.admin-pages__alarms ul { margin: 0; padding: 0; list-style: none; }
.admin-pages__alarms li + li { margin-block-start: var(--space-3xs); }

.admin-actions .btn {
  min-height: var(--tap-min);
  padding-inline: var(--space-xs);
  font-size: var(--text-xs);
}

.tag {
  display: inline-block;
  margin-inline-start: var(--space-3xs);
  padding: 0 var(--space-3xs);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--fg-faint);
  white-space: nowrap;
}

.tag--warn { border-color: var(--danger); color: var(--fg-muted); }

/* --- Account pages -------------------------------------------------------- */

/* A sign-in form has no reason to be as wide as an article. Narrower than
   --measure so the fields read as a form rather than as prose. */
.auth {
  max-width: 26rem;
  margin-inline: auto;
}

/* Wider, for a page whose content needs more than a form column — the creation steps
   that list every species and every profession. The comment here used to say "recovery
   codes or a table"; no page has ever used it for that. */
.auth--wide { max-width: var(--measure); }

/* A page that asks before anything else (Before you go on): its title centred over the form, with room under it. */
.auth__title { text-align: center; margin-block-end: var(--space-lg); }

/* Left over from the Bootstrap grid: the pages wrap their form in a .row/.col pair.
   Renaming rather than unwrapping keeps the element count identical, which is what
   makes the sweep safe to do mechanically across thirty files.

   WATCH OUT — margin-inline is the fix for a real bug and is not decorative. Without
   it this column is left-aligned inside its parent. On a plain .auth that is invisible,
   because both are 26rem and there is no slack to be aligned within; on .auth--wide the
   parent is 66ch, so the heading and the progress rules spanned the full width while the
   content sat in a 26rem column hugging the left edge. It read as the list being off
   centre, and it was really the list being the only thing NOT centred. */
.auth__body {
  max-width: 26rem;
  margin-inline: auto;
}

/* A wide page asked to be wide, so its body fills it rather than re-narrowing to the
   form column. Choice blocks are the reason: they carry a label and a sentence of
   consequence, and re-capping them at 26rem wastes the width the page asked for. */
.auth--wide .auth__body { max-width: none; }
/* A reference mark on the error page is one unbroken word, longer than a phone is wide (259). */
.auth__body code { overflow-wrap: anywhere; }

.auth__alt {
  margin-block-start: var(--space-md);
  padding-block-start: var(--space-sm);
  border-block-start: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}

.auth__alt p { margin-block: var(--space-3xs); }

/* One column at 390px; the nav moves beside the panel once there is room. */
.account-layout {
  display: grid;
  gap: var(--space-md);
  align-items: start;
}

@media (min-width: 48rem) {
  .account-layout { grid-template-columns: 14rem minmax(0, 1fr); }
}

/* The account menu (A04): a toggle naming the page below 48rem, the links shown only once it is open; a sidebar
   from 48rem, the toggle gone. */
.account-menu__summary {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap-min);
  padding-inline: var(--space-xs);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-raised);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.account-menu__summary::-webkit-details-marker { display: none; }
.account-menu__summary::after { content: " \25BE"; margin-inline-start: auto; }
.account-menu__toggle[open] .account-menu__summary::after { content: " \25B4"; }
.account-menu__items { display: none; margin-block-start: var(--space-2xs); }
.account-menu__toggle[open] + .account-menu__items { display: block; }
@media (min-width: 48rem) {
  .account-menu__toggle { display: none; }
  .account-menu__items { display: block; margin-block-start: 0; }
}

/* A section's heading and its fields share one edge in the panel (A05): .auth centres itself to read as a form on its
   own page, and inside the panel that left the heading alone in the middle and the fields far to the right. */
.account-layout__panel .auth { margin-inline: 0; }
.account-layout__panel .auth__body { margin-inline: 0; }

.account-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-nav__link {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding-inline: var(--space-xs);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--fg-muted);
  text-decoration: none;
}

.account-nav__link:hover { background: var(--paper-sunken); color: var(--fg); }

.account-nav__link.active {
  background: var(--bg-raised);
  border-inline-start: 3px solid var(--accent);
  color: var(--fg);
  font-weight: 600;
}

/* The status banner. Success is quiet; a failure earns the accent. */
.notice--error {
  border-color: var(--danger);
  color: var(--fg);
}

/* The alarms at the front of /admin - decision 091. A notice rather than a danger box: an alarm is
   something to do, not something broken, and --danger is kept for errors and destruction. Each alarm is a
   link, and the whole line is the target at 44px, because an admin reads this on a phone too. */
.alarms { margin-block: var(--space-sm) var(--space-md); }
.alarms__none { color: var(--fg-muted); }
.alarms__list {
  list-style: none;
  margin: 0;
  display: grid;
  gap: var(--space-3xs);
}
.alarms__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
}

/* Every admin edit of a draft, on the draft (106): a disclosure per edit, its changed lines as "Was" and "Now".
   A line is authored text and can be one long sentence, so it wraps anywhere rather than widening the page. */
.admin-edits { margin-block: var(--space-sm) var(--space-md); }
.admin-edits__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3xs); }
.admin-edits__lines { margin: var(--space-2xs) 0 0; display: grid; gap: var(--space-3xs); }
.admin-edits__line { display: grid; grid-template-columns: 3rem 1fr; gap: var(--space-2xs); }
.admin-edits__line dt { font-size: var(--text-xs); color: var(--fg-muted); }
.admin-edits__line dd { margin: 0; overflow-wrap: anywhere; }
.admin-edits__line--was dd { color: var(--fg-muted); text-decoration: line-through; }

/* What the town meets next, under the alarms - the front page's one panel that is not an alarm (091). A card,
   because it is a standing fact rather than something to do. */
.coming { margin-block: 0 var(--space-md); }
.coming > * + * { margin-block-start: var(--space-2xs); }
.coming h2 { margin-block-start: 0; }

/* A checkbox is the one input that must not stretch to the full width. */
.field--check {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap-min);
}

/* The scaffolding wraps the box inside its own label, so the selector has to reach
   through one level rather than assume they are siblings. */
.field--check input[type="checkbox"] {
  width: auto;
  min-height: 0;
  flex: 0 0 auto;
  margin-inline-end: var(--space-2xs);
}

.field--check label {
  display: flex;
  align-items: center;
  margin: 0;
  font-family: var(--font-ui);
}

/* A box with its hint beneath (registration's game news): the 44px target is kept, but grown upward, so the words sit
   at its foot and the hint follows them with no gap (the author, 2026-10-23). */
.field--check:has(+ .field__hint) { align-items: flex-end; }
.field--check:has(+ .field__hint) label {
  line-height: 1.5;
  padding-block-start: calc(var(--tap-min) - 1.5em);   /* the box stays centred on its words; the target grows up */
}
.field--check + .field__hint { margin-block-start: 0; }

/* --- Forms --------------------------------------------------------------- */

input, select, textarea, button {
  font: inherit;
  color: inherit;
}

input, select, textarea {
  /* 16px minimum. Anything smaller makes iOS Safari zoom the viewport on focus,
     which looks broken and strands the user at the wrong scale. */
  font-size: max(1rem, var(--text-base));
  font-family: var(--font-ui);
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-2xs) var(--space-xs);
  /* Set into the page, its edge at 3:1 or better in both themes (WCAG 1.4.11; FE-10): a field's fill differs from the
     paper by 1.06:1, so the edge is the only thing that shows where to type. It was --rule-strong, 2.39:1. */
  background: var(--paper-sunken);
  border: 1px solid var(--rule-control);
  border-radius: var(--radius);
  box-shadow: var(--depth-inset);
}
input[type="checkbox"], input[type="radio"] { box-shadow: none; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

label {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-block-end: var(--space-3xs);
}

.field { margin-block-end: var(--space-sm); }
/* Registration's trap field (S4): off the page, out of the tab order and hidden from a screen reader, so no person fills
   it; a script that fills every field does. Not display: none, which a careful script skips. */
.trap { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* A confirmed address says so beside the word Email, on the label's own line (the author, 2026-10-23). */
.field__confirmed { margin-inline-start: var(--space-2xs); color: var(--secondary); font-weight: 600; }

/* A group of radios under one label - the origin step's (291). The legend reads as a field's label, and the fieldset
   draws nothing of its own. */
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-inline-size: 0; }
fieldset.field > legend {
  padding: 0;
  margin-block-end: var(--space-2xs);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* A radio with a line saying what it means (the feedback form's kinds, 407): the radio at its own size beside its name,
   the line under the name, and the name grown to the 44px target. The general input rule would stretch the radio across
   the row (the author, 2026-11-02: "the selection formatting is off"). */
.field__option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--space-xs);
  align-items: center;
  max-width: var(--measure);
  min-height: var(--tap-min);
  padding-block: var(--space-3xs);
  margin: 0;
  font-family: var(--font-ui);
  cursor: pointer;
}
.field__option input[type="radio"] {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.field__option-name { font-weight: 600; }
.field__option .field__hint { grid-column: 2; margin-block-start: 0; line-height: 1.35; }

/* The screenshot slot (feedback, 2026-11-02): the chooser, then what is chosen - a small preview, its name, and at the far
   right the red X that takes it out, the whole 44px. A drop over it is shown by an outline. */
.shot-pick__chosen {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-block-start: var(--space-2xs);
  max-width: var(--measure);
}
.shot-pick__chosen[hidden] { display: none; }
.shot-pick__preview {
  flex: 0 0 auto;
  width: 4rem;
  height: 3rem;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.shot-pick__name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-family: var(--font-ui); font-size: var(--text-sm); }
.shot-pick__remove {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: var(--tap-min);
  height: var(--tap-min);
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--danger);
  cursor: pointer;
}
.shot-pick[data-dropping] { outline: 2px dashed var(--accent); outline-offset: var(--space-2xs); }

/* A Cryptum's kin family is asked only of a kin's body: hidden until Kin is the body picked, by :has() alone (002). */
.origin__families--kin-host { display: none; }
.origin:has(input[name="Input.Host"][value="kin"]:checked) .origin__families--kin-host { display: block; }

.field__hint {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--fg-muted);
  margin-block-start: var(--space-3xs);
}

/* A link in a hint takes vertical padding, and it is the same rule and the same
   arithmetic as .sheet__note a. 14px type is a 15px hit area, barely a third of
   --tap-min, and the links that carry a reader between the week and the record
   are hints. Padding on an INLINE element grows the hit box without touching the
   line box, so unlike .site-nav__link this needs no compensating negative margin
   and moves nothing — measured before and after at 390, 768 and 1280. */
.field__hint a { padding-block: calc((var(--tap-min) - 1.15em) / 2); }

/* Errors state what happened and what to do. They don't apologise. */
.field__error {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--danger);
  margin-block-start: var(--space-3xs);
}
/* A refused field shows it three ways (NN/g forms 10; FE-10): its edge and fill, its message beside it in the bold, and
   aria-invalid. Blazor writes the class invalid and aria-invalid on a field whose model refused it; the old rule here
   waited for a data-invalid nothing ever set. */
input.invalid, select.invalid, textarea.invalid,
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-wash);
  box-shadow: inset 0 0 0 1px var(--danger), var(--depth-inset);
}
/* A box whose answer has a known length is sized to it (NN/g forms 6; FE-10). */
.field__input--code { width: 9rem; letter-spacing: 0.12em; }
.field__input--recovery { width: 14rem; letter-spacing: 0.06em; }
/* A form that is one button among links, in their line. A class, never a style attribute, which the site's policy
   refuses (SecurityHeaders). */
.form--inline { display: inline-block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xs);
  min-height: var(--tap-min);
  padding-inline: var(--space-md);
  font-family: var(--font-ui);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent-strong);
  color: var(--paper-raised);
  cursor: pointer;
  /* An anchor styled as a button inherits the global link underline, which reads as a
     text link sitting inside a filled rectangle. */
  text-decoration: none;
  /* Raised (FE-10): lit from above, a shadow beneath, a lift on hover and inset when pressed. */
  background-image: linear-gradient(rgb(255 255 255 / 0.16), rgb(255 255 255 / 0) 55%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 1px 2px rgb(30 15 40 / 0.35), 0 5px 12px -4px rgb(30 15 40 / 0.4);
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.35); }
/* WATCH OUT — the colour here is not redundant, and leaving it out made every
   anchor-button on the site unreadable on hover.

   `a:hover { color: var(--accent) }` is an element plus a pseudo-class, so its
   specificity is (0,1,1) and it BEATS `.btn`'s (0,1,0). An <a class="btn"> therefore
   took `--accent` text on the `--accent` background this rule sets: purple on the
   identical purple, invisible. A <button class="btn"> was fine, which is why it looked
   intermittent — it depended on which element the button happened to be.

   `.btn:hover` is (0,2,0) and wins, so restating the colour is the whole fix. Any
   future .btn variant must restate its own colour on hover for the same reason. */
.btn:hover {
  background-color: var(--accent);
  color: var(--paper-raised);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 2px 3px rgb(30 15 40 / 0.35), 0 10px 18px -6px rgb(30 15 40 / 0.45);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--quiet {
  background: transparent;
  background-image: var(--depth-light);
  color: var(--fg);
  border-color: var(--rule-strong);
  box-shadow: var(--depth-plate);
}
.btn--quiet:hover {
  background-color: var(--paper-sunken);
  color: var(--fg);
  box-shadow: var(--depth-plate);
}
.btn--quiet:active { box-shadow: var(--depth-pressed); }

.btn--danger { background: var(--danger); }
/* Restated on hover, as the note above says every variant must be: without it .btn:hover turned Delete purple. */
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 85%, var(--fg)); color: var(--paper-raised); }

/* Full-width primary actions on mobile. A thumb should not have to aim. */
.btn--block { width: 100%; }
@media (min-width: 40rem) {
  .btn--block { width: auto; }
}

/* --- Multi-step forms ---------------------------------------------------- */

.steps {
  display: flex;
  gap: var(--space-3xs);
  list-style: none;
  padding: 0;
  margin-block-end: var(--space-md);
}
.steps li {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--rule);
}
.steps li[data-done]    { background: var(--accent); }
.steps li[data-current] { background: var(--accent-strong); }

/* --- Accessibility ------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* A heading Blazor focuses on arrival. FocusOnNavigate (Routes.razor) moves focus to the page's <h1> after every
   navigation, so a screen reader starts reading there; the browser then drew the ring above around it, and the author
   saw every page load with its title "selected" (2026-10-12). A heading is not a control: it is never in the tab order
   and does nothing when pressed, so a ring on it tells a keyboard user nothing. Every control keeps its ring. */
h1:focus,
h1:focus-visible {
  outline: none;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-2xs);
  inset-block-start: -100%;
  z-index: calc(var(--z-header) + 1);
  padding: var(--space-2xs) var(--space-sm);
  background: var(--accent-strong);
  color: var(--paper-raised);
  border-radius: var(--radius);
}
.skip-link:focus { inset-block-start: var(--space-2xs); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Tables, which are the usual cause of horizontal overflow ------------ */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;

  /* WATCH OUT — position: relative is what CONTAINS the absolutely-positioned
     .visually-hidden captions and column labels inside the table. Without it their
     containing block is the initial one, so a hidden label sitting at x=520 inside a
     scrollable table extends the DOCUMENT's scrollWidth to 521 while the table itself
     scrolls correctly inside this element. body has overflow-x: hidden, so that is an
     invisible clip rather than a scrollbar, and the only way to see it is to measure
     documentElement.scrollWidth. Found on /admin/events at 390px. */
  position: relative;
}

table { border-collapse: collapse; width: 100%; font-family: var(--font-ui); }
th, td {
  text-align: start;
  padding: var(--space-2xs);
  border-block-end: 1px solid var(--border);
}
th { font-size: var(--text-sm); color: var(--fg-muted); font-weight: 600; }

/* --- The chronicle index -------------------------------------------------- */

/* Two levels of native <details>: a category, then a subcategory, then the articles.
   <details> rather than a click handler for decision 108's reasons — nothing to re-run
   on enhancedload, works with JavaScript off, and keyboard and screen-reader behaviour
   come free. Which branch arrives open is a server-rendered attribute driven by ?open=,
   because CSS cannot force one open and revealing its children instead is decision 125's
   trap: the closed element measures 0px and collapses whatever holds it. */
.index { margin-block-start: var(--space-lg); }

/* The index page's one column (W07): the measure .prose and .search already keep, so the featured card and the
   categories share their left edge. 66ch resolves in the same inherited face, so the widths agree. */
.index-column { max-width: var(--measure); margin-inline: auto; }

/* Watch out — .index carried `columns: 2` at 48rem and `columns: 3` at 72rem, to stop a
   103-item flat list running down one enormous column. Collapsed, the list is FIVE rows,
   and multi-column then does active harm: five rows distribute across three columns, so a
   reader scanning downward meets them in the order 1,2 | 3,4 | 5 rather than the order
   content/navigation.txt carefully gives them, and expanding one makes its column nine
   hundred pixels tall while the others stay at eighty. The rule was solving the problem
   this change removes, so it is gone from here and moved inside an open subcategory, where
   the length actually is. */

.index__section {
  border-block-end: 1px solid var(--rule-strong);
}

.index__section-name,
.index__group-name {
  display: flex;
  /* Centre rather than baseline: an SVG has no baseline of its own, so a
     baseline-aligned icon hangs below the cap line of the text beside it. */
  align-items: center;
  gap: var(--space-2xs);
  cursor: pointer;
  /* The whole row is the target, so it carries the floor itself rather than relying on
     the type inside it — which is measured after a webfont loads and is not a guarantee. */
  min-height: var(--tap-min);
  /* Our own chevron is the affordance, so the user agent's triangle goes. Both spellings
     are needed; ::-webkit-details-marker is still what WebKit reads. */
  list-style: none;
}
.index__section-name::-webkit-details-marker,
.index__group-name::-webkit-details-marker { display: none; }

.index__section-name {
  font-size: var(--text-lg);
  margin-block: 0;
}

.index__group-name {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-block: 0;
}

.index__section-name:hover,
.index__group-name:hover { color: var(--accent-strong); }

.index__count {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg-faint);
  margin-inline-start: auto;
}

/* \25BE and \25B4, never \2303/\2304 — the latter render as a thin stray caret in several
   system stacks and read as a typo. The same pair .reveal already uses. */
.index__section-name::after,
.index__group-name::after {
  content: "\25BE";
  color: var(--fg-faint);
  font-size: var(--text-sm);
}
.index__section[open] > .index__section-name::after,
.index__group[open] > .index__group-name::after { content: "\25B4"; }

/* A subcategory is indented once so the two levels read as a tree. Once, not twice: at
   390px a second indent on the entries themselves is width a title needs more. */
.index__group { padding-inline-start: var(--space-2xs); }

.index__pages {
  list-style: none;
  padding: 0;
  margin-block: var(--space-3xs) 0;
}

.index__link {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2xs);
  /* Padding gives a thumb something to hit; the row is the target, not the words. */
  padding-block: var(--space-2xs);
  text-decoration: none;
  color: var(--fg);
  border-block-end: 1px solid var(--border);
}

/* The mark sits quieter than the title it labels — it is a category, not the name. */
.index__link .icon--entry {
  color: var(--fg-faint);
  /* Optically centres the icon on the first line of the title rather than on the
     whole wrapped block, which is where flex-start would otherwise put it. */
  margin-block-start: 0.15em;
}
.index__link:hover .icon--entry { color: var(--accent-strong); }

.index__title {
  min-width: 0;
  /* As .page-list__link: a link at rest (G07, W06). */
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.index__link:hover { color: var(--accent-strong); background: var(--bg-raised); }

/* The width earns its keep here rather than at the top level: an open subcategory is
   where the length is — Monsters is twelve entries, Regions eleven — and reflow is
   contained inside the one group a reader has opened, so nothing above or below it moves.
   `.index__entry` takes the `break-inside` that stops a title being orphaned from its
   summary across a column break, and it takes it in lore.css where that block already
   lives rather than in a second block here. */
@media (min-width: 48rem) {
  .index__pages { columns: 2; column-gap: var(--space-xl); }
}
@media (min-width: 72rem) {
  .index__pages { columns: 3; }
}

/* --- The invitation above the categories ---------------------------------- */

/* Always visible, never behind a tap: it is the page that explains what the categories
   are, so putting it inside one inverts that. A .card rather than something new, because
   the point is that it reads as a different kind of object from the list below it. */
.index__featured {
  display: block;
  margin-block-start: var(--space-lg);
  text-decoration: none;
  color: var(--fg);
}
.index__featured:hover { border-color: var(--accent); }
.index__featured:hover .index__featured-title { color: var(--accent-strong); }

.index__featured-title {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-block-start: var(--space-3xs);
}

.index__featured-summary {
  display: block;
  color: var(--fg-muted);
  margin-block-start: var(--space-3xs);
  /* The panel spans the index's full width — 1072px at 1280 — and this is the one line of
     real prose on the page. `.index__summary` already caps an entry's summary the same way;
     without it the invitation is the only sentence on the site set wider than it reads. */
  max-width: var(--measure);
}

/* --- The crumb back to an article's own branch of the index ----------------- */

/* Inside a .label, so it inherits the small uppercase face. An underline rather than the
   accent colour: it is navigation a reader can take, and an accent breadcrumb above every
   article heading on the site would be the loudest thing on the page.
   Padding on an INLINE element grows the hit box without touching the line box, so unlike
   .site-nav__link it needs no compensating negative margin and moves nothing —
   the same measurement .sheet__note a and .field__hint a already record. */
.crumb {
  color: inherit;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.25em;
  padding-block: calc((var(--tap-min) - 1.15em) / 2);
}
.crumb:hover { color: var(--accent-strong); text-decoration-color: currentColor; }

/* --- Search --------------------------------------------------------------- */

.search {
  display: flex;
  gap: var(--space-2xs);
  max-width: var(--measure);
  margin: var(--space-md) auto 0;
}

.search__input { flex: 1 1 auto; }

.search__button { flex: 0 0 auto; }

.search__summary {
  max-width: var(--measure);
  margin: var(--space-md) auto var(--space-2xs);
}

/* --- Back link ------------------------------------------------------------ */

/* The wrapper carries the width, in the body font, so it lines up with the reading
   column. --measure is 66ch and ch is font-relative: 66ch of the UI font is much
   narrower than 66ch of the body font, so putting the max-width on the link itself
   indented it well inside the text below. */
/* Sticky beneath the site header, which is itself sticky at top:0. --header-h is
   measured by wiki-back.js because the header grows at 30rem when the brand does;
   the fallback here is the mobile height and is only ever used before the script
   runs, or if it does not. */
.back-row {
  position: sticky;
  top: var(--header-h, 3.875rem);
  z-index: calc(var(--z-header) - 1);
  display: flex;
  align-items: baseline;
  gap: var(--space-2xs);
  max-width: var(--measure);
  margin-inline: auto;
  padding-block: var(--space-3xs);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

/* The title appears only once the real heading has scrolled away, so the two are
   never on screen together. */
.back-row__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: end;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--fg-muted);
  opacity: 0;
  transition: opacity 120ms ease;
}

.back-row--titled .back-row__title { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .back-row__title { transition: none; }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  min-height: var(--tap-min);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
}
.back-link:hover { color: var(--accent-strong); }


/* --- Choices — archetype 4, and the pick step of a form flow ---------------
   docs/DESIGN.md owns this. A choice is NOT a button in a row: it is a block
   the width of the text, with a verb as its label and a sentence of consequence
   under it, tappable across its whole area. Stacked, never side by side — at
   390px a row of choices is three cramped columns, and on desktop a row invites
   a scan rather than a read. A weekly decision deserves to be read.

   The state attributes are data-* rather than classes because the server renders
   them, which is this project's own naming rule. */

.choice-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.choice {
  display: block;
  padding: var(--space-sm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-raised);
  cursor: pointer;
}

.choice:hover { border-color: var(--rule-strong); }

/* The whole block is the target, so the radio itself is hidden rather than
   shrunk — a 13px radio beside a tappable block is two hit areas for one
   choice, and the small one is the one a thumb finds first. */
.choice--pick input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Focus has to land on the block, because the input it belongs to is hidden. */
.choice--pick:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.choice--pick:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.choice__label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2xs);
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--fg);
}

.choice__consequence {
  display: block;
  margin-block-start: var(--space-3xs);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--fg-muted);
}

/* The reading's Details button, to the right of each aspect (the author, 2026-10-12), opening its own section of
   /wiki/aspects. A sibling of the choice, never inside its label, so following it never picks the aspect. The
   choice takes the rest of the row and wraps its own text; the button keeps its width. */
.choice-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.choice-list__item > .choice {
  flex: 1;
  min-width: 0;
}

.choice__more {
  flex: none;
  padding-inline: var(--space-sm);
  font-size: var(--text-sm);
}

/* Refuse the call sits apart from the five, quieter than the pick. */
.reading__refusal {
  margin-block-start: var(--space-lg);
  padding-block-start: var(--space-md);
  border-block-start: 1px solid var(--rule);
}

/* A count is a record, not prose — Archivo, like every other figure on a record
   surface. */
/* A heading over one group of choices, where a screen offers two (the backgrounds, 290): the second stands clear of
   the first list's last tile. */
.choice-group__heading { margin-block: var(--space-md) var(--space-2xs); }
.choice-list + .choice-group__heading { margin-block-start: var(--space-lg); }

.choice__count {
  display: block;
  margin-block-start: var(--space-2xs);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--fg-faint);
}

/* The chosen one, and the ones that were not. A record of a decision with the
   alternatives erased is not a record of a decision, and in two hundred weeks
   the chronicle is the only artefact a late arrival has. */
.choice[data-chosen] {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.choice[data-past] {
  border-style: dashed;
  background: transparent;
  color: var(--fg-faint);
}
.choice[data-past] .choice__label { color: var(--fg-muted); }

/* A closed week is a results view (the author, 2026-10-16): the part taken and how it went lead, and the choices not
   taken follow, folded. */
.choices-past { margin-block-start: var(--space-md); }
.choices-past > .choice-list { margin-block-start: var(--space-xs); }

/* Barred: shown, never hidden, and NOT a control — no cursor, nothing to focus,
   nothing that looks tappable. Styled quieter rather than broken: --danger is
   for something going wrong, and a choice you have not grown into yet is not an
   error. */
.choice[data-barred] {
  cursor: default;
  border-style: dashed;
  background: transparent;
  opacity: 0.75;
}
.choice[data-barred]:hover { border-color: var(--rule); }
.choice__barred { color: var(--fg-muted); font-size: var(--text-sm); }
.choice__barred-lead {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-inline-end: var(--space-3xs);
}

/* What taking a choice costs — Dangerous, Strenuous — as a pill inside the
   label (ChoiceTagList.razor), the author's call of 2026-09-29. It replaced a
   leading edge that the selected state painted over, so a pill must stay the
   same whether or not its choice is checked: it sets its own ground.
   Madder on the madder wash, for every tag: the one place madder marks
   something that is not an error or a destruction (docs/DESIGN.md §1). Named as
   the hue rather than --danger, since nothing has gone wrong; working hurt is a
   legitimate choice. Contrast, computed: 6.30:1 light, 4.95:1 dark.
   Orthogonal to barred — barred means cannot be taken, a tag means takeable and
   it costs you — so a barred choice carries none. */
/* A choice's tags at the top-right of its card, each a .tip (G1; the corner the author picked, 2026-10-24). The pills
   are outside the <label>, placed over the room ChoiceTagRoom floats at the end of the title's first line, which is the
   same pills unseen - so the title wraps around them and the two boxes are one size. The inset is the card's own
   padding - the brass frame's 14px in the game's register - and the drop sets a pill on the title's first line rather
   than at its top edge, for both alike. */
.choice-list > li { --choice-inset: var(--space-sm); --tag-drop: 0.3rem; }
.site-main[data-register="game"] .choice-list > li { --choice-inset: calc(14px + var(--space-2xs)); }
.choice-list > li:has(> .choice__tags) { position: relative; }
.choice__label:has(> .choice__tags-room) { display: block; }
.choice__tags-room {
  float: inline-end;
  visibility: hidden;
  margin-block-start: var(--tag-drop);
  margin-inline-start: var(--space-xs);
}
.choice__tags,
.choice__tags-room {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  line-height: var(--leading-snug);
}
.choice__tags {
  position: absolute;
  inset-inline-end: var(--choice-inset);
  inset-block-start: calc(var(--choice-inset) + var(--tag-drop));
}
.choice__tip > .tip__toggle > summary { list-style: none; cursor: help; }
.choice__tip > .tip__toggle > summary::-webkit-details-marker { display: none; }
.choice__tip .tip__panel {
  inset-inline: auto 0;
  width: min(18rem, calc(100vw - 4 * var(--gutter)));
  margin: var(--space-3xs) 0 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  text-transform: none;
  letter-spacing: normal;
}
.choice__tip .tip__panel::before { inset-inline: auto var(--space-sm); }

/* The barred choices' fold, after the takeable ones (G1). */
.choice-list__barred { margin-block-start: var(--space-2xs); }
.barred-fold > .choice-list { margin-block: var(--space-2xs) 0; }

/* A page's one action, centred where it stops being full width (G1, G3); on a phone it stays the full width. */
@media (min-width: 40rem) {
  .btn--centre { display: flex; width: fit-content; margin-inline: auto; }
}

/* The town history's pager (G4): newer on the left, older on the right, as the list reads down to the past. */
.history-pager { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-block: var(--space-md) 0; }
.history-pager__older { margin-inline-start: auto; }

/* What the Reach asks: larger, centred and close to its title, which it introduces (G1). */
.town-asks__label { text-align: center; font-size: var(--text-base); letter-spacing: 0.01em; text-transform: none; margin-block-end: var(--space-3xs); }
.town-asks__title { text-align: center; margin-block-start: 0; }

.choice__tag {
  margin-inline-start: 0; /* the label's flex gap spaces it */
  border-color: var(--madder);
  background: var(--madder-wash);
  color: var(--madder);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: no-preference) {
  .choice { transition: border-color var(--dur-fast) var(--ease); }
}

/* --- The decision screen — archetype 4 -------------------------------------
   docs/DESIGN.md: "A situation in prose, then choices. It is closest to the
   reading page and should feel like it: the same measure, the same body face,
   the same tooltips on [[slug]] terms." And: "--veil and nothing else behind
   it", which is why the markup pairs .decision with the .veil utility rather
   than this rule setting a background of its own — one bloom, declared in one
   place, used by whatever wants to feel lit.

   It carries the gutter and the vertical room, because the screen is a panel a
   week sits inside rather than a document that starts at the top of the page.
   The reading column itself is .prose, unchanged, so a decision measures exactly
   what a wiki page measures — which is the whole of "should feel like it". */

.decision {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--space-lg);
  border-radius: var(--radius);
}

/* The choices are a block of their own, not another paragraph. .prose sets a
   rhythm between siblings and a list of tappable blocks wants more air above it
   than a sentence does. */
.decision .choice-list { margin-block-start: var(--space-md); }

/* --- The telling ------------------------------------------------------------
   docs/DESIGN.md names `.outcome` for this and says what it has to achieve:
   "the telling has to be distinguishable from the situation above it". The hard
   part is that a block of choices sits BETWEEN them, so proximity cannot do it
   and the distinction has to survive the gap.

   A ruled leading edge in the accent does it, and it is the signature .facts and
   .sheet__field already carry — so the telling reads as the same kind of object
   those do: the part of the page that is about THIS character rather than about
   the week. Everything else is left alone. It is prose at the same measure and
   the same face as the situation, because it is the answer to the question the
   screen asked and the part a player comes back for; making it smaller would say
   the opposite. */

.outcome {
  margin-block-start: var(--space-lg);
  padding-inline-start: var(--space-sm);
  border-inline-start: 3px solid var(--accent);
}

/* Mirrors .prose's own rhythm rather than inheriting it: .prose sets
   `> * + *`, and these paragraphs are one level deeper than that selector
   reaches. The global `* { margin: 0 }` means they would otherwise run
   together. */
.outcome > * + * { margin-block-start: var(--space-sm); }

/* A lapse is the telling's absence, and it is not an error and not a rebuke.
   Muted, and deliberately not --danger: decision 047 is explicit that a missed
   week costs nothing, and a week passing without you is an ordinary thing in a
   chronicle. */
.outcome--lapsed {
  border-inline-start-color: var(--rule-strong);
  color: var(--fg-muted);
}

/* --- An absent character on the roster --------------------------------------
   Decision 086: a character deactivated after eight missed decisions stays on
   the roster, marked away. NOTHING WAS TAKEN from them — the rung, the aspect
   and the whole record are where they were left, and the player brings them
   back by choosing to.

   So this reads as AWAY, never as gone and never as an error. --danger is for
   something going wrong, and a town has people who are travelling. Same
   argument as .choice[data-barred] one archetype over: quieter, not broken. */

.roster tr[data-absent],
.roster tr[data-dead],
.roster tr[data-left] { color: var(--fg-muted); }

/* The word rather than an icon, for the reason the strenuous marker is a
   sentence: a reader should not have to learn a symbol to read a table. */
.roster__away {
  /* On its own line under the name, as the titles are, so a name never breaks around it (the UI audit, G21). */
  display: block;
  width: fit-content;
  margin-block-start: var(--space-3xs);
  padding: 0 var(--space-2xs);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
  white-space: nowrap;
}

/* --- The record sheet — archetype 5 ----------------------------------------
   docs/DESIGN.md names `.sheet` as "a .facts grid at full width". The reason it
   is not just .facts: a facts block sets its label and value on ONE line, which
   runs the question and the answer together. A sheet stacks them — label above,
   in Archivo, small and lettered-out; value below, in the body face — so a
   glance separates what is being asked from what was answered.

   This is the base for the eventual character sheet as well as the creation
   summary, which is why the field is a component rather than a one-off layout. */

.sheet {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xs);
  margin: 0 0 var(--space-md);
}

/* Two across once there is room. At 390px a sheet is one column and stays
   readable; side-by-side fields at that width are two cramped columns. */
@media (min-width: 34rem) {
  .sheet { grid-template-columns: 1fr 1fr; }
  .sheet__field--wide { grid-column: 1 / -1; }
}

/* Profile's Former characters (the author, 2026-11-16): the sheet's fields as a list. */
.former { list-style: none; padding-inline-start: 0; }
.former .sheet__note { display: block; }

.sheet__field {
  padding: var(--space-2xs) var(--space-xs);
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  /* The ruled leading edge is the corpus facts block's own signature, kept so a
     record reads as the same kind of object wherever it appears. */
  border-inline-start: 3px solid var(--accent);
}

.sheet__label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.sheet__value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs);
  margin: 0;
  margin-block-start: var(--space-3xs);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--fg);
}

/* An answer in the player's own words is prose, not a datum, so it takes the
   reading face and wraps like a sentence. */
.sheet__value--prose {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

/* Something not yet known, which is a real state rather than a gap — an aspect
   is not measured until somebody tests for it. Quiet, never --danger. */
.sheet__value--absent {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--fg-faint);
  font-style: italic;
}

/* Per-field review link. Small and set apart from the value so it never reads as
   part of the answer. */
.sheet__edit {
  flex: none;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.sheet__value--prose .sheet__edit {
  display: inline-block;
  margin-inline-start: var(--space-2xs);
}

/* A second <dd> under the value, saying what the value means. The full character
   sheet is where this became necessary: a rung is seeded as "Striker" and a
   condition as "Injured", and neither word says how far along a ladder it is or
   what moving off it depends on. The name is the value; this is the note.

   Archivo at --text-sm, matching .field__hint, because it is chrome explaining a
   datum rather than prose to be read at --measure. */
.sheet__note {
  margin: var(--space-3xs) 0 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: 1.5;   /* running text, however small, is at least 1.5 (Dannaway 16; FE-10); it was --leading-snug */
  color: var(--fg-muted);
}

/* A link in a note is 14px type, which is a 19px hit area and half of what a thumb
   needs. Vertical padding on an INLINE element expands the hit box without touching
   the line box, so this needs no compensating negative margin — the .site-nav__link
   pattern without its cost, and it works because the element is never made a block. */
.sheet__note a { padding-block: calc((var(--tap-min) - 1.15em) / 2); }

/* The tier held, by its own name, between the trade or aspect and its notes (the author, 2026-11-14: "slightly more
   prominent (not as much as the overall ladder name)"): the value's face a step smaller, at full ink. It links to its
   words on the trades or aspect paths page, with the note link's hit area. */
.sheet__tier {
  margin: var(--space-3xs) 0 0;
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  color: var(--fg);
}

.sheet__tier a { padding-block: calc((var(--tap-min) - 1.15em) / 2); }

/* Several answers in one field — the characteristics a character brought, which
   are rows rather than a sentence and have no fixed number. Inside a
   .sheet__value--prose, which supplies the block display and the reading face. */
.sheet__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet__list li {
  position: relative;
  padding-inline-start: var(--space-sm);
}

.sheet__list li + li { margin-block-start: var(--space-2xs); }

/* The header's painted fleur-de-lis (280) as the mark, its shape used as a mask so it takes the accent in both
   themes: the art itself is tinted parchment for the dark header, and would vanish on the light paper. It replaced
   the drawn lozenge, the last drawn motif here (282's PR). */
.sheet__list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.3em;
  width: 10px;
  height: 12px;
  background: var(--accent);
  -webkit-mask: url("../art/brand.png") center / contain no-repeat;
          mask: url("../art/brand.png") center / contain no-repeat;
}

/* --- The condition track — a state machine, not a gauge --------------------
   docs/DESIGN.md forbids progress bars on a reading surface and makes .steps the
   only bar in the system. This is neither: a record surface may be dense, and what
   this draws is a POSITION ON A LADDER rather than a proportion of something done.
   The difference is legible in the markup — five named rungs, one marked, nothing
   filled behind it. A filled run would say "you have achieved Weakened", which is
   the reading a progress bar would impose on a scale that only goes down.

   Every rung is drawn rather than only the one held, because the machine is only
   legible as a machine: somebody who cannot see there is a step below Debilitated
   cannot understand why the risky choices went away. */

.track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3xs);
  margin-block-start: var(--space-3xs);
}

.track__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  min-width: 0;
  text-align: center;
}

.track__mark {
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
}

.track__name {
  font-family: var(--font-ui);
  /* 12px, and case as authored: uppercase plus tracking would widen "Debilitated"
     by about a third and it is already the widest rung at 390px. */
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--fg-faint);
  overflow-wrap: anywhere;
}

/* States as markup rather than classes, the same as .steps and .choice. */
.track__step[data-current] .track__mark { background: var(--accent); height: 6px; }
.track__step[data-current] .track__name { color: var(--fg); font-weight: 600; }

/* --- Reveal — a note that opens, with no JavaScript ------------------------
   <details> is native, so it survives an enhanced navigation without a script to
   re-run and needs no circuit. The whole summary is the hit target, which on the
   condition field means the whole track is. */

.reveal__summary {
  cursor: pointer;
  /* The default triangle sits beside a five-column grid and pushes it off centre.
     .reveal__hint is the affordance instead, and it says what it will do. */
  list-style: none;
}
.reveal__summary::-webkit-details-marker { display: none; }

.reveal__hint {
  /* On the summary's own line, after its words: one line, not a heading and a second line repeating it (the
     author, the UI audit's G12, 2026-10-20). After a block in the summary - the condition track - it still wraps. */
  display: inline-block;
  margin-inline-start: var(--space-2xs);
  /* Padding for the hit area, and it is inside the summary, which is already the
     target — this is about the words looking tappable rather than about reaching. */
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-strong);
}
.reveal__hint::first-letter { text-transform: uppercase; }   /* the markup's words are lower case: "show them" */

/* Filled triangles rather than the chevron characters at U+2303/2304, which render
   as a thin stray caret in several system stacks and read as a typo. */
/* A summary whose own words are the control (G2): the accent and the same caret the hint carried, on the words. */
.reveal__summary--words { color: var(--accent); }
.reveal__summary--words::after { content: " \25BE"; }
.reveal[open] > .reveal__summary--words::after { content: " \25B4"; }

.reveal__hint::after { content: " \25BE"; }                 /* down */
.reveal[open] .reveal__hint::after { content: " \25B4"; }   /* and up */

/* A closed week's passages for the parts not taken sit under their part, in the folded list (G05). */
.choices-past__telling { list-style: none; margin-block-start: calc(-1 * var(--space-2xs)); }
.outcome__part { margin-block-end: 0; }
.outcome__part + * { margin-block-start: var(--space-3xs); }

/* The authenticator's QR code (A01): dark modules on a light ground in both themes, because a scanner needs that
   contrast, at a size a phone camera reads from arm's length. The key under it wraps rather than widening a phone. */
.authenticator__qr {
  width: min(14rem, 100%);
  padding: var(--space-xs);
  background: #fff;
  border-radius: var(--radius);
}
.authenticator__qr svg { display: block; width: 100%; height: auto; }
.authenticator__key { overflow-wrap: anywhere; font-size: var(--text-base); }

/* An admin tool's sheet speaks in the interface face (DESIGN §5: --font-ui throughout an admin surface; the UI audit,
   2026-10-19, D03): the character sheet's reading face made the read-only event view's counts its heaviest text. */
.sheet--tool .sheet__value { font-family: var(--font-ui); font-size: var(--text-base); font-weight: 600; }
.sheet__lines { margin: 0; padding: 0; list-style: none; }
.sheet__lines > li + li { margin-block-start: var(--space-3xs); }

/* An admin table that becomes labelled blocks on a phone (D05, D06): each row a block, each cell on its own line under
   its column's name, so nothing is squeezed into a 90px column or cut at the frame. The header stays for a screen
   reader. Admin screens are mainly desktop; this is the 390px fit. */
@media (max-width: 39.99rem) {
  .admin-table--stack, .admin-table--stack tbody, .admin-table--stack tr,
  .admin-table--stack th, .admin-table--stack td { display: block; }
  .admin-table--stack caption { display: block; text-align: start; }
  .admin-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .admin-table--stack tr { padding-block: var(--space-xs); border-block-end: 1px solid var(--border); }
  .admin-table--stack th, .admin-table--stack td { padding: var(--space-3xs) 0; border: 0; }
  .admin-table--stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--fg-faint);
  }
}

/* --- An admin table's tools (D2, table-tools.js) ----------------------------------------------------------------
   A Find and filter fold above the table, its controls shown by the script; the table pages fifty at a time; a row
   the script is not showing is hidden even where the stacked phone layout makes rows blocks. */
.admin-table tbody tr[hidden] { display: none; }
.table-find { margin-block: var(--space-sm); }
.table-find__controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-2xs) var(--space-sm);
  margin-block-start: var(--space-xs);
}
.table-find__controls[hidden] { display: none; }
.table-find__controls .field { margin: 0; }
.table-find__controls :is(input, select) { height: var(--tap-min); }
.table-find__sort { display: none; }
@media (max-width: 39.99rem) { .table-find__sort { display: block; } }
.table-sort { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; min-height: var(--tap-min); }
th[aria-sort="ascending"] > .table-sort::after { content: " \25B4"; }
th[aria-sort="descending"] > .table-sort::after { content: " \25BE"; }
.table-none { margin-block: var(--space-sm); color: var(--fg-muted); }
.table-pager { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); margin-block: var(--space-sm); }
.table-pager[hidden] { display: none; }
.table-pager__status { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* A row's menu (D2): a <details> whose summary is a small mark - ⋯ for the actions, ⚠ for what needs the admin - and
   whose panel opens over the table; table-tools.js closes it on a press outside or Escape. */
.row-menu { position: relative; display: inline-block; }
.row-menu__toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
}
.row-menu__toggle::-webkit-details-marker { display: none; }
.row-menu__toggle:hover { background: var(--bg-raised); }
.row-menu[open] > .row-menu__toggle { background: var(--bg-raised); outline: 1px solid var(--rule-strong); }
.row-menu__panel {
  position: absolute;
  z-index: 5;
  inset-block-start: 100%;
  inset-inline-start: 0;
  min-width: 14rem;
  margin: var(--space-3xs) 0 0;
  padding: var(--space-xs);
  list-style: none;
  background: var(--bg-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.25);
  display: grid;
  gap: var(--space-3xs);
}
.row-menu__panel--end { inset-inline: auto 0; }
.row-menu__panel .admin-actions { flex-direction: column; align-items: stretch; }
.admin-accounts__issues .row-menu__toggle { color: var(--danger); }
.admin-accounts__character { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-3xs); }
.admin-accounts__issues .row-menu__toggle { min-width: 2rem; }
.admin-accounts__roles { display: flex; flex-wrap: wrap; gap: var(--space-3xs); margin-block-start: var(--space-3xs); }
.admin-accounts__actions { text-align: end; }
/* A name or a count alone in its cell is a target of its own, so it is at least 24px each way (WCAG 2.5.8): the character
   was 23.8px tall, and a one-digit count much narrower. */
.admin-accounts__character > a,
.admin-accounts__table td > a { display: inline-flex; align-items: center; min-block-size: 1.5rem; min-inline-size: 1.5rem; }
/* On a phone the stacked rows go two to a line, the account and its character across the top, so an account is a
   short block rather than nine lines (D2). */
@media (max-width: 39.99rem) {
  .admin-accounts__table tbody tr:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-3xs) var(--space-sm);
  }
  .admin-accounts__table td[data-label="Account"],
  .admin-accounts__table td[data-label="Character"] { grid-column: 1 / -1; }
  .admin-accounts__table td.admin-accounts__actions { grid-column: 1 / -1; text-align: start; }
}

/* The events list on a phone (D7): two to a line as the accounts are, the event across the top and its action at the end. */
@media (max-width: 39.99rem) {
  .admin-events__table tbody tr:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-3xs) var(--space-sm);
  }
  .admin-events__table td[data-label="Event"],
  .admin-events__table td[data-label="Author"],
  .admin-events__table td.admin-events__actions { grid-column: 1 / -1; }
}

/* The town's queue as a line (2026-10-26): each entry a numbered step joined to the next, the one the week takes
   marked Next in the accent, one the town cannot meet yet dashed and muted with a warning mark, keeping its place. */
.town-queue__summary { margin-block: var(--space-xs) var(--space-sm); }
.town-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.town-queue__entry {
  position: relative;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: var(--space-xs);
  scroll-margin-block-start: 6rem;
}
/* The thread from one step's number to the next. */
.town-queue__entry:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-block: 2.25rem calc(-1 * var(--space-sm));
  inset-inline-start: calc(1.125rem - 1px);
  border-inline-start: 2px solid var(--rule-strong);
}
.town-queue__place {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: 50%;
  border: 2px solid var(--rule-strong);
  background: var(--bg-raised);
  font-family: var(--font-ui);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.town-queue__body {
  position: relative;
  min-width: 0;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.town-queue__head { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-3xs); padding-inline-end: 7rem; }
/* The event's form, pinned to the card's top corner; the head leaves it room so a long title never runs under it. */
.town-queue__form { position: absolute; inset-block-start: var(--space-xs); inset-inline-end: var(--space-sm); margin: 0; }
.town-queue__head .tag { margin-inline-start: 0; }
.town-queue__title { font-family: var(--font-ui); font-weight: 600; }
.town-queue__source, .town-queue__why { margin: var(--space-3xs) 0 0; font-size: var(--text-sm); color: var(--fg-muted); }
.town-queue__controls { margin-block-start: var(--space-xs); }
.town-queue__moves { flex-wrap: wrap; }
.town-queue__more { margin-block-start: var(--space-2xs); }
.tag--next { border-color: var(--accent); background: var(--accent); color: var(--bg-raised); font-weight: 600; }
.town-queue__entry[data-state="next"] .town-queue__place { border-color: var(--accent); background: var(--accent); color: var(--bg-raised); }
.town-queue__entry[data-state="next"] .town-queue__body { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.town-queue__entry[data-state="waits"] .town-queue__place { border-style: dashed; border-color: var(--danger); color: var(--fg-muted); }
.town-queue__entry[data-state="waits"] .town-queue__body { border-style: dashed; border-color: var(--danger); background: var(--danger-wash); }
.town-queue__entry[data-state="waits"] .town-queue__why { color: var(--fg); }

/* An event's versions on its editor (D7): a fold under the heading, newest first. */
.event-versions { margin-block: var(--space-sm); }
.event-versions__list { margin: var(--space-2xs) 0 0; padding-inline-start: 1.5rem; display: grid; gap: var(--space-3xs); }

/* --- Footnote — read once, then never again -------------------------------
   Set below the body size deliberately. It explains three absences on the record
   above it, which is worth saying and is not worth the weight of what it explains. */

.footnote {
  margin-block-start: var(--space-lg);
  padding-block-start: var(--space-sm);
  border-block-start: 1px solid var(--rule);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--fg-muted);
}

.footnote p { margin-block-end: var(--space-2xs); }
.footnote p:last-child { margin-block-end: 0; }
.footnote strong { color: var(--fg); font-weight: 600; }

/* --- Creation asides ------------------------------------------------------- */

/* The "read about this species" link under a choice. Deliberately outside the
   <label>: a link inside one steals the click meant to select the option. */
.choice__aside {
  margin: var(--space-3xs) 0 0;
  padding-inline-start: var(--space-sm);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
}

/* Read about a species (C2): a small button inside its card, at the right of the board's line, and centred below the
   line on a phone. The link is outside the <label> and placed over a room kept for it, as a choice's pills are: the room
   is the same words in the same box, unseen, at the end of .choice__foot, so the card is sized for it. */
.choice-list > li:has(> .choice__aside--read) { position: relative; }
.choice__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-sm);
  margin-block-start: var(--space-2xs);
}
.choice__foot .choice__count { margin: 0; flex: 1 1 auto; min-width: 0; }
.choice__read {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding-inline: var(--space-sm);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
}
a.choice__read:hover { border-color: var(--accent); color: var(--accent); }
.choice__read--room { visibility: hidden; flex: 0 0 auto; margin-inline-start: auto; }
.choice__aside--read {
  position: absolute;
  inset-inline-end: var(--choice-inset);
  inset-block-end: var(--choice-inset);
  margin: 0;
  padding: 0;
}
@media (max-width: 29.99rem) {
  .choice__foot { flex-direction: column; align-items: stretch; }
  .choice__read--room { align-self: center; margin-inline-start: 0; }
  .choice__aside--read { inset-inline: 0; display: flex; justify-content: center; }
}

/* Help Wanted (C3): the job board's three most wanted trades above the families, each the same card as below - mark,
   name, the whole description (the author, 2026-10-24) - with the board's line made the card's loudest words. Each
   card is a label for its trade's radio in the family below, so it takes the press, and the trade taken wears the
   card's chosen glow (the rule is drawn per card, beside the list). */
.help-wanted { display: grid; gap: var(--space-2xs); margin-block: 0 var(--space-md); }
.help-wanted__title { margin: 0; text-align: center; font-size: var(--text-xl); }
.help-wanted .choice-list { margin: 0; }
.help-wanted .choice { cursor: pointer; }
.help-wanted .choice__count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-strong);
}

/* A family of trades, folded (C3); its summary the family's name in the words-as-control style. */
.choice-family { margin-block: var(--space-2xs); }
.choice-family > .choice-list { margin-block: var(--space-2xs) var(--space-sm); }
.choice-family__summary { display: grid; gap: 0; }
.choice-family__name { font-size: var(--text-lg); color: var(--accent); }
.choice-family__name::after { content: " \25BE"; }
.choice-family[open] > .choice-family__summary .choice-family__name::after { content: " \25B4"; }
/* What the family holds, under its name: small and quiet, read while the fold is closed. */
.choice-family__line { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--fg-muted); }

/* The way back through a flow. Quiet by design — the forward action is what the
   screen is asking for, and two controls of equal weight make a player choose
   between them rather than answer the question. */
.creation-back {
  margin-block-start: var(--space-md);
  font-size: var(--text-sm);
}

/* A creation step's foot (C1): back on the left, the forward action on the right, one row, held at the bottom of the
   screen while the step is in view. The ground fades up from the sheet's own lower paper so the list scrolls under it.
   On a phone the button takes the rest of the row. */
.creation-actions {
  position: sticky;
  inset-block-end: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  margin-block-start: var(--space-md);
  padding-block: var(--space-sm) calc(var(--space-sm) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, color-mix(in srgb, var(--paper-sunken) 80%, transparent), transparent);
}
/* The way back keeps its words on one line (the author's look, 2026-11-16): the forward button is the one that gives. */
.creation-actions .creation-back { margin: 0; flex: 0 0 auto; }
.creation-actions .back-link { white-space: nowrap; }
/* Over the cards it is scrolling past, the way back needs a ground of its own (the author, 2026-10-24): a quiet pill
   on raised paper, quieter than the forward button. */
.creation-actions .back-link {
  padding-inline: var(--space-sm);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--fg);
}
.creation-actions .back-link:hover { border-color: var(--accent); }
/* The forward button's words fit one line from 390px with this row's tighter padding (the author's look, 2026-11-16:
   "Arrive in the Reach" wrapped beside "Back to your name"); narrower than that the last step's two lines sit inside the
   button rather than on its edge. */
.creation-actions__go {
  flex: 1 1 auto;
  margin-inline-start: auto;
  padding: var(--space-3xs) var(--space-sm);
  line-height: 1.2;
  text-align: center;
}
@media (min-width: 40rem) {
  .creation-actions__go { flex: 0 0 auto; min-width: 12rem; }
}
.creation-form--actions { display: contents; }

/* The name step's naming note (C4): the hint under it a step smaller, with no gap left beneath it to the card's edge
   (the author, 2026-10-24). */
.naming-note > * + * { margin-block-start: var(--space-xs); }
.naming-note { padding-block-end: var(--space-2xs); }
.naming-note > :last-child { margin-block-end: 0; }
.naming-note__hint { font-size: var(--text-xs); }
@media (max-width: 29.99rem) {
  .creation-actions .creation-back__where {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

/* --- Event editor ---------------------------------------------------------
   Here rather than in game.css because this is an admin screen: docs/DESIGN.md
   assigns admin to this file, and game.css is reserved for the player-facing
   game surfaces and the .decision components section 4 named.

   The dashboard is exempt from the reading rules and may be as dense as it needs
   to be. What it is not exempt from is rhythm — the choice cards, the buttons that
   add one and the actions that end the form were all flush against each other,
   which read as one undifferentiated column with no way to tell a container from
   a control. */

/* A stage on a town track is the same KIND of object as a choice on an event - a
   container holding fields, and a thing in its own right rather than a qualifier on
   the thing above it. So it takes the same treatment rather than a second one, and
   it deliberately does not borrow .editor__filter, which is quieter precisely
   because a filter IS a qualifier. */
.editor__choice,
.editor__stage { margin-block-end: var(--space-sm); }

/* The default triangle is the affordance here, unlike .reveal, which hides it
   because it sits beside a five-column grid. A dense form wants the cheapest
   disclosure there is, and the writer is operating rather than reading. */
.editor__choice > summary,
.editor__stage > summary {
  cursor: pointer;
  padding-block: var(--space-2xs);
  font-family: var(--font-ui);
  font-weight: 600;
}

/* A filter block, at any of its three positions. It takes .editor__choice's summary
   treatment rather than defining its own - one disclosure style on one form, or a
   writer learns two - and it is quieter than a choice because it is a qualifier on
   the thing above it rather than a thing of its own. */
/* Since the folds (D11) a requirement block is drawn as every other fold: the dashed box it had before set it apart
   for no reason a writer could read (the author, 2026-10-26). */
.editor__filter { margin-block: var(--space-sm); }

/* The editor's folds (D11): every section a <details> whose summary names it and says where it stands. Required and
   missing is red and opens by itself; Set is plain; Optional and unset is muted - so the closed editor is a checklist.
   The summary keeps the default triangle, as .editor__choice's did. */
.editor-fold { margin-block: var(--space-sm); }
.editor-fold__summary {
  cursor: pointer;
  display: list-item;
  padding-block: var(--space-2xs);
  min-block-size: var(--tap-min);
  font-family: var(--font-ui);
}
.editor-fold__name { font-weight: 600; }
.editor-fold__state { margin-inline-start: var(--space-2xs); font-size: var(--text-sm); color: var(--fg-muted); }
.editor-fold--missing > .editor-fold__summary .editor-fold__state,
.editor-count.editor-fold--missing .editor-fold__state { color: var(--danger); font-weight: 600; }
.editor-fold--optional > .editor-fold__summary .editor-fold__name { color: var(--fg-muted); font-weight: 400; }
.editor-fold__body { padding-block-end: var(--space-2xs); }
.editor-fold__aside { margin-inline-start: var(--space-3xs); font-family: var(--font-ui); font-size: var(--text-xs); color: var(--fg-faint); }
/* A fold inside a choice is a qualifier on it: indented under a rule, as an outcome is. */
.editor__choice .editor-fold { padding-inline-start: var(--space-sm); border-inline-start: 2px solid var(--rule); }
.editor__choice .editor-fold--missing { border-inline-start-color: var(--danger); }
/* The Choices fold holds folds of its own; its summary is a section's, a size up. */
.editor-fold--section > .editor-fold__summary .editor-fold__name { font-family: var(--font-display); font-size: var(--text-lg); }

/* Two fields that are one idea - a minimum and a maximum, a stat and its threshold.
   Side by side above 30rem and stacked below it, because at 390px two number inputs
   in a row are two cramped columns. */
.editor__range {
  gap: var(--space-sm);
}

@media (min-width: 30rem) {
  .editor__range {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  }
}

/* An outcome belongs to the choice above it, and nesting is the only thing that
   says so once the form is three fields deep. A rule rather than another card:
   a card inside a card flattens the hierarchy until neither reads as a container. */
.editor__outcome {
  margin-block: var(--space-sm);
  padding-inline-start: var(--space-sm);
  border-inline-start: 2px solid var(--rule);
}

/* An affinity row (361): the aspect wide, the points narrow, Remove its own size at the row's foot - never a grid cell,
   which stretched it to a whole column and the row's height (the author, 2026-10-30: "huge"). Wraps at 390px. */
.editor__affinity-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2xs) var(--space-sm);
  margin-block: var(--space-xs);
}
.editor__affinity-row > .field { margin: 0; }
.editor__affinity-row > .field:first-child { flex: 1 1 12rem; }
.editor__affinity-row > .field:nth-child(2) { flex: 0 0 5.5rem; }
.editor__affinity-row > .btn { flex: 0 0 auto; }

/* A filter block's requirements (D13): each an entry under its type's name, indented under a rule as an outcome is, its
   Remove at its foot; the add row below them all, the type select and its button wrapping together at 390px. */
.editor__requirement {
  margin: var(--space-xs) 0;
  padding: 0 0 0 var(--space-sm);
  border: 0;
  border-inline-start: 2px solid var(--rule);
  min-inline-size: 0;
}
.editor__requirement > legend { padding: 0; font-family: var(--font-ui); font-weight: 600; }
.editor__add-requirement {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2xs) var(--space-sm);
  margin-block: var(--space-xs);
}

/* Tighter inside the editor's stacks (the author, 2026-10-30: "very spaced out ... trim the space between the fields"):
   an outcome, a requirement entry and an outcome's fields are .stacks whose gap already spaces their children, and each
   child's own margin - a field's, a fold's, an actions row's - came on top of it, so neighbours sat 32 to 48px apart.
   The gap alone spaces them now, at --space-xs. */
.editor-fold .stack { gap: var(--space-xs); }
.editor-fold .stack > *,
.editor-fold .stack > .grid > .field { margin-block: 0; }
.editor__add-requirement > .field { margin: 0; flex: 1 1 12rem; }

/* A slot's outcomes together, as the game selects them (SlotGroups; the author, 2026-10-30): a raised ground holds the
   group, its heading says how it lands, and each member's line leads with its condition. The members keep their own
   rule, so the ground is the only thing that says which belong together. */
.editor__slot {
  margin-block: var(--space-sm);
  padding: var(--space-2xs) var(--space-sm);
  background: var(--bg-raised);
  border-radius: var(--radius);
}
.editor__slot-name { font-family: var(--font-ui); font-size: var(--text-sm); font-weight: 600; color: var(--fg-muted); }
.editor__slot > .editor-fold:first-of-type, .editor__slot > .editor__outcome:first-of-type { margin-block-start: var(--space-2xs); }

/* Buttons sit apart from the fields they act on, or they read as another field. */
/* Authored prose shown back rather than edited — the approval screen, where
   somebody reads what a writer wrote. The reading face, because it is prose, and
   the measure because it is read rather than scanned. */
.editor__readonly {
  font-family: var(--font-body);
  max-width: var(--measure);
  white-space: pre-wrap;
}

.editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-block: var(--space-sm);
}

/* NOT a .stack. A stack stretches its children, which turned Save and Submit into
   two full-width bars — and a full-width block is the decision screen's shape for a
   player's choice. These are controls on a tool, and claiming that shape here would
   say something about them that is not true. */
.editor__actions .btn { flex: 0 0 auto; }

/* The form's own end, set off from everything above it. */
.editor__actions--end {
  margin-block-start: var(--space-lg);
  padding-block-start: var(--space-sm);
  border-block-start: 1px solid var(--rule);
}

/* What Save or Submit did, said under them (the page no longer moves to the top notice); red when refused. */
.editor__said { margin-block: 0 var(--space-sm); font-family: var(--font-ui); font-size: var(--text-sm); color: var(--fg-muted); }
.editor__said--error { color: var(--danger); font-weight: 600; }
.editor__said a { margin-inline-start: var(--space-2xs); }

/* Decision 066's preview, below the form and outside it. A record surface — dense
   and consulted rather than read — so it takes the UI face throughout. */
.editor__preview {
  margin-block-start: var(--space-lg);
  font-family: var(--font-ui);
}

/* The findings. They sit OUTSIDE the cast disclosure on purpose: a finding only
   visible once somebody opens a <details> is not a finding, which is decision 091's
   shape for an alarm. Decision 125's trap is why that placement needs saying — a
   closed <details> has no size, so anything laid out while it is shut is a sibling. */
.editor__findings {
  margin-block: var(--space-sm);
  padding-inline-start: var(--space-md);
  border-inline-start: 3px solid var(--accent);
}

.editor__cast > summary {
  cursor: pointer;
  padding-block: var(--space-2xs);
  font-weight: 600;
  color: var(--fg-muted);
}

/* One person's whole reading, separated from the next by a rule rather than a card:
   eight cards inside a card is a stack of containers and no hierarchy at all. */
.editor__reading {
  margin-block: var(--space-md);
  padding-block-start: var(--space-sm);
  border-block-start: 1px solid var(--rule);
}

.editor__reading h4 { margin-block-end: var(--space-3xs); }

/* What lands and what does not. The arrow in the markup carries the meaning; weight
   and colour only reinforce it, so this reads the same to anyone who cannot see the
   difference between the two colours. */
.editor__lands { font-weight: 600; }
.editor__misses { color: var(--fg-muted); }

/* --- The town ledger ------------------------------------------------------ */

/* Cards rather than rows, and that follows from a question rather than from taste: a row is
   right when entries are compared down a column, a card when each is read on its own. The
   roster settled that and is the counter-example — four short parallel fields, compared. A
   ledger entry is a name and a SENTENCE, so there is nothing to scan down.

   .page-list is reused rather than restated, the way .editor__stage reuses .editor__choice:
   it already carries the measure, the centring and the list reset, and it is already tested
   at 390px in both themes. What is added here is only what a card needs that a row did not. */
.ledger {
  display: grid;
  gap: var(--space-sm);
}

/* The group heading sits ABOVE the cards rather than inside one, so the three kinds read as
   three parts of one record. Spaced from the group before it and not from its own list. */
.ledger__group + .ledger__group { margin-block-start: var(--space-lg); }

/* The town's Chronicle (292): where the Reach stands, then how it got here, one page. The history stands clear of the
   ledger's last card; html's scroll-padding-top already lands #history below the sticky header. */
.town-chronicle > section + section { margin-block-start: var(--space-xl); }

.ledger__track {
  /* .card supplies the ground, border and padding. Only the border-block-end from
     .page-list__item would be wrong here — a card already has an edge — and this element
     never takes that class, so there is nothing to undo. */
  display: grid;
  gap: var(--space-3xs);
}

/* The track's name and where it stands, one line, one size, two colours (the author, 2026-10-24, G4; it was a small
   name over a large stage, 2026-10-20). The stage keeps the accent, as what a reader comes for, and the sentence about
   it sits smaller underneath. Still a word, never a figure (043, 052). On a phone a long pair wraps, the stage under. */
.ledger__head {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-xs);
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--leading-snug);
}
.ledger__name { color: var(--fg); }
/* Ink, not the accent: the accent is what can be pressed (Dannaway 6; FE-10, reversing G4's colour); italic keeps it apart. */
.ledger__stage { color: var(--fg); font-style: italic; }
.ledger__track .prose { font-size: var(--text-sm); color: var(--fg-muted); }

/* The prose inside a card takes the card's width rather than the page measure, or a one-line
   sentence would sit in a column narrower than the card holding it. */
/* margin-inline: 0 as well: .prose centres itself with auto margins, and inside the card's grid an auto margin shrinks
   the item to its content and centres it, so a one-line sentence sat in the middle of its card (the UI audit, G10). */
.ledger__track .prose { max-width: none; margin-inline: 0; }
.ledger__track .prose p { margin: 0; }

/* ==========================================================================
   The overhaul (the author, 2026-10-12): a place in a fantasy world, in two
   registers. MainLayout marks <main> with data-register: "book" for the
   wiki, the accounts and the tools, "game" for the week, creation, the
   reading, the town and the roster. The art is wwwroot/art, built by
   tools/art/prepare.py from the author's craftpix packs; docs/GRAPHICS.md
   records every piece. Both registers follow the reader's theme.
   ========================================================================== */

/* --- The ground: a dark desk under the page, dark stone under the game ----- */

body:has(.site-main[data-register="book"]) {
  background: #1b1410 url("../art/desk.jpg") center top / 100% auto repeat-y;
}
body:has(.site-main[data-register="game"]) {
  background: #120e0b url("../art/stone.jpg") center top / 100% auto repeat-y;
}

/* --- The header and footer: a dark band, the same in both registers -------- */

.site-header,
.site-footer {
  --fg: #F2E8D2;
  --fg-muted: #E2D4B8;
  --accent: #CDBBF2;
  --bg-raised: #1d1611;
  --border: #5b4630;
}
.site-header {
  background: linear-gradient(#15100cf0, #15100ce0);
  box-shadow: 0 2px 12px rgb(0 0 0 / 0.5);
}
.site-footer { background: #15100ce0; }

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}
.site-header__sigil { width: 23px; height: 28px; flex: none; }

/* Each link's painted mark. A background, so it is decoration a screen reader never meets; the label is the
   name. 34px inside the 44px target. */
.site-nav__link[data-icon] { gap: var(--space-2xs); }
/* An icon sits 3xs from its word in the row, 2xs in the open menu: a signed-in admin's eight links were 10px too wide to
   stay beside the brand once The ledger became The chronicle (292), and wrapped under it at every width. AFTER the rule
   above on purpose - equal specificity, so the later one wins, which is how a padding rule in the 40rem query above
   went dead. */
@media (min-width: 40rem) {
  .site-nav__link[data-icon] { gap: var(--space-3xs); }
}
.site-nav__link[data-icon]::before {
  content: "";
  width: 34px;
  height: 34px;
  flex: none;
  background: center / contain no-repeat;
}
.site-nav__link[data-icon="wiki"]::before    { background-image: url("../art/nav-wiki.png"); }
.site-nav__link[data-icon="roster"]::before  { background-image: url("../art/nav-roster.png"); }
.site-nav__link[data-icon="ledger"]::before  { background-image: url("../art/nav-ledger.png"); }
.site-nav__link[data-icon="reach"]::before   { background-image: url("../art/nav-reach.png"); }
.site-nav__link[data-icon="admin"]::before   { background-image: url("../art/nav-admin.png"); }
.site-menu__link[data-icon="reach"]::before   { background-image: url("../art/nav-reach.png"); }
.site-menu__link[data-icon="roster"]::before  { background-image: url("../art/nav-roster.png"); }
.site-menu__link[data-icon="ledger"]::before  { background-image: url("../art/nav-ledger.png"); }
.site-menu__link[data-icon="person"]::before  { background-image: url("../art/icon-category-person.png"); }
.site-menu__link[data-icon="account"]::before { background-image: url("../art/nav-account.png"); }
.site-menu__link[data-icon="door"]::before    { background-image: url("../art/nav-door.png"); }

/* --- The book: the page is a sheet of parchment on the desk ---------------- */

.site-main[data-register="book"] {
  background:
    var(--parchment-grain),
    radial-gradient(ellipse at 50% 0%, var(--paper-raised) 0%, var(--paper) 55%, var(--paper-sunken) 100%);
  box-shadow: 0 0 0 1px var(--rule-strong), 0 2px 4px rgb(0 0 0 / 0.5), 0 24px 60px rgb(0 0 0 / 0.7), inset 0 0 60px var(--parchment-burn);
  border-radius: 2px;
  margin-block: var(--space-md) var(--space-xl);
  padding: var(--space-md) var(--space-sm) var(--space-xl);
}
@media (min-width: 48rem) {
  .site-main[data-register="book"] { padding: var(--space-xl) var(--space-2xl) var(--space-2xl); }
}

/* The back row's frosted bar is for when it sticks over scrolled text. On the parchment sheet, before it has a
   title to show, it read as a dark box around the back link (the author, 2026-10-12), so it is clear until then and
   takes the paper when it sticks. wiki-back.js sets --titled once the real heading has scrolled away. */
.site-main[data-register="book"] .back-row {
  background: transparent;
  backdrop-filter: none;
}
.site-main[data-register="book"] .back-row--titled {
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: 0 1px 0 var(--rule);
}

/* --- The game: a sheet of the theme's paper in a stone frame, on dark stone ----
   Every game page is one framed sheet, the way every book page is a sheet on the desk: parchment in the light
   theme, the candlelit paper in the dark (the author, 2026-10-12: the game follows the reader's theme). The frame is
   hollow art sliced nine ways, so it fits any height; the fill is the paper's own tokens. */

.site-main[data-register="game"] {
  background:
    var(--parchment-grain),
    radial-gradient(ellipse at 50% 0%, var(--paper-raised) 0%, var(--paper) 55%, var(--paper-sunken) 100%);
  background-clip: padding-box;
  border: 20px solid transparent;
  border-image: url("../art/panel.png") 20 / 20px stretch;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.5), 0 24px 60px rgb(0 0 0 / 0.7);
  margin-block: var(--space-md) var(--space-xl);
  padding: var(--space-sm) var(--space-2xs) var(--space-xl);
}
@media (min-width: 48rem) {
  .site-main[data-register="game"] { padding: var(--space-lg) var(--space-xl) var(--space-2xl); }
}

/* The week's and the reading's panel is the sheet itself now, so its own veil and edges go. */
.site-main[data-register="game"] .decision.veil {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* A game page's title sits on a plate, the ribbon behind it (the author's pick, 2026-10-20): Fantasy RPG GUI's ornate
   cartouche in amethyst, centred, with the ribbon's two tails running out from behind it at a fixed height. The plate
   is the background's top layer, so the tails' inner ends and the band's join are always under it.
   The words keep to the plate's purple, measured on the art (390 by 129): clear of the scrollwork it runs from 23% to
   77% across and 31% to 69% down, so the text box is that rectangle - padding in from each side - and fit-title.js
   steps the type down until the title fits it (the author, 2026-10-20: "force all text to be inside"). Without the
   script a long title makes the plate taller, never spills out. Never wider than the window. */
.site-main[data-register="game"] h1 {
  --plate-width: 320px;
  --plate-height: 106px;     /* the art's 390 by 129, at this width */
  --ribbon-height: 62px;
  --ribbon-tail: 117px;      /* the tail's 210 by 111, at this height */
  --tail-show: 27px;         /* how far each tail reaches beyond the plate */
  position: relative;
  left: 50%;
  translate: -50% 0;
  width: calc(var(--plate-width) + 2 * var(--tail-show));
  max-width: calc(100vw - 1rem);
  min-height: var(--plate-height);
  margin-inline: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding-block: calc(var(--plate-height) * 0.31);
  padding-inline: calc(var(--tail-show) + var(--plate-width) * 0.23);
  background:
    url("../art/title-plate.png") center / var(--plate-width) 100% no-repeat,
    url("../art/ribbon-left.png") left center / var(--ribbon-tail) var(--ribbon-height) no-repeat,
    url("../art/ribbon-right.png") right center / var(--ribbon-tail) var(--ribbon-height) no-repeat;
  color: #FFF4DE;
  font-family: var(--font-ribbon);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px #1c0f2c;
}
@media (min-width: 48rem) {
  .site-main[data-register="game"] h1 {
    --plate-width: 600px;
    --plate-height: 198px;
    --ribbon-height: 110px;
    --ribbon-tail: 208px;
    --tail-show: 120px;
    font-size: 2.25rem;
  }
}

/* The one line under a week's title: when it closes, or which week it was (the UI audit, 2026-10-19, G02, G04). Centred
   under the ribbon it belongs to, in the interface face, so it reads as the title's caption rather than the prose. */
.week__when {
  margin: 0;
  text-align: center;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* A choice is a brass-framed card; the one chosen glows amethyst. The glow is a drop shadow, which follows the
   painted brass's own edge, rounded corners and all; a box shadow or an outline drew a square around the frame
   (the author, 2026-10-12: "a halo effect of some kind"). The radius exists for the keyboard's outline, which
   follows it; the art itself ignores it. */
.site-main[data-register="game"] .choice {
  /* The fill runs 6px in from the outer edge, under the brass (the author, 2026-11-18, FE-10): the brass is opaque only
     to about 8px of its 14px frame, so a fill clipped to the padding box left a strip of page between them and its
     near-square corners passed the painted curve. The brass's own edge is now the only line. */
  background: linear-gradient(var(--paper-raised), var(--paper-raised)) center / calc(100% - 12px) calc(100% - 12px) no-repeat;
  background-origin: border-box;
  background-clip: border-box;
  border: 14px solid transparent;
  border-image: url("../art/card.png") 34 / 14px stretch;
  border-radius: 16px;
  padding: var(--space-3xs) var(--space-2xs);
}
/* Barred wears no brass: the card is what a takeable choice looks like, so a choice that cannot be taken is a plain
   dashed block on the sheet (056; the UI audit, 2026-10-19, G01). After the card rule, which is more specific than
   .choice[data-barred] and would otherwise paint the brass over it. */
.site-main[data-register="game"] .choice[data-barred] {
  border: 1px dashed var(--rule-strong);
  border-image: none;
  border-radius: var(--radius);
  background: transparent;
  padding: var(--space-xs) var(--space-sm);
  opacity: 1;
}
.site-main[data-register="game"] .choice[data-barred] .choice__label { color: var(--fg-muted); }
.site-main[data-register="game"] .choice--pick {
  filter: var(--depth-drop);
  transition: transform var(--dur-fast) var(--ease);
}
.site-main[data-register="game"] .choice--pick:hover { transform: translateY(-2px); }
.site-main[data-register="game"] .choice--pick:has(input:checked),
.site-main[data-register="game"] .choice[data-chosen] {
  background: linear-gradient(var(--amethyst-wash), var(--amethyst-wash)) center / calc(100% - 12px) calc(100% - 12px) no-repeat;
  background-origin: border-box;
  background-clip: border-box;
  box-shadow: none;
  filter:
    drop-shadow(0 0 3px var(--accent))
    drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 80%, transparent));
}
.site-main[data-register="game"] .choice--pick:has(input:focus-visible) {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
}

/* Where a game page goes next (G19): small painted tiles in a row that wraps, each the menu's mark above its name.
   Quieter than a button - a thin rule on raised paper - so the week's own action stays the one thing to press. */
.onward { margin-block-start: var(--space-xl); }
.onward__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}
.onward__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3xs);
  min-height: var(--tap-min);
  padding: var(--space-xs) var(--space-2xs);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-raised);
  background-image: var(--depth-light);
  box-shadow: var(--depth-raised);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.onward__link:hover { border-color: var(--accent); color: var(--accent-strong); box-shadow: var(--depth-raised-hover); transform: translateY(-2px); }
.onward__link:active { box-shadow: var(--depth-pressed); transform: translateY(1px); }
.onward__link::before {
  content: "";
  width: 34px;
  height: 34px;
  background: center / contain no-repeat;
}
.onward__link[data-icon="reach"]::before  { background-image: url("../art/nav-reach.png"); }
.onward__link[data-icon="roster"]::before { background-image: url("../art/nav-roster.png"); }
.onward__link[data-icon="ledger"]::before { background-image: url("../art/nav-ledger.png"); }
.onward__link[data-icon="person"]::before { background-image: url("../art/icon-category-person.png"); }
.onward__link[data-icon="event"]::before  { background-image: url("../art/icon-category-event.png"); }
.onward__link[data-icon="wiki"]::before   { background-image: url("../art/nav-wiki.png"); }
.onward__link[data-icon="search"]::before { background-image: url("../art/icon-search.png"); }

/* A crafted button: the art is the face, the label stays real text. The quiet variant stays plain. */
.site-main[data-register="game"] .btn:not(.btn--quiet) {
  background: url("../art/button.png") center / 100% 100% no-repeat;
  border: 0;
  min-height: 52px;
  color: #FFF4DE;
  /* Sentence case (Dannaway 12; FE-10): a button is never set in capitals. */
  font-size: var(--text-lg);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px #1c0f2c;
  box-shadow: none;
  filter: var(--depth-drop);
}
.site-main[data-register="game"] .btn:not(.btn--quiet):hover { filter: var(--depth-drop) brightness(1.12); color: #FFF4DE; box-shadow: none; }
.site-main[data-register="game"] .btn:not(.btn--quiet):active { filter: brightness(0.92); box-shadow: none; }

/* --- A choice's painted mark (280): an aspect on the reading, a profession at creation ------------------------
   Beside the label and its lines, not above them, so the whole block stays the hit target and the text keeps its
   measure. Decorative: the name beside it says what it is. */
.choice:has(> .choice__mark) {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: var(--space-xs);
  align-items: start;
}
.choice:has(> .choice__mark) > :not(.choice__mark, input) { grid-column: 2; }
.choice__mark {
  grid-column: 1;
  grid-row: 1 / span 4;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 2px 6px rgb(0 0 0 / 0.3);
}

/* --- The character sheet as a tabletop sheet (282) ---------------------------------------------------------------
   /game/character only (.sheet--character): each field is a box with a double rule, the way a printed character sheet
   draws one, and its label is a tab set into the top edge. The creation summary and the editors keep the plain
   .sheet. On a wide screen the star stands in the left column beside the four short fields, the top of the sheet a
   printed one would give to the portrait and the scores; at 390px it follows them. */

.sheet--character {
  gap: var(--space-md) var(--space-sm);
  margin-block-start: var(--space-md);
}

.sheet--character .sheet__field {
  position: relative;
  padding: var(--space-sm) var(--space-xs) var(--space-xs);
  background: var(--bg-raised);
  border: 2px solid var(--rule-strong);
  border-radius: var(--radius);
  /* The inner line of the double rule: a gap of the box's own paper, then a hairline. */
  background-image: var(--depth-light);
  /* A plate (FE-10): the double rule inside, the depth outside. */
  box-shadow: inset 0 0 0 3px var(--bg-raised), inset 0 0 0 4px var(--rule), var(--depth-plate);
}

.sheet--character .sheet__label {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: var(--space-xs);
  transform: translateY(-55%);
  padding: 0 var(--space-2xs);
  background: var(--bg-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
}

@media (min-width: 34rem) {
  .sheet--character .sheet__field--star { grid-column: 1 / -1; }
}
@media (min-width: 48rem) {
  .sheet--character .sheet__field--star { grid-column: 1; grid-row: 1 / span 4; }
  .sheet--character .sheet__field--side { grid-column: 2; }
}

/* The star: four names around a brass-rimmed plate, the shape drawn in amethyst. The names are HTML in a grid
   rather than SVG text, so they keep the interface's size however small the plate gets. The whole plate is the
   summary of the tooltip's <details>, so all of it is the hit target. */
.star {
  margin: var(--space-3xs) 0 0;
}

.star__summary {
  display: grid;
  justify-items: center;
  border-radius: var(--radius);
}

.star__plate {
  display: grid;
  grid-template-columns: auto minmax(0, 15rem) auto;
  grid-template-areas:
    ".   brawn     .      "
    "wit figure    finesse"
    ".   ingenuity .      ";
  align-items: center;
  justify-items: center;
  gap: var(--space-3xs);
  width: 100%;
  max-width: 21rem;
}

.star__name {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
}
.star__name--brawn     { grid-area: brawn; }
.star__name--finesse   { grid-area: finesse; }
.star__name--ingenuity { grid-area: ingenuity; }
.star__name--wit       { grid-area: wit; }

/* The ring is the figure's background, so the plate's own ground (drawn just inside it) paints over its opening and
   the shape, which stops short of the brass, never runs under it. */
.star__figure {
  grid-area: figure;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}
.star__ring { filter: var(--ring-filter); }

.star__ground { fill: var(--paper-sunken); }
.star__guide  { fill: none; stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.star__axis   { stroke: var(--rule-strong); stroke-width: 1; }
.star__shape  {
  fill: color-mix(in srgb, var(--accent) 32%, transparent);
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.star__vertex { fill: var(--accent); }

.star__reading {
  margin: 0 0 var(--space-3xs);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  color: var(--fg);
}
/* What each stat means: the name small and lettered like a sheet label, its line beside it — stacked at 390px, where
   a name column would leave the lines a few words wide. */
.star__stats {
  display: grid;
  gap: var(--space-2xs);
  margin: 0 0 var(--space-xs);
  padding-block: var(--space-2xs);
  border-block: 1px solid var(--rule);
}
.star__stat dt {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-strong);
}
.star__stat dd {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--fg);
}

.star__note {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--fg-muted);
}

/* --- A tooltip that can be put away (.tip) -----------------------------------------------------------------------
   The trigger is a <details> summary (108); the panel is its sibling, outside it, because a closed <details> lays out
   nothing (125). Shown while the <details> is open (a tap or a click), while a pointer that can hover is over the tip,
   and while the summary has keyboard focus. tip.js takes it away: Escape marks the tip [data-dismissed], which stops
   the hover and focus showing it until the pointer or the focus has left (WCAG 1.4.13); an open one it closes. The
   panel hangs from the tip's own bottom edge with no gap, so a pointer can move onto it without the tip closing. */
.tip { position: relative; }

.tip__panel {
  display: none;
  position: absolute;
  z-index: var(--z-tooltip);
  inset-block-start: 100%;
  inset-inline: 0;
  margin-inline: auto;
  width: min(22rem, 100%);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* The pointer up at what it explains, inside the panel's own box so hovering it still counts as hovering the tip. */
.tip__panel::before {
  content: "";
  position: absolute;
  inset-block-start: -7px;
  inset-inline-start: calc(50% - 6px);
  width: 12px;
  height: 12px;
  background: var(--bg-raised);
  border-block-start: 1px solid var(--rule-strong);
  border-inline-start: 1px solid var(--rule-strong);
  transform: rotate(45deg);
}

.tip__toggle[open] + .tip__panel,
.tip:not([data-dismissed]) .tip__toggle:has(> summary:focus-visible) + .tip__panel {
  display: block;
}
@media (hover: hover) {
  .tip:not([data-dismissed]):hover .tip__panel { display: block; }
}

/* With its words in the tooltip, the star is shorter than the four fields beside it on a wide screen: it stands in
   the middle of its box rather than at the top of an empty one. */
@media (min-width: 48rem) {
  .sheet--character .sheet__field--star {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* ===========================================================================
   FE-10 — the front end held against published practice (NN/g; Kennedy, 7 Rules; Dannaway, 16 tips) and the
   author's brief, ruled page by page on 2026-11-18. docs/DESIGN.md has the rules; the register has the entries.
   ======================================================================== */

/* --- Capitals are for a label of three words or fewer (Dannaway 12; Kennedy 5) ------------------------------
   A date, a crumb, an eyebrow sentence and a button are sentence case; .label's short names keep their capitals. */
.town-chronicle .page-list__item > .label,
.hero > .label,
p.label:has(> .crumb) {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: var(--text-sm);
}
.town-chronicle .page-list__item > .label::first-letter { text-transform: uppercase; }

/* --- An open fold longer than a screen keeps its summary in view (NN/g, accordions on mobile) ---------------- */
.path[open] > .path__name,
.index__section[open] > .index__section-name {
  position: sticky;
  top: calc(var(--header-h, 3.875rem) + 2.75rem);
  z-index: 2;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(6px);
}
.index__section[open] > .index__section-name { top: var(--header-h, 3.875rem); }

/* --- The week: when it closes, said once above everything (the author) ------------------------------------- */
.decision article > .week__when { margin-block-end: var(--space-xs); }

/* --- The phone header: every top-level destination visible (NN/g, hidden navigation; the author) ------------
   With four or fewer top-level destinations a phone shows them all, each its painted mark over its word, the menus
   opening under the header. The brand's words leave the phone's row (a screen reader still hears them), so the header
   stays one row, about 68px. Replaces the three-line Menu, which stays in the markup for no width. */
@media (max-width: 39.99rem) {
  .site-header__inner { flex-wrap: nowrap; gap: var(--space-3xs); }
  .site-header__brand > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .site-header__inner > nav { flex: 1; margin-inline-start: 0; }
  .site-nav { display: none; }
  .site-nav__items { display: flex; justify-content: space-around; align-items: stretch; }
  .site-nav__items > .site-nav__link,
  .site-nav__items > .site-menu > .site-menu__toggle {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-content: center;
    justify-items: center;
    column-gap: 2px;
    row-gap: 1px;
    min-height: 52px;
    min-width: var(--tap-min);
    padding-inline: var(--space-3xs);
    font-size: 0.72rem;
    line-height: 1.1;
    white-space: nowrap;
  }
  .site-nav__items > .site-nav__link[data-icon]::before,
  .site-nav__items > .site-menu > .site-menu__toggle[data-icon]::before { grid-column: 1 / -1; width: 28px; height: 28px; }
  .site-nav__items > .site-menu > .site-menu__toggle .site-menu__account { grid-column: 1 / -1; width: 28px; height: 28px; }
  .site-nav__items > .site-menu > .site-menu__toggle::after { margin-inline-start: 0; font-size: 0.8em; }
  .site-menu { position: static; display: flex; }
  .site-menu__panel {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 3;
    padding: var(--space-2xs) var(--gutter) var(--space-xs);
    background: var(--bg-raised);
    border-block-end: 1px solid var(--border);
    box-shadow: var(--depth-raised-hover);
  }
  html { scroll-padding-top: 8.5rem; }
  .back-row { top: 4.25rem; }
}
@media (min-width: 40rem) {
  .site-menu__panel { background-image: var(--depth-light); box-shadow: var(--depth-raised-hover); }
}

/* --- Desktop: a main column and a rail (the author's brief) ------------------------------------------------
   From 64rem a page with parallel parts lays them side by side; prose keeps --measure and the rest of the 90rem sheet
   goes to the rail and to records. Below 64rem every page is as it was. */
@media (min-width: 64rem) {
  .site-main.page { width: min(100% - 2 * var(--space-md), var(--page-max)); }   /* a margin of desk at every width */
  .site-main[data-register="book"] { padding-inline: var(--space-xl); }

  /* Beside a rail a title starts where its text starts, and its brass bar (lore.css) runs the column's width from the
     left; a section heading's short bar starts at the left too. */
  .home-layout > .hero > h1,
  [data-register="book"] article.prose:has(> .article-rail) > h1,
  .site-main:has(.index-layout) > .prose > h1,
  [data-register="book"] article.prose:has(> .article-rail) > h2 { text-align: left; }
  .home-layout > .hero > h1::after,
  [data-register="book"] article.prose:has(> .article-rail) > h1::after,
  .site-main:has(.index-layout) > .prose > h1::after { width: 100%; margin-inline: 0; }
  [data-register="book"] article.prose:has(> .article-rail) > h2::before { margin-inline: 0; }
  .home-layout > .hero > .label,
  [data-register="book"] article.prose:has(> .article-rail) > .label { text-align: left; }

  /* An article: the prose at its line, the facts and the contents in the rail at the sheet's right edge. */
  [data-register="book"] article.prose:has(> .article-rail) {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 66ch) minmax(18rem, 28rem);
    justify-content: space-between;
    column-gap: 4rem;
    align-items: start;
  }
  [data-register="book"] article.prose:has(> .article-rail) > * { grid-column: 1; }
  [data-register="book"] article.prose:has(> .article-rail) > .article-rail {
    grid-column: 2;
    grid-row: 1 / span 999;
    align-self: stretch;
    margin-block-start: 0;
    container-type: inline-size;
  }
  /* The facts scroll away with the page; the contents stay in view (a rail taller than the window hid its foot). */
  .article-rail > .on-this-page {
    position: sticky;
    top: calc(var(--header-h, 3.875rem) + 3.25rem);
    margin-block-start: var(--space-lg);
  }
  .site-main:has(.article-rail) .back-row { max-width: none; }
  .article-rail .facts { margin: 0; max-width: none; padding: var(--space-md) var(--space-sm); }

  /* Home: the words and In the Reach now side by side, the buttons centred across the whole (the author). */
  .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem);
    column-gap: 4rem;
    align-items: start;
  }
  .home-layout > .hero { display: contents; }
  .home-layout > .hero > * { grid-column: 1; max-width: var(--measure); }
  .home-layout > .home-now { grid-column: 2; grid-row: 1 / span 5; align-self: center; margin: 0; max-width: none; }
  .home-layout > .hero > .hero__actions {
    grid-column: 1 / -1;
    max-width: none;
    justify-content: center;
    margin-block-start: var(--space-xl);
  }
  .home-layout .hero__more { margin-inline: 0; }

  /* The wiki's index: the title and a long search on one row, Start here a strip under them, the categories full
     width (the author). */
  .site-main:has(.index-layout) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(22rem, 32rem);
    column-gap: 3rem;
    align-items: start;
  }
  .site-main:has(.index-layout) > .prose:first-child { grid-column: 1; grid-row: 1; max-width: none; margin: 0; }
  .index-layout, .index-layout__rail { display: contents; }
  .index-layout__rail > .search { grid-column: 2; grid-row: 1; margin: var(--space-2xs) 0 0; max-width: none; }
  .index-layout__rail > .index__featured {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    margin-block-start: var(--space-lg);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--space-sm);
    row-gap: 2px;
    padding: var(--space-xs) var(--space-md);
  }
  .index-layout__rail > .index__featured .label { margin: 0; }
  .index-layout > .index-column { grid-column: 1 / -1; grid-row: 3; max-width: none; margin: var(--space-md) 0 0; }

  /* The Chronicle: the history at its line, the ledger the rail at the sheet's right edge. It scrolls with the page. */
  .town-chronicle {
    display: grid;
    grid-template-columns: minmax(0, 66ch) minmax(20rem, 28rem);
    justify-content: space-between;
    column-gap: 4rem;
    align-items: start;
    max-width: none;
  }
  .town-chronicle > .prose:first-child { grid-column: 1 / -1; max-width: none; }
  .town-chronicle > #history { grid-column: 1; grid-row: 2; }
  .town-chronicle > #standing { grid-column: 2; grid-row: 2; }
  .town-chronicle .prose,
  .town-chronicle .page-list { max-width: none; margin-inline: 0; }
  .town-chronicle > #standing h2 { font-size: var(--text-lg); }
  .town-chronicle > #standing h3 { font-size: var(--text-base); }

  /* The character sheet: boxes sized to what they hold, three across; nothing stretches to match a neighbour. */
  .site-main[data-register="game"] article.prose:has(.sheet--character) { max-width: 80rem; }
  .sheet--character { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet--character .sheet__field--star { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  .sheet--character .sheet__field--side { grid-column: auto; }
  .sheet--character > .sheet__field--wide { grid-column: auto; }
  .sheet--character > .sheet__field--wide:has(.track),
  .sheet--character > #family { grid-column: 1 / -1; }
}

/* In a narrow rail a fact stacks, its label over its value; in a wide one they sit side by side as elsewhere. */
@container (max-width: 24rem) {
  .facts__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* --- On this page: an article's sections, in the rail ------------------------------------------------------- */
.on-this-page ul { list-style: none; margin: var(--space-2xs) 0 0; padding: 0; display: grid; gap: 2px; }
.on-this-page a {
  display: block;
  padding: var(--space-3xs) var(--space-2xs);
  border-inline-start: 2px solid var(--border);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: 1.35;
  color: var(--fg-muted);
  text-decoration: none;
}
.on-this-page a:hover { color: var(--accent-strong); border-inline-start-color: var(--accent); }
@media (max-width: 63.99rem) { .on-this-page { display: none; } }

/* --- In the Reach now: home's panel, a plate --------------------------------------------------------------- */
.home-now {
  max-width: var(--measure);
  margin: var(--space-xl) auto 0;
  padding: var(--space-md);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background-color: color-mix(in srgb, var(--paper-raised) 80%, transparent);
  background-image: var(--depth-light);
  box-shadow: var(--depth-plate);
  display: grid;
  gap: var(--space-2xs);
}
.home-now__week { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.3; margin: 0; }
.home-now__lead { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--fg-muted); margin: var(--space-2xs) 0 0; }
.home-now__title { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.25; }
.home-now__telling, .home-now__telling p { margin: 0; line-height: 1.55; }
.home-now__more { margin: var(--space-2xs) 0 0; font-family: var(--font-ui); font-size: var(--text-sm); }

/* --- Movement respects the reader ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  a.card, .onward__link, .btn, .site-main[data-register="game"] .choice--pick { transition: none; }
  a.card:hover, .onward__link:hover, .btn:hover, .btn:active, .site-main[data-register="game"] .choice--pick:hover { transform: none; }
}
