:root {
    --filtering-mode-button-size: 60px; /* should be multiple of 4 */
    --filtering-mode-slider-width: calc(4 * var(--filtering-mode-button-size) + 3px);
    }

.filteringModeSlider {
    align-items: center;
    container-type: size;
    display: flex;
    height: var(--filtering-mode-button-size);
    justify-content: center;
    position: relative;
    width: var(--filtering-mode-slider-width);
    }

.filteringModeButton {
    background-color: var(--surface-1);
    border-radius: 20%;
    height: var(--filtering-mode-button-size);
    position: absolute;
    width: var(--filtering-mode-button-size);
    z-index: 10;
    }

.filteringModeButton > div {
    background-color: var(--accent-surface-1);
    border: 4px solid var(--accent-surface-1);
    border-radius: inherit;
    box-sizing: border-box;
    height: 100%;
    width: 100%;
    }

.filteringModeSlider.moving .filteringModeButton > div,
.filteringModeButton > div:hover {
    filter: brightness(0.9);
    }

.filteringModeSlider[data-level="0"] .filteringModeButton > div {
    background-color: var(--surface-2);
    border-color: var(--surface-2);
    }

.filteringModeSlider span[data-level] {
    background-color: var(--accent-surface-1);
    display: inline-flex;
    flex-shrink: 0;
    height: 30%;
    margin-left: 1px;
    width: var(--filtering-mode-button-size);
    }
.filteringModeSlider span[data-level]:first-of-type {
    margin-left: 0;
    }

.filteringModeSlider.moving span[data-level] {
    pointer-events: none;
    }

.filteringModeSlider[data-level="0"] .filteringModeButton {
    left: 0;
    }
.filteringModeSlider[data-level="1"] .filteringModeButton {
    left: calc(var(--filtering-mode-button-size) + 1px);
    }
.filteringModeSlider[data-level="2"] .filteringModeButton {
    left: calc(var(--filtering-mode-button-size) * 2 + 2px);
    }
.filteringModeSlider[data-level="3"] .filteringModeButton {
    left: calc(var(--filtering-mode-button-size) * 3 + 3px);
    }

[dir="rtl"] .filteringModeSlider span[data-level] {
    margin-left: 0;
    margin-right: 1px;
    }
[dir="rtl"] .filteringModeSlider span[data-level]:first-of-type {
    margin-right: 0;
    }
[dir="rtl"] .filteringModeSlider[data-level="0"] .filteringModeButton {
    right: 0;
    }
[dir="rtl"] .filteringModeSlider[data-level="1"] .filteringModeButton {
    right: calc(var(--filtering-mode-button-size) + 1px);
    }
[dir="rtl"] .filteringModeSlider[data-level="2"] .filteringModeButton {
    right: calc(var(--filtering-mode-button-size) * 2 + 2px);
    }
[dir="rtl"] .filteringModeSlider[data-level="3"] .filteringModeButton {
    right: calc(var(--filtering-mode-button-size) * 3 + 3px);
    }


.filteringModeSlider[data-level="0"] span[data-level] {
    background-color: var(--surface-2);
    border-color: var(--surface-2);
    }

.filteringModeSlider[data-level="1"] span[data-level]:nth-of-type(1) ~ span[data-level] {
    background-color: var(--surface-2);
    border-color: var(--surface-2);
    }

.filteringModeSlider[data-level="2"] span[data-level]:nth-of-type(2) ~ span[data-level] {
    background-color: var(--surface-2);
    border-color: var(--surface-2);
    }

.filteringModeSlider[data-level]:not(.moving) span[data-level]:hover {
    filter: brightness(0.9);
    }
