/* The Verbatimes (codename onrecord) site stylesheet: the Phase 1 UI-SPEC design system (01-UI-SPEC.md).
 *
 * One file, no preprocessor, no build step, no import and no URL that leaves the site.
 * Only the spacing tokens below are used for margin, padding and gap. Accent colour is
 * for primary buttons and the current-page bar in the nav, nothing else. Logical
 * properties are used throughout so other scripts need no rewrite.
 */

/* ---- Tokens ---------------------------------------------------------------- */

:root {
  --paper: #F6F2E9;
  --panel: #ECE5D6;
  --ink: #1B2230;
  --muted: #4A5160;
  --rule: #7D7667;
  --accent: #B4441C;
  --destructive: #8E1B1B;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --fs-meta: 0.875rem;
  --fs-body: 1rem;
  --fs-heading: 1.25rem;
  --fs-display: 1.75rem;
  --fw-regular: 400;
  --fw-bold: 700;
  --lh-body: 1.5;
  --lh-heading: 1.2;

  --font-serif: "Libre Baskerville", "Noto Sans Devanagari", "Noto Sans Tamil",
    "Noto Sans Bengali", "Noto Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Public Sans", "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans Bengali",
    "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: var(--space-md);
  --card-padding: var(--space-md);

  color-scheme: light;
}

@media (min-width: 720px) {
  :root {
    --gutter: var(--space-lg);
    --card-padding: var(--space-lg);
  }
}

/* Indic scripts need taller lines than English. Under :lang() the script's own face goes first,
   so the characters the scripts share (danda, ZWJ, ZWNJ) come from the surrounding script's
   face. Public Sans stays in each stack because :lang(hi) also matches hi-Latn, and Hindi
   written in Latin letters must render in the Latin face. The Noto faces carry a unicode-range,
   so they load only on a page that has text in the script. */
:lang(hi) {
  --lh-body: 1.7;
  --lh-heading: 1.4;
  --font-sans: "Noto Sans Devanagari", "Public Sans", "Noto Sans", system-ui, sans-serif;
  --font-serif: "Libre Baskerville", "Noto Sans Devanagari", Georgia, serif;
}

:lang(ta) {
  --lh-body: 1.7;
  --lh-heading: 1.4;
  --font-sans: "Noto Sans Tamil", "Public Sans", "Noto Sans", system-ui, sans-serif;
  --font-serif: "Libre Baskerville", "Noto Sans Tamil", Georgia, serif;
}

:lang(bn) {
  --lh-body: 1.7;
  --lh-heading: 1.4;
  --font-sans: "Noto Sans Bengali", "Public Sans", "Noto Sans", system-ui, sans-serif;
  --font-serif: "Libre Baskerville", "Noto Sans Bengali", Georgia, serif;
}

/* ---- Fonts (self-hosted, SIL OFL; see static/fonts/README) ------------------ */

@font-face {
  font-family: "Libre Baskerville";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/libre-baskerville-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Baskerville";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/libre-baskerville-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/public-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/public-sans-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans Devanagari";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/noto-sans-devanagari-devanagari-400-normal.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}

@font-face {
  font-family: "Noto Sans Devanagari";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/noto-sans-devanagari-devanagari-700-normal.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}

@font-face {
  font-family: "Noto Sans Tamil";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/noto-sans-tamil-tamil-400-normal.woff2") format("woff2");
  unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC;
}

@font-face {
  font-family: "Noto Sans Tamil";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/noto-sans-tamil-tamil-700-normal.woff2") format("woff2");
  unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC;
}

@font-face {
  font-family: "Noto Sans Bengali";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/noto-sans-bengali-bengali-400-normal.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}

@font-face {
  font-family: "Noto Sans Bengali";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/noto-sans-bengali-bengali-700-normal.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}

/* ---- Base ------------------------------------------------------------------ */

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

html {
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  text-align: start;
}

h1,
h2 {
  margin-block: 0;
  font-family: var(--font-serif);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  overflow-wrap: anywhere;
}

h1 {
  margin-block-end: var(--space-lg);
  font-size: var(--fs-display);
}

h2 {
  margin-block-end: var(--space-md);
  font-size: var(--fs-heading);
}

p {
  margin-block: 0 var(--space-md);
  max-inline-size: 70ch;
}

ul,
ol {
  margin-block: 0 var(--space-md);
  padding-inline-start: var(--space-lg);
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid #1B2230;
  outline-offset: 2px;
}

