body .s24-sort-scope .s24-sort-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 12px 30px;
    padding: 0 0 12px;
    margin: 0 0 18px;
    border-bottom: 1px solid #d7d6d0;
    color: #201f1c;
}

body .s24-sort-scope .s24-sort-tools[hidden],
body .s24-sort-scope .s24-flat-chapters[hidden],
body .s24-sort-scope .s24-sort-group[hidden],
body .s24-sort-scope .s24-flat-extra[hidden],
body .s24-sort-scope .s24-sort-concealed { display: none !important; }

body .s24-sort-scope .s24-sort-group { max-width: 100%; }
body .s24-sort-scope .s24-sort-group + .s24-sort-group {
    margin-inline-start: auto;
}
body .s24-sort-scope .s24-sort-label {
    display: block;
    margin: 0 0 2px 8px;
    color: #65625c;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .015em;
    line-height: 1.3;
}

body .s24-sort-scope .s24-sort-buttons {
    display: inline-flex;
    max-width: 100%;
    gap: 7px;
}

body .s24-sort-scope .s24-sort-buttons button {
    appearance: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 46px;
    padding: 7px 9px;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: #504d47;
    font-family: inherit;
    font-size: clamp(17px, 1.15vw, 18px);
    font-weight: 550;
    line-height: 1.25;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: pointer;
}

body .s24-sort-scope .s24-sort-buttons button[aria-pressed="true"] {
    color: #171612;
    background: transparent;
    font-weight: 680;
}
body .s24-sort-scope .s24-sort-buttons button[aria-pressed="true"]::after {
    content: '';
    position: absolute;
    inset: auto 9px 3px;
    height: 2px;
    background: currentColor;
}
body .s24-sort-scope .s24-sort-buttons button:hover {
    color: #171612;
    background: #f5f4f0;
}
body .s24-sort-scope .s24-sort-buttons button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}
body .s24-sort-scope .s24-sort-buttons svg {
    display: block;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
}
body .s24-sort-scope .s24-flat-chapters .s24-name-display { min-width: 0; }
body .s24-sort-scope .s24-flat-chapters .s24-name-origin { display: none !important; }

@media (max-width: 580px) {
    body .s24-sort-scope .s24-sort-tools { align-items: flex-start; gap: 10px; }
    body .s24-sort-scope .s24-sort-group { flex-basis: 100%; }
    body .s24-sort-scope .s24-sort-group + .s24-sort-group { margin-inline-start: 0; }
    body .s24-sort-scope .s24-sort-buttons { gap: 5px; }
    body .s24-sort-scope .s24-sort-label { font-size: 15px; }
    body .s24-sort-scope .s24-sort-buttons { flex-wrap: wrap; }
    body .s24-sort-scope .s24-sort-buttons button { gap: 5px; padding-inline: 8px; font-size: 16px; }
    body .s24-sort-scope .s24-sort-buttons svg { width: 16px; height: 16px; }
}
@media (max-width: 355px) {
    body .s24-sort-scope .s24-sort-buttons { gap: 3px; }
    body .s24-sort-scope .s24-sort-buttons button { gap: 4px; padding-inline: 5px; font-size: 15px; }
    body .s24-sort-scope .s24-sort-buttons svg { width: 15px; height: 15px; }
}
