/* Layout only: retain SELQON colours, controls, permissions and print tables.
   Container widths also respond to the sidebar and browser zoom. */
html.selqon-precision-preview {
  min-width: 0;
}
html.selqon-precision-preview body.globalrf-ui {
  --content-max: 100%;
}
html.selqon-precision-preview body.globalrf-ui :is(.app-workspace, .main-content, .panel, .service-form) {
  min-width: 0;
  max-width: 100%;
}
html.selqon-precision-preview body.globalrf-ui .main-content {
  padding-inline: clamp(12px, 2vw, 28px);
}
html.selqon-precision-preview body.globalrf-ui .service-form {
  width: 100%;
  container: transport-form / inline-size;
}
html.selqon-precision-preview body.globalrf-ui .service-form :is(input, select, textarea) {
  min-width: 0;
  max-width: 100%;
}
html.selqon-precision-preview body.globalrf-ui .service-form :is(label, small, .helptext, .errorlist) {
  overflow-wrap: anywhere;
}
@container transport-form (max-width: 1050px) {
  html.selqon-precision-preview body.globalrf-ui .service-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container transport-form (max-width: 600px) {
  html.selqon-precision-preview body.globalrf-ui .service-form .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  html.selqon-precision-preview body.globalrf-ui .service-form .form-grid > * {
    grid-column: 1 / -1;
  }
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form {
  container: transport-register / inline-size;
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .table-scroll {
  width: 100%;
  max-width: 100%;
  overscroll-behavior-inline: contain;
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table {
  width: 100%;
  min-width: 1200px;
  table-layout: fixed;
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table :is(th, td) {
  width: auto;
  min-width: 0;
  height: auto;
  white-space: normal;
  overflow-wrap: anywhere;
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table .sortable-heading {
  flex-wrap: wrap;
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table :is(.inline-weight-editor, .inline-delivery-note-editor, .transport-action-stack, .transport-action-stack .compact) {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table .transport-code-cell a {
  white-space: normal;
  overflow-wrap: anywhere;
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table :is(.delivery-note-name, .transport-file-selection, .status) {
  white-space: normal;
  max-width: 100%;
  overflow-wrap: anywhere;
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .bulk-toolbar {
  flex-wrap: wrap;
}
html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .bulk-toolbar > * {
  min-width: 0;
  max-width: 100%;
}
/* The same table and form become labelled cards; no duplicated inputs or lost actions. */
@container transport-register (max-width: 900px) {
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .bulk-toolbar {
    align-items: stretch;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .bulk-toolbar small {
    flex: 0 1 auto;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .table-scroll {
    overflow: visible;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table,
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table thead {
    /* Keep sort links available on small screens. */
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table thead tr {
    display: flex;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table thead th {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-block: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table :is(.transport-code-cell, .transport-client-cell, .transport-route-cell, .transport-delivery-file-cell, .transport-row-actions) {
    grid-column: 1 / -1;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table tbody td {
    display: block;
    position: static;
    width: auto;
    height: auto;
    min-width: 0;
    max-width: 100%;
    padding: 10px 12px !important;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    font-size: 14px !important;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 650;
    margin-bottom: 5px;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table :is(.inline-delivery-note-editor, .transport-action-stack) {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    gap: 8px;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table :is(.delivery-note-name, .transport-file-selection) {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  html.selqon-precision-preview body.globalrf-ui #transport-bulk-form .service-register-table :is(button, .secondary-button, .primary-button, .transport-file-picker) {
    min-height: 44px;
  }
}
@media (max-width: 600px) {
  html.selqon-precision-preview body.globalrf-ui :is(input, select, textarea) {
    font-size: 16px;
  }
  html.selqon-precision-preview body.globalrf-ui :is(.page-header .button-row, .form-actions, .pagination) {
    flex-wrap: wrap;
    max-width: 100%;
  }
  html.selqon-precision-preview body.globalrf-ui .service-form .panel {
    padding: 16px;
  }
}
