:root {
    --a11y-bg: #fff;
    --a11y-text: #111;
    --a11y-link: #0039a6;
    --a11y-border: #111;
    --a11y-focus: #ffbf00;
}

.special-version-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 8px 15px;
    color: #222;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    font: 600 14px/1.2 Arial, Helvetica, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.special-version-button img {
    display: block;
    width: 38px;
    height: auto;
    flex: 0 0 auto;
}

.special-version-button:hover {
    color: #000;
    background: #f6f6f6;
}

.special-version-button:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
}

.a11y-panel {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 2147483000;
    width: 100%;
    box-sizing: border-box;
    padding: 7px 16px;
    color: #111 !important;
    background: #fff !important;
    border-bottom: 1px solid #222;
    font: 16px/1.35 Arial, Helvetica, sans-serif !important;
}

/*
 * Панель fixed не занимает места в потоке. Этот служебный блок имеет
 * фактическую высоту панели и не позволяет ей перекрывать страницу.
 */
.a11y-panel-spacer {
    display: block !important;
    width: 100% !important;
    height: var(--a11y-panel-height, 0px) !important;
    min-height: var(--a11y-panel-height, 0px) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    pointer-events: none !important;
}

/* Штатная фиксированная шапка ortodont46.ru всегда находится под панелью. */
html.a11y-mode [data-js="header"] {
    top: var(--a11y-panel-height, 0px) !important;
}

.a11y-panel__main {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    max-width: 1680px;
    margin: 0 auto;
}

.a11y-panel__brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-right: 18px;
    border-right: 1px solid #bbb;
    font-size: 15px !important;
    font-weight: 700 !important;
    white-space: nowrap;
}

.a11y-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.a11y-control--inline {
    flex-wrap: nowrap;
}

.a11y-control__label {
    color: #111 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.a11y-panel button {
    min-width: 36px;
    min-height: 36px;
    box-sizing: border-box;
    padding: 6px 9px;
    color: #111 !important;
    background: #fff !important;
    border: 1px solid #222 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    font: 700 14px/1.2 Arial, Helvetica, sans-serif !important;
    text-transform: none !important;
    cursor: pointer;
}

.a11y-panel button:hover,
.a11y-panel button[aria-pressed="true"],
.a11y-panel button[aria-expanded="true"] {
    color: #fff !important;
    background: #222 !important;
}

.a11y-panel button[aria-pressed="true"] {
    box-shadow: 0 0 0 3px #ffc400 !important;
}

.a11y-icon-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
}

.a11y-icon-button--square {
    width: 36px;
    padding: 5px !important;
}

.a11y-icon {
    display: block;
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.a11y-panel__brand .a11y-icon {
    width: 25px;
    height: 25px;
}

.a11y-settings {
    margin: 7px -16px -7px;
    padding: 18px 20px 20px;
    background: #f5f5f5 !important;
    border-top: 1px solid #bbb;
}

.a11y-settings[hidden] {
    display: none !important;
}

.a11y-settings__inner {
    max-width: 1420px;
    margin: 0 auto;
}

.a11y-settings h2 {
    margin: 0 0 14px !important;
    color: #111 !important;
    font: 700 20px/1.25 Arial, Helvetica, sans-serif !important;
}

.a11y-settings__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 18px 24px;
}

.a11y-settings .a11y-control {
    align-content: start;
}

.a11y-settings .a11y-control__label {
    width: 100%;
    margin-bottom: 3px;
    font-size: 15px !important;
    font-weight: 700 !important;
}

.a11y-panel button:focus-visible,
.a11y-mode :focus-visible {
    outline: 4px solid var(--a11y-focus) !important;
    outline-offset: 3px !important;
}

.a11y-theme--white {
    color: #111 !important;
    background: #fff !important;
}

.a11y-theme--black {
    color: #fff !important;
    background: #000 !important;
}

.a11y-theme--blue {
    color: #063462 !important;
    background: #9dd1ff !important;
}

.a11y-theme--beige {
    color: #4d2600 !important;
    background: #f5e5c6 !important;
}

html.a11y-mode {
    scroll-behavior: auto !important;
}

html.a11y-mode body {
    color: var(--a11y-text) !important;
    background: var(--a11y-bg) !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 20px !important;
    letter-spacing: normal !important;
    line-height: 1.5 !important;
}

html.a11y-mode body :where(header, footer, main, nav, aside, section, article, div, form, fieldset, table, tr, td, th) {
    color: inherit !important;
    background-color: var(--a11y-bg) !important;
    background-image: none !important;
    box-shadow: none !important;
}

html.a11y-mode body :where(p, li, dt, dd, blockquote, label, input, textarea, select, button) {
    color: inherit !important;
    font-family: inherit !important;
    font-size: 1em !important;
    letter-spacing: inherit !important;
    line-height: inherit !important;
}

html.a11y-mode body :where(h1, h2, h3, h4, h5, h6) {
    color: inherit !important;
    font-family: inherit !important;
    letter-spacing: inherit !important;
    line-height: 1.25 !important;
}

