/* Generated by npm run sync from styles/table.css and its @import lines, inlined in cascade order. Do not edit. */
/* styles/selection-control.css */
@layer design {
  .selection-control {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    margin: 0;
    cursor: pointer;
    color: var(--surface-panel);
  }
  .selection-control > input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: inherit;
  }
  .selection-control-mark {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    background: var(--surface-panel);
    color: var(--surface-panel);
    transition:
      background-color var(--motion-feedback) var(--motion-easing),
      border-color var(--motion-feedback) var(--motion-easing);
  }
  .selection-control-mark > svg {
    display: none;
    width: 14px;
    height: 14px;
  }
  .selection-control > input:checked + .selection-control-mark {
    border-color: var(--selection-text);
    background: var(--selection-text);
  }
  .selection-control[data-mode='check'] > input:checked + .selection-control-mark > svg {
    display: block;
  }
  /* Single selection is a radio: an empty circle, then a ring around a filled dot. Check and ordered keep the
     rounded-square checkbox. Unselected is an empty outline in every mode. */
  .selection-control[data-mode='single'] .selection-control-mark {
    border-radius: 50%;
  }
  .selection-control[data-mode='single'] > input:checked + .selection-control-mark {
    background: var(--surface-panel);
  }
  .selection-control[data-mode='single'] > input:checked + .selection-control-mark::after {
    content: '';
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: var(--selection-text);
  }
  .selection-control[data-mode='ordered'] > input:checked + .selection-control-mark::after {
    content: attr(data-order);
    font: 600 11px/1 var(--font-ui);
    font-variant-numeric: tabular-nums;
  }
  /* Only a checkbox can be mixed; a radio in a group with nothing chosen also matches :indeterminate. */
  .selection-control > input[type='checkbox']:indeterminate + .selection-control-mark {
    border-color: var(--selection-text);
    background: var(--selection-text);
  }
  .selection-control > input[type='checkbox']:indeterminate + .selection-control-mark > svg {
    display: none;
  }
  .selection-control > input[type='checkbox']:indeterminate + .selection-control-mark::after {
    content: '';
    width: 8px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
  }
  .selection-control > input:focus-visible + .selection-control-mark {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
  }
  .selection-control > input:disabled {
    cursor: default;
  }
  .selection-control > input:disabled + .selection-control-mark {
    border-color: var(--text-disabled);
    background: var(--surface-hover);
  }
  .selection-control > input:checked:disabled + .selection-control-mark {
    background: var(--text-disabled);
    border-color: var(--text-disabled);
  }
  .selection-control[data-mode='single'] > input:checked:disabled + .selection-control-mark {
    background: var(--surface-hover);
  }
  .selection-control[data-mode='single'] > input:checked:disabled + .selection-control-mark::after {
    background: var(--text-disabled);
  }
  .selection-control[data-size='compact'] {
    width: 28px;
    height: 28px;
  }
  .selection-control[data-size='compact'] .selection-control-mark {
    width: 16px;
    height: 16px;
  }
  .selection-control[data-size='compact'] .selection-control-mark > svg {
    width: 12px;
    height: 12px;
  }
  @media (pointer: coarse) {
    .selection-control[data-size='compact'] {
      width: 44px;
      height: 44px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .selection-control-mark {
      transition: none;
    }
  }
  [data-reduced-motion='true'] .selection-control-mark {
    transition: none;
  }

  @media (forced-colors: active) {
    .selection-control-mark {
      forced-color-adjust: none;
      background: Canvas;
      border-color: ButtonText;
      color: HighlightText;
    }
    .selection-control > input:checked + .selection-control-mark,
    .selection-control > input[type='checkbox']:indeterminate + .selection-control-mark {
      background: Highlight;
      border-color: Highlight;
    }
    .selection-control[data-mode='single'] > input:checked + .selection-control-mark {
      background: Canvas;
    }
    .selection-control[data-mode='single'] > input:checked + .selection-control-mark::after {
      background: Highlight;
    }
    .selection-control > input:disabled + .selection-control-mark {
      border-color: GrayText;
    }
    .selection-control > input:checked:disabled + .selection-control-mark {
      background: GrayText;
    }
    .selection-control[data-mode='single'] > input:checked:disabled + .selection-control-mark {
      background: Canvas;
    }
    .selection-control[data-mode='single'] > input:checked:disabled + .selection-control-mark::after {
      background: GrayText;
    }
  }

  .selection-control[data-size='large'] .selection-control-mark {
    width: 22px;
    height: 22px;
  }
  .selection-control[data-size='large'] .selection-control-mark > svg {
    width: 16px;
    height: 16px;
  }
}

