html, body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: auto;
    width: 100%;
    background-color: #433b3b !important;
}
h1{
    font-family: 'Cormorant Unicase', serif; 
    color: #3A3434;
}
a {
    text-decoration: none;
    color: inherit;
}
a:hover{
    text-decoration: underline;
}
.ql-align-center {
    text-align: center;
}

.ql-align-right {
    text-align: right;
}

.ql-align-justify {
    text-align: justify;
}
p{
    line-height: 1.9;
    margin-top: 0px;
}
p a{
    color: #736A6A;
    text-decoration: underline;
}
p img{
    width: 100%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    cursor: zoom-in !important;
}
p img::before {
    content: '';
    position: absolute;
    width: calc(100% - 15px);
    height: calc(100% - 15px);
    border: 1px solid #3a3434;
    pointer-events: none;
}
blockquote {
    background-color: #3a34341e;
    margin: 0;
    line-height: 1.7;
    padding-top: 5px;
    padding-left: 30px;
    padding-bottom: 5px;
    padding-right: 50px;
    position: relative;
    margin-bottom: 20px;
}
blockquote::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: #3a3434;
}

.article-content blockquote:not(:has(+ blockquote)) {
    margin-bottom: 20px;
}

.article-content blockquote {
    margin-bottom: 0;
}
blockquote:not(blockquote + blockquote)::after {
    content: "“";
    position: absolute;
    right: 15px;
    top: 5px;
    font-size: 48px;
    font-family: serif;
    color: #3a343466;
    line-height: 1;
    margin-bottom: 0px;
}
.article-page-image{
    position: absolute;
    left: 20px;
    width: 30px;
    height: 100%;
    transform: rotate(90deg);
    background-repeat: repeat;  
    background-size: cover;
}
.article-page{
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    flex-direction: column;
    margin-top: 70px;
}
.article-page::-moz-selection {
  background: #3A3434;
  color: #ffffff;
}

.article-page::selection {
  background: #3A3434;
  color: #ffffff;
}
.container{
    position: relative;
    width: 980px;
    background-color: #E3DAD2;
    padding: 0 55px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}
