/* /read/: the reader. Builds on styles.css tokens; adds the manual page theme, four reading themes and the reading view.
   Every --r-* pair below is contrast-checked by tests/test_reader.py (text 4.5:1, borders and focus 3:1). */

/* manual page theme: the toggle wins over prefers-color-scheme (light values repeat styles.css, dark values likewise) */
:root[data-ui="light"] {
  color-scheme: light;
  --bg: #fbfaf7; --surface: #ffffff; --surface-2: #f0ece2; --text: #1c1b19; --muted: #55524c; --border: #7a756a; --rule: #d9d4c7;
  --accent: #4f46e5; --accent-text: #ffffff; --accent-hover: #4338ca; --accent-hover-text: #ffffff; --link: #4338ca; --focus: #4338ca;
  --deco: #b45309; --ok: #17603a; --ok-bg: #e8f5ec; --danger: #9b1c1c; --danger-bg: #fdecec;
}
:root[data-ui="dark"] {
  color-scheme: dark;
  --bg: #0e0d0b; --surface: #1a1915; --surface-2: #24221b; --text: #efede7; --muted: #b9b5aa; --border: #8a8578; --rule: #3a372e;
  --accent: #818cf8; --accent-text: #0a0a0a; --accent-hover: #a5b4fc; --accent-hover-text: #0a0a0a; --link: #a5b4fc; --focus: #a5b4fc;
  --deco: #f59e0b; --ok: #7fd9a1; --ok-bg: #12301f; --danger: #ff9b9b; --danger-bg: #3a1717;
}

/* reading themes: auto resolves to light or dark in reader.js */
.reading {
  --r-bg: #fbfaf7; --r-fg: #1c1b19; --r-muted: #55524c; --r-link: #4338ca; --r-border: #7a756a; --r-focus: #4338ca; --r-bar: #f0ece2;
}
.reading[data-theme="dark"] {
  --r-bg: #0e0d0b; --r-fg: #efede7; --r-muted: #b9b5aa; --r-link: #a5b4fc; --r-border: #8a8578; --r-focus: #a5b4fc; --r-bar: #1a1915;
}
.reading[data-theme="sepia"] {
  --r-bg: #f4ecd8; --r-fg: #3b2f1e; --r-muted: #5c4a33; --r-link: #7a3412; --r-border: #8a7556; --r-focus: #7a3412; --r-bar: #ebdfc3;
}
/* the press palette: CE indigo with the amber of the masthead rule */
.reading[data-theme="brand"] {
  --r-bg: #1e1b4b; --r-fg: #eef2ff; --r-muted: #c7d2fe; --r-link: #fcd34d; --r-border: #a5b4fc; --r-focus: #fcd34d; --r-bar: #262262;
}

