.ebook-reader-page {
    margin: 0;
    background: #2b2d31;
    color: #f1f1f1;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.ebook-reader {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ebook-reader__bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
    padding: 10px 16px;
    background: #1f2023;
    border-bottom: 1px solid #3a3c41;
}

.ebook-reader__back {
    color: #d6d6d6;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.ebook-reader__back:hover {
    color: #ffffff;
}

.ebook-reader__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ebook-reader__controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ebook-reader__controls button {
    width: 36px;
    height: 36px;
    border: 1px solid #45474d;
    border-radius: 6px;
    background: #2b2d31;
    color: #f1f1f1;
    font-size: 18px;
    cursor: pointer;
}

.ebook-reader__controls button:hover {
    background: #36383d;
}

.ebook-reader__pages {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.ebook-reader__pages input {
    width: 56px;
    height: 32px;
    border: 1px solid #45474d;
    border-radius: 6px;
    background: #1f2023;
    color: #f1f1f1;
    text-align: center;
}

.ebook-reader__stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow: auto;
}

.ebook-reader__stage canvas {
    display: block;
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    transition: filter 0.15s;
}

.ebook-reader__status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #cfcfcf;
    font-size: 15px;
    text-align: center;
}

.ebook-reader__status[hidden],
.ebook-reader__notice[hidden],
.ebook-reader__lock[hidden] {
    display: none;
}

.ebook-reader__badge {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f0b429;
    color: #1f2023;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.ebook-reader__notice {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    transform: translateX(-50%);
    border: 1px solid #45474d;
    border-radius: 8px;
    background: #1f2023;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.ebook-reader__notice p {
    margin: 0;
    font-size: 14px;
}

.ebook-reader__notice a {
    padding: 8px 14px;
    border-radius: 6px;
    background: #f0b429;
    color: #1f2023;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

/* Blurred whenever the window loses focus or Print Screen is pressed. */
.ebook-reader.is-obscured .ebook-reader__stage canvas {
    filter: blur(24px);
}

.ebook-reader__lock {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 21, 23, 0.96);
    text-align: center;
}

.ebook-reader__lock p {
    max-width: 420px;
    font-size: 16px;
    line-height: 1.6;
}

@media print {
    body * {
        display: none !important;
    }

    body::before {
        content: "Printing is not available for this book.";
        display: block;
        padding: 40px;
        color: #000000;
        font: 16px sans-serif;
    }
}

@media (max-width: 575px) {
    .ebook-reader__title {
        order: 3;
        flex-basis: 100%;
    }

    .ebook-reader__stage {
        padding: 8px;
    }
}
