/* Shared compact checkbox and data-table density, v1.0.2.
   Screen-only: rows grow for wrapped content; print/export keep their layout. */
@media screen {
  html body:not(.exporting) input[type="checkbox"]:not([role="switch"]):not(.form-switch input) {
    box-sizing: border-box;
    width: 14px !important; min-width: 14px !important; max-width: 14px !important;
    height: 14px !important; min-height: 14px !important; max-height: 14px !important;
    flex: 0 0 14px !important;
    padding: 0 !important;
    vertical-align: middle;
  }
  html body:not(.exporting) .record-delivery-card-select {
    width: 24px !important; min-width: 24px !important; max-width: 24px !important;
    height: 24px !important; min-height: 24px !important; max-height: 24px !important;
    flex: 0 0 24px !important; padding: 0 !important; border-radius: 5px;
  }
  html body:not(.exporting) .record-delivery-select-cell > label {
    width: 24px !important; height: 24px !important;
    min-height: 0 !important; padding: 0 !important; margin: 0 !important;
  }
  html body:not(.exporting) table :is(th, td).record-delivery-select-cell,
  html body:not(.exporting) col[data-list-selection-column="record_delivery_selection"] {
    width: 1% !important; min-width: 28px !important; max-width: 28px !important;
    padding: 0 !important;
  }
  html body:not(.exporting) :is(table.table, table.data-table, table.results-table, table.wfh-table, table.dashboard-table, .table-container > table, .table-responsive > table, .app-body table, .vg-entity-workspace-page table):not([role="presentation"]):not(.document-table) > :is(thead, tbody, tfoot) > tr {
    /* Table-row height is a minimum. This keeps action-free rows readable,
       while multiline content can still expand naturally. */
    height: 34px !important; min-height: 0 !important;
  }
  html body:not(.exporting) :is(table.table, table.data-table, table.results-table, table.wfh-table, table.dashboard-table, .table-container > table, .table-responsive > table, .app-body table, .vg-entity-workspace-page table):not([role="presentation"]):not(.document-table) > :is(tbody, tfoot) > tr > :is(td, th) {
    height: auto !important; min-height: 0 !important;
    padding-top: 2px !important; padding-bottom: 2px !important;
    line-height: 1.2 !important; vertical-align: middle;
  }
  html body:not(.exporting) :is(table.table, table.data-table, table.results-table, table.wfh-table, table.dashboard-table, .table-container > table, .table-responsive > table, .app-body table, .vg-entity-workspace-page table):not([role="presentation"]):not(.document-table) > thead > tr > th {
    height: auto !important; min-height: 0 !important;
    padding-top: 4px !important; padding-bottom: 4px !important;
    line-height: 1.2 !important; vertical-align: middle;
  }
  html body:not(.exporting) :is(table.table, table.data-table, table.results-table, table.wfh-table, table.dashboard-table, .table-container > table, .table-responsive > table, .app-body table, .vg-entity-workspace-page table):not([role="presentation"]):not(.document-table) > :is(thead, tbody, tfoot) > tr > :is(th, td).record-delivery-select-cell {
    padding: 0 !important;
  }
  html body:not(.exporting) :is(table.table, table.data-table, table.results-table, table.wfh-table, table.dashboard-table, .table-container > table, .table-responsive > table, .app-body table, .vg-entity-workspace-page table):not([role="presentation"]):not(.document-table) > tbody > tr > :is(td, th) :is(.btn, .icon-btn, .action-btn, .wfh-button, button) {
    --vg-btn-height: 24px;
    height: auto !important; min-height: 24px !important; max-height: none !important;
    padding-top: 2px !important; padding-bottom: 2px !important;
    line-height: 1.15 !important;
  }
  html body:not(.exporting) :is(table.table, table.data-table, table.results-table, table.wfh-table, table.dashboard-table, .table-container > table, .table-responsive > table, .app-body table, .vg-entity-workspace-page table):not([role="presentation"]):not(.document-table) > tbody > tr > :is(td, th) :is(.row-actions, .action-buttons, .actions-wrap) {
    min-height: 0 !important; margin-block: 0 !important; padding-block: 0 !important;
  }
  html body:not(.exporting) :is(table.table, table.data-table, table.results-table, table.wfh-table, table.dashboard-table, .table-container > table, .table-responsive > table, .app-body table, .vg-entity-workspace-page table):not([role="presentation"]):not(.document-table) > tbody > tr > :is(td, th) :is(.badge, .status-badge, .wfh-pill) {
    min-height: 0 !important; padding-top: 2px !important; padding-bottom: 2px !important;
    line-height: 1.15 !important;
  }
}

