/* Chapter reading page */

body.chapter-classic-redesign .chapter-reading-page {
    padding-bottom: 56px;
}

body.chapter-classic-redesign .chapter-reading-page .page-content {
    padding-top: 18px;
}

body.chapter-classic-redesign .chapter-breadcrumb {
    margin-bottom: 16px;
}

body.chapter-classic-redesign .chapter-reader-shell {
    max-width: 980px;
    margin: 0 auto;
}

body.chapter-classic-redesign .chapter-reader-card,
body.chapter-classic-redesign .chapter-toolbar-card {
    background: #f3f4f5;
    border: 1px solid #d6dbe0;
    box-shadow: 0 10px 24px rgba(29, 42, 56, 0.06);
}

body.chapter-classic-redesign .chapter-header {
    padding: 28px 34px 22px;
    margin-bottom: 14px;
    text-align: center;
}

body.chapter-classic-redesign .chapter-reader-kicker {
    margin: 0 0 10px;
    color: #668a2c;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

body.chapter-classic-redesign .story-title {
    margin: 0;
    color: #2f3e4d;
    font-size: 34px;
    line-height: 1.18;
    font-weight: 700;
    text-transform: uppercase;
}

body.chapter-classic-redesign .chapter-name {
    margin: 10px 0 0;
    color: #58708a;
    font-size: 18px;
    line-height: 1.5;
}

body.chapter-classic-redesign .chapter-meta-row {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

body.chapter-classic-redesign .chapter-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #d9e1e7;
    color: #45617d;
    font-size: 14px;
    text-decoration: none;
}

body.chapter-classic-redesign .chapter-meta-pill i {
    color: #668a2c;
}

body.chapter-classic-redesign .chapter-story-back:hover,
body.chapter-classic-redesign .chapter-story-link:hover {
    text-decoration: none;
    color: #1f5f95;
}

body.chapter-classic-redesign .chapter-toolbar-card {
    padding: 16px 18px;
    margin-bottom: 14px;
}

body.chapter-classic-redesign .chapter-toolbar-bottom {
    margin-top: 14px;
}

body.chapter-classic-redesign .chapter-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}

body.chapter-classic-redesign .chapter-nav.bottom {
    margin: 0;
}

body.chapter-classic-redesign .chapter-nav a,
body.chapter-classic-redesign .chapter-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

body.chapter-classic-redesign .chapter-nav a:hover:not(.disabled),
body.chapter-classic-redesign .chapter-nav button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(35, 62, 92, 0.12);
}

body.chapter-classic-redesign .chapter-nav .btn-prev,
body.chapter-classic-redesign .chapter-nav .btn-next {
    background: #6f9951;
    color: #fff;
}

body.chapter-classic-redesign .chapter-nav .btn-prev:hover:not(.disabled),
body.chapter-classic-redesign .chapter-nav .btn-next:hover:not(.disabled) {
    background: #5d8343;
}

body.chapter-classic-redesign .chapter-nav .btn-list {
    background: #2f5f8f;
    color: #fff;
}

body.chapter-classic-redesign .chapter-nav .btn-list:hover {
    background: #244b70;
}

body.chapter-classic-redesign .chapter-nav .disabled {
    background: #ced4da !important;
    color: #7b8793 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

body.chapter-classic-redesign .chapter-content {
    padding: 34px 42px;
}

body.chapter-classic-redesign .chapter-text {
    color: #263847;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
    font-size: 20px;
    line-height: 1.95;
}

body.chapter-classic-redesign .chapter-text p {
    margin: 0 0 1.45em;
    text-align: justify;
}

body.chapter-classic-redesign .chapter-text p:last-child {
    margin-bottom: 0;
}

body.chapter-classic-redesign .chapter-text img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px auto;
}

body.chapter-classic-redesign .keyboard-hint {
    margin: 16px auto 0;
    padding: 12px 18px;
    border: 1px dashed #8cb2d6;
    color: #45617d;
    background: #edf5fb;
    text-align: center;
    font-size: 13px;
}

body.chapter-classic-redesign .keyboard-hint i {
    margin-right: 8px;
}

