:root {
    --karl-bg: #faf8f3;
    --karl-surface: #ffffff;
    --karl-ink: #1f1f1c;
    --karl-muted: #706b63;
    --karl-border: #e8e2d8;

    --karl-accent: #a65d42;
    --karl-accent-dark: #874832;

    --karl-soft: #f1ece3;

    --karl-radius-sm: 8px;
    --karl-radius-md: 14px;
    --karl-radius-lg: 22px;

    --karl-shadow: 0 18px 50px rgba(31, 31, 28, .08);

    --karl-container: 1180px;
}


* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;
    background: var(--karl-bg);
    color: var(--karl-ink);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.6;
}


a {
    color: inherit;
    text-decoration: none;
}


.container {
    width: min(
        calc(100% - 40px),
        var(--karl-container)
    );

    margin-inline: auto;
}


/* HEADER */

.site-header {
    position: relative;
    z-index: 20;

    background:
        rgba(250, 248, 243, .94);

    border-bottom: 1px solid var(--karl-border);

    backdrop-filter: blur(14px);
}


.navbar {
    min-height: 84px;

    display: flex;
    align-items: center;
    gap: 32px;
}


.brand {
    display: flex;
    flex-direction: column;
    margin-right: auto;
}


.brand-name {
    font-family: Georgia, serif;

    font-size: 24px;
    letter-spacing: .08em;
}


.brand-tagline {
    color: var(--karl-muted);

    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}


.main-nav {
    display: flex;
    gap: 28px;
}


.main-nav a {
    color: var(--karl-muted);

    font-size: 14px;

    transition:
        color .2s ease;
}


.main-nav a:hover {
    color: var(--karl-accent);
}


/* BUTTONS */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding:
        0 22px;

    border-radius: 999px;

    font-size: 14px;
    font-weight: 600;

    transition:
        transform .2s ease,
        background .2s ease,
        color .2s ease;
}


.btn:hover {
    transform: translateY(-2px);
}


.btn-primary {
    background: var(--karl-accent);
    color: #fff;
}


.btn-primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}


.btn-primary:hover {
    background: var(--karl-accent-dark);
}


.btn-outline {
    border: 1px solid var(--karl-border);
}


.btn-light {
    background: #fff;
    color: var(--karl-ink);
}


/* HERO */

.hero {
    padding:
        110px 0
        100px;
}


.hero-grid {
    display: grid;

    grid-template-columns:
        1fr
        .8fr;

    align-items: center;

    gap: 80px;
}


.eyebrow {
    color: var(--karl-accent);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .16em;
    text-transform: uppercase;
}


.hero h1 {
    max-width: 650px;

    margin:
        18px 0
        22px;

    font-family: Georgia, serif;

    font-size:
        clamp(54px, 7vw, 88px);

    line-height: .98;

    font-weight: 400;
}


.hero h1 em {
    color: var(--karl-accent);
    font-style: normal;
}


.hero p {
    max-width: 560px;

    color: var(--karl-muted);

    font-size: 19px;
}


.hero-actions {
    display: flex;
    align-items: center;

    gap: 28px;

    margin-top: 34px;
}


.text-link {
    color: var(--karl-accent);

    font-size: 14px;
    font-weight: 700;
}


/* HERO BOOK ART */

.hero-art {
    position: relative;

    min-height: 480px;

    display: flex;
    align-items: center;
    justify-content: center;
}


.book-stack {
    position: relative;

    width: 320px;
    height: 390px;
}


.book {
    position: absolute;

    width: 240px;
    height: 330px;

    padding: 26px;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    border-radius: 4px;

    box-shadow: var(--karl-shadow);

    color: #fff;

    font-family: Georgia, serif;

    font-size: 13px;
    letter-spacing: .12em;
}


.book strong {
    display: block;

    margin-top: 8px;

    font-size: 30px;
    letter-spacing: .04em;
}


.book-one {
    right: 25px;
    top: 20px;

    background: #9b5f46;

    transform:
        rotate(9deg);
}


.book-two {
    left: 25px;
    top: 45px;

    background: #495a4d;

    transform:
        rotate(-7deg);
}


.book-three {
    left: 52px;
    top: 12px;

    background: #b89361;

    transform:
        rotate(1deg);
}


/* SECTIONS */

.section {
    padding:
        50px 0;
}


.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 42px;
}


.section-heading.centered {
    align-items: center;
    justify-content: center;

    text-align: center;
}


.section h2 {
    margin:
        8px 0 0;

    font-family: Georgia, serif;

    font-size:
        clamp(36px, 5vw, 58px);

    line-height: 1.05;

    font-weight: 400;
}


/* BOOKS */

.book-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 24px;
}


.book-card {
    overflow: hidden;

    background: var(--karl-surface);

    border:
        1px solid
        var(--karl-border);

    border-radius:
        var(--karl-radius-md);

    box-shadow:
        0 12px 40px
        rgba(31, 31, 28, .05);
}

.book-card-content {
    padding: 28px;
}

.book-cover {
    aspect-ratio:
        3 / 4;

    padding: 24px;

    display: flex;
    flex-direction: column;
    justify-content: end;

    color: #fff;

    font-family: Georgia, serif;

    font-size: 12px;
    letter-spacing: .12em;
}


.book-cover strong {
    margin-top: 8px;

    font-size: 27px;

    letter-spacing: .04em;
}


.cover-one {
    background: #9b5f46;
}


.cover-two {
    background: #495a4d;
}


.cover-three {
    background: #8b6d82;
}


.cover-four {
    background: #4c5964;
}


.book-info {
    padding: 22px;
}


