:root {
    --tb-bg: #1a1a1a;
    --tb-fg: #e5e7eb;
    --tb-hover: #2d2d2d;
    --tb-accent: #3b82f6;
    --tb-accent-2: #2563eb;
    --drawer-w: 320px;
    --drawer-bg: #ffffff;
    --reader-bg: #2a2a2a;
    --bottom-bar-h: 56px;
    --strip-h: 200px;
}

* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: var(--reader-bg);
}
body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR",
        sans-serif;
    color: var(--tb-fg);
}

img {
    user-select: none;
    -webkit-user-drag: none;
}
button {
    font: inherit;
    cursor: pointer;
}

.is-hidden {
    display: none !important;
}

.loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--reader-bg);
    color: var(--tb-fg);
    z-index: 1000;
}
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #444;
    border-top-color: var(--tb-accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.loading-text {
    font-size: 14px;
    opacity: 0.7;
}
.loading .error {
    padding: 24px;
    max-width: 480px;
    background: #2d2d2d;
    border-radius: 8px;
    line-height: 1.6;
    text-align: center;
}

.app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
}

/* TOP TOOLBAR */
.toolbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    background: var(--tb-bg);
    border-bottom: 1px solid #000;
    padding: 6px 12px;
    z-index: 30;
}
.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 4px;
}
.toolbar-right {
    justify-content: flex-end;
}
.toolbar-center {
    display: flex;
    justify-content: center;
}
.book-title {
    font-size: 13px;
    color: var(--tb-fg);
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40vw;
}

.tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--tb-fg);
}
.tool:hover {
    background: var(--tb-hover);
}
.tool:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.tool img {
    width: 18px;
    height: 18px;
    filter: invert(0.95);
    pointer-events: none;
}
.tool.active {
    background: rgba(59, 130, 246, 0.25);
}
.tool.active img {
    filter: invert(0.95) sepia(1) saturate(8) hue-rotate(190deg);
}

/* READER */
.reader-wrap {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--reader-bg);
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
.zoom-wrap {
    width: 100%;
    height: 100%;
    transform-origin: center center;
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* JS sets explicit width/height via setProperty('important') for COVER fit:
   the image fully fills reader-wrap on the constrained axis and overflows
   the other. This overrides PageFlip's inline width:100%. */
.book {
    flex: 0 0 auto;
}
.reader-wrap.zoomed {
    cursor: grab;
}
.reader-wrap.grabbing {
    cursor: grabbing;
}
.reader-wrap.snapping .zoom-wrap {
    transition: transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* HTML-mode pages (no canvas). Each page is a real <div><img></div> styled
   like a paper sheet. PageFlip positions/animates via CSS transforms on .stf__item. */
.book,
.book .stf__parent,
.book .stf__wrapper,
.book .stf__block {
    background: transparent !important;
}
.book .page {
    background: white;
    overflow: hidden;
    box-sizing: border-box;
}
.book .page img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}
.book .stf__item {
    background: white;
}

/* ZOOM BAR (Toast Studio-style, top center) */
.zoom-bar {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.92);
    color: var(--tb-fg);
    border-radius: 999px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 25;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.zb-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 120ms ease;
}
.zb-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}
.zb-btn img {
    width: 16px;
    height: 16px;
    filter: invert(0.95);
    pointer-events: none;
}
.zb-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 160px;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}
.zb-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--tb-accent);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.zb-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--tb-accent);
    cursor: pointer;
}
.zb-value {
    font-size: 12px;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
    min-width: 42px;
    text-align: center;
}
.zb-close {
    width: 32px;
    height: 32px;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 4px;
}
.zb-close:hover {
    background: rgba(255, 255, 255, 0.18);
}
.zb-close img {
    width: 14px;
    height: 14px;
    filter: invert(0.95);
    pointer-events: none;
}

