:is(#dx-document-results, #dx-software-results) {
    width: 100%;
    margin: 20px 0 0;
    border: 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-variant-numeric: tabular-nums;
    line-height: 1.45;

    & th, & td {
        box-sizing: border-box;
        width: auto;
        height: auto;
        padding: 14px clamp(4px, .5vw, 8px);
        border: 0;
        border-bottom: 1px solid #dedede;
        background: transparent;
        text-align: start;
        vertical-align: middle;
        letter-spacing: normal;
    }
    & th {
        padding-block: 7px;
        border-bottom: 2px solid #435b75;
        background: #fff;
        color: #283f5a;
        white-space: nowrap;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.25;
    }
    & :is(th, td) { overflow-wrap: anywhere; }
    & td {
        color: #45484b;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.5;
    }
    & td[data-label]:empty::after { content: "—" / "Not specified"; }
    & tbody tr:is(:hover, :focus-within) { background: #fafafa; }
    & td.title {
        color: #202326;
        font-size: 16px;
        font-weight: 600;
        overflow-wrap: anywhere;
    }
    & .resource-sort {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        min-height: 36px;
        padding: 0;
        border: 0;
        background: transparent;
        color: inherit;
        font: inherit;
        text-align: inherit;
        cursor: pointer;
        text-decoration: none;
        line-height: inherit;
    }
    & .resource-sort::after {
        content: "↑" / "";
        flex: none;
        font-size: 12px;
        opacity: 0;
    }
    & th[aria-sort] button::after,
    & th:hover .resource-sort::after,
    & .resource-sort:focus-visible::after { opacity: 1; }
    & th[aria-sort="descending"] button::after { content: "↓" / ""; }
    & .resource-sort:focus-visible {
        outline: 2px solid #124f99;
        outline-offset: 1px;
    }
    & :is(.resource-link, a.document) {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        box-sizing: border-box;
        min-height: 32px;
        width: auto;
        height: auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #28466f;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.45;
        text-decoration: none;
        text-underline-offset: 3px;
    }
    & a.document {
        gap: 5px;
        font-weight: 600;
        white-space: nowrap;
    }
    & a.document::before {
        content: "";
        flex: none;
        width: 16px;
        height: 16px;
        background: currentColor;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M10 5Q6 2.5 2 3.5v12q4-1 8 1.5 4-2.5 8-1.5v-12Q14 2.5 10 5Zm0 0v12'/%3E%3C/svg%3E") center / contain no-repeat;
    }
    & a.document:is(:hover, :focus-visible, :active) {
        color: #192f4e;
        text-decoration: underline;
    }
    & a.resource-download {
        justify-content: center;
        gap: 6px;
        padding: 4px 9px;
        border: 1px solid #8090a2;
        border-radius: 5px;
        background: #fff;
        color: #344d69;
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
    }
    & a.resource-download::before {
        content: "";
        flex: none;
        width: 14px;
        height: 14px;
        background: currentColor;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2v10m-4-4 4 4 4-4M3 13v4h14v-4'/%3E%3C/svg%3E") center / contain no-repeat;
    }
    & a.resource-download:is(:hover, :focus-visible) {
        background: #f3f6f9;
        border-color: #526b85;
    }
    & a.resource-download:active { background: #e6ecf2; }
    & a:focus-visible { outline: 2px solid #124f99; outline-offset: 2px; }
    & #dx-no-results td { padding: 24px 0; text-align: center; }
}

/* Keep row content and sort direction changes from resizing columns. */
#dx-document-results th:first-child { width: 33%; }
#dx-software-results th[data-sortable-by="architecture"] { width: 14%; }
#dx-software-results th[data-sortable-by="os"] { width: 8%; }
#dx-software-results th[data-sortable-by="date"] { width: 12%; }
#dx-software-results th[data-sortable-by="python_ver"] { width: 14%; }
#dx-software-results th[data-sortable-by="version"] { width: 9%; }
#dx-software-results th:nth-last-child(3) { width: 14%; }
:is(#dx-document-results, #dx-software-results) th:last-child { width: 118px; }

@media (min-width: 768px) and (max-width: 1220px) {
    #dx-software-results :is(th, td) { padding-inline: 3px; }
    #dx-software-results th { font-size: 13px; }
    #dx-software-results th[data-sortable-by="architecture"] { width: 96px; }
    #dx-software-results th[data-sortable-by="python_ver"] { width: 76px; }
    #dx-software-results th[data-sortable-by="python_ver"] .resource-sort {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: normal;
    }
    #dx-software-results th[data-sortable-by="version"] { width: 65px; }
    #dx-software-results th:nth-last-child(3) { width: 106px; }
    #dx-software-results th:last-child { width: 110px; }
    #dx-software-results th[data-sortable-by="os"] { width: 68px; }
    #dx-software-results th[data-sortable-by="date"] { width: 79px; }
}

.resource-sort-control, .resource-column-name { display: none; }

.resource-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-block: 16px;
    &:empty { display: none; }
    & > * {
        box-sizing: border-box;
        display: grid;
        place-items: center;
        min-width: 36px;
        height: 44px;
        margin: 0;
        padding: 0 3px;
        border: 0;
        border-radius: 4px;
        background: transparent;
        color: #242629;
        font-family: inherit;
        font-size: 14px;
        font-weight: 500;
        line-height: 1;
        font-variant-numeric: tabular-nums;
        text-decoration: none;
    }
    & button { cursor: pointer; }
    & button:hover { background: #f1f2f3; }
    & [aria-current] {
        min-width: 30px;
        height: 30px;
        margin-inline: 3px;
        background: #242629;
        color: #fff;
        font-weight: 600;
    }
    & :is(.resource-page-prev, .resource-page-next)::before {
        content: '';
        width: 8px;
        height: 8px;
        border: solid currentColor;
        border-width: 1.5px 1.5px 0 0;
        transform: translateX(-2px) rotate(45deg);
    }
    & .resource-page-prev::before { transform: translateX(2px) rotate(-135deg); }
    & :focus-visible { outline: 2px solid #242629; outline-offset: 2px; }
}

@media (max-width: 767px) {
    .resource-sort-control {
        display: flex;
        align-items: center;
        gap: 12px;
        white-space: nowrap;
        margin-top: 20px;
        padding-block: 6px 10px;
        border-bottom: 2px solid #435b75;
        background: #fff;
        color: #283f5a;
        font-size: 14px;
        font-weight: 600;
    }
    .resource-sort-control select {
        width: auto;
        min-width: 0;
        min-height: 44px;
        padding-inline: 8px;
        border: 1px solid #a4adb4;
        border-radius: 5px;
        background: #fff;
        color: inherit;
        font: inherit;
        font-weight: 450;
        appearance: auto;
    }
    :is(#dx-document-filter-container, #dx-software-filter-container) .resource-sort-control select:focus-visible {
        outline: 2px solid #124f99;
        outline-offset: 2px;
    }
    :is(#dx-document-results, #dx-software-results) {
        display: block;
        margin-top: 0;
        & thead {
            display: table-header-group;
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip-path: inset(50%);
        }
        & .resource-sort { display: none; }
        & .resource-column-name { display: inline; }
        & tbody { display: block; }
        & :is(.resource-link, a.document) { min-width: 44px; min-height: 44px; }
        & tbody tr {
            display: flex;
            flex-flow: row wrap;
            align-items: baseline;
            gap: 4px 16px;
            padding-block: 14px 12px;
            border-bottom: 1px solid #dedede;
        }
        & tbody tr + tr > td:first-child { margin-top: 0; border: 0 !important; }
        & td {
            display: block;
            min-width: 0;
            max-width: 100%;
            width: auto;
            padding: 0;
            overflow-wrap: anywhere;
        }
        & td.title { flex-basis: 100%; padding: 0 0 2px; }
        & td[data-label]:not([data-label="Documentation"], [data-label="File"])::before {
            content: attr(data-label) " " / "";
            color: #626568;
            font-size: 13px;
        }
        /* Start the action links together below the wrapped metadata. */
        & tbody tr:has(a)::after { content: ""; flex-basis: 100%; order: 1; }
        & td:is([data-label="Documentation"], [data-label="File"]) { order: 2; }
        & td[data-label="Documentation"]:not(:has(a)) { position: absolute; }
        & #dx-no-results td { width: 100%; }
    }
    .resource-pagination > button { min-width: 32px; }
    .resource-pagination > [aria-current] { margin-inline: 1px; }
}