.book-category {
    color: var(--karl-accent);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .12em;
    text-transform: uppercase;
}


.book-info h3 {
    margin:
        8px 0 4px;

    font-family: Georgia, serif;

    font-size: 21px;

    font-weight: 400;

    line-height: 1.2;
}


.author {
    margin: 0;

    color: var(--karl-muted);

    font-size: 13px;
}


.book-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 22px;
}


.price {
    font-size: 15px;
}


.admin-free-access-label {
    margin-top: 5px;

    color: var(--karl-accent);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .08em;
    text-transform: uppercase;
}


.book-link {
    color: var(--karl-accent);

    font-size: 12px;
    font-weight: 700;
}


/* CATEGORIES */

.categories {
    background: var(--karl-soft);
}


.category-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 16px;
}


.category-card {
    padding: 30px;

    background: rgba(255,255,255,.7);

    border:
        1px solid
        rgba(31,31,28,.08);

    border-radius:
        var(--karl-radius-md);

    transition:
        transform .2s ease,
        background .2s ease;
}


.category-card:hover {
    transform: translateY(-4px);
    background: #fff;
}


.category-card span {
    color: var(--karl-accent);

    font-size: 11px;
    font-weight: 700;
}


.category-card strong {
    display: block;

    margin-top: 34px;

    font-family: Georgia, serif;

    font-size: 26px;

    font-weight: 400;
}


.category-card small {
    display: block;

    margin-top: 8px;

    color: var(--karl-muted);

    font-size: 13px;
}


/* GROUP */

.group-banner {
    padding-top: 80px;
}


.group-banner-inner {
    padding:
        52px 58px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 40px;

    border-radius:
        var(--karl-radius-lg);

    background: var(--karl-ink);

    color: #fff;
}


.group-banner .eyebrow {
    color: #d6aa86;
}


.group-banner h2 {
    margin-bottom: 12px;
}


.group-banner p {
    max-width: 620px;

    margin: 0;

    color: rgba(255,255,255,.7);
}


/* FOOTER */

.site-footer {
    margin-top: 70px;

    padding:
        70px 0 30px;

    background: #171714;

    color: #fff;
}


.footer-grid {
    display: grid;

    grid-template-columns:
        2fr
        1fr
        1fr
        1fr;

    gap: 60px;
}


.footer-brand {
    font-family: Georgia, serif;

    font-size: 24px;

    letter-spacing: .08em;
}


.site-footer p {
    margin: 4px 0 14px;

    color: rgba(255,255,255,.58);

    font-size: 13px;
}


.group-mark {
    color: #d6aa86;

    font-size: 12px;
}


.site-footer h4 {
    margin:
        0 0 16px;

    font-size: 13px;
}


.site-footer a {
    display: block;

    margin: 8px 0;

    color: rgba(255,255,255,.58);

    font-size: 13px;
}


.site-footer a:hover {
    color: #fff;
}


.footer-bottom {
    display: flex;
    justify-content: space-between;

    margin-top: 60px;
    padding-top: 24px;

    border-top:
        1px solid
        rgba(255,255,255,.1);

    color: rgba(255,255,255,.4);

    font-size: 11px;
}



/* MOBILE NAVIGATION */

.mobile-nav-toggle {
    display: none;
}

.mobile-nav-button {
    display: none;
}

.mobile-nav-account {
    display: none;
}

.desktop-nav-account {
    display: block;
}

.mobile-nav-account .nav-account-label {
    font-size: 11px;
    font-weight: 400;
    opacity: .75;
}

.mobile-nav-account .nav-account-name {
    font-size: 14px;
    font-weight: 600;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-account {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 130px;
    max-width: 180px;
    padding: 8px 16px;
}

.mobile-nav-account.nav-account {
    display: none;
}

.nav-account-label {
    font-size: 9px;
    line-height: 1.2;
    font-weight: 400;
    opacity: .65;
}

.nav-account-name {
    margin-left: 0;
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* RESPONSIVE */

@media (max-width: 980px) {

    .main-nav {
        display: none;
    }

    .desktop-nav-account {
        display: none;
    }

    .mobile-nav-button {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 42px;
        height: 42px;

        border: 1px solid var(--karl-border);
        border-radius: 10px;

        background: transparent;
        color: var(--karl-ink);

        font-size: 24px;
        line-height: 1;

        cursor: pointer;
    }

    .mobile-nav-close {
        display: none;
    }

    .mobile-nav-toggle:checked
    + .mobile-nav-button
    .mobile-nav-open {
        display: none;
    }

    .mobile-nav-toggle:checked
    + .mobile-nav-button
    .mobile-nav-close {
        display: inline;
    }

    .mobile-nav-toggle:checked
    ~ .main-nav {
        display: flex;
        flex-direction: column;

        position: absolute;

        top: 84px;
        left: 0;
        right: 0;

        gap: 0;

        padding: 12px 20px 20px;

        background: rgba(250, 248, 243, .98);

        border-bottom:
            1px solid
            var(--karl-border);

        box-shadow:
            0 12px 30px
            rgba(0,0,0,.08);

        z-index: 30;
    }

    .mobile-nav-toggle:checked
    ~ .main-nav a {
        display: block;

        padding: 14px 4px;

        border-bottom:
            1px solid
            var(--karl-border);
    }

    .mobile-nav-toggle:checked
    ~ .main-nav
    .mobile-nav-account {
        display: block;

        margin-top: 8px;

        font-weight: 600;
    }


    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }


    .hero-art {
        min-height: 400px;
    }


    .book-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .category-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

}


@media (max-width: 640px) {

    .container {
        width:
            min(
                calc(100% - 28px),
                var(--karl-container)
            );
    }


    .navbar {
        min-height: 72px;
    }


    .brand-tagline {
        display: none;
    }


    .hero {
        padding:
            70px 0;
    }


    .hero h1 {
        font-size: 54px;
    }


    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }


    .book-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }


    .section {
        padding:
            70px 0;
    }


    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }


    .group-banner-inner {
        padding: 34px 28px;

        flex-direction: column;
        align-items: flex-start;
    }


    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }


    .footer-bottom {
        flex-direction: column;
        gap: 8px;
    }

}

