/* conjectory.com — paper by day, chalkboard by night.
   Source Serif 4 for prose; the system terminal face only for what is
   git-shaped: dates, hashes, kind stamps. Status colors carry meaning
   (green = verified, red = refuted). No scripts, no decoration without
   information. */

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-600-italic.woff2") format("woff2");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f7f8f6;
  --ink: #1b1d1f;
  --graphite: #575e63;
  --rule: #d7dcd6;
  --inset: #eef0ec;
  --verified: #1d6b4f;
  --refuted: #93342a;
  --link: #2b4f92;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191c1e;
    --ink: #e4e2d9;
    --graphite: #9aa19c;
    --rule: #34393b;
    --inset: #212527;
    --verified: #6dc49c;
    --refuted: #db8b7d;
    --link: #94b2e6;
  }
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}

/* Prose sets justified, journal-style; the terminal-voice lines and the
   ledger grid stay ragged. Justification needs a real measure to look
   like a journal instead of a ransom note — on a phone the line runs
   about 34 characters, short enough that forcing the right edge opens
   rivers, so below 34rem the setting goes ragged and keeps only the
   hyphenation. */
main p, main li, .colophon p {
  hyphens: auto;
}

@media (min-width: 34rem) {
  main p, main li, .colophon p { text-align: justify; }
}

.result-meta, .ledger li, .all-records {
  text-align: left;
  hyphens: none;
}

main, .masthead, .colophon {
  max-width: 43rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
}
a:hover { text-decoration-color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* --- masthead --------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.8rem;
  padding-bottom: 2.6rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font: 400 0.95rem var(--mono);
  letter-spacing: 0.22em;
  color: var(--ink);
  text-decoration: none;
}

.logo {
  width: 30px;
  height: 30px;
}

.masthead nav {
  display: flex;
  gap: 1.4rem;
}

.masthead nav a {
  font: 400 0.75rem var(--mono);
  letter-spacing: 0.06em;
  color: var(--graphite);
  text-decoration: none;
}
.masthead nav a:hover { color: var(--ink); }

/* On a phone the wordmark and the nav each take their own line: side by
   side the nav collapses into a ragged right-aligned stack. */
@media (max-width: 38rem) {
  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding-top: 1.2rem;
    padding-bottom: 1.9rem;
  }
  .masthead nav {
    width: 100%;
    gap: 0.4rem 1.15rem;
  }
  .masthead nav a, .account-link { padding: 0.3rem 0; }
}

/* --- sections --------------------------------------------------------- */

h2 {
  font: 600 1.05rem var(--serif);
  letter-spacing: 0.01em;
  color: var(--link);
  border-top: 1px solid var(--rule);
  padding-top: 1.15rem;
  margin: 3rem 0 1rem;
}

.page-title {
  font: 600 1.7rem/1.25 var(--serif);
  margin: 0.4rem 0 1rem;
}

.all-records {
  margin-top: 0.9rem;
}

figure {
  margin: 1.1rem 0 1.8rem;
}

figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  display: block;
}

figcaption {
  font-size: 0.82rem;
  color: var(--graphite);
  margin-top: 0.5rem;
  line-height: 1.5;
}

p { margin: 0 0 1.05rem; }

main strong { font-weight: 600; }

/* The loop: a real sequence, numbered in the terminal voice. */
ol.loop {
  list-style: none;
  counter-reset: step;
  margin: 0 0 1rem;
  padding: 0;
}

ol.loop > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.15rem;
}

ol.loop > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.18em;
  font: 400 0.8rem var(--mono);
  color: var(--graphite);
  border: 1px solid var(--rule);
  width: 1.55rem;
  height: 1.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

ol.loop b, ol.loop strong {
  font-weight: 600;
}

/* --- the ledger ------------------------------------------------------- */