/* styles/table.css */
@layer design {
  .data-region {
    background: var(--surface-panel);
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
  }
  .data-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: nowrap;
    padding: var(--space-2) var(--space-3);
    /* The title starts on the columns' text edge (the density's cell inline padding). */
    padding-inline-start: var(--table-inline-padding, var(--space-3));
    border-bottom: 1px solid var(--border-default);
  }
  .data-tools strong {
    font-size: 15px;
    font-weight: 500;
  }
  .data-tools h2 {
    font: var(--text-title);
  }
  .data-count {
    color: var(--text-muted);
    font: var(--text-dense);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .data-scroll {
    overflow: auto;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--border-default) transparent;
  }
  .data-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  .data-scroll::-webkit-scrollbar-track {
    background: transparent;
  }
  .data-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--border-default) padding-box;
  }
  .data-scroll::-webkit-scrollbar-corner {
    background: transparent;
  }
  .data-scroll table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
    font: var(--text-body);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
  }
  .data-scroll th {
    height: var(--table-header-height, 44px);
    padding: var(--space-3) var(--space-4);
    text-align: start;
    vertical-align: middle;
    font: var(--text-body);
    font-weight: 600;
    color: var(--text-primary);
    background: var(--surface-panel);
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
  }
  .sort-control {
    border: 0;
    background: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 20px;
    padding: 0;
    font: inherit;
    color: inherit;
  }
  .data-scroll td {
    position: relative;
    padding: var(--space-3) 36px var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
    height: 48px;
  }
  .data-scroll tbody tr:last-child td {
    border-bottom: 0;
  }
  .data-scroll tr:has(input:checked) {
    background: var(--surface-selected);
  }
  .data-scroll td.numeric {
    text-align: right;
  }
  .data-scroll td:focus-visible {
    outline-offset: -2px;
  }
  /* Cell copy: a bare glyph just past the value's end (placed by DataTable on the value's last line; it takes no space, so
   numbers stay aligned, and lands in the cell's reserved end padding). It appears once the pointer rests on the value
   (DataTable sets data-copy-reveal after the hover intent) and at once on the focused cell; touch keeps it visible.
   Hover and focus change only the glyph colour; keyboard focus keeps the shared ring. */
  /* A portal child can change from text to a control without re-rendering the table.
     Keep the copy affordance out of that control's hit area in the same paint. */
  .data-scroll td[data-cell-pending] > .cell-copy,
  .data-scroll
    td[data-react-cell]:not([data-copy-with-controls]):has(
      > span :is(button, input, textarea, select, [role='button'], [contenteditable]:not([contenteditable='false']))
    )
    > .cell-copy {
    display: none;
  }
  .data-scroll .cell-copy.btn.icon {
    --height: 28px;
    position: absolute;
    inset-inline-start: var(--cell-copy-start, auto);
    inset-inline-end: 6px;
    top: var(--cell-copy-top, 50%);
    min-height: 0;
    transform: translateY(-50%);
    border-color: transparent;
    background: none;
    box-shadow: none;
    color: var(--text-secondary);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity var(--motion-feedback) var(--motion-easing),
      color var(--motion-feedback) var(--motion-easing);
  }
  .data-scroll td > .cell-copy.btn.icon[data-variant]:is(:hover, :active, :focus-visible) {
    border-color: transparent;
    background: none;
    color: var(--text-primary);
  }
  .data-scroll .cell-copy.btn.icon:is([data-copy-reveal='true'], :focus-visible, [data-copied='true']),
  .data-scroll td[data-cell]:focus-visible > .cell-copy.btn.icon {
    opacity: 1;
    pointer-events: auto;
  }
  /* A device with any touch input (a touchscreen laptop whose primary pointer is fine): a tap focuses the cell without
     :focus-visible, so the focused cell shows its copy control. Mouse-only devices keep the resting-pointer reveal. */
  @media (any-pointer: coarse) {
    .data-scroll td[data-cell]:focus > .cell-copy.btn.icon {
      opacity: 1;
      pointer-events: auto;
    }
  }
  /* The owner-paged footer: the shared Pagination under the rows, inside the region so the expanded view keeps it. */
  .table-pagination {
    padding: var(--space-1) var(--space-3);
    border-top: 1px solid var(--border-default);
  }
  .table-pagination > .pagination {
    margin-top: 0;
  }
  .data-footer {
    min-height: 8px;
    padding: 0 var(--space-4);
  }
  .data-footer:has([role='status']:not(:empty)) {
    padding-block: var(--space-2);
    border-top: 1px solid var(--border-default);
  }
  .table-overflow-controls {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
  }
  .table-overflow-controls .row {
    gap: var(--space-1);
  }
  .collection-search {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    margin-bottom: var(--space-4);
  }
  .collection-search input {
    max-width: 360px;
  }
  @media (pointer: coarse) {
    .data-scroll td {
      padding-right: 52px;
      min-height: 52px;
    }
    .data-scroll .cell-copy.btn.icon {
      --height: 44px;
      inset-inline-start: auto;
      top: 50%;
      opacity: 1;
      pointer-events: auto;
    }
    .sort-control {
      min-height: 44px;
    }
  }
  @container (max-width:600px) {
    .data-tools {
      align-items: center;
    }
    .data-tools > div:first-child {
      width: auto;
    }
    .data-tools > .row {
      width: auto;
    }
    .data-tools [data-action='copy-table'] {
      margin: 0;
    }
    .data-scroll th,
    .data-scroll td {
      padding-left: var(--space-3);
    }
  }
  .data-footer {
    height: 0;
    min-height: 0;
    padding: 0;
  }
  .data-footer:has([role='status']:not(:empty)) {
    padding: 0;
    border: 0;
  }
  .reference-table-host {
    container-type: inline-size;
  }
  .reference-table .data-count {
    display: none;
  }
  .reference-table .data-tools {
    justify-content: space-between;
  }
  .reference-table .data-scroll td {
    white-space: normal;
    min-width: 0;
    vertical-align: top;
    overflow-wrap: break-word;
  }
  .reference-table .data-scroll table {
    min-width: 520px;
  }
  .reference-table .data-tools > .row {
    width: auto;
  }
  .reference-table .data-tools [data-action='copy-table'] {
    margin: 0;
  }
  /* Expanded without a native top layer (the fallback): the shared fullscreen modal owns size, padding and header; the
     table fills its body with one scroll region. */
  .dialog.table-dialog > [data-body] {
    overflow: hidden;
  }
  .expanded-table-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  .table-dialog .data-region {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    width: 100%;
  }
  .table-dialog .data-tools {
    flex: none;
  }
  .table-dialog .data-scroll {
    flex: 1 1 auto;
    min-height: 0;
  }
  .table-dialog :is(.data-footer, .table-pagination) {
    flex: none;
  }
  /* Expanded in place: ExpandedWorkspace owns the viewport bounds, surface and edges; the region stacks its toolbar,
     summary, one scroll region and footer, and the scroll region takes what the others leave. */
  .data-region[data-expanded-workspace] {
    display: flex;
    flex-direction: column;
  }
  .data-region[data-expanded-workspace] > :not(.data-scroll) {
    flex: none;
  }
  .data-region[data-expanded-workspace] > .data-scroll {
    flex: 0 1 auto;
    min-height: 0;
  }

  /* Every body cell shares one surface transition, so the selection column fades with its row. */
  .data-scroll tbody td {
    transition: background-color var(--motion-feedback) var(--motion-easing);
  }
  @media (prefers-reduced-motion: reduce) {
    .data-scroll tbody td {
      transition: none;
    }
  }

  .data-scroll th.numeric {
    text-align: right;
  }
  .data-scroll th.numeric .sort-control {
    width: 100%;
  }
  .data-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .data-region {
    container-type: inline-size;
  }
  .table-context {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    min-width: 0;
  }
  .table-heading {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    min-width: 0;
    flex-wrap: wrap;
  }
  .table-heading strong {
    overflow-wrap: anywhere;
  }

  .table-owner-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
  }
  .table-density {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    font: var(--text-dense);
    color: var(--text-muted);
  }
  .table-density .select-control {
    width: 144px;
  }
  .table-density select,
  .table-density .choice-trigger {
    min-height: 40px;
    height: 40px;
    padding: 7px var(--space-3);
    font: var(--text-dense);
  }
  .table-actions,
  .table-copy-actions,
  .table-overflow-controls {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
  }
  .table-actions {
    gap: var(--space-2);
  }
  .table-overflow-controls {
    padding: 0;
    border: 0;
    gap: 0;
  }
  .reference-table .data-tools {
    justify-content: space-between;
  }
  .data-region[data-density='compact'] .data-scroll td {
    height: 28px;
    padding-block: 2px;
  }
  .data-region[data-density='standard'] .data-scroll td {
    height: 44px;
    padding-block: 10px;
  }
  .data-region[data-density='comfortable'] .data-scroll td {
    height: 56px;
    padding-block: var(--space-4);
  }
  .data-region[data-density='compact'] .data-scroll .cell-copy.btn.icon {
    --height: 24px;
  }
  @container (max-width:900px) {
    .table-context {
      gap: var(--space-3);
    }
    .table-density > span {
      display: none;
    }
  }
  /* Narrow: the title keeps its place and every action stays visible. The actions flow in the title's row and wrap as
     whole groups, trailing: the scroll arrows stay beside the title and the rest follow together, so no control is left
     alone on a row. */
  @container (max-width:640px) {
    .data-tools {
      flex-wrap: wrap;
      justify-content: flex-end;
      padding: var(--space-2);
      padding-inline-start: var(--table-inline-padding, var(--space-3));
      gap: var(--space-2);
    }
    .table-context {
      flex: 1 1 8rem;
    }
    .table-actions {
      display: contents;
    }
    .table-copy-actions {
      margin-inline-end: 0;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .table-copy-actions .btn {
      padding-inline: 10px;
    }
  }
  /* Sort headers are whole-cell targets; reference headers remain quiet. */
  .data-scroll th:has(.sort-control) {
    padding: 0;
    transition: background-color var(--motion-feedback) var(--motion-easing);
  }
  .data-scroll th .sort-control {
    width: 100%;
    min-height: 44px;
    padding: 10px var(--space-4);
    text-align: inherit;
    cursor: pointer;
  }
  .data-scroll th:has(.sort-control:hover),
  .data-scroll th:has(.sort-control:focus-visible) {
    background: var(--surface-hover);
  }
  .data-scroll th .sort-control:focus-visible {
    outline-offset: -3px;
  }
  .data-scroll tbody tr:nth-child(even) > td {
    background: color-mix(in srgb, var(--text-primary) 2%, var(--surface-panel));
  }
  .data-scroll tbody tr:has(input:checked) > td {
    background: var(--surface-selected);
  }
  /* Hover surface (the highlight option): row by default, one cell, or none. The copy control reveals from its value, not the surface. */
  .data-region[data-highlight='row']
    .data-scroll
    tbody
    tr:has(> td[data-cell]):is(:hover, :has(td[data-cell]:focus-visible, .cell-copy:focus-visible))
    > td {
    --table-pinned-fade: var(--surface-hover);
    background: var(--surface-hover);
  }
  .data-region[data-highlight='row']
    .data-scroll
    tbody
    tr:has(input:checked):is(:hover, :has(td[data-cell]:focus-visible, .cell-copy:focus-visible))
    > td {
    --table-pinned-fade: var(--table-selected-hover);
    background: var(--table-selected-hover);
  }
  .data-region[data-highlight='cell']
    .data-scroll
    tbody
    td[data-cell]:is(:hover, :focus-visible, :has(.cell-copy:focus-visible)) {
    background: var(--surface-hover);
  }
  .data-scroll {
    --table-selected-hover: color-mix(in srgb, var(--text-primary) 4%, var(--surface-selected));
  }
  @media (prefers-reduced-motion: reduce) {
    .data-scroll th:has(.sort-control),
    .data-scroll .cell-copy.btn.icon {
      transition: none;
    }
  }

  @media (pointer: coarse) {
    .data-region[data-density='compact'] .data-scroll td {
      height: 44px;
      padding-block: 10px;
    }
    .data-region[data-density='compact'] .data-scroll .cell-copy.btn.icon {
      --height: 44px;
    }
  }

  .table-context {
    gap: var(--space-3);
  }
  .reference-table .table-actions {
    margin-inline-start: auto;
  }

  .table-overflow-controls {
    gap: var(--space-1);
  }
  .table-actions > .btn,
  .table-overflow-controls > .btn {
    border: 1px solid var(--border-default);
    background: var(--surface-panel);
  }
  .table-actions > .btn:hover:not(:disabled):not([aria-disabled='true']),
  .table-overflow-controls > .btn:hover:not(:disabled):not([aria-disabled='true']) {
    background: var(--surface-hover);
    border-color: var(--border-strong);
  }

  .sort-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    opacity: 0;
    transition: opacity var(--motion-feedback) var(--motion-easing);
    color: var(--text-muted);
  }
  .sort-control[data-sort-active='true'] .sort-indicator,
  .sort-control:hover .sort-indicator,
  .sort-control:focus-visible .sort-indicator {
    opacity: 1;
  }
  @media (prefers-reduced-motion: reduce) {
    .sort-indicator {
      transition: none;
    }
  }
  [data-reduced-motion='true'] .sort-indicator {
    transition: none;
  }

  .sort-control[data-sort-active='true'] .sort-indicator {
    color: var(--selection-text);
  }
  .sort-control[data-sort-active='true'] .sort-indicator svg {
    stroke-width: 2.6;
  }
  .reference-table-host {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .data-scroll td[data-column-kind='action'] {
    padding-right: var(--space-4);
  }
  .data-scroll td[data-copy-disabled='true'] {
    padding-right: var(--space-4);
  }
  @container (min-width:720px) {
    .data-scroll th[data-column-kind='action']:last-child {
      position: sticky;
      right: 0;
      z-index: 3;
      background: var(--surface-panel);
    }
    .data-scroll td[data-column-kind='action']:last-child {
      position: sticky;
      right: 0;
      z-index: 2;
      background: var(--surface-panel);
    }
    .data-scroll tr:has(input:checked) td[data-column-kind='action']:last-child {
      background: var(--surface-selected);
    }
  }
  /* Row density owns cell actions as well as text; taller actions never top-align copy. */
  .data-region:not(.reference-table) .data-scroll :is(th, td) {
    vertical-align: middle;
  }
  .data-region[data-density='compact'] {
    --table-action-height: 24px;
    --table-action-padding: 1px 8px;
    --table-action-cell-padding: 2px;
  }
  .data-region[data-density='standard'] {
    --table-action-height: 32px;
    --table-action-padding: 5px 12px;
    --table-action-cell-padding: 6px;
  }
  .data-region[data-density='comfortable'] {
    --table-action-height: 40px;
    --table-action-padding: 9px 16px;
    --table-action-cell-padding: 8px;
  }
  .data-region .data-scroll td[data-column-kind='action'] {
    padding-block: var(--table-action-cell-padding);
  }
  .data-region .data-scroll td[data-column-kind='action'] .btn {
    --height: var(--table-action-height);
    min-height: var(--table-action-height);
    height: auto;
    padding: var(--table-action-padding);
    line-height: 20px;
  }
  .data-region .data-scroll td[data-column-kind='action'] .btn.icon {
    width: var(--table-action-height);
    height: var(--table-action-height);
    padding: 0;
  }
  .data-region .data-scroll td[data-column-kind='action'] .btn svg {
    width: 16px;
    height: 16px;
  }
  @media (pointer: coarse) {
    .data-region[data-density] {
      --table-action-height: 44px;
      --table-action-padding: 11px 12px;
      --table-action-cell-padding: 2px;
    }
  }

  /* Density scales inline padding only, for column-edge alignment with body cells; the header
   stays one compact, bold row height regardless of row density. Restoring the .data-scroll th
   base rule's own height/weight/color (declared near the top of this file) after they were
   silently overridden here by a higher-specificity rule using the `font` shorthand (which
   resets font-weight even when only trying to set line-height) and a `--table-header-height`
   that tracked body row height per density (NW-521). */
  .data-region {
    --table-header-height: 44px;
    --table-header-padding: var(--space-3) var(--space-4);
  }
  /* Compact density: the header matches the compact rows; touch keeps its 44px target. */
  .data-region[data-density='compact'] {
    --table-header-height: 36px;
    --table-header-padding: 6px var(--space-4);
  }
  @media (pointer: coarse) {
    .data-region[data-density='compact'] {
      --table-header-height: 44px;
      --table-header-padding: var(--space-3) var(--space-4);
    }
  }
  .data-region[data-density='compact'] {
    --table-inline-padding: 12px;
  }
  .data-region[data-density='standard'] {
    --table-inline-padding: 16px;
  }
  .data-region[data-density='comfortable'] {
    --table-inline-padding: 16px;
  }
  .data-region .data-scroll thead th:not(.selection-column) {
    height: var(--table-header-height);
    padding: var(--table-header-padding);
    font: var(--text-body);
    font-weight: 600;
    color: var(--text-primary);
  }
  .data-region .data-scroll thead th:has(.sort-control) {
    padding: 0;
  }
  .data-region .data-scroll thead th .sort-control {
    min-height: var(--table-header-height);
    padding: var(--table-header-padding);
    font: inherit;
    line-height: 24px;
  }

  /* Keep column labels and body values on the same density-specific start edge. */
  .data-region .data-scroll :is(thead th, tbody td):not(.selection-column):not(:has(.sort-control)) {
    padding-inline-start: var(--table-inline-padding);
  }
  .data-region .data-scroll thead th:has(.sort-control) .sort-control {
    padding-inline-start: var(--table-inline-padding);
  }

  /* Compact density tightens the action bar; comfortable keeps standard actions. */
  .data-region[data-density='compact'] .data-tools {
    padding-block: var(--space-1);
  }
  .data-region[data-density='compact']
    .table-actions
    > :is(.table-copy-actions, .table-overflow-controls)
    > .btn[data-size='compact'],
  .data-region[data-density='compact'] .table-actions > .btn[data-size='compact'] {
    --height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding-block: var(--space-1);
  }
  .data-footer:has([data-export-error]:not([hidden])) {
    height: auto;
    min-height: 0;
    padding: var(--space-2) var(--space-4);
    border-top: 1px solid var(--border-default);
  }

  @media (pointer: coarse) {
    .data-region[data-density='compact']
      .table-actions
      > :is(.table-copy-actions, .table-overflow-controls)
      > .btn[data-size='compact'],
    .data-region[data-density='compact'] .table-actions > .btn[data-size='compact'] {
      --height: 44px;
      min-width: 44px;
      min-height: 44px;
      padding-block: var(--space-2);
    }
  }

  /* Keep the search action in the visible toolbar at narrow article widths. */
  .collection-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    max-width: 560px;
    min-width: 0;
  }
  .collection-search label {
    min-width: 0;
  }
  .collection-search input {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .collection-search > [data-action='clear'] {
    flex: none;
    min-width: var(--control-sm);
    white-space: nowrap;
  }
  @media (pointer: coarse) {
    .collection-search > [data-action='clear'] {
      min-width: var(--control-md);
    }
  }
  .data-scroll :is(th, td).selection-column {
    box-sizing: border-box;
    width: 52px;
    min-width: 52px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
  }
  .data-scroll .selection-control {
    margin-inline: auto;
  }

  /* Authored reference widths allocate room to actual content, while narrow views scroll. */
  .reference-table .data-scroll table:has(col[style*='width']) {
    table-layout: fixed;
    min-width: 640px;
  }

  /* Actions retain their trailing anchor even when a caption is intentionally hidden. */
  .data-tools > .table-actions {
    margin-inline-start: auto;
  }

  /* Selection actions travel with their table, including into the expanded view. */
  .table-selection-actions {
    display: flex;
    align-items: center;
    min-width: 0;
  }
  .table-selection-actions[hidden] {
    display: none;
  }
  .table-selection-actions > .bulk-action-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0;
    border: 0;
    background: transparent;
  }
  .table-selection-actions > .bulk-action-bar[hidden] {
    display: none;
  }
  .table-selection-actions .bulk-action-bar > .row {
    gap: var(--space-1);
    flex-wrap: nowrap;
  }

  /* Actions keep one DOM order at every width: scroll, selection, copy, filter, expand, settings. */
  @container (max-width:900px) {
    .table-actions {
      flex-wrap: wrap;
      justify-content: flex-end;
    }
  }
  @container (max-width:640px) {
    .table-actions {
      align-items: center;
    }
    .table-selection-actions {
      max-width: 100%;
    }
    .table-selection-actions > .bulk-action-bar {
      max-width: 100%;
      flex-wrap: wrap;
    }
    .table-selection-actions .bulk-action-bar > .row {
      flex-wrap: wrap;
    }
    .table-selection-actions .bulk-action-bar [data-pending] {
      max-width: 100%;
      overflow-wrap: anywhere;
    }
  }

  /* Symmetric insets when nothing overflows; a scrollbar lane is reserved only once data-table.js's
   overflow() has measured real overflow and set data-overflow-x/-y, so classic scrollbars never
   cover the last-column action and never shift layout, but no lane sits empty on a table that
   never scrolls. */
  .data-scroll {
    scrollbar-gutter: auto;
    scroll-padding-block: var(--space-3);
  }
  .data-scroll[data-overflow-y='true'] {
    scrollbar-gutter: stable;
  }
  /* Prepared reference tables cannot know viewport overflow at build time. Keep their
     bottom inset identical before and after hydration. */
  .reference-table-host .data-scroll,
  .data-scroll[data-overflow-x='true'] {
    padding-block-end: var(--space-2);
  }
  .data-scroll tbody td:last-child:not([data-column-kind='action']):not([data-copy-disabled='true']) {
    padding-inline-end: calc(36px + var(--space-3));
  }
  .data-scroll tbody td:last-child .cell-copy {
    inset-inline-end: var(--space-3);
  }
  @media (pointer: coarse) {
    .data-scroll tbody td:last-child:not([data-column-kind='action']):not([data-copy-disabled='true']) {
      padding-inline-end: calc(44px + var(--space-3));
    }
  }

  /* Column resizing (after prosemirror-tables): the pointer is matched to a column's trailing border by geometry, so no layer can block it.
   The table marks the hovered edge; the guide line and the keyboard separators (one Tab stop) sit in a layer over the scroll area. */
  .data-scroll {
    position: relative;
  }
  /* While an edge is hovered the whole column line shows the resize cursor, over any child; during a drag it holds everywhere. */
  .data-scroll table[data-resize-hover],
  .data-scroll table[data-resize-hover] *,
  .data-region[data-resizing='true'],
  .data-region[data-resizing='true'] * {
    cursor: col-resize;
  }
  :root[data-column-resizing='true'],
  :root[data-column-resizing='true'] * {
    cursor: col-resize;
  }
  .data-region[data-resizing='true'] {
    user-select: none;
  }
  .data-region {
    position: relative;
  }
  .column-resize-layer {
    position: absolute;
    z-index: 5;
    overflow: clip;
    pointer-events: none;
  }
  /* The guide line appears after a resting pointer (HOVER_INTENT; at once for keyboard focus and a drag) and fades in and out;
   only opacity and colour change, never layout. Reduced motion keeps the delays and drops the fade. */
  .column-resize-indicator {
    position: absolute;
    z-index: 4;
    width: 2px;
    margin-inline-start: -1px;
    border-radius: 1px;
    background: var(--border-strong);
    opacity: 0;
    transition:
      opacity var(--motion-feedback) var(--motion-easing),
      background-color var(--motion-feedback) var(--motion-easing);
    pointer-events: none;
  }
  .column-resize-indicator[data-shown='true'] {
    opacity: 1;
  }
  .data-region[data-resizing='true'] .column-resize-indicator,
  .data-region:has(.column-resize:focus-visible) .column-resize-indicator {
    background: var(--focus-ring);
  }
  @media (prefers-reduced-motion: reduce) {
    .column-resize-indicator {
      transition: none;
    }
  }
  [data-reduced-motion='true'] .column-resize-indicator {
    transition: none;
  }
  .column-resize {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    outline: none;
  }
  /* Default layout: declared widths are minimums (auto layout, full width), so nothing clips while there is room.
   Once a column is resized, widths are exact and the table is their sum; values wrap in their chosen columns without hiding data. */
  .data-scroll table[data-column-widths='custom'] {
    table-layout: fixed;
    min-width: 0;
  }
  .data-scroll table:not([data-column-widths='custom']) {
    width: 100%;
  }
  /* Fill columns (width:'fill') are the table's flexible text: they take the spare width, keep a readable minimum,
   wrap to their full height without a line limit. Other columns size to content. */
  .data-scroll td[data-column-fill] {
    white-space: normal;
  }
  .data-scroll td[data-column-fill] > span:first-child {
    display: block;
    min-width: var(--table-fill-min, 24ch);
    max-height: none;
    overflow: visible;
    overflow-wrap: anywhere;
  }
  /* Cell pills remain fully readable, including after column resizing. */
  .data-scroll td .metadata-pill {
    max-width: 100%;
    vertical-align: middle;
  }
  .data-scroll table[data-column-widths='custom'] td:not(.selection-column) {
    overflow: visible;
  }
  .data-scroll table[data-column-widths='custom'] td:not(.selection-column) > span:first-child {
    display: block;
    min-width: 0;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .column-measure {
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
    white-space: nowrap;
    width: max-content;
    pointer-events: none;
  }

  /* Summary metrics paired with a table sit between its title row and the table, above a divider. */
  .table-summary {
    padding: var(--space-3) var(--space-3) var(--space-4);
    padding-inline-start: var(--table-inline-padding, var(--space-3));
    border-bottom: 1px solid var(--border-default);
  }
  /* Hidden slots take no space, in every mode (component display rules must not beat [hidden]). */
  .data-region
    :is(.table-context, .table-overflow-controls, .table-selection-actions, .data-count, [data-export-error])[hidden] {
    display: none;
  }

  /* Pinned columns: content scrolling beneath fades into them (24px, surface-coloured) only while more of it is hidden there.
   data-hidden-left/right are physical, so RTL needs no mirror; a start-pinned cell ([data-pinned=start]) takes the matching fade. */
  .data-scroll :is(th, td)[data-column-kind='action']:last-child::before,
  .data-scroll :is(th, td)[data-pinned='start']::after {
    position: absolute;
    inset-block: 0;
    width: 24px;
    content: '';
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--motion-feedback) var(--motion-easing);
  }
  .data-scroll :is(th, td)[data-column-kind='action']:last-child::before {
    right: 100%;
    background: linear-gradient(to left, var(--table-pinned-fade, var(--surface-panel)), transparent);
  }
  .data-scroll :is(th, td)[data-pinned='start']::after {
    left: 100%;
    background: linear-gradient(to right, var(--table-pinned-fade, var(--surface-panel)), transparent);
  }
  .data-scroll tr:has(input:checked) > td {
    --table-pinned-fade: var(--surface-selected);
  }
  @container (min-width:720px) {
    .data-scroll[data-hidden-right='true'] :is(th, td)[data-column-kind='action']:last-child::before {
      opacity: 1;
    }
  }
  .data-scroll[data-hidden-left='true'] :is(th, td)[data-pinned='start']::after {
    opacity: 1;
  }
  @media (prefers-reduced-motion: reduce) {
    .data-scroll :is(th, td)[data-column-kind='action']:last-child::before,
    .data-scroll :is(th, td)[data-pinned='start']::after {
      transition: none;
    }
  }

  /* One end edge per column: a header and its cells share the inline end reserve (--cell-end). Body cells keep the copy
   button there; a right-aligned header puts its sort arrow there, so its label ends exactly where its values end. */
  .data-region .data-scroll :is(thead th, tbody td):not(.selection-column) {
    --cell-end: 36px;
  }
  .data-region
    .data-scroll
    :is(thead th, tbody td):last-child:not(
      [data-column-kind='action'],
      [data-copy-disabled='true'],
      .selection-column
    ) {
    --cell-end: calc(36px + var(--space-3));
  }
  .data-region .data-scroll :is(thead th, tbody td):is([data-column-kind='action'], [data-copy-disabled='true']) {
    --cell-end: var(--space-4);
  }
  @media (pointer: coarse) {
    .data-region .data-scroll :is(thead th, tbody td):not(.selection-column) {
      --cell-end: 52px;
    }
    .data-region
      .data-scroll
      :is(thead th, tbody td):last-child:not(
        [data-column-kind='action'],
        [data-copy-disabled='true'],
        .selection-column
      ) {
      --cell-end: calc(44px + var(--space-3));
    }
    .data-region .data-scroll :is(thead th, tbody td):is([data-column-kind='action'], [data-copy-disabled='true']) {
      --cell-end: var(--space-4);
    }
  }
  .data-region .data-scroll tbody td:not(.selection-column),
  .data-region .data-scroll thead th:not(.selection-column):not(:has(.sort-control)),
  .data-region .data-scroll thead th .sort-control {
    padding-inline-end: var(--cell-end);
  }
  .data-region .data-scroll thead th:has(.sort-control) {
    padding-inline-end: 0;
  }
  .data-region .data-scroll thead th.numeric .sort-control {
    position: relative;
    flex-direction: row;
    justify-content: flex-end;
  }
  .data-region .data-scroll thead th.numeric .sort-indicator {
    position: absolute;
    inset-inline-end: calc((var(--cell-end) - 16px) / 2);
    top: 50%;
    translate: 0 -50%;
  }

  /* Action column: controls line up on the cell's start edge, the same inset as other values; the header label is for screen readers only. */
  .data-region .data-scroll td[data-column-kind='action'] {
    text-align: start;
  }
  .data-region .data-scroll td[data-column-kind='action'] > * {
    justify-content: flex-start;
  }

  /* A pinned action cell takes its row's surface: stripe and selection (rows have no hover surface), and its fade follows. */
  .data-scroll {
    --table-stripe: color-mix(in srgb, var(--text-primary) 2%, var(--surface-panel));
  }
  @container (min-width:720px) {
    .data-scroll tbody tr:nth-child(even) > td[data-column-kind='action']:last-child {
      background: var(--table-stripe);
    }
    .data-scroll tbody tr:has(input:checked) > td[data-column-kind='action']:last-child {
      background: var(--surface-selected);
    }
  }
  .data-scroll tbody tr:nth-child(even) > td {
    --table-pinned-fade: var(--table-stripe);
  }
  .data-scroll tbody tr:has(input:checked) > td {
    --table-pinned-fade: var(--surface-selected);
  }

  /* Secondary details are data too: let every line remain visible. */
  .data-scroll td .cell-detail {
    display: block;
    min-width: 0;
    max-height: none;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--text-muted);
    font: var(--text-dense);
  }

  /* Sticky header: an opaque surface whose divider is an inset shadow (a collapsed border stays behind when the header
   sticks); once the rows scroll under it, a calm raised shadow separates them. */
  .data-region .data-scroll thead th {
    background: var(--surface-panel);
    border-bottom: 0;
    box-shadow: inset 0 -1px 0 var(--border-strong);
  }
  .data-region .data-scroll[data-scrolled-y='true'] thead th {
    box-shadow:
      inset 0 -1px 0 var(--border-strong),
      var(--shadow-raised);
  }

  /* Auto layout: the fill column (or, without one, the widest text column) takes the spare width; every other column keeps its content width. */
  .data-scroll table:not([data-column-widths='custom']) :is(th[data-column-fill], th[data-column-spare]) {
    width: 100%;
  }

  /* The pinned column's fade only shows while content is scrolled beneath it, uses the row's own surface, and never covers
   the header divider: in the header it stops above the divider, and the pinned header draws the same inset divider. */
  .data-region .data-scroll thead th[data-column-kind='action']:last-child {
    box-shadow: inset 0 -1px 0 var(--border-strong);
  }
  .data-region .data-scroll[data-scrolled-y='true'] thead th[data-column-kind='action']:last-child {
    box-shadow:
      inset 0 -1px 0 var(--border-strong),
      var(--shadow-raised);
  }
  .data-scroll thead th[data-column-kind='action']:last-child::before,
  .data-scroll thead th[data-pinned='start']::after {
    inset-block: 0 1px;
  }
  .data-scroll thead th {
    --table-pinned-fade: var(--surface-panel);
  }

  /* File names in cells: the glyph slot is one fixed square per density, so a thumbnail or an icon never changes the row;
   the name centres with it, and compact rows drop the detail line (the name's tooltip carries it). */
  .data-region {
    --table-glyph-size: 32px;
  }
  .data-region[data-density='compact'] {
    --table-glyph-size: 24px;
  }
  .data-region[data-density='comfortable'] {
    --table-glyph-size: 40px;
  }
  .data-scroll td .file-name {
    align-items: center;
    vertical-align: middle;
  }
  .data-scroll td .file-name-glyph {
    width: var(--table-glyph-size);
    height: var(--table-glyph-size);
    overflow: hidden;
    border-radius: var(--radius-xs);
  }
  .data-scroll td .file-name-glyph > :is(img, video) {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .data-scroll td .file-name-glyph > :not(img, video) {
    max-width: 100%;
    max-height: 100%;
  }
  .data-region[data-density='compact'] .data-scroll td .file-name-detail {
    display: none;
  }

  /* Default layout: the fill column takes the spare width, which makes the browser shrink every other column to its
   min-content. Their content never shrinks below its natural width, so labels like "Needs attention" stay whole. */
  .data-scroll table:not([data-column-widths='custom']) td:not([data-column-fill], .selection-column) > :first-child {
    min-width: max-content;
  }

  /* Content width (width:'content'): the table sizes to its columns at the inline start and nothing takes spare width; the
   toolbar, summary and footer still span the region. A fill column keeps its minimum width. A text column without a declared
   width is capped at --table-content-max and wraps to its full height. A resize makes
   widths exact, as in full width; reset returns here. A pinned action column sits at the table's end. */
  .data-region[data-table-width='content'] .data-scroll table:not([data-column-widths='custom']) {
    width: auto;
  }
  .data-region[data-table-width='content'] .data-scroll table:not([data-column-widths='custom']) th[data-column-fill] {
    width: auto;
  }
  .data-region[data-table-width='content']
    .data-scroll
    table:not([data-column-widths='custom'])
    td[data-column-fill]
    > span:first-child {
    width: var(--table-fill-min, 24ch);
  }
  .data-region[data-table-width='content']
    .data-scroll
    table:not([data-column-widths='custom'])
    td[data-column-capped] {
    white-space: normal;
  }
  .data-region[data-table-width='content']
    .data-scroll
    table:not([data-column-widths='custom'])
    td[data-column-capped]
    > span:first-child {
    display: block;
    width: max-content;
    min-width: 0;
    max-width: var(--table-content-max, 40ch);
    max-height: none;
    overflow: visible;
    overflow-wrap: anywhere;
  }
  /* Shared overflow labels may be composed inside a cell. Table data takes precedence over
     their compact-label treatment, regardless of RTL, mobile width or stylesheet load order. */
  .data-region .data-scroll tbody td [data-overflow-mode],
  .data-region .data-scroll tbody td .metadata-pill-text {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    max-height: none;
    -webkit-line-clamp: unset;
    -webkit-mask: none;
    mask: none;
    text-overflow: clip;
  }
  /* In automatic layout, compact labels contribute their complete intrinsic width.
     An explicit resize may wrap them, but must never mask their data. */
  .data-region .data-scroll table:not([data-column-widths='custom']) td .metadata-pill {
    width: max-content;
    max-width: none;
  }
  .data-region .data-scroll table:not([data-column-widths='custom']) td .metadata-pill-text {
    white-space: nowrap;
    overflow-wrap: normal;
  }
}
