/* Reference-style operational forms: dense business documents, not decorative cards. */
:root {
  --operational-document-width: 1120px;
  --operational-form-width: 1180px;
  --operational-form-label: 122px;
  --operational-form-row: 42px;
  --operational-form-section: #edf2f7;
  --operational-form-label-bg: #f7f9fb;
  --operational-form-line: #d8e0e9;
}

/* Flow ledger document preview authority 2026-08-29 */
.flow-record-preview-panel.is-document-preview {
  width: min(1180px, calc(100vw - 32px));
  max-width: 1180px;
  height: min(900px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: #1d2129;
  background: #f6f8fa;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 52, 118, 0.14);
}

.flow-record-preview-backdrop.is-workspace .flow-record-preview-panel.is-document-preview {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
  min-height: 88px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) minmax(190px, 250px) max-content;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid #dfe4ea;
}

.flow-record-preview-panel.is-document-preview .flow-preview-status-zone {
  display: flex;
  align-items: center;
}

.flow-record-preview-panel.is-document-preview .flow-approval-status-chip {
  min-width: 64px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  color: #0f3476;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  background: #eef5ff;
  border: 1px solid #b9d3f7;
  border-radius: 6px;
}

.flow-record-preview-panel.is-document-preview .flow-approval-title-block,
.flow-record-preview-panel.is-document-preview .flow-approval-title-block > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.flow-record-preview-panel.is-document-preview .flow-approval-title-block small {
  color: #6e7681;
  font-size: 12px;
  line-height: 1.4;
}

.flow-record-preview-panel.is-document-preview .flow-approval-title-block strong {
  min-width: 0;
  color: #1d2129;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.flow-record-preview-panel.is-document-preview .flow-approval-title-block p {
  margin: 0;
  color: #6e7681;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.flow-record-preview-panel.is-document-preview .flow-approval-header-amount {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 2px;
  padding-left: 14px;
  text-align: right;
  border-left: 1px solid #e5e9ee;
}

.flow-record-preview-panel.is-document-preview .flow-record-document-number,
.flow-record-preview-panel.is-document-preview .flow-approval-amount-note {
  max-width: 100%;
  color: #6e7681;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.flow-record-preview-panel.is-document-preview .flow-approval-header-amount > strong {
  color: #1d2129;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.flow-record-preview-panel.is-document-preview > .flow-record-preview-head > [data-flow-record-preview-close] {
  align-self: start;
  min-width: 54px;
  min-height: 34px;
}

.flow-record-preview-panel.is-document-preview .flow-record-preview-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.flow-record-preview-panel.is-document-preview .flow-record-preview-layout.has-approval-workbench {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.flow-record-preview-panel.is-document-preview .flow-record-preview-main {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #f6f8fa;
}

.flow-record-preview-panel.is-document-preview .flow-approval-document {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(29, 33, 41, 0.06);
}

.flow-readonly-document {
  min-width: 0;
  display: grid;
  gap: 0;
}

.flow-readonly-document .flow-approval-content-section,
.flow-readonly-document .flow-approval-focus,
.flow-readonly-document .flow-approval-main-checks {
  min-width: 0;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #dfe4ea;
  border-radius: 0;
  box-shadow: none;
}

.flow-readonly-document > :last-child {
  border-bottom: 0;
}

.flow-readonly-document .flow-approval-content-section > header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #eef2f6;
  border: 0;
  border-bottom: 1px solid #dfe4ea;
}

.flow-readonly-document .flow-approval-content-section > header strong {
  min-width: 0;
  color: #1d2129;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.flow-readonly-document .flow-approval-content-section > header span {
  min-width: 0;
  color: #6e7681;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: right;
  overflow-wrap: anywhere;
}

.flow-readonly-document .flow-approval-context-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  background: #fff;
  border: 0;
  border-radius: 0;
}

.flow-readonly-document .flow-approval-context-strip > div {
  min-width: 0;
  min-height: 46px;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: center;
  gap: 0 10px;
  padding: 7px 12px;
  border-right: 1px solid #e5e9ee;
  border-bottom: 1px solid #e5e9ee;
}

.flow-readonly-document .flow-approval-context-strip > div:nth-child(2n) {
  border-right: 0;
}

.flow-readonly-document .flow-approval-context-strip > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.flow-readonly-document .flow-approval-context-strip > div > span {
  color: #4e5969;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: right;
}

.flow-readonly-document .flow-approval-context-strip > div > strong {
  min-width: 0;
  color: #1d2129;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.flow-readonly-document .flow-approval-context-strip > div > small {
  min-width: 0;
  grid-column: 2;
  color: #86909c;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.flow-readonly-document .flow-approval-business-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
}

.flow-readonly-document .flow-approval-business-details > div {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: stretch;
  border-right: 1px solid #e5e9ee;
  border-bottom: 1px solid #e5e9ee;
}

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

.flow-readonly-document .flow-approval-business-details > div.is-wide {
  grid-column: 1 / -1;
}

.flow-readonly-document .flow-approval-business-details dt,
.flow-readonly-document .flow-approval-business-details dd {
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.flow-readonly-document .flow-approval-business-details dt {
  color: #4e5969;
  font-weight: 600;
  text-align: right;
  background: transparent;
  border-right: 1px solid #e5e9ee;
}

.flow-readonly-document .flow-approval-business-details dd {
  color: #1d2129;
  font-weight: 500;
  background: #fff;
}

.flow-readonly-document .flow-approval-detail-section .empty-state,
.flow-readonly-document .flow-approval-attachments-section .empty-state {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #6e7681;
  font-size: 13px;
}

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

.flow-readonly-document .flow-approval-account-section dl > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-right: 1px solid #e5e9ee;
}

.flow-readonly-document .flow-approval-account-section dl > div:last-child {
  border-right: 0;
}

