html[user-color-intensity="0"] {
    filter: grayscale(100%);
}

html[user-color-intensity="1"] {
    filter: saturate(0.75);
}

html[user-color-intensity="3"] {
    filter: saturate(1.25);
}

html[user-color-intensity="4"] {
    filter: saturate(1.5);
}

html {
    font-size: calc(var(--text-font-size) + var(--user-font-scale, 0) * 0.125rem);
}

body {
    line-height: calc((var(--base-line-height, 1.5) + var(--user-line-height-scale, 0))) !important;
}

body * {
    letter-spacing: calc(var(--user-letter-spacing, 0) * 1px);
}

body.accessibility-sidebar-open {
    overflow: hidden;
}

#accessibility-toggle {
    position: fixed;
    bottom: 8px;
    right: 8px;
    z-index: 1001;
    background-color: #fff;
    color: #0077cc;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

#accessibility-toggle svg {
    width: 32px;
    fill: #0d6efd;
}

#accessibility-toggle:hover svg {
    fill: #0b5ed7;
}

#accessibility-sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: #212529;
    color: white;
    transition: right 0.3s ease;
    z-index: 1051;
}

#accessibility-sidebar.active {
    right: 0;
}

.accessibility-sidebar-header, .accessibility-sidebar-body {
    padding: 16px;
}

.accessibility-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.accessibility-sidebar-body {
    font-size: 16px;
    max-height: calc(100vh - 57px);
    overflow: hidden auto;
}

.accessibility-sidebar-header h2 {
    margin-top: 0;
    margin-bottom: 0;
    text-align: center;
    color: #fff !important;
    font-size: 20px;
    line-height: 1.2 !important;
}

.accessibility-sidebar-header button {
    border: none;
    padding: 2px 4px;
    color: #fff;
    background: none;
    font-size: 20px;
    line-height: 1;
    opacity: 0.7;
}

.accessibility-sidebar-header button:hover {
    opacity: 1;
}

#accessibility-sidebar ul {
    list-style: none;
    padding: 0;
    margin-bottom: 0;
}

#accessibility-sidebar ul li {
    text-align: center;
}

#accessibility-sidebar ul li:not(:last-of-type) {
    margin-bottom: 16px;
}

#accessibility-sidebar ul li button {
    width: 100%;
    background: #212529;
    color: white;
    border: 1px solid #fff;
    padding: 8px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
}

#accessibility-sidebar ul li button.active {
    background-color: #4d5154;
    border-color: #373b3e;
}

#accessibility-sidebar ul li button:hover {
    background-color: #424649;
    border-color: #373b3e;
}

.access-btn-group {
    display: flex;
    justify-content: center;
}

.access-btn-group button {
    font-size: 16px;
    flex: 0 0 auto;
    width: auto !important;
    min-width: 48px;
}

.access-value-container {
    text-align: center;
    display: inline-block;
    color: white;
    border: 1px solid #fff;
    padding: 8px;
    text-align: center;
    font-size: 16px;
    flex: 1 1 auto;
}

.wpt-access-btn {
    &:disabled {
        pointer-events: none;
        background-color: rgba(255, 255, 255, 0.1) !important;
        opacity: .5;
    }
}

.access-decrease-btn {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.access-increase-btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

#accessibility-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

#accessibility-backdrop.active {
    display: block;
}

body[data-bs-mode="protanomalie"] {
    /* Statusfarben */
    --bs-success: #2e6e2f;
    --bs-info: #226ca5;
    --bs-warning: #aa7a00;
    --bs-danger: #944d3a;
    --bs-success-rgb: 46, 110, 47;
    --bs-info-rgb: 34, 108, 165;
    --bs-warning-rgb: 170, 122, 0;
    --bs-danger-rgb: 148, 77, 58;

    /* alerts */
    --bs-success-text-emphasis: #234521;
    --bs-success-bg-subtle: #d9e9d3;
    --bs-success-border-subtle: #9bbd94;
    --bs-danger-text-emphasis: #4a231b;
    --bs-danger-bg-subtle: #f9d8d3;
    --bs-danger-border-subtle: #e1a59d;
    --bs-warning-text-emphasis: #4e3a00;
    --bs-warning-bg-subtle: #f5eac2;
    --bs-warning-border-subtle: #dec48f;
    --bs-info-text-emphasis: #0f355a;
    --bs-info-bg-subtle: #d4e9f8;
    --bs-info-border-subtle: #a5cce6;
}

body[data-bs-mode="deuteranomalie"] {
    /* Statusfarben */
    --bs-success: #3b6e3c;
    --bs-success-rgb: 59, 110, 60;
    --bs-danger: #8f2f2e;
    --bs-danger-rgb: 143, 47, 46;
    --bs-warning: #a27000;
    --bs-warning-rgb: 162, 112, 0;
    --bs-info: #1d6fa5;
    --bs-info-rgb: 29, 111, 165;

    /* alerts */
    --bs-success-text-emphasis: #2e4d2d;
    --bs-success-bg-subtle: #e0ece0;
    --bs-success-border-subtle: #aac4aa;
    --bs-danger-text-emphasis: #4f1f1e;
    --bs-danger-bg-subtle: #f3d6d5;
    --bs-danger-border-subtle: #dda4a2;
    --bs-warning-text-emphasis: #4a3600;
    --bs-warning-bg-subtle: #f7edd1;
    --bs-warning-border-subtle: #e3cd93;
    --bs-info-text-emphasis: #0d3e5f;
    --bs-info-bg-subtle: #d4e8f4;
    --bs-info-border-subtle: #a4c9e0;
}

body[data-bs-motion="reduce-motion"] *,
body[data-bs-motion="reduce-motion"] *::before,
body[data-bs-motion="reduce-motion"] *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}