.xsort-open {
    overflow: hidden;
}

.xsort-pro {
    width: 100%;
    margin: 0 0 18px;
}

.xsort-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.xsort-button {
    display: inline-flex;
    min-height: 42px;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 15px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 8px;
    background: var(--bg, #fff);
    color: inherit;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.xsort-button svg {
    width: 18px;
    height: 18px;
    color: var(--accent, #19b56b);
    flex: 0 0 auto;
}

.xsort-button small {
    overflow: hidden;
    max-width: 260px;
    color: hsl(var(--c-muted, 220 9% 43%));
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xsort-button:active {
    transform: scale(.985);
}

.xsort-sheet[hidden] {
    display: none;
}

.xsort-sheet {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.xsort-sheet.is-visible {
    pointer-events: auto;
}

.xsort-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, .58);
    opacity: 0;
    transition: opacity .28s ease;
}

.xsort-sheet.is-visible .xsort-backdrop {
    opacity: 1;
}

.xsort-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 560px);
    max-height: min(82svh, 720px);
    overflow-y: auto;
    padding: 14px 20px max(24px, env(safe-area-inset-bottom));
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 18px 18px 0 0;
    background: var(--bg, #fff);
    color: inherit;
    box-shadow: 0 -24px 80px rgba(0, 0, 0, .24);
    opacity: .98;
    transform: translateY(110%);
    transition: transform .34s cubic-bezier(.22, 1, .36, 1), opacity .24s ease;
}

.xsort-sheet.is-visible .xsort-panel {
    opacity: 1;
    transform: translateY(0);
}

.xsort-handle {
    width: 64px;
    height: 4px;
    margin: 0 auto 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .13);
}

.xsort-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 0 6px;
}