.flow-readonly-document .flow-approval-account-section :is(dt, dd) {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.flow-readonly-document .flow-approval-account-section dt {
  color: #6e7681;
}

.flow-readonly-document .flow-approval-account-section dd {
  color: #1d2129;
  font-weight: 600;
}

.flow-readonly-document .flow-approval-line-items-section > :not(header),
.flow-readonly-document .flow-approval-content-section > .data-table-shell,
.flow-readonly-document .flow-approval-content-section > .responsive-table {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.flow-readonly-document :is(.data-table, table) {
  font-size: 13px;
}

.flow-readonly-document :is(.data-table, table) :is(th, td) {
  min-height: 36px;
  padding: 7px 10px;
  line-height: 1.45;
  vertical-align: middle;
}

.flow-readonly-document .flow-approval-attachment-list {
  margin: 0;
  padding: 10px 14px;
}

.flow-readonly-document .flow-approval-timeline-list {
  padding: 12px 14px 16px;
}

.flow-record-preview-panel.is-document-preview .flow-preview-action-bar {
  min-height: 56px;
  margin: 0;
  padding: 8px 14px;
  background: #fff;
  border-top: 1px solid #dfe4ea;
}

.flow-record-preview-panel.is-document-preview .flow-approval-workbench {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid #dfe4ea;
}

@media (max-width: 980px) {
  .flow-record-preview-panel.is-document-preview .flow-record-preview-layout.has-approval-workbench {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }

  .flow-record-preview-panel.is-document-preview .flow-record-preview-layout.has-approval-workbench .flow-record-preview-main {
    overflow: visible;
  }

  .flow-record-preview-panel.is-document-preview .flow-approval-workbench {
    overflow: visible;
    border-top: 1px solid #dfe4ea;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .flow-record-preview-panel.is-document-preview {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

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

  .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;
    min-width: 48px;
    min-height: 44px;
  }

  .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-approval-title-block strong {
    font-size: 16px;
  }

  .flow-record-preview-panel.is-document-preview .flow-approval-header-amount {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 10px;
    padding: 8px 0 0;
    text-align: left;
    border-top: 1px solid #e5e9ee;
    border-left: 0;
  }

  .flow-record-preview-panel.is-document-preview .flow-approval-header-amount > strong {
    order: -1;
    flex: 1 1 100%;
    font-size: 17px;
  }

  .flow-record-preview-panel.is-document-preview .flow-record-preview-main {
    padding: 8px;
    scrollbar-gutter: auto;
  }

  .flow-record-preview-panel.is-document-preview .flow-approval-document {
    width: 100%;
    border-radius: 6px;
  }

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

  .flow-readonly-document .flow-approval-context-strip > div,
  .flow-readonly-document .flow-approval-context-strip > div:nth-child(2n),
  .flow-readonly-document .flow-approval-context-strip > div:nth-last-child(-n + 2) {
    grid-template-columns: 96px minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid #e5e9ee;
  }

  .flow-readonly-document .flow-approval-context-strip > div:last-child {
    border-bottom: 0;
  }

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

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

  .flow-readonly-document .flow-approval-business-details dt,
  .flow-readonly-document .flow-approval-business-details dd {
    padding: 9px 10px;
    font-size: 13px;
  }

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

  .flow-readonly-document .flow-approval-account-section dl > div {
    border-right: 0;
    border-bottom: 1px solid #e5e9ee;
  }

  .flow-readonly-document .flow-approval-account-section dl > div:last-child {
    border-bottom: 0;
  }

  .flow-readonly-document .flow-approval-content-section > header {
    align-items: flex-start;
    padding: 8px 10px;
  }

  .flow-record-preview-panel.is-document-preview .flow-preview-action-bar {
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  }
}

/* Construction log document workspace authority 2026-08-30.
 * Keep the daily entry surface aligned with the fixed flow-document geometry.
 */
body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace {
  width: min(100%, var(--operational-document-width));
  max-width: var(--operational-document-width);
  display: grid;
  gap: 8px;
  margin-inline: auto;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace > .panel {
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  border: 1px solid #d9e0e7 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(15, 52, 118, 0.06) !important;
  overflow: hidden;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace .panel-title {
  min-height: 44px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 5px 10px !important;
  border-bottom: 1px solid #dfe5eb !important;
  background: #f7f9fb !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace .panel-title strong {
  color: #1d2129 !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-header-controls {
  min-width: 0 !important;
  width: min(680px, 100%) !important;
  display: grid !important;
  grid-template-columns: minmax(320px, 1fr) 270px !important;
  justify-content: end !important;
  gap: 8px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-header-controls > label {
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-header-controls > label > span {
  min-height: 0 !important;
  color: #4e5969 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-header-controls select {
  width: 100% !important;
  max-width: none !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 28px 0 8px !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-layout {
  display: grid !important;
  grid-template-columns: 248px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 8px !important;
  padding: 8px !important;
  border-top: 0 !important;
  background: #f4f6f8 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-calendar,
body[data-ui-theme="macos-workspace-v3"] .construction-log-form {
  min-width: 0 !important;
  padding: 8px !important;
  border: 1px solid #d9e0e7 !important;
  border-radius: 4px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-calendar {
  position: sticky;
  top: 8px;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-toolbar {
  min-height: 32px !important;
  gap: 6px !important;
  margin-bottom: 5px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-title > span {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-title strong {
  font-size: 14px !important;
  line-height: 1.25 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-controls {
  gap: 3px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-controls button {
  width: 26px !important;
  height: 26px !important;
  min-height: 26px !important;
  border-radius: 4px !important;
  font-size: 14px !important;
}

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

body[data-ui-theme="macos-workspace-v3"] :is(.construction-calendar-week, .construction-calendar-grid) {
  gap: 3px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-week {
  margin-bottom: 3px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-week span {
  min-height: 18px !important;
  font-size: 10px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-grid button {
  min-height: 26px !important;
  aspect-ratio: 1 !important;
  border-radius: 4px !important;
  font-size: 11px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-calendar-selection {
  min-height: 28px !important;
  gap: 5px !important;
  margin-top: 6px !important;
  padding-top: 6px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-share-actions {
  gap: 5px !important;
  margin-top: 6px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-share-actions .table-action {
  min-height: 30px !important;
  padding: 4px 7px !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form > .flow-section-title:first-of-type {
  min-height: 30px !important;
  margin: 0 !important;
  padding: 4px 8px !important;
  border: 1px solid #d9e0e7 !important;
  border-bottom: 0 !important;
  color: #1d2129 !important;
  background: #eef3f8 !important;
  font-size: 13px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-edit-window {
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid #d9e0e7;
  border-bottom: 0;
  color: #31547a;
  background: #f4f8fc;
  font-size: 11px;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-edit-window.is-locked {
  color: #8a5200;
  background: #fff8e8;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-grid.compact {
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  justify-content: stretch !important;
  gap: 0 !important;
  padding: 0 !important;
  border-top: 1px solid #d9e0e7 !important;
  border-left: 1px solid #d9e0e7 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-grid.compact > label {
  width: 100% !important;
  max-width: none !important;
  min-height: 38px !important;
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-right: 1px solid #d9e0e7 !important;
  border-bottom: 1px solid #d9e0e7 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-grid.compact > label > span {
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 5px 8px !important;
  border-right: 1px solid #e5e9ee !important;
  color: #1d2129 !important;
  background: transparent !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-align: right !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-grid.compact > label :is(input, select, textarea) {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #1d2129 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-grid.compact > label :is(input, select) {
  height: 37px !important;
  min-height: 37px !important;
  padding: 0 8px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .construction-log-field {
  grid-column: auto !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 70px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .construction-log-field textarea {
  min-height: 69px !important;
  padding: 7px 8px !important;
  resize: vertical;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .construction-log-upload-field {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) !important;
  gap: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-right: 1px solid #d9e0e7 !important;
  border-bottom: 1px solid #d9e0e7 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-upload-label {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  margin: 0 !important;
  padding: 5px 8px !important;
  border-right: 1px solid #e5e9ee !important;
  color: #1d2129 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-align: right;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-upload-row {
  min-height: 42px !important;
  gap: 6px 8px !important;
  padding: 5px 8px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-upload-row > small {
  color: #6e7681 !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-actions {
  min-height: 40px !important;
  margin: 6px 0 0 !important;
  padding: 4px 0 0 !important;
  border-top: 1px solid #e5e9ee !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-actions .table-action {
  min-height: 32px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-photo-section {
  margin-top: 6px !important;
  padding: 6px !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-panel .panel-title,
body[data-ui-theme="macos-workspace-v3"] .construction-log-history .panel-title {
  min-height: 38px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-month {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-month > span {
  color: #4e5969 !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-month input {
  width: 132px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 7px !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  padding: 0 !important;
  border-bottom: 1px solid #dfe5eb !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-metrics .metric-card {
  min-height: 54px !important;
  gap: 1px !important;
  padding: 5px 9px !important;
  border: 0 !important;
  border-right: 1px solid #e5e9ee !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-metrics .metric-card:last-child {
  border-right: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-metrics .metric-card :is(span, small) {
  font-size: 11px !important;
  line-height: 1.2 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-metrics .metric-card strong {
  font-size: 17px !important;
  line-height: 1.2 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-panel > .data-table-shell {
  max-height: 320px !important;
  overflow: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace :is(.construction-log-summary-table, .construction-log-history .data-table) :is(th, td) {
  height: 30px !important;
  min-height: 30px !important;
  padding: 4px 7px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-history > .data-table-shell {
  max-height: 260px !important;
  overflow: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] .construction-log-lock-status {
  color: #6e7681;
  font-size: 11px;
  white-space: nowrap;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace > .panel,
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(.construction-log-calendar, .construction-log-form),
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-metrics .metric-card {
  color: #f2f4f7 !important;
  background: #18212d !important;
  border-color: #34404f !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace :is(.panel-title, .construction-log-form > .flow-section-title:first-of-type) {
  color: #f2f4f7 !important;
  background: #202c3a !important;
  border-color: #34404f !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-grid.compact > label > span,
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .construction-log-upload-label {
  color: #f2f4f7 !important;
  border-color: #34404f !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-grid.compact > label :is(input, select, textarea) {
  color: #f2f4f7 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .construction-log-edit-window {
  color: #b9ddff;
  background: #1b2b3d;
  border-color: #34404f;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .construction-log-edit-window.is-locked {
  color: #ffd58a;
  background: #352b19;
}

@media (max-width: 900px) {
  body[data-ui-theme="macos-workspace-v3"] .construction-log-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-calendar {
    position: static !important;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace {
    width: 100% !important;
    gap: 6px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace > .panel {
    border-radius: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-document-workspace .panel-title {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    padding: 6px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-header-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-header-controls > label {
    grid-template-columns: 72px minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-header-controls select {
    width: 100% !important;
    max-width: none !important;
    min-height: 40px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
    padding: 6px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-form {
    order: 1;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-calendar {
    order: 2;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-grid.compact {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-form .form-grid.compact > label,
  body[data-ui-theme="macos-workspace-v3"] .construction-log-form .construction-log-upload-field {
    grid-column: auto !important;
    grid-template-columns: 82px minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-metrics .metric-card:nth-child(2) {
    border-right: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .construction-log-summary-month input {
    min-height: 40px !important;
  }
}

:root[data-color-scheme="dark"] .flow-record-preview-panel.is-document-preview {
  color: #f2f4f7;
  background: #121923;
  border-color: #34404f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}

:root[data-color-scheme="dark"] .flow-record-preview-panel.is-document-preview > .flow-record-preview-head,
:root[data-color-scheme="dark"] .flow-record-preview-panel.is-document-preview .flow-record-preview-main,
:root[data-color-scheme="dark"] .flow-record-preview-panel.is-document-preview .flow-approval-document,
:root[data-color-scheme="dark"] .flow-record-preview-panel.is-document-preview .flow-preview-action-bar,
:root[data-color-scheme="dark"] .flow-record-preview-panel.is-document-preview .flow-approval-workbench,
:root[data-color-scheme="dark"] .flow-readonly-document .flow-approval-content-section,
:root[data-color-scheme="dark"] .flow-readonly-document .flow-approval-focus,
:root[data-color-scheme="dark"] .flow-readonly-document .flow-approval-main-checks,
:root[data-color-scheme="dark"] .flow-readonly-document .flow-approval-context-strip,
:root[data-color-scheme="dark"] .flow-readonly-document .flow-approval-business-details dd {
  color: #f2f4f7;
  background: #18212d;
  border-color: #34404f;
}

:root[data-color-scheme="dark"] .flow-readonly-document .flow-approval-content-section > header {
  background: #202c3a;
  border-color: #34404f;
}

:root[data-color-scheme="dark"] .flow-record-preview-panel.is-document-preview :is(
  .flow-approval-title-block strong,
  .flow-approval-header-amount > strong,
  .flow-approval-content-section > header strong,
  .flow-approval-context-strip > div > strong,
  .flow-approval-business-details dd,
  .flow-approval-account-section dd
) {
  color: #f2f4f7;
}

:root[data-color-scheme="dark"] .flow-record-preview-panel.is-document-preview :is(
  .flow-approval-title-block small,
  .flow-approval-title-block p,
  .flow-record-document-number,
  .flow-approval-amount-note,
  .flow-approval-content-section > header span,
  .flow-approval-context-strip > div > span,
  .flow-approval-context-strip > div > small,
  .flow-approval-business-details dt,
  .flow-approval-account-section dt
) {
  color: #b8c2cf;
}

:root[data-color-scheme="dark"] .flow-readonly-document :is(
  .flow-approval-context-strip > div,
  .flow-approval-business-details > div,
  .flow-approval-business-details dt,
  .flow-approval-account-section dl > div
) {
  border-color: #34404f;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker):has(#flow-form) > .erp-flow-launch-dialog-shell {
  width: min(calc(100vw - 36px), 1240px) !important;
  max-width: 1240px !important;
  height: min(calc(100vh - 36px), 920px) !important;
  max-height: 920px !important;
  overflow: hidden !important;
  border-radius: 8px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-head {
  min-height: 54px !important;
  padding: 0 16px !important;
  flex: 0 0 54px;
  border-bottom: 1px solid var(--operational-form-line) !important;
  box-shadow: none !important;
}

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

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-body.is-form {
  min-height: 0;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: var(--enterprise-surface-soft) !important;
}

body[data-ui-theme="macos-workspace-v3"] .cashier-scope-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: #667085;
  font-size: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .cashier-scope-summary span {
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .cashier-scope-summary b {
  color: #18488f;
  font-size: 13px;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .cashier-overview-panel > .panel-title {
    align-items: flex-start;
  }

  body[data-ui-theme="macos-workspace-v3"] .cashier-scope-summary {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .cashier-scope-summary .table-action {
    min-height: 44px;
  }
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-form {
  width: 100%;
  max-width: none !important;
  min-height: 100%;
  padding: 10px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-form {
  width: min(100%, var(--operational-form-width)) !important;
  max-width: var(--operational-form-width) !important;
  min-height: 100%;
  margin: 0 auto !important;
  display: block !important;
  overflow: visible !important;
  background: var(--enterprise-surface) !important;
  border: 1px solid var(--operational-form-line) !important;
  border-radius: 5px !important;
  box-shadow: 0 5px 18px rgba(20, 34, 52, 0.08) !important;
}

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

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

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

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

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

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-template-slot {
  min-width: 0;
  display: flex;
  align-items: center;
}

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

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-record-document-number {
  color: var(--enterprise-text-secondary) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-number {
  min-width: 0;
  min-height: 34px !important;
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) !important;
  align-items: stretch;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  background: var(--enterprise-surface) !important;
  border: 1px solid var(--operational-form-line) !important;
  border-radius: 4px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-number > span {
  min-width: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--enterprise-text-secondary) !important;
  background: var(--operational-form-label-bg) !important;
  border-right: 1px solid var(--operational-form-line);
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-number > input {
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  color: var(--enterprise-text) !important;
  background: var(--enterprise-surface) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 680 !important;
  text-align: center;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-template-tools {
  position: relative;
  min-width: 88px;
  margin: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-template-tools > summary {
  min-height: 36px !important;
  padding: 0 12px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--operational-form-line) !important;
  border-radius: 4px !important;
  font-size: 13px !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 {
  width: 100% !important;
  min-width: 0 !important;
  display: block !important;
  overflow: visible !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-task-rail {
  display: none !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: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: none !important;
  grid-auto-flow: row !important;
  grid-auto-rows: max-content !important;
  gap: 0 !important;
  align-items: stretch !important;
  border: 0 !important;
  border-radius: 0 !important;
}

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

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-section-label {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 34px !important;
  margin: 8px 0 0 !important;
  padding: 0 12px !important;
  display: flex !important;
  align-items: center;
  color: #1d3557 !important;
  background: var(--operational-form-section) !important;
  border: 0 !important;
  border-top: 1px solid var(--operational-form-line) !important;
  border-bottom: 1px solid var(--operational-form-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

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

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label:not(.field-wide),
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > .flow-related-field {
  min-width: 0 !important;
  width: 100% !important;
  min-height: var(--operational-form-row) !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: 122px minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 0 !important;
  overflow: visible !important;
  background: var(--enterprise-surface) !important;
  border: 0 !important;
  border-right: 1px solid var(--operational-form-line) !important;
  border-bottom: 1px solid var(--operational-form-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label.field-wide, .attachment-upload-control, .contract-lines) {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label.field-wide {
  min-height: 76px !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: var(--operational-form-label) minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 0 !important;
  background: var(--enterprise-surface) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--operational-form-line) !important;
  border-radius: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label > span:first-child,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-field > span:first-child {
  min-width: 0 !important;
  min-height: 100% !important;
  padding: 8px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  color: var(--enterprise-text-secondary) !important;
  background: var(--operational-form-label-bg) !important;
  border: 0 !important;
  border-right: 1px solid var(--operational-form-line) !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-align: right !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

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
) {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: var(--operational-form-row) !important;
  min-height: var(--operational-form-row) !important;
  margin: 0 !important;
  padding: 0 12px !important;
  color: var(--enterprise-text) !important;
  background: var(--enterprise-surface) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid textarea {
  grid-column: 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 76px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  color: var(--enterprise-text) !important;
  background: var(--enterprise-surface) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  resize: vertical;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid :is(input[readonly], textarea[readonly], .readonly-link) {
  color: var(--enterprise-text-secondary) !important;
  background: var(--enterprise-surface-soft) !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: 2;
  outline: 2px solid var(--enterprise-accent) !important;
  outline-offset: -2px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-chips {
  grid-column: 1 / -1 !important;
  padding: 6px 10px !important;
  border-top: 1px solid var(--operational-form-line);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .line-table-head {
  min-height: 42px !important;
  padding: 6px 10px !important;
  background: var(--operational-form-label-bg) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--operational-form-line) !important;
  border-radius: 0 !important;
}

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

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

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .business-line-table :is(th, td) {
  min-height: 38px !important;
  padding: 5px 7px !important;
  border-color: var(--operational-form-line) !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

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

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .attachment-upload-control > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--enterprise-text) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions {
  position: sticky !important;
  z-index: 12 !important;
  bottom: 0 !important;
  width: 100% !important;
  min-height: 58px !important;
  margin: 0 !important;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom)) !important;
  display: grid !important;
  grid-template-columns: 116px 116px minmax(140px, 1fr) !important;
  justify-content: end !important;
  gap: 8px !important;
  background: color-mix(in srgb, var(--enterprise-surface) 96%, transparent) !important;
  border-top: 1px solid var(--operational-form-line) !important;
  box-shadow: 0 -5px 14px rgba(20, 34, 52, 0.07) !important;
  backdrop-filter: blur(12px);
}

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

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #submit-flow {
  justify-self: end;
  width: 148px;
}

:root[data-color-scheme="dark"] {
  --operational-form-section: #26364b;
  --operational-form-label-bg: #1f2937;
  --operational-form-line: #3c4b5e;
}

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

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head > .flow-approval-header-amount {
    flex-wrap: wrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-record-document-number {
    width: 100%;
    order: -1;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker):has(#flow-form) > .erp-flow-launch-dialog-shell {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }

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

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-form {
    width: 100% !important;
    max-width: none !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) .flow-document-head {
    min-height: 46px !important;
    padding: 6px 8px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-identity {
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
  }

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

  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 > label:not(.field-wide),
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label.field-wide,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > .flow-related-field {
    grid-column: 1 !important;
    grid-template-columns: 104px minmax(0, 1fr) !important;
    border-right: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label > span:first-child,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-field > span:first-child {
    padding: 8px !important;
    font-size: 13px !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: 46px !important;
    min-height: 46px !important;
    padding-inline: 10px !important;
    font-size: 16px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid textarea {
    min-height: 88px !important;
    font-size: 16px !important;
  }

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

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions {
    min-height: 64px !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    padding: 8px calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions > button,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #submit-flow {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    font-size: 14px !important;
  }
}

/* Related-flow picker density authority 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] .related-flow-picker {
  width: min(1100px, calc(100vw - 32px)) !important;
  min-width: 0 !important;
  height: min(780px, calc(100dvh - var(--reference-header, 56px) - 24px)) !important;
  max-width: 1100px !important;
  max-height: min(780px, calc(100dvh - var(--reference-header, 56px) - 24px)) !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  align-content: stretch !important;
  overflow: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-toolbar {
  min-width: 0;
  min-height: 0;
  height: auto !important;
  padding: 10px 14px;
  align-self: start;
  align-items: end;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-toolbar label {
  width: min(520px, 100%);
  min-width: 0;
  gap: 4px;
}

body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-toolbar input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-toolbar small {
  max-width: 30em;
  line-height: 1.4;
  text-align: right;
}

body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-list {
  min-width: 0;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: 8px 10px;
  overflow: auto;
  scrollbar-gutter: stable;
}

body[data-ui-theme="macos-workspace-v3"] .related-flow-option {
  min-height: 56px;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .related-flow-picker > .dashboard-preview-actions {
  min-height: 56px;
  height: auto;
  position: relative;
  inset: auto;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-backdrop {
    padding: 0 !important;
  }

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

  body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-toolbar {
    padding: 9px 12px;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-toolbar label,
  body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-toolbar small {
    width: 100%;
    max-width: none;
    text-align: left;
  }

  body[data-ui-theme="macos-workspace-v3"] .related-flow-picker-list {
    padding: 8px;
  }
}

/* Mobile flow action geometry authority 2026-08-26 */
@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions {
    width: calc(100vw - 16px) !important;
    min-width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box;
  }
}

/* Workspace preview mobile header authority 2026-08-26 */
@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel.is-approval-mode .flow-approval-header-amount {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "document"
      "amount-value"
      "amount-note";
    justify-items: end;
    gap: 2px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel.is-approval-mode .flow-record-document-number {
    grid-area: document;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel.is-approval-mode .flow-approval-header-amount > strong {
    grid-area: amount-value;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel.is-approval-mode .flow-approval-amount-note {
    grid-area: amount-note;
  }
}

/* Keep this last: visible-field layouts must never override semantic hidden state. */
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label[hidden],
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > .flow-related-field[hidden],
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > [hidden],
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid [hidden] {
  display: none !important;
}

/* Flow preview header geometry authority 2026-08-26 */
@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head {
    min-height: 104px !important;
    align-items: center !important;
    gap: 18px !important;
    padding: 16px 22px !important;
    overflow: hidden !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block,
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block > div {
    min-width: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block strong {
    min-width: 0;
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--enterprise-text) !important;
    font-size: 19px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
    white-space: normal !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-header-amount {
    min-width: 0 !important;
    max-width: 320px;
    padding-left: 18px !important;
    overflow: hidden;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-record-document-number {
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-align: right;
    white-space: normal !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-header-amount > strong {
    max-width: 100%;
    color: var(--enterprise-text) !important;
    font-size: 30px !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head > [data-flow-record-preview-close] {
    width: auto !important;
    min-width: 88px !important;
    min-height: 38px !important;
    padding: 0 14px !important;
    justify-self: end;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Preview text boundary authority: keep this last so legacy preview rules cannot clip it. */
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block,
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip > div {
  min-width: 0;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip > div > :is(strong, small) {
  max-width: 100%;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block > div > :is(strong, p) {
    width: 100%;
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (min-width: 1501px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px) 92px !important;
  }
}

@media (min-width: 761px) and (max-width: 1500px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head {
    grid-template-columns: minmax(0, 1fr) 92px !important;
    grid-template-areas:
      "preview-title preview-close"
      "preview-amount preview-amount";
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head > .flow-approval-title-block {
    grid-area: preview-title;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head > .flow-approval-header-amount {
    width: 100%;
    max-width: none;
    grid-area: preview-amount;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: baseline;
    gap: 10px;
    padding: 10px 0 0 !important;
    border-top: 1px solid var(--enterprise-border);
    border-left: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head > [data-flow-record-preview-close] {
    grid-area: preview-close;
  }
}

/* Dark workspace contrast authority 2026-08-26 */
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .ledger-metric-link,
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .ledger-metric-link > :is(span, strong) {
  color: #dfe7f2 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-ledger-toolbar label > span,
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-ledger-count {
  color: #cbd5e1 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-ledger-toolbar {
  background: #273342 !important;
  border-color: #465569 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-ledger-toolbar :is(input, select) {
  color: #f3f6fb !important;
  background: #1f2937 !important;
  border-color: #526176 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .workspace-tab-close {
  color: #cbd5e1 !important;
}

@media (max-width: 760px) {
  :root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary],
  :root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav #mobile-more-toggle,
  :root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary] .module-nav-label {
    color: #cbd5e1 !important;
  }

  :root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary]:is(.is-active, [aria-current="page"]),
  :root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav #mobile-more-toggle:is(.is-active, [aria-expanded="true"]) {
    color: #8fc6ff !important;
  }
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .cashier-type-remove,
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .cashier-type-remove > span {
  color: #ff817b !important;
}

/* Final dark-mode contrast authority 2026-08-28 */
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] #global-search {
  background: #222b36 !important;
  color: #f3f6f9 !important;
  border-color: #526176 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] #global-search::placeholder {
  color: #b9c4cf !important;
  opacity: 1 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(.workspace-tab-activate, .module-subnav > button, .workbench-flow-status-button) {
  color: #b9c4cf !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .workspace-tab.is-active .workspace-tab-activate {
  color: #dcecff !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .workbench-flow-status-button.is-active {
  color: #dcecff !important;
  background: #173d69 !important;
  border-color: #4d739c !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .workbench-flow-status-button.is-active strong {
  color: #dcecff !important;
}

body[data-ui-theme="macos-workspace-v3"] :is(.flow-ledger-toolbar label > span, .flow-ledger-count) {
  color: #5f6d7b !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(.flow-ledger-toolbar label > span, .flow-ledger-count) {
  color: #cbd5e1 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .ledger-alert-link,
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .ledger-secondary-stat {
  color: #dfe7f2 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .data-export-heading-stats span {
  color: #dfe7f2 !important;
  background: #273342 !important;
  border-color: #465569 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .data-export-heading-stats b {
  color: #8edbd6 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .approval-template-list > button.is-active {
  color: #f3f6fb !important;
  background: #243b4e !important;
  border-color: #72c8c4 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .approval-template-list > button.is-active :is(strong, small) {
  color: #f3f6fb !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .login-audit-agent summary {
  color: #cfe2ff !important;
  background: #273342 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .login-audit-agent p {
  color: #dfe7f2 !important;
  background: #20242a !important;
}
/* Flow ledgers and app-level workflow windows */
.flow-workspace-window {
  width: min(100%, 1480px);
  min-width: 0;
  margin: 0 auto;
  color: var(--ui-text, #1d2129);
}

.flow-ledger-window {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--ui-border, #dfe4ea);
  border-radius: 6px;
  background: var(--ui-surface, #fff);
  box-shadow: 0 6px 18px rgba(15, 52, 118, 0.07);
}

.flow-ledger-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ui-border, #dfe4ea);
}

.flow-ledger-head > div {
  min-width: 0;
}

.flow-ledger-head span,
.flow-ledger-head p {
  color: var(--ui-text-muted, #6e7681);
}

.flow-ledger-head span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.flow-ledger-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0;
}

.flow-ledger-head p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.flow-ledger-toolbar {
  display: grid;
  grid-template-columns: auto 180px auto minmax(80px, 1fr);
  align-items: end;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  background: var(--ui-surface-subtle, #f6f8fa);
  border: 1px solid var(--ui-border, #dfe4ea);
  border-radius: 5px;
}

.flow-ledger-primary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.flow-ledger-primary-actions .table-action {
  min-height: 36px;
}

.flow-ledger-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.flow-ledger-toolbar label > span,
.flow-ledger-count {
  color: var(--ui-text-muted, #6e7681);
  font-size: 12px;
}

.flow-ledger-toolbar :is(input, select) {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--ui-border-strong, #c8d0da);
  border-radius: 4px;
  background: var(--ui-surface, #fff);
  color: var(--ui-text, #1d2129);
  font: inherit;
  font-size: 14px;
}

.flow-ledger-count {
  align-self: center;
  justify-self: end;
  white-space: nowrap;
}

.flow-workspace-form-window {
  display: grid;
  min-height: 0;
  gap: 10px;
}

.flow-workspace-form-host {
  min-width: 0;
  min-height: 0;
}

@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .module-subnav-flow-launch {
    max-height: calc(100dvh - var(--ui-header-height, 56px)) !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  contain: inline-size;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window::backdrop {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-shell {
  width: var(--flow-workspace-available-width, 100%) !important;
  min-width: 0 !important;
  max-width: var(--flow-workspace-available-width, 100%) !important;
  box-sizing: border-box !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  border: 1px solid var(--ui-border, #dfe4ea);
  border-radius: 6px;
  background: var(--ui-surface, #fff);
  box-shadow: 0 6px 18px rgba(15, 52, 118, 0.07);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window:not(.is-picker):has(#flow-form) > .erp-flow-launch-dialog-shell {
  width: var(--flow-workspace-available-width, 100%) !important;
  max-width: var(--flow-workspace-available-width, 100%) !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-body {
  width: calc(var(--flow-workspace-available-width, 100%) - 2px) !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-body.is-form {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-form {
  width: calc(var(--flow-workspace-available-width, 100%) - 2px) !important;
  min-width: 0 !important;
  max-width: 1180px !important;
  box-sizing: border-box !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window #flow-form {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 1180px !important;
  box-sizing: border-box !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-change {
  display: none !important;
}

.flow-record-preview-backdrop.is-workspace {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 0 !important;
  margin: 0 auto;
  padding: 0 !important;
  box-sizing: border-box;
  contain: inline-size;
  overflow: visible !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

.flow-record-preview-backdrop.is-workspace .flow-record-preview-panel {
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  overflow: visible !important;
  border-radius: 6px !important;
}

@media (max-width: 760px) {
  .flow-workspace-window,
  .flow-record-preview-backdrop.is-workspace {
    width: 100%;
  }

  .flow-ledger-window {
    gap: 10px;
    padding: 10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .flow-ledger-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .flow-ledger-head h1 {
    font-size: 20px;
  }

  .flow-ledger-head > button {
    width: 100%;
  }

  .flow-ledger-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 0.45fr);
  }

  .flow-ledger-toolbar > button {
    width: 100%;
  }

  .flow-ledger-count {
    justify-self: end;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-shell,
  .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel {
    border-right: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
  }
}

/* Reference ledger density and duplicate-navigation cleanup 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window {
  width: 100%;
  max-width: none;
  gap: 10px;
  padding: 12px;
  border-radius: 4px;
  box-shadow: none;
}

body[data-ui-theme="macos-workspace-v3"] .flow-ledger-head {
  min-height: 42px;
  align-items: center;
  padding: 0 0 10px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-ledger-head h1 {
  font-size: 18px;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .flow-ledger-toolbar {
  grid-template-columns: auto 160px auto minmax(80px, 1fr);
  padding: 8px;
  border-radius: 4px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window tr[data-flow-ledger-row] {
  cursor: pointer;
}

body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window tr[data-flow-ledger-row].is-flow-ledger-selected > td {
  background: #e8f2ff;
  box-shadow: inset 0 1px #b8d5fb, inset 0 -1px #b8d5fb;
}

body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window tr[data-flow-ledger-row]:focus-visible > td {
  outline: 2px solid #1677ff;
  outline-offset: -2px;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window tr[data-flow-ledger-row].is-flow-ledger-selected > td {
  background: #19385f;
  box-shadow: inset 0 1px #3f75ad, inset 0 -1px #3f75ad;
}

body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table tbody td,
body[data-ui-theme="macos-workspace-v3"] .erp-main .panel .data-table tbody td {
  max-width: 320px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table td.is-action {
  overflow: visible;
}

body[data-ui-theme="macos-workspace-v3"] .party-subtabs {
  display: none !important;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-primary-actions {
    width: 100%;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-count {
    justify-self: start;
  }
}

/* Flow form typography authority: fixed labels, editable values and linked values. */
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label, .flow-related-field) > span:first-child {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  justify-content: flex-end !important;
  color: #1d2129 !important;
  text-align: right !important;
  white-space: normal !important;
  overflow: hidden !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label:has(> :is(input[readonly], .readonly-link)) > span::after {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(
  .form-section-label,
  .line-table-head,
  .attachment-upload-control > span:first-child
) {
  color: #111827 !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"]):not([readonly]):not(:disabled),
  select:not(:disabled),
  textarea:not([readonly]):not(:disabled),
  .percent-input-control,
  .flow-related-trigger
) {
  min-width: 0 !important;
  max-width: 100% !important;
  color: #111827 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid :is(input, textarea)::placeholder {
  color: #6b7280 !important;
  opacity: 1 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form.is-document-layout.flow-form-streamlined .form-grid :is(input[readonly], textarea[readonly], select:disabled, .readonly-link) {
  color: #4b5563 !important;
  background: var(--enterprise-surface-soft, #f4f6f8) !important;
  opacity: 1 !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid .readonly-link {
  height: auto !important;
  min-height: var(--operational-form-row) !important;
  white-space: normal !important;
  overflow: hidden !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35 !important;
  text-align: left !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid textarea {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > :is(label, .flow-related-field) > span:first-child,
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(.form-section-label, .line-table-head, .attachment-upload-control > span:first-child) {
  color: #f3f6fb !important;
}

:root[data-color-scheme="dark"] 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"]):not([readonly]):not(:disabled),
  select:not(:disabled),
  textarea:not([readonly]):not(:disabled),
  .percent-input-control,
  .flow-related-trigger
) {
  color: #f3f6fb !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form.is-document-layout.flow-form-streamlined .form-grid :is(input[readonly], textarea[readonly], select:disabled, .readonly-link) {
  color: #b9c2cf !important;
  background: var(--mac-v3-surface-muted, #232b36) !important;
}

/* Billing application selects its source from a readable settlement ledger. */
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(.income-settlement-source-field, .invoice-contract-selection-field) {
  align-items: start !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(.income-settlement-source-field, .invoice-contract-selection-field) > .flow-related-trigger {
  min-height: var(--operational-form-row) !important;
  height: auto !important;
  padding-block: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  text-align: left !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(.income-settlement-source-field, .invoice-contract-selection-field) > .flow-related-trigger b,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(.income-settlement-source-field, .invoice-contract-selection-field) > .flow-related-trigger 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) :is(.income-settlement-source-field, .invoice-contract-selection-field) > .flow-related-trigger small {
  color: var(--enterprise-text-secondary) !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(.income-settlement-source-field, .invoice-contract-selection-field) > .flow-related-chips {
  grid-column: 2 !important;
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 6px 10px 8px !important;
  border-top: 1px solid var(--operational-form-line);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .invoice-contract-selection-field > .flow-related-chips > span,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .invoice-contract-selection-field .flow-related-chip-preview {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .invoice-contract-selection-field .flow-related-chip-preview {
  display: flex !important;
  justify-content: space-between;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > .flow-context {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 8px 0 0 !important;
  padding: 0 12px 12px !important;
  display: grid !important;
  gap: 10px !important;
  border-top: 1px solid var(--operational-form-line);
  background: var(--enterprise-surface) !important;
}

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

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > .flow-context .flow-section-title {
  min-height: 32px;
  margin: 0 -12px;
  padding: 7px 12px;
  color: var(--enterprise-text);
  background: var(--operational-form-section);
  border-top: 1px solid var(--operational-form-line);
  border-bottom: 1px solid var(--operational-form-line);
  font-size: 13px;
  font-weight: 700;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > .flow-context .context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > .flow-context .context-card {
  min-width: 0;
  min-height: 76px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 3px;
  overflow: hidden;
  border: 1px solid var(--operational-form-line);
  border-radius: 4px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface-soft);
  text-align: left;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > .flow-context .context-card :is(span, strong, 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) .form-grid > .flow-context .context-card strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > .flow-context .context-card small {
  color: var(--enterprise-text-secondary);
  font-size: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker {
  width: min(1240px, calc(100vw - 32px)) !important;
  max-width: 1240px !important;
  height: min(760px, calc(100dvh - 32px)) !important;
  max-height: min(760px, calc(100dvh - 32px)) !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  overflow: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-table-wrap {
  min-width: 0;
  min-height: 0;
  padding: 12px !important;
  overflow: auto !important;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-table-wrap .data-table-shell {
  min-width: 940px;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-table :is(th, td) {
  padding: 10px 8px;
  border-bottom: 1px solid var(--operational-form-line);
  color: var(--enterprise-text);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--enterprise-text-secondary);
  background: var(--enterprise-surface-soft);
  font-weight: 700;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-table tr.is-selected td {
  background: color-mix(in srgb, var(--enterprise-accent, #0f3476) 8%, var(--enterprise-surface));
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-table .money-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-table .is-available {
  color: #08766e;
  font-weight: 700;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-table .is-exhausted {
  color: var(--enterprise-text-secondary);
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-row-actions .table-action {
  min-width: 48px;
  padding-inline: 8px;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-backdrop {
    padding: 0 !important;
  }

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

  body[data-ui-theme="macos-workspace-v3"] .income-settlement-picker-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(.income-settlement-source-field, .invoice-contract-selection-field) > .flow-related-trigger {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 2px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .invoice-contract-selection-field > .flow-related-trigger > :is(b, small) {
    width: 100% !important;
    max-width: 100% !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .invoice-contract-selection-field > .flow-related-chips {
    grid-column: 2 !important;
    width: 100% !important;
  }

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

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

/* Mobile flow preview actions must fit their visible labels. */
@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head {
    grid-template-columns: minmax(0, 1fr) 76px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head > [data-flow-record-preview-close] {
    width: auto !important;
    min-width: 76px !important;
    min-height: 36px !important;
    padding: 0 8px !important;
    overflow: hidden;
    font-size: 13px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Final preview text boundary override. */
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip > div > :is(strong, small) {
  max-width: 100%;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block > div > :is(strong, p) {
    width: 100%;
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* Final tablet component reflow override. */
@media (min-width: 761px) and (max-width: 1180px) {
  body[data-ui-theme="macos-workspace-v3"] .dashboard-donut-layout {
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(120px, 0.85fr) minmax(0, 1.15fr) !important;
    gap: 12px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-donut-legend,
  body[data-ui-theme="macos-workspace-v3"] .dashboard-donut-legend button {
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .payroll-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .payroll-filters > label:last-child {
    grid-column: 1 / -1;
  }

  body[data-ui-theme="macos-workspace-v3"] .org-role-summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px 12px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .org-role-summary > .org-inline-check {
    grid-column: 1;
    justify-self: start;
  }

  body[data-ui-theme="macos-workspace-v3"] .org-role-summary > .table-action {
    grid-column: 2;
    justify-self: end;
  }

  body[data-ui-theme="macos-workspace-v3"] .org-department-row {
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px 52px !important;
    gap: 8px !important;
  }
}

/* Preview workspace boundary authority 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .dashboard-preview-panel {
  height: min(920px, calc(100dvh - var(--reference-header, 56px) - 24px)) !important;
  max-height: min(920px, calc(100dvh - var(--reference-header, 56px) - 24px)) !important;
  min-height: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .party-project-table {
  width: 100% !important;
  min-width: 640px !important;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-metrics > .context-card > :is(span, small) {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .dashboard-preview-panel {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }
}

/* Fixed flow document workspace authority 2026-08-27 */
@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .erp-main:has(.flow-workspace-form-window),
  body[data-ui-theme="macos-workspace-v3"] .erp-main:has(.flow-record-preview-backdrop.is-workspace) {
    overflow: auto !important;
    scrollbar-gutter: stable;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-workspace-form-window,
  body[data-ui-theme="macos-workspace-v3"] .flow-workspace-form-host,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window,
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace {
    width: min(100%, var(--operational-document-width)) !important;
    min-width: 0 !important;
    max-width: var(--operational-document-width) !important;
    margin-inline: auto !important;
    contain: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-shell,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window:not(.is-picker):has(#flow-form) > .erp-flow-launch-dialog-shell,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-body,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-form,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window #flow-form,
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-workspace-form-window {
    display: block !important;
    align-self: start !important;
    height: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-shell {
    display: block !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-workspace-form-host,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-shell,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-body,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-form,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window #flow-form {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .form-actions {
    position: static !important;
    inset: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .form-grid > [hidden] {
    display: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel,
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-layout,
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-main {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-preview-action-bar {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    margin: 0 !important;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-workspace-form-window,
  body[data-ui-theme="macos-workspace-v3"] .flow-workspace-form-host,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window,
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
  }
}
/* End fixed flow document workspace authority */

/* Release audit authority 2026-08-27 */
:root {
  --enterprise-accent: #0f5fc6;
  --reference-accent: #0f5fc6;
  --reference-action-solid: #0f5fc6;
  --enterprise-focus: 0 0 0 3px rgba(15, 95, 198, 0.24);
  --reference-focus: 0 0 0 3px rgba(15, 95, 198, 0.24);
}

:root[data-color-scheme="dark"] {
  --enterprise-accent: #78b3ff;
  --reference-accent: #78b3ff;
  --reference-action-solid: #1f6fc4;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tabs .workspace-tab-close {
  color: var(--reference-text-secondary) !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-approval-system-checks > header small,
body[data-ui-theme="macos-workspace-v3"] .flow-approval-system-checks > ul > li p {
  font-size: 12px !important;
  line-height: 1.5 !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-approval-system-checks > ul > li > span {
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .data-table td[data-truncated-text="true"] {
  text-decoration: underline dotted rgba(82, 97, 112, 0.55);
  text-underline-offset: 3px;
  cursor: help;
}

body[data-ui-theme="macos-workspace-v3"] .data-table td[data-truncated-text="true"]:focus-visible {
  outline: 2px solid var(--reference-accent);
  outline-offset: -3px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-exception-list small {
  display: -webkit-box;
  overflow: hidden !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main small,
body[data-ui-theme="macos-workspace-v3"] .erp-main .finance-period-control > label {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

@media (min-width: 761px) and (max-width: 1180px) {
  body[data-ui-theme="macos-workspace-v3"] .panel-title > .inline-select {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) !important;
    flex: 1 1 100% !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .panel-title > .inline-select > select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

body[data-ui-theme="macos-workspace-v3"] :is(
  .panel-title,
  .dashboard-preview-head,
  .flow-record-preview-head,
  .flow-approval-content-section > header,
  .data-table th,
  .data-table td
) :is(strong, span, small, p) {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] #mobile-more-toggle small {
    font-size: 13px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .context-card > span,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .finance-ledger-switch > button {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table :is(
    button,
    strong,
    span,
    small,
    div
  ),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .dashboard-executive :is(
    button,
    strong,
    span,
    small,
    th,
    td
  ) {
    font-size: 13px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
    .table-action,
    .data-table-pagination button,
    .flow-preview-action-bar button,
    .flow-approval-actions button
  ),
  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root :is(
    .table-action,
    .dashboard-preview-actions button,
    .flow-preview-action-bar button,
    .flow-approval-actions button
  ) {
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
    small,
    .status-pill,
    .muted,
    .hint,
    .panel-title span,
    .data-table-pagination span
  ),
  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root :is(
    small,
    .status-pill,
    .muted,
    .hint
  ) {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head > [data-flow-record-preview-close] {
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
    .dashboard-donut-legend,
    .dashboard-lane-head,
    .dashboard-stage-node,
    .table-column-menu,
    .construction-log-calendar,
    .template-field-legend,
    .template-step-strip,
    .data-table-scroll-hint,
    .finance-period-current,
    .party-import-toolbar,
    .data-export-config,
    .org-inline-check,
    .org-role-summary,
    .org-role-members,
    .org-role-member-list,
    .approval-template-layout
  ) :is(span, strong, b, label, legend, summary, button, p),
  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
    .schedule-gantt-tick,
    .ledger-record-number,
    .ledger-secondary-stat,
    .ledger-alert-link > span,
    .construction-log-summary-status,
    .template-card > span,
    th,
    .org-inline-check,
    .approval-assignment-group .is-complete
  ),
  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
    .dashboard-line-grid,
    .dashboard-line-months
  ) text {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
    .dashboard-cost-connector,
    .dashboard-cost-result,
    .dashboard-exposure-item,
    .dashboard-invoice-row,
    .data-export-category-tabs,
    .data-export-preview-head
  ) :is(span, b),
  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-export-preview-count {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table-shell .table-empty-cell .data-table-empty-state {
    position: sticky;
    left: 0;
    width: calc(100vw - 40px) !important;
    max-width: calc(100vw - 40px) !important;
    box-sizing: border-box;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-task-rail-progress-track > i {
    transition: none !important;
  }
}
/* End release audit authority */

/* Operator live module audit 2026-08-27 */
:root {
  --operational-document-width: 1040px;
  --module-caption-size: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .workbench-flow-status-group h2,
  .workbench-flow-list-head,
  .data-table thead th,
  .data-table thead th > span,
  .table-column-menu > summary,
  .table-column-menu > div > label,
  .finance-ledger-switch > button,
  .template-field-legend span,
  .template-step-strip span,
  .data-table-scroll-hint,
  .org-inline-check,
  .org-role-member,
  .approval-tree-note,
  .type-chip
) {
  font-size: 12px !important;
  line-height: 1.4 !important;
}

body[data-ui-theme="macos-workspace-v3"] .data-table-column-resizer {
  width: 24px !important;
  min-width: 24px !important;
}

body[data-ui-theme="macos-workspace-v3"] .finance-ledger-switch > button {
  min-height: 32px !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .dashboard-invoice-row b {
  color: #72c8c4 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .workbench-section-head > b {
  color: #ffb45e !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .org-module-dropdown > summary > i {
  color: #72c8c4 !important;
}

@media (min-width: 1281px) and (max-width: 1439px) {
  :root {
    --operational-document-width: 960px;
  }
}

@media (min-width: 1101px) and (max-width: 1280px) {
  :root {
    --operational-document-width: 880px;
  }
}

@media (min-width: 921px) and (max-width: 1100px) {
  :root {
    --operational-document-width: 800px;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .org-employee-mobile-toggle small {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .flow-record-preview-panel.is-decision-mode .flow-record-preview-layout.has-approval-workbench,
  html body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .flow-record-preview-panel.is-decision-mode .flow-record-preview-layout.has-approval-workbench {
    padding-bottom: calc(190px + env(safe-area-inset-bottom)) !important;
  }

  html body[data-ui-theme="macos-workspace-v3"] .erp-main .flow-record-preview-panel.is-decision-mode .flow-approval-workbench > .flow-approval-actions,
  html body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .flow-record-preview-panel.is-decision-mode .flow-approval-workbench > .flow-approval-actions {
    inset: auto 0 auto 0 !important;
    bottom: calc(64px + env(safe-area-inset-bottom)) !important;
    padding: 10px 12px !important;
  }
}

/* Typography and boundary audit 2026-08-27 */
body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .boss-kpi-card > span,
  .dashboard-chart-bar > span,
  .dashboard-donut-legend span,
  .workbench-flow-filter-group h2,
  .workbench-flow-status-group > span,
  .ledger-record-context,
  .ledger-record-link,
  .ledger-record-number,
  .ledger-secondary-stat,
  .ledger-metric-link,
  .schedule-gantt-tick,
  .construction-calendar-title > span,
  .construction-calendar-week > span,
  .construction-calendar-selection,
  .data-export-category-tabs :is(span, b),
  .data-export-preview-count,
  .org-role-name-field,
  .org-role-members-label,
  .approval-assignment-group .is-complete,
  .flow-section-incomplete-count
) {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .dashboard-executive svg text {
  font-size: 11px !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .ledger-record-context,
  .ledger-record-link,
  .ledger-record-number,
  .ledger-secondary-stat,
  .ledger-metric-link
) {
  max-width: 100%;
  min-width: 0;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .ledger-record-link {
  height: auto;
  min-height: 32px;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table :is(
  .ledger-record-cell,
  .ledger-party-cell,
  .ledger-metric-stack,
  .ledger-static-metric,
  .ledger-metric-link,
  .ledger-status-cell
) {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-table :is(
  .ledger-record-cell,
  .ledger-party-cell,
  .ledger-metric-stack,
  .ledger-static-metric,
  .ledger-metric-link,
  .ledger-status-cell
) :is(span, strong, button, small, div) {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .ledger-alert-link > span,
  .party-import-toolbar > div > span,
  .data-export-section-title > span,
  .data-export-section-title > span > b,
  .data-export-preview-head > div > span,
  .data-export-field-grid label,
  .data-export-field-list > label,
  .data-export-statuses label,
  .org-role-name-field > span,
  .approval-tree-head label > span,
  .approval-tree-node-fields label > span
) {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .schedule-gantt-tick:last-child {
  padding-right: 4px;
  padding-left: 0;
  transform: translateX(-100%);
  text-align: right;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog :is(
  .flow-section-incomplete-count,
  .flow-section-title,
  .line-table-head > span,
  .line-table-head strong,
  .line-table-head button,
  .attachment-upload-button,
  .flow-attachment-checklist small,
  .flow-attachment-checklist .is-missing
),
body[data-ui-theme="macos-workspace-v3"] .global-overlay-root #erp-flow-launch-dialog :is(
  .flow-section-incomplete-count,
  .flow-section-title,
  .line-table-head > span,
  .line-table-head strong,
  .line-table-head button,
  .attachment-upload-button,
  .flow-attachment-checklist small,
  .flow-attachment-checklist .is-missing
) {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

html body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form.is-document-layout.flow-form-streamlined .form-grid .percent-input-control {
  grid-template-columns: minmax(0, 1fr) 40px !important;
  padding: 0 !important;
}

html body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form.is-document-layout.flow-form-streamlined .form-grid .percent-input-control > input {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 12px !important;
}

html body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form.is-document-layout.flow-form-streamlined .form-grid .percent-input-control > span {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 40px !important;
  min-width: 40px !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .login-audit-agent > p {
  max-width: 100%;
  min-width: 0;
  font-size: 12px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-ui-theme="macos-workspace-v3"] details.login-audit-agent:not([open]) > p {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .data-export-config :is(
  label > span,
  legend,
  .hint,
  .muted
) {
  font-size: 12px !important;
  line-height: 1.45 !important;
  white-space: normal;
  overflow-wrap: anywhere;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .org-employee-mobile-toggle > i {
  color: #72c8c4 !important;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] :is(
    .workspace-tab-activate,
    .workspace-tab-activate > span,
    .module-nav-label,
    .project-subtabs > button,
    .finance-subnav > button,
    .organization-subtabs > button,
    .workbench-flow-status-list > button
  ) {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
    .flow-section-incomplete-count,
    .flow-section-title,
    .line-table-head > span,
    .line-table-head strong,
    .line-table-head button,
    .attachment-upload-button,
    .flow-attachment-checklist small,
    .flow-attachment-checklist .is-missing,
    .construction-calendar-title > span,
    .construction-calendar-week > span,
    .construction-calendar-selection,
    .data-table th
  ) {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] :is(.project-subtabs, .finance-subnav, .organization-subtabs, .workbench-flow-status-list) {
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 100% !important;
    padding-right: 16px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-padding-inline: 12px;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  body[data-ui-theme="macos-workspace-v3"] :is(.project-subtabs, .finance-subnav, .organization-subtabs, .workbench-flow-status-list)::-webkit-scrollbar {
    display: none;
  }

  body[data-ui-theme="macos-workspace-v3"] :is(.project-subtabs, .finance-subnav, .organization-subtabs, .workbench-flow-status-list) > :is(button, a) {
    flex: 0 0 auto !important;
    max-width: none !important;
  }
}

/* Related-flow record preview authority 2026-08-27 */
@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel {
    width: min(1100px, calc(100vw - 48px)) !important;
    height: auto !important;
    max-height: min(calc(100dvh - 32px), 860px) !important;
    display: flex !important;
    flex-direction: column;
    grid-template-rows: none !important;
  }
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel > .dashboard-preview-head,
body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel > .related-flow-record-metrics {
  flex: 0 0 auto;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel > .dashboard-preview-table {
  flex: 0 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: auto !important;
  overscroll-behavior: contain;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .related-flow-record-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .dashboard-preview-table {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 0 !important;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .dashboard-preview-table > .flow-section-title {
  min-height: 40px;
  margin: 0;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--enterprise-border);
  border-bottom: 1px solid var(--enterprise-border);
  color: var(--enterprise-text);
  background: var(--enterprise-surface-soft);
  font-size: 13px;
  line-height: 1.4;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .dashboard-preview-table > .flow-section-title:first-child {
  border-top: 0;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table-shell {
  margin: 0;
  border: 0;
  border-radius: 0;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table {
  table-layout: fixed;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table :is(th, td):first-child {
  width: 168px;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table td {
  height: auto;
  min-height: 42px;
  padding: 9px 12px;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .flow-approval-business-details {
  margin: 12px 14px;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-picker-list {
    grid-auto-rows: max-content !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-option {
    height: max-content !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel > .dashboard-preview-table {
    flex: 1 1 auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .flow-approval-business-details {
    height: max-content !important;
    min-height: max-content;
    overflow: visible !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .related-flow-record-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .related-flow-record-metrics > .context-card:last-child {
    grid-column: 1 / -1;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table-shell {
    width: 100%;
    height: max-content !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table thead {
    display: table-header-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table tbody {
    display: table-row-group !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table tr {
    display: table-row !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table :is(th, td) {
    display: table-cell !important;
    width: auto;
    min-width: 0;
    padding: 9px 10px;
    border-bottom: 1px solid var(--enterprise-border);
    vertical-align: top;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table tbody td::before {
    display: none !important;
    content: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-overlay-root .related-flow-record-panel .data-table :is(th, td):first-child {
    width: 96px;
  }
}

/* Bounded flow workspace authority 2026-08-27 */
body[data-ui-theme="macos-workspace-v3"] .erp-main:has(.flow-workspace-form-window),
body[data-ui-theme="macos-workspace-v3"] .erp-main:has(.flow-record-preview-backdrop.is-workspace) {
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .flow-workspace-form-window),
body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .flow-record-preview-backdrop.is-workspace) {
  height: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .flow-workspace-form-window) > .view-semantic-title,
body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .flow-record-preview-backdrop.is-workspace) > .view-semantic-title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%);
  white-space: nowrap !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-workspace-form-window,
body[data-ui-theme="macos-workspace-v3"] .flow-workspace-form-host,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-shell,
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace,
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-shell,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window:not(.is-picker):has(#flow-form) > .erp-flow-launch-dialog-shell {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-body,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .erp-flow-launch-dialog-body.is-form {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window :is(.erp-flow-launch-dialog-form, #flow-form) {
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow: visible !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .form-actions {
  position: sticky !important;
  inset: auto 0 0 !important;
  bottom: 0 !important;
  z-index: 12;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-layout {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-main {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: block !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-preview-action-bar {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  margin: 0 !important;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .flow-workspace-form-window),
  body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .flow-record-preview-backdrop.is-workspace) {
    width: 100% !important;
    padding: 8px 0 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .form-actions {
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-layout:not(.has-approval-workbench) {
    padding-bottom: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-layout.has-approval-workbench {
    height: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-layout.has-approval-workbench .flow-record-preview-main {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-status-list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 6px;
    max-width: 100% !important;
    padding: 0 12px 10px !important;
    overflow: visible !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-status-list > :is(button, section),
  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-status-list .workbench-flow-filter-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-trend-chart,
  body[data-ui-theme="macos-workspace-v3"] .dashboard-line-canvas {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: hidden !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-line-canvas {
    width: auto !important;
    justify-self: stretch;
    padding-inline: 8px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-line-canvas svg {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}
/* End bounded flow workspace authority */

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog.is-workspace-window .form-grid > [hidden] {
  display: none !important;
}

/* Mobile empty workbench compaction 2026-08-27 */
@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window:has(.workbench-task-center.is-empty) {
    height: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window:has(.workbench-task-center.is-empty) .workbench-flow-window-body {
    height: auto !important;
    grid-template-rows: auto auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window:has(.workbench-task-center.is-empty) .workbench-next-action-empty {
    min-height: 144px !important;
  }
}

/* Project nature, bottom approval route, and reference-style wide flow ledgers. */
.flow-inline-approval-route {
  width: 100%;
  margin-top: 12px;
  overflow: hidden;
}

#erp-flow-launch-dialog .flow-inline-approval-route > header {
  min-height: 48px;
  padding: 9px 12px;
}

#erp-flow-launch-dialog .flow-inline-approval-route #flow-task-approval-route {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 18px;
  padding: 8px 12px 12px;
}

@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table {
    width: max-content;
    min-width: 1600px;
    table-layout: auto;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table :is(th, td) {
    min-width: 118px;
    max-width: 260px;
    white-space: nowrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table :is(th, td):first-child {
    min-width: 170px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table :is(th, td):nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table :is(th, td):nth-child(5) {
    min-width: 220px;
    max-width: 320px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table :is(th, td):last-child {
    min-width: 104px;
  }
}

@media (max-width: 760px) {
  #erp-flow-launch-dialog .flow-inline-approval-route #flow-task-approval-route {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Full-width dense flow ledgers, matching the reference ledger workspace. */
@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .flow-ledger-window) {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 8px 8px 16px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window {
    width: 100%;
    max-width: none;
    min-height: 100%;
    gap: 8px;
    padding: 8px;
    border: 0;
    border-radius: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-head {
    min-height: 36px;
    padding: 0 0 6px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-head h1 {
    font-size: 17px;
    line-height: 1.3;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-head > .table-action {
    min-height: 30px;
    padding: 0 10px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-toolbar {
    grid-template-columns: auto 152px auto minmax(80px, 1fr);
    gap: 8px;
    padding: 6px 8px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-toolbar label {
    gap: 3px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-toolbar :is(input, select) {
    height: 32px;
    min-height: 32px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-toolbar > .table-action {
    min-height: 32px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-primary-actions .table-action {
    min-height: 32px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table-shell {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 220px);
    overflow-x: auto;
    overflow-y: auto;
    border-radius: 2px 2px 0 0;
    scrollbar-gutter: stable;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table {
    width: max-content;
    min-width: max(100%, 1600px);
    table-layout: auto;
    font-size: 12px;
    line-height: 1.35;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table thead th {
    height: 30px;
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 1.25;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table tbody td {
    height: 34px;
    min-height: 34px;
    max-width: 320px;
    padding: 4px 8px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table :is(th, td):nth-child(4),
  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table :is(th, td):nth-child(5) {
    white-space: nowrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table td.is-action {
    min-width: 104px;
    overflow: visible;
    white-space: nowrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table td.is-action .table-action {
    height: 26px !important;
    min-height: 26px !important;
    margin: 0 3px 0 0 !important;
    padding: 0 7px !important;
    font-size: 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-ledger-window .data-table-pagination {
    min-height: 32px;
    padding: 4px 8px;
  }
}

/* Flow ledger document preview authority 2026-08-29 */
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview {
  width: min(1180px, calc(100vw - 32px)) !important;
  max-width: 1180px !important;
  height: min(900px, calc(100dvh - 32px)) !important;
  max-height: calc(100dvh - 32px) !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: hidden !important;
  color: #1d2129 !important;
  background: #f6f8fa !important;
  border: 1px solid #dfe4ea !important;
  border-radius: 8px !important;
  box-shadow: 0 18px 48px rgba(15, 52, 118, 0.14) !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-backdrop.is-workspace .flow-record-preview-panel.is-document-preview {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
  min-height: 72px !important;
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) minmax(190px, 250px) max-content !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 14px !important;
  background: #fff !important;
  border-bottom: 1px solid #dfe4ea !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-preview-status-zone {
  display: flex !important;
  align-items: center !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-status-chip {
  position: static !important;
  min-width: 64px !important;
  min-height: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 3px 8px !important;
  color: #0f3476 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  background: #eef5ff !important;
  border: 1px solid #b9d3f7 !important;
  border-radius: 6px !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-title-block,
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-title-block > div {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 1px !important;
  padding: 0 !important;
  text-align: left !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-title-block {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-title-block strong {
  color: #1d2129 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-title-block :is(small, p),
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-record-document-number,
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-amount-note {
  display: block !important;
  margin: 0 !important;
  color: #6e7681 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-header-amount {
  position: static !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: end !important;
  gap: 2px !important;
  padding: 0 0 0 10px !important;
  text-align: right !important;
  border-left: 1px solid #e5e9ee !important;
  grid-column: 3 !important;
  grid-row: 1 !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-header-amount > strong {
  color: #1d2129 !important;
  font-size: 17px !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview > .flow-record-preview-head > [data-flow-record-preview-close] {
  position: static !important;
  align-self: start !important;
  min-width: 54px !important;
  min-height: 34px !important;
  margin: 0 !important;
  grid-column: 4 !important;
  grid-row: 1 !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-record-preview-layout {
  min-width: 0 !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  overflow: hidden !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-record-preview-layout.has-approval-workbench {
  grid-template-columns: minmax(0, 1fr) 320px !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-record-preview-main {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  padding: 10px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #f6f8fa !important;
  scrollbar-gutter: stable;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-document {
  width: min(100%, 1040px) !important;
  max-width: 1040px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 1px solid #dfe4ea !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(29, 33, 41, 0.06) !important;
}

.flow-readonly-document {
  min-width: 0;
  display: grid;
  gap: 0;
}

.flow-readonly-document .flow-approval-content-section,
.flow-readonly-document .flow-approval-focus,
.flow-readonly-document .flow-approval-main-checks {
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  border: 0 !important;
  border-bottom: 1px solid #dfe4ea !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.flow-readonly-document .flow-approval-content-section > header {
  min-height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 5px 12px !important;
  background: #eef2f6 !important;
  border: 0 !important;
  border-bottom: 1px solid #dfe4ea !important;
}

.flow-readonly-document .flow-approval-content-section > header strong {
  color: #1d2129 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.flow-readonly-document .flow-approval-content-section > header span {
  min-width: 0;
  color: #6e7681 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  text-align: right;
  overflow-wrap: anywhere;
}

.flow-readonly-document .flow-approval-context-strip {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  border: 0 !important;
}

.flow-readonly-document .flow-approval-context-strip > div {
  min-width: 0 !important;
  min-height: 36px !important;
  display: grid !important;
  grid-template-columns: 124px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 0 8px !important;
  padding: 4px 10px !important;
  background: transparent !important;
  border-right: 1px solid #e5e9ee !important;
  border-bottom: 1px solid #e5e9ee !important;
}

.flow-readonly-document .flow-approval-context-strip > div:nth-child(2n) {
  border-right: 0 !important;
}

.flow-readonly-document .flow-approval-context-strip > div > span {
  color: #4e5969 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-align: right !important;
}

.flow-readonly-document .flow-approval-context-strip > div > strong {
  min-width: 0 !important;
  color: #1d2129 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
}

.flow-readonly-document .flow-approval-context-strip > div > small {
  min-width: 0 !important;
  grid-column: 2 !important;
  color: #86909c !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

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

.flow-readonly-document .flow-approval-business-details > div {
  min-width: 0 !important;
  min-height: 36px !important;
  display: grid !important;
  grid-template-columns: 124px minmax(0, 1fr) !important;
  align-items: stretch !important;
  border-right: 1px solid #e5e9ee !important;
  border-bottom: 1px solid #e5e9ee !important;
}

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

.flow-readonly-document .flow-approval-business-details > div.is-wide {
  grid-column: 1 / -1 !important;
}

.flow-readonly-document .flow-approval-business-details :is(dt, dd) {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
}

.flow-readonly-document .flow-approval-business-details dt {
  color: #4e5969 !important;
  font-weight: 600 !important;
  text-align: right !important;
  background: transparent !important;
  border-right: 1px solid #e5e9ee !important;
}

.flow-readonly-document .flow-approval-business-details dd {
  color: #1d2129 !important;
  font-weight: 500 !important;
  background: #fff !important;
}

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

.flow-readonly-document .flow-approval-account-section dl > div {
  min-width: 0 !important;
  display: grid !important;
  gap: 2px !important;
  padding: 6px 10px !important;
  border-right: 1px solid #e5e9ee !important;
}

.flow-readonly-document .flow-approval-line-items-section > :not(header),
.flow-readonly-document .flow-approval-content-section > .data-table-shell,
.flow-readonly-document .flow-approval-content-section > .responsive-table {
  max-width: 100% !important;
  overflow-x: auto !important;
}

.flow-readonly-document :is(.data-table, table) :is(th, td) {
  min-height: 32px !important;
  padding: 5px 8px !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  vertical-align: middle !important;
}

.flow-readonly-document .flow-approval-attachment-list {
  margin: 0 !important;
  padding: 6px 10px !important;
}

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

.flow-readonly-document .flow-approval-timeline-list li {
  min-height: 0 !important;
  padding-block: 4px !important;
}

.flow-readonly-document :is(
  .flow-approval-detail-section,
  .flow-approval-attachments-section
) .empty-state {
  min-height: 40px !important;
  padding: 8px 10px !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-preview-action-bar {
  position: static !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  background: #fff !important;
  border-top: 1px solid #dfe4ea !important;
}

@media (max-width: 980px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-record-preview-layout.has-approval-workbench {
    grid-template-columns: minmax(0, 1fr) !important;
    overflow-y: auto !important;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) max-content !important;
    gap: 6px !important;
    padding: 8px 10px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-preview-status-zone {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview > .flow-record-preview-head > [data-flow-record-preview-close] {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 48px !important;
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-title-block {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-approval-header-amount {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    gap: 4px 10px !important;
    padding: 8px 0 0 !important;
    text-align: left !important;
    border-top: 1px solid #e5e9ee !important;
    border-left: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-record-preview-main {
    padding: 6px !important;
    scrollbar-gutter: auto;
  }

  .flow-readonly-document .flow-approval-context-strip {
    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-column: auto !important;
    grid-template-columns: 96px minmax(0, 1fr) !important;
    border-right: 0 !important;
  }

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

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

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview,
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-record-preview-main {
  color: #f2f4f7 !important;
  background: #121923 !important;
  border-color: #34404f !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview :is(
  .flow-record-preview-head,
  .flow-approval-document,
  .flow-preview-action-bar,
  .flow-approval-workbench,
  .flow-approval-content-section,
  .flow-approval-context-strip,
  .flow-approval-business-details dd
) {
  color: #f2f4f7 !important;
  background: #18212d !important;
  border-color: #34404f !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-readonly-document .flow-approval-content-section > header {
  background: #202c3a !important;
  border-color: #34404f !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview :is(
  .flow-approval-title-block strong,
  .flow-approval-header-amount > strong,
  .flow-approval-content-section > header strong,
  .flow-approval-context-strip > div > strong,
  .flow-approval-business-details dd,
  .flow-approval-account-section dd
) {
  color: #f2f4f7 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview :is(
  .flow-approval-title-block small,
  .flow-approval-title-block p,
  .flow-record-document-number,
  .flow-approval-amount-note,
  .flow-approval-content-section > header span,
  .flow-approval-context-strip > div > span,
  .flow-approval-context-strip > div > small,
  .flow-approval-business-details dt,
  .flow-approval-account-section dt
) {
  color: #b8c2cf !important;
}

/* Global read-only density authority 2026-08-29.
 * Data rows stay compact; long business values alone are allowed to grow.
 */
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
  min-height: 64px !important;
  gap: 8px !important;
  padding: 6px 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-record-preview-main {
  padding: 6px !important;
}

.flow-readonly-document .flow-approval-content-section > header {
  min-height: 28px !important;
  gap: 6px !important;
  padding: 3px 8px !important;
}

.flow-readonly-document .flow-approval-content-section > header strong {
  font-size: 13px !important;
  line-height: 1.25 !important;
}

.flow-readonly-document .flow-approval-content-section > header span {
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.flow-readonly-document .flow-approval-context-strip > div {
  min-height: 30px !important;
  grid-template-columns: 104px minmax(0, 1fr) !important;
  gap: 0 6px !important;
  padding: 2px 8px !important;
}

.flow-readonly-document .flow-approval-context-strip > div > span,
.flow-readonly-document .flow-approval-context-strip > div > strong {
  font-size: 12px !important;
  line-height: 1.25 !important;
}

.flow-readonly-document .flow-approval-context-strip > div > small {
  font-size: 11px !important;
  line-height: 1.2 !important;
}

.flow-readonly-document .flow-approval-business-details > div {
  min-height: 30px !important;
  grid-template-columns: 104px minmax(0, 1fr) !important;
  padding: 0 !important;
}

.flow-readonly-document .flow-approval-business-details :is(dt, dd) {
  padding: 4px 8px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}

.flow-readonly-document .flow-approval-account-section dl > div {
  min-height: 30px !important;
  grid-template-columns: 92px minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 0 !important;
}

.flow-readonly-document .flow-approval-account-section :is(dt, dd) {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  overflow-wrap: anywhere !important;
}

.flow-readonly-document .flow-approval-account-section dt {
  justify-content: flex-end !important;
  text-align: right !important;
  border-right: 1px solid #e5e9ee !important;
}

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

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

.flow-readonly-document .flow-approval-timeline-list {
  padding: 4px 8px 6px !important;
}

.flow-readonly-document .flow-approval-timeline-list li {
  padding-block: 2px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}

.flow-readonly-document :is(
  .flow-approval-detail-section,
  .flow-approval-attachments-section
) .empty-state {
  min-height: 32px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-preview-action-bar {
  min-height: 44px !important;
  padding: 4px 8px !important;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-head {
  min-height: 48px !important;
  padding: 6px 10px !important;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card {
  min-height: 58px !important;
  align-content: center !important;
  gap: 1px !important;
  padding: 6px 10px !important;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card > :is(span, small) {
  font-size: 11px !important;
  line-height: 1.2 !important;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card > strong {
  font-size: 18px !important;
  line-height: 1.2 !important;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-table > .flow-section-title {
  min-height: 30px !important;
  padding: 4px 8px !important;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-table :is(.data-table, table) :is(th, td),
body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-table :is(.summary-row, .compact-item) {
  min-height: 30px !important;
  padding: 4px 8px !important;
  line-height: 1.3 !important;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-table .empty-state {
  min-height: 36px !important;
  padding: 6px 8px !important;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview > .flow-record-preview-head {
    min-height: 0 !important;
    padding: 6px 8px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-document-preview .flow-record-preview-main {
    padding: 4px !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: 88px minmax(0, 1fr) !important;
  }

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