/* Reader (P2a) — the review journal, opened.
 *
 * Bridges PB-219 theme tokens (design-tokens.css) into the landing page's
 * editorial vocabulary: paper surfaces, ink text, one deep-red accent,
 * hairline rules, small-caps labels, serif specimens. Dark theme keeps the
 * softened ramp from design-tokens; light theme shifts paper-ward to match
 * templates/landing.html. theme.js toggles `light-theme` on <html>.
 */

/* design-tokens.css now keys its light/dark values directly off the
   html.light-theme class (PB-258), so no local pinning is needed here —
   the tokens already agree with the class regardless of OS preference. */

:root {
  color-scheme: dark;

  /* dark: softened ramp + desaturated brick accent */
  --paper: var(--color-bg-primary);
  --ink: var(--color-text-primary);
  --ink-soft: var(--color-text-secondary);
  --ink-faint: var(--color-text-tertiary);
  --accent: #cd8177;
  --rule: var(--color-border);
  --rule-strong: rgba(255, 255, 255, 0.55);
  --toast-bg: #efece6;
  --toast-ink: #1a1815;

  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --measure: 40rem;
}

html.light-theme {
  color-scheme: light;

  /* light: the landing page's paper */
  --paper: #faf7f2;
  --ink: #1a1815;
  --ink-soft: #57514a;
  --ink-faint: #857d72;
  --accent: #8b2e2e;
  --rule: #d8d2c8;
  --rule-strong: #1a1815;
  --toast-bg: #1a1815;
  --toast-ink: #faf7f2;
}

/* E-ink (PB-282): crisp black-on-near-white, hairlines kept but solid,
   one muted accent — no gradients or shadows, matching design-tokens.css's
   html.eink-theme block. Editorial DNA (serif specimens, small-caps labels)
   is untouched; only the palette changes. */
html.eink-theme {
  color-scheme: light;

  --paper: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #3a3a3a;
  --ink-faint: #5a5a5a;
  --accent: #55595e;
  --rule: #d4d4d4;
  --rule-strong: #0a0a0a;
  --toast-bg: #0a0a0a;
  --toast-ink: #ffffff;
}

/* Twilight (PB-282): opt-in, local-clock-only warm shift for evening/night
   reading — Instapaper "Twilight Sepia" is the reference ("subtly increases
   reading comfort without being distracting or tacky"). Applied as a token
   nudge on top of whichever light-family theme is active (light or eink);
   theme.js never adds this class when the dark theme is resolved, since
   dark already has no glare to soften. Kept deliberately small: a warm
   paper tint and softened ink, not a new palette. */
html.twilight {
  --paper: #f6ecd9;
  --ink: #2b2013;
  --ink-soft: #5c4d38;
  --ink-faint: #8a7a5f;
  --rule: #dfd0ab;
}

* { box-sizing: border-box; }

/* Author display rules (e.g. .quiet-button) must not defeat [hidden]. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
}

a { color: inherit; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- masthead: wordmark over a double rule, views as a text nav ---- */

.masthead {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.2rem 1.25rem 0;
}

/* Wordmark left, tools right, in one flex context so they share the row
   and can never overlap — the theme toggle renders the current mode label
   ("▤ E-ink" etc.), far wider than a plain icon, which used to collide with
   a text-align:center wordmark + absolute tools. */
.masthead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .045em;
  margin: 0;
}
.wordmark::after { content: "."; color: var(--accent); }

