/* Shared description layout: the same HTML, labels and values at every width. */
.proso-description-tables {
    container: proso-description / inline-size;
    min-width: 0;
}
.proso-description-tables table[data-proso-table-ready] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.proso-description-tables table[data-proso-table-ready] :is(th, td) {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}
.proso-description-tables [data-proso-table="pairs"] th[scope="row"] {
    width: 34%;
    font-weight: 600;
}
.proso-table-label { display: none; }

/* Older browsers keep natural table columns and the existing local scroll wrapper. */
@supports not (container-type: inline-size) {
    .proso-description-tables table[data-proso-table-ready] {
        table-layout: auto;
    }
}

/* Preserve readable columns; stack only below the measured four-column fit. */
@container proso-description (max-width: 40rem) {
    .proso-description-tables [data-proso-table="records"][data-proso-table-ready],
    .proso-description-tables [data-proso-table="records"][data-proso-table-ready] :is(tbody, tr, th, td) {
        display: block;
        width: auto;
    }
    .proso-description-tables [data-proso-table="records"][data-proso-table-ready] thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .proso-description-tables [data-proso-table="records"][data-proso-table-ready] tbody tr {
        padding: 1rem 0;
        border-bottom: 1px solid var(--gray-200, #dee2e6);
    }
    /* Opt-in table layout overrides the incumbent theme's modal cell selector. */
    .proso-description-tables [data-proso-table="records"][data-proso-table-ready] tbody :is(th, td) {
        padding: .5rem 0 !important;
        border: 0 !important;
    }
    .proso-description-tables [data-proso-table="records"] .proso-table-label {
        display: block;
        margin-bottom: .25rem;
        color: var(--dark, #212529);
        font-weight: 600;
    }
    .proso-description-tables [data-proso-table="records"] th[scope="row"] .proso-table-label {
        display: none;
    }
    .proso-description-tables [data-proso-table="records"] .proso-table-value {
        display: block;
        font-weight: 400;
    }
    .proso-description-tables [data-proso-table="records"] th[scope="row"] .proso-table-value {
        font-weight: 600;
    }
}

@container proso-description (min-width: 28rem) and (max-width: 40rem) {
    .proso-description-tables [data-proso-table="records"][data-proso-table-ready] tbody td {
        display: grid;
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        gap: 1rem;
        align-items: baseline;
    }
}

@container proso-description (max-width: 21rem) {
    .proso-description-tables [data-proso-table="pairs"][data-proso-table-ready],
    .proso-description-tables [data-proso-table="pairs"][data-proso-table-ready] :is(tbody, tr, th, td) {
        display: block;
        width: auto;
    }
    .proso-description-tables [data-proso-table="pairs"][data-proso-table-ready] thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .proso-description-tables [data-proso-table="pairs"][data-proso-table-ready] tbody tr {
        padding: .75rem 0;
        border-bottom: 1px solid var(--gray-200, #dee2e6);
    }
    .proso-description-tables [data-proso-table="pairs"][data-proso-table-ready] tbody :is(th, td) {
        padding: .25rem 0 !important;
        border: 0 !important;
    }
}

@media print {
    .proso-description-tables { container-type: normal; }
}