.container::before {
    align-self: center; 
    content: '';
    position: absolute;
    width: calc(100% - 30px);
    height: calc(100% - 30px);
    border: 1px solid #3a3434;
    pointer-events: none;
}
.readnext{
    text-align: center;
    margin-bottom: 0px;
    margin-top: 50px;
    font-size: 28px;
    border: 1px solid;
    border-radius: 15px;
    margin-left: 35%;
    margin-right: 35%;
    padding: 7px;
}
.slider-container {
    width: 100%;
    display: flex;
    overflow: hidden;
    position: relative;
    padding-top: 10px;
    box-sizing: border-box;
    flex-direction: row;
    justify-content: space-evenly;
}
.slider{
    width: 100%;
    height: 100%;
    gap: 35px;
    box-sizing: border-box;
    overflow-x: scroll;
    overflow-y: hidden;
    scrollbar-width: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px 0px;
    justify-content: center;
}
.slide {
    width: 30%;
    flex-basis: 30%;
    flex-shrink: 0;
    height: 400px;
    background: #747474;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
}
.slide::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 1px solid #E3DAD2;
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}
.slide:hover {
    transform: translateY(-10px);
}
.article-link:hover{
    text-decoration: none !important;
}
.article-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 2;
}
.slide-content {
    height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Playfair Display', serif;
    color: #E3DAD2;
    box-sizing: border-box;
}
.read-also-section{
    margin: 60px 0px;
    margin-top: 20px;
}
.slide-content h3 {
    width: 90%;
    font-size: 18px;
    /* letter-spacing: 2px;*/
    background-color: #3A3434;
    color: #E3DAD2;
    font-family: 'Playfair Display', serif;
    font-weight: 300;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    word-wrap: break-word;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.article-title{
    font-size: 52px;
    font-family: 'Cormorant Unicase', serif; 
    font-weight: 400;
    position: relative;
    text-transform: uppercase;
    color: #3a3434;
    margin-top: 35px;
    margin-bottom: 20px;
}
.article-line{
    width: 100%;
    height: 1px;
    background-color: #3a3434;
    margin: 15px 0px;
}
.article-meta{
    display: flex;
    flex-direction: row;
    align-items: center;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: #343434;
    text-transform: uppercase;
    font-weight: 500;
    justify-content: space-between;
    margin-bottom: 0px !important;
}
.article-author a{
    text-align: center;
}
.diamond{
    width: 10px;
    height: 10px;
    background-color: #3A3434;
    transform: rotate(45deg);
}

.article-annotation, blockquote, .article-tags{
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.9;
    color: #000000;
}
.article-annotation{
    font-style: italic;
    color: #3a3434;
}
.article-tags{
    text-align: justify;
}
p{
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 400;
    color: #000000;
}
.article-tags{
    text-align: center;
    width: 100%;
    color: #786F6E;
    text-decoration: none !important;
}
.tag{
    text-decoration: underline;
    margin: 5px;
}
.article-image{
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
}
.article-image::after {
    content: '';
    position: absolute;
    width: calc(100% - 15px);
    height: calc(100% - 15px);
    border-radius: 10px;
    border: 1px solid #E3DAD2;
    pointer-events: none;
}
.article-image img{
    width: 100%;
    height: 500px;
    border-radius: 10px;
    object-fit: cover;
    user-select: none;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}
.article-image img:hover {
  transform: scale(1.02);
}
.article-links{
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    margin: 40px 50px;
}
.footer-article-telegram{
    position: relative;
    width: 50px;
    height: 50px;
    margin-bottom: 40px;
}
.telegram-image,.footer-telegram-link{
    width: 100%;
    height: 100%;
    color: #E3DAD2;
}
.footer-telegram-link{
    display: block;
    position: absolute;
    top: 0;
}
.image {
    display: block;
    position: fixed;
    width: 100%;
    height: 100%;
    background-size: 40%;
    background-position: center;
    background-origin: content-box;
    opacity: 0.4;
    background-clip: content-box;
    z-index: 0;
    background-image: url("/static/public/images/фоновый псевд 2.svg");
}
.footnote-popup p{
    color: rgb(227, 218, 210);
    font-size: 16px;
    font-weight: 400;
    font-family: "Playfair Display", serif;
    margin-bottom: 0;
}
.footnote-popup p a{
    color: rgb(227, 218, 210);
    font-size: 16px;
    font-weight: 400;
    font-family: "Playfair Display", serif;
}
.centered-image {
    max-width: 80%;
    width: 350px;
    margin: 50px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.mobile-info, .telegram, .mobilemenu-img{
    display: none;
}
.footnote-reference {
    /*background-color: #3a3434;*/
    color: #3a3434;
    border-radius: 3px;
    vertical-align: super;
    font-size: 80%;
    padding: 1px 2px;
    cursor: pointer;
}
.footnote-popup {
    position: absolute;
    background-color: #3a3434;
    border: 1px solid #786f6e;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    padding: 10px;
    z-index: 9998;
    max-width: 300px;
    color: #e3dad2;
    font-size: 16px;
    font-weight: 400;
    font-family: "Playfair Display", serif;
}
.footnote-popup p span{
    color: #e3dad2 !important;
}
/* Кнопка скачать PDF */
.pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #3A3434;
    border-radius: 10px;
    background-color: transparent;
    color: #3A3434;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cormorant Unicase', serif;
    text-transform: uppercase;
}

.pdf-btn:hover {
    background-color: #3A3434;
    color: #E3DAD2;
}

.pdf-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.pdf-btn.success {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: #FFFFFF;
}

/* Кнопка скачать Word */
.word-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #3A3434;
    border-radius: 10px;
    background-color: transparent;
    color: #3A3434;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cormorant Unicase', serif;
    text-transform: uppercase;
}

.word-btn:hover {
    background-color: #3A3434;
    color: #E3DAD2;
}

.word-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.word-btn.success {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: #FFFFFF;
}