@media (max-width: 600px) {
    .zoom-bar {
        padding: 4px 8px;
        gap: 4px;
    }
    .zb-slider {
        width: 110px;
    }
    .zb-value {
        display: none;
    }
}

/* DRAWERS */
.drawer {
    position: absolute;
    top: 0;
    bottom: var(--bottom-bar-h);
    left: 0;
    width: var(--drawer-w);
    background: var(--drawer-bg);
    color: #111;
    transform: translateX(-100%);
    transition: transform 240ms ease;
    z-index: 40;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
}
.drawer.open {
    transform: translateX(0);
}
.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}
.drawer-head h2 {
    margin: 0;
    font-size: 15px;
}
.drawer-close {
    background: transparent;
    border: 0;
    font-size: 24px;
    line-height: 1;
    padding: 0 4px;
    color: #6b7280;
}
.drawer-close:hover {
    color: #111;
}
.drawer .empty {
    padding: 24px 16px;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
}

.toc-list,
.toc-sub {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: auto;
}
.toc-list {
    padding: 8px 0;
    flex: 1;
}
.toc-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 8px;
    padding: 8px 16px 8px calc(16px + var(--depth, 0) * 16px);
    cursor: pointer;
}
.toc-item:hover {
    background: #f3f4f6;
}
.toc-item a {
    color: #111;
    text-decoration: none;
    font-size: 14px;
}
.toc-page {
    color: #9ca3af;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.toc-sub {
    grid-column: 1 / -1;
    padding-left: 0;
}

.search-input {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}
.search-input input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
}
.search-input input:focus {
    outline: none;
    border-color: var(--tb-accent);
}
.search-results {
    flex: 1;
    overflow: auto;
    padding: 8px 0;
}
.search-hint {
    color: #6b7280;
    font-size: 13px;
    padding: 8px 16px;
    margin: 0;
}
.search-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #f3f4f6;
}
.search-item:hover {
    background: #f9fafb;
}
.search-item-page {
    display: block;
    font-weight: 600;
    color: var(--tb-accent);
    font-size: 12px;
}
.search-item-snippet {
    display: block;
    color: #374151;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 2px;
}
.search-item mark {
    background: #fef08a;
    padding: 0 2px;
}

/* BOOKMARKS */
.bookmark-list {
    flex: 1;
    overflow: auto;
    padding: 8px;
}
.bm-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
    padding: 6px;
    border-radius: 6px;
}
.bm-item:hover {
    background: #f9fafb;
}
.bm-go {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 0;
    padding: 4px;
    text-align: left;
    flex: 1;
    cursor: pointer;
}
.bm-go img {
    width: 44px;
    height: auto;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
}
.bm-go span {
    font-size: 14px;
    color: #111;
}
.bm-del {
    background: transparent;
    border: 0;
    color: #9ca3af;
    font-size: 20px;
    padding: 4px 8px;
    cursor: pointer;
}
.bm-del:hover {
    color: #dc2626;
}

/* NOTES */
.note-list {
    flex: 1;
    overflow: auto;
    padding: 8px;
}
.note-item {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fffdf3;
}
.note-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.note-go {
    background: transparent;
    border: 0;
    color: var(--tb-accent);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.note-go:hover {
    text-decoration: underline;
}
.note-edit {
    background: transparent;
    border: 0;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
}
.note-body {
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
    word-break: break-word;
}

/* BOTTOM BAR */
.bottom-bar {
    flex: 0 0 var(--bottom-bar-h);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 6px 12px;
    background: var(--tb-bg);
    border-top: 1px solid #000;
    z-index: 30;
    position: relative;
}
.bb-left {
    display: flex;
    justify-content: flex-start;
}
.bb-center {
    display: flex;
    align-items: center;
    gap: 6px;
}
.bb-right {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.bb-pageinfo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--tb-hover);
    border-radius: 6px;
    font-size: 13px;
    width: 100px;
}
.bb-pageinfo input {
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: right;
    -moz-appearance: textfield;
}
.bb-pageinfo input::-webkit-outer-spin-button,
.bb-pageinfo input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.bb-pageinfo input:focus {
    outline: none;
}
.bb-sep {
    opacity: 0.6;
}

