/* Inner pages: library, book, tropes, submit, auth, TBR */

.crumbs { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 24px; }
.crumbs a:hover { color: var(--text); }
.head-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn-block { width: 100%; }

/* ─── Library filters ────────────────────────────────────────────────────────── */
.filters { padding: 20px; margin-bottom: 32px; }
.filter-grid { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 960px) { .filter-grid { grid-template-columns: 1fr 1fr; } .filter-search { grid-column: 1 / -1; } }
@media (max-width: 520px) { .filter-grid { grid-template-columns: 1fr; } }
.active-filters { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.active-filters .chips { align-items: center; }
.results-head h2 { font-size: 1.3rem; }
.sort-form select { min-width: 160px; }

/* ─── Book page ──────────────────────────────────────────────────────────────── */
.book-page { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 48px; align-items: start; }
@media (max-width: 760px) { .book-page { grid-template-columns: 1fr; gap: 24px; } .book-cover { max-width: 220px; } }
.book-cover { position: sticky; top: calc(var(--nav-h) + 24px); }
@media (max-width: 760px) { .book-cover { position: static; } }
.book-cover .cover { border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.byline { font-size: 1.15rem; color: var(--text-dim); margin-top: 6px; }
.facts { color: var(--text-muted); font-size: 0.92rem; margin-top: 4px; }
.spice-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--text-dim); font-size: 0.95rem; }
.spice-row .spice i { width: 11px; height: 11px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.ext-links { margin-top: 16px; color: var(--text-dim); font-size: 0.95rem; }
.tw-box { margin-top: 20px; background: var(--gold-soft); border: 1px solid rgba(201, 168, 76, 0.35); border-radius: var(--radius); padding: 12px 16px; }
.tw-box summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.tw-box summary::-webkit-details-marker { display: none; }
.tw-box[open] summary .hint { visibility: hidden; }
.tw-box .tw-count { font-size: 0.95rem; }
.tw-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tw-list li { border: 1px solid rgba(201, 168, 76, 0.4); color: var(--gold); border-radius: 999px; padding: 3px 11px; font-size: 0.85rem; }
.sub-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin: 32px 0 10px; }
.synopsis p { color: var(--text-dim); margin-bottom: 12px; max-width: 68ch; }
.trope-votes { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 14px 0 20px; }
.trope-votes li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 6px 6px 14px; }
.trope-votes a:hover { color: var(--accent-text); }
.related { margin-top: 72px; }

/* ─── Tropes ─────────────────────────────────────────────────────────────────── */
.trope-group { margin-bottom: 48px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.trope-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.trope-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; transition: border-color 0.15s; }
.trope-card:hover { border-color: var(--accent); }
.trope-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.trope-desc { color: var(--text-dim); font-size: 0.9rem; line-height: 1.45; }
.trope-count { color: var(--text-muted); font-size: 0.82rem; margin-top: auto; padding-top: 6px; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.book-form fieldset { margin-bottom: 24px; }
.more-fields summary { cursor: pointer; color: var(--text-dim); font-weight: 500; font-size: 0.92rem; min-height: 32px; }
.more-fields[open] summary { margin-bottom: 14px; }
.scanner { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; }
.scanner video { width: 100%; max-height: 300px; object-fit: cover; border-radius: 8px; background: #000; margin-bottom: 12px; display: block; }
.lookup-preview { display: flex; gap: 14px; align-items: center; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 18px; }
.lookup-preview img { width: 56px; border-radius: 4px; }
.done { text-align: center; padding-top: 40px; }
.done .page-sub { margin: 12px auto 0; }
.done-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* ─── Auth ───────────────────────────────────────────────────────────────────── */
.auth { max-width: 460px; }
.auth .page-title { font-size: 2rem; }
.auth .page-sub { margin-bottom: 24px; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--text-dim); font-size: 0.92rem; }

/* ─── TBR ────────────────────────────────────────────────────────────────────── */
.empty-card { text-align: center; }
.empty-card p { color: var(--text-dim); margin-bottom: 18px; }
.tbr-group { margin-bottom: 40px; }
.tbr-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tbr-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 10px 10px; }
.tbr-cover { border-radius: 6px; }
.tbr-cover .ph { font-size: 0.6rem; padding: 4px; }
.tbr-info { min-width: 0; }
.tbr-info .book-title { display: block; }
.tbr-info .book-title:hover { color: var(--accent-text); }
.tbr-info .meta { padding-top: 4px; }
.tbr-actions { display: flex; align-items: center; gap: 8px; }
.tbr-actions select { min-width: 130px; padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 600px) {
  .tbr-item { grid-template-columns: 48px 1fr; }
  .tbr-actions { grid-column: 1 / -1; justify-content: space-between; }
}

/* Cover link + live preview */
.cover-field { display: grid; grid-template-columns: 84px 1fr; gap: 16px; align-items: start; }
.cover-preview { border-radius: 6px; }
.cover-preview .ph { font-size: 0.7rem; padding: 6px; }

/* Kindle link on book pages */
.kindle { margin-top: 20px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.btn-kindle { background: var(--gold); color: #1a1408; }
.btn-kindle:hover { background: #d8b85c; }
.kindle .hint { margin-top: 10px; }
.kindle .disclosure-note { margin-top: 4px; font-size: 0.78rem; }