@media screen {
  /* Compact delivery toolbar and field chooser. */
  html body .record-delivery-selection-toolbar { gap: 6px; padding: 6px 8px; margin-block: 6px; }
  html body .record-delivery-selection-toolbar .btn {
    min-height: 28px !important; height: auto !important; max-height: none !important;
    padding: 3px 7px !important; line-height: 1.2 !important;
  }
  html body .vg-list-selection-fields .vg-list-field-moves button,
  html body #fieldSelectorDropdown.vg-list-selection-fields .vg-list-field-moves button {
    width: 24px !important; min-width: 24px !important; max-width: 24px !important;
    height: 24px !important; min-height: 24px !important; max-height: 24px !important;
    padding: 0 !important;
  }
  html body .vg-list-selection-fields .field-selector-controls button,
  html body #fieldSelectorDropdown.vg-list-selection-fields .field-selector-controls button {
    min-height: 28px !important; height: auto !important; max-height: none !important;
    padding: 3px 7px !important; line-height: 1.2 !important;
  }
  html body .dropdown-menu.vg-list-selection-fields label.dropdown-item {
    min-height: 28px !important; padding-block: 2px !important;
  }

  /* Send selected records: content sets the height, with no stretched tiles. */
  html body .record-delivery-dialog .record-delivery-dialog__header {
    gap: 10px; padding: 10px 14px;
  }
  html body .record-delivery-dialog__header > div { min-width: 0; }
  html body .record-delivery-dialog .record-delivery-dialog__header h2 {
    margin: 3px 0; font-size: 1.05rem; line-height: 1.25;
  }
  html body .record-delivery-dialog .record-delivery-dialog__header p { font-size: .75rem; line-height: 1.35; }
  html body .record-delivery-dialog .record-delivery-icon-button {
    width: 28px !important; height: 28px !important; min-height: 28px !important; padding: 0 !important;
  }
  html body .record-delivery-dialog .record-delivery-dialog__body { padding: 10px 14px; }
  html body .record-delivery-dialog .record-delivery-scope { padding: 6px 8px; margin-bottom: 8px; }
  html body .record-delivery-dialog .record-delivery-config { align-items: start; gap: 8px; }
  html body .record-delivery-dialog .record-delivery-field { gap: 4px; }
  html body .record-delivery-dialog #recordDeliveryAudience {
    height: 32px !important; min-height: 32px !important; max-height: 32px !important;
    padding-block: 3px !important;
  }
  html body .record-delivery-dialog .record-delivery-channels {
    align-self: start; align-content: start; align-items: start; min-width: 0; gap: 5px;
  }
  html body .record-delivery-dialog .record-delivery-channels legend { margin-bottom: 4px; }
  html body .record-delivery-dialog .record-delivery-channels label {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    min-height: 32px !important; height: auto !important; padding: 4px 6px !important;
    line-height: 1.2; font-size: .72rem;
  }
  html body .record-delivery-dialog .record-delivery-channels label > input,
  html body .record-delivery-dialog .record-delivery-recipient > input {
    margin: 0 !important; align-self: center;
  }
  html body .record-delivery-dialog .record-delivery-channels label > span { min-width: 0; overflow-wrap: anywhere; }
  html body .record-delivery-dialog .record-delivery-channels label > i { flex: 0 0 auto; }
  html body .record-delivery-dialog .record-delivery-note { margin-top: 8px; padding: 6px 8px; line-height: 1.3; }
  html body .record-delivery-dialog .record-delivery-review { margin-top: 10px; padding-top: 10px; }
  html body .record-delivery-dialog .record-delivery-review__counts { gap: 6px; margin-top: 8px; }
  html body .record-delivery-dialog .record-delivery-review__count { gap: 1px; padding: 6px 8px; }
  html body .record-delivery-dialog .record-delivery-review__count strong { font-size: 1rem; }
  html body .record-delivery-dialog .record-delivery-recipient {
    grid-template-columns: 14px minmax(0, 1fr); align-items: center; gap: 6px; padding: 6px 8px;
  }
  html body .record-delivery-dialog .record-delivery-recipient__copy { gap: 4px; }
  html body .record-delivery-dialog .record-delivery-dialog__footer { gap: 6px; padding: 8px 14px; }
  html body .record-delivery-dialog .record-delivery-dialog__footer .btn {
    min-height: 30px !important; height: auto !important; max-height: none !important;
    padding: 4px 8px !important; font-size: .75rem !important; line-height: 1.2 !important;
    white-space: normal !important;
  }
  @media (max-width: 720px) {
    html body .record-delivery-dialog .record-delivery-config { grid-template-columns: minmax(0, 1fr); }
    html body .record-delivery-dialog #recordDeliveryAudience { font-size: 16px !important; }
  }
}

@media screen {
  html body:not(.exporting) table :is(th, td):is(.checkbox-cell, .select-cell),
  html body:not(.exporting) table :is(th, td):has(> input[type="checkbox"]:only-child) {
    text-align: center !important; vertical-align: middle !important;
    padding: 2px !important; width: 1%; min-width: 28px;
  }
  html body:not(.exporting) table :is(th, td) input[type="checkbox"] { margin: 0 !important; }
}

@media screen {
  html body:not(.exporting) table :is(th, td).record-delivery-select-cell {
    text-align: center !important; vertical-align: middle !important;
  }
  html body:not(.exporting) table .record-delivery-select-cell > label {
    display: grid; margin-inline: auto !important;
  }
  html body:not(.exporting) table :is(th, td) > input[type="checkbox"]:only-child:not([hidden]) {
    display: block; margin-inline: auto !important;
  }
}
