/* =========================================================================
   Cabinhub News — the article page beyond the body (N3-DESIGN)

   Owner: N3-DESIGN. New file; loaded after css/detail.css so its additions
   win the equal-specificity tie, and before css/a11y.css so the system focus
   and tap rules still have the last word.

   Three surfaces live here:
     .reading-progress / .signoff / .detail__actions / .act   the story's own
     .saved / .saved__*                                     the reading list
     .related + .related__*                                 the shelf below
                                                            the story

   Everything is drawn from tokens.css. There is no new colour, no gradient,
   no shadow, no uppercase micro-label and no italic. Type is the reading
   face for the credit line (it is prose) and the UI face for the controls.
   ========================================================================= */

/* ================================================= reading progress =====
   One 2px accent rule across the top of the viewport, drawn only while an
   article is open. It sits under the sticky toolbar (which is 60px tall once
   a11y.css applies the 44px targets), so it reads as the edge of the paper
   rather than as a floating UI bar, and it never covers the reading column.

   transform: scaleX on the fill is the only thing that changes; the bar
   itself never moves, so nothing reflows while a reader scrolls. */
.reading-progress {
  position: fixed;
  /* Base.css gives every element a border-box; the notch padding must add to
     the 2px rule rather than eat it, so the bar restates the box. */
  box-sizing: content-box;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 7;                     /* above the toolbar (6) and filters (5) */
  background: transparent;
  pointer-events: none;
  /* The notch: the rule starts where the page starts. */
  padding-top: env(safe-area-inset-top, 0px);
}
.reading-progress__fill {
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  /* No transition: the value arrives at rAF rate already, and reduced motion
     has nothing to suppress here — the transform IS the reading position,
     not an animation. A `transition: none` under prefers-reduced-motion would
     be redundant; deleting the transform there would draw a full bar. */
}

/* =================================================== in-story contents ===
   A compact list of the story's own sections, above the first one. Chips
   rather than a boxed sidebar: the aside sits below the body on a phone, so
   the contents have to be where every reader starts. The active chip is the
   section in view; the fill and the rule all come from tokens.css. */
.toc {
  margin: 0 0 1.4rem;
  padding-top: 0.2rem;
}
.toc__head {
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.toc__head::after { content: ""; flex: 1; height: 1px; background: var(--rule-soft); }
.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}
.toc__link {
  display: inline-block;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.toc__link:hover { color: var(--ink); border-color: var(--rule-strong); }
.toc__link[aria-current="location"] {
  /* --accent-ink is white in light and near-black in dark; on --accent-soft it
     measured 1.20:1 (light) and 1.17:1 (dark), both below 4.5:1 — axe reported
     1.2:1 on this link. --ink on --accent-soft passes in both themes
     (14.79:1 light, 13.49:1 dark). */
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-soft);
}
@media (prefers-reduced-motion: reduce) {
  .toc__link { transition: none; }
}

/* The sticky toolbar is 60px; a section jumped to from the contents, or from a
   copied fragment link, must land below it rather than behind it. Matches
   TOC_LINE in js/article.js. */
.sheet .section-label[tabindex] { scroll-margin-top: 5rem; }

/* ================================================ source attribution ====
   One line under the headline, before the first paragraph: the address the
   document sits at, and when we read it. The desk's name is already in the
   kicker above the headline, so it is not repeated here — Reuters puts the
   wire name in the body dateline and the credit under the byline for the same
   reason: a reader should never meet the same fact twice in one screen.

   No glyph separates the two facts. A middot between two small-type facts is
   the one character that can be left dangling at the end of a wrapped line,
   and on a 390px phone this line does wrap in Chinese. Space alone is the
   separator, so no wrap can ever leave a mark behind. */
.attribution {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 0.7rem;
  row-gap: 0.1rem;
  margin: 0.8rem 0 0;
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  line-height: 1.55;
  color: var(--ink-faint);
}
.attribution__via { color: var(--ink-faint); }
/* A source address is a link, and it is underlined: the one place on the page
   where a reader can leave and check the claim. The underline is a hairline
   rule, not a brighter colour — the colour would compete with the headline. */