.xsort-head h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.xsort-head a {
    color: var(--accent, #19b56b);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.xsort-current {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .045);
    color: hsl(var(--c-muted, 220 9% 43%));
}

.xsort-current span,
.xsort-current small {
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xsort-list {
    display: grid;
    gap: 8px;
}

.xsort-choice {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 6px 0 12px;
    border-radius: 999px;
    color: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.xsort-choice:hover,
.xsort-choice.is-active {
    background: rgba(0, 0, 0, .045);
}

.xsort-choice i {
    position: relative;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border: 1px solid rgba(0, 0, 0, .13);
    border-radius: 50%;
}

.xsort-choice.is-active i {
    border-color: var(--accent, #19b56b);
    background: var(--accent, #19b56b);
}

.xsort-choice.is-active i::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 7px;
    width: 11px;
    height: 6px;
    border: solid #fff;
    border-width: 0 0 2px 2px;
    transform: rotate(-45deg);
}

.xsort-dir {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.xsort-dir-btn {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .045);
    color: inherit;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.xsort-dir-btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.xsort-dir-btn.is-active {
    background: var(--accent, #19b56b);
    color: #fff;
}

body.dt .xsort-button,
body[data-theme="dark"] .xsort-button,
body.dt .xsort-panel,
body[data-theme="dark"] .xsort-panel {
    border-color: rgba(255, 255, 255, .08);
    background: #17191c;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .24);
}

body.dt .xsort-button small,
body[data-theme="dark"] .xsort-button small,
body.dt .xsort-current,
body[data-theme="dark"] .xsort-current {
    color: rgba(255, 255, 255, .68);
}

body.dt .xsort-handle,
body[data-theme="dark"] .xsort-handle,
body.dt .xsort-current,
body[data-theme="dark"] .xsort-current,
body.dt .xsort-choice:hover,
body.dt .xsort-choice.is-active,
body.dt .xsort-dir-btn,
body[data-theme="dark"] .xsort-choice:hover,
body[data-theme="dark"] .xsort-choice.is-active,
body[data-theme="dark"] .xsort-dir-btn {
    background: rgba(255, 255, 255, .07);
}

body.dt .xsort-choice i,
body[data-theme="dark"] .xsort-choice i {
    border-color: rgba(255, 255, 255, .14);
}

body.dt .xsort-choice.is-active i,
body.dt .xsort-dir-btn.is-active,
body[data-theme="dark"] .xsort-choice.is-active i,
body[data-theme="dark"] .xsort-dir-btn.is-active {
    background: var(--accent, #19b56b);
    border-color: var(--accent, #19b56b);
}

@media (min-width: 760px) {
    .xsort-panel {
        margin-bottom: 18px;
        border-radius: 18px;
    }
}

@media (max-width: 560px) {
    .xsort-bar {
        justify-content: stretch;
    }

    .xsort-button {
        width: 100%;
    }

    .xsort-button small {
        max-width: 52vw;
    }
}

.xsort-choice-form,
.xsort-dir-form,
.xsort-reset-form {
    margin: 0;
}

.xsort-choice,
.xsort-dir-btn,
.xsort-reset-form button {
    border: 0;
    font-family: inherit;
    cursor: pointer;
}

.xsort-choice {
    width: 100%;
    background: transparent;
    text-align: left;
}

.xsort-reset-form button {
    padding: 0;
    background: transparent;
    color: var(--accent, #19b56b);
    font-size: 12px;
    font-weight: 800;
}

.xsort-dir-form {
    display: block;
}

.xsort-dir-btn {
    width: 100%;
}
/* xSort desktop placement and compact panel tuning */
@media (min-width: 900px) {
    .sect__header--xsort {
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 14px !important;
    }

    .sect__header--xsort .sect__title {
        flex: 0 1 auto !important;
        margin-right: 0 !important;
    }

    .sect__header--xsort .xsort-pro {
        width: auto !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    .sect__header--xsort .xsort-bar {
        justify-content: flex-start !important;
    }

    .sect__header--xsort .xsort-button {
        min-height: 38px !important;
        padding: 0 13px !important;
        box-shadow: 0 3px 12px rgba(0, 0, 0, .045) !important;
    }
}

.xsort-panel {
    width: min(100%, 500px) !important;
    padding: 12px 18px max(20px, env(safe-area-inset-bottom)) !important;
}

.xsort-handle {
    width: 56px !important;
    margin-bottom: 14px !important;
}

.xsort-head {
    margin-bottom: 10px !important;
}

.xsort-head h3 {
    font-size: 18px !important;
}

.xsort-current {
    min-height: 36px !important;
    margin-bottom: 10px !important;
}

.xsort-current span,
.xsort-current small {
    font-size: 12px !important;
}

.xsort-list {
    gap: 5px !important;
}

.xsort-choice {
    min-height: 37px !important;
    padding: 0 5px 0 11px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.xsort-choice i {
    width: 23px !important;
    height: 23px !important;
}

.xsort-choice.is-active i::before {
    left: 6px !important;
    top: 6px !important;
    width: 10px !important;
    height: 6px !important;
}

.xsort-dir {
    gap: 8px !important;
    margin-top: 14px !important;
}

.xsort-dir-btn {
    min-height: 38px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
}

.xsort-dir-btn svg {
    width: 16px !important;
    height: 16px !important;
}

@media (max-width: 560px) {
    .xsort-panel {
        width: min(100%, 480px) !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .xsort-choice {
        min-height: 36px !important;
        font-size: 12.5px !important;
    }
}
/* xSort close button */
.xsort-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.xsort-close {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .055);
    color: inherit;
    cursor: pointer;
}

.xsort-close svg {
    width: 16px;
    height: 16px;
}

.xsort-close:hover {
    background: rgba(0, 0, 0, .09);
}

body.dt .xsort-close,
body[data-theme="dark"] .xsort-close {
    background: rgba(255, 255, 255, .08);
}

body.dt .xsort-close:hover,
body[data-theme="dark"] .xsort-close:hover {
    background: rgba(255, 255, 255, .13);
}
/* xSort light theme active readability */
.xsort-choice.is-active {
    background: rgba(0, 0, 0, .045) !important;
    color: hsl(var(--c-text, 220 12% 18%)) !important;
}

body:not(.dt):not([data-theme="dark"]) .xsort-choice.is-active span {
    color: hsl(var(--c-text, 220 12% 18%)) !important;
}

body.dt .xsort-choice.is-active,
body[data-theme="dark"] .xsort-choice.is-active {
    color: inherit !important;
}
/* xSort light theme choice state contrast */
body:not(.dt):not([data-theme="dark"]) .xsort-choice,
body:not(.dt):not([data-theme="dark"]) .xsort-choice:hover,
body:not(.dt):not([data-theme="dark"]) .xsort-choice:focus,
body:not(.dt):not([data-theme="dark"]) .xsort-choice:active,
body:not(.dt):not([data-theme="dark"]) .xsort-choice.is-active {
    color: #3f4248 !important;
    -webkit-text-fill-color: #3f4248 !important;
}

body:not(.dt):not([data-theme="dark"]) .xsort-choice span,
body:not(.dt):not([data-theme="dark"]) .xsort-choice:hover span,
body:not(.dt):not([data-theme="dark"]) .xsort-choice:focus span,
body:not(.dt):not([data-theme="dark"]) .xsort-choice:active span,
body:not(.dt):not([data-theme="dark"]) .xsort-choice.is-active span {
    color: #3f4248 !important;
    -webkit-text-fill-color: #3f4248 !important;
}

body:not(.dt):not([data-theme="dark"]) .xsort-choice:hover,
body:not(.dt):not([data-theme="dark"]) .xsort-choice:focus,
body:not(.dt):not([data-theme="dark"]) .xsort-choice:active,
body:not(.dt):not([data-theme="dark"]) .xsort-choice.is-active {
    background: rgba(0, 0, 0, .045) !important;
}
