/* ГАРАНТИРОВАННОЕ ОТОБРАЖЕНИЕ КНОПКИ */
#accessibility-panel-toggle {
    opacity: 1 !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999999 !important;
    color: white !important;
    text-decoration: none !important;
    font-size: 13px !important;
    text-align: center !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}
#accessibility-panel-toggle .panel-toggle-text {
    margin-left: 5px !important;
	text-decoration: underline;
	text-decoration-style: dashed;
	text-underline-offset: 5px;
    text-decoration-thickness: 1px;
	transition: color .3s;
}
#accessibility-panel-toggle .panel-toggle-text:hover {
    text-decoration: none !important;
	transition: color .3s;
}

/* БАЛАНСИРОВАННЫЕ СТИЛИ ДЛЯ ШРИФТА */
body.font-size-large {
    font-size: 120% !important;
}

body.font-size-large * {
    font-size: inherit !important;
}

/* ПРОПОРЦИОНАЛЬНЫЕ РАЗМЕРЫ ДЛЯ ЗАГОЛОВКОВ В БОЛЬШОМ РЕЖИМЕ */
body.font-size-large h1,
body.font-size-large .h1,
body.font-size-large [class*="h1"] {
    font-size: 2.2em !important;
    line-height: 1.2 !important;
}

body.font-size-large h2,
body.font-size-large .h2,
body.font-size-large [class*="h2"] {
    font-size: 1.8em !important;
    line-height: 1.3 !important;
}

body.font-size-large h3,
body.font-size-large .h3,
body.font-size-large [class*="h3"] {
    font-size: 1.5em !important;
    line-height: 1.3 !important;
}

body.font-size-large h4,
body.font-size-large .h4,
body.font-size-large [class*="h4"] {
    font-size: 1.3em !important;
    line-height: 1.4 !important;
}

body.font-size-large h5,
body.font-size-large .h5,
body.font-size-large [class*="h5"] {
    font-size: 1.2em !important;
    line-height: 1.4 !important;
}

body.font-size-large h6,
body.font-size-large .h6,
body.font-size-large [class*="h6"] {
    font-size: 1.1em !important;
    line-height: 1.4 !important;
}

/* Огромный размер */
body.font-size-huge {
    font-size: 140% !important;
}

body.font-size-huge * {
    font-size: inherit !important;
}

/* ПРОПОРЦИОНАЛЬНЫЕ РАЗМЕРЫ ДЛЯ ЗАГОЛОВКОВ В ОГРОМНОМ РЕЖИМЕ */
body.font-size-huge h1,
body.font-size-huge .h1,
body.font-size-huge [class*="h1"] {
    font-size: 2.4em !important;
    line-height: 1.2 !important;
}

body.font-size-huge h2,
body.font-size-huge .h2,
body.font-size-huge [class*="h2"] {
    font-size: 2.0em !important;
    line-height: 1.3 !important;
}

body.font-size-huge h3,
body.font-size-huge .h3,
body.font-size-huge [class*="h3"] {
    font-size: 1.7em !important;
    line-height: 1.3 !important;
}

body.font-size-huge h4,
body.font-size-huge .h4,
body.font-size-huge [class*="h4"] {
    font-size: 1.5em !important;
    line-height: 1.4 !important;
}

body.font-size-huge h5,
body.font-size-huge .h5,
body.font-size-huge [class*="h5"] {
    font-size: 1.3em !important;
    line-height: 1.4 !important;
}

body.font-size-huge h6,
body.font-size-huge .h6,
body.font-size-huge [class*="h6"] {
    font-size: 1.2em !important;
    line-height: 1.4 !important;
}

/* ИНТЕРВАЛ МЕЖДУ БУКВАМИ */
body.letter-spacing-large * {
    letter-spacing: 0.05em !important;
}

body.letter-spacing-huge * {
    letter-spacing: 0.1em !important;
}

/* ИЗОБРАЖЕНИЯ - логотип всегда отображается */
body.images-hide img:not([src*="logo"]):not(.logo-header),
body.images-hide picture:not(:has(img[src*="logo"])):not(.logo-header),
body.images-hide figure:not(:has(img[src*="logo"])):not(.logo-header),
body.images-hide [style*="background-image"]:not(.logo-header) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Логотип всегда отображается независимо от настроек */
img[src*="logo"],
.logo-header,
picture:has(img[src*="logo"]) {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ЦВЕТА - правильная инверсия */
body.color-inverted {
    background: #000 !important;
    color: #fff !important;
    filter: invert(1) hue-rotate(180deg) !important;
}

/* Фикс для горизонтального скролла при инверсии */
body.color-inverted {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
}

/* Черно-белый режим */
body.color-grayscale {
    filter: grayscale(100%) !important;
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
}

/* ВАЖНО: Отключаем фильтры когда панель открыта */
body.accessibility-panel-open.color-inverted,
body.accessibility-panel-open.color-grayscale {
    filter: none !important;
}

/* Инверсия изображений (кроме логотипа) */
body.color-inverted img:not([src*="logo"]):not(.logo-header),
body.color-inverted video:not(.logo-header),
body.color-inverted iframe:not(.logo-header),
body.color-inverted canvas:not(.logo-header) {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* SVG элементы также инвертируем */
body.color-inverted svg:not(.logo-header) {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* Логотип SVG не инвертируем */
body.color-inverted svg[class*="logo"],
body.color-inverted svg.logo-header {
    filter: none !important;
}

/* Специфичные стили для кнопки в цветовых режимах */
body.color-inverted #accessibility-panel-toggle {
    background: #337ab7 !important;
    color: white !important;
    border: 2px solid white !important;
}

body.color-grayscale #accessibility-panel-toggle {
    color: white !important;
}

/* Оверлей для блокировки скролла */
.accessibility-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999998;
    display: none;
}

.accessibility-overlay.active {
    display: block;
}

/* Запрет скролла при открытой панели */
body.accessibility-panel-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ПАНЕЛЬ НАСТРОЕК */
.accessibility-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background: #f5f5f5;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 999999;
    overflow-y: auto;
    font-family: Arial, sans-serif;
}

.accessibility-panel.active {
    right: 0;
}

.accessibility-panel__close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessibility-panel__close:hover {
    background: #e0e0e0;
    border-radius: 50%;
}

.accessibility-panel h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    color: #333;
}

.accessibility-option {
    margin-bottom: 20px;
	border: 1px solid #cccccc;
    padding: 1rem;
    border-radius: 5px;
}

.accessibility-option label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}
.accessibility-option label.easy-title {
    font-family: 'RobotoBold';
    font-size: 18px;
}

/* Стили для радиобаттонов */
.accessibility-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accessibility-radio {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.accessibility-radio:hover {
    background: #f0f0f0;
}

.accessibility-radio input[type="radio"] {
    margin-right: 10px;
}

.accessibility-radio.selected {
    background: #337ab7;
    color: white;
    border-color: #337ab7;
}

/* Кнопки в панели */
.accessibility-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.accessibility-link {
    background: none;
    border: none;
    color: #337ab7;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px;
    text-align: center;
}

.accessibility-link:hover {
    color: #286090;
}

.accessibility-apply {
    padding: 12px;
    background: linear-gradient(45deg, #8a1776, #c5638f);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.accessibility-apply:hover {
    background: linear-gradient(45deg, #a13c79, #c5638f);
}

.accessibility-cancel {
    padding: 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.accessibility-cancel:hover {
    background: #5a6268;
}