body.chapter-classic-redesign .settings-toggle {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #2f5f8f;
    color: #fff;
    font-size: 19px;
    box-shadow: 0 14px 30px rgba(27, 47, 70, 0.18);
    z-index: 1100;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

body.chapter-classic-redesign .settings-toggle:hover {
    background: #244b70;
    transform: translateY(-2px);
}

body.chapter-classic-redesign .settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(92vw, 360px);
    padding: 24px;
    border: 1px solid #d6dbe0;
    background: #f8f9fa;
    box-shadow: 0 18px 44px rgba(27, 47, 70, 0.22);
    transform: translate(-50%, -50%) scale(0.96);
    opacity: 0;
    visibility: hidden;
    z-index: 1102;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

body.chapter-classic-redesign .settings-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

body.chapter-classic-redesign .settings-panel h4 {
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d6dbe0;
    color: #2f3e4d;
    font-size: 18px;
    font-weight: 700;
}

body.chapter-classic-redesign .setting-item {
    margin-bottom: 18px;
}

body.chapter-classic-redesign .setting-item label {
    display: block;
    margin-bottom: 10px;
    color: #4d6478;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.chapter-classic-redesign .font-size-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.chapter-classic-redesign .font-size-controls button,
body.chapter-classic-redesign .btn-close-settings {
    min-height: 42px;
    border: 1px solid #d6dbe0;
    background: #fff;
    color: #2f3e4d;
    cursor: pointer;
}

body.chapter-classic-redesign .font-size-controls button {
    min-width: 42px;
    font-weight: 700;
}

body.chapter-classic-redesign .font-size-controls span {
    min-width: 62px;
    color: #58708a;
    font-weight: 700;
    text-align: center;
}

body.chapter-classic-redesign .theme-colors {
    display: flex;
    gap: 12px;
}

body.chapter-classic-redesign .color-btn {
    width: 38px;
    height: 38px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

body.chapter-classic-redesign .color-btn:hover,
body.chapter-classic-redesign .color-btn.active {
    border-color: #2f5f8f;
    transform: scale(1.08);
}

body.chapter-classic-redesign .color-btn.white {
    background: #ffffff;
    border-color: #d6dbe0;
}

body.chapter-classic-redesign .color-btn.beige {
    background: #f5f1e6;
}

body.chapter-classic-redesign .color-btn.gray {
    background: #eceff2;
}

body.chapter-classic-redesign .color-btn.dark {
    background: #22313f;
}

body.chapter-classic-redesign .btn-close-settings {
    width: 100%;
    margin-top: 8px;
    font-weight: 700;
}

body.chapter-classic-redesign .chapter-list-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(100vw, 420px);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-left: 1px solid #d6dbe0;
    box-shadow: -12px 0 32px rgba(29, 42, 56, 0.14);
    transform: translateX(100%);
    transition: transform 0.2s ease;
    z-index: 1101;
}

body.chapter-classic-redesign .chapter-list-panel.active {
    transform: translateX(0);
}

body.chapter-classic-redesign .chapter-list-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: #2f5f8f;
    color: #fff;
}

body.chapter-classic-redesign .chapter-list-panel .panel-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

body.chapter-classic-redesign .chapter-list-panel .btn-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
}

body.chapter-classic-redesign .chapter-list-panel .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}

body.chapter-classic-redesign .chapter-list-panel .loading,
body.chapter-classic-redesign .chapter-list-panel .error {
    padding: 18px 0;
    color: #4d6478;
    text-align: center;
}

body.chapter-classic-redesign .chapter-list-panel .chapter-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.chapter-classic-redesign .chapter-list-panel .chapter-list li {
    border-bottom: 1px dashed #d6dbe0;
    padding: 10px 0;
}

body.chapter-classic-redesign .chapter-list-panel .chapter-list a {
    color: #2f5f8f;
    text-decoration: none;
    line-height: 1.5;
}

body.chapter-classic-redesign .chapter-list-panel .chapter-list a:hover {
    text-decoration: underline;
}

