.book-page { max-width: 960px; }
.book-overview { display: grid; grid-template-columns: minmax(112px, 35%) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 20px; align-items: start; }
.book-cover { grid-row: 1 / 3; }
.book-cover img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 4px; }
.book-heading h1 { margin: 0 0 16px; font: 400 30px/1.15 Georgia, 'Times New Roman', serif; overflow-wrap: anywhere; text-wrap: balance; }
.book-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border-radius: 5px; background: var(--surface); font-size: 12px; line-height: 1.3; }
.badge-dark { background: var(--text); color: var(--page); }
.book-meta { margin: 5px 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.book-actions { align-self: end; display: grid; gap: 8px; margin-top: 20px; }
.book-actions .button { width: 100%; gap: 10px; padding-inline: 12px; font-size: 13px; border: 1px solid var(--text); }
.button-outline { background: var(--page); color: var(--accent); border: 1px solid var(--outline-border) !important; }
.button-outline:hover { background: var(--surface); }
.button-disabled { background: var(--surface); color: var(--muted); border-color: var(--line) !important; }
.library-status { margin: 0; font-size: 12px; line-height: 1.5; }
.book-synopsis { margin-top: 30px; }
.book-synopsis h2 { margin: 0 0 16px; font: 400 28px/1.2 Georgia, 'Times New Roman', serif; }
.synopsis-copy { max-width: 70ch; font: 17px/1.8 Georgia, 'Times New Roman', serif; }
.synopsis-copy p { margin: 0 0 16px; }
.synopsis-copy.is-collapsed { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 0; padding: 8px 0; background: none; font-size: 13px; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.text-button[aria-expanded="true"] .icon { transform: rotate(180deg); }
.book-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 12px 0 24px; }
.book-tags li { background: var(--surface); padding: 7px 9px; border-radius: 4px; font-size: 12px; line-height: 1.3; }
.tab-list { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.tab-list button { padding: 16px 8px; min-height: 52px; border: 0; border-bottom: 2px solid transparent; background: var(--page); font-size: 14px; color: var(--muted); }
.tab-list button[aria-selected="true"] { border-color: var(--text); color: var(--text); font-weight: 600; }
.chapter-list { margin: 0; padding: 0; list-style: none; }
.chapter-row { display: flex; align-items: center; gap: 16px; min-height: 84px; border-bottom: 1px solid var(--line); padding: 16px 0; }
.chapter-row:hover { text-decoration: none; background: var(--hover-surface); }
.chapter-number { color: var(--muted); font-size: 12px; flex: 0 0 20px; font-variant-numeric: tabular-nums; }
.chapter-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.chapter-title { font-size: 14px; line-height: 1.5; }
.chapter-meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.chapter-access { display: flex; align-items: center; flex: none; gap: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.book-facts { font-size: 14px; }
.book-facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.book-facts dt { color: var(--muted); }
.book-facts dd { margin: 0; }
.bottom-nav { display: none; }
.hero-slider { background: var(--hero-bg); color: var(--hero-text); margin-bottom: 32px; border-radius: 6px; overflow: hidden; --focus: var(--hero-text); }
.hero-slide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 32%); gap: 40px; align-items: center; min-height: 380px; padding: 36px 7% 12px; }
.hero-copy { max-width: 540px; }
.hero-copy h2 { margin: 0 0 16px; font: 400 clamp(30px, 3.2vw, 46px)/1.12 Georgia, 'Times New Roman', serif; text-wrap: balance; }
.hero-copy p { color: var(--hero-muted); font-size: 16px; line-height: 1.6; margin: 0 0 24px; }
.hero-copy .button { color: var(--hero-button-text); background: var(--hero-button-bg); gap: 12px; }
.hero-copy .button:hover { background: var(--hero-button-hover); }
.hero-cover { display: block; max-width: 225px; justify-self: center; width: 100%; }
.hero-cover img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 4px; }
.hero-controls { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 16px 12px; }
.hero-controls .icon-button { color: var(--hero-text); }
.hero-controls .icon-button:hover { background: var(--hero-control-hover); }
.hero-dots { display: flex; }
.hero-dots button { display: grid; place-items: center; width: 36px; height: 44px; background: none; padding: 0; border: 0; }
.hero-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--hero-dot); }
.hero-dots [aria-current="true"] span { background: var(--hero-text); width: 20px; border-radius: 8px; }
.reader-header { padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.reader-header a { font: 14px/1.5 Arial, sans-serif; text-decoration: underline; }
.reader-header h1 { margin-top: 24px; }
.reader-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; font: 14px/1.5 Arial, sans-serif; }
.reader-nav a { display: flex; align-items: center; min-height: 44px; text-decoration: underline; }
.locked-chapter { text-align: center; padding: 40px 12px; }
.locked-chapter > .icon { margin: 0 auto 20px; }
.locked-chapter p { color: var(--muted); }
@media (max-width: 640px) {
    .book-page { padding: 24px 16px 104px; }
    .book-overview { gap: 16px; grid-template-columns: 35% minmax(0, 1fr); }
    .book-heading h1 { font-size: 24px; margin-bottom: 12px; }
    .book-badges { margin-bottom: 10px; }
    .book-meta { font-size: 12px; }
    .book-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; margin-top: 2px; }
    .book-actions .button { font-size: 12px; gap: 6px; padding-inline: 8px; }
    .book-cover { grid-row: 1; }
    .library-status { grid-column: 1 / -1; }
    .book-synopsis { margin-top: 28px; }
    .book-synopsis h2 { font-size: 26px; }
    .synopsis-copy { font-size: 16px; }
    .chapter-row { gap: 10px; }
    .chapter-title { font-size: 13px; }
    .chapter-access { font-size: 11px; gap: 4px; }
    .hero-slide { grid-template-columns: minmax(0, 1fr) 34%; gap: 16px; min-height: 268px; padding: 24px 20px 8px; }
    .hero-copy h2 { font-size: 27px; margin-bottom: 12px; }
    .hero-copy p { font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
    .hero-copy .button { font-size: 12px; padding: 10px 12px; gap: 6px; }
    .hero-slider { margin-bottom: 28px; }
}
@media (min-width: 641px) { .book-overview { grid-template-columns: 240px minmax(0, 1fr); gap: 0 32px; } .book-heading h1 { font-size: 38px; } .book-actions { max-width: 360px; } }
@media (max-width: 900px) {
    body:has(.bottom-nav) { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
    .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; border-top: 1px solid var(--line); background: var(--page); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
    .bottom-nav a { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; font-size: 11px; line-height: 1.2; color: var(--muted); }
    .bottom-nav a[aria-current="page"] { color: var(--text); font-weight: 700; }
    .bottom-nav a:hover { text-decoration: none; color: var(--text); }
}
.book-metrics { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.book-metrics > span { display: inline-flex; align-items: center; gap: 5px; }
.book-chapter-container { margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.chapter-list-summary { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.book-chapter-container .chapter-list { display: grid; gap: 6px; }
.book-chapter-container .chapter-row { min-height: 52px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--page); }
.book-chapter-container .chapter-row:hover { border-color: var(--muted); }
.book-chapter-container .chapter-number { flex-basis: 3ch; }
.book-chapter-container .chapter-title { overflow-wrap: anywhere; }
@media (max-width: 640px) { .book-chapter-container { padding: 10px; } .book-chapter-container .chapter-row { gap: 8px; padding: 10px; } }

.chapter-filters { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.chapter-search { display: flex; align-items: center; flex: 1; min-width: 0; border: 1px solid var(--input-border, #767676); border-radius: 6px; background: var(--page); }
.chapter-search input { width: 100%; min-width: 0; height: 42px; padding: 10px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: 14px Arial, Helvetica, sans-serif; }
.chapter-search input::placeholder { color: var(--muted); opacity: 1; }
.chapter-search button { display: grid; place-items: center; flex: 0 0 44px; min-height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; }
.chapter-sort { flex: 0 0 auto; }
.chapter-sort select { min-height: 46px; max-width: 100%; padding: 8px 10px; border: 1px solid var(--input-border, #767676); border-radius: 6px; background: var(--page); color: var(--text); font: 14px Arial, Helvetica, sans-serif; }
.chapter-list-scroll { position: relative; max-height: 340px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--muted) transparent; scrollbar-gutter: stable; padding: 2px 4px 2px 2px; }
.chapter-search input:focus-visible, .chapter-search button:focus-visible, .chapter-sort select:focus-visible, .chapter-list-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.book-chapter-container .chapter-title { font-size: 13px; }
@media (max-width: 640px) { .chapter-filters { gap: 8px; } .chapter-search input { font-size: 16px; } .chapter-sort select { font-size: 16px; } .chapter-list-scroll { max-height: 300px; } }
.hero-controls { flex-wrap: wrap; }
.hero-dots { flex-wrap: wrap; justify-content: center; max-width: min(100%, 360px); }
.hero-slide { position: relative; isolation: isolate; }
.hero-background { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero-background img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-background::after { content: ""; position: absolute; inset: 0; background: var(--hero-overlay); box-shadow: var(--hero-image-shadow, inset 0 0 64px rgb(0 0 0 / 50%)); }
.hero-background ~ .hero-copy h2, .hero-background ~ .hero-copy p { text-shadow: var(--hero-text-shadow, 0 2px 12px rgb(0 0 0 / 65%)); }
