/* ============================================================
   Панель доступности для слабовидящих — ГОСТ Р 52872-2019
   ============================================================ */

:root {
    --acc-topbar-height: 0px;
    --acc-bar-accent: #005fcc;
    --acc-bar-accent-hover: #004799;
    --acc-bar-surface: #d5dde8;
    --acc-bar-muted: #475569;
    --acc-bar-border: #a8b4c4;
    --acc-bar-head-bg: linear-gradient(180deg, #c8d2e0 0%, #b8c4d4 100%);
    --acc-bar-shadow: 0 4px 14px rgba(15, 23, 42, 0.16), 0 1px 0 #94a3b8;
    --acc-bar-content-bg: #c9d3e1;
    --acc-chip-bg: #eef2f7;
    --acc-chip-radius: 8px;
    --acc-bar-options-bg: #e2e8f0;
    --acc-content-divider: #b0bcc9;
}

/* --- Контейнер: компактная кнопка или верхняя панель --- */
.accessibility-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10000;
}

html[data-visibility-mode="high-visibility"] .accessibility-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

/* Компактная кнопка включения (обычный режим) */
.acc-compact-trigger {
    display: block;
}

html[data-visibility-mode="high-visibility"] .acc-compact-trigger {
    display: none;
}

/* --- Верхняя панель настроек (режим для слабовидящих) --- */
.accessibility-top-bar {
    display: none;
}

html[data-visibility-mode="high-visibility"] .accessibility-top-bar {
    display: block;
    width: 100%;
    background: var(--acc-bar-surface);
    border-bottom: 4px solid var(--acc-bar-accent);
    box-shadow: var(--acc-bar-shadow);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #1e293b;
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
}

html[data-visibility-mode="high-visibility"] .accessibility-top-bar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.12) 0%, rgba(15, 23, 42, 0) 100%);
    pointer-events: none;
}

html[data-visibility-mode="high-visibility"] body {
    padding-top: var(--acc-topbar-height);
}

/* Линия между панелью и контентом (стандартная схема) */
html[data-visibility-mode="high-visibility"][data-acc-scheme="standard"] body > header,
html[data-visibility-mode="high-visibility"][data-acc-scheme="standard"] body > .menu-container,
html[data-visibility-mode="high-visibility"][data-acc-scheme="standard"] body > .container,
html[data-visibility-mode="high-visibility"][data-acc-scheme="standard"] body > main {
    border-top: 2px solid var(--acc-content-divider);
}

.accessibility-bar-head {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 8px 16px;
    background: var(--acc-bar-head-bg);
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid var(--acc-bar-border);
}

.accessibility-top-bar--expanded .accessibility-bar-head {
    border-bottom: 1px solid var(--acc-bar-border);
}

.accessibility-bar-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

.accessibility-bar-title::before {
    content: '';
    width: 4px;
    height: 1.1em;
    border-radius: 2px;
    background: var(--acc-bar-accent);
    flex-shrink: 0;
}

.accessibility-bar-quick {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
}

.accessibility-bar-quick .acc-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
    padding: 5px 10px 5px 8px;
    background: var(--acc-chip-bg);
    border: 1px solid var(--acc-bar-border);
    border-radius: var(--acc-chip-radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 2px rgba(15, 23, 42, 0.08);
}

.accessibility-bar-quick .acc-group-label {
    margin-bottom: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--acc-bar-muted);
    white-space: nowrap;
}

.accessibility-bar-quick .acc-options {
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--acc-bar-border);
    background: var(--acc-bar-options-bg, #e2e8f0);
}

.accessibility-bar-quick .acc-btn {
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--acc-bar-border);
    background: transparent;
    box-shadow: none;
}

.accessibility-bar-quick .acc-btn:last-child {
    border-right: none;
}

.accessibility-bar-quick .acc-btn:hover {
    background: #e8edf3;
}

.accessibility-bar-quick .acc-btn.active {
    background: var(--acc-bar-accent);
    color: #fff;
    border-color: transparent;
    box-shadow: inset 0 0 0 1px var(--acc-bar-accent);
}

.accessibility-bar-quick .acc-btn-scheme-bw.active,
.accessibility-bar-quick .acc-btn-scheme-wb.active,
.accessibility-bar-quick .acc-btn-scheme-db.active,
.accessibility-bar-quick .acc-btn-scheme-bg.active,
.accessibility-bar-quick .acc-btn-scheme-gb.active {
    outline: 2px solid var(--acc-bar-accent);
    outline-offset: -2px;
}