.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ledger li {
  display: grid;
  grid-template-columns: 6.2rem 6.6rem 1fr auto;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.ledger li:first-child { border-top: 1px solid var(--rule); }

.ledger-date {
  font: 400 0.78rem var(--mono);
  color: var(--graphite);
  white-space: nowrap;
}

.stamp {
  font: 400 0.72rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stamp-proof { color: var(--verified); }
.stamp-refutation { color: var(--refuted); }
.stamp-paper { color: var(--link); }

.ledger-title {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent);
}
.ledger-title:hover { text-decoration-color: var(--ink); }

.ledger-project {
  font: 400 0.75rem var(--mono);
  color: var(--graphite);
  justify-self: end;
}

.ledger-empty { color: var(--graphite); }

/* Titles may carry KaTeX; inside a title the math inherits the title's
   size instead of KaTeX's usual 1.21em body-math scale. */
.ledger-title .katex, .page-title .katex, .result h1 .katex { font-size: 1em; }

/* Narrow: the four columns can't hold their shape, so each row becomes a
   record — title first because it is what you came to tap, then the
   provenance line underneath in the terminal voice. */
@media (max-width: 38rem) {
  .ledger li {
    /* minmax(0,…) so the last column may shrink below its content and wrap
       instead of pushing the row past the screen. */
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 0.25rem 0.75rem;
    padding: 0.7rem 0;
    align-items: start;
  }
  .ledger-title {
    grid-column: 1 / -1;
    grid-row: 1;
    line-height: 1.4;
  }
  .ledger-date { grid-column: 1; grid-row: 2; }
  .stamp { grid-column: 2; grid-row: 2; }
  .ledger-project {
    grid-column: 3;
    grid-row: 2;
    justify-self: stretch;
    min-width: 0;
    overflow-wrap: break-word;
  }
}

/* Under about 23rem the date, the stamp and the author can't share a line
   at all, so the author takes its own. */
@media (max-width: 23rem) {
  .ledger li { grid-template-columns: auto minmax(0, 1fr); }
  .ledger-project { grid-column: 1 / -1; grid-row: 3; }
}

/* --- result pages ----------------------------------------------------- */

.result h1 {
  font: 600 1.85rem/1.25 var(--serif);
  margin: 0.4rem 0 1rem;
}

.result-meta { margin: 0; }

.abstract {
  font-style: italic;
  font-size: 1.14rem;
  color: color-mix(in srgb, var(--ink) 82%, var(--graphite));
  margin-bottom: 1.6rem;
}

.provenance {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.28rem 1.3rem;
  font: 400 0.78rem/1.7 var(--mono);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.8rem 0;
  margin: 0 0 2rem;
}

.provenance dt { color: var(--graphite); }
.provenance dd { margin: 0; overflow-wrap: anywhere; }

/* Narrow: a commit hash or a repository URL needs the full width, so the
   label moves above its value instead of stealing a column. */
@media (max-width: 38rem) {
  .provenance {
    grid-template-columns: 1fr;
    gap: 0;
    line-height: 1.5;
  }
  .provenance dt { margin-top: 0.7rem; }
  .provenance dt:first-of-type { margin-top: 0; }
}

.result h2 {
  border-top: none;
  padding-top: 0.4rem;
}

.result h3 {
  font: 600 1.1rem var(--serif);
  margin: 1.8rem 0 0.6rem;
}

blockquote {
  margin: 1.2rem 0;
  padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 2px solid var(--rule);
  color: color-mix(in srgb, var(--ink) 85%, var(--graphite));
}

code {
  font: 400 0.85em var(--mono);
  background: var(--inset);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  /* A long identifier in running prose must break rather than push the
     page sideways. */
  overflow-wrap: break-word;
}

pre {
  background: var(--inset);
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  font: 400 0.82rem/1.55 var(--mono);
  border-radius: 4px;
}

pre code { background: none; padding: 0; }

.katex-display { margin: 1.4rem 0; overflow-x: auto; overflow-y: hidden; }

table { border-collapse: collapse; margin: 1.2rem 0; }
th, td { border-bottom: 1px solid var(--rule); padding: 0.35rem 0.9rem 0.35rem 0; text-align: left; }
th { font: 400 0.72rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--graphite); }