html.a11y-mode body a {
    color: var(--a11y-link) !important;
}

html.a11y-mode body :where(input, textarea, select, button) {
    color: var(--a11y-text) !important;
    background: var(--a11y-bg) !important;
    border: 2px solid var(--a11y-border) !important;
}

html.a11y-mode body :where(input, textarea, select) {
    min-height: 44px;
    padding: 8px !important;
}

html.a11y-mode *,
html.a11y-mode *::before,
html.a11y-mode *::after {
    animation: none !important;
    transition: none !important;
}

html.a11y-font-small body {
    font-size: 18px !important;
}

html.a11y-font-medium body {
    font-size: 22px !important;
}

html.a11y-font-large body {
    font-size: 26px !important;
}

html.a11y-family-serif body,
html.a11y-family-serif body :where(p, li, dt, dd, blockquote, label, input, textarea, select, button, h1, h2, h3, h4, h5, h6) {
    font-family: Georgia, "Times New Roman", serif !important;
}

html.a11y-letters-medium body {
    letter-spacing: 0.08em !important;
}

html.a11y-letters-large body {
    letter-spacing: 0.16em !important;
}

html.a11y-lines-medium body {
    line-height: 1.65 !important;
}

html.a11y-lines-large body {
    line-height: 2 !important;
}

html.a11y-theme-white {
    --a11y-bg: #fff;
    --a11y-text: #111;
    --a11y-link: #0039a6;
    --a11y-border: #111;
}

html.a11y-theme-black {
    --a11y-bg: #000;
    --a11y-text: #fff;
    --a11y-link: #ffeb3b;
    --a11y-border: #fff;
}

html.a11y-theme-blue {
    --a11y-bg: #9dd1ff;
    --a11y-text: #062f57;
    --a11y-link: #53156f;
    --a11y-border: #062f57;
}

html.a11y-theme-beige {
    --a11y-bg: #f5e5c6;
    --a11y-text: #4d2600;
    --a11y-link: #003d7a;
    --a11y-border: #4d2600;
}

html.a11y-links-underlined body a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 0.18em !important;
}

html.a11y-images-grayscale body img {
    filter: grayscale(1) contrast(1.1) !important;
}

html.a11y-images-hide body img:not([data-a11y-keep]) {
    visibility: hidden !important;
}

html.a11y-mode body .a11y-panel,
html.a11y-mode body .a11y-panel * {
    letter-spacing: normal !important;
    line-height: 1.35 !important;
}

/* Панель не должна наследовать выбранную цветовую схему страницы. */
html.a11y-mode body #a11y-panel {
    color: #111 !important;
    background: #fff !important;
}

html.a11y-mode body #a11y-panel :where(div, span) {
    color: #111 !important;
    background: transparent !important;
}

html.a11y-mode body #a11y-panel button {
    color: #111 !important;
    background: #fff !important;
    border-color: #222 !important;
}

html.a11y-mode body #a11y-panel button:hover,
html.a11y-mode body #a11y-panel button[aria-pressed="true"],
html.a11y-mode body #a11y-panel button[aria-expanded="true"] {
    color: #fff !important;
    background: #222 !important;
}

html.a11y-mode body #a11y-panel .a11y-theme--white {
    color: #111 !important;
    background: #fff !important;
}

html.a11y-mode body #a11y-panel .a11y-theme--black {
    color: #fff !important;
    background: #000 !important;
}

html.a11y-mode body #a11y-panel .a11y-theme--blue {
    color: #063462 !important;
    background: #9dd1ff !important;
}

html.a11y-mode body #a11y-panel .a11y-theme--beige {
    color: #4d2600 !important;
    background: #f5e5c6 !important;
}

html.a11y-mode body #a11y-panel .a11y-settings {
    background: #f5f5f5 !important;
}

@media (max-width: 1200px) {
    .a11y-panel__brand {
        width: 100%;
        justify-content: center;
        padding: 0 0 6px;
        border-right: 0;
        border-bottom: 1px solid #ddd;
    }

    .a11y-settings__grid {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }
}

@media (max-width: 900px) {
    .a11y-panel {
        padding: 10px;
        max-height: 100vh;
        overflow-y: auto;
    }

    .a11y-panel__main {
        justify-content: flex-start;
        gap: 10px 16px;
    }

    .a11y-settings {
        margin: 10px -10px -10px;
    }
}

@media (max-width: 600px) {
    .a11y-panel__main {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .a11y-panel__brand {
        justify-content: flex-start;
    }

    .a11y-control--inline {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .a11y-settings__grid {
        grid-template-columns: 1fr;
    }

    .a11y-settings .a11y-control {
        align-items: stretch;
    }

    .a11y-settings .a11y-control button {
        flex: 1 1 auto;
    }
}

@media (max-width: 600px) {
    .special-version-button {
        gap: 7px;
        padding: 7px 10px;
        font-size: 12px;
        white-space: normal;
    }

    .special-version-button img {
        width: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .a11y-panel *,
    .special-version-button {
        animation: none !important;
        transition: none !important;
    }
}