/* Обновляем стиль pdf-btn для двух кнопок */
.pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #3A3434;
    border-radius: 10px;
    background-color: transparent;
    color: #3A3434;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cormorant Unicase', serif;
    text-transform: uppercase;
}

.pdf-btn:hover {
    background-color: #3A3434;
    color: #E3DAD2;
}

.pdf-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.pdf-btn.success {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: #FFFFFF;
}

h3, h2, h1{
    font-family: "Cormorant Unicase", serif;
}
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    cursor: default;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #E3DAD2;
    font-size: 50px;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

/* Кнопка полноэкранного режима */
.fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #3A3434;
    border-radius: 10px;
    background-color: transparent;
    color: #3A3434;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cormorant Unicase', serif;
    text-transform: uppercase;
}

.fullscreen-btn:hover {
    background-color: #3A3434;
    color: #E3DAD2;
}

.fullscreen-btn.active {
    background-color: #3A3434;
    color: #E3DAD2;
}

.article-page.fullscreen-mode {
    position: relative;
    z-index: 9997;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    background-color: #E3DAD2;
}

body.fullscreen-active header,
body.fullscreen-active footer,
body.fullscreen-active .image,
body.fullscreen-active .mobilemenu {
    display: none !important;
}

body.fullscreen-active .reading-settings-toggle {
    z-index: 10000;
}

body.fullscreen-active .reading-settings-panel {
    z-index: 9999;
}

body.fullscreen-active .image-modal {
    z-index: 10001;
}