.masthead-tools {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool {
  font-family: var(--sans);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.tool:hover { color: var(--ink); }

.masthead-rules {
  border: 0;
  border-top: 3px double var(--rule-strong);
  margin: .85rem 0 0;
}

.views {
  display: flex;
  justify-content: center;
  gap: 2.4rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.view-link {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
}
.view-link.active {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}
.view-link.disabled {
  color: var(--ink-faint);
  opacity: .55;
  cursor: default;
}

/* ---- queue ---- */

#reader {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem 4.5rem;
}

/* Sort toggle: "newest · for you", quiet text-link pair above the header. */
/* "+ save a link" action row, above the sort toggles. Reuses .tag-add /
   .tag-add-input; centered to sit in the same quiet register as the toggles. */
.queue-actions {
  display: flex;
  justify-content: center;
  margin: 1.4rem 0 0;
}
.queue-save-input {
  min-width: 15rem;
  text-align: center;
}

.queue-sort-toggles {
  display: flex;
  justify-content: center;
  gap: .35rem;
  margin: 1.4rem 0 0;
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.queue-sort-toggle {
  background: none;
  border: 0;
  padding: 0 0 2px;
  font: inherit;
  color: var(--ink-faint);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.queue-sort-toggle:hover { color: var(--accent); }
.queue-sort-toggle[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* The day's dateline: how much is waiting, set like the landing's
   "est. 2026 · in beta" line. */
.queue-header {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  margin: 1.4rem 0 0;
}

/* PB-276 (v2c Task 2): the recommender's cold-start note — same small-caps
   dateline treatment as .queue-header, one shade fainter (it's a caveat,
   not the headline count). */
.queue-fallback-note {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  margin: .5rem 0 0;
}

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

/* Entries are specimens separated by hairlines, not cards. The li is a
   one-row grid so `.leaving` can collapse it (grid-template-rows 0fr)
   while the fade runs — CSS only. */
.entry {
  display: grid;
  grid-template-rows: 1fr;
  border-bottom: 1px solid var(--rule);
  transition: grid-template-rows .35s ease, opacity .3s ease;
}
.entry-body {
  min-height: 0;
  overflow: hidden;
  padding: 2.1rem 0 2.2rem;
  transition: padding .35s ease;
}
.entry.leaving {
  grid-template-rows: 0fr;
  opacity: 0;
  border-bottom-color: transparent;
}
.entry.leaving .entry-body { padding-top: 0; padding-bottom: 0; }

/* PB-278: keyboard j/k selection. A quiet left-accent echoing the blurb's
   own accent rule (line 271) — no background block, no border-box change,
   just enough signal for a sighted keyboard user to track position. */
.entry-selected {
  box-shadow: inset 3px 0 0 var(--accent);
}
.entry-selected .entry-body {
  padding-left: .8rem;
}

.entry-title {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.008em;
  margin: 0;
  text-wrap: balance;
}
.entry-link { text-decoration: none; }
.entry-link:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.entry-meta {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: .55rem 0 0;
}
.entry-source { color: var(--ink-soft); }
/* Ranking rationale ("Similar to …", "Wildcard") on its own line below the
   byline, not trailing the source/date/length run. */
.entry-reason { display: block; margin-top: .15rem; }

/* PB-371: publisher favicon, in the slot the content-kind glyph used to hold.
   Fixed box reserves space so the lazy-loaded icon doesn't reflow the line;
   an empty src stays transparent until favicon.js sets it. */
.entry-favicon {
  width: 1em;
  height: 1em;
  border-radius: 2px;
  object-fit: contain;
  vertical-align: -2px;
  margin-right: .4em;
}
/* PB-362: favicons render greyscale by default (owner taste — restraint
   governs ornament); a per-reader Settings toggle opts into colour, which adds
   .favicons-colour on the root. Scoped to img so the monogram fallback (a span
   sharing .entry-favicon) keeps its own colour. */
img.entry-favicon { filter: grayscale(1); opacity: .9; }
.favicons-colour img.entry-favicon { filter: none; opacity: 1; }
/* Terminal fallback when the icon fails to load: a monogram initial. */
.entry-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink-soft);
  background: var(--rule);
}

/* The review itself: full text, accent hairline, hanging punctuation —
   the landing specimen, verbatim. */
.entry-blurb-wrap {
  display: flex;
  align-items: stretch;
  gap: .6rem;
  margin-top: 1rem;
  cursor: pointer;
}
.entry-blurb {
  margin: 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
  font-size: 1.02rem;
  line-height: 1.62;
  color: var(--ink);
  hanging-punctuation: first last;
  flex: 1;
  min-width: 0;
}
/* PB-363: same hover affordance as .entry-link, so the blurb reads as part
   of the same click target as the title rather than a separate control. */
.entry-blurb-wrap:hover .entry-blurb {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.peer-prev,
.peer-next {
  align-self: center;
  background: none;
  border: 0;
  padding: .2rem .3rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
}
.peer-prev:hover,
.peer-next:hover { color: var(--accent); }

.entry-blurb-source {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: .6rem 0 0;
  padding-left: calc(1.1rem + 2px);
  text-align: left;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Inline pin toggle on the perspective switcher (P4c Task 3, D2 ordering).
   Quiet text button, same idiom as .blurb-edit-btn — no icon assets. */
.peer-pin-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer;
}
.peer-pin-btn:hover { color: var(--accent); }
.peer-pin-btn[aria-pressed="true"] { color: var(--ink-soft); }

/* Failed-fetch state (PB-279): honest inline state in place of the blurb,
   same quiet register as .entry-blurb-source — small caps, no color alarm. */
.entry-failed {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: .85rem 0 0;
  padding-left: calc(1.1rem + 2px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
}
.entry-retry {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--ink-soft);
  cursor: pointer;
}
.entry-retry:hover { color: var(--accent); }
.entry-retry:disabled { opacity: .45; cursor: default; }
.entry-original {
  color: var(--ink-soft);
  text-decoration: none;
}
.entry-original:hover { color: var(--accent); text-decoration: underline; }

.entry-tags {
  margin: .6rem 0 0;
  padding-left: calc(1.1rem + 2px);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .7rem;
}

/* PB-350 (tier 2): article-aspect content-kind glyph. (The reading-length
   pips glyph was removed by PB-380 as redundant with the "N min" count.)
   Monochrome, currentColor only, sized to sit inline with the small-caps
   meta text (.entry-meta / .article-meta already set
   color: var(--ink-faint)/var(--ink-soft) — the glyph inherits it, no
   colors of its own). This encodes data (kind), not decoration:
   restraint per NORTH_STAR — no fills tied to --accent, no badges. */
.kind-wrap {
  display: inline-flex;
  align-items: center;
  vertical-align: -1px;
}
.entry-kind[hidden],
.entry-length:empty { display: none; }
.entry-kind { margin-right: .1em; }
.kind-glyph { flex-shrink: 0; }

/* Screen-reader-only label accompanying a glyph-only icon (no visible
   caption — see owner design taste: numerals/icons read alone on screen,
   the word is there for assistive tech). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.tag-remove {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: .9rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
}
.tag-remove:hover { color: var(--accent); }
.tag-add {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
}
.tag-add:hover { color: var(--accent); }

/* PB-354: queue card's honest truncation hint — plain text, not a control
   (the expand affordance lives on the article view, not the compact card). */
.tag-more-hint {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.tag-add-input {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .05em;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0 0 .1rem;
}

/* Faceted tags panel (P2c) */
.facets-list {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .7rem;
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.facets-list span {
  overflow-wrap: normal;
  min-width: 0;
  max-width: 100%;
}

/* ---- verbs: quiet text, not buttons-as-chrome ---- */

.entry-verbs {
  display: flex;
  gap: 1.8rem;
  margin: 1.15rem 0 0;
}

.verb {
  background: none;
  border: 0;
  padding: 0 0 2px;
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.verb:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.verb[data-verb="read"] { color: var(--accent); }
.verb[data-verb="read"]:hover { border-bottom-color: var(--accent); }
.verb:disabled {
  opacity: .45;
  cursor: default;
  border-bottom-color: transparent;
}
.verb:disabled:hover { color: var(--ink-soft); }
.verb[data-verb="read"]:disabled:hover { color: var(--accent); }

/* ---- queue-zero: an earned sentence, set generously ---- */

.queue-zero {
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  margin: 5rem auto 0;
  max-width: 26rem;
  text-wrap: balance;
}
.queue-zero::before {
  content: "";
  display: block;
  width: 5rem;
  border-top: 1px solid var(--accent);
  margin: 0 auto 2.2rem;
}

/* ---- queue-firstrun: designed get-started state (onboarding Phase 2) ----
   Same earned-sentence register as .queue-zero (accent hairline, generous
   top margin, centered) but with two concrete next actions instead of a
   dead end — serif headline inherited from body, quiet sans lede. */
.queue-firstrun {
  text-align: center;
  margin: 4.5rem auto 0;
  max-width: 26rem;
}
.queue-firstrun::before {
  content: "";
  display: block;
  width: 5rem;
  border-top: 1px solid var(--accent);
  margin: 0 auto 2.2rem;
}
.queue-firstrun-title {
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 .9rem;
  text-wrap: balance;
}
.queue-firstrun-lede {
  font-family: var(--sans);
  font-size: .82rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 1.7rem;
}
.queue-firstrun-actions {
  margin: 0;
}
.queue-firstrun-actions .tag-add {
  font-size: .72rem;
}

/* Phase 3: the honest "gathering your reads" note — same small-caps-off
   quiet register as .queue-fallback-note but body copy length, since it's
   a full sentence rather than a caveat clause. Shared by the first-run
   block AND a returning member's momentarily-empty queue after a save. */
.queue-firstrun-pending {
  font-family: var(--sans);
  font-size: .8rem;
  line-height: 1.6;
  color: var(--ink-soft);
  text-align: center;
  max-width: 24rem;
  margin: 3.5rem auto 0;
}

/* Phase 4: inline "account not ready" notice + self-retry — never a popup.
   Sits above the sort toggles so it's visible the moment it's relevant,
   without displacing the save-a-link action row above it. */
.queue-account-issue {
  font-family: var(--sans);
  font-size: .78rem;
  line-height: 1.6;
  color: var(--ink-soft);
  text-align: center;
  max-width: 28rem;
  margin: .9rem auto 0;
}
.queue-account-issue .tag-add {
  margin-left: .3rem;
}

/* ---- show older ---- */

.quiet-button {
  display: block;
  margin: 2.4rem auto 0;
  background: none;
  border: 0;
  padding: 0 0 2px;
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
}
.quiet-button:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- toast stack: bottom-center, inverse paper, undo inside ---- */

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: .5rem;
  max-width: min(92vw, 26rem);
}

.toast {
  background: var(--toast-bg);
  color: var(--toast-ink);
  font-family: var(--sans);
  font-size: .84rem;
  padding: .55rem 1.1rem;
  border-radius: 2px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  max-width: 100%;
}

.toast-undo {
  background: none;
  border: 0;
  padding: 0 0 1px;
  margin-left: .5rem;
  font: inherit;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .72rem;
  color: inherit;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

/* ---- small screens ---- */

@media (max-width: 700px) {
  .masthead { padding-top: 1.5rem; }
  .views { gap: 1.6rem; }
  .entry-body { padding: 1.7rem 0 1.8rem; }
  .entry-title { font-size: 1.22rem; }
  .entry-verbs { gap: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .entry, .entry-body { transition: none; }
}

/* Collections view (P2b) */
.collections-shelf {
  list-style: none;
  margin: 0;
  padding: 0;
}
.collection {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.collection:last-child { border-bottom: none; }
.collection-title { margin: 0; }
.collection-toggle {
  font-family: var(--serif);
  font-size: 1.35rem;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.collection-toggle:hover { color: var(--accent); }
.collection-meta {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0.25rem 0 0;
}
.collection-headline {
  font-family: var(--serif);
  font-style: italic;
  margin: 0.5rem 0 0;
}
.collection-preview,
.collection-toc {
  font-family: var(--serif);
  margin: 0.75rem 0 0;
  padding-left: 1.5rem;
}
.toc-entry { margin: 0.35rem 0; }
.toc-link { color: var(--ink); }
.toc-link:hover { color: var(--accent); }
.toc-status,
.toc-minutes {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-left: 0.5rem;
}
.view-loading { color: var(--ink-soft); }

.collection-attribution {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-variant-caps: small-caps;
  margin: 0.1rem 0 0;
}
.collection-share { margin: 0.2rem 0 0; }
.share-chip {
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0 0.5em;
  margin-right: 0.4em;
  cursor: pointer;
}
.share-input { font-size: 0.85rem; width: 11em; margin-right: 0.4em; }

/* Library view (P2b) */
#library-search {
  width: 100%;
  font-family: var(--serif);
  font-size: 1rem;
  padding: 0.5rem 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
#library-search:focus { outline: none; border-bottom-color: var(--accent); }
.library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}
.filter {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
}
.filter[aria-pressed="true"] { color: var(--accent); }
.filter:disabled { opacity: 0.4; cursor: default; }
.library-collect { margin: 0.2rem 0 0.4rem; }
.collect-count {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-left: 0.5em;
}
.row-select { margin-right: 0.5em; }
.collect-name-input { font-size: 0.85rem; width: 14em; }
.library-list { list-style: none; margin: 0; padding: 0; }
.library-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.row-title { margin: 0; font-family: var(--serif); font-size: 1.05rem; }
.row-link { color: var(--ink); text-decoration: none; }
.row-link:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.row-status {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-left: 0.5rem;
}
.row-meta {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.15rem 0 0;
}
.row-first-line {
  font-family: var(--serif);
  color: var(--ink-soft);
  margin: 0.25rem 0 0;
}

/* Assemble form (P2b) */
.assemble-form {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
}
.assemble-legend {
  flex-basis: 100%;
  margin: 0;
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.assemble-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.assemble-form select,
.assemble-form input {
  font: inherit;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.25rem 0;
}
.assemble-status { color: var(--ink-soft); }

/* Article view (P2c). The two-column grid needs a wider measure than the
   single-column reader pages: 65ch content + 3rem gap + 20rem panel ≈ 64rem. */
.article-page #article-main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.25rem 4.5rem;
  display: grid;
  grid-template-columns: minmax(0, 65ch) minmax(14rem, 20rem);
  gap: 3rem;
  align-items: start;
}
.article-title { font-family: var(--serif); font-size: 1.8rem; margin: 0; }
.article-meta {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0.35rem 0 1rem;
  display: flex;
  align-items: center;
  gap: .3em;
}
.article-standfirst {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 0;
  margin: 0 0 1.5rem;
}

/* Blurb authoring (P4c Task 2): quiet small-caps affordance row, hairline
   separated from the standfirst above it — no card, matches the rest of
   the article page's understated editorial chrome. */
.blurb-editor-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border-bottom: 1px solid var(--rule);
  padding: 0 0 0.75rem;
  margin: -1rem 0 1.5rem;
}
.blurb-yours-marker {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.blurb-edit-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
}
.blurb-edit-btn:hover { color: var(--accent); }

.blurb-editor {
  border-bottom: 1px solid var(--rule);
  padding: 0 0 1.25rem;
  margin: -1rem 0 1.5rem;
}
.blurb-char-count {
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-align: right;
  margin: 0.25rem 0 0.75rem;
}
.blurb-editor-selects {
  display: flex;
  gap: 1.25rem;
  margin: 0 0 0.75rem;
}
.blurb-select-label {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.blurb-select-label select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.15rem 0.3rem;
}
.blurb-editor-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0.5rem 0;
}
.blurb-refine-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 0.75rem 0;
}
.blurb-refine-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
}
.blurb-versions-disclosure { margin-top: 0.75rem; }
.blurb-versions-disclosure summary { cursor: pointer; }
.blurb-versions-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}
.blurb-versions-list li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.85rem;
}
.blurb-version-date {
  font-variant-caps: small-caps;
  color: var(--ink-faint);
  flex-shrink: 0;
}
.blurb-version-excerpt { color: var(--ink-soft); flex: 1; }
.blurb-version-restore {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}
.blurb-version-restore:hover { color: var(--accent); }

@media (max-width: 640px) {
  .blurb-refine-panel { grid-template-columns: 1fr; }
}

.article-body {
  font-family: var(--serif);
  line-height: 1.65;
  overflow-wrap: break-word;
}
.article-body img { max-width: 100%; height: auto; }
.article-body pre { overflow-x: auto; }
.article-panel { border-left: 1px solid var(--rule); padding-left: 1.5rem; }
.panel-section { margin-bottom: 1.75rem; }
/* Hairline dividers between settings sections (PB-378). Scoped to the
   settings view so the article side panel is untouched; skip the first
   section so there's no leading rule. */
.settings-view .panel-section:not(:first-of-type) {
  border-top: 1px solid var(--rule);
  padding-top: 1.75rem;
}
.panel-label {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  font-weight: normal;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}
.panel-empty {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}
.rating-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.4rem 0;
}
.rating-label {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.rating-name {
  font-family: var(--serif);
  flex: 1;
}
.rating-value {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-size: 0.85em;
}
.rating-pips {
  display: inline-flex;
  gap: 0.15rem;
}
.pip {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: 0.9em;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
}
.pip-filled { color: var(--accent); }
.pip:hover { color: var(--accent); }
.note-text {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 1px solid var(--rule);
  padding: 0.5rem;
}
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { margin: 0.4rem 0; }
.related-type {
  font-size: 0.8em;
  font-variant-caps: small-caps;
  color: var(--ink-soft);
}
.collection-nav {
  /* #article-main is a 2-col grid (article | panel). This nav is a third
     grid child, shown only when the article is opened from a collection —
     it must span both columns and take its own row, otherwise it steals the
     first cell and bumps <article> into the narrow sidebar column. */
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
}
.coll-counter {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.wordmark a { color: inherit; text-decoration: none; }
@media (max-width: 900px) {
  .article-page #article-main { grid-template-columns: minmax(0, 1fr); }
  .article-panel { border-left: none; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
}

/* The article page's #article-main is wider than the reader's default
   --measure (two-column grid), so the masthead's double rule must match
   that wider measure here rather than the single-column default. */
.article-page .masthead {
  max-width: 64rem;
  margin-inline: auto;
}

/* ---- "Your algorithm" settings view (PB-274) ---- */

.settings-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: normal;
  margin: 1.5rem 0 0.5rem;
}
.settings-intro {
  color: var(--ink-soft);
  margin: 0 0 2rem;
}
.settings-copy {
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 0.75rem;
}
.setting-name {
  font-variant-caps: small-caps;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.signal-toggle-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0.5rem 0;
}
/* PB-356: same visual language as .queue-sort-toggle / .filter (quiet text
   button, accent hairline when active) so "on/off" reads as the same
   control family as the queue's sort toggle and the library's status
   filters — not a boxed widget of its own. Was previously a bordered pill,
   the one control on this view that broke from the reader's line-based
   idiom. */
.signal-toggle {
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0 0 2px;
  font: inherit;
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  cursor: pointer;
}
.signal-toggle:hover { color: var(--accent); border-bottom-color: var(--accent); }
.signal-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.signal-toggle:disabled { cursor: default; opacity: 0.6; }
.signal-count {
  font-size: 0.85em;
  color: var(--ink-faint);
}
/* PB-381: "max authors shown" select. Line-based idiom like .signal-toggle —
   no boxed widget: transparent, an accent hairline underneath, theme colours
   via the same vars everything else here uses (works in both light and dark). */
.setting-select {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0 1.2em 2px 0;
  font: inherit;
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink);
  cursor: pointer;
}
.setting-select:hover { border-bottom-color: var(--accent); }
.setting-select:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.setting-select option { color: var(--ink); background: var(--paper); }
.erase-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0;
}
.erase-confirm {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.erase-confirm-text { color: var(--ink-soft); }

/* ---- Feedback (B1): quiet link -> inline textarea, no dialogs ---- */
.feedback-row { margin: 0.5rem 0 0; }
.feedback-form { margin: 0.5rem 0 0; }
.feedback-textarea {
  display: block;
  width: 100%;
  max-width: 32rem;
  font: inherit;
  color: var(--ink);
  background: none;
  /* Same plain hairline box as .note-text (article panel's own textarea) —
     no radius, so this doesn't read as a rounded "card" against the rest
     of the reader's square, line-based controls. */
  border: 1px solid var(--rule);
  padding: 0.5rem;
  resize: vertical;
}
.feedback-textarea:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.feedback-actions {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
}
.feedback-thanks {
  font-variant-caps: small-caps;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  margin: 0.5rem 0 0;
}

/* ---- Perspectives panel (P4b Task 4): adopt bundles, manage peers ---- */

.perspectives-list { margin: 0 0 1.25rem; }
.perspective-row {
  border-top: 1px solid var(--rule);
  padding: 0.75rem 0;
}
.perspective-row:first-of-type { border-top: none; padding-top: 0; }
.perspective-meta { margin: 0 0 0.2rem; }
.perspective-title { color: var(--ink); }
.perspective-curator { color: var(--ink-soft); }
.perspective-topics {
  margin: 0 0 0.4rem;
  font-size: 0.85em;
  color: var(--ink-faint);
}
.perspective-token-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0.4rem 0 0;
}
/* Only spot here besides the queue toggle where accent marks a state the
   reader needs to notice (needs-token), per /ui-change gate 4. */
.perspective-token-hint { color: var(--accent); font-size: 0.9em; }
.perspective-adopt-row { margin: 0.5rem 0 0; }
.perspective-adopt-input-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}
.perspective-adopt-input-row .tag-add-input { min-width: 16rem; flex: 1; }
.perspective-preview-card {
  border-top: 1px solid var(--rule);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}
.perspective-preview-detail {
  font-size: 0.85em;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}
.perspective-warnings {
  font-size: 0.85em;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}
.perspective-adopt-result {
  font-size: 0.85em;
  color: var(--ink-soft);
  margin: 0.4rem 0 0;
}

/* Subscriptions (M4 Task 4, PB-138): one small-caps row per enabled peer,
   same visual weight as .perspective-token-row above it. */
.perspective-subscription-row {
  margin: 0.4rem 0 0;
  font-variant-caps: small-caps;
  letter-spacing: 0.03em;
  font-size: 0.9em;
  color: var(--ink-soft);
}
.perspective-subscription-status { color: var(--ink-soft); }

/* ---- "My mix" slider editor (PB-275, ranking v2b) ----
   Same restraint as the rest of the settings view: hairline track, no
   gradients or drop-shadows, accent only on the thumb (the one thing the
   reader is actually dragging). */

.mymix-slider-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.3rem;
  margin: 0.9rem 0;
}
.mymix-slider-label {
  grid-column: 1 / -1;
  font-variant-caps: small-caps;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.mymix-slider {
  grid-column: 1 / 2;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  height: 1.2rem;
  margin: 0;
  cursor: pointer;
}
.mymix-slider-value {
  grid-column: 2 / 3;
  font-variant-caps: small-caps;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  min-width: 2.5em;
  text-align: right;
}
/* Track: a single hairline rule, no gradient fill — the thumb position is
   the only signal, matching the rest of the panel's line-based idiom. */
.mymix-slider::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--rule);
  border: none;
}
.mymix-slider::-moz-range-track {
  height: 1px;
  background: var(--rule);
  border: none;
}
.mymix-slider::-moz-range-progress { background: var(--rule); height: 1px; }
/* Thumb: a small solid accent circle, vertically centered on the hairline
   track (negative margin-top offsets WebKit's thumb-height/2). */
.mymix-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  margin-top: -0.42rem;
  cursor: pointer;
}
.mymix-slider::-moz-range-thumb {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
.mymix-slider:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.mymix-save-hint {
  font-variant-caps: small-caps;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

/* ---- first-use cues (PB-370) ---- */
/* Inline teaching note: accent hairline (the blurb-specimen motif), small-caps
   title, muted body, one quiet dismiss. Theme tokens only. */
.reader-cue {
  border-left: 2px solid var(--accent);
  padding: .55rem 0 .55rem .8rem;
  margin: 1rem 0;
}
.reader-cue-title {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 .25rem;
}
.reader-cue-body {
  font-size: .95rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 .45rem;
}
.reader-cue-dismiss {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.reader-cue-dismiss:hover { color: var(--accent); }
