table.table-sort-enabled thead th[data-sort] {
    position: relative;
    cursor: pointer;
    user-select: none;
    padding-right: 2rem;
}

table.table-sort-enabled thead th[data-sort]:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

table.table-sort-enabled thead th[data-sort]::before,
table.table-sort-enabled thead th[data-sort]::after {
    position: absolute;
    right: 0.75rem;
    color: var(--text-secondary);
    opacity: 0;
    font-size: 0.7rem;
    line-height: 1;
    transition: color 0.15s ease, opacity 0.15s ease;
}

table.table-sort-enabled thead th[data-sort]::before {
    content: "▲";
    top: calc(50% - 0.5rem);
}

table.table-sort-enabled thead th[data-sort]::after {
    content: "▼";
    top: calc(50% + 0.1rem);
}

table.table-sort-enabled thead th[data-sort]:hover::before,
table.table-sort-enabled thead th[data-sort]:hover::after,
table.table-sort-enabled thead th[data-sort]:focus-visible::before,
table.table-sort-enabled thead th[data-sort]:focus-visible::after {
    opacity: 0.75;
}

table.table-sort-enabled thead th[data-sort][aria-sort="ascending"]::before,
table.table-sort-enabled thead th[data-sort][aria-sort="descending"]::after {
    color: var(--accent);
    opacity: 1;
}

table.table-sort-enabled thead th[data-sort][aria-sort="ascending"]::after,
table.table-sort-enabled thead th[data-sort][aria-sort="descending"]::before {
    color: var(--text-secondary);
    opacity: 0.35;
}