/* A paper can carry a table of any shape, so on a phone it scrolls inside
   its own box rather than widening the page. (Our own two-column tables
   stack instead — see the help and API-key rules below.) */
@media (max-width: 38rem) {
  .result:not(.help) table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }
}

/* --- colophon --------------------------------------------------------- */

.colophon {
  border-top: 1px solid var(--rule);
  margin-top: 4.5rem;
  padding-top: 1.2rem;
  padding-bottom: 3rem;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--graphite);
}

.colophon a { color: var(--graphite); }
.colophon a:hover { color: var(--ink); }

/* --- community papers: filters, forms, account ------------------------ */

.stamp-conjecture { color: var(--graphite); }
.stamp-note { color: var(--graphite); }

.masthead nav { align-items: center; flex-wrap: wrap; }

.account-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: 400 0.75rem var(--mono);
  letter-spacing: 0.06em;
  color: var(--graphite);
  text-decoration: none;
}
.account-link:hover { color: var(--ink); }

.avatar {
  border-radius: 50%;
  border: 1px solid var(--rule);
  vertical-align: -0.35em;
  object-fit: cover;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.8rem 0;
  margin: 1.4rem 0 1.1rem;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font: 400 0.68rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
}

input[type="text"], input[type="password"], input[type="email"],
input[type="search"], input[type="date"], select {
  font: 400 0.85rem var(--serif);
  color: var(--ink);
  background: var(--inset);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  min-width: 0;
}

.filters input[type="text"] { width: 11rem; }
.filters input[type="date"] { width: 9.5rem; }

.btn {
  font: 400 0.75rem var(--mono);
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--inset);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.32rem 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--graphite); }
.btn:disabled { color: var(--graphite); cursor: default; opacity: 0.6; }
.btn-danger { color: var(--refuted); }

.pager {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0;
}
.pager-count { font: 400 0.78rem var(--mono); color: var(--graphite); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 400 0.75rem var(--mono);
  color: var(--graphite);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  margin-bottom: 0.6rem;
}
.chip-clear {
  font: 400 0.9rem var(--mono);
  color: var(--refuted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.1rem;
}

/* community ledger rows: date · stamp · title · author */
.community-ledger li { grid-template-columns: 6.2rem 7.2rem 1fr auto; }
.ledger-author {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}
.ledger-author:hover { color: var(--ink); }
.ledger-deleted { color: var(--graphite); text-decoration: line-through; }

@media (max-width: 38rem) {
  .community-ledger li { grid-template-columns: auto auto minmax(0, 1fr); }
  /* The author sits where the project does on a workbench row; flex rather
     than inline-flex so a long name wraps inside the column. */
  .ledger-author {
    grid-column: 3;
    grid-row: 2;
    display: flex;
    justify-self: stretch;
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 23rem) {
  .community-ledger li { grid-template-columns: auto minmax(0, 1fr); }
  .ledger-author { grid-column: 1 / -1; grid-row: 3; }
}

/* account page */
.stack { display: flex; flex-direction: column; gap: 0.9rem; }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font: 400 0.68rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
  max-width: 26rem;
}
.field input { font-size: 1rem; }
.field small {
  font: 400 0.78rem var(--serif);
  letter-spacing: normal;
  text-transform: none;
  color: var(--graphite);
}

.form-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.6rem 0;
}

.hint { font-size: 0.78rem; color: var(--graphite); }

.notice {
  font-size: 0.88rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--verified);
  background: var(--inset);
  padding: 0.55rem 0.9rem;
  border-radius: 4px;
  margin: 0.6rem 0;
}
.notice-error { border-left-color: var(--refuted); }

.fresh-key { overflow-wrap: anywhere; user-select: all; }

table.keys { width: 100%; }
table.keys td { font-size: 0.88rem; }

.rules dd { text-align: left; }

.account-mail { color: var(--graphite); font-size: 0.9rem; }

