/* Unwind extras — quote cards, Read Later, newsletter inbox */

.private-only { display: none !important; }
body.is-private .private-only { display: inline-block !important; }

.x-note { color: var(--text-tertiary); font-size: 13px; line-height: 1.8; }
.x-note a { color: var(--text-secondary); }
.x-status { font-size: 13px; color: var(--text-tertiary); min-height: 20px; margin: 8px 0 4px; }
.x-status.err { color: #e5786d; }
.x-status.ok { color: #8bb09a; }

.x-panel {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 22px; margin: 8px 0 24px; line-height: 1.8;
  color: var(--text-secondary); font-size: 14px;
}
.x-panel h3 { font-size: 15px; font-weight: 500; color: var(--text-primary); margin-bottom: 10px; }
.x-panel ol { padding-left: 20px; margin: 8px 0 14px; }
.x-panel li { margin: 4px 0; }
.x-panel code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  background: var(--hover-bg); padding: 2px 6px; border-radius: 4px; color: var(--text-primary);
  word-break: break-all;
}

.x-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.x-input {
  flex: 1 1 240px; min-width: 0;
  padding: 11px 12px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text-primary); outline: none;
  transition: border-color 0.2s;
}
.x-input:focus { border-color: var(--text-tertiary); }
.x-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 16px; font-size: 14px; font-family: inherit; cursor: pointer;
  color: var(--text-secondary); transition: border-color 0.2s, color 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.x-btn:hover { border-color: var(--text-tertiary); color: var(--text-primary); }
.x-btn.primary { background: var(--text-primary); color: var(--bg); border-color: var(--text-primary); }
.x-btn.primary:hover { opacity: 0.85; color: var(--bg); }
.x-btn.danger:hover { border-color: #e5786d; color: #e5786d; }
.x-btn:disabled { opacity: 0.4; cursor: default; }
.x-btn.small { padding: 5px 12px; font-size: 12px; }

.x-tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 20px 0 4px; }

/* lists */
.x-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  border-bottom: 1px solid var(--border); padding: 18px 0; cursor: pointer;
  font-family: inherit; color: inherit;
}
.x-item:last-child { border-bottom: none; }
.x-item-title { font-size: 16px; line-height: 1.5; color: var(--text-primary); font-weight: 500; }
.x-item.read .x-item-title { color: var(--text-tertiary); font-weight: 400; }
.x-item-excerpt {
  margin-top: 6px; font-size: 13.5px; line-height: 1.7; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.x-item-meta { margin-top: 8px; font-size: 12px; color: var(--text-tertiary); display: flex; gap: 10px; flex-wrap: wrap; }
.x-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-primary); margin-right: 8px; vertical-align: middle; }

/* reader */
.reader-back {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 13px; color: var(--text-tertiary); padding: 0; margin-bottom: 20px;
}
.reader-back:hover { color: var(--text-primary); }
.reader-title { font-size: 26px; line-height: 1.35; font-weight: 500; color: var(--text-primary); letter-spacing: -0.01em; }
.reader-meta { margin: 12px 0 8px; font-size: 13px; color: var(--text-tertiary); display: flex; gap: 10px; flex-wrap: wrap; }
.reader-meta a { color: var(--text-secondary); }
.reader-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 28px; }
.reader-content { font-size: 17px; line-height: 1.95; color: var(--text-primary); overflow-wrap: anywhere; }
.reader-content p, .reader-content ul, .reader-content ol, .reader-content blockquote,
.reader-content pre, .reader-content figure, .reader-content table { margin: 0 0 1.2em; }
.reader-content h1, .reader-content h2, .reader-content h3, .reader-content h4 {
  font-weight: 500; line-height: 1.4; margin: 1.8em 0 0.7em; color: var(--text-primary);
}
.reader-content h1 { font-size: 24px; } .reader-content h2 { font-size: 21px; }
.reader-content h3 { font-size: 18px; } .reader-content h4 { font-size: 17px; }
.reader-content a { color: inherit; text-decoration: underline; text-decoration-color: var(--text-tertiary); text-underline-offset: 3px; }
.reader-content img, .reader-content video { max-width: 100%; height: auto; border-radius: 6px; }
.reader-content ul, .reader-content ol { padding-left: 1.4em; }
.reader-content blockquote { border-left: 1px solid var(--border); padding-left: 16px; color: var(--text-secondary); }
.reader-content pre, .reader-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.reader-content pre { background: var(--hover-bg); padding: 14px; border-radius: 6px; overflow-x: auto; }
.reader-content table { display: block; overflow-x: auto; border-collapse: collapse; }
.reader-content td, .reader-content th { border: 1px solid var(--border); padding: 6px 10px; }
.reader-content figcaption { font-size: 13px; color: var(--text-tertiary); margin-top: 6px; }
.reader-content hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
mark.reader-mark { background: rgba(232, 168, 56, 0.28); color: inherit; border-radius: 2px; padding: 1px 0; }