/* ---- library ---- */
.reader-head { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: var(--sp-6); }
.reader-head > * { min-width: 0; }
.reader-head h1 { margin-bottom: var(--sp-3); }
.reader-head h1:focus { outline: none; }
.open-panel { background: var(--surface-2); border: 1px solid var(--rule); border-left: 4px solid var(--deco); border-radius: var(--radius); padding: var(--card-pad); }
.open-panel h2 { font-size: var(--fs-h3); margin: 0 0 var(--sp-2); }
.open-panel p { margin-bottom: var(--sp-3); }
.check { display: flex; gap: var(--sp-3); align-items: center; min-height: var(--tap); }
.check input { width: 1.25rem; height: 1.25rem; flex: none; accent-color: var(--accent); }
@media (min-width: 48rem) {
  .reader-head { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
.r-why { margin: var(--sp-1) 0 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.notice { border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface-2); padding: var(--sp-3) var(--sp-4); }
.reader-lib h2 { margin-top: var(--sp-6); }
.shelf { list-style: none; padding: 0; margin: 0 0 var(--sp-5); width: 100%; max-width: none; display: grid; gap: var(--sp-6) var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); align-items: stretch; }
/* a card is a flex column; the title, state, progress and note slots have fixed heights, so cover, button and foot line up across a row */
.shelf-item { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); font-family: var(--sans); }
.shelf-item[hidden] { display: none; }
.shelf-cover { display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px var(--border), 0 6px 18px rgba(0, 0, 0, 0.16); background: var(--surface-2); }
a.shelf-cover { color: inherit; }
.shelf-img { display: block; width: 100%; height: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.shelf-img.cover-text { display: flex; align-items: center; justify-content: center; padding: var(--sp-3); text-align: center; background: var(--surface-2); color: var(--text); font-family: var(--serif); font-weight: 700; }
.shelf-progress { display: flex; align-items: center; height: 0.5rem; }
.shelf-bar { display: block; width: 100%; height: 0.375rem; margin: 0; padding: 0; border: 0; border-radius: 999px; overflow: hidden; appearance: none; -webkit-appearance: none; background: var(--rule); box-shadow: 0 0 0 1px var(--border); }
.shelf-bar::-webkit-progress-bar { background: var(--rule); }
.shelf-bar::-webkit-progress-value { background: var(--deco); border-radius: 999px; }
.shelf-bar::-moz-progress-bar { background: var(--deco); border-radius: 999px; }
.shelf-bar[hidden] { display: block; visibility: hidden; }
.shelf-title { margin: var(--sp-1) 0 0; min-height: 2.5em; font-family: var(--serif); font-size: 1.0625rem; font-weight: 700; line-height: 1.25; }
.shelf-title a, .shelf-title span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; }
.shelf-title a:hover { text-decoration-thickness: 0.15em; }
.shelf-state, .shelf-meta { margin: 0; min-height: 1.5rem; display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); color: var(--muted); }
.shelf-state .badge-icon { color: var(--text); }
.shelf-btn { width: 100%; margin-top: var(--sp-1); }
.shelf-sample { margin: 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--muted); }
.shelf-sample strong { color: var(--text); font-weight: 600; }
.shelf-foot { margin-top: auto; padding-top: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-1); }
.shelf-links { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--sp-3); font-size: var(--fs-sm); }
.shelf-links a, .shelf-remove { display: inline-flex; align-items: center; min-height: var(--tap); }
.shelf-links a { color: var(--link); }
.shelf-remove { padding: 0 var(--sp-1); border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.shelf-remove:hover { color: var(--text); }
.shelf-open:focus-visible, .shelf-links a:focus-visible, .shelf-remove:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.lib-filter { border: 0; padding: 0; margin: 0 0 var(--sp-3); min-width: 0; }
.lib-filter legend { padding: 0; margin-bottom: var(--sp-1); }
.lib-count { margin: 0 0 var(--sp-4); font-family: var(--sans); color: var(--muted); }
.lib-count.is-empty { color: var(--text); font-weight: 600; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface-2); padding: var(--sp-3) var(--sp-4); }
.btn-quiet { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-s); background: transparent; color: var(--text); font-family: var(--sans); font-size: var(--fs-sm); cursor: pointer; }
.btn-quiet:hover { border-color: var(--text); }
.shelf-badge { display: inline-flex; align-items: center; align-self: flex-start; gap: var(--sp-1); margin: 0; min-height: 1.5rem; padding: 0 var(--sp-2); border: 1px solid var(--rule); border-radius: 999px; background: var(--surface-2); color: var(--text); font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; }
.shelf-badge[hidden] { display: inline-flex; visibility: hidden; }
.badge-icon { width: 0.9rem; height: 0.9rem; flex: none; }
.tools { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1fr); }
.tools > * { min-width: 0; }
@media (min-width: 48rem) {
  .tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.tools fieldset, .r-dialog fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--sp-3) var(--card-pad); margin: 0 0 var(--sp-4); min-width: 0; }
legend { font-family: var(--sans); font-weight: 600; padding: 0 var(--sp-2); }
.radio-row { display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); }
.reader-tip { border-top: 1px solid var(--rule); padding-top: var(--sp-4); margin-top: var(--sp-6); color: var(--muted); font-family: var(--sans); }
.reader-tip a { display: inline-block; padding-block: 0.65rem; }
.coffee-head { margin: 0 0 var(--sp-3); font-family: var(--sans); }
.coffee-head-link { gap: var(--sp-2); }
.coffee-head-link svg, .r-coffee svg { width: 1.25rem; height: 1.25rem; flex: none; }
.shelf-sample { margin: var(--sp-2) 0 0; font-family: var(--sans); font-size: var(--fs-sm); color: var(--text); }
.end-sample-links .r-buy-list a { color: var(--link); border: 1px solid var(--border); border-radius: var(--radius-s); margin-bottom: var(--sp-2); }
.reader-js-only { display: none; }
.reader-ready .reader-js-only { display: block; }