.accessibility-bar-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

.accessibility-bar-content {
    display: none;
    overflow: visible;
    padding: 12px 16px 14px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    background: var(--acc-bar-content-bg);
    border-top: 1px solid var(--acc-bar-border);
}

.accessibility-top-bar--expanded .accessibility-bar-content {
    display: block;
}

.accessibility-bar-content .accessibility-settings {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.accessibility-bar-content .acc-group {
    flex: 0 1 170px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--acc-bar-border);
    border-radius: var(--acc-chip-radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 3px rgba(15, 23, 42, 0.08);
}

.accessibility-bar-content .acc-group-label {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--acc-bar-muted);
    margin-bottom: 8px;
}

.accessibility-bar-content .acc-options {
    justify-content: center;
    gap: 5px;
}

.accessibility-top-bar .acc-btn {
    padding: 5px 9px;
    font-size: 12px;
    min-width: 28px;
    border-width: 1px;
    border-radius: 5px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.accessibility-top-bar .acc-btn.active {
    box-shadow: 0 1px 2px rgba(0, 95, 204, 0.25);
}

.accessibility-top-bar .acc-btn-font-normal { font-size: 12px; }
.accessibility-top-bar .acc-btn-font-large { font-size: 14px; }
.accessibility-top-bar .acc-btn-font-xlarge { font-size: 16px; }

.acc-toggle-settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    color: #1f2937;
    border: 1px solid var(--acc-bar-border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.acc-toggle-settings:hover {
    background: #eef2f7;
    border-color: #aeb9c5;
}

.acc-toggle-settings[aria-expanded="true"] {
    background: var(--acc-bar-accent);
    color: #fff;
    border-color: var(--acc-bar-accent);
    box-shadow: 0 1px 3px rgba(0, 95, 204, 0.3);
}

.acc-toggle-settings[aria-expanded="true"]:hover {
    background: var(--acc-bar-accent-hover);
    border-color: var(--acc-bar-accent-hover);
}

.acc-toggle-settings:focus {
    outline: 2px solid #005fcc;
    outline-offset: 1px;
}

.acc-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    background: #fff;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    color: #333;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.acc-icon-btn:hover,
.acc-icon-btn:focus {
    background: #e8e8e8;
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

.acc-icon-btn .eye-icon {
    font-size: 32px;
    line-height: 1;
}

.visibility-toggle {
    gap: 0;
}

.visibility-toggle .acc-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Группы настроек в верхней панели --- */
.accessibility-settings {
    box-sizing: border-box;
}

.accessibility-top-bar .accessibility-settings {
    width: auto;
    max-height: none;
    overflow: visible;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.accessibility-settings h4 {
    margin: 0 0 8px;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    border: none;
    background: none;
}

.acc-group {
    margin-bottom: 0;
    padding: 0;
    border-bottom: none;
    border-right: none;
    min-width: 0;
    max-width: none;
    flex: 0 1 150px;
    text-align: center;
}

.accessibility-top-bar .acc-group-speech {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 10px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px dashed var(--acc-bar-border);
}

.accessibility-bar-content .acc-group-speech {
    flex: 1 1 100%;
    max-width: 100%;
}

.accessibility-bar-content .acc-group-speech .acc-speech-read-page {
    flex: 1 1 auto;
    min-width: 140px;
}

.acc-group-speech > .acc-group-label {
    flex: 0 0 auto;
    margin-bottom: 0;
    margin-right: 4px;
}

.acc-group-speech > .acc-options {
    flex: 0 0 auto;
}

.acc-group-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
}

/* --- Кнопки-выборы (общий стиль) --- */
.acc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.acc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    background: #f5f5f5;
    border: 2px solid #aaa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #333;
    line-height: 1.2;
    font-family: inherit;
}

.acc-btn:hover {
    border-color: #555;
    background: #e8e8e8;
}

.acc-btn:focus {
    outline: 2px solid #005fcc;
    outline-offset: 1px;
}

.acc-btn.active {
    background: #005fcc;
    color: #fff;
    border-color: #005fcc;
}

/* Кнопки размера шрифта */
.acc-btn-font-normal { font-size: 14px; }
.acc-btn-font-large { font-size: 18px; }
.acc-btn-font-xlarge { font-size: 22px; }

/* Кнопки цветовых схем */
.acc-btn-scheme-bw { background: #fff; color: #000; border-color: #000; }
.acc-btn-scheme-bw.active { outline: 3px solid #005fcc; }
.acc-btn-scheme-wb { background: #000; color: #fff; border-color: #fff; }
.acc-btn-scheme-wb.active { outline: 3px solid #ffdd00; }
.acc-btn-scheme-db { background: #9DD1FF; color: #063462; border-color: #063462; }
.acc-btn-scheme-db.active { outline: 3px solid #063462; }
.acc-btn-scheme-bg { background: #F5E6C8; color: #4D3B1A; border-color: #4D3B1A; }
.acc-btn-scheme-bg.active { outline: 3px solid #4D3B1A; }
.acc-btn-scheme-gb { background: #3B3B3B; color: #A9E44D; border-color: #A9E44D; }
.acc-btn-scheme-gb.active { outline: 3px solid #A9E44D; }

/* Кнопка сброса */
.acc-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    background: #fff;
    color: #b42318;
    border: 1px solid #f2c8c4;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.acc-reset-btn:hover {
    background: #fef3f2;
    border-color: #e08a84;
    color: #912018;
}

.acc-reset-btn:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

.acc-sub-label {
    margin-top: 10px;
}

.acc-speech-actions {
    margin-top: 6px;
}

.acc-speech-read-page {
    flex: 1 1 auto;
}

.acc-speech-stop {
    min-width: 72px;
}

.acc-speech-unsupported {
    margin: 0;
    font-size: 13px;
    color: #777;
    line-height: 1.4;
}

/* --- Значки озвучивания у блоков текста --- */
.acc-speech-block {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0.5em;
}

.acc-speech-block > :not(.acc-block-speech-btn) {
    flex: 1 1 auto;
    min-width: 0;
}

.acc-block-speech-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-top: 2px;
    padding: 0;
    box-sizing: border-box;
    background: #fff;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    color: #333;
    line-height: 1;
    font-family: Arial, sans-serif;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.acc-block-speech-icon {
    font-size: 24px;
    line-height: 1;
}

.acc-block-speech-btn:hover,
.acc-block-speech-btn:focus {
    background: #e8e8e8;
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

.acc-block-speech-btn.is-speaking {
    background: #005fcc;
    border-color: #005fcc;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.25);
}

.acc-speech-block > h1,
.acc-speech-block > h2,
.acc-speech-block > h3,
.acc-speech-block > h4,
.acc-speech-block > h5,
.acc-speech-block > h6,
.acc-speech-block > p,
.acc-speech-block > blockquote,
.acc-speech-block > li {
    margin-top: 0;
}

html[data-acc-speech="click"] #main-content,
html[data-acc-speech="click"] .content {
    cursor: help;
}

/* ============================================================
   1. РАЗМЕР ШРИФТА
   ============================================================ */
html[data-acc-fontsize="large"] {
    font-size: 130% !important;
}
html[data-acc-fontsize="xlarge"] {
    font-size: 160% !important;
}

/* ============================================================
   2. ЦВЕТОВЫЕ СХЕМЫ
   ============================================================ */

/* --- Чёрный на белом (высокий контраст) --- */
html[data-acc-scheme="bw"],
html[data-acc-scheme="bw"] body {
    background: #fff !important;
    color: #000 !important;
}
html[data-acc-scheme="bw"] * {
    background-color: transparent !important;
    color: #000 !important;
    border-color: #000 !important;
}
html[data-acc-scheme="bw"] a,
html[data-acc-scheme="bw"] a * {
    color: #0000EE !important;
    text-decoration: underline !important;
}
html[data-acc-scheme="bw"] a:visited,
html[data-acc-scheme="bw"] a:visited * {
    color: #551A8B !important;
}
html[data-acc-scheme="bw"] button,
html[data-acc-scheme="bw"] input[type="submit"],
html[data-acc-scheme="bw"] .acc-btn,
html[data-acc-scheme="bw"] .visibility-toggle,
html[data-acc-scheme="bw"] .speech-toggle,
html[data-acc-scheme="bw"] .acc-icon-btn,
html[data-acc-scheme="bw"] .acc-block-speech-btn {
    background-color: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
}
html[data-acc-scheme="bw"] .acc-btn.active {
    background-color: #000 !important;
    color: #fff !important;
}
html[data-acc-scheme="bw"] .acc-reset-btn {
    background-color: #000 !important;
    color: #fff !important;
}

/* --- Белый на чёрном (инвертированный) --- */
html[data-acc-scheme="wb"],
html[data-acc-scheme="wb"] body {
    background: #000 !important;
    color: #fff !important;
}
html[data-acc-scheme="wb"] * {
    background-color: transparent !important;
    color: #fff !important;
    border-color: #fff !important;
}
html[data-acc-scheme="wb"] a,
html[data-acc-scheme="wb"] a * {
    color: #ffdd00 !important;
    text-decoration: underline !important;
}
html[data-acc-scheme="wb"] button,
html[data-acc-scheme="wb"] input[type="submit"],
html[data-acc-scheme="wb"] .acc-btn,
html[data-acc-scheme="wb"] .visibility-toggle,
html[data-acc-scheme="wb"] .speech-toggle,
html[data-acc-scheme="wb"] .acc-icon-btn,
html[data-acc-scheme="wb"] .acc-block-speech-btn {
    background-color: #222 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}
html[data-acc-scheme="wb"] .acc-btn.active {
    background-color: #fff !important;
    color: #000 !important;
}
html[data-acc-scheme="wb"] .acc-reset-btn {
    background-color: #fff !important;
    color: #000 !important;
}

/* --- Тёмно-синий на голубом --- */
html[data-acc-scheme="db"],
html[data-acc-scheme="db"] body {
    background: #9DD1FF !important;
    color: #063462 !important;
}
html[data-acc-scheme="db"] * {
    background-color: transparent !important;
    color: #063462 !important;
    border-color: #063462 !important;
}
html[data-acc-scheme="db"] a,
html[data-acc-scheme="db"] a * {
    color: #00008B !important;
    text-decoration: underline !important;
}
html[data-acc-scheme="db"] button,
html[data-acc-scheme="db"] input[type="submit"],
html[data-acc-scheme="db"] .acc-btn,
html[data-acc-scheme="db"] .visibility-toggle,
html[data-acc-scheme="db"] .speech-toggle,
html[data-acc-scheme="db"] .acc-icon-btn,
html[data-acc-scheme="db"] .acc-block-speech-btn {
    background-color: #b8dfff !important;
    color: #063462 !important;
    border: 2px solid #063462 !important;
}
html[data-acc-scheme="db"] .acc-btn.active {
    background-color: #063462 !important;
    color: #9DD1FF !important;
}
html[data-acc-scheme="db"] .acc-reset-btn {
    background-color: #063462 !important;
    color: #9DD1FF !important;
}

/* --- Коричневый на бежевом --- */
html[data-acc-scheme="bg"],
html[data-acc-scheme="bg"] body {
    background: #F5E6C8 !important;
    color: #4D3B1A !important;
}
html[data-acc-scheme="bg"] * {
    background-color: transparent !important;
    color: #4D3B1A !important;
    border-color: #4D3B1A !important;
}
html[data-acc-scheme="bg"] a,
html[data-acc-scheme="bg"] a * {
    color: #7B3F00 !important;
    text-decoration: underline !important;
}
html[data-acc-scheme="bg"] button,
html[data-acc-scheme="bg"] input[type="submit"],
html[data-acc-scheme="bg"] .acc-btn,
html[data-acc-scheme="bg"] .visibility-toggle,
html[data-acc-scheme="bg"] .speech-toggle,
html[data-acc-scheme="bg"] .acc-icon-btn,
html[data-acc-scheme="bg"] .acc-block-speech-btn {
    background-color: #eedcba !important;
    color: #4D3B1A !important;
    border: 2px solid #4D3B1A !important;
}
html[data-acc-scheme="bg"] .acc-btn.active {
    background-color: #4D3B1A !important;
    color: #F5E6C8 !important;
}
html[data-acc-scheme="bg"] .acc-reset-btn {
    background-color: #4D3B1A !important;
    color: #F5E6C8 !important;
}

/* --- Зелёный на тёмном --- */
html[data-acc-scheme="gb"],
html[data-acc-scheme="gb"] body {
    background: #3B3B3B !important;
    color: #A9E44D !important;
}
html[data-acc-scheme="gb"] * {
    background-color: transparent !important;
    color: #A9E44D !important;
    border-color: #A9E44D !important;
}
html[data-acc-scheme="gb"] a,
html[data-acc-scheme="gb"] a * {
    color: #C8FF5D !important;
    text-decoration: underline !important;
}
html[data-acc-scheme="gb"] button,
html[data-acc-scheme="gb"] input[type="submit"],
html[data-acc-scheme="gb"] .acc-btn,
html[data-acc-scheme="gb"] .visibility-toggle,
html[data-acc-scheme="gb"] .speech-toggle,
html[data-acc-scheme="gb"] .acc-icon-btn,
html[data-acc-scheme="gb"] .acc-block-speech-btn {
    background-color: #4a4a4a !important;
    color: #A9E44D !important;
    border: 2px solid #A9E44D !important;
}
html[data-acc-scheme="gb"] .acc-btn.active {
    background-color: #A9E44D !important;
    color: #3B3B3B !important;
}
html[data-acc-scheme="gb"] .acc-reset-btn {
    background-color: #A9E44D !important;
    color: #3B3B3B !important;
}

/* --- Панель: отдельные цвета под каждую схему --- */
html[data-acc-scheme="bw"] {
    --acc-bar-surface: #d4d4d4;
    --acc-bar-head-bg: linear-gradient(180deg, #c4c4c4 0%, #b0b0b0 100%);
    --acc-bar-content-bg: #c8c8c8;
    --acc-chip-bg: #ebebeb;
    --acc-bar-options-bg: #d0d0d0;
    --acc-bar-border: #000;
    --acc-content-divider: #888;
}

html[data-acc-scheme="wb"] {
    --acc-bar-surface: #1a1a1a;
    --acc-bar-head-bg: linear-gradient(180deg, #2a2a2a 0%, #141414 100%);
    --acc-bar-content-bg: #222;
    --acc-chip-bg: #333;
    --acc-bar-options-bg: #3a3a3a;
    --acc-bar-border: #fff;
    --acc-content-divider: #666;
    --acc-bar-muted: #ddd;
}

html[data-acc-scheme="db"] {
    --acc-bar-surface: #7ec0ff;
    --acc-bar-head-bg: linear-gradient(180deg, #6eb5f7 0%, #5da8eb 100%);
    --acc-bar-content-bg: #72baf5;
    --acc-chip-bg: #b8dfff;
    --acc-bar-options-bg: #a8d4f5;
    --acc-bar-border: #063462;
    --acc-content-divider: #063462;
}

html[data-acc-scheme="bg"] {
    --acc-bar-surface: #e8d4b0;
    --acc-bar-head-bg: linear-gradient(180deg, #dcc9a3 0%, #cfba92 100%);
    --acc-bar-content-bg: #e0cda8;
    --acc-chip-bg: #f5ead4;
    --acc-bar-options-bg: #e8d9be;
    --acc-bar-border: #4D3B1A;
    --acc-content-divider: #4D3B1A;
}

html[data-acc-scheme="gb"] {
    --acc-bar-surface: #2f2f2f;
    --acc-bar-head-bg: linear-gradient(180deg, #3d3d3d 0%, #282828 100%);
    --acc-bar-content-bg: #353535;
    --acc-chip-bg: #454545;
    --acc-bar-options-bg: #4e4e4e;
    --acc-bar-border: #A9E44D;
    --acc-content-divider: #6a8a35;
    --acc-bar-muted: #c8e88a;
}

/* Панель поверх правила * { background: transparent } в схемах */
html[data-visibility-mode="high-visibility"] .accessibility-panel .accessibility-top-bar {
    background-color: var(--acc-bar-surface) !important;
}

html[data-visibility-mode="high-visibility"] .accessibility-panel .accessibility-bar-head {
    background: var(--acc-bar-head-bg) !important;
}

html[data-visibility-mode="high-visibility"] .accessibility-panel .accessibility-bar-content {
    background-color: var(--acc-bar-content-bg) !important;
}

html[data-visibility-mode="high-visibility"] .accessibility-panel .accessibility-bar-quick .acc-group,
html[data-visibility-mode="high-visibility"] .accessibility-panel .accessibility-bar-content .acc-group {
    background-color: var(--acc-chip-bg) !important;
}

html[data-visibility-mode="high-visibility"] .accessibility-panel .accessibility-bar-quick .acc-options {
    background-color: var(--acc-bar-options-bg, #e2e8f0) !important;
}

html[data-visibility-mode="high-visibility"] .accessibility-panel .accessibility-top-bar,
html[data-visibility-mode="high-visibility"] .accessibility-panel .accessibility-bar-head,
html[data-visibility-mode="high-visibility"] .accessibility-panel .accessibility-bar-content,
html[data-visibility-mode="high-visibility"] .accessibility-panel .acc-group {
    border-color: var(--acc-bar-border) !important;
}

/* Навигация — фон меню и подменю (поверх * { background: transparent }) */
html[data-acc-scheme="bw"] .menu-container,
html[data-acc-scheme="bw"] .menu,
html[data-acc-scheme="bw"] .menu-toggle {
    background-color: #fff !important;
}

html[data-acc-scheme="bw"] .submenu {
    background-color: #f0f0f0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
}

html[data-acc-scheme="bw"] .menu > ul > li:hover,
html[data-acc-scheme="bw"] .submenu li:hover,
html[data-acc-scheme="bw"] .submenu a:hover {
    background-color: #e0e0e0 !important;
}

html[data-acc-scheme="bw"] .menu a,
html[data-acc-scheme="bw"] .submenu a {
    color: #000 !important;
    text-decoration: none !important;
}

html[data-acc-scheme="bw"] .menu a:hover,
html[data-acc-scheme="bw"] .submenu a:hover {
    text-decoration: underline !important;
}

html[data-acc-scheme="wb"] .menu-container,
html[data-acc-scheme="wb"] .menu,
html[data-acc-scheme="wb"] .menu-toggle {
    background-color: #111 !important;
}

html[data-acc-scheme="wb"] .submenu {
    background-color: #222 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
}

html[data-acc-scheme="wb"] .menu > ul > li:hover,
html[data-acc-scheme="wb"] .submenu li:hover,
html[data-acc-scheme="wb"] .submenu a:hover {
    background-color: #333 !important;
}

html[data-acc-scheme="wb"] .menu a,
html[data-acc-scheme="wb"] .submenu a {
    color: #fff !important;
    text-decoration: none !important;
}

html[data-acc-scheme="wb"] .menu a:hover,
html[data-acc-scheme="wb"] .submenu a:hover {
    color: #ffdd00 !important;
    text-decoration: underline !important;
}

html[data-acc-scheme="db"] .menu-container,
html[data-acc-scheme="db"] .menu,
html[data-acc-scheme="db"] .menu-toggle {
    background-color: #b8dfff !important;
}

html[data-acc-scheme="db"] .submenu {
    background-color: #9dd1ff !important;
    box-shadow: 0 4px 14px rgba(6, 52, 98, 0.25) !important;
}

html[data-acc-scheme="db"] .menu > ul > li:hover,
html[data-acc-scheme="db"] .submenu li:hover,
html[data-acc-scheme="db"] .submenu a:hover {
    background-color: #7ec0ff !important;
}

html[data-acc-scheme="db"] .menu a,
html[data-acc-scheme="db"] .submenu a {
    color: #063462 !important;
    text-decoration: none !important;
}

html[data-acc-scheme="db"] .menu a:hover,
html[data-acc-scheme="db"] .submenu a:hover {
    text-decoration: underline !important;
}

html[data-acc-scheme="bg"] .menu-container,
html[data-acc-scheme="bg"] .menu,
html[data-acc-scheme="bg"] .menu-toggle {
    background-color: #eedcba !important;
}

html[data-acc-scheme="bg"] .submenu {
    background-color: #f5e6c8 !important;
    box-shadow: 0 4px 14px rgba(77, 59, 26, 0.2) !important;
}

html[data-acc-scheme="bg"] .menu > ul > li:hover,
html[data-acc-scheme="bg"] .submenu li:hover,
html[data-acc-scheme="bg"] .submenu a:hover {
    background-color: #e5d4b0 !important;
}

html[data-acc-scheme="bg"] .menu a,
html[data-acc-scheme="bg"] .submenu a {
    color: #4d3b1a !important;
    text-decoration: none !important;
}

html[data-acc-scheme="bg"] .menu a:hover,
html[data-acc-scheme="bg"] .submenu a:hover {
    text-decoration: underline !important;
}

html[data-acc-scheme="gb"] .menu-container,
html[data-acc-scheme="gb"] .menu,
html[data-acc-scheme="gb"] .menu-toggle {
    background-color: #4a4a4a !important;
}

html[data-acc-scheme="gb"] .submenu {
    background-color: #3b3b3b !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
}

html[data-acc-scheme="gb"] .menu > ul > li:hover,
html[data-acc-scheme="gb"] .submenu li:hover,
html[data-acc-scheme="gb"] .submenu a:hover {
    background-color: #525252 !important;
}

html[data-acc-scheme="gb"] .menu a,
html[data-acc-scheme="gb"] .submenu a {
    color: #a9e44d !important;
    text-decoration: none !important;
}

html[data-acc-scheme="gb"] .menu a:hover,
html[data-acc-scheme="gb"] .submenu a:hover {
    color: #c8ff5d !important;
    text-decoration: underline !important;
}

html[data-acc-scheme="bw"] .menu li,
html[data-acc-scheme="bw"] .submenu li,
html[data-acc-scheme="wb"] .menu li,
html[data-acc-scheme="wb"] .submenu li,
html[data-acc-scheme="db"] .menu li,
html[data-acc-scheme="db"] .submenu li,
html[data-acc-scheme="bg"] .menu li,
html[data-acc-scheme="bg"] .submenu li,
html[data-acc-scheme="gb"] .menu li,
html[data-acc-scheme="gb"] .submenu li {
    text-shadow: none !important;
}

/* ============================================================
   3. ТИП ШРИФТА
   ============================================================ */
html[data-acc-font="arial"],
html[data-acc-font="arial"] * {
    font-family: Arial, Helvetica, sans-serif !important;
}
html[data-acc-font="times"],
html[data-acc-font="times"] * {
    font-family: "Times New Roman", Times, Georgia, serif !important;
}

/* ============================================================
   4. МЕЖБУКВЕННЫЙ ИНТЕРВАЛ
   ============================================================ */
html[data-acc-letterspacing="medium"],
html[data-acc-letterspacing="medium"] * {
    letter-spacing: 2px !important;
}
html[data-acc-letterspacing="large"],
html[data-acc-letterspacing="large"] * {
    letter-spacing: 4px !important;
}

/* ============================================================
   5. МЕЖСТРОЧНЫЙ ИНТЕРВАЛ
   ============================================================ */
html[data-acc-linespacing="medium"],
html[data-acc-linespacing="medium"] * {
    line-height: 1.8 !important;
}
html[data-acc-linespacing="large"],
html[data-acc-linespacing="large"] * {
    line-height: 2.4 !important;
}

/* ============================================================
   6. ИЗОБРАЖЕНИЯ
   ============================================================ */

/* --- Чёрно-белые изображения --- */
html[data-acc-images="grayscale"] img,
html[data-acc-images="grayscale"] picture,
html[data-acc-images="grayscale"] video {
    filter: grayscale(100%) !important;
}
html[data-acc-images="grayscale"] [style*="background-image"] {
    filter: grayscale(100%) !important;
}

/* --- Скрытые изображения --- */
html[data-acc-images="hide"] img,
html[data-acc-images="hide"] picture,
html[data-acc-images="hide"] svg:not(.acc-icon),
html[data-acc-images="hide"] video {
    opacity: 0 !important;
    position: relative !important;
}
/* Заглушка для скрытых изображений — рамка, чтобы было видно что здесь была картинка */
html[data-acc-images="hide"] img,
html[data-acc-images="hide"] picture img,
html[data-acc-images="hide"] video {
    border: 2px dashed #999 !important;
    min-height: 40px !important;
    min-width: 40px !important;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(150,150,150,0.15) 10px,
        rgba(150,150,150,0.15) 20px
    ) !important;
}
html[data-acc-images="hide"] [style*="background-image"] {
    background-image: none !important;
}

/* --- Убираем фоновые изображения при всех цветовых схемах (кроме стандартной) --- */
html[data-acc-scheme="bw"] [style*="background-image"],
html[data-acc-scheme="wb"] [style*="background-image"],
html[data-acc-scheme="db"] [style*="background-image"],
html[data-acc-scheme="bg"] [style*="background-image"],
html[data-acc-scheme="gb"] [style*="background-image"] {
    background-image: none !important;
}

/* ============================================================
   7. МЕЖСЛОВНЫЙ ИНТЕРВАЛ
   ============================================================ */
html[data-acc-wordspacing="medium"],
html[data-acc-wordspacing="medium"] * {
    word-spacing: 4px !important;
}
html[data-acc-wordspacing="large"],
html[data-acc-wordspacing="large"] * {
    word-spacing: 8px !important;
}

/* ============================================================
   8. ВЫДЕЛЕНИЕ ССЫЛОК
   ============================================================ */
html[data-acc-links="underline"] a {
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}
html[data-acc-links="underline"] a:hover,
html[data-acc-links="underline"] a:focus {
    text-decoration-thickness: 3px !important;
}

/* ============================================================
   9. УВЕЛИЧЕННЫЙ КУРСОР
   ============================================================ */
html[data-acc-cursor="large"],
html[data-acc-cursor="large"] * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M5 1L5 28L12 20L20 20Z' fill='black' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 5 1, auto !important;
}
html[data-acc-cursor="large"] a,
html[data-acc-cursor="large"] button,
html[data-acc-cursor="large"] [role="button"],
html[data-acc-cursor="large"] input[type="submit"],
html[data-acc-cursor="large"] select,
html[data-acc-cursor="large"] label {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M3 6C3 6 9 1 16 1C23 1 29 6 29 6L29 10C29 10 23 16 16 16C9 16 3 10 3 10Z' fill='white' stroke='black' stroke-width='2'/%3E%3Ccircle cx='16' cy='8' r='4' fill='black'/%3E%3Cpath d='M6 22L26 22' stroke='black' stroke-width='3'/%3E%3C/svg%3E") 16 16, pointer !important;
}
html[data-acc-cursor="large"] input[type="text"],
html[data-acc-cursor="large"] input[type="email"],
html[data-acc-cursor="large"] input[type="search"],
html[data-acc-cursor="large"] input[type="password"],
html[data-acc-cursor="large"] textarea {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cline x1='16' y1='2' x2='16' y2='30' stroke='black' stroke-width='3'/%3E%3Cline x1='10' y1='2' x2='22' y2='2' stroke='black' stroke-width='3'/%3E%3Cline x1='10' y1='30' x2='22' y2='30' stroke='black' stroke-width='3'/%3E%3C/svg%3E") 16 16, text !important;
}

/* ============================================================
   10. ВИДИМЫЕ ФОКУСНЫЕ РАМКИ (клавиатурная навигация)
   ============================================================ */
*:focus-visible {
    outline: 3px solid #005fcc !important;
    outline-offset: 2px !important;
}
/* Более контрастный фокус для тёмных схем */
html[data-acc-scheme="wb"] *:focus-visible,
html[data-acc-scheme="gb"] *:focus-visible {
    outline-color: #ffdd00 !important;
}
html[data-acc-scheme="db"] *:focus-visible {
    outline-color: #063462 !important;
}
html[data-acc-scheme="bg"] *:focus-visible {
    outline-color: #4D3B1A !important;
}

/* ============================================================
   11. ССЫЛКА «ПЕРЕЙТИ К СОДЕРЖИМОМУ» (Skip to content)
   ============================================================ */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 10px;
    z-index: 100000;
    padding: 12px 20px;
    background: #005fcc;
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 6px 6px;
    transition: top 0.2s;
    font-family: Arial, sans-serif;
}
.skip-to-content:focus {
    top: 0;
    outline: 3px solid #ffdd00;
    outline-offset: 2px;
}

html[data-visibility-mode="high-visibility"] .skip-to-content:focus {
    top: var(--acc-topbar-height);
}

html.pk-has-admin-bar[data-visibility-mode="high-visibility"] .skip-to-content:focus {
    top: calc(var(--pk-admin-bar-height) + var(--acc-topbar-height));
}

/* ============================================================
   12. АДАПТИВНОСТЬ ПАНЕЛИ
   ============================================================ */
@media (max-width: 768px) {
    .accessibility-bar-head {
        padding: 6px 10px;
    }

    .accessibility-bar-title {
        font-size: 13px;
    }

    .accessibility-bar-quick .acc-group-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .accessibility-bar-content {
        padding: 8px 10px;
    }

    .accessibility-bar-content .accessibility-settings {
        gap: 8px 10px;
    }

    .accessibility-top-bar .acc-btn {
        padding: 4px 6px;
        font-size: 11px;
        min-width: 24px;
    }

    .acc-group-speech {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .accessibility-panel {
        right: 6px;
    }

    .acc-icon-btn {
        width: 48px;
        height: 48px;
    }

    .acc-icon-btn .eye-icon {
        font-size: 26px;
    }

    .acc-reset-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Сочетание с admin bar и липким меню */
html.pk-has-admin-bar[data-visibility-mode="high-visibility"] body {
    padding-top: calc(var(--pk-admin-bar-height) + var(--acc-topbar-height));
}

html[data-visibility-mode="high-visibility"] .menu-container.menu-sticky {
    top: var(--acc-topbar-height);
}

html.pk-has-admin-bar[data-visibility-mode="high-visibility"] .menu-container.menu-sticky {
    top: calc(var(--pk-admin-bar-height) + var(--acc-topbar-height));
}