/* A heading or summary that scripting focuses must not show a ring for the focus move. */
h1:focus:not(:focus-visible),
.error-summary:focus:not(:focus-visible) {
  outline: none;
}

.meta {
  color: var(--muted);
  font-size: var(--fs-meta);
}

.strong {
  font-weight: var(--fw-bold);
}

/* Emails, URLs and free-text names must wrap instead of widening the page. */
.wrap-anywhere,
.email,
.url,
.person-name {
  overflow-wrap: anywhere;
}

/* Handles are set in the bold face so they stand apart from prose. */
.handle {
  font-weight: var(--fw-bold);
  overflow-wrap: anywhere;
}

/* ---- Skip link ------------------------------------------------------------- */

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-md);
  inset-block-start: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-weight: var(--fw-bold);
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---- Page shell ------------------------------------------------------------ */

.site-header {
  background: var(--panel);
  border-block-end: 1px solid var(--rule);
  padding-block: var(--space-sm);
  padding-inline: var(--gutter);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
  max-inline-size: 64rem;
  margin-inline: auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  min-inline-size: 44px;
  font-family: var(--font-serif);
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.wordmark:hover {
  text-decoration: underline;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link,
.site-nav__button {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  min-inline-size: 44px;
  margin: 0;
  padding: var(--space-sm) 0;
  border: 0;
  border-block-end: 4px solid transparent;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.site-nav__link:hover,
.site-nav__button:hover {
  text-decoration-thickness: 2px;
}

.site-nav__link[aria-current="page"] {
  border-block-end-color: var(--accent);
  font-weight: var(--fw-bold);
}

.site-nav__form {
  margin: 0;
}

.page {
  inline-size: 100%;
  max-inline-size: 36rem;
  margin-inline: auto;
  padding-block: var(--space-xl) var(--space-3xl);
  padding-inline: var(--gutter);
}

.page--narrow {
  max-inline-size: 36rem;
}

.page--medium {
  max-inline-size: 48rem;
}

.page--wide {
  max-inline-size: 64rem;
}

.site-footer {
  margin-block-start: var(--space-3xl);
  padding-block: var(--space-md);
  padding-inline: var(--gutter);
  border-block-start: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--fs-meta);
}

.site-footer p {
  margin-block-end: 0;
}

/* ---- Card ------------------------------------------------------------------ */

.card {
  margin-block-end: var(--space-xl);
  padding: var(--card-padding);
  background: var(--panel);
  border: 1px solid var(--rule);
}

.card > :last-child {
  margin-block-end: 0;
}

.section-gap {
  margin-block-start: var(--space-2xl);
}

/* ---- Form field ------------------------------------------------------------ */

.form > * + * {
  margin-block-start: var(--space-lg);
}

.field {
  margin-block-end: var(--space-lg);
}

.field__label {
  display: block;
  font-weight: var(--fw-bold);
  overflow-wrap: anywhere;
}

.field__hint {
  margin-block: var(--space-sm) var(--space-xs);
  color: var(--muted);
  font-size: var(--fs-meta);
}

.field__input {
  display: block;
  inline-size: 100%;
  min-block-size: 48px;
  margin-block-start: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: 0;
  color: var(--ink);
  font: inherit;
}

.field__input[aria-invalid="true"],
.field--error .field__input {
  border-color: var(--destructive);
}

.field__error {
  margin-block: var(--space-xs) 0;
  color: var(--destructive);
  font-weight: var(--fw-bold);
  overflow-wrap: anywhere;
}

/* ---- Buttons --------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 48px;
  min-inline-size: 44px;
  margin: 0;
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: var(--fw-bold);
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.button--secondary {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
}

.button--destructive {
  background: var(--paper);
  border-color: var(--destructive);
  color: var(--destructive);
}

.button--confirm {
  background: var(--destructive);
  border-color: var(--destructive);
  color: var(--paper);
}

.button:hover,
.button:active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.button[aria-disabled="true"] {
  cursor: default;
}

/* The share card's preview (S56): the picture scales with the column and keeps its ratio. */
.share__preview {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
  border: 1px solid var(--rule);
  margin-block-end: var(--space-md);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

/* ---- Notices and error summary --------------------------------------------- */

.notice {
  margin-block-end: var(--space-lg);
  padding: var(--space-md);
  background: var(--panel);
  border-inline-start: 4px solid var(--ink);
}

.notice--problem {
  border-inline-start-color: var(--destructive);
}

.notice > :last-child {
  margin-block-end: 0;
}

.notice__prefix {
  font-weight: var(--fw-bold);
}

.error-summary {
  margin-block-end: var(--space-lg);
  padding: var(--space-md);
  background: var(--panel);
  border-inline-start: 4px solid var(--destructive);
}

.error-summary__title {
  margin-block-end: var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
}

.error-summary ul {
  margin-block-end: 0;
}

/* ---- Description list ------------------------------------------------------ */

.details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-md);
  margin: 0;
}

.details__term {
  margin: 0 0 var(--space-xs);
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  overflow-wrap: anywhere;
}

.details__value {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 720px) {
  .details {
    grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
    column-gap: var(--space-lg);
    row-gap: var(--space-md);
  }

  .details__term {
    min-inline-size: 8rem;
    margin-block-end: 0;
  }
}

/* ---- Tags ------------------------------------------------------------------ */

.tag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-flex;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--ink);
  font-size: var(--fs-meta);
  font-weight: var(--fw-regular);
  overflow-wrap: anywhere;
}