.attribution__link {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
  /* It is an inline link in a line of small type, so its hit area is the line
     box, not a block: 20px tall at the label step, under the 24px 2.5.8 floor
     the rest of the page holds. Padding buys the height without moving the
     type, and the negative block margin gives the line box back, so the
     paragraph keeps its rhythm. */
  display: inline-block;
  padding-block: 3px;
  margin-block: -3px;
  vertical-align: baseline;
}
/* On a TOUCH device the source link is a thumb target, not a mouse target.
   Measured live 2026-11-12 on production (Playwright, iPad portrait 768x1024,
   coarse pointer, the story that carries a geekpark.net source): the link
   painted 85x26 — 485 bytes tall short of the product's own 44px tap token,
   and the only control under it on that route. The padding above buys 26px,
   which clears WCAG 2.5.8's 24px floor but not our token.

   The 44px box is grown the same way a11y.css grows the footer links: an
   overhanging ::after so the type, the underline and the paragraph's rhythm
   do not move. It is scoped to coarse pointers — on a mouse the smaller box is
   correct, and a 44px block would break the sentence's line box. */
@media (pointer: coarse) {
  .attribution__link {
    position: relative;
    /* The line is a flex row of three spans, and the two timestamps are
       painted AFTER the link, so they sat on top of its overhang: measured
       2026-11-12, the hit area was 26px above the link's own box and 0px
       below it. The overhang is transparent and its neighbours are plain
       text, so lifting the link above them steals no click from a control. */
    z-index: 1;
  }
  .attribution__link::after {
    content: "";
    position: absolute;
    /* Centred on BOTH axes, and at least the token wide: a short domain
       ("gov.uk", 40px) is a narrow target even when it is tall enough. The
       -50%/-50% pair is what makes the band symmetric; anchoring the box by
       its top edge instead put 10px of reach above the link and 36px below,
       which is a target whose grab point is not where the word is. */
    left: 50%;
    top: 50%;
    width: max(100%, 46px);
    height: 46px;
    transform: translate(-50%, -50%);
    background: transparent;
    border-radius: 0;
  }
}
@media (hover: hover) and (pointer: fine) {
  .attribution__link:hover { color: var(--ink); text-decoration-color: currentColor; }
}
.attribution__time { font-variant-numeric: tabular-nums; }
.attribution__time + .attribution__time::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 2px;
  margin: 0 0.7rem 0.28em;
  border-radius: 50%;
  background: var(--rule-strong);
  vertical-align: baseline;
}
@media (forced-colors: active) {
  .attribution__link { color: LinkText; }
}
/* DEFECT FIXED (PORT-UX, 2026-11-18). This rule used to hide the Reference
   panel once article.js had copied its two facts into the inline line above,
   to stop the same fact being printed twice. But the panel is the citation
   RECORD — it is the only place the reader sees the source named under the
   word "Reference" / "参考来源" with a clickable, dated address — and
   hiding it dropped that word from the rendered page entirely (measured: the
   rendered-copy gate's `Reference` / `参考来源` assertion could not be met, and
   a reader at a desk lost the verifiable citation). One line of small type and
   a foot-of-page citation panel are not the same thing printed twice: the line
   credits the frame, the panel records where the story came from. The panel
   now stays visible; article.js no longer sets the flag. */

/* ======================================================== signoff =======
   The end of the story names the desk that filed it, in the reading face,
   one quiet line under a hairline: Reuters closes with "Reporting by ...;
   Editing by ...", the New York Times with the desk. We have one fact, the
   source desk, and we print it and nothing invented.

   It is a full-measure line at the bottom of the article sheet, not a
   sticker: no box, no fill, no rounded panel. */
.signoff {
  margin-top: clamp(1.6rem, 3.4vw, 2.4rem);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--rule);
}
.signoff__text {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  line-height: 1.6;
  color: var(--ink-faint);
}
.signoff__name { color: var(--ink-soft); font-weight: 500; }

/* ====================================================== the two actions ==
   Share and Save as one pair, laid out as words with a small mark, the way
   Bloomberg sets "Save" and "Translate" as plain text under the timestamp.
   The box is invisible until it is touched: a hairline outline on hover, a
   fill on press, the system focus ring when tabbed to (a11y.css). */
.detail__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  margin-top: var(--sp-3);
}

.act {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--tap);
  padding: 0 0.7rem 0 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.004em;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease),
              background-color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
}
.act .icon { color: var(--ink-faint); transition: color var(--dur-1) var(--ease); }
.act__label { white-space: nowrap; }

@media (hover: hover) and (pointer: fine) {
  .act:hover {
    color: var(--ink);
    background: var(--paper-2);
    border-color: var(--rule-soft);
  }
  .act:hover .icon { color: var(--ink-soft); }
}
.act:active { background: var(--paper-3); }