@media screen and (max-width: 1500px) and (orientation: landscape){
    .container{
        width: 750px;
    }
    .article-title{
        font-size: 40px;
    }
    .article-image img{
        height: 400px;
    }
    .article-annotation, blockquote, .article-tags{
        font-size: 16px;
    }
    p{
        font-size: 16px;
    }
    .centered-image {
        width: 250px;
        margin: 30px;
        margin-left: auto;
        margin-right: auto;
    }
    .article-meta{
        font-size: 18px;
    }
}
@media screen and (min-width: 1024px) and (orientation: portrait){ 
    body {
        background-color: #e3dad2 !important;
    }
    .mobilemenu{
        display: block;
        width: 100%;
        height: 130px;
        background-color: #3A3434;
        display: flex;
        justify-content: center;
    }
    .article-page{
        width: 100%;
        margin-top: 0px;
    }
    .container{
        width: 100%;
        padding: 0 30px;
    }
    .container::before {
        content: none;
    }
    .article-title{
        font-size: 3rem;
        text-align: center;
        font-weight: 600;
        margin-top: 20px;
    }
    .article-image img{
        height: 450px;
    }
    .diamond, .image{
        display: none;
    }
    .article-line {
        margin: 10px 0px;
    }
    .article-meta{
        font-size: 14px;
        font-weight: 700;
    }
    .article-annotation, p, blockquote, .article-tags{
        font-size: 2rem;
    }
    .centered-image{
        width: 500px;
        margin: 30px auto;
    }
    .mobile-info{
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }
    .info-item{
        font-family: 'Playfair Display', serif;
        font-size: 1.5rem;
        color: #3A3434;
        height: 50px;
        border-radius: 10px;
        border: 1px solid #3a3434;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0px 30px;
        text-align: center;
        white-space: nowrap;
    }
    .telegram{
        width: 300px;
        margin: 5px 0px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .info-item-telegram-link{
        width: 100%;
    }
    .article-category a{
        text-decoration: none;
    }
    .article-category-m, .article-author-m{
        text-transform: uppercase;
    }
    .article-tags, .footer-article-telegram,.article-category,.article-author,.article-line{
        display: none;
    }
    .article-meta{
        justify-content: center;
    }
    .article-date{
        display: flex;
        width: 200px;
        height: 50px;
        border-radius: 10px;
        border: 1px solid #3A3434;
        justify-content: center;
        align-items: center;
        margin: 10px 0px;
        font-size: 1.5rem;
        font-family: 'Cormorant Unicase', serif; 
    }
    .mobilemenu-img{
        display: block;
        width: 50%;
    }
    .scroll-to-top{
        background-color: #3a3434 !important;
    }
    .scroll-to-top::after {
        border-top: 2px solid #E3DAD2 !important;
        border-right: 2px solid #E3DAD2 !important;
    }
}
@media (max-width: 1024px) {
    p, .article-annotation, blockquote, .article-tags{
        line-height: 1.5;
    }
    .mobilemenu{
        display: block;
        width: 100%;
        height: 80px;
        background-color: #3A3434;
        display: flex;
        justify-content: center;
    }
    .menu-button-fixed{
        z-index: 1000;
        background-color: transparent;
        position: absolute !important;
        top: 15px !important;
        height: 50px;
        width: 50px;
    }
    .search-button-fixed{
        background-color: transparent;
        position: absolute !important;
        z-index: 1000;
        height: 50px;
        width: 50px;
        top: 15px !important;
        right: 20px !important;
        left: auto !important;
    }
    
    .arrow-icon::after {
        border-top: 2px solid #E3DAD2 !important;
        border-right: 2px solid #E3DAD2 !important;
    }
    .article-page{
        width: 100%;
        margin-top: 0px;
    }
    .container{
        width: 100%;
        padding: 0 30px;
    }
    .container::before {
        content: none;
    }
    .article-title{
        font-size: 35px;
        text-align: center;
        font-weight: 600;
        margin-top: 20px;
    }
    .article-image img{
        height: 350px;
    }
    .diamond, .image{
        display: none;
    }
    .article-line {
        margin: 10px 0px;
    }
    .article-meta{
        font-size: 14px;
        font-weight: 700;
    }
    .article-annotation, p, blockquote, .article-tags{
        font-size: 16px;
    }
    .centered-image{
        width: 300px;
    }
    .mobile-info{
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }
    .info-item{
        font-family: 'Playfair Display', serif;
        font-size: 14px;
        color: #3A3434;
        height: 30px;
        border-radius: 10px;
        border: 1px solid #3a3434;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0px 30px;
        text-align: center;
        white-space: nowrap;
    }
    .telegram{
        width: 200px;
        margin: 5px 0px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .info-item-telegram-link{
        width: 100%;
    }
    .article-category a{
        text-decoration: none;
    }
    .article-category-m, .article-author-m{
        text-transform: uppercase;
    }
    .article-tags, .footer-article-telegram,.article-category,.article-author,.article-line{
        display: none;
    }
    .article-meta{
        justify-content: center;
    }
    .article-date{
        display: flex;
        width: 150px;
        height: 30px;
        font-size: 18px;
        border-radius: 10px;
        border: 1px solid #3A3434;
        justify-content: center;
        align-items: center;
        margin: 10px 0px;
        font-family: 'Cormorant Unicase', serif; 
    }
    .mobilemenu-img{
        display: block;
        width: 50%;
    }
    .scroll-to-top{
        background-color: #3a3434 !important;
    }
    .scroll-to-top::after {
        border-top: 2px solid #E3DAD2 !important;
        border-right: 2px solid #E3DAD2 !important;
    }
    .slide {
        display: block;
        height: 160px;
        margin-bottom: 15px;
        width: 100%;
        flex-basis: 160px;
    }
    .slider{
        padding: 0;
        width: auto;
        display: block;
        width: 100%;
        height: auto;
    }
    .slide:hover {
        transform: translateY(0px);
    }
    .slider-container {
        align-items: center;
        flex-direction: column;
        height: auto;
    }
    .slide-content h3 {
        font-size: 18px;
    }
    .readnext{
        margin-top: 30px;
        margin-left: 13%;
        margin-right: 13%;
        padding: 5px 8px;
    }
}
@media (max-width: 768px) {
    .menu-modal {
        margin-top: 81px !important;
    }
    .mobilemenu-img{
        width: 50%;
    }
    .article-image img{
        height: 250px;
    }
    .article-title{
        font-size: 30px;
    }
    .modal-close {
        top: 15px;
        right: 20px;
        font-size: 40px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 80%;
    }
}

@media (max-width: 576px) {
    .mobilemenu-img{
        width: 50%;
    }
}

@media (max-width: 480px) {
    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 35px;
    }
}

.reading-settings-toggle {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 50px;
    height: 50px;
    background-color: #E3DAD2;
    color: #3A3434;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    opacity: 0;
    visibility: hidden;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    
}

.reading-settings-toggle.visible {
    opacity: 1;
    visibility: visible;
}

.reading-settings-panel {
    position: fixed;
    right: 30px;
    bottom: 160px;
    width: 340px;
    max-height: 70vh;
    background-color: #E3DAD2;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 9998;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
}

.reading-settings-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #3A3434;
    color: #E3DAD2;
}