.book-cover {
    overflow: hidden;
    position: relative;
}

.book-cover.cover-image {
    padding: 0;
}

.book-cover.cover-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-default {
    background: var(--karl-ink);
}

.catalog-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--karl-muted);
    border: 1px dashed var(--karl-border);
    border-radius: var(--karl-radius-md);
}

.catalog-loading,
.catalog-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--karl-muted);
    border: 1px dashed var(--karl-border);
    border-radius: var(--karl-radius-md);
}

.book-cover.cover-default {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    padding: 24px;

    background: #495a4d;
    color: #fff;

    aspect-ratio: 3 / 4;
}

.book-cover.cover-default span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .9;
}

.book-cover.cover-default strong {
    display: block;

    margin-top: 8px;

    font-family: Georgia, serif;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 400;
}

/* Dynamic catalog cover fallback */
.book-card .book-cover.cover-default {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;

    position: relative;
    overflow: hidden;

    min-height: 300px;
    aspect-ratio: 3 / 4;

    padding: 24px !important;

    background: #495a4d !important;
    color: #ffffff !important;
}

.book-card .book-cover.cover-default span {
    display: block;

    color: #ffffff !important;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.book-card .book-cover.cover-default strong {
    display: block;

    margin-top: 8px;

    color: #ffffff !important;

    font-family: Georgia, serif;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 400;
}

/* Dynamic Featured Book Cover */
#featured-books .book-card .book-cover.cover-default {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;

    width: 100%;
    min-height: 300px;

    padding: 24px !important;

    background: #495a4d !important;
    color: #ffffff !important;

    overflow: hidden;
}

#featured-books .book-card .book-cover.cover-default span {
    display: block !important;

    color: #ffffff !important;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

#featured-books .book-card .book-cover.cover-default strong {
    display: block !important;

    margin-top: 8px;

    color: #ffffff !important;

    font-family: Georgia, serif;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 400;
}

.book-detail-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 80px;
    align-items: start;
}

.book-detail-cover .book-cover {
    min-height: 440px;
}

.book-detail-content {
    padding-top: 20px;
}

.book-detail-content h1 {
    margin: 14px 0 10px;

    font-family: Georgia, serif;
    font-size: clamp(48px, 6vw, 72px);
    line-height: 1;
    font-weight: 400;
}

.book-detail-author {
    margin: 0 0 30px;

    color: var(--karl-muted);
    font-size: 16px;
}

.book-detail-description {
    max-width: 680px;

    color: var(--karl-muted);
    font-size: 17px;
    line-height: 1.8;
}

.book-purchase {
    margin-top: 42px;
    padding-top: 28px;

    border-top: 1px solid var(--karl-border);
}

.book-price-label {
    color: var(--karl-muted);

    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.book-price {
    margin: 6px 0 22px;

    font-family: Georgia, serif;
    font-size: 34px;
}

@media (max-width: 760px) {

    .book-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .book-detail-cover {
        max-width: 320px;
    }
}

/* =========================================================
   KARLALYN — BOOK DETAIL
   ========================================================= */

.book-detail-page {
    padding-top: 70px;
    padding-bottom: 100px;
}

.book-detail-page .book-detail-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 80px;
    align-items: start;
    margin-top: 34px;
}

.book-detail-page .book-detail-cover {
    width: 340px;
}

.book-detail-page .book-detail-cover .book-cover {
    width: 340px;
    height: 453px;
    min-height: 0;
    aspect-ratio: auto;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    padding: 28px !important;

    background: #495a4d !important;
    color: #fff !important;

    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--karl-shadow);
}

.book-detail-page .book-detail-cover .book-cover span {
    color: #fff !important;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.book-detail-page .book-detail-cover .book-cover strong {
    margin-top: 10px;

    color: #fff !important;

    font-family: Georgia, serif;
    font-size: 34px;
    line-height: 1;
    font-weight: 400;
}

.book-detail-page .book-detail-content {
    padding-top: 18px;
}

.book-detail-page .book-detail-content h1 {
    margin: 12px 0 10px;

    font-family: Georgia, serif !important;
    font-size: clamp(48px, 5vw, 72px) !important;
    line-height: 1 !important;
    font-weight: 400 !important;
    color: var(--karl-ink);
}

.book-detail-page .book-detail-author {
    margin: 0 0 28px;
    color: var(--karl-muted);
    font-size: 16px;
}

.book-detail-page .book-detail-description {
    max-width: 650px;
    color: var(--karl-muted);
    font-size: 17px;
    line-height: 1.8;
}

.book-detail-page .book-purchase {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--karl-border);
}

.book-detail-page .book-price-label {
    color: var(--karl-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.book-detail-page .book-price {
    margin: 8px 0 22px;

    font-family: Georgia, serif;
    font-size: 34px;
    line-height: 1;
}

/* Mobile */
@media (max-width: 760px) {

    .book-detail-page .book-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .book-detail-page .book-detail-cover {
        width: min(100%, 320px);
    }

    .book-detail-page .book-detail-cover .book-cover {
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 4;
    }
}

/* =========================================
   Karlalyn My Books
   ========================================= */

.my-books-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(240px, 1fr)
    );
    gap: 28px;
    margin-top: 40px;
}

