/* =========================================================
   NovelSite — "Reading Room After Midnight"
   A dim, lamplit reading-room theme: deep ink surfaces, warm
   gold for actions and coins, rose for hearts and highlights.
   Signature device: a folded dog-ear corner + colored "spine"
   edge on every novel cover, and ribbon-shaped tags for badges.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    /* Ink & surfaces */
    --dark: #15121F;
    --bg: #1B1730;
    --card-bg: #241F3B;
    --card-bg-2: #2C2648;
    --border: #362F52;

    /* Text */
    --text: #F1ECE4;
    --muted: #A79FC0;

    /* Accents */
    --primary: #E8607C;   /* rose — CTAs, likes, premium */
    --gold: #E8A33D;      /* lamplight gold — coins, ratings, signature */
    --success-text: #6FC495;
    --success-bg: rgba(111, 196, 149, 0.14);
    --error-text: #FF8A93;
    --error-bg: rgba(232, 96, 107, 0.14);

    /* Type */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: inherit; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.site-header {
    background: rgba(21, 18, 31, 0.9);
    backdrop-filter: blur(10px);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.logo {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    font-style: italic;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.3px;
}
.logo-img { max-height: 40px; display: block; }
.site-header nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-header nav a {
    color: #d8d3e6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease;
}
.site-header nav a:hover { color: var(--gold); }
.coins { color: var(--gold) !important; font-weight: 700; font-size: 14px; text-decoration: none; }
.username { color: #fff !important; font-weight: 600; }

.nav-btn {
    padding: 7px 16px;
    border-radius: 6px;
    font-weight: 700 !important;
    font-size: 13px !important;
    color: #fff !important;
    text-decoration: none;
}
.nav-btn-login { background: var(--success-text); color: #0e2116 !important; }
.nav-btn-logout, .nav-btn-signup { background: var(--primary); }
.nav-btn-login:hover { background: #5cb583; }
.nav-btn-logout:hover, .nav-btn-signup:hover { background: #d94f6a; }

main { min-height: 70vh; padding: 34px 0; }

h1 { font-family: var(--font-display); font-weight: 700; font-size: 32px; letter-spacing: 0.2px; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; }

/* ---------------------------------------------------------
   Hero (homepage)
   --------------------------------------------------------- */
.hero {
    padding: 44px 0 8px;
    animation: heroRise 0.6s ease both;
}
@keyframes heroRise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
}
.hero h1 {
    font-size: 44px;
    line-height: 1.15;
    max-width: 620px;
    margin-bottom: 10px;
}
.hero h1 em { color: var(--primary); font-style: italic; }
.hero-sub {
    color: var(--muted);
    font-size: 16px;
    max-width: 520px;
    margin-bottom: 24px;
}

/* ---------------------------------------------------------
   Novel grid + card (signature: dog-ear fold + spine edge)
   --------------------------------------------------------- */
.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 22px;
    margin-top: 20px;
}
.novel-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 4px 10px 10px 4px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    text-decoration: none;
    color: var(--text);
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid var(--gold);
}
.novel-card:nth-child(3n+2) { border-left-color: var(--primary); }
.novel-card:nth-child(3n+3) { border-left-color: #7C9CE0; }
.novel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(232, 163, 61, 0.18);
}
.novel-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, var(--primary), #6B4FA0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    padding: 10px;
    object-fit: cover;
}
/* dog-ear fold — the signature */
.novel-cover::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 22px 22px 0;
    border-color: transparent rgba(21,18,31,0.75) transparent transparent;
}
.novel-info { padding: 12px 14px; }
.novel-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.novel-meta { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------
   Categories
   --------------------------------------------------------- */
.category-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.category-pill {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 9px 18px 9px 22px;
    border-radius: 3px 14px 14px 3px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.category-pill::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--gold);
    border-radius: 3px 0 0 3px;
}
.category-pill:hover { border-color: var(--gold); color: var(--gold); }

/* ---------------------------------------------------------
   Forms & cards
   --------------------------------------------------------- */
.form-card {
    max-width: 420px;
    margin: 40px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
}
.form-card h1 { font-size: 24px; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: #FAF7F1;
    color: #241F3B;
    font-family: var(--font-body);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}
