html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5I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I2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}






/* ── Stack card (series / collection / arc groupings) ────────
   Box-shadow creates the stacked-cards illusion with zero
   layout impact — same footprint as a regular WorkCard.
   Two sharp, offset shadows simulate two backing card edges. */
.stack-card {
    box-shadow:
        3px 3px 0 rgba(255, 255, 255, 0.07),
        6px 6px 0 rgba(255, 255, 255, 0.04);
}

/* ── EPUB content base ───────────────────────────────────────
   .epub-content wraps the injected chapter HTML.
   We own all typography here — EPUB's own styles are stripped.  */

.epub-content {
    /* Readable measure — ~65 chars per line */
    max-width: 680px;
    width: 100%;
    box-sizing: border-box;
    /* Typography */
    font-size: 1.05rem;
    line-height: 1.8;
    word-break: break-word;
    overflow-wrap: break-word;
}

    /* Prose elements */
    .epub-content p {
        margin-top: 0;
        margin-bottom: 1em;
    }

    .chapter {
        margin-bottom: 2em;
    }

    .epub-content h1, .epub-content h2, .epub-content h3,
    .epub-content h4, .epub-content h5, .epub-content h6 {
        margin: 1.5em 0 0.5em;
        line-height: 1.3;
        font-weight: 600;
    }

    .epub-content h1 {
        font-size: 1.6rem;
    }

    .epub-content h2 {
        font-size: 1.35rem;
    }

    .epub-content h3 {
        font-size: 1.15rem;
    }

    .epub-content blockquote {
        margin: 1em 0 1em 1.5em;
        padding-left: 1em;
        border-left: 3px solid currentColor;
        opacity: 0.75;
    }

    .epub-content img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 1em auto;
    }

    .epub-content a {
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .epub-content hr {
        border: none;
        border-top: 1px solid currentColor;
        opacity: 0.2;
        margin: 2em 0;
    }

/* ── Themes ──────────────────────────────────────────────── */

.epub-theme-dark {
    color: #e5e7eb;
    background: transparent;
}

    .epub-theme-dark a {
        color: #e94560;
    }

.epub-theme-sepia {
    color: #3b2f2f;
    background: transparent;
}

    .epub-theme-sepia a {
        color: #8b4513;
    }

.epub-theme-light {
    color: #1a1a1a;
    background: transparent;
}

    .epub-theme-light a {
        color: #e94560;
    }

/* ── Layout modes ────────────────────────────────────────── */

/* Single page — centered portrait column, natural scroll     */
.epub-single {
    max-width: 680px;
    min-height: 100%;
}

/* Continuous — same as single but no max-width cap           */
.epub-continuous {
    max-width: 680px;
}

/* Two page — CSS columns, always exactly 2, no bleed        
   We set column-count explicitly rather than relying on
   column-width auto-calculation (which is what epub.js did
   and caused all the bleed/sizing bugs).
   Each column is ~680px so the total reading surface is
   ~1360px — fits comfortably on a 1440p or larger display.
   On smaller screens falls back to single column via media
   query below.                                               */
.epub-two-page {
    max-width: 1400px;
    column-count: 2;
    column-gap: 4rem;
    column-rule: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 1100px) {
    .epub-two-page {
        column-count: 1;
        max-width: 680px;
    }
}

/* Prevent headings and images from breaking across columns   */
.epub-two-page h1, .epub-two-page h2, .epub-two-page h3,
.epub-two-page figure, .epub-two-page img {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* ── PDF text layer ──────────────────────────────────────────
   Self-contained — does not depend on pdf_viewer.css.
   PDF.js v4+ sets CSS variables on the container and spans;
   these rules consume them.                                   */

.textLayer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    line-height: 1;
    text-size-adjust: none;
    forced-color-adjust: none;
    transform-origin: 0 0;
    z-index: 2;
    caret-color: CanvasText;
}

.textLayer span,
.textLayer br {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

/* PDF.js v6 sets --font-height, --total-scale-factor, --min-font-size,
   --min-font-size-inv, --scale-x, and --rotate on each span.
   The font-size is intentionally inflated when text is below the minimum
   readable size; scale(--min-font-size-inv) visually corrects it back.
   Without that third term the inflated text overruns the canvas glyph at
   the right edge of each span (correct start, drift at end). */
.textLayer span {
    font-size: calc(var(--total-scale-factor) * var(--min-font-size, 1) * var(--font-height));
    transform: rotate(var(--rotate, 0deg)) scaleX(var(--scale-x, 1)) scale(var(--min-font-size-inv, 1));
}

.textLayer span::selection {
    background: rgba(233, 69, 96, 0.35);
    color: transparent;
}

.textLayer span.pdf-highlight {
    background: rgba(233, 69, 96, 0.45);
    border-radius: 2px;
}

/* Thin styled scrollbar for the epub/comic viewports */
.epub-viewport::-webkit-scrollbar,
.comic-viewport::-webkit-scrollbar,
.pdf-viewport::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.epub-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.epub-viewport::-webkit-scrollbar-thumb {
    background: rgba(233, 69, 96, 0.5); /* your --accent color */
    border-radius: 2px;
}

    .epub-viewport::-webkit-scrollbar-thumb:hover {
        background: rgba(233, 69, 96, 0.8);
    }

/* Firefox */
.epub-viewport,
.comic-viewport,
.pdf-viewport {
    scrollbar-width: thin;
    scrollbar-color: rgba(233, 69, 96, 0.5) transparent;
}