.reader-hl-section { margin-top: 48px; border-top: 1px solid var(--border); padding-top: 24px; }
.reader-hl-section h3 { font-size: 13px; letter-spacing: 0.12em; color: var(--text-tertiary); font-weight: 400; margin-bottom: 6px; }
.hl-row { padding: 16px 0; border-bottom: 1px solid var(--border); }
.hl-row:last-child { border-bottom: none; }
.hl-text { font-size: 15.5px; line-height: 1.85; color: var(--text-primary); white-space: pre-wrap; }
.hl-src { margin-top: 8px; font-size: 12.5px; color: var(--text-tertiary); }
.hl-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* selection bar */
.sel-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 220%);
  opacity: 0; pointer-events: none;
  display: flex; gap: 8px; align-items: center;
  background: var(--text-primary); color: var(--bg);
  border-radius: 9999px; padding: 6px 6px 6px 18px; z-index: 300;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  transition: transform 0.22s ease, opacity 0.22s ease; max-width: calc(100vw - 32px);
}
.sel-bar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.sel-bar span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; opacity: 0.7; }
.sel-bar button {
  border: none; border-radius: 9999px; padding: 9px 18px; font-size: 14px; font-family: inherit;
  cursor: pointer; background: var(--bg); color: var(--text-primary); white-space: nowrap;
}