.btn {
    display: inline-block;
    background: var(--gold);
    color: #1B1730;
    border: none;
    padding: 11px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, background 0.15s ease;
    font-family: var(--font-body);
}
.btn:hover { background: #F2B457; transform: translateY(-1px); }
.error-box {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,138,147,0.25);
}
.success-box {
    background: var(--success-bg);
    color: var(--success-text);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid rgba(111,196,149,0.25);
}

/* ---------------------------------------------------------
   Novel detail
   --------------------------------------------------------- */
.novel-detail { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 30px; }
.novel-detail .novel-cover { width: 220px; border-radius: 4px 10px 10px 4px; border-left: 4px solid var(--gold); }
.novel-detail-info { flex: 1; min-width: 260px; }
.novel-detail-info h1 { font-size: 28px; margin-bottom: 10px; }
.chapter-list { list-style: none; margin-top: 20px; }
.chapter-list li {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
}
.chapter-list a {
    display: flex;
    justify-content: space-between;
    padding: 13px 16px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
}
.chapter-list a:hover { color: var(--gold); }
.chapter-list .lock {
    color: #1B1730;
    background: var(--gold);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px 3px 14px;
    border-radius: 2px 10px 10px 2px;
    position: relative;
}

/* ---------------------------------------------------------
   Chapter reader
   --------------------------------------------------------- */