.settings-header h3 {
    margin: 0;
    font-size: 18px;
    color: #E3DAD2 !important;
    font-weight: 500;
    font-family: 'Cormorant Unicase', serif;
}

.settings-close {
    background: none;
    border: none;
    color: #E3DAD2;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: opacity 0.2s;
}

.settings-close:hover {
    opacity: 0.7;
}

.settings-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(70vh - 160px);
}

.setting-group {
    margin-bottom: 20px;
}

.setting-label {
    display: block;
    font-family: 'Cormorant Unicase', serif;
    font-size: 14px;
    color: #3A3434;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
}

.setting-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.setting-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #3A3434;
    background-color: #E3DAD2;
    color: #3A3434;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.setting-btn:hover {
    background-color: #3A3434;
    color: #E3DAD2;
}

.setting-value {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    color: #3A3434;
    min-width: 60px;
    text-align: center;
    font-weight: 500;
}

.setting-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #D4C9BE;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3A3434;
    cursor: pointer;
    border: 2px solid #E3DAD2;
}

.setting-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3A3434;
    cursor: pointer;
    border: 2px solid #E3DAD2;
}

/* Кнопки шрифтов */
.setting-font-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
/* ===== Кастомная полоса прокрутки для панели настроек ===== */
.settings-body {
    scrollbar-width: thin;
    scrollbar-color: #3A3434 #D4C9BE;
}

.settings-body::-webkit-scrollbar {
    width: 6px;
}

.settings-body::-webkit-scrollbar-track {
    background: #D4C9BE;
    border-radius: 3px;
}

.settings-body::-webkit-scrollbar-thumb {
    background: #3A3434;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.settings-body::-webkit-scrollbar-thumb:hover {
    background: #4A4444;
}

/* Для Firefox */
.settings-body {
    scrollbar-width: thin;
    scrollbar-color: #3A3434 #D4C9BE;
}
.font-btn {
    padding: 6px 12px;
    border: 1px solid #3A3434;
    border-radius: 8px;
    background-color: #E3DAD2;
    color: #3A3434;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Playfair Display', serif;
}

.font-btn:hover {
    background-color: #D4C9BE;
}

.font-btn.active {
    background-color: #3A3434;
    color: #E3DAD2;
}

/* Кнопки ширины */
.setting-width-buttons {
    display: flex;
    gap: 8px;
}

.width-btn {
    padding: 8px 12px;
    border: 1px solid #3A3434;
    border-radius: 8px;
    background-color: #E3DAD2;
    color: #3A3434;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.width-btn:hover {
    background-color: #D4C9BE;
}

.width-btn.active {
    background-color: #3A3434;
    color: #E3DAD2;
}

/* Кнопки темы */
.setting-theme-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #3A3434;
    border-radius: 8px;
    background-color: #E3DAD2;
    color: #3A3434;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Playfair Display', serif;
}

.theme-btn:hover {
    background-color: #D4C9BE;
}

.theme-btn.active {
    background-color: #3A3434;
    color: #E3DAD2;
}

.theme-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #3A3434;
    display: inline-block;
    flex-shrink: 0;
}

/* Кнопки выравнивания */
.setting-align-buttons {
    display: flex;
    gap: 8px;
}

.align-btn {
    padding: 8px 12px;
    border: 1px solid #3A3434;
    border-radius: 8px;
    background-color: #E3DAD2;
    color: #3A3434;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.align-btn:hover {
    background-color: #D4C9BE;
}

.align-btn.active {
    background-color: #3A3434;
    color: #E3DAD2;
}