/* auth: tabs, forms, 2FA */
.auth-tabs { display: flex; gap: 0.4rem; border-bottom: 1px solid var(--rule); margin: 1.2rem 0 1.4rem; }
.auth-tab {
  font: 400 0.8rem var(--mono);
  letter-spacing: 0.04em;
  color: var(--graphite);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  margin-bottom: -1px;
}
.auth-tab.active { color: var(--ink); border-bottom-color: var(--link); }
.auth-form { max-width: 26rem; }
.btn-primary { background: var(--link); color: #fff; border-color: var(--link); }
.btn-primary:hover:not(:disabled) { border-color: var(--link); filter: brightness(1.08); }
.muted-link { font: 400 0.8rem var(--mono); color: var(--graphite); }

.qr {
  display: inline-block;
  background: #fff;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin: 0.6rem 0;
}
.qr svg { display: block; width: 180px; height: 180px; }
.secret { font-size: 0.9rem; }

.recovery-codes {
  list-style: none;
  padding: 0.8rem 1rem;
  margin: 0.6rem 0;
  columns: 2;
  background: var(--inset);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.recovery-codes li { margin: 0.15rem 0; }
.recovery-codes code { background: none; font-size: 0.95rem; }

.confirm-box { max-width: 26rem; margin: 0.6rem 0; }

/* help page */
.help h1 { font: 600 1.7rem/1.25 var(--serif); margin: 0.4rem 0 1rem; }
.help table { width: 100%; }
.help td { font-size: 0.9rem; }
.help td:first-child { white-space: nowrap; font: 400 0.8rem var(--mono); }
.help-raw { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 2.4rem;
  font-size: 0.85rem; color: var(--graphite); }

/* --- reader mode (assets/js/reader.js) -------------------------------- */
/* Math islands carry .rd-math from the build; everything below is inert
   until the reader toggle turns on body.rd-on. */

.rd-math.rd-display { display: block; position: relative; }

.rd-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  padding: 0.45rem 0.95rem;
  font: 400 0.78rem var(--mono);
  letter-spacing: 0.08em;
  color: var(--graphite);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgb(0 0 0 / 10%);
}
.rd-toggle[aria-pressed="true"] {
  color: var(--paper);
  background: var(--link);
  border-color: var(--link);
}

body.rd-on .rd-math { cursor: help; }
body.rd-on .rd-math:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
body.rd-on .rd-math.rd-display::before {
  content: "eq " attr(data-rd-eq);
  position: absolute;
  top: 0.1rem;
  right: 0;
  font: 400 0.68rem var(--mono);
  letter-spacing: 0.1em;
  color: var(--graphite);
}
.rd-hot {
  background: color-mix(in srgb, var(--link) 16%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--link) 16%, transparent);
  border-radius: 3px;
}

.rd-panel {
  position: fixed;
  left: 50%;
  bottom: 0.9rem;
  transform: translateX(-50%);
  z-index: 40;
  width: min(44rem, calc(100vw - 1.6rem));
  padding: 0.75rem 2.4rem 0.75rem 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgb(0 0 0 / 18%);
  font-size: 0.9rem;
}
.rd-row { display: flex; gap: 0.7rem; align-items: baseline; }
.rd-row + .rd-row { margin-top: 0.55rem; padding-top: 0.55rem; border-top: 1px dashed var(--rule); }
.rd-col { min-width: 0; }
.rd-sym {
  flex: none;
  min-width: 1.6rem;
  text-align: center;
  font-size: 1.15rem;
}
.rd-eqlabel {
  font: 400 0.68rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
}
.rd-say { font-style: italic; }
.rd-gloss { color: var(--graphite); font-size: 0.85rem; }
.rd-speak {
  flex: none;
  padding: 0.3rem 0.45rem;
  font-size: 0.95rem;
  background: var(--inset);
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  align-self: center;
}
.rd-panel-close {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  padding: 0.15rem 0.5rem;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--graphite);
  background: none;
  border: 0;
  cursor: pointer;
}

/* Touch screens: reader mode earns its keep by making the math itself a
   bigger target too. */
@media (pointer: coarse) {
  body.rd-on .rd-math .katex { font-size: 1.15em; }
}

