/* Shared reference-document layout for flow editing and submitted records. */
:root {
  --flow-reference-document-width: 1000px;
  --flow-reference-row-height: 29px;
  --flow-reference-label-width: 132px;
  --flow-reference-border: #d9dfe8;
  --flow-reference-muted-border: #e4e8ee;
  --flow-reference-page: #f2f4f7;
  --flow-reference-surface: #ffffff;
  --flow-reference-field: #f4f6f8;
  --flow-reference-section: #f5f5f5;
  --flow-reference-text: #111111;
  --flow-reference-secondary: #7d8794;
  --flow-reference-primary: #409eff;
  --flow-reference-font: "Microsoft YaHei", Arial, sans-serif;
  --flow-reference-title-font: SimSun, "Songti SC", serif;
}

/* Editing document */
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-shell {
  background: var(--flow-reference-page) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-head {
  min-height: 34px !important;
  padding: 0 10px !important;
  background: var(--flow-reference-surface) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-head h2 {
  font-size: 13px !important;
  font-weight: 600 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-body.is-form {
  background: var(--flow-reference-page) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-form {
  width: min(100%, var(--flow-reference-document-width)) !important;
  max-width: var(--flow-reference-document-width) !important;
  margin-inline: auto !important;
  padding: 8px 0 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-form {
  width: 100% !important;
  max-width: var(--flow-reference-document-width) !important;
  margin-inline: auto !important;
  color: var(--flow-reference-text) !important;
  background: var(--flow-reference-surface) !important;
  border: 1px solid var(--flow-reference-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  padding: 12px 12px 0 !important;
  background: var(--flow-reference-surface) !important;
  border: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-heading {
  min-width: 0 !important;
  display: grid !important;
  justify-items: center !important;
  gap: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-meta {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-heading h3 {
  margin: 0 0 10px !important;
  color: var(--flow-reference-text) !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  letter-spacing: 0 !important;
}

.flow-reference-meta-grid {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--flow-reference-border);
  border-left: 1px solid var(--flow-reference-border);
}

.flow-reference-meta-grid > div {
  min-width: 0;
  min-height: var(--flow-reference-row-height);
  display: grid;
  grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr);
  align-items: stretch;
  border-right: 1px solid var(--flow-reference-border);
  border-bottom: 1px solid var(--flow-reference-border);
}

.flow-reference-meta-grid :is(dt, dd) {
  min-width: 0;
  margin: 0;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  color: var(--flow-reference-text);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.flow-reference-meta-grid dt {
  justify-content: flex-end;
  text-align: right;
  border-right: 1px solid var(--flow-reference-border);
}

.flow-reference-meta-grid dt em {
  margin-right: 2px;
  color: #f5222d;
  font-style: normal;
}

.flow-reference-meta-grid dd {
  justify-content: flex-start;
  background: var(--flow-reference-field);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-reference-meta-grid {
  grid-column: 1 / -1;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-identity {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-layout,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-editor {
  overflow: visible !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
  width: calc(100% - 24px) !important;
  margin: 0 12px 12px !important;
  border-left: 1px solid var(--flow-reference-border) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label:not(.field-wide), .flow-related-field) {
  min-height: var(--flow-reference-row-height) !important;
  grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr) !important;
  background: var(--flow-reference-surface) !important;
  border-right: 1px solid var(--flow-reference-border) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-section-label {
  min-height: 32px !important;
  margin: 6px 0 0 !important;
  padding: 5px 8px !important;
  color: var(--flow-reference-text) !important;
  background: var(--flow-reference-section) !important;
  border-top: 1px solid var(--flow-reference-border) !important;
  border-right: 1px solid var(--flow-reference-border) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-section-label:first-of-type {
  margin-top: 6px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label, .flow-related-field) > span:first-child {
  min-height: var(--flow-reference-row-height) !important;
  padding: 4px 7px !important;
  color: var(--flow-reference-text) !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  .readonly-link,
  .percent-input-control,
  .flow-related-trigger
) {
  height: var(--flow-reference-row-height) !important;
  min-height: var(--flow-reference-row-height) !important;
  padding: 3px 8px !important;
  color: var(--flow-reference-text) !important;
  background: var(--flow-reference-field) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid :is(input[readonly], textarea[readonly], select:disabled, .readonly-link) {
  color: var(--flow-reference-secondary) !important;
  background: var(--flow-reference-field) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label.field-wide {
  min-height: 68px !important;
  grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr) !important;
  border-right: 1px solid var(--flow-reference-border) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid textarea {
  min-height: 68px !important;
  padding: 8px !important;
  color: var(--flow-reference-text) !important;
  background: var(--flow-reference-surface) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .line-table-head,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .attachment-upload-control > span:first-child {
  min-height: 32px !important;
  margin: 0 !important;
  padding: 5px 8px !important;
  color: var(--flow-reference-text) !important;
  background: var(--flow-reference-section) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .contract-lines,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table {
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  background: var(--flow-reference-surface) !important;
  border-right: 1px solid var(--flow-reference-border) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .business-line-table {
  width: max-content !important;
  min-width: 100% !important;
  table-layout: auto !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .business-line-table :is(th, td) {
  min-height: 30px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .business-line-table :is(input, select, textarea) {
  min-height: 28px !important;
  height: 28px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .attachment-upload-control {
  padding: 0 10px 10px !important;
  background: var(--flow-reference-surface) !important;
  border-right: 1px solid var(--flow-reference-border) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-attachment-checklist {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .queued-attachment-toolbar {
  min-height: 72px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin-top: 8px !important;
  padding: 8px !important;
  border: 1px dashed #c9d1dc !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route {
  width: calc(100% - 24px) !important;
  margin: 0 12px 10px !important;
  background: var(--flow-reference-surface) !important;
  border: 1px solid var(--flow-reference-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route > header {
  min-height: 32px !important;
  padding: 5px 8px !important;
  background: var(--flow-reference-section) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route #flow-task-approval-route {
  display: block !important;
  margin: 0 !important;
  padding: 8px 18px 10px 32px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route #flow-task-approval-route > li {
  position: relative;
  min-height: 42px;
  padding: 4px 8px 8px 18px;
  border-left: 2px solid #e2e6ec;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route #flow-task-approval-route > li > i {
  position: absolute;
  top: 4px;
  left: -9px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--flow-reference-primary);
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions {
  min-height: 48px !important;
  grid-template-columns: 112px minmax(0, 1fr) 112px !important;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom)) !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions > button {
  min-height: 32px !important;
  border-radius: 16px !important;
  font-size: 13px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #save-draft {
  color: #fff !important;
  background: #d2aa6d !important;
  border-color: #d2aa6d !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #clear-flow-form {
  justify-self: center;
  width: 96px;
  color: #6b7280 !important;
  background: transparent !important;
  border-color: transparent !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #submit-flow {
  width: 112px !important;
  min-width: 112px !important;
  color: #fff !important;
  background: var(--flow-reference-primary) !important;
  border-color: var(--flow-reference-primary) !important;
}

/* Submitted document */
.flow-record-preview-panel.is-document-preview {
  --flow-reference-document-width: 1000px;
  color: var(--flow-reference-text) !important;
  background: var(--flow-reference-page) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
  position: relative;
  min-height: 66px !important;
  display: grid !important;
  grid-template-columns: 96px minmax(0, 1fr) 220px max-content !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  background: var(--flow-reference-surface) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
}

.flow-record-preview-panel.is-document-preview .flow-preview-status-zone {
  justify-content: flex-start;
}

.flow-record-preview-panel.is-document-preview .flow-approval-title-block {
  min-width: 0;
  display: grid !important;
  justify-items: center !important;
  gap: 2px !important;
  text-align: center !important;
}

.flow-record-preview-panel.is-document-preview .flow-approval-title-block strong {
  color: var(--flow-reference-text) !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

.flow-record-preview-panel.is-document-preview .flow-approval-title-block small {
  max-width: 100%;
  color: var(--flow-reference-secondary) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-record-preview-panel.is-document-preview .flow-reference-document-number {
  min-width: 0;
  text-align: right;
}

.flow-record-preview-panel.is-document-preview .flow-record-document-number {
  display: block;
  color: var(--flow-reference-secondary) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  overflow-wrap: anywhere;
}

.flow-record-preview-panel.is-document-preview .flow-record-preview-main {
  padding: 8px !important;
  background: var(--flow-reference-page) !important;
}

.flow-record-preview-panel.is-document-preview .flow-approval-document {
  width: 100%;
  max-width: var(--flow-reference-document-width);
  margin-inline: auto !important;
  background: var(--flow-reference-surface) !important;
  border: 1px solid var(--flow-reference-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.flow-reference-submitted-meta {
  border-top: 0;
}

.flow-readonly-document .flow-approval-content-section > header {
  min-height: 32px !important;
  padding: 5px 8px !important;
  background: var(--flow-reference-section) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
}

.flow-readonly-document .flow-approval-context-strip,
.flow-readonly-document .flow-approval-business-details {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.flow-readonly-document .flow-approval-context-strip > div,
.flow-readonly-document .flow-approval-business-details > div {
  min-height: var(--flow-reference-row-height) !important;
  grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr) !important;
  padding: 0 !important;
  border-right: 1px solid var(--flow-reference-border) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
}

.flow-readonly-document .flow-approval-context-strip > div:nth-child(2n),
.flow-readonly-document .flow-approval-business-details > div:nth-child(2n):not(.is-wide) {
  border-right: 1px solid var(--flow-reference-border) !important;
}

.flow-readonly-document .flow-approval-context-strip > div:nth-child(3n),
.flow-readonly-document .flow-approval-business-details > div:nth-child(3n):not(.is-wide),
.flow-readonly-document .flow-approval-business-details > div.is-wide {
  border-right: 0 !important;
}

.flow-readonly-document .flow-approval-context-strip > div > :is(span, strong, small),
.flow-readonly-document .flow-approval-business-details :is(dt, dd) {
  min-height: var(--flow-reference-row-height) !important;
  padding: 4px 7px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}

.flow-readonly-document .flow-approval-context-strip > div > span,
.flow-readonly-document .flow-approval-business-details dt {
  color: var(--flow-reference-text) !important;
  background: transparent !important;
  font-weight: 500 !important;
  text-align: right !important;
}

.flow-readonly-document .flow-approval-context-strip > div > strong,
.flow-readonly-document .flow-approval-business-details dd {
  color: var(--flow-reference-text) !important;
  background: var(--flow-reference-field) !important;
  font-weight: 500 !important;
}

.flow-readonly-document :is(.data-table, table) :is(th, td) {
  min-height: 30px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}

.flow-readonly-document .flow-approval-attachment-list,
.flow-readonly-document .flow-approval-timeline-list {
  padding: 8px 10px !important;
}

.flow-readonly-document .flow-approval-timeline-list > li {
  min-height: 40px !important;
}

.flow-record-preview-panel.is-document-preview .flow-preview-action-bar {
  min-height: 48px !important;
  padding: 7px 10px !important;
  background: var(--flow-reference-surface) !important;
  box-shadow: none !important;
}

@media (min-width: 1100px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1099px) and (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .flow-readonly-document .flow-approval-context-strip,
  .flow-readonly-document .flow-approval-business-details {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-head {
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-form,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-form {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-right: 0 !important;
    border-left: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
    padding: 10px 8px 0 !important;
  }

  .flow-reference-meta-grid,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .flow-reference-meta-grid > div,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label:not(.field-wide), .flow-related-field),
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label.field-wide {
    grid-template-columns: 104px minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
    width: calc(100% - 16px) !important;
    margin: 0 8px 8px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    select,
    .readonly-link,
    .percent-input-control,
    .flow-related-trigger
  ) {
    height: 42px !important;
    min-height: 42px !important;
    font-size: 15px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label, .flow-related-field) > span:first-child {
    min-height: 42px !important;
    font-size: 13px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route {
    width: calc(100% - 16px) !important;
    margin-inline: 8px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #submit-flow {
    width: 100% !important;
    min-width: 0 !important;
  }

  .flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) max-content !important;
    padding: 8px !important;
  }

  .flow-record-preview-panel.is-document-preview .flow-preview-status-zone {
    grid-column: 1;
    grid-row: 1;
  }

  .flow-record-preview-panel.is-document-preview > .flow-record-preview-head > [data-flow-record-preview-close] {
    grid-column: 2;
    grid-row: 1;
  }

  .flow-record-preview-panel.is-document-preview .flow-approval-title-block {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .flow-record-preview-panel.is-document-preview .flow-reference-document-number {
    grid-column: 1 / -1;
    grid-row: 3;
    text-align: center;
  }

  .flow-record-preview-panel.is-document-preview .flow-record-preview-main {
    padding: 0 !important;
  }

  .flow-readonly-document .flow-approval-context-strip,
  .flow-readonly-document .flow-approval-business-details {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .flow-readonly-document .flow-approval-context-strip > div,
  .flow-readonly-document .flow-approval-business-details > div,
  .flow-readonly-document .flow-approval-business-details > div.is-wide {
    grid-template-columns: 104px minmax(0, 1fr) !important;
    grid-column: auto !important;
    border-right: 0 !important;
  }
}

/* System confirmation dialog authority. */
.system-confirmation-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 16px;
  overflow: hidden;
  color: #1d2129;
  background: transparent;
  border: 0;
}

.system-confirmation-dialog[open] {
  display: grid;
  place-items: center;
}

.system-confirmation-dialog::backdrop {
  background: rgba(12, 18, 28, 0.46);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.system-confirmation-card {
  width: min(calc(100vw - 32px), 440px);
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  box-shadow: 0 20px 56px rgba(15, 52, 118, 0.2);
}

.system-confirmation-content {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 20px 20px 16px;
}

.system-confirmation-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9a4d09;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  background: #fff4e8;
  border: 1px solid #f2c58f;
  border-radius: 50%;
}

.system-confirmation-card.is-danger .system-confirmation-icon {
  color: #b42318;
  background: #fff1f0;
  border-color: #f3b7b3;
}

.system-confirmation-content > div {
  min-width: 0;
}

.system-confirmation-content h2 {
  margin: 0;
  color: #1d2129;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.system-confirmation-content p,
.system-confirmation-content small {
  display: block;
  margin: 6px 0 0;
  color: #4e5969;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.system-confirmation-content small {
  margin-top: 3px;
  color: #6e7681;
  font-size: 12px;
}

.system-confirmation-actions {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  background: #f6f8fa;
  border-top: 1px solid #e5e9ee;
}

.system-confirmation-actions button {
  min-width: 96px;
  min-height: 38px;
  padding: 0 14px;
  color: #1d2129;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  border: 1px solid #cfd6de;
  border-radius: 6px;
  cursor: pointer;
}

.system-confirmation-actions button:hover {
  border-color: #0f3476;
}

.system-confirmation-actions button:focus-visible {
  outline: 3px solid rgba(114, 200, 196, 0.48);
  outline-offset: 2px;
}

.system-confirmation-actions button.primary {
  color: #fff;
  background: #0f3476;
  border-color: #0f3476;
}

.system-confirmation-actions button.danger {
  color: #fff;
  background: #c9362b;
  border-color: #c9362b;
}

@media (max-width: 760px) {
  .system-confirmation-dialog {
    padding: 12px;
  }

  .system-confirmation-card {
    width: min(calc(100vw - 24px), 440px);
  }

  .system-confirmation-content {
    padding: 18px 16px 14px;
  }

  .system-confirmation-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }

  .system-confirmation-actions button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
}

:root[data-color-scheme="dark"] .system-confirmation-card {
  color: #f3f6f9;
  background: #202833;
  border-color: #45515f;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.45);
}

:root[data-color-scheme="dark"] .system-confirmation-content h2 {
  color: #f3f6f9;
}

:root[data-color-scheme="dark"] .system-confirmation-content p,
:root[data-color-scheme="dark"] .system-confirmation-content small {
  color: #c6cdd6;
}

:root[data-color-scheme="dark"] .system-confirmation-actions {
  background: #1a212b;
  border-color: #45515f;
}

:root[data-color-scheme="dark"] .system-confirmation-actions button:not(.primary):not(.danger) {
  color: #f3f6f9;
  background: #27313d;
  border-color: #526170;
}

/* Pixel-matched reference document authority. */
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(#flow-form, #flow-form *) {
  font-family: var(--flow-reference-font) !important;
  letter-spacing: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-form {
  width: min(100%, var(--flow-reference-document-width)) !important;
  padding: 8px 0 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-form {
  border: 0 !important;
  background: var(--flow-reference-surface) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
  padding: 14px 0 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-heading {
  width: 100% !important;
  min-height: 32px !important;
  display: block !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-heading h3 {
  display: block !important;
  margin: 0 0 10px !important;
  color: #111 !important;
  font-family: var(--flow-reference-title-font) !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
  text-align: center !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-form .flow-document-heading > h3 {
  display: block !important;
  width: 100% !important;
  margin: 0 0 10px !important;
  color: #111 !important;
  font-family: var(--flow-reference-title-font) !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
  text-align: center !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-reference-meta-grid {
  width: calc(100% - 24px) !important;
  margin: 0 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-reference-meta-grid > div {
  min-height: var(--flow-reference-row-height) !important;
  grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-reference-meta-grid :is(dt, dd) {
  min-height: var(--flow-reference-row-height) !important;
  padding: 2px 7px !important;
  color: #111 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-layout {
  padding: 0 0 50px !important;
  background: var(--flow-reference-surface) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-editor {
  width: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--flow-reference-surface) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-progress {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
  width: calc(100% - 24px) !important;
  margin: 0 12px !important;
  overflow: visible !important;
  border-top: 1px solid var(--flow-reference-border) !important;
  border-left: 1px solid var(--flow-reference-border) !important;
  border-radius: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-section-label {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-form :is([data-flow-field="applicationDate"], [data-flow-field="date"]) {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label:not(.field-wide), .flow-related-field) {
  height: var(--flow-reference-row-height) !important;
  min-height: var(--flow-reference-row-height) !important;
  grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr) !important;
  border-right: 1px solid var(--flow-reference-border) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
  border-radius: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label, .flow-related-field) > span:first-child {
  height: var(--flow-reference-row-height) !important;
  min-height: var(--flow-reference-row-height) !important;
  box-sizing: border-box !important;
  justify-content: flex-end !important;
  padding: 2px 7px !important;
  color: #111 !important;
  background: #fff !important;
  border-right: 1px solid var(--flow-reference-border) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  text-align: right !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  .readonly-link,
  .percent-input-control,
  .flow-related-trigger
) {
  height: var(--flow-reference-row-height) !important;
  min-height: var(--flow-reference-row-height) !important;
  padding: 2px 7px !important;
  color: #111 !important;
  background: var(--flow-reference-field) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid :is(input, select, textarea, button):focus-visible {
  position: relative;
  z-index: 1;
  outline: 1px solid #409eff !important;
  outline-offset: -1px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label.field-wide {
  min-height: 80px !important;
  grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr) !important;
  border-right: 1px solid var(--flow-reference-border) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid textarea {
  min-height: 80px !important;
  padding: 8px !important;
  color: #111 !important;
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(.line-table-head, .attachment-upload-control > span:first-child) {
  min-height: 34px !important;
  padding: 7px 4px !important;
  color: #111 !important;
  background: var(--flow-reference-section) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .line-table-head button {
  min-height: 26px !important;
  padding: 3px 9px !important;
  color: #fff !important;
  background: #4d9ff6 !important;
  border: 0 !important;
  border-radius: 2px !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .contract-lines {
  border-right: 1px solid var(--flow-reference-border) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
  border-radius: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .business-line-table :is(th, td) {
  min-height: 31px !important;
  padding: 3px 6px !important;
  color: #111 !important;
  background: #fff !important;
  border-color: var(--flow-reference-muted-border) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.flow-record-preview-panel.is-document-preview .flow-approval-title-block small {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-title-block > small {
  display: none !important;
}

.flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
  grid-template-columns: 220px minmax(0, 1fr) 220px max-content !important;
}

.flow-record-preview-panel.is-document-preview .flow-preview-status-zone {
  visibility: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .business-line-table th {
  background: #fafafa !important;
  font-weight: 400 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .attachment-upload-control {
  padding: 0 12px 12px !important;
  border-right: 1px solid var(--flow-reference-border) !important;
  border-bottom: 1px solid var(--flow-reference-border) !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .queued-attachment-toolbar {
  min-height: 76px !important;
  margin-top: 10px !important;
  padding: 8px !important;
  border: 1px dashed #cfd6df !important;
  border-radius: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-attachments-hint {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .attachment-upload-button {
  min-width: 100px !important;
  min-height: 30px !important;
  color: #fff !important;
  background: #14b7e5 !important;
  border: 0 !important;
  border-radius: 2px !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route {
  width: 100% !important;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-top: 8px solid var(--flow-reference-page) !important;
  border-radius: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route > header {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route #flow-task-approval-route {
  padding: 22px 44px 12px 62px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route #flow-task-approval-route > li {
  display: block !important;
  position: relative !important;
  min-height: 52px !important;
  padding: 4px 8px 12px 18px !important;
  border-left: 3px solid #e5e8ed !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route #flow-task-approval-route > li > div {
  width: auto !important;
  min-width: 0 !important;
  display: grid !important;
  gap: 2px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions {
  min-height: 48px !important;
  grid-template-columns: 112px minmax(0, 1fr) 112px !important;
  padding: 7px 10px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  border-top: 1px solid #e5e8ed !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #clear-flow-form {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(#save-draft, #submit-flow) {
  min-height: 28px !important;
  border-radius: 16px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.flow-record-preview-panel.is-document-preview,
.flow-record-preview-panel.is-document-preview * {
  font-family: var(--flow-reference-font) !important;
  letter-spacing: 0 !important;
}

.flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
  width: min(100%, var(--flow-reference-document-width)) !important;
  min-height: 62px !important;
  margin-inline: auto !important;
  padding: 7px 10px !important;
  background: #fff !important;
  border-bottom: 0 !important;
}

.flow-record-preview-panel.is-document-preview .flow-approval-title-block strong {
  color: #111 !important;
  font-family: var(--flow-reference-title-font) !important;
  font-size: 18px !important;
  font-weight: 400 !important;
}

.flow-record-preview-panel.is-document-preview .flow-record-preview-main {
  padding: 0 !important;
}

.flow-record-preview-panel.is-document-preview .flow-approval-document {
  border: 0 !important;
  border-radius: 0 !important;
}

.flow-record-preview-panel.is-document-preview .flow-readonly-document {
  display: block !important;
}

.flow-record-preview-panel.is-document-preview .flow-reference-submitted-meta {
  width: calc(100% - 24px) !important;
  margin: 0 12px !important;
}

.flow-record-preview-panel.is-document-preview .flow-reference-meta-grid :is(dt, dd) {
  min-height: var(--flow-reference-row-height) !important;
  padding: 2px 7px !important;
  color: #111 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.flow-readonly-document .flow-approval-content-section {
  width: calc(100% - 24px) !important;
  margin-inline: 12px !important;
  border-radius: 0 !important;
}

.flow-readonly-document .flow-approval-content-section > header {
  min-height: 34px !important;
  padding: 7px 5px !important;
  color: #111 !important;
  background: var(--flow-reference-section) !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

.flow-readonly-document .flow-approval-context-strip > div,
.flow-readonly-document .flow-approval-business-details > div {
  min-height: var(--flow-reference-row-height) !important;
  grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr) !important;
}

.flow-readonly-document .flow-approval-context-strip > div > :is(span, strong, small),
.flow-readonly-document .flow-approval-business-details :is(dt, dd) {
  min-height: var(--flow-reference-row-height) !important;
  padding: 2px 7px !important;
  color: #111 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.flow-readonly-document .flow-approval-context-strip > div > strong,
.flow-readonly-document .flow-approval-business-details dd {
  background: var(--flow-reference-field) !important;
}

.flow-readonly-document .flow-approval-context-strip > div > small {
  color: var(--flow-reference-secondary) !important;
}

.flow-readonly-document .flow-approval-account-section dl {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.flow-readonly-document .flow-approval-attachments-section .empty-state {
  min-height: 72px !important;
  padding: 24px 12px !important;
}

.flow-readonly-document :is(
  .flow-reference-meta-grid,
  .flow-approval-context-strip,
  .flow-approval-business-details,
  .flow-approval-account-section dl,
  .flow-approval-content-section,
  .data-table-shell,
  table
) {
  border-radius: 0 !important;
}

.flow-reference-record-tabs {
  width: calc(100% - 24px);
  min-height: 40px;
  display: flex;
  align-items: stretch;
  gap: 22px;
  margin: 14px 12px 0;
  padding: 0 10px;
  background: #fff;
  border-top: 1px solid var(--flow-reference-border);
  border-bottom: 1px solid var(--flow-reference-border);
}

.flow-reference-record-tabs > span {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 2px;
  color: #222;
  font-size: 12px;
  white-space: nowrap;
}

.flow-reference-record-tabs > span.is-active {
  color: #0b6fc2;
}

.flow-reference-record-tabs > span.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: #1684e8;
}

.flow-reference-record-log-layout {
  width: calc(100% - 24px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 12px;
  background: #fff;
}

.flow-reference-record-log-layout .flow-approval-timeline {
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
}

.flow-reference-record-log-layout .flow-approval-timeline > header {
  display: none !important;
}

.flow-reference-operation-log {
  min-width: 0;
  padding: 10px 12px 16px;
  border-left: 1px solid var(--flow-reference-border);
}

.flow-reference-operation-log ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-reference-operation-log li {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0 5px 14px;
  border-bottom: 1px dashed #dfe4ea;
  font-size: 12px;
}

.flow-reference-operation-log li::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  margin-left: -12px;
  background: #222;
  border-radius: 50%;
}

.flow-reference-operation-log li > span {
  min-width: 0;
  flex: 1;
  color: #222;
  overflow-wrap: anywhere;
}

.flow-reference-operation-log li > small {
  flex: 0 0 auto;
  color: #9aa2ad;
  font-size: 11px;
}

.flow-readonly-document .flow-approval-timeline-list {
  padding: 12px 18px 16px 32px !important;
}

.flow-readonly-document .flow-approval-timeline-list > li {
  min-height: 50px !important;
}

.flow-record-preview-panel.is-document-preview .flow-preview-action-bar {
  width: min(100%, var(--flow-reference-document-width)) !important;
  margin-inline: auto !important;
  border-top: 1px solid #e5e8ed !important;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tabs {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content !important;
  align-items: stretch !important;
  overflow: hidden !important;
  scroll-padding-inline-end: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tabs-track {
  min-width: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  gap: 2px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tabs-track::-webkit-scrollbar {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tabs-close-all {
  position: static !important;
  right: auto !important;
  z-index: 1 !important;
  margin-left: 0 !important;
  box-shadow: none !important;
}

/* Keep borders inside the document width and reflow against the real form width. */
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-form {
  container: flow-reference-form / inline-size !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(#flow-form, #flow-form *) {
  box-sizing: border-box !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label, .flow-related-field) {
  min-width: 0 !important;
  max-width: 100% !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label, .flow-related-field) > span:first-child {
  min-width: 0 !important;
  white-space: nowrap !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  .readonly-link,
  .percent-input-control,
  .flow-related-trigger
) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(
  [data-flow-field="project"],
  [data-flow-field="sourceIncomeSettlement"],
  [data-flow-field="billingApplication"]
) {
  grid-column: span 2 !important;
}

.flow-reference-meta-grid,
.flow-reference-meta-grid *,
.flow-record-preview-panel.is-document-preview,
.flow-record-preview-panel.is-document-preview * {
  box-sizing: border-box !important;
}

.flow-reference-meta-grid :is(dt, dd),
.flow-readonly-document .flow-approval-context-strip > div > :is(span, strong, small),
.flow-readonly-document .flow-approval-business-details :is(dt, dd) {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.flow-record-preview-panel.is-document-preview .flow-approval-document {
  container: flow-reference-preview / inline-size !important;
}

@container flow-reference-form (max-width: 900px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@container flow-reference-form (max-width: 620px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-reference-meta-grid,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(
    [data-flow-field="project"],
    [data-flow-field="sourceIncomeSettlement"],
    [data-flow-field="billingApplication"]
  ) {
    grid-column: span 1 !important;
  }
}

@container flow-reference-preview (max-width: 900px) {
  .flow-readonly-document .flow-approval-context-strip,
  .flow-readonly-document .flow-approval-business-details,
  .flow-readonly-document .flow-approval-account-section dl {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@container flow-reference-preview (max-width: 620px) {
  .flow-record-preview-panel.is-document-preview .flow-reference-submitted-meta,
  .flow-readonly-document .flow-approval-context-strip,
  .flow-readonly-document .flow-approval-business-details,
  .flow-readonly-document .flow-approval-account-section dl {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
    padding-top: 10px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-reference-meta-grid,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid,
  .flow-record-preview-panel.is-document-preview .flow-reference-submitted-meta,
  .flow-readonly-document .flow-approval-content-section {
    width: calc(100% - 12px) !important;
    margin-inline: 6px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-reference-meta-grid > div,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label:not(.field-wide), .flow-related-field),
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label.field-wide,
  .flow-readonly-document .flow-approval-context-strip > div,
  .flow-readonly-document .flow-approval-business-details > div {
    grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    select,
    .readonly-link,
    .percent-input-control,
    .flow-related-trigger
  ) {
    height: 40px !important;
    min-height: 40px !important;
    font-size: 14px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label, .flow-related-field) > span:first-child {
    min-height: 40px !important;
    font-size: 12px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-inline-approval-route #flow-task-approval-route {
    padding: 16px 14px 10px 30px !important;
  }

  .flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
    grid-template-columns: minmax(0, 1fr) max-content !important;
  }

  .flow-record-preview-panel.is-document-preview .flow-preview-status-zone {
    display: none !important;
  }

  .flow-reference-record-tabs,
  .flow-reference-record-log-layout {
    width: calc(100% - 12px);
    margin-inline: 6px;
  }

  .flow-reference-record-tabs {
    gap: 14px;
    overflow-x: auto;
  }

  .flow-reference-record-log-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-reference-operation-log {
    border-top: 1px solid var(--flow-reference-border);
    border-left: 0;
  }
}

/* Semantic ledger dimensions 2026-08-31: final authority after legacy density rules. */
@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table {
    width: 1256px !important;
    min-width: 1256px !important;
    table-layout: fixed !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(1) { width: 56px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(2) { width: 320px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(3),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(5),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(6) { width: 190px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(7) { width: 120px !important; }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table {
    width: 1448px !important;
    min-width: 1448px !important;
    table-layout: fixed !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(1) { width: 56px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(2) { width: 300px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(3) { width: 260px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(4) { width: 112px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(n + 5) { width: 180px !important; }

  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(.project-ledger, .contract-ledger-table) .ledger-record-link,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-party-cell > strong {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(.project-ledger, .contract-ledger-table) :is(.ledger-record-context, .ledger-record-number, .ledger-record-cell > small),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-party-cell > :is(span, small) {
    display: block !important;
    max-width: 100%;
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(.project-ledger, .contract-ledger-table) .module-ledger-table tbody tr {
    height: 82px !important;
  }
}

/* Flow switching, confirmation and payment contract picker authority 2026-09-02 */
.system-confirmation-actions button.danger {
  position: relative !important;
  z-index: 1 !important;
  isolation: isolate;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #b42318 !important;
  border-color: #b42318 !important;
  line-height: 1.2 !important;
}

.system-confirmation-actions button.danger > span {
  position: relative;
  z-index: 1;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .payment-contract-select-trigger {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 27px !important;
  min-height: 27px !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  padding: 2px 7px !important;
  color: #111827 !important;
  background: #fff !important;
  border: 1px solid #cfd6de !important;
  border-radius: 2px !important;
  text-align: left;
  cursor: pointer;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) form[data-operational-form-kind="payment"] [data-flow-field="project"] {
  order: -3;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) form[data-operational-form-kind="payment"] [data-flow-field="contractType"] {
  order: -2;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) form[data-operational-form-kind="payment"] [data-flow-field="contract"] {
  grid-column: 1 / -1 !important;
  min-width: 0;
  overflow: hidden;
  order: -1;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) form[data-operational-form-kind="supplierSettlement"] [data-flow-field="project"] {
  order: -3;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) form[data-operational-form-kind="supplierSettlement"] [data-flow-field="contractType"] {
  order: -2;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) form[data-operational-form-kind="supplierSettlement"] [data-flow-field="contract"] {
  grid-column: 1 / -1 !important;
  min-width: 0;
  overflow: hidden;
  order: -1;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) form[data-operational-form-kind="invoice"] [data-flow-field="project"] {
  order: -3;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) form[data-operational-form-kind="invoice"] [data-flow-field="invoiceContractType"] {
  order: -2;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) form[data-operational-form-kind="invoice"] [data-flow-field="invoiceContractSelection"] {
  grid-column: 1 / -1 !important;
  min-width: 0;
  overflow: hidden;
  order: -1;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .payment-contract-select-trigger[hidden] {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .payment-contract-select-trigger:is(:hover, :focus-visible) {
  border-color: #2684ff !important;
  outline: 0;
  box-shadow: inset 0 0 0 1px #2684ff;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .payment-contract-select-trigger:disabled {
  color: #7b8491 !important;
  background: #f7f8fa !important;
  border-color: #dfe4ea !important;
  cursor: not-allowed;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .payment-contract-select-trigger > :is(b, small) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .payment-contract-select-trigger > b {
  font-size: 13px;
  font-weight: 500;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .payment-contract-select-trigger > small {
  color: #68717d;
  font-size: 11px;
  font-weight: 400;
  text-align: right;
}

body[data-ui-theme="macos-workspace-v3"] .payment-contract-picker,
body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .payment-contract-picker {
  width: min(1040px, calc(100vw - 32px)) !important;
  max-width: 1040px !important;
  height: auto !important;
  max-height: min(620px, calc(100dvh - 32px)) !important;
  grid-template-rows: auto minmax(0, auto) auto !important;
}

.payment-contract-picker-table-wrap {
  min-width: 0;
  min-height: 0;
  max-height: min(420px, calc(100dvh - 180px));
  padding: 8px 18px 18px 8px !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-padding-inline-end: 18px;
}

.payment-contract-picker-table-wrap .data-table-shell {
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
  padding-inline-end: 16px;
  box-sizing: content-box;
  overflow: visible !important;
  max-height: none !important;
}

.payment-contract-picker-table {
  width: 1290px;
  min-width: 1290px;
  table-layout: fixed;
  border-collapse: collapse;
}

.payment-contract-picker-table col.supplier-column { width: 180px; }
.payment-contract-picker-table col.amount-column { width: 130px; }
.payment-contract-picker-table col.name-column { width: 260px; }
.payment-contract-picker-table col.number-column { width: 190px; }
.payment-contract-picker-table col.date-column { width: 120px; }
.payment-contract-picker-table col.action-column { width: 150px; }

.payment-contract-picker-table :is(th, td) {
  height: 34px;
  padding: 4px 8px;
  color: #1d2129;
  border: 1px solid #dfe4ea;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  box-sizing: border-box;
}

.payment-contract-picker-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f7fa;
  font-weight: 600;
}

.payment-contract-picker-table tr.is-selected td {
  background: #edf5ff;
}

.payment-contract-picker-table .money-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.payment-contract-picker-cell-text {
  min-width: 0;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-contract-picker-table .table-action {
  width: 100%;
  min-width: 0;
  min-height: 26px;
  padding: 2px 8px;
  font-size: 12px;
}

.payment-contract-picker-table .payment-contract-picker-row-actions .table-action {
  width: auto;
  flex: 1 1 0;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .payment-contract-select-trigger {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .payment-contract-select-trigger > small {
    text-align: left;
  }

  body[data-ui-theme="macos-workspace-v3"] .payment-contract-picker-backdrop {
    padding: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .payment-contract-picker {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
}

/* Long ledger identities stay dense on every viewport; full values remain available via title attributes. */
body[data-ui-theme="macos-workspace-v3"] .erp-main :is(.project-ledger, .contract-ledger-table) .ledger-record-cell {
  min-width: 0 !important;
  overflow: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main :is(.project-ledger, .contract-ledger-table) .ledger-record-link {
  display: -webkit-box !important;
  max-width: 100% !important;
  max-height: 36px !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
  line-height: 18px !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main :is(.project-ledger, .contract-ledger-table) :is(.ledger-record-context, .ledger-record-number, .ledger-record-cell > small) {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

:root[data-color-scheme="dark"] .flow-readonly-document .flow-approval-timeline-list > li > div > span {
  color: #a8b2c0 !important;
}

:root[data-color-scheme="dark"] .flow-reference-meta-grid dt em {
  color: #ff7077 !important;
}

:root[data-color-scheme="dark"] {
  --flow-reference-border: #3b4656;
  --flow-reference-muted-border: #303a49;
  --flow-reference-page: #151a22;
  --flow-reference-surface: #1d2430;
  --flow-reference-field: #252e3b;
  --flow-reference-section: #273343;
  --flow-reference-text: #f1f4f8;
  --flow-reference-secondary: #b8c0cc;
}

/* Runtime fit safeguards: keep dense operational controls readable without
 * allowing compact viewports to clip their containing panel. */
.data-export-keyword-field {
  grid-column: 1 / -1;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .data-table {
  min-width: 1120px;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-static-metric {
  grid-template-columns: minmax(60px, auto) minmax(0, 1fr) !important;
}

.construction-log-header-controls select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 1101px) {
  .enterprise-profile-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 360px));
  }

  .enterprise-profile-form .form-grid > label {
    width: 360px;
    max-width: 360px;
  }

  .enterprise-profile-form .form-grid > label.field-wide {
    grid-column: 1 / -1;
    width: 736px;
    max-width: 100%;
  }
}

@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label:not(.field-wide), .flow-related-field) {
    grid-template-columns: var(--flow-reference-label-width) minmax(0, 1fr) !important;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .workbench-status-group button {
    padding: 4px;
  }

  .organization-tree-field-grid,
  .organization-tree-permission-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .organization-tree-setting-control .org-module-dropdown {
    width: 100%;
    min-width: 0;
  }

  .approval-assignment-list .approval-assignment-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .approval-assignment-row :is(.approval-assignment-dropdown, .approval-project-dropdown) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .approval-assignment-row .approval-project-dropdown {
    grid-column: 2;
  }

  .enterprise-profile-form .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .enterprise-profile-form .form-grid > label,
  .enterprise-profile-form .form-grid > label.field-wide {
    grid-column: auto;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .enterprise-profile-form .form-grid,
  .enterprise-profile-form .form-grid > label,
  .enterprise-profile-form .form-grid > label.field-wide {
    width: 100%;
    max-width: 100%;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .enterprise-profile-form .form-grid > label.field-wide {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 4px;
  }
}

/* Non-workbench density authority 2026-08-30 */
@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table {
    min-width: 1434px !important;
    table-layout: fixed;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table :is(th, td):nth-child(1) { width: 64px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table :is(th, td):nth-child(2) { width: 420px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table :is(th, td):nth-child(3),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table :is(th, td):nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table :is(th, td):nth-child(5),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table :is(th, td):nth-child(6) { width: 200px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table :is(th, td):nth-child(7) { width: 150px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table col:nth-child(1) { width: 64px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table col:nth-child(2) { width: 420px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table col:nth-child(3),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table col:nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table col:nth-child(5),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table col:nth-child(6) { width: 200px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table col:nth-child(7) { width: 150px !important; }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table tbody tr {
    height: 74px !important;
    min-height: 74px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .data-table tbody td,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .data-table tbody td {
    height: auto !important;
    min-height: 0 !important;
    padding: 4px 8px !important;
    vertical-align: top !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .ledger-metric-stack,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-metric-stack {
    gap: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .ledger-metric-link,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .ledger-static-metric {
    min-height: 22px !important;
    padding: 1px 2px !important;
    line-height: 1.25 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-metric-link,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-static-metric {
    min-height: 22px !important;
    padding: 1px 2px !important;
    line-height: 1.25 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .ledger-record-cell,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .ledger-alert-stack,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-record-cell,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-party-cell,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-status-cell {
    gap: 2px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .ledger-record-link,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-record-link {
    min-height: 0 !important;
    line-height: 1.3 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .ledger-alert-link {
    min-height: 24px !important;
    padding: 1px 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-log-summary-table {
    width: 700px !important;
    max-width: 100% !important;
    min-width: 640px !important;
    table-layout: fixed;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-log-summary-table :is(th, td):nth-child(1) {
    width: 190px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-log-summary-table :is(th, td):nth-child(2) {
    width: 120px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-log-summary-table :is(th, td):nth-child(3) {
    width: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-log-summary-table :is(th, td):nth-child(4) {
    width: 96px !important;
    text-align: right !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .login-audit-table {
    width: 100% !important;
    min-width: 960px !important;
    table-layout: fixed;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .login-audit-table :is(th, td):nth-child(1) { width: 150px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .login-audit-table :is(th, td):nth-child(2) { width: 130px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .login-audit-table :is(th, td):nth-child(3) { width: 110px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .login-audit-table :is(th, td):nth-child(4) { width: 150px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .login-audit-table :is(th, td):nth-child(5) { width: 190px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .login-audit-table :is(th, td):nth-child(6) { width: auto !important; }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .cashier-type-grid .inline-settings {
    grid-template-columns: minmax(180px, 420px) max-content !important;
    justify-content: start !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .cashier-type-grid .inline-settings input {
    width: 100% !important;
    min-width: 180px !important;
    max-width: 420px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main [data-system-library-form] input[name="url"] {
    width: 100% !important;
    max-width: 460px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-export-table td {
    height: auto !important;
    min-height: 36px !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main #contract-material-project-select {
    width: min(100%, 560px) !important;
    max-width: 560px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main #data-export-source {
    width: min(100%, 520px) !important;
    max-width: 520px !important;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .erp-main .enterprise-profile-form .form-grid > label.field-wide {
    grid-template-columns: 104px minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .enterprise-profile-form .form-grid > label.field-wide > span {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 10px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .enterprise-profile-form .form-grid > label.field-wide > input {
    min-width: 0 !important;
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table-shell {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table {
    width: max-content !important;
    min-width: var(--module-ledger-min-width, 960px) !important;
    display: table !important;
    table-layout: fixed !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table thead {
    display: table-header-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table tbody {
    display: table-row-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table tbody tr {
    position: static !important;
    display: table-row !important;
    height: 74px !important;
    min-height: 74px !important;
    padding: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table tbody td,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table tbody td:nth-child(n) {
    position: static !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 320px !important;
    height: auto !important;
    min-height: 0 !important;
    display: table-cell !important;
    padding: 4px 8px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: top !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table tbody td::before {
    display: none !important;
    content: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) :is(
    .flow-ledger-window .data-table-shell,
    .data-export-table-scroll
  ) {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .flow-ledger-window .data-table {
    width: max-content !important;
    min-width: max(100%, 1600px) !important;
    display: table !important;
    table-layout: fixed !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .data-export-table {
    width: max-content !important;
    min-width: 100% !important;
    display: table !important;
    table-layout: fixed !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) :is(
    .flow-ledger-window .data-table,
    .data-export-table
  ) thead {
    display: table-header-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) :is(
    .flow-ledger-window .data-table,
    .data-export-table
  ) tbody {
    display: table-row-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) :is(
    .flow-ledger-window .data-table,
    .data-export-table
  ) tbody tr {
    position: static !important;
    display: table-row !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) :is(
    .flow-ledger-window .data-table,
    .data-export-table
  ) tbody td,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) :is(
    .flow-ledger-window .data-table,
    .data-export-table
  ) tbody td:nth-child(n) {
    position: static !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    display: table-cell !important;
    padding: 4px 8px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) :is(
    .flow-ledger-window .data-table,
    .data-export-table
  ) tbody td::before {
    display: none !important;
    content: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .data-export-table tbody td {
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    vertical-align: top !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table {
    width: max-content !important;
    min-width: max(100%, var(--line-item-mobile-min-width, 920px)) !important;
    display: table !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-material {
    --line-item-mobile-min-width: 920px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-labor {
    --line-item-mobile-min-width: 1100px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .project-expense-line-table {
    --line-item-mobile-min-width: 1040px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table colgroup {
    display: table-column-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table col:nth-child(1) {
    width: 56px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table col:nth-child(n + 2) {
    width: 140px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-material col:nth-child(2) { width: 220px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-material col:nth-child(3) { width: 180px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-material col:nth-child(4) { width: 80px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-material col:nth-child(5),
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-material col:nth-child(6) { width: 110px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-material col:nth-child(7) { width: 120px !important; }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-labor col:nth-child(2) { width: 180px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-labor col:nth-child(3) { width: 260px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-labor col:nth-child(4) { width: 90px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-labor col:nth-child(5),
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-labor col:nth-child(6) { width: 110px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-labor col:nth-child(7) { width: 120px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .contract-line-table.is-labor col:nth-child(8) { width: 150px !important; }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .project-expense-line-table col:nth-child(2) { width: 140px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .project-expense-line-table col:nth-child(3) { width: 240px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .project-expense-line-table col:nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .project-expense-line-table col:nth-child(5),
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .project-expense-line-table col:nth-child(6) { width: 130px !important; }
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .project-expense-line-table col:nth-child(n + 7) { width: 150px !important; }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table thead {
    display: table-header-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table tbody {
    display: table-row-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table tfoot {
    display: table-footer-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table tr {
    position: static !important;
    display: table-row !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table :is(th, td),
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table tbody td:nth-child(n) {
    position: relative !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    display: table-cell !important;
    padding: 4px 6px !important;
    border-radius: 0 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .mobile-editable-table .line-item-table td::before {
    display: none !important;
    content: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table {
    width: 1434px !important;
    min-width: 1434px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table :is(th, td):nth-child(1),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(1) { width: 64px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table :is(th, td):nth-child(2),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(2) { width: 420px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table :is(th, td):nth-child(3),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table :is(th, td):nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table :is(th, td):nth-child(5),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table :is(th, td):nth-child(6),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(3),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(5),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(6) { width: 200px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table :is(th, td):nth-child(7),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .module-ledger-table col:nth-child(7) { width: 150px !important; }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table {
    width: 1782px !important;
    min-width: 1782px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table :is(th, td):nth-child(1),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(1) { width: 64px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table :is(th, td):nth-child(2),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table :is(th, td):nth-child(3),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(2),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(3) { width: 420px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table :is(th, td):nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(4) { width: 118px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table :is(th, td):nth-child(n + 5),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .module-ledger-table col:nth-child(n + 5) { width: 190px !important; }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table {
    width: 1434px !important;
    min-width: 1434px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(1) { width: 64px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(2) { width: 420px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(3),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(5),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(6) { width: 200px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(7) { width: 150px !important; }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger [data-project-preview].ledger-record-link {
    width: 100% !important;
    min-height: 0 !important;
    padding-block: 0 !important;
    align-items: flex-start !important;
    line-height: 1.3 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table {
    width: 1782px !important;
    min-width: 1782px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(1) { width: 64px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(2),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(3) { width: 420px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(4) { width: 118px !important; }
  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(n + 5) { width: 190px !important; }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table :is(.ledger-metric-link, .ledger-static-metric) {
    min-height: 22px !important;
    padding: 1px 0 !important;
    line-height: 1.25 !important;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  body[data-ui-theme="macos-workspace-v3"] .erp-main .boss-kpi-grid > :last-child {
    grid-column: 1 / -1 !important;
  }
}

/* Release audit: keep long submitted records reachable inside the mobile workspace. */
@media (max-width: 760px) {
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel.is-document-preview.is-approval-mode .flow-record-preview-layout,
  .flow-record-preview-panel.is-document-preview .flow-record-preview-layout {
    min-height: 0 !important;
    height: 100% !important;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel.is-document-preview.is-approval-mode .flow-record-preview-main,
  .flow-record-preview-panel.is-document-preview .flow-record-preview-main {
    min-height: 0 !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

/* Final desktop ledger geometry. Keep this last so legacy density declarations cannot resize it. */
@media (min-width: 761px) {
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table {
    width: 1256px !important;
    min-width: 1256px !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table :is(th, td):nth-child(1),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(1) { width: 56px !important; }
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table :is(th, td):nth-child(2),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(2) { width: 320px !important; }
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table :is(th, td):nth-child(3),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table :is(th, td):nth-child(4),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table :is(th, td):nth-child(5),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table :is(th, td):nth-child(6),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(3),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(4),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(5),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(6) { width: 190px !important; }
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table :is(th, td):nth-child(7),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table col:nth-child(7) { width: 120px !important; }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table {
    width: 1448px !important;
    min-width: 1448px !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table :is(th, td):nth-child(1),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(1) { width: 56px !important; }
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table :is(th, td):nth-child(2),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(2) { width: 300px !important; }
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table :is(th, td):nth-child(3),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(3) { width: 260px !important; }
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table :is(th, td):nth-child(4),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(4) { width: 112px !important; }
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table :is(th, td):nth-child(n + 5),
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table col:nth-child(n + 5) { width: 180px !important; }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .project-ledger .ledger-record-link {
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table .ledger-record-link {
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) :is(.project-ledger, .contract-ledger-table) :is(.ledger-metric-link, .ledger-static-metric) {
    min-height: 20px !important;
    padding-block: 0 !important;
    line-height: 1.2 !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table tbody tr {
    height: 34px !important;
    min-height: 34px !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table .table-action {
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 6px !important;
    line-height: 22px !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .project-ledger .module-ledger-table tbody tr {
    height: 74px !important;
    min-height: 74px !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .contract-ledger-table .module-ledger-table tbody tr {
    height: 94px !important;
    min-height: 94px !important;
  }
}

/* Final release boundary remediation: readable compact controls and status labels. */
body[data-ui-theme="macos-workspace-v3"] .construction-calendar-grid button,
body[data-ui-theme="macos-workspace-v3"] .construction-calendar-grid button span,
body[data-ui-theme="macos-workspace-v3"] .construction-calendar-today,
body[data-ui-theme="macos-workspace-v3"] .construction-calendar-week span,
body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-metrics .metric-card :is(span, small),
body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-status,
body[data-ui-theme="macos-workspace-v3"] .dashboard-lane-head span,
body[data-ui-theme="macos-workspace-v3"] .dashboard-invoice-row :is(span, b),
body[data-ui-theme="macos-workspace-v3"] .material-contract-reference b,
body[data-ui-theme="macos-workspace-v3"] .module-ledger-table-shell {
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-controls button,
body[data-ui-theme="macos-workspace-v3"] .construction-calendar-today {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-controls .construction-calendar-today {
  width: auto !important;
  min-width: 44px !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .system-content-records article > div > span {
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .line-table-head button {
  min-height: 32px !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] :is(.cashier-pending-badge, .contract-type-pill, .material-contract-meta b) {
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .table-action.amount-link {
  height: 28px !important;
  min-height: 28px !important;
  line-height: 26px !important;
}

html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table .table-action.amount-link {
  height: 28px !important;
  min-height: 28px !important;
  line-height: 26px !important;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .construction-calendar-controls button,
  body[data-ui-theme="macos-workspace-v3"] .construction-calendar-today,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .line-table-head button,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .table-action.amount-link {
    height: 44px !important;
    min-height: 44px !important;
  }
}

/* Final interaction and mobile operability remediation. */
body[data-ui-theme="macos-workspace-v3"] .contract-ledger-group-switch > button {
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  html body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions :is(#save-draft, #submit-flow),
  html body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-actions .table-action {
    height: 44px !important;
    min-height: 44px !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .construction-calendar-controls button,
  html body[data-ui-theme="macos-workspace-v3"] .construction-calendar-controls .construction-calendar-today {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .construction-calendar-controls .construction-calendar-today {
    width: auto !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) .module-ledger-table .table-action.amount-link {
    height: 44px !important;
    min-height: 44px !important;
    line-height: 42px !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .contract-ledger-group-switch {
    max-width: 100% !important;
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: max-content !important;
    justify-content: start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* System confirmation dialog final authority. */
.system-confirmation-dialog {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 16px !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
}

.system-confirmation-dialog[open] {
  display: grid !important;
  place-items: center !important;
}

.system-confirmation-card {
  width: min(calc(100vw - 32px), 440px) !important;
  min-width: 0 !important;
  max-height: min(calc(100dvh - 32px), 620px) !important;
  overflow: auto !important;
}

.system-confirmation-actions button {
  min-height: 38px !important;
}

@media (max-width: 760px) {
  .system-confirmation-dialog {
    padding: 12px !important;
  }

  .system-confirmation-card {
    width: min(calc(100vw - 24px), 440px) !important;
    max-height: min(calc(100dvh - 24px), 620px) !important;
  }

  .system-confirmation-actions button {
    min-height: 44px !important;
  }
}

/* Final mobile attachment queue boundary remediation. */
@media (max-width: 760px) {
  html body[data-ui-theme="macos-workspace-v3"] .queued-attachment-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 2px !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .queued-attachment-head strong {
    min-width: max-content !important;
    white-space: nowrap !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .queued-attachment-head span {
    min-width: 0 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
  }
}

/* Final project preview scroll safety. */
body[data-ui-theme="macos-workspace-v3"] .project-preview-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel > .dashboard-preview-metrics {
  align-self: start !important;
  align-content: start !important;
  grid-auto-rows: minmax(58px, auto) !important;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel > .dashboard-preview-metrics .context-card > span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel > .dashboard-preview-metrics .context-card > :is(strong, small) {
  min-width: 0 !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel > .dashboard-preview-metrics .context-card > strong {
  -webkit-line-clamp: 2 !important;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel > .dashboard-preview-metrics .context-card > small {
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel > .project-preview-body {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel > .dashboard-preview-actions {
  position: static !important;
  inset: auto !important;
  margin-top: 0 !important;
}

/* Final accessibility contrast and target remediation. */
body[data-ui-theme="macos-workspace-v3"] .workbench-status-group.blue {
  background: #3976bd !important;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-status-group.coral {
  background: #b84f53 !important;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-status-group.violet {
  background: #5359b5 !important;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-status-group.teal {
  background: #167f72 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-attachments-button {
  color: #fff !important;
  background: #0879a6 !important;
  border-color: #0879a6 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #save-draft {
  color: #1d2129 !important;
}

body[data-ui-theme="macos-workspace-v3"] .cashier-pending-badge {
  color: #1d2129 !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] :is(.ledger-record-cell small, .cashier-empty-workspace p) {
  color: #68717d !important;
}

@media (min-width: 761px) {
  html body[data-ui-theme="macos-workspace-v3"] .erp-main .view-root:not(.workbench-page) :is(.project-ledger, .contract-ledger-table) :is(.ledger-metric-link, .ledger-static-metric) {
    min-height: 24px !important;
    display: flex !important;
    align-items: center !important;
  }
}