.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 1px solid #3A3434;
    border-radius: 10px;
    background-color: transparent;
    color: #3A3434;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cormorant Unicase', serif;
    text-transform: uppercase;
}

.reset-btn:hover {
    background-color: #3A3434;
    color: #E3DAD2;
}

/* Контейнер для кнопок действий */
.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* Кнопка сохранения */
.save-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 1px solid #3A3434;
    border-radius: 10px;
    background-color: #3A3434;
    color: #E3DAD2;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cormorant Unicase', serif;
    text-transform: uppercase;
}
.toc-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #3A3434;
    border-radius: 10px;
    background-color: transparent;
    color: #3A3434;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cormorant Unicase', serif;
    text-transform: uppercase;
}

.toc-toggle-btn:hover {
    background-color: #3A3434;
    color: #E3DAD2;
}

.toc-wrapper {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 9999;
    right: -30px;
}
.table-of-contents {
    position: fixed;
    margin-top: 30px;
    width: 220px;
    max-height: 60vh;
    background-color: #E3DAD2;
    border: 1px solid #E3DAD2;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;

    overflow: hidden;
}

.table-of-contents.visible {
    opacity: 1;
    visibility: visible;
}

.toc-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 14px;
    background-color: #3A3434;
    color: #E3DAD2;
}

.toc-title {
    font-family: 'Cormorant Unicase', serif;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    overflow-y: auto;
    max-height: calc(60vh - 45px);
    scrollbar-width: thin;
    scrollbar-color: #3A3434 #D4C9BE;
}

.toc-list::-webkit-scrollbar {
    width: 4px;
}

.toc-list::-webkit-scrollbar-track {
    background: #D4C9BE;
}

.toc-list::-webkit-scrollbar-thumb {
    background: #3A3434;
    border-radius: 2px;
}

.toc-item {
    margin: 0;
}

.toc-link {
    display: block;
    padding: 8px 14px;
    font-family: 'Playfair Display', serif;
    font-size: 13px;
    color: #3A3434;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    line-height: 1.3;
}

.toc-link:hover {
    background-color: rgba(58, 52, 52, 0.08);
    border-left-color: #3A3434;
    padding-left: 16px;
}

.toc-link.active {
    background-color: rgba(58, 52, 52, 0.12);
    border-left-color: #3A3434;
    font-weight: 600;
}

@media (max-width: 1300px) {
    .table-of-contents {
        right: 5px;
        width: 200px;
    }
    
    .toc-link {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 1024px) {
    .table-of-contents, .toc-wrapper {
        display: none !important;
    }
}
.save-btn:hover {
    background-color: #4A4444;
}

/* Кнопка сброса */
.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 1px solid #3A3434;
    border-radius: 10px;
    background-color: transparent;
    color: #3A3434;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cormorant Unicase', serif;
    text-transform: uppercase;
}

.reset-btn:hover {
    background-color: #3A3434;
    color: #E3DAD2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ===== Адаптивность панели настроек ===== */
@media (max-width: 1024px) {
    .reading-settings-toggle {
        right: 20px;
        bottom: 90px;
        width: 45px;
        height: 45px;
    }
    
    .reading-settings-panel {
        right: 20px;
        bottom: 145px;
        width: 300px;
    }
}

@media (max-width: 768px) {
    .reading-settings-toggle {
        background-color: #3A3434;
        color: #E3DAD2;
        right: 20px;
        bottom: 90px;
        width: 45px;
        height: 45px;
    }
    
    .reading-settings-panel {
        right: 10px;
        bottom: 145px;
        width: calc(100vw - 20px);
        max-width: 320px;
    }
    
    .settings-header h3 {
        font-size: 16px;
    }
    
    .settings-body {
        padding: 15px;
    }
}

.article-content[style*="color: rgb(212, 212, 212)"] ~ .reading-settings-panel {
    background-color: #2C2C2C;
    border-color: #555;
}

.article-content[style*="color: rgb(212, 212, 212)"] ~ .reading-settings-toggle {
    background-color: #2C2C2C;
    color: #D4D4D4;
    border-color: #555;
}