.my-book-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--rq-border, #e5e0d8);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
}

.my-book-card .book-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
}

.my-book-card .book-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.my-book-info {
    padding: 24px 28px;
}

.my-book-card h3 {
    margin: 6px 0 8px;
    line-height: 1.35;
}

.my-book-card .author {
    margin-bottom: 10px;
}

.my-book-card .book-code {
    margin: 0 0 15px;
    font-size: 12px;
    opacity: .65;
}

.my-book-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.my-book-actions .btn {
    min-width: 0;
    padding: 9px 14px;
    font-size: 13px;
    border-radius: 7px;
}

.my-book-actions .btn-primary {
    flex: 1 1 auto;
}

.my-book-actions .btn-outline {
    flex: 1 1 auto;
}

.my-book-actions .read-button {
    width: 100%;
}

.my-book-downloads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.my-book-downloads .btn,
.my-book-actions .read-button {
    min-width: 0;
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 7px;
    text-align: center;
}

@media (max-width: 520px) {
    .my-book-downloads {
        grid-template-columns: 1fr;
    }
}





/* Fallback cover */
.my-book-card .cover-default {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    background: #4a5b4f;
    color: #fff;
}

@media (max-width: 700px) {

    .my-books-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

}

/* =========================================
   Karlalyn Login
   ========================================= */

.login-page {
    min-height: 620px;
    display: flex;
    align-items: center;
}

.login-panel {
    width: min(460px, 100%);
}

.login-panel h1 {
    margin: 14px 0 12px;
}

.login-panel > p {
    margin-bottom: 32px;
    color: #6b675f;
}

.karlalyn-login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.karlalyn-login-form label {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.karlalyn-login-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    border: 1px solid #ddd6cc;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: #25221f;
    outline: none;
}

.karlalyn-login-form input:focus {
    border-color: #b76546;
    box-shadow: 0 0 0 3px rgba(183, 101, 70, .12);
}

.karlalyn-login-form .btn {
    margin-top: 14px;
    width: fit-content;
    min-width: 120px;
}

.login-note {
    margin-top: 22px;
    font-size: 13px;
    color: #8a847c;
}

@media (max-width: 700px) {

    .login-page {
        min-height: 520px;
    }

    .login-panel {
        width: 100%;
    }

}

/* =========================================================
   KARLALYN READER
   ========================================================= */

.reader-page {
    padding-top: 7rem;
    padding-bottom: 7rem;
}

.reader {
    max-width: 860px;
    margin: 0 auto;
}

.reader-header {
    margin-bottom: 3.5rem;
}

.reader-header .eyebrow {
    display: inline-block;
    margin-bottom: 1.25rem;
}

.reader-header h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 1.05;
}

.reader-book-title {
    margin: 0 0 .5rem;
    font-size: 1.05rem;
    font-weight: 500;
}

.reader-author {
    margin: 0;
    color: #777;
    font-size: .95rem;
}

/* ---------------------------------------------------------
   Content
   --------------------------------------------------------- */



.reader-content {
    max-width: 820px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    background: #fff;
    border: 1px solid #e9e3dc;
    border-radius: 12px;
    font-size: 1.1rem;
    line-height: 1.9;
    color: #292929;
}

.reader-content h2,
.reader-content h3,
.reader-content h4 {
    margin-top: 3rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.reader-content p {
    margin: 0 0 1.5rem;
}

.reader-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 10px;
}

.reader-content blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid #b15f43;
    color: #666;
}

/* ---------------------------------------------------------
   Navigation
   --------------------------------------------------------- */

.reader-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;

    max-width: 760px;
    margin: 1.5rem auto 2rem;
    padding: 1.5rem 0;

    border-top: 1px solid #e9e3dc;
    border-bottom: 1px solid #e9e3dc;
}

.reader-navigation > :last-child {
    justify-self: end;
}

