/* ===== ВЕРСИЯ ДЛЯ СЛАБОВИДЯЩИХ ===== */

.accessibility-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;           /* Уменьшили высоту */
    padding: 0 12px;        /* Уменьшили отступы по бокам */
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 18px;    /* Радиус под новую высоту */
    cursor: pointer;
    color: #2c3e50;
    font-size: 12px;        /* Уменьшили шрифт */
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;    /* Строго в одну строку */
    transition: all 0.3s ease;
    flex-shrink: 0;         /* Запрещаем сжиматься */
}

.accessibility-toggle:hover,
.accessibility-toggle:focus {
    border-color: #019934;
    color: #019934;
    background: #fff;
}

.accessibility-toggle svg {
    width: 18px;            /* Уменьшили иконку */
    height: 18px;
    flex-shrink: 0;
}

/* Панель */
.accessibility-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%) translateX(120%);
    width: 320px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.accessibility-panel.active {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    visibility: visible;
}

.accessibility-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #019934;
    color: #fff;
    border-radius: 15px 15px 0 0;
}

.accessibility-panel__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.accessibility-panel__close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.accessibility-panel__close:hover,
.accessibility-panel__close:focus {
    background: rgba(255, 255, 255, 0.2);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.accessibility-panel__body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.accessibility-group {
    margin-bottom: 20px;
}

.accessibility-group:last-child {
    margin-bottom: 0;
}

.accessibility-group__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.accessibility-group__buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.accessibility-font-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    background: #f8f9fa;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    color: #333;
    transition: all 0.2s;
}

.accessibility-font-btn[data-font-size="normal"] { font-size: 14px; }
.accessibility-font-btn[data-font-size="large"] { font-size: 18px; }
.accessibility-font-btn[data-font-size="xlarge"] { font-size: 22px; }

.accessibility-font-btn:hover,
.accessibility-font-btn:focus {
    border-color: #019934;
    color: #019934;
    outline: none;
}

.accessibility-font-btn.active {
    background: #019934;
    border-color: #019934;
    color: #fff;
}

.accessibility-scheme-btn {
    padding: 8px 14px;
    background: #f8f9fa;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s;
}

.accessibility-scheme-btn:hover,
.accessibility-scheme-btn:focus {
    border-color: #019934;
    color: #019934;
    outline: none;
}

.accessibility-scheme-btn.active {
    background: #019934;
    border-color: #019934;
    color: #fff;
}

.accessibility-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.accessibility-checkbox:hover {
    background: #f8f9fa;
}

.accessibility-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #019934;
}

.accessibility-checkbox span {
    font-size: 14px;
    color: #333;
}

.accessibility-panel__footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e1e1e1;
}

.accessibility-reset-btn,
.accessibility-close-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.accessibility-reset-btn {
    background: #fff;
    border: 1px solid #e1e1e1;
    color: #666;
}

.accessibility-reset-btn:hover,
.accessibility-reset-btn:focus {
    border-color: #019934;
    color: #019934;
    outline: none;
}

.accessibility-close-btn {
    background: #019934;
    border: 1px solid #019934;
    color: #fff;
}

.accessibility-close-btn:hover,
.accessibility-close-btn:focus {
    background: #017a29;
    outline: 2px solid #019934;
    outline-offset: 2px;
}

/* ===== РЕЖИМ "СЛАБОВИДЯЩИЕ" ===== */
body.a11y-hide-images img,
body.a11y-hide-images svg:not(.accessibility-toggle svg),
body.a11y-hide-images picture {
    visibility: hidden !important;
}

body.a11y-sans-serif,
body.a11y-sans-serif * {
    font-family: Arial, Helvetica, sans-serif !important;
}

body.a11y-line-height,
body.a11y-line-height * {
    line-height: 1.8 !important;
}

/* Размеры шрифта */
body.a11y-font-large {
    font-size: 18px !important;
}

body.a11y-font-large p,
body.a11y-font-large li,
body.a11y-font-large td {
    font-size: 1.15em !important;
}

body.a11y-font-xlarge {
    font-size: 22px !important;
}

body.a11y-font-xlarge p,
body.a11y-font-xlarge li,
body.a11y-font-xlarge td {
    font-size: 1.3em !important;
}

/* Цветовые схемы */
body.a11y-scheme-black-white,
body.a11y-scheme-black-white * {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.a11y-scheme-black-white a,
body.a11y-scheme-black-white a * {
    color: #0000cc !important;
    text-decoration: underline !important;
}

body.a11y-scheme-black-white img {
    filter: grayscale(100%) !important;
}

body.a11y-scheme-white-black,
body.a11y-scheme-white-black * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.a11y-scheme-white-black a,
body.a11y-scheme-white-black a * {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

body.a11y-scheme-white-black img {
    filter: grayscale(100%) !important;
}

body.a11y-scheme-blue-white,
body.a11y-scheme-blue-white * {
    background-color: #9dd1ff !important;
    color: #063462 !important;
    border-color: #063462 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.a11y-scheme-blue-white a,
body.a11y-scheme-blue-white a * {
    color: #063462 !important;
    text-decoration: underline !important;
    font-weight: 700 !important;
}

body.a11y-scheme-blue-white img {
    filter: grayscale(100%) !important;
}

/* Кнопка активна */
body.a11y-active .accessibility-toggle {
    background: #019934 !important;
    color: #fff !important;
    border-color: #019934 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .accessibility-panel {
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        transform: translateY(100%);
        overflow-y: auto;
    }
    
    .accessibility-panel.active {
        transform: translateY(0);
    }
    
    .accessibility-panel__body {
        max-height: none;
        flex: 1;
    }
    
    .accessibility-toggle {
        width: 36px;
        height: 36px;
    }
}


/* ===== МОБИЛЬНАЯ ВЕРСИЯ КНОПКИ ===== */
@media (max-width: 768px) {
    .accessibility-toggle {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        gap: 0;
        display: none;
    }

    /* Скрываем текст на мобильных, оставляем только иконку */
    .accessibility-toggle .accessibility-toggle__text {
        display: none;
    }
}