.bb-menu {
    width: 38px;
    height: 38px;
}

/* MENU POPOVER */
.menu-popover {
    position: absolute;
    bottom: calc(var(--bottom-bar-h) + 8px);
    left: 12px;
    background: white;
    color: #111;
    border-radius: 10px;
    padding: 8px;
    min-width: 220px;
    max-height: 70vh;
    overflow: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    z-index: 60;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}
.menu-popover.open {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.mp-section {
    padding: 4px 0;
}
.mp-section + .mp-section {
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
    padding-top: 8px;
}
.mp-title {
    padding: 4px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    font-weight: 600;
}
.mp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    text-align: left;
    color: #111;
    font-size: 14px;
    cursor: pointer;
}
.mp-item:hover {
    background: #f3f4f6;
}
.mp-item img {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* PAGE STRIP */
.page-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--bottom-bar-h);
    height: var(--strip-h);
    background: rgba(15, 15, 15, 0.96);
    border-top: 1px solid #000;
    display: flex;
    align-items: center;
    transform: translateY(100%);
    transition: transform 250ms ease;
    z-index: 35;
}
.page-strip.open {
    transform: translateY(0);
}
.strip-arrow {
    flex: 0 0 44px;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.strip-arrow:hover {
    background: rgba(0, 0, 0, 0.6);
}
.strip-arrow img {
    width: 20px;
    height: 20px;
    filter: invert(0.95);
}
.strip-scroll {
    flex: 1;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 8px;
    padding: 12px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
    cursor: grab;
    user-select: none;
}
.strip-scroll.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}
.strip-scroll.dragging .strip-page {
    pointer-events: none;
}
.strip-scroll img {
    pointer-events: none;
}
.strip-scroll::-webkit-scrollbar {
    height: 6px;
}
.strip-scroll::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}
.strip-page {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
}
.strip-page:hover {
    border-color: rgba(255, 255, 255, 0.3);
}
.strip-page.active {
    border-color: var(--tb-accent);
}
.strip-page img {
    height: calc(var(--strip-h) - 56px);
    width: auto;
    display: block;
}
.strip-page-n {
    color: white;
    font-size: 11px;
    opacity: 0.85;
}

/* MODAL */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 200ms ease;
}
.modal-backdrop.open {
    opacity: 1;
}
.modal {
    background: white;
    color: #111;
    width: min(440px, 92vw);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(8px);
    transition: transform 200ms ease;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-lg {
    width: min(720px, 96vw);
}
.modal .modal-body {
    overflow: auto;
}
.modal-backdrop.open .modal {
    transform: translateY(0);
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.modal-head h2 {
    margin: 0;
    font-size: 16px;
}
.modal-close {
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    padding: 0 4px;
}
.modal-close:hover {
    color: #111;
}
.modal-body {
    padding: 18px 20px 22px;
}

.share-link {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.share-link input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    color: #111;
    background: #f9fafb;
    min-width: 0;
}
.share-link input:focus {
    outline: none;
    border-color: var(--tb-accent);
    background: white;
}
#share-copy-btn {
    padding: 9px 16px;
    background: var(--tb-accent);
    color: white;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-weight: 500;
}
#share-copy-btn:hover {
    background: var(--tb-accent-2);
}

.share-sns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.sns-btn {
    height: 48px;
    border: 0;
    border-radius: 8px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 100ms ease,
        filter 100ms ease;
}
.sns-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}
.sns-btn:active {
    transform: translateY(0);
}
.sns-twitter {
    background: #000;
}
.sns-facebook {
    background: #1877f2;
}
.sns-linkedin {
    background: #0a66c2;
}
.sns-naver {
    background: #03c75a;
}
.sns-email {
    background: #6b7280;
}
.sns-btn img {
    width: 22px;
    height: 22px;
    filter: invert(0.95);
}

