:root {
    --reader-text-muted: #666;
    --reader-border-color: #00000050;
    --reader-accent-color: #0a9ea4;
    --reader-text-primary: #111;
    --reader-textarea-border: #e0e0e0;
    --reader-comment-border: #555;
    --reader-shadow-color: rgba(0, 0, 0, 0.1);
    --reader-inset-shadow-color: rgba(0, 0, 0, 0.75);
    --reader-success-color: #1ca76a;
}
.reader-theme-dark {
    --reader-text-muted: #aaa;
    --reader-border-color: #ffffff50;
    --reader-accent-color: #0fa6ab;
    --reader-text-primary: #eee;
    --reader-textarea-border: #444;
    --reader-comment-border: #888;
    --reader-shadow-color: rgba(255, 255, 255, 0.1);
    --reader-inset-shadow-color: rgba(255, 255, 255, 0.3);
    --reader-success-color: #3edb8d;
}
.reader-theme-sepia {
    --reader-text-muted: #6b5e4a;
    --reader-text-primary: #3d2323;
    --reader-textarea-border: #d6c9b2;
    --reader-comment-border: #8a7b6c;
}
.reader-theme-gray {
    --reader-textarea-border: #ccc;
}
.popup-reader__book-info {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.popup-reader__book-info > img {
    width: 89px;
    height: 132px;
    border-radius: 10px;
}

.popup-reader-book-info__heading h3 {
    font-size: 14px;
    line-height: 15px;
}

.popup-reader-book-info__heading p {
    font-size: 13px;
    line-height: 14px;
}

.popup-reader__switch-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 5px;
}

.popup-reader-switch-nav__button {
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    background: transparent;
    color: var(--reader-text-muted);
    border: 1px solid var(--reader-border-color);
}

.popup-reader-switch-nav__button:hover, .popup-reader-switch-nav__button.active {
    border: 1px solid var(--reader-accent-color);
    color: var(--reader-text-primary);
    cursor: pointer;
}

.reader-bottom-reviews {
    position: absolute;
    width: 100%;
    top: 250%;
    transition: .4s;
    padding: 5vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2000;
    box-shadow: 0 0 10px var(--reader-shadow-color);
}

.reader-bottom-reviews.collapsed {
    top: 50%;
    min-height: 50vh;
}

body.scrollable {
    overflow-y: scroll !important;
}

.reader-bottom-chapter-comments {
    max-width: 800px;
    width: 95%;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reader-bottom-chapter-comments__submit--loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
    padding-right: 2.5rem !important;
}

.reader-bottom-chapter-comments__submit--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 1rem;
    height: 1rem;
    margin-top: -0.5rem;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: reader-bottom-submit-spinner 0.75s linear infinite;
}

@keyframes reader-bottom-submit-spinner {
    to {
        transform: rotate(360deg);
    }
}

.reader-bottom-chapter-comments__error {
    color: var(--reader-error-color, #ff4f4f);
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    display: none;
}

.reader-bottom-chapter-comments__success {
    color: var(--reader-success-color, #1ca76a);
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    display: none;
}

.reader-bottom-chapter__leave-comment {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.reader-bottom-chapter__leave-comment .estimate {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.reader-bottom-chapter-comments__textarea {
    box-shadow: inset 0 0 3px 0 var(--reader-inset-shadow-color);
    border: 1px solid var(--reader-textarea-border);
    resize: none;
    box-sizing: border-box;
    max-height: 50px;
    width: 100%;
    border-radius: 10px;
    padding: 10px;
}

.reader-bottom-chapter-comm {
    border-left: 2px solid var(--reader-comment-border);
    padding: .5rem 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.reader-bottom-chapter-comm > img {
    min-width: 45px;
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 50%;
}

.reader-bottom-chapter-comm-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reader-bottom-chapter-comm-answer {
    color: var(--reader-accent-color);
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.reader-bottom-chapter-comm-answer:hover {
    cursor: pointer;
    text-decoration: underline;
}
.popup-reader__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    margin: 20px 0;
}

.popup-reader__actions > * {
    flex: 1 1 220px;
    max-width: 280px;
}

.popup-reader__action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

.popup-reader__action-button.active {
    box-shadow: 0 0 0 2px rgba(15, 166, 171, 0.15);
}


.popup-reader__similar {
    margin: 24px 0;
}

.popup-reader__section-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--reader-text-primary);
    margin-bottom: 16px;
}

.popup-reader__similar-carousel {
    display: flex;
    width: 100%;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.popup-reader__similar-carousel::-webkit-scrollbar {
    height: 6px;
}

.popup-reader__similar-carousel::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 9999px;
}

.popup-reader__similar-carousel.owl-loaded {
    display: block;
    overflow: visible;
    padding-bottom: 0;
}

/* Одна книга на экран (как в сайдбаре): карточка по центру */
.popup-reader__similar-carousel.owl-loaded .owl-item {
    display: flex;
    justify-content: center;
}
.popup-reader__similar-carousel.owl-loaded .popup-reader__similar-item {
    max-width: 200px;
    margin: 0 auto;
}

.popup-reader__similar-item {
    padding: 4px;
    flex: 0 0 160px;
    width: 160px;
    max-width: 160px;
    box-sizing: border-box;
    scroll-snap-align: start;
}

.popup-reader__similar-link {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-height: 100%;
    text-decoration: none;
    color: inherit;
}

.popup-reader__similar-picture {
    display: block;
    width: 150px;
    height: 210px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
}

.popup-reader__similar-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.popup-reader__similar-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.popup-reader__similar-author {
    font-size: 13px;
    color: var(--reader-text-muted);
}


@media screen and (max-width: 1000px) {
    .popup-reader__advices svg {
        width: 80vw;
    }
}

@media screen and (max-width: 570px) {
    .popup-reader__container {
        right: auto !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }

    .reader-bottom-chapter__leave-comment {
        flex-direction: column;
        align-items: start;
    }

    .reader-bottom-chapter__leave-comment .buttons {
        width: 100%;
    }
}