.ebook-reader { background: #1e293b; border-radius: 1rem; padding: 1rem; }
.ebook-stage {
    position: relative;
    width: 100%;
    height: clamp(420px, calc(100vh - 300px), 900px);
    background: radial-gradient(ellipse at center, #334155 0%, #1e293b 75%);
    border-radius: .75rem;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.ebook-book { width: 100%; height: 100%; visibility: hidden; }
.ebook-book.is-ready { visibility: visible; }
.ebook-loading, .ebook-error {
    position: absolute; inset: 0; z-index: 5;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem;
    color: #e2e8f0; font-size: .95rem; background: rgba(15, 23, 42, .55);
}
.ebook-loading[hidden], .ebook-error[hidden] { display: none; }
.ebook-loading-bar { width: min(320px, 70%); height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.ebook-loading-bar span { display: block; height: 100%; width: 0; background: #60a5fa; transition: width .2s; }
.ebook-toolbar {
    display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap;
    margin-top: .75rem; color: #e2e8f0;
}
.ebook-toolbar button {
    min-width: 2.5rem; height: 2.5rem; padding: 0 .75rem; border-radius: .6rem;
    border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: inherit;
    font-size: 1rem; cursor: pointer; transition: background .15s;
}
.ebook-toolbar button:hover { background: rgba(255, 255, 255, .2); }
.ebook-toolbar button:focus-visible, .ebook-page-indicator input:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.ebook-page-indicator { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; }
.ebook-page-indicator input {
    width: 4rem; height: 2.5rem; text-align: center; border-radius: .6rem;
    border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff;
}
.ebook-reader:fullscreen { padding: 1rem; display: flex; flex-direction: column; background: #0f172a; }
.ebook-reader:fullscreen .ebook-stage { flex: 1; height: auto; }

.ebook-page { background: #fff; overflow: hidden; }
.ebook-page img {
    width: 100%; height: 100%; display: block; object-fit: fill;
    pointer-events: none; -webkit-user-drag: none; user-select: none;
}
