/* Web app — mirrors the iOS screens. Loads after styles.css (tokens, buttons, chips, pills). */
body { overflow-x: hidden; }
html, body { overscroll-behavior-y: none; }   /* no rubber-band past the top/bottom (iOS drags the page out from under the tab bar) */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; padding: 28px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; background: rgba(247,244,237,0.55); }
.side .wordmark { margin-bottom: 18px; }
.side a.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.side a.nav-item svg { width: 22px; height: 22px; stroke: currentColor; }
.side a.nav-item:hover { background: rgba(46,36,32,0.05); color: var(--ink); }
.side a.nav-item[aria-current] { color: var(--accent); background: var(--accent-tint); }
.side .spacer { flex: 1; }
.side .mode { font-size: 12px; color: var(--muted); }
.side .mode b { color: var(--accent); }
.shell > main { min-width: 0; }
.content { max-width: 640px; width: 100%; margin: 0 auto; padding: 24px var(--gutter) 60px; }
.tabbar { display: none; }
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .content { padding-top: 14px; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(64px + env(safe-area-inset-bottom)); padding: 8px 12px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; flex: 1; font-size: 11px; font-weight: 600; color: var(--muted); }
  .tabbar a svg { width: 24px; height: 24px; stroke: currentColor; }
  .tabbar a[aria-current] { color: var(--accent); }
}

