/* Keep data readable without allowing long values to size the entire table. */
.table-text-table, .drafts-table { table-layout: fixed; width: 100%; min-width: 0; white-space: normal; }
.table-text-table :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
.table-text-table td { vertical-align: top; }
.table-text { position: relative; display: block; min-width: 0; max-width: 100%; text-align: inherit; }
.table-text-scroll {
    display: block; min-width: 0; max-width: 100%; max-height: 4.5em;
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    line-height: 1.5; white-space: normal; overflow-wrap: anywhere;
    scrollbar-width: thin; scrollbar-color: var(--portal-muted) transparent;
    -webkit-overflow-scrolling: touch;
}
.table-text-content { display: block; min-width: 0; padding-inline-end: 1.4em; line-height: 1.5em; white-space: normal; overflow-wrap: anywhere; }
.table-text-content :is(a, span, strong, small, code, time, p, pre, div) { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: inherit; }
.table-text-content :is(p, pre) { margin: 0; }
.table-text-content pre { white-space: pre-wrap; font-size: inherit; }
.table-text-content small { margin-top: 0 !important; line-height: inherit; }
.table-text-content .olap-tuple-label + .olap-tuple-label { margin-top: 0; }
.table-text-scroll:focus-visible { outline: 2px solid var(--portal-blue); outline-offset: -2px; border-radius: 2px; }
.table-text-ellipsis {
    position: absolute; inset-inline-end: var(--table-text-scrollbar, 0px); bottom: 0;
    display: block; width: 1.4em; height: 1.5em; line-height: 1.5;
    color: var(--portal-ink); background: var(--portal-surface); text-align: center;
    font-weight: 700; pointer-events: none; user-select: none;
}
.table-text-ellipsis[hidden] { display: none !important; }
.table-text-ellipsis::before { content: '…'; }
.draft-cargo-line { display: block; }
.audit-table .table-text-content > :is(strong, small, time) { display: block; }
.olap-table [data-table-text] { max-width: 260px; }
.olap-table thead .table-text-ellipsis { background: var(--portal-background); }
.dashboard-orders-row .table-text { font-size: inherit; }
@media (min-width: 701px) {
    .table-text-table.table-text-wide { min-width: calc(var(--table-text-columns, 8) * 112px); }
    .table-text-table > tbody > tr > td { padding-block: 14px; }
    .drafts-table th:first-child { width: 90px; }
    .drafts-table th:nth-child(3) { width: 165px; }
    .drafts-table th:last-child { width: 230px; }
    .drafts-table .row-actions { gap: 8px; }
    .api-token-list .table-text-table :is(th, td):last-child { width: 140px; white-space: normal; }
}
@media (max-width: 1360px) {
    .dashboard-orders-head { display: none; }
    .dashboard-orders-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; padding: 14px; gap: 12px; }
    .dashboard-orders-row > * { min-width: 0; overflow-wrap: anywhere; }
    .dashboard-orders-row > [data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--portal-muted); font-weight: 400; }
}
@media (max-width: 700px) {
    .table-text-table.table-text-wide { min-width: 0; }
    .table-text-table td > .table-text { width: 100%; min-width: 0; }
    .drafts-table td[data-label="Грузы"] { display: block; }
    .drafts-table td[data-label="Грузы"]::before { display: block; margin-bottom: 6px; }
    .dashboard-orders-row > [data-table-text] { grid-column: 1 / -1; }
}
@media print {
    .table-text-table.table-text-wide { min-width: 0; }
    .table-text-scroll { max-height: none !important; overflow: visible !important; }
    .table-text-content { padding-inline-end: 0; }
    .table-text-ellipsis { display: none !important; }
}