/* Text size: a two-step stepper at the head of the action row. The A− / A+
   glyphs carry the meaning on screen; the aria-labels carry it for AT. A
   bounded control greys its button at the end instead of vanishing, so the
   reader can see the limit rather than guess why nothing happened. */
.act-size {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  margin-inline-end: 0.15rem;
}
.act-size__label {
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  color: var(--ink-faint);
  padding-inline: 0.2rem 0.35rem;
}
.act--size {
  min-width: var(--tap);
  justify-content: center;
  padding: 0 0.45rem;
}
.act__glyph {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
}
/* Read aloud: a play/pause toggle and a stop, at the head of the row beside the
   size stepper. It reuses .act for the button skin; the glyph carries the
   action on screen while the aria-label carries it for AT. While it is actually
   speaking, the toggle wears the accent so "it is reading" reads at a glance. */
.act-speak {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  margin-inline-end: 0.15rem;
}
.act--speak.is-on { color: var(--accent); }
.act--speak.is-on .act__glyph { color: var(--accent); }

.act[disabled] {
  color: var(--ink-faint);
  opacity: 0.45;
  cursor: default;
}
@media (hover: hover) and (pointer: fine) {
  .act[disabled]:hover { background: transparent; border-color: transparent; color: var(--ink-faint); }
}

/* Saved is a held state, not an alert: the accent is on the mark and the
   word, at the same weight as everything else in the row. */
.act.is-on { color: var(--accent); }
.act.is-on .icon { color: var(--accent); }
/* The mark is a held state: the bookmark's body is filled in the soft brand
   wash so "saved" reads at a glance without a second badge. */
.act.is-on .icon path:first-child { fill: var(--accent-soft); }

/* The confirmation line: it sits after the pair, occupies no space until it
   has something to say, and never pushes the layout when it retires. It is
   always in the DOM for the live region, so it is the element that is
   hidden, never text that appears from nowhere. */
.act__note {
  font-size: var(--fs-label);
  line-height: 1.5;
  color: var(--ink-faint);
  /* It sits beside the pair it confirms, not at the far edge of the column:
     a sentence 500px from the button it describes reads as unrelated. */
  margin-inline-start: 0.5rem;
  max-width: 100%;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.act__note.is-on { opacity: 1; }
@media (max-width: 420px) {
  /* On a phone the pair owns the row; the confirmation drops beneath it. */
  .act__note { flex-basis: 100%; margin-inline-start: 0; }
}

/* ======================================================== saved list ====
   The reading list, above the front-page feed: one line per story, the
   title in the reading face and the desk in small type. It is a list, so it
   is separated by hairlines, never boxed. */
.saved {
  margin-bottom: clamp(1.2rem, 2.6vw, 1.8rem);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--rule);
}
.saved__head {
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 var(--sp-2);
}
.saved__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.saved__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule-soft);
}
.saved__item:first-child { border-top: 0; padding-top: 0.15rem; }
.saved__title {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.006em;
  color: var(--ink);
  text-decoration: none;
  text-wrap: pretty;
}
@media (hover: hover) and (pointer: fine) {
  .saved__title:hover { color: var(--accent); }
}
.saved__meta {
  grid-column: 1;
  margin: 0.1rem 0 0;
  font-size: var(--fs-label);
  line-height: 1.5;
  color: var(--ink-faint);
}
.saved__meta:empty { display: none; }
.saved__src { color: var(--ink-faint); }

/* Remove is a word, not a glyph: it is the one destructive control on the
   page and a reader must read it before pressing it. The hit area is the
   44px tap token even though the word is small; a11y.css raises this to the
   full target, this rule only aligns it to the first line. */
.saved__remove {
  appearance: none;
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: baseline;
  border: 0;
  background: transparent;
  padding: 0 0.35rem;
  min-height: 32px;
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  color: var(--ink-faint);
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .saved__remove:hover { color: var(--ink); background: var(--paper-2); }
}

/* ===================================================== related shelf ====
   The story's own cards, under a rule: the block app.js renders
   (section.related > .section-head + .related__note + .related__list) keeps its
   markup exactly and gains a shelf's typography here.

   Decisions
     - The head is the block's own label at the reading step, not a caption:
       this is what a reader chooses next, the second most important line on
       the page.
     - The note ("what led to this ...") and the window count stay in the
       DOM but are not drawn: both describe how the endpoint works, which is
       contract documentation, not reader copy.
     - Cards are separated by hairlines, not boxes, exactly as on the front
       page. Their titles step down one size from the article headline so the
       shelf cannot compete with the story that just ended.
     - The why-it-is-related line is reader evidence ("shared: USD"), so it
       stays, in the UI face, one step below the title. */
