@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --burgundy: #6f1d3a;
    --burgundy-dark: #4a1026;
    --burgundy-soft: #f1e4e8;

    --ivory: #f7f1e7;
    --paper: #fffdf8;

    --charcoal: #292525;
    --charcoal-soft: #494240;

    --muted: #756c67;
    --muted-light: #918984;

    --gold: #b18a52;
    --gold-soft: #d9c7a5;

    --border: #ded4c8;

    --shadow: 0 10px 28px rgba(50, 35, 35, 0.07);
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--ivory);
    color: var(--charcoal);
    font-family: "Manrope", sans-serif;
}

/* =====================================================
   HEADER
===================================================== */

.header {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 52px;
    background: var(--charcoal);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--burgundy);
    color: var(--ivory);
    font-family: "Cormorant Garamond", serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-info h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
}

.brand-info span {
    display: block;
    margin-top: 4px;
    color: #aaa19b;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.6px;
}

.header-actions { display: flex; align-items: center; gap: 18px; }
.header-actions a, .header-logout { color: #ddd3cc; background: transparent; border: 0; padding: 0; font: 600 10px "Manrope", sans-serif; letter-spacing: .6px; text-decoration: none; cursor: pointer; }
.header-actions .header-join { min-height: 34px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid rgba(177,138,82,.75); color: #e2c797; }
.header-actions a:hover, .header-logout:hover { color: #fff; }

/* =====================================================
   MAIN
===================================================== */

.main-container {
    width: min(1180px, calc(100% - 104px));
    margin: 0 auto;
    padding: 62px 0 75px;
}

/* =====================================================
   HERO
===================================================== */

.hero {
    padding: 10px 0 58px;
    border-bottom: 1px solid var(--border);
}

.hero-eyebrow,
.section-eyebrow {
    color: var(--gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
}

.hero h1 {
    margin-top: 11px;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(44px, 5vw, 66px);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -1px;
}

.hero h1 span {
    color: var(--burgundy);
}

.hero p:last-child {
    max-width: 560px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

/* =====================================================
   BROWSE
===================================================== */

.browse-controls {
    padding: 38px 0 12px;
}

.search-box {
    width: 100%;
    max-width: 760px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    background: var(--paper);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.search-box:focus-within {
    border-color: rgba(111, 29, 58, 0.5);
    box-shadow: 0 0 0 3px rgba(111, 29, 58, 0.06);
}

.search-icon {
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--burgundy);
    font-size: 22px;
}

.search-box input {
    width: 100%;
    height: 52px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--charcoal);
    font-family: "Manrope", sans-serif;
    font-size: 12px;
}

.search-box input::placeholder {
    color: #a29a94;
}

/* =====================================================
   GENRE
===================================================== */

.genre-section {
    margin-top: 40px;
}

.genre-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 17px;
}

.genre-header h2 {
    margin-top: 6px;
    font-family: "Cormorant Garamond", serif;
    font-size: 29px;
    font-weight: 600;
}

#genreCount {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.genre-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-button {
    min-height: 36px;
    padding: 0 16px;
    border: 1px solid var(--border);
    background: var(--paper);
    color: var(--muted);
    font-family: "Manrope", sans-serif;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.genre-button:hover {
    border-color: var(--burgundy);
    color: var(--burgundy);
}

.genre-button.active {
    border-color: var(--burgundy);
    background: var(--burgundy);
    color: #fff;
}

/* =====================================================
   NOVEL SECTION
===================================================== */

.novels-section {
    margin-top: 52px;
}

.section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title h2 {
    margin-top: 6px;
    font-family: "Cormorant Garamond", serif;
    font-size: 31px;
    font-weight: 600;
}

.novel-count {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

/* =====================================================
   NOVEL LIST
===================================================== */

.novels-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* =====================================================
   NOVEL CARD
===================================================== */

.novel-card {
    min-width: 0;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--border);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.novel-card:hover {
    transform: translateY(-3px);
    border-color: rgba(111, 29, 58, 0.35);
    box-shadow: var(--shadow);
}

.novel-card-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--ivory);
}

.novel-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.35s ease;
}

.novel-card:hover .novel-card-cover img {
    transform: scale(1.025);
}

.novel-card-content {
    padding: 21px;
}

body.library-page { display: grid; grid-template-columns: 244px minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
body.library-page .header, body.library-page footer { grid-column: 1 / -1; }
body.library-page .main-container { width: min(1180px, calc(100% - 72px)); }
.library-sidebar { grid-column: 1; grid-row: 2; min-height: calc(100vh - 158px); padding: 24px 14px; background: var(--charcoal); color: #d8d0ca; }
.library-sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.09); }
.library-sidebar-brand > span, .library-sidebar-user > span { display: grid; place-items: center; width: 38px; height: 38px; background: var(--burgundy); color: var(--ivory); font-family: "Cormorant Garamond", serif; font-weight: 700; }
.library-sidebar-brand strong { display: block; color: #fff; font: 600 20px "Cormorant Garamond", serif; }
.library-sidebar-brand small { display: block; margin-top: 3px; color: #978d87; font-size: 8px; letter-spacing: 1.4px; text-transform: uppercase; }
.library-sidebar-nav { display: grid; gap: 4px; padding: 22px 0; }
.library-sidebar-nav a { min-height: 42px; display: flex; align-items: center; padding: 0 12px; color: #c7bdb7; text-decoration: none; font-size: 11px; font-weight: 600; border-left: 2px solid transparent; }
.library-sidebar-nav a:hover, .library-sidebar-nav a.active { background: rgba(255,255,255,.06); color: #fff; border-left-color: var(--gold); }
.library-sidebar-user { margin-top: auto; padding: 17px 8px 0; border-top: 1px solid rgba(255,255,255,.09); }
.library-sidebar-user > span { float: left; width: 32px; height: 32px; margin-right: 9px; border-radius: 50%; font-size: 11px; }
.library-sidebar-user strong { display: block; padding-top: 2px; color: #fff; font-size: 11px; }
.library-sidebar-user button { margin-top: 13px; width: 100%; min-height: 33px; border: 1px solid rgba(255,255,255,.13); background: transparent; color: #c7bdb7; font: 700 9px "Manrope", sans-serif; cursor: pointer; }
.library-sidebar-user button:hover { color: #fff; border-color: var(--gold); }

.novel-card-content > p { margin-top: 6px; color: var(--muted); font-size: 10px; }

.novel-card h3 {
    color: var(--charcoal);
    font-family: "Cormorant Garamond", serif;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.15;
}

.novel-card-author {
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
}

.novel-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.novel-card-meta span {
    color: var(--burgundy);
    font-size: 9px;
    font-weight: 700;
}

.novel-card-description {
    margin-top: 12px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}

.novel-card-button,
.read-button,
.add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 17px;
    border: 1px solid var(--burgundy);
    background: var(--burgundy);
    color: #fff;
    text-decoration: none;
    font-family: "Manrope", sans-serif;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.novel-card-button:hover,
.read-button:hover,
.add-button:hover {
    background: var(--burgundy-dark);
    border-color: var(--burgundy-dark);
}

/* =====================================================
   LOADING / EMPTY / ERROR
===================================================== */

.loading {
    grid-column: 1 / -1;
    padding: 70px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.empty-state,
.no-results {
    grid-column: 1 / -1;
    padding: 70px 25px;
    text-align: center;
    background: var(--paper);
    border: 1px solid var(--border);
}

.empty-state h3,
.no-results h3 {
    font-family: "Cormorant Garamond", serif;
    font-size: 25px;
    font-weight: 600;
}

.empty-state p,
.no-results p {
    max-width: 420px;
    margin: 8px auto 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

/* =====================================================
   SCRAPER PAGE
===================================================== */

body:has(#scrapeForm) .main-container {
    max-width: 950px;
}

body:has(#scrapeForm) .hero {
    text-align: center;
}

body:has(#scrapeForm) .hero h1 {
    font-size: clamp(42px, 5vw, 58px);
}

body:has(#scrapeForm) .hero p:last-child {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.url-input-container {
    max-width: 760px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    margin: 28px auto 0;
    background: var(--paper);
    border: 1px solid var(--border);
}

.url-input-container input {
    min-width: 0;
    height: 52px;
    padding: 0 17px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--charcoal);
    font-family: "Manrope", sans-serif;
    font-size: 12px;
}

.url-input-container button {
    min-width: 145px;
    border: none;
    background: var(--burgundy);
    color: #fff;
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.url-input-container button:hover {
    background: var(--burgundy-dark);
}

.example-url {
    margin-top: 12px;
    color: #958b85;
    font-size: 10px;
}

.message {
    margin-top: 15px;
    font-size: 11px;
}

.scraping-status {
    margin-top: 10px;
    color: var(--muted);
    font-size: 10px;
}

.scraper-navigation {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 35px;
}

/* =====================================================
   FOOTER
===================================================== */

footer {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 52px;
    background: var(--charcoal);
    color: #aaa19b;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 14px;
}

.footer-brand strong {
    display: block;
    color: #fff;
    font-family: "Cormorant Garamond", serif;
    font-size: 18px;
    font-weight: 600;
}

.footer-brand span {
    display: block;
    margin-top: 2px;
    color: #8f8782;
    font-size: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

footer > span {
    font-size: 9px;
    letter-spacing: 0.8px;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1050px) {
    .novels-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    body.library-page { display: block; }
    .library-sidebar { min-height: auto; padding: 11px 18px; }
    .library-sidebar-brand, .library-sidebar-user { display: none; }
    .library-sidebar-nav { display: flex; overflow-x: auto; padding: 0; }
    .library-sidebar-nav a { flex: 0 0 auto; min-height: 36px; font-size: 10px; }
    body.library-page .main-container { width: min(100% - 50px, 720px); }
    .header {
        padding: 16px 25px;
    }

    .main-container {
        width: min(100% - 50px, 720px);
        padding-top: 45px;
    }

    .header-text {
        display: none;
    }

    .novel-card-cover {
        height: 280px;
    }

    footer {
        padding: 18px 25px;
    }
}

@media (max-width: 600px) {
    .header {
        min-height: 70px;
    }

    .main-container {
        width: calc(100% - 34px);
        padding: 35px 0 55px;
    }

    .hero {
        padding-bottom: 42px;
    }

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

    .genre-header,
    .section-title {
        align-items: flex-start;
        gap: 15px;
    }

    .novels-list {
        grid-template-columns: 1fr;
    }

    .novel-card-cover {
        height: 360px;
    }

    .url-input-container {
        grid-template-columns: 1fr;
    }

    .url-input-container button {
        min-height: 48px;
    }

    footer {
        display: block;
    }

    footer > span {
        display: block;
        margin-top: 12px;
    }
}

@media (max-width: 400px) {
    .brand-info h2 {
        font-size: 19px;
    }

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

    .novel-card-cover {
        height: 320px;
    }

    .novel-card-content {
        padding: 17px;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--burgundy);
    color: var(--ivory);
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-text {
    font-family: "Cormorant Garamond", serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--ivory);
}

/* ============================================================
   NOVEL CARD ACTION BUTTONS
   ============================================================ */

.novel-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.novel-card-actions button {
    flex: 1;
    min-height: 42px;
    border: 1px solid var(--burgundy);
    border-radius: 8px;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.novel-card-actions .read-button {
    background: var(--burgundy);
    color: var(--ivory);
}

.novel-card-actions .read-button:hover {
    background: var(--burgundy-dark);
    border-color: var(--burgundy-dark);
}

.novel-card-actions .edit-button {
    background: var(--burgundy);
    color: var(--ivory);
}

.novel-card-actions .edit-button:hover {
    background: var(--burgundy-dark);
    border-color: var(--burgundy-dark);
}

/* ============================================================
   PROFESSIONAL CHAPTER LIST
   ============================================================ */

.chapters-section {
    width: 100%;
    max-width: 900px;
    margin: 42px auto 0;
}

.chapters-section h2 {
    margin-bottom: 18px;
    color: var(--charcoal);
    font-family: "Cormorant Garamond", serif;
    font-size: 32px;
    font-weight: 700;
}

#chaptersList {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual Chapter */

.chapter-item {
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 15px 20px;

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

    cursor: pointer;

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

.chapter-item:hover {
    background: var(--ivory);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(41, 37, 37, 0.07);
}

/* Chapter Number */

.chapter-number {
    min-width: 42px;
    height: 42px;

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

    border-radius: 8px;

    background: var(--burgundy-soft);
    color: var(--burgundy);

    font-family: "Manrope", sans-serif;
    font-size: 14px;
    font-weight: 700;
}

/* Chapter Information */

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

.chapter-title {
    margin: 0;

    color: var(--charcoal);

    font-family: "Manrope", sans-serif;
    font-size: 15px;
    font-weight: 600;

    line-height: 1.4;
}

.chapter-date {
    margin-top: 4px;

    color: var(--muted);

    font-family: "Manrope", sans-serif;
    font-size: 12px;
}

/* Chapter Arrow */

.chapter-arrow {
    color: var(--gold);
    font-size: 20px;
    font-weight: 600;

    transition: transform 0.2s ease;
}

.chapter-item:hover .chapter-arrow {
    transform: translateX(4px);
}

/* Chapter Count */

.chapter-count {
    margin-bottom: 14px;

    color: var(--muted);

    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 500;
}

/* Mobile */

@media (max-width: 650px) {

    .chapters-section {
        margin-top: 30px;
    }

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

    .chapter-item {
        padding: 13px 14px;
        gap: 12px;
    }

    .chapter-number {
        min-width: 38px;
        height: 38px;
        font-size: 12px;
    }

    .chapter-title {
        font-size: 14px;
    }

    .chapter-arrow {
        font-size: 17px;
    }
}

/* ============================================================
   PROFESSIONAL CHAPTER NAVIGATION
   ============================================================ */

#chaptersList {
    width: 100%;
    max-width: 920px;
    margin: 24px auto 0;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.chapter-button {
    width: 100%;
    min-height: 58px;

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

    padding: 14px 18px;

    background: var(--paper);
    color: var(--charcoal);

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

    font-family: "Manrope", sans-serif;
    font-size: 14px;
    font-weight: 600;

    text-align: left;
    cursor: pointer;

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

.chapter-button:hover {
    background: var(--ivory);
    border-color: var(--gold);

    transform: translateY(-2px);

    box-shadow:
        0 8px 18px rgba(41, 37, 37, 0.08);
}

.chapter-button span:first-child {
    color: var(--charcoal);
}

.chapter-button span:last-child {
    flex-shrink: 0;

    color: var(--gold);

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

    transition: transform 0.2s ease;
}

.chapter-button:hover span:last-child {
    transform: translateX(4px);
}

/* Chapter count */

#chapterCount {
    color: var(--muted);

    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 500;
}

/* Empty chapters */

.empty-message {
    width: 100%;
    padding: 30px;

    color: var(--muted);

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

    text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 700px) {

    #chaptersList {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .chapter-button {
        min-height: 54px;
        padding: 13px 15px;
    }
}

.reader-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #eee3d4;
}

#readerContent {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 58px 36px 75px;
    color: #3b3531;
    font-family:
        "Cormorant Garamond",
        Georgia,
        "Times New Roman",
        serif;
    font-size: 20px;
    line-height: 1.95;
    letter-spacing: 0.1px;
}

#readerContent {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 58px 36px 75px;

    color: #3b3531;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 20px;
    line-height: 1.95;
    letter-spacing: 0.15px;
}

#readerContent p {
    margin: 0 0 24px;
}

#readerContent h1,
#readerContent h2,
#readerContent h3 {
    margin: 0 0 28px;

    color: var(--novel-burgundy);

    font-family:
        "Cormorant Garamond",
        Georgia,
        serif;

    font-weight: 700;
    line-height: 1.3;
}

#readerContent strong {
    color: var(--novel-charcoal);
}

/* ============================================================
   GLOBAL WEBSITE BACK BUTTON
   ============================================================ */

.global-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    min-height: 42px;

    margin-bottom: 20px;
    padding: 9px 15px;

    background: var(--novel-paper, #fffdf8);

    border: 1px solid var(--novel-border, #ded4c8);
    border-radius: 10px;

    color: var(--novel-charcoal, #292525);

    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

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

.global-back-button:hover {
    background: var(--novel-ivory, #f7f1e7);
    border-color: var(--novel-gold, #b18a52);

    transform: translateX(-2px);

    box-shadow:
        0 4px 12px
        rgba(41, 37, 37, 0.06);
}

.global-back-button:active {
    transform: translateX(0);
}

.global-back-button:focus-visible {
    outline:
        2px solid
        var(--novel-gold, #b18a52);

    outline-offset: 2px;
}

.global-back-button span:first-child {
    font-size: 18px;
    line-height: 1;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 650px) {

    .global-back-button {
        min-height: 40px;

        margin-bottom: 16px;
        padding: 8px 13px;

        font-size: 12px;
    }

    .global-back-button span:first-child {
        font-size: 17px;
    }

}

.novel-cover {
    width: 100%;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee8dc;
    overflow: hidden;
    border-radius: 8px;
}

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

.reader-chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.premium-badge {
    margin-left: auto;
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f1e4e8;
    color: #6f1d3a;
    border: 1px solid rgba(111, 29, 58, 0.18);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.reader-container.chapter-list-open .reader-body {
    display: none;
}

.reader-container.chapter-list-open {
    height: min(760px, calc(100vh - 48px));
}

.reader-container.chapter-list-open #readerChapterList {
    flex: 1;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
}

/* ============================================================
   FULL CHAPTER LIST MODE
============================================================ */

.reader-container.chapter-list-open {
    height: min(760px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
}

.reader-container.chapter-list-open .reader-body {
    display: none !important;
}

.reader-container.chapter-list-open #readerChapterList {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 20px;
}

.reader-container.chapter-list-open #readerChapters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.reader-container.chapter-list-open
.reader-chapter-item {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    background: var(--paper, #fffdf8);
    color: var(--charcoal, #292525);
    border: 1px solid var(--border, #ded4c8);
    text-align: left;
    cursor: pointer;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.reader-container.chapter-list-open
.reader-chapter-item:hover {
    background: #f3ede3;
    border-color: var(--gold, #b18a52);
}

.reader-container.chapter-list-open
.reader-chapter-item.active {
    background: var(--burgundy-soft, #f1e4e8);
    color: var(--burgundy, #6f1d3a);
    border-color: var(--burgundy, #6f1d3a);
}

.reader-container.chapter-list-open
.chapter-number {
    display: block;
    width: 100%;
}

/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 650px) {

    .reader-container.chapter-list-open
    #readerChapterList {
        padding: 15px;
    }

    .reader-container.chapter-list-open
    #readerChapters {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .reader-container.chapter-list-open
    .reader-chapter-item {
        min-height: 48px;
        padding: 0 15px;
    }
}