/* The comment sorter uses the same accessible select as the route catalogue. */
.ar-page .ar-comment-sort .catalog-select {
    position: relative;
    width: 190px;
    max-width: 100%;
}
.ar-page #comments-section .ar-comment-sort:has(.catalog-select)::after { display: none; }
.ar-page #comments-section .ar-comment-sort .catalog-select #comment-sort-select.catalog-select__native {
    position: absolute;
    width: 1px;
    height: 1px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
.ar-page .ar-comment-sort .catalog-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line-2, #d4d9d4);
    border-radius: 999px;
    background: var(--surface, #fff);
    color: var(--ink, #151d27);
    font: inherit;
    font-size: var(--fs-small, 14px);
    font-weight: var(--fw-ui, 600);
    text-align: left;
    cursor: pointer;
}
.ar-page .ar-comment-sort .catalog-select__trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ar-page .ar-comment-sort .catalog-select__trigger .icon {
    width: 16px;
    height: 16px;
    flex: none;
    color: var(--quiet, #65717d);
}
.ar-page .ar-comment-sort .catalog-select__menu {
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    right: 0;
    min-width: 100%;
    padding: 6px;
    border: 1px solid var(--line, #e2e5e1);
    border-radius: 16px;
    background: var(--surface, #fff);
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(18, 25, 33, .14));
}
.ar-page .ar-comment-sort .catalog-select__menu[hidden] { display: none; }
.ar-page .ar-comment-sort .catalog-select__option {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink, #151d27);
    font: inherit;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
.ar-page .ar-comment-sort .catalog-select__option:hover,
.ar-page .ar-comment-sort .catalog-select__option:focus-visible { background: var(--bg-soft, #f2f3f0); }
.ar-page .ar-comment-sort .catalog-select__option[aria-selected="true"] { color: var(--cta, #c43c00); font-weight: var(--fw-ui, 600); }
.ar-page .ar-comment-sort .catalog-select__trigger:focus-visible,
.ar-page .ar-comment-sort .catalog-select__option:focus-visible { outline: 2px solid var(--focus, #e55300); outline-offset: 2px; }
@media (max-width: 767px) {
    .ar-page .ar-comment-sort .catalog-select { width: 100%; }
    .ar-page .ar-comment-sort .catalog-select__trigger { min-height: 44px; }
}
