#rq-accessibility-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 48px !important;
    height: 48px !important;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    color: #ffffff;
    cursor: pointer;
    z-index: 999999;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    transition: background 0.2s ease;
}

#rq-accessibility-btn svg {
    width: 25px;
    height: 25px;
    display: block;
    fill: currentColor;
}

#rq-accessibility-btn:hover,
#rq-accessibility-btn:focus {
    background: #6f6fed;
    outline: none;
}

#rq-accessibility-panel[hidden] {
    display: none !important;
}

#rq-accessibility-panel {
    position: fixed;
    right: 20px;
    bottom: 88px;
    width: 180px;
    background: rgb(2 28 58);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

#rq-accessibility-panel button {
    border: none;
    padding: 10px;
    border-radius: 10px;
    background: #ffffff;
    color: #111111;
    cursor: pointer;
    font-size: 15px !important;
    transition: opacity 0.2s ease;
}

#rq-accessibility-panel button:hover {
    opacity: 0.9;
}

#rq-accessibility-panel button:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* DARK CONTRAST */

body.rq-high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.rq-high-contrast .quest_card,
body.rq-high-contrast .reviews-card,
body.rq-high-contrast .faq-block,
body.rq-high-contrast .wp-block-group,
body.rq-high-contrast .wp-block-column,
body.rq-high-contrast .wp-block-cover,
body.rq-high-contrast .wp-block-accordion-panel {
    background: #111 !important;
    color: #fff !important;
}

body.rq-high-contrast h1,
body.rq-high-contrast h2,
body.rq-high-contrast h3,
body.rq-high-contrast h4,
body.rq-high-contrast h5,
body.rq-high-contrast h6,
body.rq-high-contrast p,
body.rq-high-contrast li,
body.rq-high-contrast span,
body.rq-high-contrast strong {
    color: #fff !important;
}

body.rq-high-contrast a {
    color: #00ffff !important;
    text-decoration: underline !important;
}

body.rq-high-contrast button,
body.rq-high-contrast .wp-block-button__link,
body.rq-high-contrast .wp-block-accordion-heading__toggle {
    background: #222 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

body.rq-high-contrast img {
    opacity: 0.9;
}

/* LIGHT CONTRAST */

body.rq-light-contrast {
    background: #fff !important;
    color: #000 !important;
}

body.rq-light-contrast .quest_card,
body.rq-light-contrast .reviews-card,
body.rq-light-contrast .faq-block,
body.rq-light-contrast .wp-block-group,
body.rq-light-contrast .wp-block-column,
body.rq-light-contrast .wp-block-cover,
body.rq-light-contrast .wp-block-accordion-panel {
    background: #fff !important;
    color: #000 !important;
}

body.rq-light-contrast h1,
body.rq-light-contrast h2,
body.rq-light-contrast h3,
body.rq-light-contrast h4,
body.rq-light-contrast h5,
body.rq-light-contrast h6,
body.rq-light-contrast p,
body.rq-light-contrast li,
body.rq-light-contrast span,
body.rq-light-contrast strong {
    color: #000 !important;
}

body.rq-light-contrast a {
    color: #0033cc !important;
    text-decoration: underline !important;
}

body.rq-light-contrast button,
body.rq-light-contrast .wp-block-button__link,
body.rq-light-contrast .wp-block-accordion-heading__toggle {
    background: #ffffff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
}

/* SIMPLIFY UI IN CONTRAST MODES */

body.rq-high-contrast *,
body.rq-light-contrast * {
    box-shadow: none !important;
    text-shadow: none !important;
    background-image: none !important;
}

/* UNDERLINE LINKS */

body.rq-underline-links a {
    text-decoration: underline !important;
}

/* HIGHLIGHT LINKS BACKGROUND (Выделение ссылок фоном) */
body.rq-links-bg a {
    background-color: #ffff00 !important;
    background-image: none !important;
    color: #000000 !important;
    text-decoration: underline !important;
    /* Удалили padding, чтобы тема сама управляла отступами в меню */
}

/* Делаем прозрачными внутренние контейнеры ссылок, чтобы желтый фон просвечивал */
body.rq-links-bg a * {
    background-color: transparent !important;
    background-image: none !important;
    color: #000000 !important;
}

/* Персонально для упрямой кнопки Astra в хедере */
body.rq-links-bg .ast-custom-button,
body.rq-links-bg .ast-custom-button-link {
    background-color: #ffff00 !important;
    background-image: none !important;
    color: #000000 !important;
}

/* GRAYSCALE */

body.rq-grayscale main {
    filter: grayscale(100%);
}

/* READABLE FONT */

body.rq-readable-font * {
    font-family: Arial, sans-serif !important;
}

/* STOP ANIMATIONS */

body.rq-stop-animations *,
body.rq-stop-animations *::before,
body.rq-stop-animations *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* HIGHLIGHT HEADINGS */

body.rq-highlight-headings h1,
body.rq-highlight-headings h2,
body.rq-highlight-headings h3,
body.rq-highlight-headings h4,
body.rq-highlight-headings h5,
body.rq-highlight-headings h6 {
    background: yellow !important;
    color: #000 !important;
    padding: 4px !important;
}

/* HEADER FIX */

body.rq-high-contrast header,
body.rq-high-contrast .site-header,
body.rq-high-contrast .ast-primary-header-bar,
body.rq-high-contrast .main-header-bar,
body.rq-high-contrast .ast-builder-menu {
    background: #111 !important;
}

body.rq-light-contrast header,
body.rq-light-contrast .site-header,
body.rq-light-contrast .ast-primary-header-bar,
body.rq-light-contrast .main-header-bar,
body.rq-light-contrast .ast-builder-menu {
    background: #ffffff !important;
}
/* Принудительно увеличиваем шрифты для сайта, КРОМЕ кнопок плагина */
body.rq-text-scaled button:not(#rq-accessibility-panel button):not(#rq-accessibility-btn),
body.rq-text-scaled .wp-block-button__link,
body.rq-text-scaled .wp-block-accordion-heading__toggle,
body.rq-text-scaled .wp-block-accordion-panel *,
body.rq-text-scaled .quest_card p,
body.rq-text-scaled .quest_card h2,
body.rq-text-scaled .quest_card h3,
body.rq-text-scaled .faq-block p,
body.rq-text-scaled .faq-block h2 {
    font-size: calc(1em * var(--rq-text-scale)) !important;
}

/* MOBILE */

@media(max-width:768px){
    #rq-accessibility-btn{
        width: 44px !important;
        height: 44px !important;
        right: 16px;
        bottom: 16px;
    }
    #rq-accessibility-panel{
        width: 310px; /* Делаем панель шире, чтобы влезли 2 колонки */
        max-width: calc(100vw - 32px); /* Защита от выхода за экран по ширине */
        right: 16px;
        bottom: 82px;
        
        /* Включаем двухколоночную сетку */
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        
        /* Защита от выхода за экран по высоте + скролл */
        max-height: calc(100vh - 100px); 
        overflow-y: auto; 
    }

    /* Делаем так, чтобы кнопка "Сброс" (איפוס) красиво занимала всю ширину (обе колонки) в самом низу */
    #rq-accessibility-panel button[data-action="reset"] {
        grid-column: span 2;
    }

}
/* Защита по высоте для любых экранов (если окно слишком низкое) */
@media(max-height: 650px) {
    #rq-accessibility-panel {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}