@media (max-width: 38rem) {
  .rd-panel { bottom: 0; width: 100vw; border-radius: 8px 8px 0 0; }
  .rd-toggle { bottom: 0.7rem; right: 0.7rem; }
}

/* --- stats (owner-only /stats/ page) ----------------------------------- */

.stats h2 { margin-top: 2rem; }
.stats table { border-collapse: collapse; width: 100%; max-width: 44rem; }
.stats th, .stats td {
  text-align: left;
  padding: 0.3rem 0.9rem 0.3rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}
.stats th {
  font: 400 0.68rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
}
.stats td.num, .stats th.num { text-align: right; font-variant-numeric: tabular-nums; }
.stats td.path { font: 400 0.8rem var(--mono); overflow-wrap: anywhere; }

/* --- small screens ---------------------------------------------------- */
/* Cross-cutting phone rules. Component-specific ones live with their
   component above. */

@media (max-width: 38rem) {
  /* Headings give back some of their air; at this measure the rules above
     and below them already do the separating. */
  h2 { margin-top: 2.2rem; }
  .page-title { font-size: 1.4rem; }
  .result h1 { font-size: 1.5rem; }
  .abstract { font-size: 1.05rem; }

  /* Controls at 13.6px make iOS Safari zoom the page on focus and never
     zoom back out. 1rem is the threshold that stops it, and it doubles as
     a readable size and a bigger target. */
  input[type="text"], input[type="password"], input[type="email"],
  input[type="search"], input[type="date"], select {
    font-size: 1rem;
    padding: 0.45rem 0.6rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  /* Controls need a finger-sized target; inline links inside prose are
     tapped as words and keep their text height. */
  /* The default 40px list indent is a tenth of the screen; markers still
     read at 1.4rem. (.loop, .ledger and .recovery-codes set their own.) */
  main ul, main ol { padding-left: 1.4rem; }

  .chip { padding: 0.3rem 0.5rem 0.3rem 0.8rem; }
  .chip-clear {
    padding: 0.35rem 0.5rem;
    margin: -0.35rem 0;
    font-size: 1.05rem;
  }
  .muted-link { display: inline-block; padding: 0.4rem 0; }
  .auth-tab { padding: 0.6rem 0.9rem; }

  /* Filter controls share the row two-up instead of holding fixed widths
     that overflow. */
  .filters { gap: 0.85rem 0.9rem; }
  .filters label { flex: 1 1 8.5rem; }
  .filters input[type="text"], .filters input[type="date"], .filters select {
    width: 100%;
  }

  .form-row { gap: 0.6rem; }
  .field, .auth-form, .confirm-box { max-width: none; }

  /* Both page buttons stay on one line; the count moves below them. */
  .pager { flex-wrap: wrap; gap: 0.6rem 0.8rem; }
  .pager-count { order: 3; width: 100%; }

  /* Recovery codes read as one column; two columns of 9 characters leave
     no room to breathe. */
  .recovery-codes { columns: 1; }

  /* Our own label/value tables stack: the label sits above its value, the
     way a definition list would. */
  .help table, .help tbody, .help tr, .help td { display: block; }
  .help thead { display: none; }
  .help tr {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .help td { border: 0; padding: 0; }
  .help td:first-child {
    white-space: normal;
    margin-bottom: 0.2rem;
    color: var(--graphite);
  }

  /* API keys: same idea, but each cell keeps its column name so two dates
     in a row can't be confused. */
  table.keys, table.keys tbody, table.keys tr, table.keys td { display: block; }
  table.keys { width: 100%; }
  table.keys tr:first-child { display: none; }
  table.keys tr {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--rule);
  }
  table.keys td {
    border: 0;
    padding: 0.1rem 0;
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.6rem;
    align-items: baseline;
    /* values size to their content rather than stretching the column */
    justify-items: start;
  }
  table.keys td::before {
    content: attr(data-label);
    font: 400 0.68rem var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--graphite);
  }
  /* The revoke cell carries no label, so its button starts at the margin. */
  table.keys td[data-label=""] {
    grid-template-columns: 1fr;
    margin-top: 0.45rem;
  }
  table.keys td[data-label=""]::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