/* ---- Row list -------------------------------------------------------------- */

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

.row-list__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-block: var(--space-md);
  border-block-start: 1px solid var(--rule);
}

.row-list__item:first-child {
  padding-block-start: 0;
  border-block-start: 0;
}

.row-list__item:last-child {
  padding-block-end: 0;
}

.row-list__item > * {
  margin-block: 0;
}

@media (min-width: 720px) {
  .row-list__item {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm) var(--space-md);
  }
}

/* ---- Responsive table ------------------------------------------------------ */

/* Below 720px every row is a stacked block and each cell shows its column name taken from
   data-label. The template sets table roles so the structure survives the display change. */
.data-table {
  display: block;
  inline-size: 100%;
  border-collapse: collapse;
}

.data-table thead {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.data-table tbody,
.data-table tr,
.data-table td {
  display: block;
}

/* The stacked header row is visually hidden. Its cells must not keep the width of their text
   (330px and 370px at 320px wide), so each is a 1px clipped block. */
.data-table th {
  display: block;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  white-space: nowrap;
}

.data-table tr {
  padding-block: var(--space-md);
  border-block-start: 1px solid var(--rule);
}

.data-table tr:first-child {
  border-block-start: 0;
}

.data-table td {
  padding-block: var(--space-xs);
  overflow-wrap: anywhere;
}

.data-table td::before {
  content: attr(data-label);
  display: block;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
}

.data-table td:first-child {
  font-weight: var(--fw-bold);
}

.data-table td:first-child::before {
  display: none;
}

@media (min-width: 720px) {
  .data-table {
    display: table;
    border: 1px solid var(--rule);
  }

  .data-table thead {
    position: static;
    inline-size: auto;
    block-size: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
    display: table-header-group;
  }

  .data-table tbody {
    display: table-row-group;
  }

  .data-table tr {
    display: table-row;
    padding: 0;
    border-block-start: 0;
  }

  .data-table td,
  .data-table th {
    display: table-cell;
    padding: var(--space-sm) var(--space-md);
    border-block-start: 1px solid var(--rule);
    text-align: start;
    vertical-align: top;
  }

  .data-table th {
    inline-size: auto;
    block-size: auto;
    overflow: visible;
    white-space: normal;
    background: var(--panel);
    color: var(--muted);
    font-size: var(--fs-meta);
    font-weight: var(--fw-bold);
  }

  .data-table tbody tr:hover td {
    background: var(--panel);
  }

  .data-table td::before {
    display: none;
  }
}

/* ---- Pager ----------------------------------------------------------------- */

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

.pager__link {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  min-inline-size: 44px;
}

/* ---- Confirm page ---------------------------------------------------------- */

.confirm__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

/* ---- Passkey control ------------------------------------------------------- */

.passkey {
  margin-block-end: var(--space-md);
}

.passkey__status {
  margin-block: var(--space-sm) 0;
  color: var(--muted);
  font-size: var(--fs-meta);
}

.passkey[data-state="waiting"] .button {
  cursor: default;
}

.passkey[data-state="unsupported"] .button,
.passkey[hidden],
.passkey [hidden] {
  display: none;
}


/* ==== Phase 2 (02-UI-SPEC "Page Components (Phase 2 additions)") ====================== */

/* An element that declares an Indic language takes that script's face and line height. The
   variables above are set by :lang(), but font-family and line-height are inherited as values
   already resolved on <body>, so the element has to ask for them again. */
:lang(hi),
:lang(ta),
:lang(bn) {
  font-family: var(--font-sans);
  line-height: var(--lh-body);
}

/* Inside a serif heading the name keeps the heading's face and takes the taller heading line. */
h1 :lang(hi),
h1 :lang(ta),
h1 :lang(bn),
h2 :lang(hi),
h2 :lang(ta),
h2 :lang(bn) {
  font-family: var(--font-serif);
  line-height: var(--lh-heading);
}

/* Heading level 3: used inside cards, under the card's h2. */
h3 {
  margin-block: 0 var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  line-height: var(--lh-body);
  overflow-wrap: anywhere;
}

/* An h3 that follows other card content gets the gap a new group needs. */
* + h3 {
  margin-block-start: var(--space-lg);
}

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

/* Step indicator and count line. */
.step {
  margin-block-end: var(--space-sm);
}

.count-line {
  margin-block-end: var(--space-md);
}

/* A count line straight under a description list (the topic page facts) keeps the gap a new
   block needs; the list has no margin of its own. */
.details + .count-line {
  margin-block-start: var(--space-md);
}

/* Text area and select share the field anatomy. */
.field__textarea {
  min-block-size: 144px;
  resize: vertical;
}

.field__select {
  min-block-size: 48px;
}

/* A fixed fact inside a form, with a text link to the step that sets it. */
.read-only {
  margin-block-end: var(--space-lg);
}

/* Choice group: a fieldset whose legend looks like a field label, one native control per row. */
.choice-group {
  min-inline-size: 0;
  margin: 0 0 var(--space-lg);
  padding: 0;
  border: 0;
}

.choice-group__legend {
  padding: 0;
  font-weight: var(--fw-bold);
  overflow-wrap: anywhere;
}

.choice-group--error {
  padding-inline-start: var(--space-md);
  border-inline-start: 4px solid var(--destructive);
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-block-size: 44px;
}

.choice input {
  flex: none;
  inline-size: 24px;
  block-size: 24px;
  margin: 0;
  accent-color: var(--ink);
}

/* The words exactly as typed: line breaks kept, no quotation marks added, no shortening. */
.quote-block {
  margin: 0 0 var(--space-md);
  padding-inline-start: var(--space-md);
  border-inline-start: 4px solid var(--ink);
  font-family: var(--font-serif);
  font-size: var(--fs-heading);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.context__text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.context {
  margin-block-start: var(--space-lg);
}

/* Record label: a fact about the record. Two-pixel stroke and bold, so it is told apart from a
   status tag by stroke and weight, not by colour. */
.record-labels {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: 0 0 var(--space-md);
  padding: 0;
  list-style: none;
}

.record-labels__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.record-label {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border: 2px solid var(--ink);
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  overflow-wrap: anywhere;
}

/* Rule results: the bar is a second signal; the prefix word is always there. */
.rule-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: 0 0 var(--space-md);
  padding: 0;
  list-style: none;
}

.rule-result {
  padding: var(--space-sm) var(--space-md);
  background: var(--panel);
  border-inline-start: 4px solid var(--ink);
}

.rule-result--must_fix {
  border-inline-start-color: var(--destructive);
}

.rule-result > p {
  margin-block: 0;
  overflow-wrap: anywhere;
}

.rule-result > p + p {
  margin-block-start: var(--space-xs);
}

.rule-result__prefix {
  font-weight: var(--fw-bold);
}

/* The Problems column of My submissions: one line per problem, no bullets. */
.problem-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.problem-list > li,
.problem-list__none {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Archive state line: the tag word, then the sentence. The bar marks the states that need the
   contributor to act. */
.archive-line {
  margin: 0;
  overflow-wrap: anywhere;
}

.archive-line--action {
  padding-inline-start: var(--space-md);
  border-inline-start: 4px solid var(--destructive);
}

/* The full SHA-256, never shortened. */
.hash {
  font-size: var(--fs-meta);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* One article per source, separated by a rule. */
.source-block {
  padding-block: var(--space-lg);
  border-block-start: 1px solid var(--rule);
}

.source-block:last-child {
  padding-block-end: 0;
}

.count-line + .source-block {
  border-block-start: 0;
  padding-block-start: 0;
}

/* ---- Registry rows (politician search, offices and memberships) ------------- */

/* The text of a search row. Names in any script wrap; nothing is clipped. */
.row-list__text {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.row-list__text > p {
  margin-block: 0;
}

/* A tip's note keeps the line breaks its sender typed. */
.tip-note {
  white-space: pre-line;
}

.row-list__text > p + p {
  margin-block-start: var(--space-xs);
}

/* One office or membership inside its card, separated by a rule. */
.record-row {
  padding-block: var(--space-lg);
  border-block-start: 1px solid var(--rule);
  overflow-wrap: anywhere;
}

.record-row:first-of-type {
  padding-block-start: 0;
  border-block-start: 0;
}

.record-row:last-child {
  padding-block-end: 0;
}

.record-row > p {
  margin-block: 0 var(--space-sm);
}

.record-row > .details {
  margin-block-start: var(--space-md);
}

/* A name in its own script, in a description list. */
.name-value {
  overflow-wrap: anywhere;
}

/* ---- Forced colours -------------------------------------------------------- */

@media (forced-colors: active) {
  .site-nav__link[aria-current="page"] {
    border-block-end-color: CanvasText;
  }

  .notice,
  .notice--record,
  .error-summary,
  .rule-result,
  .rule-result--blocked,
  .speaker-check,
  .archive-line--action,
  .quote-block,
  .choice-group--error {
    border-inline-start-color: CanvasText;
  }
}

/* "Our copy": the links to the stored copies of one capture, one per line. */
.evidence-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-links__item {
  overflow-wrap: anywhere;
}

.evidence-links__item + .evidence-links__item {
  margin-block-start: var(--space-xs);
}

/* A contributor's capture beside the quote it is compared with: it scales to the column and
   never causes a sideways scroll; the evidence link opens it alone at full size. */
.capture-image {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
  border: 1px solid var(--rule);
}

/* ---- Review and trust (Phase 3) -------------------------------------------- */

/* In-page links at the top of a long page: one per section, each at least 44px tall. */
.jump-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0 0 var(--space-lg);
  padding: 0;
  list-style: none;
}

.jump-list a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding: var(--space-sm) var(--space-md);
  color: var(--ink);
  text-decoration: underline;
}

/* A publication-gate refusal: the person at the page cannot fix it by editing. The bar is the
   second signal; the "Blocked:" prefix is always there. */
.rule-result--blocked {
  border-inline-start-color: var(--destructive);
}

/* The speaker card: the line that tells the reviewer to check the role when the registry has no
   confirmed office for the day. The bar is the second signal; the sentence is always there. */
.speaker-check {
  padding-inline-start: var(--space-md);
  border-inline-start: 4px solid var(--destructive);
}

/* A source block's reviewer part: our copy first, then the original, then the recording. */
.source-review > p {
  margin-block: var(--space-sm) 0;
  overflow-wrap: anywhere;
}

/* The YouTube frame on S35 (D-40): it scales with the column and keeps the player's 16:9 shape. */
.embed-frame {
  display: block;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  margin-block-start: var(--space-sm);
  border: 1px solid var(--rule);
}

/* The checklist: one native checkbox per row, the whole label clickable and 44px tall. */
.choice-group .field + .field {
  margin-block-start: var(--space-sm);
}

/* The word diff on S44 (UI-SPEC A18): one item per run of differing words. Stored words are struck
   through and re-typed words underlined 2px, so the two read apart without colour; each carries
   visually hidden "[stored: ...]" or "[re-typed: ...]" text. Long words in Hindi, Tamil and
   Bengali wrap inside the column at 320px and 200% zoom. */
.word-diff {
  margin: 0 0 var(--space-md);
  padding: 0;
  list-style: none;
}

.word-diff__item {
  padding-block: var(--space-sm);
  line-height: var(--lh-body);
  overflow-wrap: anywhere;
}

.word-diff__item + .word-diff__item {
  border-block-start: 1px solid var(--rule);
}

.word-diff del {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.word-diff ins {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

@media (forced-colors: active) {
  .word-diff__item + .word-diff__item {
    border-block-start-color: CanvasText;
  }
}

/* ---- Reader and disputes (Phase 4) ------------------------------------------ */

/* The nameplate of the reader site: the site name as a link, a one-line tagline, and a 4px ink rule
   under the block (04-UI-SPEC "Stylesheet Contract"). It is not a heading. */
.masthead {
  padding-block: var(--space-lg) var(--space-md);
  padding-inline: var(--gutter);
  border-block-end: 4px solid var(--ink);
  text-align: start;
}

.masthead__name {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.masthead__name:hover,
.masthead__name:focus-visible {
  text-decoration: underline;
}

.masthead__tagline {
  margin-block: var(--space-xs) 0;
  color: var(--muted);
  font-size: var(--fs-meta);
}

@media (min-width: 720px) {
  .masthead {
    text-align: center;
  }

  .masthead__tagline {
    margin-inline: auto;
  }
}

/* The reader's main navigation: the .site-nav pattern, wrapping, each link 44px tall. */
.reader-nav {
  padding-inline: var(--gutter);
  border-block-end: 1px solid var(--rule);
}

.reader-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .reader-nav__list {
    justify-content: center;
  }
}

.reader-nav__link {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding: var(--space-sm) var(--space-md);
  border-block-end: 4px solid transparent;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.reader-nav__link:hover {
  text-decoration-thickness: 2px;
}

.reader-nav__link[aria-current="page"] {
  border-block-end-color: var(--accent);
  font-weight: var(--fw-bold);
}

/* A notice that is part of the document, not an announcement: the notice shape with an ink bar. */
.notice--record {
  margin-block-end: var(--space-lg);
  padding: var(--space-md);
  background: var(--panel);
  border-inline-start: 4px solid var(--ink);
}

.notice--record > :last-child {
  margin-block-end: 0;
}

/* One entry of the Disputes and corrections card: a bold lead, then the public note, with a rule
   between entries. */
.record-entry {
  padding-block: var(--space-md);
  border-block-start: 1px solid var(--rule);
}

.record-entry:first-of-type {
  padding-block-start: 0;
  border-block-start: 0;
}

.record-entry > p {
  margin-block: 0;
}

.record-entry > p + p {
  margin-block-start: var(--space-xs);
}

/* The reason a member gave for a dispute keeps the line breaks they typed. */
.dispute-reason {
  white-space: pre-wrap;
}

/* The sentence under the words: what "verified" means. */
.verified-line {
  margin-block: var(--space-md);
  max-inline-size: 70ch;
}

/* The words on a quote page at 280 code points or fewer: the Display size at the regular weight.
   The server sets the class; longer words keep the Quote text size. */
.quote-block--lead {
  font-size: var(--fs-display);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
}

/* Another reviewed translation into the same language: a native disclosure, no script. The
   summary is a 44px target and shows the standard focus ring. */
.more-translations {
  margin-block-start: var(--space-md);
}

.more-translations > summary {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  cursor: pointer;
  font-weight: var(--fw-bold);
}

.more-translations > summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* The topic list on the home page: no bullets, a rule above each row. */
.topic-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-list__item {
  padding-block: var(--space-md);
  border-block-start: 1px solid var(--rule);
}

.topic-list__title {
  font-family: var(--font-serif);
  font-size: var(--fs-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
}

/* The topic page (S55): four sides, each holding parties, each holding quote entries. A side after
   another and the first party under a side stand apart by the larger steps of the scale. */
.side + .side {
  margin-block-start: var(--space-2xl);
}

.side > .party-group:first-of-type {
  margin-block-start: var(--space-xl);
}

.party-group + .party-group {
  margin-block-start: var(--space-xl);
}

/* A quote entry: a rule above, the speaker as a level 3 heading, then the lines, the words and the
   link. The stub of a retracted quote is one paragraph with the same rule and padding. */
.quote-entry,
.quote-entry--stub {
  padding-block: var(--space-lg);
  border-block-start: 1px solid var(--rule);
}

.quote-entry > h4 {
  margin-block: 0 var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  line-height: var(--lh-body);
  overflow-wrap: anywhere;
}

.quote-entry > p {
  margin-block-end: var(--space-sm);
}

.quote-entry--stub {
  margin-block: 0;
  /* The stub is a paragraph, so the 70ch measure of `p` would end its rule short of the rule of
     the article entries around it. */
  max-inline-size: none;
  overflow-wrap: anywhere;
}

/* Two cards side by side: the wording as a member proposed it and as a moderator approved it.
   One column below 720px. */
.side-by-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
}

.side-by-side > .card {
  min-inline-size: 0;
  margin-block-end: 0;
}

@media (min-width: 720px) {
  .side-by-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A description in a card keeps the line breaks its author typed. */
.details__value--text {
  white-space: pre-line;
}

@media (forced-colors: active) {
  .masthead {
    border-block-end-color: CanvasText;
  }

  .reader-nav__link[aria-current="page"] {
    border-block-end-color: CanvasText;
  }

  .side-by-side .card {
    border-color: CanvasText;
  }

  .quote-entry {
    border-block-start-color: CanvasText;
  }

  .reader-search {
    border-block-end-color: CanvasText;
  }

  .person-list__item {
    border-block-start-color: CanvasText;
  }

  .filters {
    border-color: CanvasText;
  }

  .breaking-card {
    border-color: CanvasText;
  }
}

/* Print: the reader pages show where each external link goes and hide what cannot be used on
   paper. Scoped to the class the reader base template puts on its body. */
@media print {
  .reader-page .reader-nav,
  .reader-page .reader-search,
  .reader-page .filters,
  .reader-page .share,
  .reader-page .actions {
    display: none;
  }

  .reader-page a[href^="http"]::after {
    content: " (" attr(href) ")";
  }
}

/* ---- Search, Breaking and launch (Phase 5) ----------------------------------- */

/* The masthead search (D-07, A34 to A36): an input and a secondary button in one row at every
   width, under the reader nav. The input takes what the button leaves. */
.reader-search {
  display: flex;
  gap: var(--space-sm);
  padding-block: var(--space-md);
  padding-inline: var(--gutter);
  border-block-end: 1px solid var(--rule);
}

.reader-search .field__input {
  flex: 1 1 auto;
  min-inline-size: 0;
  inline-size: auto;
  margin-block-start: 0;
}

@media (min-width: 720px) {
  .reader-search {
    max-inline-size: 36rem;
    margin-inline: auto;
  }
}

/* A politician in the list a name search opens with: no bullets, a rule above, the name as a
   level 3 heading and the lines under it as Meta. */
.person-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.person-list__item {
  padding-block: var(--space-md);
  border-block-start: 1px solid var(--rule);
  overflow-wrap: anywhere;
}

.person-list__item > h3 {
  margin-block: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  line-height: var(--lh-body);
}

.person-list__item > .meta {
  margin-block: var(--space-xs) 0;
}

/* The speaker of a result entry: the heading of the topic page entry, at level 3. */
.quote-entry > h3,
.quote-entry__speaker {
  margin-block: 0 var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  line-height: var(--lh-body);
  overflow-wrap: anywhere;
}

/* A line or the filter panel straight under a description list gets the gap a new block needs, as
   `.details + .count-line` does above (05-UI-SPEC "Lessons"). */
.details + .meta {
  margin-block-start: var(--space-md);
}

.details + .filters {
  margin-block-start: var(--space-md);
}

/* The people and the quotes of one search stand apart by the larger step of the scale. */
.person-list + h2,
h2 + .quote-entry {
  margin-block-start: var(--space-xl);
}

/* The filter panel of the search page (SRCH-03, D-14): a native disclosure inside the one GET form,
   no script. The summary is a 44px target and shows the standard focus ring; the fields stack with
   the medium gap, and the last has room below it. */
.filters {
  margin-block: var(--space-md);
  border: 1px solid var(--rule);
  padding-inline: var(--card-padding);
}

.filters > summary {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  cursor: pointer;
  font-weight: var(--fw-bold);
}

.filters > summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.filters > .field + .field {
  margin-block-start: var(--space-md);
}

.filters[open] {
  padding-block-end: var(--space-md);
}

/* The speaker of a Breaking entry on its own page is a level 2 heading, so it takes the Heading
   role (20px, 700) instead of the body size of a level 3 speaker (S94, A43). The words stay the
   same 20px Quote text as every other entry. */
.quote-entry > h2.quote-entry__speaker {
  font-size: var(--fs-heading);
  line-height: var(--lh-heading);
}

/* The Breaking card of the home page (S107): the card panel with its entries as quote entries. A
   rule sits between two entries and not above the first, which already has the card's own top
   edge. */
.breaking-card {
  margin-block-end: var(--space-xl);
}

.breaking-card > .quote-entry {
  padding-block: var(--space-lg);
}

.breaking-card > .quote-entry:first-of-type {
  border-block-start: 0;
}

/* The monthly counts (S96, D-38): one section for each month, newest first, a step of the scale
   apart; its two tables are the responsive `data-table` with room above and below. */
.month + .month {
  margin-block-start: var(--space-2xl);
}

.month .data-table {
  margin-block: var(--space-md);
}