/* ---- reading view ---- */
body.is-reading { overflow: hidden; }
body.is-reading .site-header, body.is-reading .site-footer { display: none; }
.reading { position: fixed; inset: 0; z-index: 30; background: var(--r-bg); color: var(--r-fg); font-family: var(--sans); }
.reading[hidden] { display: none; }
.r-stage { position: absolute; top: calc(3.5rem + var(--r-sample-h)); bottom: 3.75rem; left: 0; right: 0; }
.r-view { display: block; width: 100%; height: 100%; }
.r-bar { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--gutter); background: var(--r-bar); color: var(--r-fg); }
.r-top { top: 0; height: 3.5rem; border-bottom: 1px solid var(--r-border); }
.reading { --r-sample-h: 0rem; }
.reading.is-sample { --r-sample-h: 2.25rem; }
.r-sample { position: absolute; z-index: 4; left: 0; right: 0; top: 3.5rem; min-height: var(--r-sample-h); margin: 0; padding: 0.25rem var(--gutter); display: flex; align-items: center; background: var(--r-bar); color: var(--r-fg); border-bottom: 1px solid var(--r-border); font-size: var(--fs-sm); line-height: 1.3; }
.r-sample[hidden] { display: none; }
.r-bottom { bottom: 0; height: 3.75rem; border-top: 1px solid var(--r-border); }
.r-brand { display: inline-flex; align-items: center; gap: var(--sp-2); flex: none; min-height: var(--tap); min-width: var(--tap); justify-content: center; color: var(--r-fg); text-decoration: none; border-radius: var(--radius-s); }
.r-brand:hover .wm-main { text-decoration: underline; text-decoration-color: var(--r-border); text-decoration-thickness: 0.15em; }
.r-mark-img { width: 1.75rem; height: 1.75rem; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px var(--r-border); }
.r-brand-text { display: none; line-height: 1.1; }
.r-brand .wm-top { color: var(--r-muted); font-size: 0.6875rem; }
.r-brand .wm-main { color: var(--r-fg); font-size: 1.1rem; }
@media (min-width: 80rem) { .r-brand-text { display: block; } }
.r-title { flex: 1 1 auto; min-width: 0; margin: 0; font-family: var(--serif); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--tap); min-width: var(--tap); padding: 0 var(--sp-2); border: 1px solid transparent; border-radius: var(--radius-s); background: transparent; color: var(--r-fg); font: inherit; font-weight: 600; cursor: pointer; flex: none; }
.r-break { display: none; }
.r-buy > summary { list-style: none; cursor: pointer; border-color: var(--r-border); white-space: nowrap; font-size: var(--fs-sm); }
.r-buy > summary::-webkit-details-marker { display: none; }
.r-buy > summary svg { width: 1.25rem; height: 1.25rem; flex: none; }
.r-buy-panel { position: absolute; z-index: 7; top: 100%; right: var(--sp-2); width: min(22rem, calc(100% - 2 * var(--sp-2))); background: var(--r-bar); color: var(--r-fg); border: 1px solid var(--r-border); border-radius: var(--radius); padding: var(--sp-2); }
.r-buy-list { list-style: none; margin: 0; padding: 0; }
.r-buy-list a { display: flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-2); color: var(--r-link); font-weight: 600; }
.r-coffee { border-color: var(--r-border); text-decoration: none; white-space: nowrap; font-size: var(--fs-sm); }
.r-btn:hover { border-color: var(--r-border); }
.r-btn[aria-pressed="true"] { border-color: var(--r-link); color: var(--r-fg); }
.r-btn svg { width: 1.35rem; height: 1.35rem; flex: none; }
.r-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.reading :focus-visible { outline: 3px solid var(--r-focus); outline-offset: 2px; }
.r-where { flex: none; margin: 0; font-size: var(--fs-sm); color: var(--r-muted); white-space: nowrap; }
.r-progress { flex: 1 1 auto; min-width: 0; min-height: var(--tap); accent-color: var(--r-link); background: transparent; }
@media (max-width: 39.99rem) {
  .r-title { display: none; }
  /* two rows at phone width: Library, Buy this book and Coffee, then the five controls, so every 44 px target fits at 320 px */
  .r-top { flex-wrap: wrap; justify-content: space-between; align-content: center; gap: 0; height: 6.25rem; padding-inline: var(--sp-2); }
  .r-break { display: block; flex: 0 0 100%; height: 0; }
  .reading.is-sample { --r-sample-h: 3.25rem; }
  .r-sample { top: 6.25rem; }
  .r-stage { top: calc(6.25rem + var(--r-sample-h)); }
  .r-where { display: none; }
}
@media (min-width: 40rem) {
  .r-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}