/* newsletter frame */
.mail-frame { width: 100%; border: none; border-radius: 8px; background: #fff; min-height: 320px; display: block; }

/* quote card modal */
.qc-overlay {
  position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,0.82);
  display: none; align-items: center; justify-content: center; flex-direction: column;
  padding: 20px; gap: 16px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.qc-overlay.open { display: flex; }
.qc-img {
  max-width: min(92vw, 440px); max-height: 72vh; width: auto; height: auto;
  border-radius: 10px; border: 1px solid #222; display: block;
}
.qc-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.qc-actions .x-btn { color: #ddd; border-color: #444; }
.qc-actions .x-btn:hover { color: #fff; border-color: #888; }
.qc-actions .x-btn.primary { background: #f2f2f2; color: #000; border-color: #f2f2f2; }
.qc-hint { font-size: 12px; color: #888; }

/* review scope */
.review-scope { display: inline-flex; border: 1px solid var(--border); border-radius: 9999px; padding: 2px; }
.review-scope button {
  background: none; border: none; border-radius: 9999px; padding: 5px 13px;
  font-size: 13px; font-family: inherit; cursor: pointer; color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}
.review-scope button.active { background: var(--text-primary); color: var(--bg); }
.review-scope-status { font-size: 12px; color: var(--text-tertiary); margin: 10px 0 0; line-height: 1.7; }
.review-scope-status.ok { color: #8bb09a; }

@media (max-width: 480px) {
  .reader-title { font-size: 22px; }
  .reader-content { font-size: 16.5px; line-height: 1.9; }
  .x-panel { padding: 18px; }
}

/* app notifications row reuses .x-row / .review-scope-status */
#pushRow .x-row { gap: 8px; }
.push-time {
  padding: 6px 10px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text-primary); outline: none;
}
.push-time:focus { border-color: var(--text-tertiary); }
.push-time-ro { font-size: 14px; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* Libraries.dev effects (vendor/unwind-fx.js) */
.fx-orb { display: inline-block; width: 20px; height: 20px; vertical-align: middle; flex: none; }
.fx-orb:empty { width: 0; }                       /* no gap before the file has loaded */
.x-loading { display: flex; align-items: center; gap: 10px; }
.x-status .fx-orb { margin-right: 8px; }
.fx-host { position: relative; isolation: isolate; }
.x-input-host { display: block; flex: 1 1 240px; min-width: 0; }
.x-input-host .x-input { width: 100%; }
.fx-beam { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .fx-beam { display: none; } }

/* Private page astronaut (astronaut.js) */
.astro { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 40px; }
.astro-figure {
  flex: none; padding: 0; border: none; background: none; cursor: pointer; line-height: 0;
  -webkit-tap-highlight-color: transparent; border-radius: 4px;
}
.astro-figure:focus-visible { outline: 1px solid var(--text-tertiary); outline-offset: 4px; }
.astro-line {
  margin: 0; max-width: 34em; font-size: 15px; line-height: 1.75; color: var(--text-secondary);
  text-wrap: pretty; transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.astro-line.is-out { opacity: 0; }
@media (max-width: 560px) { .astro { margin-bottom: 28px; } }
@media (prefers-reduced-motion: reduce) { .astro-line { transition: none; } }

/* Projects art (page-art.js) */
.proj-art { margin: 8px 0 56px; }
.proj-art canvas { display: block; width: 100%; }
.proj-art-title {
  margin: 20px 0 0; text-align: center; font-weight: 400; color: var(--text-primary);
  font-size: clamp(26px, 4.6vw, 40px); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance;
}
.proj-art-title span { font-weight: 400; }
.proj-art-title em {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400;
  font-size: 1.14em; letter-spacing: -0.005em;
}

/* Home rings (page-art.js) */
.home-rings {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1;
  pointer-events: none; overflow: hidden; color: var(--text-primary); opacity: 0; transition: opacity 0.6s ease;
}
.home-rings.on { opacity: 1; }
.home-rings circle { fill: none; stroke: currentColor; stroke-opacity: 0.14; stroke-width: 1; }

/* Stream backdrop (page-art.js) */
.stream-art {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1;
  pointer-events: none; opacity: 0; transition: opacity 0.6s ease;
}
.stream-art.on { opacity: 1; }

/* System page (system.js) */
.sys-stage { position: relative; width: 100%; margin: 4px 0 28px; }
.sys-stage canvas { position: absolute; inset: 0; display: block; touch-action: pan-y pinch-zoom; }
.sys-panel { max-width: 34em; }
.sys-note { color: var(--text-secondary); font-size: 14px; line-height: 1.8; margin: 0 0 12px; }
.sys-note code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--text-primary); }
.sys-note.err { color: #e5786d; }
.sys-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.sys-label { font-size: 12px; color: var(--text-tertiary); margin: 18px 0 6px; flex: none; }
.sys-row .sys-label { margin: 0; width: 3em; }
.sys-input {
  flex: 1 1 auto; min-width: 0; padding: 8px 10px; font-size: 16px; font-family: inherit;
  color: var(--text-primary); background: transparent; border: 1px solid var(--border); border-radius: 6px; outline: none;
}
.sys-input:focus { border-color: var(--text-tertiary); }
.sys-title { font-size: 20px; font-weight: 500; border-color: transparent; padding-left: 0; }
.sys-title:focus { border-color: var(--border); padding-left: 10px; }
.sys-list { list-style: none; margin: 8px 0; padding: 0; }
.sys-list li { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--border); }
.sys-list li:last-child { border-bottom: none; }
.sys-link { background: none; border: none; padding: 8px 0; font: inherit; font-size: 15px; color: var(--text-primary); cursor: pointer; text-align: left; flex: 1; }
.sys-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sys-count { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.sys-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sys-danger { margin-top: 24px; }
.sys-status { min-height: 18px; font-size: 12px; color: var(--text-tertiary); margin: 10px 0 0; }
.sys-status.err { color: #e5786d; }
.sys-wrap { position: relative; }
.sys-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 22px; margin: -6px 0 2px; font-size: 13px; color: var(--text-tertiary); }
.sys-crumbs button { background: none; border: none; padding: 2px 0; font: inherit; color: var(--text-tertiary); cursor: pointer; }
.sys-crumbs button:hover { color: var(--text-primary); }
.sys-crumbs [aria-current] { color: var(--text-primary); }
.sys-crumbs .sep { opacity: 0.6; }
.sys-p-head { display: flex; align-items: center; gap: 8px; }
.sys-p-head .sys-title { flex: 1; }
.sys-x { flex: none; width: 32px; height: 32px; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--text-tertiary); font-size: 18px; line-height: 1; cursor: pointer; }
.sys-x:hover { color: var(--text-primary); border-color: var(--border); }
.sys-text {
  display: block; width: 100%; box-sizing: border-box; min-height: 76px; margin: 10px 0 0; padding: 10px;
  font: inherit; font-size: 15px; line-height: 1.7; color: var(--text-primary);
  background: transparent; border: 1px solid var(--border); border-radius: 6px; outline: none; resize: none;
}
.sys-text:focus { border-color: var(--text-tertiary); }
.sys-links { list-style: none; margin: 4px 0; padding: 0; }
.sys-links li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.sys-links a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--text-primary); text-decoration: none; }
.sys-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sys-links a span { color: var(--text-tertiary); }
.sys-del { flex: none; background: none; border: none; padding: 2px 6px; font-size: 16px; color: var(--text-tertiary); cursor: pointer; }
.sys-del:hover { color: #e5786d; }
.sys-select { width: 100%; font-size: 14px; background: var(--bg); cursor: pointer; }
/* on a computer the panel floats at the right of the full-width graph */
@media (min-width: 900px) {
  .sys-panel.side {
    position: absolute; top: 20px; z-index: 2; width: 340px; max-width: none; box-sizing: border-box;
    overflow-y: auto; padding: 16px 18px 12px;
    background: color-mix(in srgb, var(--bg) 88%, transparent); border: 1px solid var(--border); border-radius: 10px;
  }
  .sys-panel.side .sys-label { margin-top: 16px; }
}

/* Nav: unlocked, the row is wider than the 640px column. Centre it on the
   column instead of letting it run off to the right; when it fits (the
   public pages) it stays exactly as before. */
@media (min-width: 769px) {
  .container > nav {
    width: max-content; min-width: 100%; max-width: calc(100vw - 48px);
    margin-left: 50%; transform: translateX(-50%);
    flex-wrap: wrap; justify-content: center; row-gap: 12px;
  }
}
.file-frame { background: transparent; border-radius: 0; }

/* Shelf on the Reading page (shelf.js) */
.shelf-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
#page-reading.shelf-on #readingList, #page-reading.shelf-on #readingSortBtn { display: none; }
#page-reading:not(.shelf-on) #shelfRoot { display: none; }
.shelf { margin-top: 8px; }
.shelf-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.shelf-count { color: var(--text-tertiary); font-variant-numeric: tabular-nums; margin-left: 2px; }
.review-tab.active .shelf-count { color: inherit; opacity: 0.6; }
.shelf-right { display: flex; align-items: center; gap: 10px; }
.shelf-sort { font: inherit; font-size: 13px; color: var(--text-secondary); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; }
.shelf-mode { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.shelf-mode button { background: none; border: none; padding: 5px 12px; font: inherit; font-size: 13px; color: var(--text-tertiary); cursor: pointer; }
.shelf-mode button.active { background: var(--text-primary); color: var(--bg); }
.shelf-samples { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-tertiary); margin: 0 0 14px; cursor: pointer; }

/* wider than the reading column on a computer, so the shelf holds more per row */
@media (min-width: 900px) {
  .shelf-spines, .shelf-covers, .shelf-card { width: min(1100px, calc(100vw - 96px)); margin-left: 50%; transform: translateX(-50%); }
}

/* spines: width = highlights, dot density = highlights, fill = progress */
.shelf-spines { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 26px 3px; padding: 6px 0 12px; }
.spine {
  position: relative; flex: none; width: var(--w); height: var(--h); padding: 10px 0 22px; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  background: color-mix(in srgb, var(--text-primary) 4%, var(--bg)); border: 1px solid var(--border); border-radius: 2px;
  color: var(--text-tertiary); cursor: pointer; font: inherit; transition: transform 0.25s ease, border-color 0.2s ease;
}
.spine::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--dust);
  background-image: radial-gradient(var(--text-primary) 0.6px, transparent 0.8px); background-size: 4px 4px;
}
.spine::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: -7px; height: 1px; background: var(--border); }
.spine { background-image: linear-gradient(to top, color-mix(in srgb, var(--text-primary) 12%, transparent) var(--pct), transparent var(--pct)); }
.spine-title {
  position: relative; writing-mode: vertical-rl; text-orientation: mixed; font-size: 12px; line-height: 1.15;
  max-height: calc(var(--h) - 40px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.spine-n { position: absolute; bottom: 5px; left: 0; right: 0; text-align: center; font-size: 9.5px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.spine.s1 { color: var(--text-primary); }
.spine.s2 { color: var(--text-secondary); border-color: color-mix(in srgb, var(--text-primary) 30%, var(--border)); }
.spine:hover, .spine:focus-visible, .spine.open { transform: translateY(-8px); border-color: var(--text-tertiary); outline: none; }
.spine.open { border-color: var(--text-primary); }

/* covers: the reader's thumbnails, greyscale */
.shelf-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 22px 14px; padding: 6px 0 12px; }
.cover { display: flex; flex-direction: column; gap: 6px; background: none; border: none; padding: 0; text-align: left; font: inherit; color: var(--text-secondary); cursor: pointer; }
.cover-img { display: block; aspect-ratio: 149 / 198; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--text-primary) 5%, var(--bg)); box-shadow: 0 0 0 1px var(--border); }
.cover-img img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: transform 0.25s ease; }
.cover-blank { display: flex; align-items: center; justify-content: center; height: 100%; padding: 8px; box-sizing: border-box; font-size: 11px; line-height: 1.4; text-align: center; color: var(--text-tertiary); }
.cover-title { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cover-bar { display: block; height: 2px; background: var(--border); }
.cover-bar span { display: block; height: 100%; background: var(--text-secondary); }
.cover:hover .cover-img img, .cover:focus-visible .cover-img img { transform: scale(1.03); }
.cover.open .cover-img { box-shadow: 0 0 0 1px var(--text-primary); }

/* the card for one book */
.shelf-card { position: relative; box-sizing: border-box; margin-bottom: 26px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb, var(--text-primary) 2%, var(--bg)); }
.shelf-close { position: absolute; top: 10px; right: 10px; }
.shelf-card-head { display: flex; gap: 16px; align-items: flex-start; padding-right: 32px; }
.shelf-card-head .cover-img { flex: none; width: 76px; }
.shelf-card-title { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.4; color: var(--text-primary); }
.shelf-card-author { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }
.shelf-card-meta { margin: 8px 0 0; font-size: 12px; color: var(--text-tertiary); }
.shelf-hl { list-style: none; margin: 4px 0 14px; padding: 0; }
.shelf-hl li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.75; color: var(--text-primary); }
.shelf-hl li:last-child { border-bottom: none; }
.shelf-hl-note { display: block; margin-top: 4px; font-size: 13px; color: var(--text-tertiary); }
.shelf-legend { margin: 0 0 12px; font-size: 12px; line-height: 1.7; color: var(--text-tertiary); }
@media (min-width: 900px) {
  .shelf-legend { width: min(1100px, calc(100vw - 96px)); margin-left: 50%; transform: translateX(-50%); }
}