.reader-position {
    color: #777;
    font-size: .85rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ---------------------------------------------------------
   Chapter list
   --------------------------------------------------------- */

.reader-chapter-list {
    max-width: 760px;
    margin: 0 auto;
    padding-top: 3rem;
}

.reader-chapter-list-header {
    margin-bottom: 1.75rem;
}

.reader-chapter-list-header h2 {
    margin: .35rem 0 0;
    font-size: 2rem;
    line-height: 1.1;
}

.reader-chapters {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.reader-chapter-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 1rem;

    padding: 1rem 1.15rem;

    color: inherit;
    text-decoration: none;

    background: #fff;
    border: 1px solid #e8e1d9;
    border-radius: 12px;

    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.reader-chapter-item:hover {
    transform: translateY(-1px);
    border-color: #d8c9bd;
    box-shadow: 0 8px 24px rgba(38, 30, 24, .06);
}

.reader-chapter-number {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: #a9563b;
}

.reader-chapter-title {
    min-width: 0;
}

.reader-chapter-title strong {
    display: block;
    margin-bottom: .2rem;
    font-size: .98rem;
}

.reader-chapter-title span {
    display: block;
    color: #777;
    font-size: .82rem;
}
.reader-chapter-download {
    display: inline-block;
    margin-top: .65rem;
    padding: .45rem .75rem;
    font-size: .78rem;
    line-height: 1.2;
    border-radius: 7px;
    text-decoration: none;
}

.reader-chapter-status {
    min-width: 28px;
    text-align: center;
    font-size: .95rem;
}

.reader-chapter-item.is-locked,
.reader-chapter-item.is-coming-soon {
    background: #faf8f5;
    border-style: dashed;
    color: #777;
}

.reader-chapter-item.is-locked:hover,
.reader-chapter-item.is-coming-soon:hover {
    transform: none;
    box-shadow: none;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.reader-navigation .btn {
    min-width: 120px;
    justify-content: center;
}

/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 700px) {

    .reader-page {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .reader-header {
        margin-bottom: 2.5rem;
    }

    .reader-content {
        padding: 1.5rem 1.25rem;
        font-size: 1rem;
        line-height: 1.8;
    }

    .reader-navigation {
        grid-template-columns: 1fr 1fr;
        margin-top: 2.5rem;
        margin-bottom: 3rem;
    }

    .reader-position {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
        margin-bottom: .25rem;
    }

    .reader-navigation .btn {
        min-width: 0;
        width: 100%;
    }

    .reader-chapter-item {
        grid-template-columns: 42px 1fr 24px;
        gap: .75rem;
        padding: .9rem;
    }

    .reader-chapter-list {
        margin-top: 3.5rem;
        padding-top: 2.25rem;
    }

    .reader-chapter-list-header h2 {
        font-size: 1.7rem;
    }
}

.reader-progress {
    display: none;
}

.reader-progress-bar {
    width: 100%;
    height: 4px;
    overflow: hidden;
    background: #ece7e1;
    border-radius: 999px;
}

.reader-progress-fill {
    width: 0;
    height: 100%;
    background: #b15f43;
    transition: width .15s ease;
}

/* ---------------------------------------------------------
   Floating Reader Controls
   --------------------------------------------------------- */

.reader-floating-controls {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 1000;

    width: min(
        calc(100% - 2rem),
        860px
    );

    transform: translateX(-50%);

    display: flex;
    align-items: center;
    gap: 1.25rem;

    padding: .7rem 1rem;

    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(232, 225, 217, .95);
    border-radius: 14px;

    box-shadow:
        0 10px 30px rgba(38, 30, 24, .10);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.reader-floating-back {
    flex: 0 0 auto;

    color: inherit;
    text-decoration: none;

    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.reader-floating-back:hover {
    text-decoration: none;
}

.reader-floating-chapter {
    flex: 0 1 auto;
    min-width: 0;

    display: flex;
    align-items: center;
    gap: .35rem;

    color: #555;
    font-size: .8rem;
    font-weight: 600;

    white-space: nowrap;
}

.reader-floating-chapter-separator {
    color: #b15f43;
}

.reader-floating-chapter-title {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
 * Voice Reader — Floating Controls
 * ========================================================= */

.reader-floating-voice {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.reader-floating-voice-label {
    font-size: .8rem;
    font-weight: 600;
    color: inherit;
}

.reader-floating-voice-button {
    width: auto;
    height: auto;
    min-width: 0;
    margin: 0;
    padding: 0 .15rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;

    color: inherit;
    font: inherit;
    line-height: 1;
    border-radius: 0;

    appearance: none;
    -webkit-appearance: none;

    cursor: pointer;
}

.reader-floating-voice-button:hover,
.reader-floating-voice-button:focus,
.reader-floating-voice-button:active {
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--rq-primary, #2563eb);
}

.reader-floating-voice-button:focus-visible {
    outline: 2px solid var(--rq-primary, #2563eb);
    outline-offset: 3px;
    border-radius: .2rem;
}

#voice-reader-audio,
#voice-reader-seek,
#voice-reader-current-time,
#voice-reader-duration {
    display: none;
}

@media (max-width: 700px) {

    .reader-floating-voice {
        gap: .25rem;
    }

    .reader-floating-voice-label {
        font-size: .75rem;
    }

    .reader-floating-voice-button {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: .8rem;
    }
}
.reader-floating-progress {
    flex: 1 1 auto;
    min-width: 0;

    display: flex;
    align-items: center;
    gap: .65rem;
}

.reader-floating-progress-value {
    flex: 0 0 auto;

    min-width: 3rem;

    text-align: right;

    color: #777;
    font-size: .8rem;
    font-weight: 600;
}

.reader-floating-progress-bar {
    flex: 1 1 auto;

    height: 4px;

    overflow: hidden;

    background: #ece7e1;
    border-radius: 999px;
}

.reader-floating-progress-fill {
    width: 0;
    height: 100%;

    background: #b15f43;

    transition: width .15s ease;
}

@media (max-width: 700px) {

    .reader-floating-controls {
        bottom: .75rem;

        width: calc(100% - 1rem);

        gap: .75rem;

        padding: .65rem .75rem;

        border-radius: 12px;
    }

    .reader-floating-back {
        font-size: .82rem;
    }

    .reader-floating-progress {
        gap: .45rem;
    }

    .reader-floating-progress-value {
        min-width: 2.5rem;
        font-size: .75rem;
    }
}

.my-book-progress {
    margin: 1rem 0 1.25rem;
}

.my-book-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .45rem;
    font-size: .78rem;
    color: #777;
}

.my-book-progress-bar {
    width: 100%;
    height: 5px;
    overflow: hidden;
    background: #ece7e1;
    border-radius: 999px;
}

.my-book-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #b15f43;
    transition: width .2s ease;
}
/* ============================================================
 * AUTH FORMS
 * Login / Forgot Password / Reset Password
 * ============================================================ */

.auth-page {
    padding:
        80px 0
        90px;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 460px;
    margin: 2rem auto 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.form-group[hidden] {
    display: none !important;
}

.form-group label {
    font-size: .9rem;
    font-weight: 600;
    color: var(--karl-ink);
}

.form-group input:not([type="radio"]):not([type="checkbox"]) {
    width: 100%;
    min-height: 48px;

    padding:
        .75rem 1rem;

    border:
        1px solid var(--karl-border);

    border-radius:
        12px;

    background:
        #fff;

    color:
        var(--karl-ink);

    font-family:
        inherit;

    font-size:
        .95rem;

    outline:
        none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.form-group input:focus {
    border-color:
        var(--karl-accent);

    box-shadow:
        0 0 0 3px
        rgba(177, 95, 67, .12);
}

.auth-form .btn {
    align-self: flex-start;
    margin-top: .25rem;
}

.auth-register-link {
    margin-top: 1.25rem;
    font-size: .9rem;
    text-align: center;
}

.auth-register-link a {
    color: var(--karl-accent);
    font-weight: 600;
}

.auth-error,
.auth-success {
    margin-bottom: 1.25rem;
    padding: .85rem 1rem;
    border-radius: 10px;
    font-size: .9rem;
    line-height: 1.5;
}

.auth-error {
    background: #fdf0ed;
    color: #8f3f2d;
    border: 1px solid #edc8bd;
}

.auth-success {
    background: #eef8f1;
    color: #2f6b42;
    border: 1px solid #c7e3cf;
}

@media (max-width: 640px) {

    .auth-page {
        padding:
            60px 0
            70px;
    }

    .auth-form-wrapper {
        max-width: none;
        margin-top: 1.5rem;
    }

    .auth-form .btn {
        width: 100%;
    }
}



/* REGISTER PHONE */

.register-phone-row {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 14px;
    align-items: start;
}

.register-phone-row label {
    display: block;
    margin-bottom: 8px;
}

.register-phone-row select,
.register-phone-row input {
    width: 100%;
    box-sizing: border-box;
}

.register-phone-row select {
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--karl-border);
    border-radius: 10px;
    background: #fff;
    color: var(--karl-ink);
    font: inherit;
}

@media (max-width: 640px) {

    .register-phone-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

}


/* ---------------------------------------------------------
   BOOK CHAPTERS
   --------------------------------------------------------- */

.book-chapters {
    margin-top: 42px;
    max-width: 760px;
}

.book-chapters h2 {
    margin: 0 0 20px;

    font-family: Georgia, serif;
    font-size: 30px;
    font-weight: 400;

    color: var(--karl-ink);
}


.chapter-list {
    display: flex;
    flex-direction: column;

    border-top:
        1px solid
        var(--karl-border);
}


.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 28px;

    padding:
        20px 0;

    border-bottom:
        1px solid
        var(--karl-border);
}


.chapter-info {
    min-width: 0;
}


.chapter-number {
    display: block;

    margin-bottom: 6px;

    color: var(--karl-muted);

    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
}


.chapter-info h3 {
    margin: 0;

    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: 400;

    color: var(--karl-ink);
}


.chapter-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 14px;

    flex-shrink: 0;
}


.chapter-price,
.chapter-free {
    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;
}


.chapter-free {
    color: #4a5b4f;
}


.chapter-action .btn {
    min-height: 40px;

    padding:
        0 18px;

    font-size: 13px;
}


@media (max-width: 640px) {

    .book-chapters {
        margin-top: 34px;
    }


    .book-chapters h2 {
        font-size: 28px;
    }


    .chapter-item {
        align-items: flex-start;

        flex-direction: column;

        gap: 14px;

        padding: 18px 0;
    }


    .chapter-action {
        width: 100%;

        justify-content: space-between;
    }

}

/* MY ACCOUNT */

.my-account-page > .container > .section-heading {
    margin-bottom: 34px;
}

.my-account-page .section-heading h1 {
    margin-bottom: 0;
}

.my-account-page .my-account-profile-summary {
    margin-bottom: 28px;
}

.my-account-page .my-account-overview {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ACCOUNT VERIFICATION */

.account-verification-list {
    display: flex;
    flex-direction: column;
    gap: 14px;

    margin-top: 20px;
    margin-bottom: 20px;
}

.account-verification-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}

.account-verification-info {
    display: flex;
    align-items: baseline;
    gap: 12px;

    min-width: 0;
}

.account-verification-info strong {
    min-width: 72px;
}

.account-verification-info span {
    font-size: 14px;
}

.account-verification-row form {
    flex-shrink: 0;
}

.account-verification-row .btn {
    margin: 0;
}

/* MY ACCOUNT VERIFICATION — FINAL */

.my-account-page .account-verification-list {
    gap: 12px;
    margin-top: 18px;
    margin-bottom: 22px;
}

.my-account-page .account-verification-row {
    min-height: 40px;
}

.my-account-page .account-verification-info {
    flex: 1 1 auto;
}

.my-account-page .account-verification-row form {
    margin-left: auto;
}

.my-account-page .account-verification-row .btn {
    min-width: 140px;
}

@media (max-width: 640px) {

    .my-account-page .account-verification-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .my-account-page .account-verification-info {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .my-account-page .account-verification-row form {
        margin-left: 0;
    }

    .my-account-page .account-verification-row .btn {
        min-width: 0;
    }

}

/* Create Chapter Content Mode */
.chapter-content-mode-options {
    display: flex;
    gap: 20px;
    align-items: center;
}

.chapter-content-mode-options label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
    margin: 0;
}

.chapter-content-mode-options input[type="radio"] {
    appearance: auto;
    -webkit-appearance: radio;
    width: 13px;
    height: 13px;
    min-width: 13px;
    min-height: 13px;
    padding: 0;
    margin: 0 6px 0 0;
    border: 0;
    border-radius: 50%;
    background: initial;
}


/* Author Sample Work radio */
.form-group input[name="sample_work_type"] {
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0 .4rem 0 0;
}


/* AUTHOR PROFILE */

.author-profile-card .book-card-content {
    padding: 28px;
    padding-bottom: 24px;
}

.author-profile-card .book-card-content h3 {
    margin: 0 0 18px;
    font-weight: 500;
}

.author-profile-card .book-card-content p {
    margin: 0 0 8px;
}

.author-profile-card .book-card-content p strong {
    display: block;
    font-weight: 600;
}

.author-profile-card .book-card-content p + p {
    margin-bottom: 16px;
}

.author-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--karl-border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

/* PUBLIC AUTHOR BOOKS */

.author-public-books-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.author-public-books-grid .book-card-content {
    padding: 28px;
}

.author-public-books-grid .book-card-content h3 {
    margin: 12px 0 10px;
}

.author-public-books-grid .book-card-content p {
    margin: 0 0 20px;
}

/* =========================================================
   AUTHOR CHAPTER MANAGEMENT — GRID
   ========================================================= */

.author-chapters-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.author-chapter-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 200px;

    padding: 20px;

    border: 1px solid var(--karl-border);
    border-radius: 14px;

    background: #fff;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.author-chapter-card:hover {
    border-color: rgba(37, 99, 235, .35);

    box-shadow:
        0 8px 24px rgba(15, 23, 42, .08);

    transform: translateY(-2px);
}

.author-chapter-number {
    margin-bottom: 14px;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .08em;
    text-transform: uppercase;

    color: #2563eb;
}

.author-chapter-info {
    flex: 1 1 auto;
    min-width: 0;
}

.author-chapter-info h3 {
    margin: 0 0 14px;

    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;

    overflow-wrap: anywhere;
}

.author-chapter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.author-chapter-meta span {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border: 1px solid var(--karl-border);
    border-radius: 999px;

    font-size: 12px;
    line-height: 1.2;

    white-space: nowrap;
}

.author-chapter-workflow-status.is-editable {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.author-chapter-workflow-status.is-rejected {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.author-chapter-workflow-status.is-locked {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.author-chapter-actions {
    margin-top: 20px;
    padding-top: 16px;

    border-top: 1px solid var(--karl-border);
}

.author-chapter-actions .btn {
    width: 100%;
    margin: 0;
}


/* AUTHOR CHAPTERS — TABLET */

@media (max-width: 1024px) {

    .author-chapters-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* AUTHOR CHAPTERS — MOBILE */

@media (max-width: 640px) {

    .author-chapters-list {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .author-chapter-card {
        min-height: 0;
        padding: 18px;
    }

}

/* Author Book Cover Preview */
.author-book-cover-preview {
    width: 240px;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.author-book-cover-preview img {
    display: block;
    width: 100%;
    height: auto;
}



/* =========================================================
   AUTHOR BOOK MANAGEMENT — GRID
   ========================================================= */

.author-books-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.author-book-card {
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 220px;

    padding: 20px;

    border: 1px solid var(--karl-border);
    border-radius: 14px;

    background: #fff;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.author-book-card::before {
    content: "";

    position: absolute;
    inset: 0;

    background-image: var(--author-book-cover);
    background-size: cover;
    background-position: center;

    opacity: .15;

    pointer-events: none;
}

.author-book-card > * {
    position: relative;
    z-index: 1;
}

.author-book-card:hover {
    border-color: rgba(37, 99, 235, .35);

    box-shadow:
        0 8px 24px rgba(15, 23, 42, .08);

    transform: translateY(-2px);
}

.author-book-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    margin-bottom: 14px;
}

.author-book-card h3 {
    margin: 0 0 14px;

    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;

    overflow-wrap: anywhere;
}

.author-book-card .book-code {
    margin: 0 0 14px;

    font-size: 13px;
    line-height: 1.3;

    overflow-wrap: anywhere;
}

.author-book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.author-book-meta span {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border: 1px solid var(--karl-border);
    border-radius: 999px;

    font-size: 12px;
    line-height: 1.2;

    white-space: nowrap;
}


.author-book-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;

    margin-top: auto;
    padding-top: 20px;

    border-top: 1px solid var(--karl-border);
}

.author-book-actions form {
    margin: 0;
}

.author-book-actions .btn {
    flex: 0 0 auto;
    width: auto;
    margin: 0;

    padding: 9px 9px;
    font-size: 12px;
}




/* AUTHOR BOOKS — TABLET */

@media (max-width: 1024px) {

    .author-books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* AUTHOR BOOKS — MOBILE */

@media (max-width: 640px) {

    .author-books-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .author-book-card {
        min-height: 0;
        padding: 18px;
    }

}



.author-book-actions form .btn {
    min-width: 72px;
}


/* =========================================================
 * Voice Reader — T01 UI
 * ========================================================= */

.voice-reader-ui {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.voice-reader-page .reader-header {
    margin-bottom: 1.5rem;
}




.voice-reader-page .voice-reader-word,
.reader-voice-text .voice-reader-word {
    transition:
        background-color .12s ease,
        color .12s ease;
}

.voice-reader-page .voice-reader-word.is-active,
.reader-voice-text .voice-reader-word.is-active {
    background: var(--rq-primary, #2563eb);
    color: #fff;
    border-radius: .25rem;
    padding: .05em .18em;
}

/* ============================================================
   VOICE READER — DARK FLOATING CONTROL
   Presentation-only override.
   ============================================================ */

.reader-floating-voice {
    background: rgba(24, 24, 22, .92);
    color: rgba(255, 255, 255, .92);
    box-shadow:
        0 .5rem 1.25rem rgba(0, 0, 0, .18);
    border: 1px solid rgba(255, 255, 255, .08);
}

.reader-floating-voice-label {
    color: rgba(255, 255, 255, .92);
}

.reader-floating-voice-button {
    color: rgba(255, 255, 255, .96);
}

.reader-floating-voice-button:hover,
.reader-floating-voice-button:focus,
.reader-floating-voice-button:active {
    color: var(--rq-primary, #2563eb);
    background: transparent;
}

.reader-floating-progress {
    color: rgba(255, 255, 255, .88);
}

.reader-floating-progress-value {
    color: rgba(255, 255, 255, .88);
}


/* ============================================================
   VOICE READER — FINAL UNIVERSAL FLOATING BAR
   Presentation-only override.
   Shared reading/audio progress remains unchanged.
   ============================================================ */

.reader-floating-controls {
    background: rgba(24, 24, 22, .94);
    color: rgba(255, 255, 255, .94);

    border: 1px solid rgba(255, 255, 255, .10);

    box-shadow:
        0 .5rem 1.25rem rgba(0, 0, 0, .22);
}

.reader-floating-voice {
    background: transparent;
    color: rgba(255, 255, 255, .94);

    border: 0;
    box-shadow: none;
}

.reader-floating-voice-label {
    color: rgba(255, 255, 255, .94);
}

.reader-floating-voice-button {
    color: rgba(255, 255, 255, .98);
}

.reader-floating-voice-button:hover,
.reader-floating-voice-button:focus,
.reader-floating-voice-button:active {
    background: transparent;
    color: #fff;

    border: 0;
    box-shadow: none;
}

.reader-floating-voice-button:focus-visible {
    outline-color: rgba(255, 255, 255, .90);
}

.reader-floating-progress {
    color: rgba(255, 255, 255, .94);
}

.reader-floating-progress-value {
    color: rgba(255, 255, 255, .94);
}

.reader-floating-progress-bar {
    background: rgba(255, 255, 255, .22);
}

.reader-floating-progress-fill {
    background: rgba(255, 255, 255, .96);
}


/* ============================================================
   READER FLOATING BAR — BOOK TITLE ACCENT
   Presentation-only override.
   ============================================================ */

.reader-floating-chapter-title {
    color: #f0b89f;
}


/* ============================================================
   READER FLOATING BAR — MOBILE PORTRAIT TWO ROWS
   Presentation-only override.
   Portrait: 2 rows.
   Landscape: remains 1 row.
   No HTML / JS changes.
   ============================================================ */

@media (max-width: 700px) and (orientation: portrait) {

    .reader-floating-controls {
        display: grid;

        grid-template-columns:
            auto
            minmax(0, 1fr);

        column-gap: .75rem;
        row-gap: .35rem;

        align-items: center;
    }

    .reader-floating-back {
        grid-column: 1;
        grid-row: 1;
    }

    .reader-floating-chapter {
        grid-column: 2;
        grid-row: 1;

        min-width: 0;
    }

    .reader-floating-voice {
        grid-column: 1;
        grid-row: 2;
    }

    .reader-floating-progress {
        grid-column: 2;
        grid-row: 2;

        min-width: 0;
    }
}


/* ============================================================
 * UNIVERSAL BOOK FACTORY
 * Centralized component rules
 * ============================================================ */

.factory-actions {
    margin-top: 24px;
}


#factory-public-price-group[hidden],
#factory-author-price-group[hidden],
#factory-edit-author-price-group[hidden],
#factory-mixed-pricing-note[hidden],
#factory-chapter-author-price-group[hidden] {
    display: none !important;
}

#factory-chapter-pricing-group label {
    display: inline-flex;
    align-items: center;
    gap: 0;
}
/* ============================================================
 * UNIVERSAL BOOK FACTORY — WYSIWYG EDITOR
 * ============================================================ */

#factory-edit-chapter-editor,
#factory-chapter-editor {
    background: #fff;
}
/* ============================================================
 * UNIVERSAL BOOK FACTORY — CHAPTER SUBMISSION UI
 * ============================================================ */

.factory-lock-message {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    line-height: 1.5;
}

.chapter-declaration-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.55);
}

.chapter-declaration-modal[hidden] {
    display: none;
}

.chapter-declaration-dialog {
    width: min(100%, 560px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.chapter-declaration-header {
    padding: 22px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.chapter-declaration-header h2 {
    margin: 0;
}

.chapter-declaration-body {
    padding: 20px 24px;
}

.chapter-declaration-body > p:first-child {
    margin-top: 0;
}

.chapter-declaration-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 14px 0;
    line-height: 1.5;
    cursor: pointer;
}

.chapter-declaration-item input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 3px;
}

.chapter-declaration-error {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chapter-declaration-error[hidden] {
    display: none;
}

.chapter-declaration-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 22px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 640px) {

    .chapter-declaration-modal {
        padding: 12px;
    }

    .chapter-declaration-dialog {
        max-height: calc(100vh - 24px);
    }

    .chapter-declaration-header,
    .chapter-declaration-body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .chapter-declaration-actions {
        flex-direction: column-reverse;
        padding-left: 18px;
        padding-right: 18px;
    }

    .chapter-declaration-actions .btn {
        width: 100%;
    }
}


#factory-edit-chapter-editor .ql-editor,
#factory-chapter-editor .ql-editor {
    min-height: 360px;
}

#factory-edit-chapter-content,
#factory-chapter-content {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px 0 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}