.related {
  margin-top: clamp(2rem, 4.5vw, 3.4rem);
  border-top: 2px solid var(--rule-strong);
  padding-top: clamp(0.9rem, 2vw, 1.3rem);
  /* The shelf swaps its own state in place (loading -> list, or error -> list on a
     retry). Exclude it from the browser's scroll anchoring so a change in the
     shelf's height never drags the reader's viewport to compensate. */
  overflow-anchor: none;
}

.related .section-head {
  display: block;
  padding: 0;
  /* feed.css draws a hairline at the head's top; the shelf's own rule above
     already separates it, so the second line is dropped. */
  border-top: 0;
  font-family: var(--font-display);
  font-size: var(--fs-sub);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.related .section-head > span:last-child { display: none; }

.related__note { display: none; }

.related__empty {
  margin-top: var(--sp-3);
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* A failed load says so in words (same quiet size as the empty note) and offers
   one control to ask again. The button carries the shared .button style; only its
   spacing is the shelf's. */
.related__error {
  margin-top: var(--sp-3);
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--ink-soft);
}
.related__actions { margin-top: var(--sp-2); }
/* Programmatic focus after a retry lands: keep it invisible, the shelf is a region
   not a control — but leave a visible ring for a keyboard user who focuses by key. */
.related:focus { outline: none; }
.related:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 4px; }

.related__list {
  margin-top: clamp(0.7rem, 1.6vw, 1.1rem);
  column-gap: clamp(1.4rem, 3vw, 2.4rem);
  row-gap: clamp(1rem, 2vw, 1.4rem);
}

/* A card in the shelf is a headline with its own dateline. Two facts decided
   this shape, both measured on the live pages (card1/ on tx-sh5, 2026-11-08):

     1440, three columns of 321px: the title column is 223px. With the plate as
     a float, the fourth line of a headline ran UNDERNEATH the plate (card 1:
     title 93.6px tall beside an 84px plate) — the ragged edge the float was
     meant to avoid, at the width where it should be cleanest.
     390, one column of 358px: an 84px float leaves ~3.4ch per line beside it,
     so a four-line headline wrapped to eight ragged words.

   So the plate owns a column at every width, never a float: the card is a
   two-column grid (text, plate) and the headline keeps its full measure in
   the text column. The reason line spans both columns because it explains the
   whole card, not the text column — it is a caption, and a caption that stops
   84px short of the card's edge reads as a mistake. */
.related__item,
.related__item.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  column-gap: 0.9rem;
  align-items: start;
  /* The shelf stretches every card to the tallest in its row, and a grid's
     default align-content shares that surplus between the card's own rows —
     so a two-line headline floated its why sentence to the bottom of the
     card while the four-line card beside it kept the normal gap. Pack the
     rows at the top. */
  align-content: start;
  padding: 0;
  border-top: 0;
}
/* The card's DOM order is plate, dateline, headline, deck, why (app.js
   card()), so every line is placed by hand: the plate owns the right column
   beside the dateline and the headline, and the text column stacks normally.

   A shelf card is a headline, a dateline and one sentence of evidence — it is
   navigation, not a second reading surface. app.js prints the full summary as
   .card__deck and the desk's byline as .card__meta::after on every card;
   repeated six times under a story a reader has just finished, that is a wall
   of the same small print. Both stay in the DOM (a page without this file
   still shows them) and are not drawn here. The title stops at four lines so
   one long headline cannot make a column taller than its neighbours. */
.related__item .thumb--card:has(.thumb__img) {
  float: none;
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 84px;
  margin: 0.1rem 0 0;
}
/* A house graphic is a typeset card, not a photograph: the figure and the
   number are drawn in the left two thirds of a 16:9 frame and the right third
   is paper. css/photo.css widens the slot to 128px for that reason, but a fixed
   84px grid column keeps the figure at 84px and pushes the plate 44px past the
   card's right edge — at 360 the shelf measured 388px wide inside a 360px
   window (28px of horizontal scroll on every phone). The column takes the
   plate's real width, so the wider slot is drawn inside the card it belongs to.
   128px only: a photograph keeps its 84px column and its square crop. */