body.chrome-off .r-bar { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .r-bar { transition: opacity 0.25s ease, visibility 0.25s; }
}

/* sharing: the Copy quote button floats beside a selection, never over it (reader.js places it); colors are the reading
   theme's own pair, so it reads at the same contrast as the page text (inverse of --r-bg and --r-fg) */
.reading [hidden] { display: none; }
.r-quote { position: absolute; z-index: 5; display: flex; flex-wrap: wrap; gap: var(--sp-2); max-width: calc(100vw - 1rem); }
.r-quote-btn { padding-inline: var(--sp-3); background: var(--r-fg); color: var(--r-bg); border: 2px solid var(--r-bg); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); }
.r-quote-btn:hover { background: var(--r-fg); color: var(--r-bg); }
.r-quote-fallback { position: absolute; z-index: 6; left: var(--gutter); right: var(--gutter); bottom: 4.5rem; max-width: 32rem; margin: 0 auto; display: grid; gap: var(--sp-2); padding: var(--sp-3); background: var(--r-bar); color: var(--r-fg); border: 1px solid var(--r-border); border-radius: var(--radius); }
.r-quote-fallback textarea { width: 100%; box-sizing: border-box; padding: var(--sp-2); background: var(--r-bg); color: var(--r-fg); border: 1px solid var(--r-border); border-radius: var(--radius-s); font: inherit; }
.r-toast { position: absolute; z-index: 6; left: 50%; bottom: 4.75rem; transform: translateX(-50%); max-width: calc(100vw - 2rem); margin: 0; padding: var(--sp-2) var(--sp-4); background: var(--r-fg); color: var(--r-bg); border-radius: var(--radius-s); font-weight: 600; text-align: center; }
.r-toast:empty { visibility: hidden; padding: 0; }
.share-links { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.share-links a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-2); }

