body.public-site--book-ebook { background: #e9ede8; color: #343b30; }
body.public-site--book-ebook .public-site__page { width: 100%; max-width: 720px; margin: 0 auto; background: #fbfaf6; }
.book-ebook { width: 100%; max-width: none; margin: 0; display: flex; flex-direction: column; min-height: 100svh; padding-top: env(safe-area-inset-top, 0px); padding-bottom: 0; color: #343b30; }
.book-ebook__heading { width: calc(100% - 32px); max-width: 720px; margin-inline: auto; display: flex; align-items: center; gap: 12px; padding: 12px 0 20px; }
.book-ebook__heading h1 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; line-height: 1.5; color: #73796d; }
.book-ebook__back { display: inline-flex; flex: 0 0 44px; align-items: center; justify-content: center; min-height: 44px; margin-left: -10px; border-radius: 50%; color: #59634f; text-decoration: none; }
.book-ebook__back:hover { background: #eef0e7; color: #315139; }
.book-ebook__back:focus-visible { outline: 2px solid #527452; outline-offset: 3px; }
.book-ebook__initial { width: 100%; max-width: 720px; margin-inline: auto; flex: 1; padding: 20px 16px 32px; }
.book-ebook__initial h2 { margin: 0 0 24px; font-size: 18px; line-height: 1.6; }
.book-ebook__initial > p { margin: 28px 0 0; text-align: center; color: #84877b; font-size: 12px; }
.book-ebook .book-reader { padding: 0; background: transparent; border-radius: 0; }
.book-ebook .book-reader__spread { width: 100%; max-width: none; margin: 0; box-shadow: none; }
.book-ebook .book-reader__paper { background: #fbfaf6; }
.book-ebook .book-reader__position { display: none; }
.book-ebook__viewer { min-width: 0; flex: 1; }
.book-ebook__text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--font-size-body-lg); line-height: var(--line-height-reading); }
.book-ebook__error { padding: 24px 0; color: #8d3930; line-height: 1.7; }
.book-ebook .book-reader__toolbar { display: none; }

.book-ebook__loading { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: linear-gradient(#fbfaf6, #fbfaf6) center / min(100%, 720px) 100% no-repeat, #e9ede8; }
.book-ebook__loading[hidden] { display: none; }
.book-ebook__spinner { width: 30px; height: 30px; border: 2px solid #dde4d6; border-top-color: #627f55; border-radius: 50%; animation: ebook-loading-spin 1s linear infinite; }
.book-ebook__loading-text { font-size: 13px; color: #6f7c65; letter-spacing: .02em; }
@keyframes ebook-loading-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .book-ebook__spinner { animation: none; }
}

.book-ebook__help, .book-ebook__help-close, .book-ebook__page-toggle { display: inline-flex; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; color: #65735a; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.book-ebook__help:hover, .book-ebook__help-close:hover, .book-ebook__page-toggle:hover:not(:disabled) { background: #eef0e7; }
.book-ebook__page-toggle:focus-visible, .book-ebook__help:focus-visible, .book-ebook__help-close:focus-visible, .book-ebook__help-confirm:focus-visible { outline: 2px solid #527452; outline-offset: 3px; }
.book-ebook__help-dialog { width: min(420px, calc(100% - 40px)); max-height: calc(100dvh - 48px); margin: auto; padding: 24px; border: 0; border-radius: 16px; color: #343b30; background: #fbfaf6; overflow-y: auto; box-shadow: 0 16px 60px #24312626; }
.book-ebook__help-dialog::backdrop { background: #28302466; }
.book-ebook__help-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.book-ebook__help-heading h2 { margin: 0; font-size: 19px; }
.book-ebook__help-close { font-size: 26px; }
.book-ebook__help-dialog > p { margin: 8px 0 20px; color: #73796d; font-size: 14px; }
.book-ebook__help-dialog ul { margin: 0 0 24px; padding-left: 20px; font-size: 14px; line-height: 1.8; }
.book-ebook__help-dialog li + li { margin-top: 12px; }
.book-ebook__help-confirm { width: 100%; min-height: 44px; border: 0; border-radius: 8px; color: #fff; background: #315139; cursor: pointer; font: inherit; font-size: 14px; }
.book-ebook__help-confirm:hover { background: #25442d; }

.book-ebook__breadcrumb { width: calc(100% - 32px); max-width: 720px; margin: -8px auto 16px; color: #858b7f; }
.book-ebook__breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 0; padding: 0; list-style: none; }
.book-ebook__breadcrumb li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font-size: 11px; line-height: 1.6; }
.book-ebook__breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.book-ebook__breadcrumb a:hover { color: #315139; }
.book-ebook__breadcrumb a[aria-current="page"] { color: #59664f; }
.book-ebook__breadcrumb a:focus-visible { outline: 2px solid #527452; outline-offset: 3px; }

.book-ebook__help { position: fixed; z-index: 20; right: max(16px, calc((100vw - 720px) / 2 + 16px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); border: 1px solid #d9dfd1; background: #fbfaf6; box-shadow: 0 3px 14px #24312614; }
.book-ebook__page-toggle:disabled { opacity: .4; cursor: wait; }
.book-ebook__page-toggle { position: fixed; z-index: 20; left: max(16px, calc((100vw - 720px) / 2 + 16px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); border: 1px solid #d9dfd1; background: #fbfaf6; box-shadow: 0 3px 14px #24312614; }
.book-ebook__selection-toggle { position: fixed; z-index: 20; left: max(68px, calc((100vw - 720px) / 2 + 68px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid #d9dfd1; border-radius: 50%; background: #fbfaf6; color: #65735a; box-shadow: 0 3px 14px #24312614; cursor: pointer; }
.book-ebook__selection-toggle:hover:not(:disabled) { background: #eef0e7; }
.book-ebook__selection-toggle[aria-pressed="true"], .book-ebook__selection-toggle[aria-pressed="true"]:hover { border-color: #e5d38b; background: #fff1ae; color: #6c5e25; }
.book-ebook__selection-toggle:focus-visible { outline: 2px solid #527452; outline-offset: 3px; }
.book-ebook__selection-toggle:disabled { opacity: .4; cursor: wait; }
.book-ebook .book-reader--text-select .book-reader__spread { user-select: text; -webkit-user-select: text; cursor: text; }
.book-ebook .book-reader--text-select ::selection { background: #fff1ae; color: #343b30; }
.book-ebook__page-sheet { position: fixed; inset: auto 0 0; width: min(100%, 720px); max-width: none; max-height: none; margin: 0 auto; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: #fbfaf6; color: #343b30; overflow: hidden; }
.book-ebook__page-sheet::backdrop { background: #28302466; }
.book-ebook__page-panel { display: flex; flex-direction: column; height: min(88dvh, 760px); padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
.book-ebook__page-handle { flex: 0 0 4px; width: 38px; margin: 0 auto 16px; border-radius: 4px; background: #d4dacf; }
.book-ebook__page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.book-ebook__page-heading h2 { margin: 0; font-size: 19px; }
.book-ebook__page-heading p { margin: 6px 0 0; color: #7b8572; font-size: 12px; }
.book-ebook__pages { display: grid; flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: start; gap: 10px; min-height: 0; margin: 0; padding: 2px 4px 4px 2px; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.book-ebook__pages button { display: flex; align-items: center; gap: 7px; min-width: 0; text-align: left; width: 100%; min-height: 46px; padding: 8px; border: 1px solid #e2e6da; border-radius: 8px; background: #f1f3eb; color: #56634c; font: inherit; font-size: 13px; cursor: pointer; }
.book-ebook__pages button:hover { border-color: #9db493; background: #e8eede; }
.book-ebook__pages button[aria-pressed="true"] { border-color: #315139; background: #315139; color: #fffdf4; font-weight: 700; }
.book-ebook__pages button:focus-visible { outline: 2px solid #527452; outline-offset: 2px; }

.book-ebook__pages button[aria-current="page"] { box-shadow: inset 0 0 0 1px #315139; }
.book-ebook__page-preview { display: grid; flex: 0 0 auto; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 20px; margin-bottom: 20px; }
.book-ebook__preview-paper { width: 96px; overflow: hidden; border: 1px solid #e1e4da; border-radius: 4px; box-shadow: 0 3px 8px #2431260c; pointer-events: none; }
.book-ebook__preview-copy { min-width: 0; }
.book-ebook__preview-copy > p:first-child { margin: 0 0 8px; color: #859078; font-size: 11px; }
.book-ebook__preview-copy > strong { color: #315139; font-size: 18px; }
.book-ebook__preview-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 10px 0 0; color: #7a826f; font-size: 12px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.book-ebook__page-footer { flex: 0 0 auto; padding-top: 16px; }
.book-ebook__page-footer button { width: 100%; min-height: 46px; border: 0; border-radius: 10px; background: #315139; color: #fffdf4; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.book-ebook__page-footer button:hover:not(:disabled) { background: #25442d; }
.book-ebook__page-footer button:disabled { opacity: .45; cursor: default; }
.book-ebook__page-footer button:focus-visible { outline: 2px solid #527452; outline-offset: 3px; }
@media (max-height: 600px) {
    .book-ebook__page-preview { grid-template-columns: 60px minmax(0, 1fr); gap: 14px; margin-bottom: 12px; }
    .book-ebook__preview-paper { width: 60px; }
    .book-ebook__page-heading { margin-bottom: 12px; }
    .book-ebook__page-handle { margin-bottom: 10px; }
    .book-ebook__preview-excerpt { -webkit-line-clamp: 2; }
}

.book-ebook__page-number { flex: 0 0 auto; font-size: 12px; font-weight: 700; }
.book-ebook__page-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; opacity: .75; font-size: 10px; }
.book-ebook__preview-type { display: inline; margin-left: 8px; color: #7a826f; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
@media (max-width: 540px) {
    .book-ebook__pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