/* the current question, on a book's card (shelf.js) and in System */
.shelf-q { margin: 16px 0 6px; padding: 14px 0 4px; border-top: 1px solid var(--border); }
.shelf-q .sys-label { margin-top: 0; }
.shelf-q-text { margin: 0 0 10px; font-size: 15px; line-height: 1.6; color: var(--text-primary); }
.shelf-q-state { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13px; color: var(--text-secondary); }
.shelf-q-list { list-style: none; margin: 8px 0 0; padding: 0; }
.shelf-q-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.shelf-q-list li:last-child { border-bottom: none; }
.spine.inq { border-top: 3px solid var(--text-primary); }
.cover.inq .cover-img { box-shadow: 0 0 0 2px var(--text-primary); }
.sys-q { margin: 12px 0 2px; }

/* Question tab (question.js) */
#page-reading.question-on #readingList, #page-reading.question-on .reading-toolbar, #page-reading.question-on #shelfRoot { display: none; }
#page-reading:not(.question-on) #questionRoot { display: none; }
.qz-head { margin: 4px 0 18px; }
.qz-pick { margin-bottom: 12px; max-width: 100%; }
.qz-question { margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.25; color: var(--text-primary); text-wrap: balance; }
.qz-meta { margin: 6px 0 0; font-size: 12px; color: var(--text-tertiary); }
.qz-link { background: none; border: none; padding: 0; font: inherit; color: var(--text-secondary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.qz-search { width: 100%; box-sizing: border-box; margin-bottom: 14px; }
.qz-cols { display: grid; gap: 14px; margin-bottom: 40px; }
.qz-cols.n1 { grid-template-columns: 1fr; } .qz-cols.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qz-cols.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 900px) {
  .qz-cols { width: min(1100px, calc(100vw - 96px)); margin-left: 50%; transform: translateX(-50%); }
}
@media (max-width: 760px) {
  .qz-cols.n2, .qz-cols.n3 { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 6px; }
  .qz-cols .qz-col { flex: 0 0 86%; scroll-snap-align: start; }
}
.qz-col { min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 14px 14px 6px; background: color-mix(in srgb, var(--text-primary) 2%, var(--bg)); }
.qz-book { margin: 0; font-size: 15px; font-weight: 500; color: var(--text-primary); }
.qz-hl { list-style: none; margin: 10px 0 0; padding: 0; max-height: 58vh; overflow-y: auto; }
.qz-hl li { padding: 10px 0; border-top: 1px solid var(--border); }
.qz-hl p { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--text-primary); }
.qz-hl .qz-note { margin-top: 4px; font-size: 12.5px; color: var(--text-tertiary); }
.qz-hl-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--text-tertiary); }
.qz-hl-foot span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-quote { flex: none; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 11px; color: var(--text-secondary); cursor: pointer; }
.qz-quote:hover { border-color: var(--text-tertiary); color: var(--text-primary); }
.qz-quoted { flex: none; color: var(--text-secondary); }
.qz-work { max-width: 40em; }
.qz-step { margin: 30px 0 10px; font-size: 12px; letter-spacing: 0.08em; color: var(--text-tertiary); }
.qz-question-small { margin: 0; font-size: 16px; line-height: 1.6; color: var(--text-primary); }
.qz-answer { margin: 0 0 22px; }
.qz-answer-title { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.qz-label { display: block; margin: 16px 0 0; font-size: 12px; color: var(--text-tertiary); }
.qz-quotes { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 1px solid var(--border); }
.qz-quotes li { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
.qz-quotes em { font-style: normal; color: var(--text-tertiary); margin-left: 4px; }
.qz-hint { margin: 8px 0 0; font-size: 12px; color: var(--text-tertiary); }
.qz-foot { margin-top: 22px; }