/* Screen chrome */
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.screen-title { font-family: var(--display); font-size: 30px; font-weight: 500; letter-spacing: -0.01em; line-height: 1; }
.screen-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 700 12px var(--ui); display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; object-fit: cover; flex: none; }
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 700 9px var(--ui); display: inline-flex; align-items: center; justify-content: center; object-fit: cover; flex: none; }
.avatar-link { display: inline-flex; border-radius: 50%; text-decoration: none; }
img.avatar, img.avatar-sm, img.avatar-lg { background: var(--line); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.rule { height: 1px; background: var(--line); }

/* Covers */
.cover { position: relative; flex-shrink: 0; border-radius: 4px; color: var(--surface); padding: 10px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; overflow: hidden; box-shadow: 0 10px 20px rgba(46,36,32,0.24); font-family: var(--display); font-weight: 600; line-height: 1.12; }
.cover.dark-text { color: var(--ink); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover small { font-family: var(--ui); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.cover-btn { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.pill { white-space: nowrap; }
.cover.tiny { padding: 0; }
.cover.small { font-size: 9px; padding: 6px; }
.cover.small small { font-size: 7px; }

/* Browse */
.hero-book { display: flex; gap: 18px; align-items: center; width: 100%; }
.hero-book > div:not(.cover) { flex: 1; min-width: 0; }
.hero-book .cover { flex: none; }
.hero-book h3 { white-space: normal; font-size: 22px; margin-bottom: 6px; }
.hero-book .meta { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.band { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-card); box-shadow: 0 10px 24px rgba(46,36,32,0.18); }
.band strong { display: block; font-family: var(--display); font-weight: 500; font-size: 19px; letter-spacing: -0.01em; }
.band small { font-size: 12px; opacity: 0.9; }
.band .btn { margin-left: auto; flex-shrink: 0; }
.rail-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.rail-head h2 { font-size: 20px; }
.rail-head small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.rail { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
.rail::-webkit-scrollbar { display: none; }
.rail-card { width: 108px; flex-shrink: 0; scroll-snap-align: start; }
.rail-card .cover { width: 108px; height: 162px; font-size: 13px; }
.rail-card .cover small { font-size: 9px; }
.rail-card .t { font-family: var(--display); font-size: 14px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-card .m { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star { display: inline-block; width: 11px; height: 11px; vertical-align: -1px; fill: var(--ink); }
.stars { display: inline-flex; gap: 1px; }
.stars .star.off { fill: var(--line); }

/* Book page */
.book-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.book-hero .cover { width: 160px; height: 240px; font-size: 21px; padding: 16px; text-align: left; box-shadow: 0 24px 44px rgba(46,36,32,0.32); }
.book-hero .cover small { font-size: 10px; }
.book-hero h1 { font-size: 28px; }
.book-hero .by { color: var(--muted); font-size: 14px; margin-top: 4px; }
.book-hero .meta { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.actions { display: grid; gap: 10px; }
.actions .btn { width: 100%; }
.actions .fine { text-align: center; font-size: 12px; color: var(--muted); }
.blurb { font-size: 15px; line-height: 1.6; }
.rating-block { display: flex; gap: 18px; align-items: center; }
.rating-block .big { font-family: var(--display); font-size: 48px; line-height: 1; letter-spacing: -0.02em; text-align: center; }
.rating-block .n { font-size: 11px; color: var(--muted); text-align: center; }
.bars { flex: 1; display: grid; gap: 6px; }
.bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar .track { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); }
.review { display: grid; gap: 8px; }
.review .who { display: flex; justify-content: space-between; font-size: 13px; }
.review .who b { font-weight: 600; }
.review .who span { color: var(--muted); font-size: 12px; }
.review p { font-size: 14px; line-height: 1.55; }
.verified { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-tint); padding: 3px 8px; border-radius: 999px; }
.rate-form { display: grid; gap: 10px; }
.rate-stars { display: flex; gap: 4px; }
.rate-stars button { background: none; border: 0; cursor: pointer; padding: 2px; }
.rate-stars svg { width: 26px; height: 26px; fill: var(--line); }
.rate-stars button.on svg { fill: var(--ink); }

/* Reader */
.reader { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--r-bg); color: var(--r-fg); --r-bg: #EDE9E0; --r-fg: #2E2420; --r-card: #F7F5F0; --r-line: #D6CFC3; --r-eyebrow: #1F4E5A; --r-btn: #1F4E5A; --r-btn-fg: #F7F4ED; }
.reader[data-theme="dark"] { --r-bg: #1C1917; --r-fg: #ECE7DD; --r-card: #2A2522; --r-line: #3D3733; --r-eyebrow: #8FB5BE; --r-btn: #7FB3BD; --r-btn-fg: #1C1917; }
.reader .chrome { display: flex; align-items: center; gap: 2px; padding: max(10px, env(safe-area-inset-top)) 10px 0 14px; }
.reader .chrome .t { flex: 1; min-width: 0; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader .chrome button { background: none; border: 0; color: inherit; width: 40px; height: 40px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); }
.reader .chrome button svg { width: 20px; height: 20px; stroke: currentColor; }
.reader .body { flex: 1; overflow-y: auto; padding: 28px 28px 60px; }
.reader .inner { max-width: 640px; margin: 0 auto; }
.reader .eyebrow { color: var(--r-eyebrow); }
.reader h1 { font-size: 28px; margin: 12px 0 20px; color: var(--r-fg); }
.reader p.para { font-family: var(--reading); line-height: 1.7; margin-bottom: 1em; }
.reader .nav-row { display: flex; gap: 10px; margin-top: 28px; }
.reader .nav-row .btn { flex: 1; }
.reader .end { text-align: center; font-family: var(--display); font-size: 22px; margin-top: 28px; }
.reader .progress { padding: 10px 28px calc(14px + env(safe-area-inset-bottom)); font-size: 11px; font-weight: 600; opacity: 0.85; }
.reader .progress .track { height: 2px; background: var(--r-line); margin-top: 6px; }
.reader .progress .fill { height: 100%; background: var(--r-btn); }
.reader .btn-primary { background: var(--r-btn); color: var(--r-btn-fg); box-shadow: none; }
.reader .btn-secondary { color: var(--r-fg); border-color: var(--r-fg); }
.gate { margin-top: 24px; padding: 20px; border-radius: 16px; background: var(--r-card); border: 1px solid var(--r-line); box-shadow: 0 18px 40px rgba(0,0,0,0.22); display: grid; gap: 12px; }
.gate h2 { font-size: 22px; color: var(--r-fg); }
.gate p { font-size: 14px; opacity: 0.8; }
.gate .fine { font-size: 12px; text-align: center; opacity: 0.65; }
.chapter-list { position: fixed; inset: 0; z-index: 60; background: rgba(46,36,32,0.45); display: flex; align-items: flex-end; }
.chapter-list .sheet { background: var(--surface); width: 100%; max-height: 70vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 16px var(--gutter) 24px; }
.chapter-list button { display: flex; width: 100%; gap: 12px; align-items: center; padding: 12px 0; background: none; border: 0; border-bottom: 1px solid var(--line); font: 15px var(--ui); color: var(--ink); cursor: pointer; text-align: left; }
.chapter-list button:disabled { color: var(--muted); }
.chapter-list button .idx { width: 32px; color: var(--muted); }
@media (min-width: 900px) { .chapter-list { align-items: center; justify-content: center; } .chapter-list .sheet { width: 480px; border-radius: 16px; } }

/* Library */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--track); }
.seg button, .seg a { flex: 1; min-height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 13px var(--ui); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.seg button[aria-pressed="true"], .seg a[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(46,36,32,0.16); }
.seg.admin-tabs { flex-wrap: wrap; }
.seg.admin-tabs a { flex: 1 0 30%; }
.lib-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.lib-row .cover { width: 56px; height: 84px; font-size: 9px; padding: 6px; }
.lib-row .info { flex: 1; min-width: 0; display: grid; gap: 5px; }
.lib-row .t { font-family: var(--display); font-size: 16px; }
.lib-row .a { font-size: 12px; color: var(--muted); }
.lib-row .track { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.lib-row .fill { height: 100%; background: var(--accent); }
.lib-row .m { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.lib-row .m .on { color: var(--accent); font-weight: 600; }
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lib-grid .cover { width: 100%; aspect-ratio: 2/3; height: auto; font-size: 13px; }
.lib-grid .t { font-family: var(--display); font-size: 13px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-grid .m { font-size: 11px; color: var(--muted); }

/* Subscribe */
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; cursor: pointer; font: inherit; color: inherit; display: grid; gap: 6px; }
.plan-card[aria-pressed="true"] { border: 2px solid var(--accent); padding: 13px; }
.plan-card .lbl { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.plan-card .p { font-family: var(--display); font-size: 28px; letter-spacing: -0.01em; }
.plan-card .s { font-size: 12px; color: var(--muted); }
.save { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px; border-radius: 8px; background: var(--accent-tint); color: var(--accent); }
.benefits { list-style: none; padding: 0 4px; margin: 0; display: grid; gap: 10px; font-size: 14px; }
.benefits li { display: flex; gap: 12px; align-items: center; }
.benefits li::before { content: "✓"; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--accent-tint); color: var(--accent); font-weight: 800; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Write / dashboard */
.pub-btn { width: 100%; min-height: 56px; }
.pub-btn .plus { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.earn { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px; border-radius: var(--r-card); box-shadow: 0 12px 26px rgba(46,36,32,0.28); }
.earn .amt { font-family: var(--display); font-size: 42px; line-height: 1; letter-spacing: -0.02em; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.earn .side-note { text-align: right; font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-grid .stat b { font-size: 26px; }
.book-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.book-row .cover { width: 44px; height: 66px; padding: 0; box-shadow: 0 6px 12px rgba(46,36,32,0.2); }
.book-row .info { flex: 1; min-width: 0; }
.book-row .t { font-family: var(--display); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-row .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.book-row .s.warn { color: var(--warn); }
.status { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.status.live { background: var(--accent-tint); color: var(--accent); }
.status.in_review, .status.draft { background: var(--track); color: var(--muted); }
.status.needs_changes, .status.removed { background: var(--warn-tint); color: var(--warn); }

/* Upload */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13px var(--ui); cursor: pointer; }
.chip-row button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.radio { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; cursor: pointer; }
.radio.on { border: 1.5px solid var(--accent); font-weight: 600; }
.radio input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.file-row .ok { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.file-row .n { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .n small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.cover-pick { width: 96px; height: 144px; border-radius: 4px; border: 1.5px dashed #BDB3A5; background: var(--surface); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; cursor: pointer; overflow: hidden; flex-shrink: 0; }
.cover-pick img { width: 100%; height: 100%; object-fit: cover; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.45; cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.switch-row b { display: block; font-size: 14px; }
.switch-row small { color: var(--muted); font-size: 12px; }

/* Moderate */
.queue-item { display: grid; gap: 12px; }
.queue-item textarea { min-height: 70px; }

/* Toast + misc */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(46,36,32,0.35); max-width: 90vw; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
@media (min-width: 900px) { .toast { bottom: 32px; } }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 15px; }
.test-banner { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 16px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.test-banner button { background: none; border: 0; color: var(--accent); font: 600 12px var(--ui); cursor: pointer; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: 600 13px var(--ui); cursor: pointer; }

/* Checkout return */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Library edit mode */
.lib-row-wrap { display: flex; align-items: center; gap: 10px; }
.lib-row-wrap .lib-row { flex: 1; min-width: 0; }
.lib-tile { position: relative; min-width: 0; }
.lib-tile .cover-btn { display: block; width: 100%; }
.lib-tile .remove-btn { margin-top: 6px; width: 100%; min-height: 32px; font-size: 12px; }
.remove-btn { flex: none; }

/* Inbox badge, author page, stats, tables, admin */
.nav-item { position: relative; }
.badge { position: absolute; left: 26px; top: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--warn); color: var(--surface); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn.on { color: var(--accent); border-color: var(--accent); }
.chip-row a.chip { text-decoration: none; }
.chip.on { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.author-head { display: flex; align-items: center; gap: 16px; }
.author-head h1 { font-size: 26px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 700 20px var(--ui); display: inline-flex; align-items: center; justify-content: center; object-fit: cover; flex: none; }
.chart { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.chart svg { display: block; width: 100%; height: 80px; margin: 8px 0 4px; }
.table { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow-x: auto; }
.table .tr { display: grid; grid-template-columns: 1.4fr 1.2fr 1.2fr 0.7fr 0.9fr 0.9fr; gap: 8px; padding: 10px 12px; font-size: 12px; border-top: 1px solid var(--line); min-width: 560px; }
.table .tr.th { border-top: 0; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; }
.notif { text-align: left; width: 100%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.notif.unread { border-left: 4px solid var(--accent); }
.admin-tabs { margin-bottom: 18px; }
.admin-tabs a { text-decoration: none; text-align: center; }
.payout-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.payout-card .btn { flex: none; }
@media (max-width: 480px) { .payout-card { flex-direction: column; align-items: stretch; } }

/* Audiobook player */
body.has-player .content { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
#player-root { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; pointer-events: none; }   /* above the tab bar (30), below the reader (50) */
.player-bar { pointer-events: auto; position: absolute; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 6px; padding: 8px 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px rgba(46,36,32,0.22); }
@media (min-width: 900px) { .player-bar { left: 264px; right: 24px; bottom: 16px; max-width: 640px; margin: 0 auto; } }
.player-bar .pb-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.player-bar .pb-text { min-width: 0; display: flex; flex-direction: column; }
.player-bar .pb-text b { font-family: var(--display); font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar .pb-text small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar > button:not(.pb-open) { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.player-bar > button svg { width: 22px; height: 22px; stroke: currentColor; }
.player-bar .pb-play { background: var(--accent); color: var(--surface); }
.player-bar .pb-close { width: 30px; height: 30px; color: var(--muted); }
.player-bar .pb-close svg { width: 16px; height: 16px; }
.player-bar .pb-track { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px; background: var(--track); border-radius: 2px; overflow: hidden; }
.player-bar .pb-track div { height: 100%; background: var(--accent); }
.now-playing { pointer-events: auto; position: fixed; inset: 0; z-index: 40; background: var(--ground); overflow-y: auto; }
.now-playing[data-theme="dark"] { background: #1C1917; color: #ECE7DD; --ink: #ECE7DD; --muted: #A89F97; --surface: #2A2522; --line: #3D3733; --track: #3D3733; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.np-head button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.np-head button svg { width: 20px; height: 20px; stroke: currentColor; }
.np-head button[data-p="collapse"] svg { transform: rotate(-90deg); }
.np-body { max-width: 420px; margin: 0 auto; padding: 8px 24px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.np-body .cover { margin-bottom: 12px; }
.np-body h2 { font-size: 22px; }
.np-chapter { font-size: 13px; font-weight: 600; color: var(--accent); }
.np-body input[type=range] { width: 100%; accent-color: var(--accent); margin-top: 6px; }
.np-times { width: 100%; font-size: 12px; }
.np-controls { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.np-controls button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.np-controls button svg { width: 24px; height: 24px; stroke: currentColor; }
.np-controls button.big { width: 68px; height: 68px; background: var(--accent); border-color: var(--accent); color: var(--surface); }
.np-controls button.big svg { width: 30px; height: 30px; }
.np-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.np-tools button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: 600 13px var(--ui); cursor: pointer; }
.audio-gate { margin-top: 16px; text-align: left; width: 100%; }
#player-root .chapter-list { pointer-events: auto; z-index: 45; }
.listen-card .listen-icon svg { width: 22px; height: 22px; stroke: var(--accent); }
.parts { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.part { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 14px; }
.part:first-child { border-top: 0; }
.part .idx { width: 22px; color: var(--muted); font-weight: 700; font-size: 12px; }
.part .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.small { width: 30px; height: 30px; font-size: 14px; }
.card.highlight { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.audio-gate { background: var(--surface); border-color: var(--line); }
.audio-gate h3 { font-size: 20px; color: var(--ink); }
.audio-gate p { color: var(--ink); }

/* Home (front door) — wider than the app's phone column on desktop */
.content.wide { max-width: 1040px; }
.home-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; padding: 16px 0 40px; }
.home-hero h1 { font-size: clamp(38px, 5.4vw, 60px); line-height: 1.02; margin: 12px 0 0; white-space: normal; }
.home-dek { font-size: 17px; color: var(--muted); line-height: 1.55; margin: 18px 0 20px; max-width: 520px; }
.home-hero .ticks { gap: 8px; }
.home-hero .ticks li { font-size: 14px; }
/* Three real covers, fanned. The middle one stands proud; the outer two lean in. */
.home-fan { display: flex; justify-content: center; align-items: flex-end; gap: 0; padding: 18px 0; }
.home-fan .cover-btn { transition: transform .25s ease; }
.home-fan .cover { box-shadow: 0 28px 44px rgba(46,36,32,.30); }
.home-fan .cover-btn:nth-child(1) { transform: rotate(-9deg) translate(26px, 10px); z-index: 1; }
.home-fan .cover-btn:nth-child(2) { transform: translateY(-14px) scale(1.06); z-index: 3; }
.home-fan .cover-btn:nth-child(3) { transform: rotate(9deg) translate(-26px, 10px); z-index: 2; }
.home-fan .cover-btn:hover { transform: translateY(-18px) scale(1.08); z-index: 4; }
/* "How it was made", under a cover on the shelf. */
.made { margin-top: 5px; font: 600 10.5px var(--ui); letter-spacing: .02em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.made::before { content: "✦ "; color: var(--accent); }
.made.made-human::before { content: "✎ "; color: #5C6140; }
.made-inline { color: var(--muted); }
.made-chips .chip { cursor: pointer; }
.ai-label.human { background: #E4E7D9; color: #4A5034; }
/* The writers' invitation: a quiet card, not a billboard. */
.home-invite { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r-card); padding: 22px 26px; max-width: 760px; background-image: url(assets/paper.png?v=2); background-size: 320px 320px; }
.home-invite h2 { font-size: 24px; margin: 6px 0 8px; white-space: normal; }
.home-invite p { font-size: 15px; color: var(--muted); line-height: 1.55; max-width: 640px; }
.home-invite p b { color: var(--ink); }
.radio span { display: flex; flex-direction: column; gap: 2px; }
.radio small { font-weight: 400; font-size: 12px; color: var(--muted); line-height: 1.35; }
.home-manifesto { text-align: center; padding: 34px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 8px 0 32px; }
.home-manifesto p { font-family: var(--display); font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.015em; }
.home-manifesto p em { color: var(--accent); }
.home-manifesto span { display: block; max-width: 640px; margin: 12px auto 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.home-section { margin: 32px 0; }
.home-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; }
.home-step .n { font-family: var(--display); font-size: 34px; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.home-step h3 { font-size: 18px; margin-bottom: 6px; white-space: normal; }
.home-step p { font-size: 14px; color: var(--muted); line-height: 1.5; }
.home-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px 16px; }
.home-panel { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: center; }
.home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-stats .stat { background: var(--surface); border-radius: 12px; padding: 12px 14px; color: var(--ink); text-align: left; }
.home-stats .stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 500; line-height: 1.1; }
.home-stats .stat span { font-size: 12px; color: var(--muted); }
.home-foot { display: flex; flex-wrap: wrap; gap: 14px 18px; font-size: 13px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }
.home-foot a { color: var(--muted); font-weight: 600; }
@media (max-width: 760px) { .home-hero { grid-template-columns: 1fr; gap: 8px; padding-bottom: 28px; } .home-fan { order: -1; padding: 6px 0 14px; } .home-fan .cover { width: 104px !important; height: 156px !important; } .home-steps, .home-panel { grid-template-columns: 1fr; } .home-invite { padding: 18px; } }

/* Home split: readers left, writers right */

/* Sign in */
.signin { max-width: 440px; margin: 0 auto; }
.signin h1 { font-size: clamp(28px, 4vw, 36px); line-height: 1.08; white-space: normal; margin-top: 8px; }
.signin .or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signin .btn-secondary { min-height: 46px; }

.lib-tile .m .on { color: var(--accent); font-weight: 600; }
.lib-grid { align-items: start; }

/* Construction-paper texture on the app's boxes (styles.css covers .card / .panel / .stone-* / buttons). */
.home-step, .listen-card, .plan-card, .notif, .payout-card, .queue-item, .test-banner, .band, .seg, .player-bar, .audio-gate,
.home-stats .stat, .earn, .stat-grid .stat, .pill, .chip, .btn-secondary, .lib-row-wrap .remove-btn { background-image: url(assets/paper.png?v=2); background-size: 320px 320px; }
.lib-tile .cover, .rail-card .cover, .cover img { background-image: none; }

/* Owner › Money tables */
table.money { width: 100%; border-collapse: collapse; font-size: 13px; }
table.money th, table.money td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.money th:first-child, table.money td:first-child { text-align: left; }
table.money th { font: 700 11px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
table.money tr.total td { font-weight: 700; border-bottom: 0; }
.preview-role .seg { flex-wrap: wrap; }

.genre-group { display: block; font: 700 10.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 8px 0 6px; }

/* Write dashboard: one entry = the book row + its audiobook line */
.book-entry { border-bottom: 1px solid var(--line); }
.book-entry .book-row { border-bottom: 0; padding-bottom: 4px; }
.book-extra { padding: 0 0 12px 56px; font-size: 12.5px; }
.book-extra a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); text-decoration: none; }
.book-extra a:hover { text-decoration: underline; }
.book-extra svg { width: 14px; height: 14px; }

/* Publish form: compact genre picker — chosen genres as removable chips + one "Add a genre" menu */
.genre-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.genre-pick .picked { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 600 13px var(--ui); cursor: pointer; }
.genre-pick .picked span { opacity: .8; font-size: 15px; line-height: 1; }
.genre-pick .picked.other { padding: 0 4px 0 6px; background: var(--surface); color: var(--ink); cursor: default; }
.genre-pick .picked.other input { border: 0; background: none; font: 600 13px var(--ui); width: 150px; padding: 6px; outline: none; color: inherit; min-height: 0; }
.genre-pick .picked.other button { border: 0; background: none; font-size: 16px; padding: 4px 8px; cursor: pointer; color: var(--muted); }
.genre-select { min-height: 36px; padding: 0 30px 0 12px; border-radius: 999px; border: 1px dashed var(--muted); background: var(--surface); font: 600 13px var(--ui); color: var(--accent); cursor: pointer; width: auto; max-width: 100%; }
.genre-select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .book-extra .muted { display: none; } }

/* Follow */
.follow-chip { margin-left: 8px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font: 600 12px var(--ui); cursor: pointer; vertical-align: 1px; }
.follow-chip.on { background: var(--accent-tint); border-color: transparent; }
.follow-list { display: flex; flex-direction: column; }
.follow-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.follow-row b { display: block; font-family: var(--display); font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn svg { width: 15px; height: 15px; vertical-align: -2px; stroke: currentColor; }

/* Owner copies — only the owner ever sees these */
.owner-btn { display: block; width: 100%; margin-top: 8px; padding: 9px 12px; border-radius: var(--r-btn); border: 1px dashed var(--accent); background: var(--accent-tint); color: var(--accent-deep); font: 600 13px var(--ui); cursor: pointer; }
.owner-btn:hover { background: #cddadb; }

/* Share sheet + photo cropper (bottom sheet on phones, centred card on wider screens) */
.share-sheet, .crop-sheet { position: fixed; inset: 0; z-index: 80; background: rgba(46,36,32,0.45); display: flex; align-items: flex-end; justify-content: center; }
.share-sheet .sheet, .crop-sheet .sheet { background: var(--surface); color: var(--ink); width: 100%; max-width: 460px; border-radius: 16px 16px 0 0; padding: 18px 20px 24px; box-shadow: 0 -10px 40px rgba(46,36,32,0.25); }
@media (min-width: 700px) { .share-sheet, .crop-sheet { align-items: center; } .share-sheet .sheet, .crop-sheet .sheet { border-radius: 16px; } }
.share-link { display: flex; gap: 8px; margin-bottom: 16px; }
.share-link input { flex: 1; min-width: 0; padding: 0 12px; min-height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--ground); font: 13px var(--ui); color: var(--muted); }
.share-link .btn { white-space: nowrap; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.share-grid a, .share-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 500 12px var(--ui); color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 4px 0; border-radius: 10px; }
.share-grid a:hover, .share-grid button:hover { background: var(--ground); }
.share-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-deep); display: grid; place-items: center; font: 700 17px var(--ui); }
.share-ico svg { width: 20px; height: 20px; stroke: currentColor; }
.crop-stage { position: relative; overflow: hidden; margin: 0 auto; border-radius: 12px; background: #1d1714; touch-action: none; cursor: grab; outline-offset: 3px; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 50%; top: 50%; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(20,14,12,0.55); border: 2px solid rgba(255,255,255,0.85); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 16px auto 18px; max-width: 300px; color: var(--muted); font: 600 16px var(--ui); }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
@media (max-width: 560px) {
  .seg.lib-seg { overflow-x: auto; scrollbar-width: none; }
  .seg.lib-seg::-webkit-scrollbar { display: none; }
  .seg.lib-seg button { flex: none; white-space: nowrap; padding: 0 14px; }
}

/* Admin › Books: the book holding a featured slot */
.feature-btn { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.feature-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.feature-btn.on:hover { background: var(--accent-deep); }
.featured-card { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent) inset; }
.feature-tag { display: inline-block; margin: 6px 6px 0 0; padding: 2px 8px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-deep); font: 700 11px var(--ui); letter-spacing: .02em; }
.feature-tag { white-space: nowrap; }
.admin-book > div:nth-child(2) { flex: 1 1 160px; }
@media (max-width: 560px) {
  .admin-book { flex-wrap: wrap; }
  .admin-book > div:last-child { flex: 1 0 100%; justify-content: flex-start !important; }
}

/* Phone tab bar: six tabs, unread badge on Inbox */
@media (max-width: 860px) {
  .tabbar { padding-left: 4px; padding-right: 4px; }
  .tabbar a { min-width: 0; position: relative; font-size: 10.5px; }
  .tabbar a .badge { position: absolute; top: -4px; left: 50%; margin-left: 6px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--warn); color: #fff; font: 700 10px/17px var(--ui); text-align: center; }
}
.admin-card { color: inherit; text-decoration: none; align-items: center; }
.admin-card svg { width: 22px; height: 22px; stroke: var(--accent); }
/* Book "more" menu */
.menu-list { display: flex; flex-direction: column; margin-top: 6px; }
.menu-list button, .menu-list a { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; font: 500 15px var(--ui); color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.menu-list button:last-child { border-bottom: 0; }
.menu-list svg { width: 20px; height: 20px; stroke: currentColor; flex: none; color: var(--muted); }
.menu-list .danger { color: var(--warn); }
.menu-list .danger svg { color: var(--warn); }
.report-reasons label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); font: 14px var(--ui); cursor: pointer; }
.report-reasons label small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.report-reasons input { margin-top: 3px; accent-color: var(--accent); }
.sheet textarea.report-detail { width: 100%; min-height: 80px; margin: 12px 0; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--ground); font: 14px var(--ui); color: var(--ink); resize: vertical; box-sizing: border-box; }
.share-sheet .sheet { max-height: 88vh; overflow: auto; }
.chapter-list button[aria-current] { font-weight: 700; }
.chapter-list button[aria-current] .idx { color: var(--accent); }
.reader .progress .row { gap: 10px; }
.reader .progress .ch { text-align: right; }
.name-check.ok { color: var(--accent); font-weight: 600; }
.name-check.bad { color: var(--warn); font-weight: 600; }
.review.mine { border-color: var(--accent); }
.rev-diff { margin: 4px 0 10px; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.revision-item { border-color: var(--accent); }
.preview-text { max-height: 60vh; overflow: auto; font-family: var(--reading); font-size: 16px; line-height: 1.65; }
.preview-text h3 { font-family: var(--display); margin: 0 0 10px; }
.audio-howto { padding: 14px 16px; border-radius: var(--r-card); background: var(--accent-tint); color: var(--accent-deep); font-size: 13.5px; line-height: 1.5; }
.audio-howto ol { margin: 6px 0 6px; padding-left: 20px; }
.audio-howto li { margin: 3px 0; }
.audio-howto code { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(255,255,255,.55); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.audio-howto small { color: var(--accent-deep); opacity: .85; }
/* Sign-in: password field with Show/Hide, and the big code box */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 58px; min-width: 0; }
.pw-wrap .link-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; }
.code-input { font: 600 26px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: .3em; text-align: center; }

/* Publish form: the Submit button stays clickable (it says what's missing) but looks muted until the form is complete. */
.btn[aria-disabled="true"] { opacity: .55; }
.btn[aria-busy="true"] { opacity: .8; cursor: progress; }

/* Two books in the home fan: lean them toward each other instead of the three-book layout. */
.home-fan.n2 .cover-btn:nth-child(1) { transform: rotate(-6deg) translate(12px, 6px); z-index: 1; }
.home-fan.n2 .cover-btn:nth-child(2) { transform: rotate(6deg) translate(-12px, 0); z-index: 2; }
.home-fan.n2 .cover-btn:hover { transform: translateY(-14px) scale(1.06); z-index: 4; }

/* Admin › Import: storage meters and the per-book log. */
.meter { display: grid; gap: 5px; font-size: 13px; }
.meter .track { height: 8px; border-radius: 99px; background: var(--line, rgba(46,36,32,.12)); overflow: hidden; }
.meter .fill { height: 100%; border-radius: 99px; background: var(--accent); min-width: 2px; }
.meter .fill.warn { background: var(--warn); }
.meter small { color: var(--muted); font-size: 12px; }
.import-log { display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.import-log:empty { display: none; }
.import-row { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: rgba(46,36,32,.04); font-size: 13.5px; }
.import-row .st { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.import-row.failed .st { color: var(--warn); } .import-row.skipped .st { color: var(--muted); }
.import-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
@media (max-width: 520px) { .import-row { grid-template-columns: 1fr; gap: 2px; } }
.btn[hidden] { display: none !important; }

/* Browse: genre buttons, with the rest of the genres in a "More" menu (a real select laid over the chip, so it opens the device's own picker) */
.genre-bar .chip { min-height: 34px; padding: 0 13px; font-size: 13px; }
.genre-bar .more-chip { position: relative; gap: 6px; cursor: pointer; }
.genre-bar .more-chip select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.genre-bar .more-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.genre-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 20px 16px; }
.genre-grid .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }

/* Reader: read aloud */
.reader .chrome button[aria-pressed="true"] { color: var(--r-btn); }
.reader p.para.speaking { background: color-mix(in srgb, var(--r-btn) 13%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--r-btn) 13%, transparent); border-radius: 3px; }
.reader .listen-bar { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--r-line); background: var(--r-card); }
.reader .listen-bar button { background: none; border: 0; color: inherit; width: 40px; height: 40px; flex: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.reader .listen-bar button svg { width: 18px; height: 18px; stroke: currentColor; }
.reader .listen-bar button.flip svg { transform: rotate(180deg); }
.reader .listen-bar button.main { background: var(--r-btn); color: var(--r-btn-fg); width: 44px; height: 44px; }
.reader .listen-bar button.main.busy { opacity: .6; }
.reader .listen-bar .pick { min-width: 0; }
.reader .listen-bar .pick.grow { flex: 1; }
.reader .listen-bar select { width: 100%; min-height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--r-line); background: var(--r-bg); color: var(--r-fg); font: 600 13px var(--ui); }
.reader .listen-bar button:focus-visible, .reader .listen-bar select:focus-visible { outline: 2px solid var(--r-btn); outline-offset: 2px; }
