/* Library-only presentation: shared data, catalogue routes and pagination stay in the page. */
.bth-library .bth-library-section { display: grid; gap: 20px; min-width: 0; }
.bth-library .bth-library-section + .bth-library-section { margin-top: 30px; }
.bth-library .bth-library-list-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; min-width: 0; }
.bth-library .bth-library-list-heading h2 { margin: 0; color: var(--bth-muted); font-family: var(--bth-font-body); font-size: 13px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.bth-library .bth-library-support-heading h2 { margin: 0; color: var(--bth-ink); font-family: var(--bth-font-display); font-size: 23px; font-weight: 550; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
.bth-library .bth-library-sort { position: relative; display: block; flex: none; max-width: 100%; }
.bth-library .bth-library-sort::after { position: absolute; content: ""; width: 7px; height: 7px; right: 15px; top: 19px; border-right: 1.5px solid var(--bth-muted); border-bottom: 1.5px solid var(--bth-muted); transform: rotate(45deg); pointer-events: none; }
.bth-library .bth-library-sort select { appearance: none; height: 48px; min-height: 48px; max-width: 100%; padding: 9px 34px 9px 12px; border: 1px solid var(--bth-line); border-radius: 10px; background: var(--bth-surface); color: var(--bth-muted); font: inherit; font-size: 16px; cursor: pointer; }
.bth-library .bth-library-card { display: block; align-self: start; width: 100%; min-width: 0; min-height: 48px; padding: 0; border: 0; border-radius: 13px; background: transparent; color: var(--bth-ink); font: inherit; text-align: left; cursor: pointer; }
.bth-library .bth-library-cover { aspect-ratio: 1.16; border-radius: 13px; background: var(--bth-paper-deep); }
.bth-library .bth-library-cover-fallback { background: var(--bth-paper-deep); }
.bth-library .bth-library-cover-art { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0; }
.bth-library .bth-library-card-copy { display: block; padding: 10px 1px 0; }
.bth-library .bth-library-card-type { display: block; margin-bottom: 6px; color: var(--bth-clay); font-size: 10.5px; line-height: 1.5; letter-spacing: .055em; text-transform: uppercase; overflow-wrap: anywhere; }
.bth-library .bth-library-card-title { display: block; font-family: var(--bth-font-display); font-weight: 550; font-size: 19px; line-height: 1.24; letter-spacing: -.015em; overflow-wrap: anywhere; }
.bth-library .bth-library-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 7px; color: var(--bth-muted); font-size: 12px; line-height: 1.5; }
.bth-library .bth-library-card-meta > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.bth-library .bth-library-card-meta svg { width: 15px; height: 15px; flex: none; }
.bth-library .bth-library-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; padding: 40px 16px; color: var(--bth-muted); text-align: center; }
.bth-library .bth-library-empty > svg { width: 38px; height: 38px; color: var(--bth-clay); }
.bth-library .bth-library-empty p { margin: 0; max-width: 440px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.bth-library .bth-library-empty .bth-library-empty-hint { font-size: 12px; }
.bth-library .bth-library-action, .bth-library .bth-library-load-more { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 48px; max-width: 100%; padding: 11px 18px; border: 1px solid var(--bth-line); border-radius: 13px; background: transparent; color: var(--bth-ink); font: inherit; font-size: 13px; line-height: 1.5; cursor: pointer; }
.bth-library .bth-library-action { background: var(--bth-plum); color: var(--bth-on-plum); border-color: transparent; }
.bth-library .bth-library-action svg { width: 18px; height: 18px; flex: none; }
.bth-library .bth-library-load-more { width: 100%; margin-top: 4px; }
.bth-library .bth-library-load-more:disabled { opacity: .65; cursor: wait; }
.bth-library .bth-library-support-heading p { margin: 8px 0 0; color: var(--bth-muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.bth-library .bth-library-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.bth-library .bth-library-card:focus-visible, .bth-library .bth-library-sort select:focus-visible, .bth-library .bth-library-action:focus-visible, .bth-library .bth-library-load-more:focus-visible { outline: 3px solid var(--bth-plum); outline-offset: 5px; }

@media (min-width: 761px) and (pointer: fine), (min-width: 1025px) {
    .bth-library .bth-library-cover { aspect-ratio: 1.32; border-radius: 16px; }
    .bth-library .bth-library-card { border-radius: 16px; }
    .bth-library .bth-library-card-copy { padding-top: 13px; }
    .bth-library .bth-library-card-title { font-size: 20px; line-height: 1.22; }
    .bth-library .bth-library-list-heading h2 { font-size: 14px; }
    .bth-library .bth-library-support-heading h2 { font-size: 25px; }
}
@media (hover: hover) {
    .bth-library .bth-library-card:hover .bth-library-card-title { color: var(--bth-plum); }
    .bth-library .bth-library-load-more:not(:disabled):hover { background: var(--bth-surface-soft); }
}
@media (prefers-reduced-motion: reduce) {
    .bth-library .bth-library-cover .animate-pulse { animation: none; }
    .bth-library .bth-library-cover img { transition: none; }
}

.bth-library .bth-library-chapter-count { color: var(--bth-plum); font-weight: 600; }
.bth-library-series .bth-library-latest-chapter { width: 100%; margin-bottom: 24px; gap: 10px; }
.bth-library-series h3 { margin: 0 0 12px; font-size: 15px; color: var(--bth-muted); }
.bth-library-chapters { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bth-library-chapters button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 14px; border: 1px solid var(--bth-line); border-radius: 16px; background: var(--bth-surface); color: var(--bth-ink); text-align: left; font: inherit; cursor: pointer; }
.bth-library-chapter-number { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 50%; background: var(--bth-paper-deep); color: var(--bth-plum); font-weight: 600; }
.bth-library-chapter-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
.bth-library-chapter-copy strong { font-family: var(--bth-font-display); font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.bth-library-chapter-copy small, .bth-library-chapter-label { color: var(--bth-muted); font-size: 12px; }
.bth-library-chapters button > svg { flex: 0 0 18px; width: 18px; height: 18px; }
.bth-library-chapters button:focus-visible { outline: 3px solid var(--bth-plum); outline-offset: 3px; }