.related__item:has(> .thumb--house) {
  grid-template-columns: minmax(0, 1fr) 128px;
}
.related__item > .card__meta { grid-column: 1; grid-row: 1; }
/* The dateline here is desk + hour, the shelf convention at the papers this
   page is measured against: the section in the accent colour, then the time,
   one line, level across every card in a row. Two things feed.css prints on
   every card are dropped in the shelf only:
     - the wire name (.card__source). At 1440 the card's text column is 222px
       and the longest name, "BIS — Central Bank Speeches", wrapped the
       dateline onto a second line, dropping that card's headline 30px below
       its two neighbours' — three titles that started level ended staggered.
       The wire is not lost: it is in the Reference panel of the story it
       attributes, one click away.
     - the generated "By Ember" credit, because the shelf sits under a story
       whose head already carries "By Ember · AI-generated content" in full;
       six more copies of the same small print is noise, not disclosure.
   What is left fits one line at every width measured (390, 768, 1440). */
.related__item .card__source,
.related__item .card__source + .article__dot,
.related__item .card__meta::after { display: none; }
.related__item .card__meta {
  flex-wrap: nowrap;
  min-width: 0;
  white-space: nowrap;
}
.related__item > .card__title {
  grid-column: 1;
  grid-row: 2;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related__item > .card__deck { display: none; }
/* The why sentence spans both columns: it explains the card, not the text
   column, and a caption that stops 84px short of the card's edge reads as a
   mistake. Every child is placed by hand on purpose — one auto-placed child
   in a two-column grid is how a card ends up with a third, implicit column. */
.related__item > .related__reason { grid-column: 1 / -1; grid-row: 3; }

/* One column is a list, though, and a list of six headlines needs a hairline
   to keep them apart; the rule returns there and only there. */
@media (max-width: 759px) {
  .related__list { row-gap: 0; }
  .related__item + .related__item {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--rule-soft);
  }
}

/* ------------------------------------------------------------------------
   Rows that hold, side by side.

   Each card sizes its own grid, so the 84px plate — which spans the dateline
   and the headline — is what decides how the card's first two rows divide
   their shared height, and two cards with different headline lengths divide
   it differently. Measured at 1440 (n3_rows.mjs, 2026-11-09): the dateline row
   was 23.5px on one card and 30.25px on the card beside it, which put the
   second card's headline 7px low and its why sentence 11px high inside a row
   that reads as one block. Rules cannot fix that, because the split is a
   consequence of each card being its own grid.

   So where the shelf has more than one column, the cards stop being grids and
   become subgrids of the shelf: three tracks (dateline, headline, why) are
   shared across the row, and every dateline, every headline and every why
   sentence starts on the same line. The shelf's own row-gap would then fall
   between rows *inside* a card, so it moves to the why sentence's bottom
   margin, which is the only place the gap between two cards is drawn.

   subgrid: Chrome 117, Safari 16, Firefox 71. Where it is absent the cards
   keep the per-card grid above — the same page, drawn by the old rule. */
@media (min-width: 760px) {
  @supports (grid-template-rows: subgrid) {
    /* The gap between two shelf rows is drawn by the why sentence's own
       bottom margin, and the last row's copy of it is cancelled on the list
       so the shelf keeps the bottom edge it had. The token keeps the two in
       step. */
    .related {
      --shelf-row-gap: clamp(1rem, 2vw, 1.4rem);
    }
    .related__list { row-gap: 0; margin-bottom: calc(-1 * var(--shelf-row-gap)); }
    .related__item,
    .related__item.card {
      grid-row: span 3;
      grid-template-rows: subgrid;
      align-content: normal;
    }
    .related__item > .related__reason {
      margin-bottom: var(--shelf-row-gap);
    }
  }
}

/* Why it is here: an explanation, not a tag. Set in the UI face at the meta
   step, italic never, and it is the last thing in the card. */