/* Note editor */
.note-page-label {
    color: #6b7280;
    font-size: 13px;
    margin: 0 0 8px;
}
#note-textarea {
    width: 100%;
    resize: vertical;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    line-height: 1.5;
}
#note-textarea:focus {
    outline: none;
    border-color: var(--tb-accent);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}
.btn-primary {
    padding: 9px 18px;
    background: var(--tb-accent);
    color: white;
    border: 0;
    border-radius: 6px;
    font-weight: 500;
}
.btn-primary:hover {
    background: var(--tb-accent-2);
}
.btn-secondary {
    padding: 9px 18px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
.btn-secondary:hover {
    background: #f9fafb;
}

/* Print Modal */
.print-modal-body {
    padding-bottom: 16px;
}
.print-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: 18px;
}
.print-control-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.print-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 64px;
}
.print-range,
.print-orientation {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #111;
    cursor: pointer;
}
.radio-label input {
    cursor: pointer;
}
.print-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.print-range-inputs input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    -moz-appearance: textfield;
}
.print-range-inputs input::-webkit-outer-spin-button,
.print-range-inputs input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#print-size {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    background: white;
}

.print-preview {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    max-height: 320px;
    overflow: auto;
}
.print-preview.landscape {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.print-preview .pp-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: white;
    padding: 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.print-preview .pp-page img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 120px;
    object-fit: contain;
}
.print-preview.landscape .pp-page img {
    max-height: 90px;
}
.print-preview .pp-n {
    font-size: 11px;
    color: #6b7280;
}
.print-preview .empty {
    grid-column: 1 / -1;
    color: #9ca3af;
    text-align: center;
    padding: 24px;
}

.print-count {
    margin-right: auto;
    color: #6b7280;
    font-size: 13px;
    align-self: center;
}

@media (max-width: 600px) {
    .print-controls {
        grid-template-columns: 1fr;
    }
}

/* Toast */
.share-toast {
    position: fixed;
    bottom: calc(var(--bottom-bar-h) + 24px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.88);
    color: white;
    padding: 10px 18px;
    border-radius: 22px;
    font-size: 13px;
    opacity: 0;
    transition: opacity 200ms ease;
    z-index: 200;
    pointer-events: none;
}
.share-toast.show {
    opacity: 1;
}

/* Print */
.print-host {
    position: fixed;
    left: -99999px;
    top: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    visibility: hidden;
}
.print-host img {
    display: block;
    width: 100%;
    height: auto;
}
@media print {
    @page {
        margin: 0;
        size: auto;
    }
    html,
    body {
        height: auto !important;
        overflow: visible !important;
        background: white !important;
    }
    .app > *:not(.print-host) {
        display: none !important;
    }
    .print-host {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        visibility: visible !important;
        display: block !important;
    }
    .print-host img {
        display: block;
        width: 100%;
        height: auto;
        page-break-after: always;
        break-after: page;
        margin: 0;
        padding: 0;
    }
    .print-host img:last-child {
        page-break-after: avoid;
        break-after: avoid;
    }
}

@media (max-width: 768px) {
    .toolbar {
        grid-template-columns: 1fr auto 1fr;
        padding: 4px 6px;
        gap: 4px;
    }
    .toolbar-right .tool:nth-child(n + 5) {
        display: none;
    }
    .book-title {
        display: none;
    }
    .bottom-bar {
        padding: 4px 6px;
    }
    .bb-pageinfo input {
        width: 42px;
    }
    .tool {
        width: 32px;
        height: 32px;
    }
    .tool img {
        width: 16px;
        height: 16px;
    }
    .drawer {
        width: 86vw;
    }
    .zoom-panel {
        right: 8px;
        padding: 6px 4px;
    }
    .zoom-panel .zp-slider {
        height: 80px;
    }
    .strip-page img {
        height: calc(var(--strip-h) - 48px);
    }
}