.reader-box {
    background: #FBF7EF;
    color: #2B2B3A;
    padding: 34px;
    border-radius: 10px;
    max-width: 720px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.9;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.reader-box h1 { font-size: 23px; margin-bottom: 20px; color: #2B2B3A; }
#reader-content p { margin-bottom: 1.1em; }
#reader-content p:last-child { margin-bottom: 0; }
.reader-box .novel-meta a { color: var(--primary); text-decoration: none; }
.reader-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; flex-wrap: wrap; gap: 10px; }
.reader-toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-btn {
    background: #F0E9DA;
    border: 1px solid #E0D6C0;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #2B2B3A;
    font-family: var(--font-body);
    font-weight: 600;
}
.toolbar-btn:hover { background: #E5DAC4; }

/* Locked chapter panel — wax-seal styling */
.lock-panel {
    margin-top: 10px;
    padding: 34px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(251,247,239,0) 0%, #F3ECDC 15%, #F3ECDC 100%);
    border-top: 1px solid #E0D6C0;
    border-radius: 0 0 10px 10px;
}
.lock-icon {
    font-size: 26px;
    width: 54px;
    height: 54px;
    line-height: 54px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    margin: 0 auto 14px;
    box-shadow: 0 3px 10px rgba(232,96,124,0.4);
}
.lock-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-bottom: 6px; color: #2B2B3A; }
.lock-sub { font-size: 14px; color: #6b6478; max-width: 420px; margin: 0 auto 18px; }
.lock-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* Reading themes (user-selected — independent of site chrome) */
.reader-box.theme-dark { background: #1e1e2b; color: #e4e4ef; }
.reader-box.theme-dark h1, .reader-box.theme-dark .lock-title { color: #e4e4ef; }
.reader-box.theme-dark .lock-panel { background: linear-gradient(180deg, rgba(30,30,43,0) 0%, #17171f 15%, #17171f 100%); border-color: #333; }
.reader-box.theme-dark .lock-sub { color: #a79fc0; }
.reader-box.theme-dark .toolbar-btn { background: #2a2a3a; border-color: #3a3a4a; color: #e4e4ef; }
.reader-box.theme-gray { background: #eef0f2; color: #333; }
.reader-box.font-serif #reader-content { font-family: Georgia, 'Times New Roman', serif; }
.reader-box.font-sans #reader-content { font-family: Arial, Helvetica, sans-serif; }
.reader-box.font-georgia #reader-content { font-family: Georgia, serif; }
.reader-box.font-system #reader-content { font-family: var(--font-body); }

/* ---------------------------------------------------------
   Ratings, likes, favorites
   --------------------------------------------------------- */
.rating-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.stars { font-size: 21px; cursor: pointer; }
.stars .star { color: #443a63; transition: color 0.1s ease; }
.stars .star.filled { color: var(--gold); }
.stars .star:hover { color: var(--gold); }
.action-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.action-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 600;
}
.action-btn:hover { border-color: var(--primary); }
.continue-reading-box {
    margin-top: 18px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(232,163,61,0.14), rgba(232,96,124,0.1));
    border: 1px solid rgba(232,163,61,0.3);
    border-radius: 8px;
}

/* Password visibility toggle */
.password-field { position: relative; display: flex; }
.password-field .pw-input { flex: 1; padding-right: 44px; }
.pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 4px 8px;
}

/* ---------------------------------------------------------
   Modal (chapter list, reader settings)
   --------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,8,18,0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-family: var(--font-display); font-size: 17px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-search { margin: 14px 20px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; background: #FAF7F1; color: #241F3B; }
.chapter-list-results { overflow-y: auto; padding: 10px 20px; flex: 1; }
.chapter-list-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.chapter-list-item.current { color: var(--gold); font-weight: 700; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); }
.page-btn { border: 1px solid var(--border); background: var(--card-bg); color: var(--text); border-radius: 4px; padding: 5px 11px; font-size: 12px; cursor: pointer; }
.page-btn.active { background: var(--gold); color: #1B1730; border-color: var(--gold); font-weight: 700; }

/* Settings panel */
.settings-group { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.settings-group label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.settings-row { display: flex; gap: 8px; }
.settings-option { flex: 1; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); border-radius: 6px; padding: 8px; font-size: 13px; cursor: pointer; }
.settings-option.active { background: var(--gold); color: #1B1730; border-color: var(--gold); font-weight: 700; }
.settings-select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #FAF7F1; color: #241F3B; }

/* ---------------------------------------------------------
   Plans / pricing
   --------------------------------------------------------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-top: 20px; }
.plan-card { background: var(--card-bg); border-radius: 10px; padding: 26px 20px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.3); border: 2px solid var(--border); }
.plan-card.active-plan { border-color: var(--gold); }
.plan-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.plan-price { font-size: 25px; font-weight: 800; color: var(--gold); margin-bottom: 4px; }
.plan-duration { font-size: 12px; color: var(--muted); margin-bottom: 16px; }

/* ---------------------------------------------------------
   Admin tables
   --------------------------------------------------------- */
table { color: var(--text); }
table thead tr { background: var(--dark) !important; }
table tbody tr { border-bottom: 1px solid var(--border) !important; }
table a { color: var(--gold); }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.site-footer { background: var(--dark); color: var(--muted); text-align: center; padding: 26px 0; font-size: 13px; border-top: 1px solid var(--border); }
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a { color: #cfc7e0; text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--gold); }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 640px) {
    .hero h1 { font-size: 32px; }
    .header-inner { padding: 12px 16px; }
    .site-header nav { gap: 12px; }
    .novel-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .reader-box { padding: 22px 16px; }
}

/* ---------------------------------------------------------
   Accessibility & mobile navigation
   --------------------------------------------------------- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--gold);
    color: #1B1730;
    padding: 10px 18px;
    font-weight: 700;
    z-index: 200;
    border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; background: none; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: #fff; margin: 0 auto; }

@media (max-width: 780px) {
    .nav-toggle { display: flex; }
    .site-header nav {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 14px;
        padding: 16px 0 4px;
    }
    .site-header nav.open { display: flex; }
    .header-inner { flex-wrap: wrap; }
}

/* Comfortable touch targets */
.toolbar-btn, .action-btn, .page-btn, .settings-option, .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chapter-list-item, .category-pill { min-height: 40px; }

/* Prevent iOS Safari auto-zoom on form focus */
@media (max-width: 640px) {
    .form-group input, .form-group select, .form-group textarea, .modal-search, .settings-select {
        font-size: 16px;
    }
}

/* ---------------------------------------------------------
   Header live search
   --------------------------------------------------------- */
.header-search { position: relative; flex: 1; max-width: 320px; min-width: 140px; }
.header-search input {
    width: 100%;
    padding: 9px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 14px;
    font-family: var(--font-body);
}
.header-search input::placeholder { color: #9a92b3; }
.header-search input:focus { background: #FAF7F1; color: #241F3B; }
.header-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 50;
    overflow: hidden;
}
.header-search-results.open { display: block; }
.header-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.header-search-item:hover { background: var(--card-bg-2); }
.header-search-item img, .hsr-cover-fallback {
    width: 34px; height: 45px; border-radius: 3px; object-fit: cover; flex-shrink: 0;
}
.hsr-cover-fallback {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), #6B4FA0);
    color: #fff; font-family: var(--font-display); font-weight: 700;
}
.header-search-viewall { display: block; padding: 10px 14px; text-align: center; color: var(--gold); text-decoration: none; font-size: 13px; font-weight: 600; }
.header-search-empty { padding: 14px; font-size: 13px; color: var(--muted); }

@media (max-width: 780px) {
    .header-search { order: 3; max-width: 100%; margin-top: 10px; flex-basis: 100%; }
}

/* ---------------------------------------------------------
   Enhanced novel card badges (rating, likes, category, status)
   --------------------------------------------------------- */
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card-category, .card-status, .card-rating, .card-likes {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px 8px 8px 3px;
}
.card-category { background: rgba(232,163,61,0.15); color: var(--gold); }
.card-status { background: rgba(255,255,255,0.06); color: var(--muted); }
.card-status.status-ongoing { background: rgba(111,196,149,0.16); color: var(--success-text); }
.card-status.status-completed { background: rgba(232,96,124,0.16); color: var(--primary); }
.card-status.status-hiatus { background: rgba(255,255,255,0.06); color: var(--muted); }
.card-rating { background: rgba(232,163,61,0.15); color: var(--gold); }
.card-likes { background: rgba(232,96,124,0.15); color: var(--primary); }
.card-synopsis {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------------------------------------------------
   Curated homepage sections (grid, 6 per section + View More)
   --------------------------------------------------------- */
.novel-section { margin-top: 40px; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.section-more { color: var(--gold); text-decoration: none; font-size: 13px; font-weight: 600; }

/* ---------------------------------------------------------
   Admin navigation (right sidebar desktop, top bar mobile)
   --------------------------------------------------------- */
.admin-layout { display: flex; gap: 24px; flex-direction: row-reverse; align-items: flex-start; }
.admin-content { flex: 1; min-width: 0; }
.admin-nav {
    flex: 0 0 200px;
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}
.admin-nav a {
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.admin-nav a:hover { background: var(--card-bg-2); }
.admin-nav a.active { background: var(--gold); color: #1B1730; }

@media (max-width: 900px) {
    .admin-layout { flex-direction: column; }
    .admin-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
        flex: none;
    }
    .admin-nav a { white-space: nowrap; }
}

/* ---------------------------------------------------------
   Reading settings — small button fixed to the right edge,
   opens a slide-in panel. Stays accessible after closing.
   --------------------------------------------------------- */
.settings-fab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 120;
    background: var(--gold);
    color: #1B1730;
    border: none;
    width: 42px;
    height: 52px;
    border-radius: 8px 0 0 8px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: -2px 2px 10px rgba(0,0,0,0.25);
}
.settings-fab:hover { width: 46px; }
.settings-slide-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    box-shadow: -6px 0 24px rgba(0,0,0,0.35);
    z-index: 130;
    overflow-y: auto;
    transition: right 0.25s ease;
}
.settings-slide-panel.open { right: 0; }
.settings-slide-panel .modal-header { border-bottom: 1px solid var(--border); }
@media (max-width: 480px) {
    .settings-fab { height: 46px; width: 38px; }
}
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn:hover { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Form rows (e.g. chapter number + title side by side) */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { margin-bottom: 16px; }
.form-row-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: end; }
@media (max-width: 640px) {
    .form-row-3col { grid-template-columns: 1fr; }
}

/* Fixed-height, scrollable content editor — stays a manageable
   size no matter how much text/how many paragraphs are entered */
.fixed-height-editor .ql-editor { height: 340px; overflow-y: auto; }

/* List toolbar (search + sort, admin & reader chapter lists) */
.list-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Quill editor — align with site theme */
#chapter-editor { background: #FAF7F1; color: #241F3B; border-radius: 0 0 6px 6px; min-height: 260px; }
.ql-toolbar.ql-snow { border-radius: 6px 6px 0 0; background: #FAF7F1; }
.ql-container.ql-snow { border-color: var(--border); }
.ql-toolbar.ql-snow { border-color: var(--border); }