.related__reason {
  margin-top: 0.45rem;
  font-size: var(--fs-label);
  line-height: 1.55;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------------------
   THE END OF THE ARTICLE IS THE PLANE OF ACTION.

   app.js prints the disclaimer as the last sheet section. It is the one
   block on the page that is not reporting, so it is set one step quieter and
   the credit + Share + Save pair follows it. article.js marks that section
   `.signoff-note` (an added class, nothing renamed) so this file addresses it
   by name rather than by guessing at its position.
   ---------------------------------------------------------------------- */
.signoff-note > p.prose {
  /* The disclaimer is the story's foot-of-page note, and a reader who set a
     larger size for the body does not get it back here: same base step as
     before, still multiplied by the reader's own scale (css/tokens.css
     --reading-scale raises .prose in css/detail.css, and this rule has to
     carry it or it overrides that one back to a fixed size). */
  font-size: calc(var(--fs-small) * var(--reading-scale));
  line-height: 1.65;
  color: var(--ink-soft);
}

/* ======================================================= dark mode ======
   No rule in this file sets a colour directly, so both themes follow the
   tokens. Two places need more than the token alone:
     - the progress rule and the saved mark use --accent, which tokens.css
       already lifts to #FA8054 on dark;
     - the pressed fill (--paper-3) is the dark surface in dark mode.
   Nothing here needs a dark-only override; that is the point of the token
   layer. */

/* ==================================================== forced colours ====
   Windows high contrast drops backgrounds. The progress fill and the saved
   state must still be visible, so both get a system colour. */
@media (forced-colors: active) {
  .reading-progress__fill { background: Highlight; }
  .act.is-on { color: Highlight; }
  .act.is-on .icon { color: Highlight; }
  .act { border-color: ButtonText; }
  .toc__link { border-color: ButtonText; color: ButtonText; }
  .toc__link[aria-current="location"] { border-color: Highlight; color: Highlight; }
  .related__item,
  .saved__item,
  .signoff { border-color: GrayText; }
}

/* The native dialog preserves focus containment and platform dismissal. */
.reader-sheet {
  box-sizing:border-box; width:min(35rem,calc(100% - 2rem)); max-height:85dvh;
  padding:0; margin:auto; border:1px solid var(--rule-strong); border-radius:6px;
  color:var(--ink); background:var(--paper); box-shadow:0 2rem 5rem #21160f38;
}
.reader-sheet::backdrop { background:rgb(30 24 18 / 43%); }
.reader-sheet__form { padding:clamp(1.1rem,3vw,2rem); }
.reader-sheet__head { display:flex; justify-content:space-between; align-items:center; gap:1rem; border-bottom:2px solid var(--ink); padding-bottom:.65rem; }
.reader-sheet__head h2 { margin:0; font:600 clamp(1.6rem,4vw,2.15rem)/1.15 var(--font-display); letter-spacing:-.025em; }
.reader-sheet__done { appearance:none; min-height:44px; padding:.4rem .9rem; font:600 .875rem var(--font-ui); color:var(--accent-ink); background:var(--accent); border:0; border-radius:3px; cursor:pointer; }
.reader-sheet__row { min-width:0; padding:.9rem 0; margin:0; border:0; border-bottom:1px solid var(--rule); }
.reader-sheet__row legend { float:inline-start; width:100%; margin-bottom:.55rem; padding:0; font:600 .91rem var(--font-ui); }
.reader-sheet__choices { display:flex; clear:both; flex-wrap:wrap; gap:.3rem; }
.reader-sheet__choices label { position:relative; flex:1 1 auto; min-width:2.7rem; }
.reader-sheet__choices input { position:absolute; opacity:0; width:1px; height:1px; }
.reader-sheet__choices span { display:grid; place-items:center; min-height:44px; font:600 .9rem var(--font-ui); color:var(--ink); background:var(--paper-2); border:1px solid var(--rule-strong); border-radius:3px; cursor:pointer; }
.reader-sheet__choices input:checked + span { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.reader-sheet__choices input:focus-visible + span, .reader-sheet__done:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.reader-sheet__motion { display:flex; align-items:center; justify-content:space-between; gap:1rem; min-height:3.5rem; padding-top:.6rem; cursor:pointer; }
.reader-sheet__motion small { display:block; margin-top:.2rem; color:var(--ink-soft); }
.reader-sheet__motion input { width:1.35rem; height:1.35rem; accent-color:var(--accent); }
html[data-reader-motion="reduce"] { scroll-behavior:auto !important; }
html[data-reader-motion="reduce"] *, html[data-reader-motion="reduce"] *::before, html[data-reader-motion="reduce"] *::after {
  animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important;
}
@media (max-width:600px) {
  .reader-sheet { margin:auto 0 0; width:100%; max-width:100%; border-radius:12px 12px 0 0; border-bottom:0; }
  .reader-sheet__form { padding-bottom:max(1.3rem,env(safe-area-inset-bottom)); }
}
@media (forced-colors:active) {
  .reader-sheet__choices input:checked + span { outline:2px solid Highlight; outline-offset:-3px; }
}

/* Fresh-source research links keep their private return separate from Share. */
.research-reader-return { margin: .4rem .6rem .85rem 0; }
.is-verifying-research-proof #report-source-evidence { display: none; }