/* saved quotes and notes: the note dialog, the My notes page and the print view. Page tokens only, so light and dark follow the page theme. */
.note-quote { margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-4); border-left: 4px solid var(--deco); font-family: var(--serif); background: var(--surface-2); overflow-wrap: anywhere; }
.r-dialog textarea { min-height: 9rem; }
.r-dialog .btn-row { margin: var(--sp-3) 0; }
.reader-notes [hidden], .np [hidden] { display: none; }
.reader-notes .notes-h1 { font-size: var(--fs-h1); margin: 0 0 var(--sp-4); }
.reader-notes .notes-h1:focus { outline: none; }
.notes-tools { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1fr); margin: var(--sp-4) 0; }
.notes-tools > * { min-width: 0; }
@media (min-width: 48rem) {
  .notes-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.notes-book { margin-bottom: var(--sp-6); }
.notes-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); border-bottom: 2px solid var(--deco); margin-top: var(--sp-6); }
.notes-head h2 { margin: 0 0 var(--sp-2); }
.notes-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.notes-book h3 { font-family: var(--sans); font-size: var(--fs-h3); margin: var(--sp-5) 0 var(--sp-2); }
.note { border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--sp-3) var(--card-pad); margin: 0 0 var(--sp-3); background: var(--surface); }
.note .note-quote { margin-bottom: var(--sp-2); }
.note-text { white-space: pre-wrap; font-family: var(--sans); margin: 0 0 var(--sp-2); overflow-wrap: anywhere; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: 0; font-family: var(--sans); font-size: var(--fs-sm); color: var(--muted); }
.note-open, .note-meta .btn-quiet { display: inline-flex; align-items: center; min-height: var(--tap); }
.note-sure { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); color: var(--text); font-weight: 600; }
.note-yes { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.notes-danger { border-top: 1px solid var(--rule); margin-top: var(--sp-6); }
.notes-danger h2 { font-size: var(--fs-h3); }

/* the print view is paper: fixed light colors on screen and in print, so it always reads as the page that will be printed */
.np-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: var(--sp-4) 0; }
.np-bar p { margin: 0; flex-basis: 100%; }
.np-doc { max-width: 46rem; margin: 0 auto var(--sp-6); padding: var(--sp-4) var(--sp-5); background: #ffffff; color: #1c1b19; border: 1px solid #7a756a; font-family: var(--serif); }
.np-table { width: 100%; border-collapse: collapse; }
.np-table td { padding: 0; vertical-align: top; }
.np-head { display: flex; align-items: center; gap: var(--sp-3); padding-bottom: var(--sp-2); margin-bottom: var(--sp-4); border-bottom: 3px solid #b45309; font-family: var(--sans); }
.np-head img { width: 1.75rem; height: 1.75rem; }
.np-brand { font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.np-sub { margin-left: auto; color: #55524c; text-align: right; }
.np-foot { margin-top: var(--sp-4); padding-top: var(--sp-2); border-top: 1px solid #7a756a; font-family: var(--sans); font-size: 0.8125rem; color: #55524c; }
.np-body h1 { font-size: 1.6rem; margin: 0 0 var(--sp-2); color: #1c1b19; }
.np-body h2 { font-size: 1.2rem; margin: var(--sp-5) 0 var(--sp-2); color: #1c1b19; break-after: avoid; }
.np-by { margin: 0 0 var(--sp-3); font-family: var(--sans); color: #55524c; overflow-wrap: anywhere; }
.np-entry { margin: 0 0 var(--sp-4); break-inside: avoid; }
.np-entry blockquote { margin: 0 0 var(--sp-1); padding-left: var(--sp-3); border-left: 3px solid #b45309; font-style: italic; }
.np-entry p { margin: 0 0 var(--sp-1); font-family: var(--sans); font-size: 0.9375rem; overflow-wrap: anywhere; }
.np-attr, .np-date { color: #55524c; font-size: 0.8125rem; }
.np-note { white-space: pre-wrap; }
@media print {
  @page { margin: 16mm 14mm; }
  body.is-print-view { background: #ffffff; }
  body.is-print-view .site-header, body.is-print-view .site-footer, body.is-print-view .np-bar, body.is-print-view .skip-link { display: none; }
  body.is-print-view .np-doc { max-width: none; margin: 0; padding: 0; border: 0; }
  body.is-print-view .np { padding: 0; max-width: none; }
  .np-table thead { display: table-header-group; }
  .np-table tfoot { display: table-footer-group; }
}

/* dialogs: top layer, page tokens */
.r-dialog { width: min(36rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); color: var(--text); font-family: var(--sans); }
.r-dialog::backdrop { background: rgba(10, 10, 10, 0.55); }
.r-dialog-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--card-pad); background: var(--surface); border-bottom: 1px solid var(--rule); }
.r-dialog-head h2 { margin: 0; font-size: var(--fs-h3); }
.r-dialog-body { padding: var(--card-pad); }
.r-dialog ul, .r-dialog ol { list-style: none; padding: 0; margin: 0 0 var(--sp-4); }
.r-dialog ul ul { padding-left: var(--sp-4); }
.r-dialog li { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.r-dialog li > ul { flex-basis: 100%; }
.toc-btn { flex: 1 1 12rem; min-height: var(--tap); padding: var(--sp-2) var(--sp-3); border: 0; border-radius: var(--radius-s); background: transparent; color: var(--link); font: inherit; text-align: left; text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.toc-btn:hover { background: var(--surface-2); }
.toc-btn[aria-current="true"] { font-weight: 700; color: var(--text); text-decoration: none; box-shadow: inset 4px 0 0 var(--deco); }
.toc-btn mark { background: var(--todo-bg); color: var(--todo-text); }
.r-dialog input[type="range"] { width: 100%; min-height: var(--tap); accent-color: var(--accent); }
.r-dialog input[type="search"] { width: 100%; min-height: var(--tap); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); color: var(--text); font: inherit; }
.search-row { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.search-row .btn { flex: none; }
.end-art { width: 3.5rem; height: 3.5rem; margin-bottom: var(--sp-3); }
@media (forced-colors: active) {
  .r-bar, .r-dialog, .r-quote-btn, .r-toast { border: 1px solid CanvasText; }
  .shelf-bar::-webkit-progress-value { background: Highlight; }
  .shelf-bar::-moz-progress-bar { background: Highlight; }
}