body.chapter-classic-redesign .overlay {
    position: fixed;
    inset: 0;
    background: rgba(19, 28, 38, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1100;
}

body.chapter-classic-redesign .overlay.active {
    opacity: 1;
    visibility: visible;
}

body.chapter-classic-redesign.theme-white .chapter-reading-page {
    background: transparent;
}

body.chapter-classic-redesign.theme-beige .chapter-reader-card,
body.chapter-classic-redesign.theme-beige .chapter-toolbar-card,
body.chapter-classic-redesign.theme-beige .settings-panel,
body.chapter-classic-redesign.theme-beige .chapter-list-panel {
    background: #f5f1e6;
}

body.chapter-classic-redesign.theme-beige .chapter-content {
    background: #fbf7ed;
}

body.chapter-classic-redesign.theme-gray .chapter-reader-card,
body.chapter-classic-redesign.theme-gray .chapter-toolbar-card,
body.chapter-classic-redesign.theme-gray .settings-panel,
body.chapter-classic-redesign.theme-gray .chapter-list-panel {
    background: #edf1f4;
}

body.chapter-classic-redesign.theme-gray .chapter-content {
    background: #f7f9fb;
}

body.chapter-classic-redesign.theme-dark .chapter-reading-page {
    color: #dbe3eb;
}

body.chapter-classic-redesign.theme-dark .chapter-reader-card,
body.chapter-classic-redesign.theme-dark .chapter-toolbar-card,
body.chapter-classic-redesign.theme-dark .settings-panel,
body.chapter-classic-redesign.theme-dark .chapter-list-panel {
    background: #22313f;
    border-color: #31485c;
    box-shadow: none;
}

body.chapter-classic-redesign.theme-dark .story-title,
body.chapter-classic-redesign.theme-dark .settings-panel h4,
body.chapter-classic-redesign.theme-dark .chapter-list-panel .panel-header h4 {
    color: #f2f6fb;
}

body.chapter-classic-redesign.theme-dark .chapter-name,
body.chapter-classic-redesign.theme-dark .font-size-controls span,
body.chapter-classic-redesign.theme-dark .keyboard-hint,
body.chapter-classic-redesign.theme-dark .chapter-list-panel .loading,
body.chapter-classic-redesign.theme-dark .chapter-list-panel .error {
    color: #b8c7d5;
}

body.chapter-classic-redesign.theme-dark .chapter-meta-pill,
body.chapter-classic-redesign.theme-dark .font-size-controls button,
body.chapter-classic-redesign.theme-dark .btn-close-settings {
    background: #1a2530;
    border-color: #31485c;
    color: #dbe3eb;
}

body.chapter-classic-redesign.theme-dark .chapter-content {
    background: #1f2a33;
}

body.chapter-classic-redesign.theme-dark .chapter-text {
    color: #e6edf5;
}

body.chapter-classic-redesign.theme-dark .chapter-list-panel .panel-header {
    background: #1b4f77;
}

body.chapter-classic-redesign.theme-dark .keyboard-hint {
    background: #1f2a33;
    border-color: #35526b;
}

@media (max-width: 991px) {
    body.chapter-classic-redesign .story-title {
        font-size: 28px;
    }

    body.chapter-classic-redesign .chapter-content {
        padding: 28px 28px 30px;
    }
}

@media (max-width: 767px) {
    body.chapter-classic-redesign .chapter-reading-page .page-content {
        padding-top: 14px;
    }

    body.chapter-classic-redesign .chapter-header,
    body.chapter-classic-redesign .chapter-content,
    body.chapter-classic-redesign .chapter-toolbar-card {
        padding-left: 18px;
        padding-right: 18px;
    }

    body.chapter-classic-redesign .story-title {
        font-size: 24px;
    }

    body.chapter-classic-redesign .chapter-name {
        font-size: 16px;
    }

    body.chapter-classic-redesign .chapter-text {
        font-size: 18px;
        line-height: 1.85;
    }

    body.chapter-classic-redesign .chapter-nav {
        gap: 8px;
    }

    body.chapter-classic-redesign .chapter-nav a,
    body.chapter-classic-redesign .chapter-nav button {
        width: 100%;
        min-height: 44px;
        padding: 0 16px;
    }

    body.chapter-classic-redesign .settings-toggle {
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    body.chapter-classic-redesign .chapter-header {
        padding-top: 22px;
    }

    body.chapter-classic-redesign .chapter-reader-kicker {
        font-size: 12px;
        letter-spacing: 0.12em;
    }

    body.chapter-classic-redesign .story-title {
        font-size: 22px;
    }

    body.chapter-classic-redesign .chapter-text {
        font-size: 17px;
    }

    body.chapter-classic-redesign .chapter-nav .btn-list span {
        font-size: 13px;
    }
}
