/* Shared desktop appearance. Load after feature styles; keep business layouts,
   state colors, mobile controls and printed documents in their own stylesheets. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview {
    --ui-primary: #175fc6;
    --ui-ink: #20344b;
    --ui-muted: #64748b;
    --ui-border: #dbe3ef;
    --ui-soft: #f5f7fa;
    --ui-radius: 6px;
    --brand: var(--ui-primary);
    --brand-dark: #124b9c;
    --muted: var(--ui-muted);
    font-size: 14px;
  }
  /* Equal type within each navigation level, with a larger parent label.
     Badge counts and disclosure arrows keep their own sizing. */
  body.pc-ui-preview .tabs button { font-family: inherit; }
  body.pc-ui-preview .tabs .desktop-nav-group-toggle { font-size: 15px; font-weight: 700; color: #d6deea; }
  body.pc-ui-preview .tabs .desktop-nav-items { padding-left: 20px; }
  body.pc-ui-preview .tabs .desktop-nav-items > button[data-tab] { font-size: 13px; font-weight: 400; color: #b8c6d8; }
  body.pc-ui-preview .tabs .desktop-nav-items > button[data-tab]:is(.active,:hover) { color: #fff; }
  body.pc-ui-preview .tabs .tab-button-label,
  body.pc-ui-preview .tabs .desktop-nav-group-toggle > span:first-child { font: inherit; }
  body.pc-ui-preview :is(:where(#content),.preview-modal-card,.bf-modal,.cw-modal,.cd-modal,.qd-modal,.mw-modal,.ca-modal,.ca-detail-overlay,.fw-modal,.iv-modal,.reim-modal) :is(input,select,textarea,button):not(:where(.mr-report *,.ar-report *,.ir-report *)) {
    font-family: inherit;
  }
  body.pc-ui-preview :where(#content) > .panel,
  body.pc-ui-preview :where(#content) .page-hero { border-color: var(--ui-border); border-radius: var(--ui-radius); }
  body.pc-ui-preview :where(#content) > .panel > h3,
  body.pc-ui-preview :where(#content) .section-head > h3,
  body.pc-ui-preview .material-todo-section h3,
  body.pc-ui-preview .dw-classic-section-head h2 { font-size: 15px; color: var(--ui-ink); }
  body.pc-ui-preview :is(.cw-toolbar h2,.client-page-panel > .section-head h3,.client-page-panel > h3,.quote-list-panel > .section-head h3,.ca-project-heading h2) { font-size: 18px; color: var(--ui-ink); }
  body.pc-ui-preview :where(#content) :is(table,th,td):not(:where(.mr-report *,.ar-report *,.ir-report *,.quote-summary-table *)) { font-size: 13px; }
  body.pc-ui-preview :where(#content) th:not(:where(.mr-report *,.ar-report *,.ir-report *)) { font-weight: 600; }
  body.pc-ui-preview :is(:where(#content),.preview-modal-card) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]),select:not([multiple])):not(:where(.mr-report *,.ar-report *,.ir-report *)) {
    min-height: 34px; padding: 5px 10px; font-size: 13px; border-radius: var(--ui-radius);
  }
  body.pc-ui-preview :is(:where(#content),.preview-modal-card) textarea:not(:where(.mr-report *,.ar-report *,.ir-report *)) { font-size: 13px; border-radius: var(--ui-radius); }
  body.pc-ui-preview :is(:where(#content),.preview-modal-card) :is(input,select,textarea):not([aria-invalid="true"]):focus-visible { outline: 2px solid #175fc633; outline-offset: 1px; border-color: var(--ui-primary); }
  body.pc-ui-preview :is(:where(#content),.preview-modal-card) button.secondary:not(:where(.active,.selected,.is-active,.danger,[aria-pressed="true"],[aria-selected="true"],[aria-current="page"],.stat-action,.mr-report *,.ar-report *,.ir-report *)) {
    background: #fff; color: var(--ui-primary); border: 1px solid var(--ui-border);
  }
  body.pc-ui-preview :is(:where(#content),.preview-modal-card) button.secondary:not(:where(.active,.selected,.is-active,.danger,[aria-pressed="true"],[aria-selected="true"],[aria-current="page"],.stat-action,.mr-report *,.ar-report *,.ir-report *)):hover:not(:disabled) { background: #f1f5fc; border-color: #b7ccec; }
  body.pc-ui-preview :where(#content) button.tiny:not(:where(.stat-action,.mr-report *,.ar-report *,.ir-report *)) { font-size: 13px; border-radius: var(--ui-radius); }
  body.pc-ui-preview .quote-create-toggle,
  body.pc-ui-preview .client-create-toggle { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: var(--ui-radius); }
  body.pc-ui-preview :is(.quote-create-toggle,.client-create-toggle):hover { background: #124b9c; border-color: #124b9c; }
  body.pc-ui-preview .report-workspace #rwQuery { background: var(--ui-primary); min-height: 34px; height: 34px; padding: 5px 12px; font-size: 13px; border-radius: var(--ui-radius); }
  body.pc-ui-preview :is(.mw-workspace,.mw-modal) { --mw-teal: var(--ui-primary); --mw-ink: var(--ui-ink); }
  body.pc-ui-preview .mw-workspace .mw-tabs button.active,
  body.pc-ui-preview .mw-workspace .mw-toolbar button:not(.secondary) { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; box-shadow: none; }
  body.pc-ui-preview .mw-workspace .mw-tabs button,
  body.pc-ui-preview .mw-workspace .mw-toolbar button,
  body.pc-ui-preview .mw-workspace .mw-head .mw-actions > button,
  body.pc-ui-preview .mw-start > button { min-height: 34px; padding: 6px 12px; border-radius: var(--ui-radius); font-size: 13px; line-height: 20px; }
  body.pc-ui-preview .mw-start { background: #fff; border-color: var(--ui-border); }
  body.pc-ui-preview .mw-workspace .mw-eyebrow { color: var(--ui-muted); letter-spacing: normal; }
}

/* 204 candidate: business/execution appearance only; merge after existing sheets.
   Desktop only. No grid, widths, sticky behavior, pagination or business state changes.
   Report roots are deliberately absent; report modals are excluded where broad form selectors are needed. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview :is(.client-page-panel,.client-detail-workspace,.quote-editor-refined,.ca-workspace,.ca-modal,.ca-detail-overlay,.cd-modal,.qd-dialog) {
    color: var(--ui-ink); font-family: inherit; font-size: 14px;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table,
  body.pc-ui-preview :is(.mw-assessment-simple,.mw-inspection-association),
  body.pc-ui-preview .mw-workspace:has(.ma-app),
  body.pc-ui-preview .mw-workspace:has(.ma-project-list) { font-family: inherit; }

  /* Customer and quotation navigation: remove the isolated teal action theme. */
  body.pc-ui-preview .client-page-panel .client-page-actions > .client-create-toggle,
  body.pc-ui-preview .client-detail-workspace .client-detail-actions > .client-detail-primary {
    background: var(--ui-primary); border-color: var(--ui-primary); color: #fff;
  }
  body.pc-ui-preview .client-detail-workspace .client-detail-tabs > button[aria-selected="true"] {
    color: var(--ui-primary); border-bottom-color: var(--ui-primary);
  }
  body.pc-ui-preview .client-detail-workspace .client-detail-tabs > button:hover,
  body.pc-ui-preview .client-detail-view .client-intent-history > summary:hover > strong,
  body.pc-ui-preview .client-detail-view .client-business-group > summary:hover strong { color: var(--ui-primary); }
  body.pc-ui-preview .client-detail-workspace button:focus-visible,
  body.pc-ui-preview .client-detail-view .client-back-to-list:focus-visible,
  body.pc-ui-preview .client-detail-view .client-intent-history > summary:focus-visible,
  body.pc-ui-preview .client-page-panel .client-list-controls > .cards .stat-action:focus-visible { outline-color: var(--ui-primary); }
  body.pc-ui-preview .quote-editor-refined .quote-form-head h3,
  body.pc-ui-preview .qd-header h2 { color: var(--ui-ink); font-size: 18px; }
  body.pc-ui-preview .quote-editor-refined,
  body.pc-ui-preview .quote-editor-refined .quote-summary-layout,
  body.pc-ui-preview .quote-editor-refined .quote-summary-layout:has(.quote-summary-sheet-customer),
  body.pc-ui-preview .qd-dialog { border-color: var(--ui-border); border-radius: var(--ui-radius); }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav { border-color: var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-soft); }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a.is-active > span { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a:focus-visible,
  body.pc-ui-preview .quote-editor-refined .quote-form-head-actions button:focus-visible { outline-color: var(--ui-primary); }
  body.pc-ui-preview .quote-editor-refined .quote-form-head-actions button:hover { color: var(--ui-primary); border-color: var(--ui-border); background: var(--ui-soft); }
  body.pc-ui-preview .quote-editor-refined .quote-form-head-actions button,
  body.pc-ui-preview .quote-editor-refined .quote-form-save-actions button,
  body.pc-ui-preview .qd-header button { min-height: 34px; padding: 6px 12px; border-radius: var(--ui-radius); font-size: 13px; line-height: 20px; }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a > span { font-size: 12px; }
  body.pc-ui-preview .quote-editor-refined .quote-customer-total td,
  body.pc-ui-preview .qd-summary > strong { color: var(--ui-ink); font-size: 24px; }
  /* Quote totals are summary metrics, not ordinary 13px table cells. */
  body.pc-ui-preview .quote-editor-refined .quote-summary-table td { font-size: 16px; }
  body.pc-ui-preview .quote-editor-refined .quote-customer-total td { font-size: 24px; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table th { font-size: 12px; color: var(--ui-muted); }

  /* Contract/project detail: retain already confirmed compact card structure. */
  body.pc-ui-preview .cd-shell,
  body.pc-ui-preview .cd-confirm section { border-radius: var(--ui-radius); }
  body.pc-ui-preview .cd-header h2 { font-size: 18px; color: var(--ui-ink); }
  body.pc-ui-preview .cd-modal .cd-button { min-height: 34px; padding: 6px 12px; border-radius: var(--ui-radius); font-size: 13px; line-height: 20px; }
  body.pc-ui-preview .cd-badge { border-radius: var(--ui-radius); font-size: 12px; }
  body.pc-ui-preview .cd-footer > .cd-actions:last-child > .cd-button:last-child,
  body.pc-ui-preview .cd-sign-form button[type=submit],
  body.pc-ui-preview .cd-template-layout button[type=submit] { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
  body.pc-ui-preview .cd-steps .cd-button[aria-current] { background: var(--ui-soft); border-color: var(--ui-border); color: var(--ui-primary); }
  body.pc-ui-preview .project-contract-detail-panel[data-detail-refined="true"] {
    --detail-ink: var(--ui-ink); --detail-muted: var(--ui-muted); --detail-line: var(--ui-border); --detail-action: var(--ui-primary);
    font-size: 14px;
  }
  body.pc-ui-preview .project-contract-detail-panel[data-detail-refined="true"] :is(.project-detail-hero,.receivable-detail-block,.project-detail-workflow,.project-detail-costs,.project-detail-documents) { border-radius: var(--ui-radius); }
  body.pc-ui-preview .project-contract-detail-panel[data-detail-refined="true"] .project-cost-table :is(th,td) { font-size: 13px; }
  body.pc-ui-preview .project-contract-detail-panel[data-detail-refined="true"] .project-cost-table :is(input,select) { border-radius: var(--ui-radius); }
  body.pc-ui-preview .project-profile-field > small,
  body.pc-ui-preview .project-cost-analysis-panel .project-cost-amount-link small,
  body.pc-ui-preview .project-cost-analysis-panel .project-cost-category-link > span,
  body.pc-ui-preview .cd-template-item small { font-size: 12px; }

  /* Tasks: these exact selectors override the late .task-detail-refined rules. */
  body.pc-ui-preview .execution-page-intro h2,
  body.pc-ui-preview .task-workspace-heading h2,
  body.pc-ui-preview .task-detail-heading h2,
  body.pc-ui-preview .task-detail-refined .task-detail-heading h2 { font-size: 18px; color: var(--ui-ink); }
  body.pc-ui-preview .execution-panel-head h3,
  body.pc-ui-preview .execution-list-heading h4,
  body.pc-ui-preview .task-detail-section > :is(h3,h4),
  body.pc-ui-preview .task-detail-section .task-history-title,
  body.pc-ui-preview .task-detail-refined .task-acceptance-copy h3,
  body.pc-ui-preview .device-task-context h3 { font-size: 15px; color: var(--ui-ink); }
  body.pc-ui-preview .task-workspace-board,
  body.pc-ui-preview .task-detail-section,
  body.pc-ui-preview .task-detail-refined .task-detail-header,
  body.pc-ui-preview .task-detail-refined .task-detail-auxiliary { border-color: var(--ui-border); border-radius: var(--ui-radius); }
  /* Preserve borderless nested groups; the common section rule above must not round them. */
  body.pc-ui-preview .task-detail-refined :is(.task-detail-basics,.task-detail-requirements,.task-asset-ledger-link),
  body.pc-ui-preview .task-detail-refined .task-detail-auxiliary > .task-detail-section { border-radius: 0; }
  body.pc-ui-preview .task-detail-view .task-schedule-field > :is(input,select):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([multiple]),
  body.pc-ui-preview .task-detail-refined .task-schedule-field > :is(input,select):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([multiple]),
  body.pc-ui-preview .task-workspace-board .task-list-filter-form > :is(input,select) {
    height: 34px; min-height: 34px; padding: 6px 10px; border-color: var(--ui-border); border-radius: var(--ui-radius); font-size: 13px; line-height: 20px;
  }
  body.pc-ui-preview .task-detail-view .task-schedule-field > textarea,
  body.pc-ui-preview .task-detail-refined .task-schedule-field > textarea { border-color: var(--ui-border); border-radius: var(--ui-radius); font-size: 13px; }
  body.pc-ui-preview .task-detail-submit-actions > button,
  body.pc-ui-preview .task-detail-refined .task-accept-action,
  body.pc-ui-preview .task-workspace-header .execution-create-toggle,
  body.pc-ui-preview .task-workspace-board .task-list-filter-form > button { min-height: 34px; padding: 6px 12px; border-radius: var(--ui-radius); font-size: 13px; line-height: 20px; }
  body.pc-ui-preview .task-detail-refined .task-detail-fields dd { font-size: 14px; color: var(--ui-ink); }
  body.pc-ui-preview .task-detail-history .task-history-meta,
  body.pc-ui-preview .task-detail-history .task-history-head .badge,
  body.pc-ui-preview .task-arrangement-hint,
  body.pc-ui-preview .task-arrangement-overdue,
  body.pc-ui-preview #taskForm .task-project-menu small { font-size: 12px; }
  body.pc-ui-preview .task-detail-refined .task-detail-compose .task-asset-completion,
  body.pc-ui-preview .device-replacement,
  body.pc-ui-preview .device-scope-dialog { border-color: var(--ui-border); border-radius: var(--ui-radius); }

  /* Original device ledger: remove the late enlarged detail/table override. */
  body.pc-ui-preview .ca-header h2,
  body.pc-ui-preview .ca-detail-overlay h2 { font-size: 18px; color: var(--ui-ink); }
  body.pc-ui-preview .ca-detail-overlay h3 { font-size: 15px; color: var(--ui-ink); }
  body.pc-ui-preview .ca-dialog,
  body.pc-ui-preview .ca-detail-overlay > .ca-detail-page { border-radius: var(--ui-radius); font-size: 14px; }
  body.pc-ui-preview .ca-detail-overlay .ca-detail-summary { font-size: 14px; }
  body.pc-ui-preview .ca-detail-overlay .ca-detail-table,
  body.pc-ui-preview .ca-detail-overlay .ca-detail-table :is(th,td) { font-size: 13px; }
  body.pc-ui-preview .ca-detail-overlay .cal-position-table td:nth-child(2),
  body.pc-ui-preview .ca-detail-overlay .cal-position-table td:first-child > strong,
  body.pc-ui-preview .ca-detail-overlay .cal-position-table tfoot td:nth-child(2),
  body.pc-ui-preview .ca-table tfoot strong,
  body.pc-ui-preview .ca-summary > strong { font-size: 14px; color: var(--ui-ink); }
  body.pc-ui-preview .ca-detail-overlay small,
  body.pc-ui-preview .ca-detail-overlay .ca-section-note,
  body.pc-ui-preview .ca-detail-overlay .cal-badge,
  body.pc-ui-preview .cal-rule-settings > .ca-section-note,
  body.pc-ui-preview .cal-position-table small,
  body.pc-ui-preview .cal-position-table .cal-badge,
  body.pc-ui-preview .cal-entry-summaries,
  body.pc-ui-preview .cal-entry-selector .cal-entry-hint,
  body.pc-ui-preview .cal-remind-row > span { font-size: 12px; }
  body.pc-ui-preview .cal-rule-row label { font-size: 12px !important; }
  body.pc-ui-preview .cal-position-table .cal-actions button,
  body.pc-ui-preview .cal-summary-table td:last-child button { font-size: 13px; min-height: 32px; padding: 4px 8px; border-radius: var(--ui-radius); }

  /* Technical service workspace/form chrome. Do not normalize report content. */
  body.pc-ui-preview .mw-head h2,
  body.pc-ui-preview .mw-modal > section > header h2 { font-size: 18px; color: var(--ui-ink); }
  body.pc-ui-preview .mw-panel,
  body.pc-ui-preview .mw-entry,
  body.pc-ui-preview .mw-device,
  body.pc-ui-preview .mw-stats > div,
  body.pc-ui-preview .mw-modal > section { border-color: var(--ui-border); border-radius: var(--ui-radius); }
  body.pc-ui-preview .mw-workspace:not(:has(.mr-report,.ar-report,.ir-report)) .mw-toolbar :is(input,select),
  body.pc-ui-preview .mw-modal:not(:has(.mr-report,.ar-report,.ir-report)) .mw-form :is(input,select):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([multiple]) {
    min-height: 34px; padding: 6px 10px; border-color: var(--ui-border); border-radius: var(--ui-radius); font-size: 13px; line-height: 20px;
  }
  body.pc-ui-preview .mw-workspace .mw-head .mw-actions > button:not(.secondary),
  body.pc-ui-preview .mw-modal:not(:has(.mr-report,.ar-report,.ir-report)) .mw-form > .mw-actions > button[type=submit]:not(.secondary):not(.mw-danger-submit),
  body.pc-ui-preview .mw-start > button { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
  body.pc-ui-preview .mw-workspace .mw-task-actions > button,
  body.pc-ui-preview .mw-modal:not(:has(.mr-report,.ar-report,.ir-report)) .mw-form > .mw-actions > button { min-height: 34px; height: auto; padding: 6px 12px; border-radius: var(--ui-radius); font-size: 13px; line-height: 20px; }
  body.pc-ui-preview .mw-subheading h3,
  body.pc-ui-preview .mw-start h3,
  body.pc-ui-preview .mw-device h3 { font-size: 15px; color: var(--ui-ink); }
  body.pc-ui-preview .mw-review-status-copy > small,
  body.pc-ui-preview .mw-review-status-actions > small,
  body.pc-ui-preview .mw-review-decision-actions small { font-size: 12px; }

  /* Association work apps have red theme vars shared with failure states.
     Override only action/navigation chrome; NEVER redefine --ia-red/--as-red. */
  body.pc-ui-preview .mw-inspection-association .ia-header,
  body.pc-ui-preview .mw-assessment-simple .as-header,
  body.pc-ui-preview .mw-workspace .ma-header { background: var(--ui-primary); color: #fff; }
  body.pc-ui-preview .mw-inspection-association .ia-header h2,
  body.pc-ui-preview .mw-assessment-simple .as-header h2,
  body.pc-ui-preview .mw-workspace .ma-header h2 { color: #fff; font-size: 18px !important; }
  body.pc-ui-preview .mw-inspection-association .ia-primary,
  body.pc-ui-preview .mw-assessment-simple .as-primary { background: var(--ui-primary) !important; border-color: var(--ui-primary) !important; color: #fff !important; border-radius: var(--ui-radius); font-size: 13px; }
  body.pc-ui-preview .mw-inspection-association .ia-system-tabs button.selected,
  body.pc-ui-preview .mw-inspection-association .ia-list-tabs button.active,
  body.pc-ui-preview .mw-assessment-simple .as-system-tabs button.selected,
  body.pc-ui-preview .mw-workspace .ma-signin .ma-sign-button,
  body.pc-ui-preview .mw-workspace .ma-portrait-capture,
  body.pc-ui-preview .mw-workspace .ma-enter,
  body.pc-ui-preview .mw-workspace .ma-pages button.active,
  body.pc-ui-preview .mw-workspace .ma-bottom button:last-child,
  body.pc-ui-preview .mw-workspace .ma-retest-form .ma-retest-save { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
  body.pc-ui-preview .mw-workspace .ma-month-grid button.is-current { border-color: var(--ui-primary); background: var(--ui-soft); }
  body.pc-ui-preview .mw-inspection-association .ia-app :is(input,textarea,select):focus { outline-color: var(--ui-primary); border-color: var(--ui-primary); }
  body.pc-ui-preview .mw-inspection-association .ia-point-label,
  body.pc-ui-preview .mw-assessment-simple .as-point-label,
  body.pc-ui-preview .mw-assessment-simple .as-system-title small { font-size: 12px; }

  /* Two surviving legacy inline card styles require exact, bounded overrides. */
  body.pc-ui-preview .maintenance-entry-card,
  body.pc-ui-preview #maintenanceRepairTaskEntryList > .project-permission-option {
    border-color: var(--ui-border) !important; border-radius: var(--ui-radius) !important; background: var(--ui-soft) !important;
  }
}

/* 204 review proposal, desktop only. Merge after loaded component styles.
 * No DOM, column sizing, grid, overflow, positioning or business changes.
 * Selected main amount metrics use 24px; semantic warning/danger colors,
 * textareas and mobile touch targets keep their existing behavior.
 */
@media screen and (min-width: 769px) {
  body.pc-ui-preview .finance-a-hero,
  body.pc-ui-preview .finance-a-funds > .page-hero {
    background: #fff;
    border-color: var(--ui-border, #dbe3ef);
    border-left-color: var(--ui-primary, #175fc6);
    border-radius: var(--ui-radius, 6px);
  }
  body.pc-ui-preview .finance-a-eyebrow { color: var(--ui-primary, #175fc6); font-size: 12px; }

  /* Page headings: do not target every h3; detail sections remain smaller. */
  body.pc-ui-preview .finance-a-hero h3,
  body.pc-ui-preview .finance-a-receivables.receivable-workspace .receivable-overview-panel h3,
  body.pc-ui-preview .fw-header h3,
  body.pc-ui-preview .report-workspace .rw-header h2,
  body.pc-ui-preview .reimbursements-page .reim-list-head h2,
  body.pc-ui-preview .purchase-a-shell .page-hero-title,
  body.pc-ui-preview .issue-workspace-heading h2,
  body.pc-ui-preview .fa-summary > .fa-heading h3 {
    font-size: 18px;
    color: var(--ui-ink, #20344b);
  }
  body.pc-ui-preview .finance-a-form-heading h4,
  body.pc-ui-preview .finance-a-funds .section-head h3,
  body.pc-ui-preview .reimbursements-page .reim-list h3,
  body.pc-ui-preview .finance-a-receivables.receivable-workspace .receivable-list-panel .section-head h3,
  body.pc-ui-preview .finance-a-receivables.receivable-workspace .receivable-create-panel .section-head h3,
  body.pc-ui-preview .finance-a-section-head h4,
  body.pc-ui-preview .finance-a-result-heading h4,
  body.pc-ui-preview .finance-a-reimbursements .finance-a-list-panel > h4,
  body.pc-ui-preview .report-workspace .rw-metric-group h3,
  body.pc-ui-preview .report-workspace .rw-section-head h3,
  body.pc-ui-preview .purchase-a-shell .section-head h3,
  body.pc-ui-preview .material-table-head :is(h3,h4),
  body.pc-ui-preview .issue-material-body .section-head h3,
  body.pc-ui-preview .issue-material-body .panel > h3,
  body.pc-ui-preview .ai-heading h3,
  body.pc-ui-preview .fa-workspace .panel:not(.fa-summary) .fa-heading h3,
  body.pc-ui-preview .fa-detail h4 {
    font-size: 15px;
    color: var(--ui-ink, #20344b);
  }

  /* Existing white cards stay white; special alerts are not recolored. */
  body.pc-ui-preview .finance-a-page > .panel,
  body.pc-ui-preview .finance-a-receivables.receivable-workspace > .panel,
  body.pc-ui-preview .fw-workspace,
  body.pc-ui-preview .report-workspace,
  body.pc-ui-preview .a-operation-form,
  body.pc-ui-preview .material-a-detail,
  body.pc-ui-preview .purchase-a-detail,
  body.pc-ui-preview .purchase-a-shell .purchase-overview-cards,
  body.pc-ui-preview .fa-stats > div,
  body.pc-ui-preview .reimbursements-page #reimForm {
    border-radius: var(--ui-radius, 6px);
    border-color: var(--ui-border, #dbe3ef);
  }
  body.pc-ui-preview .fw-workspace,
  body.pc-ui-preview .report-workspace,
  body.pc-ui-preview .reimbursements-page,
  body.pc-ui-preview .fa-workspace,
  body.pc-ui-preview .ai-workspace { font-size: 14px; color: var(--ui-ink, #20344b); }
  body.pc-ui-preview .report-workspace {
    --rw-ink: var(--ui-ink, #20344b);
    --rw-line: var(--ui-border, #dbe3ef);
    --rw-blue: var(--ui-primary, #175fc6);
  }
  body.pc-ui-preview .finance-a-receivables.receivable-workspace {
    --rl-ink: var(--ui-ink, #20344b);
    --rl-line: var(--ui-border, #dbe3ef);
  }
  body.pc-ui-preview .report-workspace .rw-metric strong,
  body.pc-ui-preview .report-workspace #reportResult > .cards .stat .num,
  body.pc-ui-preview .receivable-workspace .receivable-primary-metric > strong,
  body.pc-ui-preview .fw-metric strong { font-size: 24px; }

  body.pc-ui-preview .fw-workspace table,
  body.pc-ui-preview .report-workspace table,
  body.pc-ui-preview .iv-table-wrap table,
  body.pc-ui-preview .fa-table,
  body.pc-ui-preview .ai-table,
  body.pc-ui-preview .ai-table strong,
  body.pc-ui-preview .purchase-a-shell .purchase-list-table,
  body.pc-ui-preview .material-inventory-table,
  body.pc-ui-preview .issue-material-body table { font-size: 13px; }
  body.pc-ui-preview .ai-table th { font-size: 13px; }
  body.pc-ui-preview .finance-a-receivables.receivable-workspace .receivable-ledger-table > thead > tr > th,
  body.pc-ui-preview .finance-a-receivables.receivable-workspace .receivable-item-cell > strong { font-size: 13px; }
  body.pc-ui-preview .fw-workspace small,
  body.pc-ui-preview .fa-table small,
  body.pc-ui-preview .fa-detail small,
  body.pc-ui-preview .reim-table small,
  body.pc-ui-preview .iv-table-wrap small,
  body.pc-ui-preview .issue-workspace-heading p,
  body.pc-ui-preview .finance-a-hero p { font-size: 12px; }

  /* Only normal buttons; tabs, metric cards and text links retain geometry. */
  body.pc-ui-preview .finance-a-create-toggle,
  body.pc-ui-preview .finance-a-jump-list,
  body.pc-ui-preview .purchase-a-shell .section-head button,
  body.pc-ui-preview .purchase-a-shell .purchase-table-action-group button,
  body.pc-ui-preview .a-operation-submit,
  body.pc-ui-preview .issue-material-body .material-section-toggle,
  body.pc-ui-preview .issue-material-body .grid > button,
  body.pc-ui-preview .fw-header button,
  body.pc-ui-preview .fw-tools button,
  body.pc-ui-preview .fw-tabs button,
  body.pc-ui-preview .fw-dialog button,
  body.pc-ui-preview .reim-actions button,
  body.pc-ui-preview .reim-modal button,
  body.pc-ui-preview .iv-actions button,
  body.pc-ui-preview .iv-footer button,
  body.pc-ui-preview .iv-shell > header button,
  body.pc-ui-preview .reimbursements-page .reim-filters > button,
  body.pc-ui-preview .fa-workspace button,
  body.pc-ui-preview .ai-workspace button:not(.ai-text-button):not(.ai-tabs button) {
    min-height: 32px;
    border-radius: var(--ui-radius, 6px);
    padding: 5px 10px;
    font-size: 13px;
  }
  body.pc-ui-preview :is(.fw-workspace,.fw-dialog,.iv-modal,.iv-workspace,.purchase-a-shell,.issue-material-body) button.secondary:not(.danger):not([aria-pressed="true"]) {
    color: var(--ui-primary, #175fc6);
    background: #fff;
    border-color: var(--ui-border, #dbe3ef);
  }
  body.pc-ui-preview .fa-row-actions button,
  body.pc-ui-preview .ai-table .ai-actions button,
  body.pc-ui-preview .fw-workspace td button,
  body.pc-ui-preview .reim-row-actions button,
  body.pc-ui-preview .iv-table-wrap td button {
    min-height: 32px;
    border-radius: var(--ui-radius, 6px);
    padding: 5px 8px;
    font-size: 13px;
  }
  body.pc-ui-preview .reim-actions [type="submit"],
  body.pc-ui-preview .ai-workspace button[data-ai="assign"],
  body.pc-ui-preview .ai-workspace button[data-ai="return"],
  body.pc-ui-preview .fw-tabs button[aria-pressed="true"],
  body.pc-ui-preview .fw-workspace[data-view="settlements"] .fw-month button,
  body.pc-ui-preview .iv-actions [aria-pressed="true"] {
    background: var(--ui-primary, #175fc6);
    border-color: var(--ui-primary, #175fc6);
    color: #fff;
  }
  body.pc-ui-preview .issue-workspace-tabs button[aria-pressed="true"],
  body.pc-ui-preview .ai-tabs button[aria-pressed="true"] {
    color: var(--ui-primary, #175fc6);
    border-bottom-color: var(--ui-primary, #175fc6);
  }
  body.pc-ui-preview .fa-editor,
  body.pc-ui-preview .ai-editor { border-left-color: var(--ui-primary, #175fc6) !important; }

  /* Never apply field height to checkbox/radio/file/hidden inputs or textarea. */
  body.pc-ui-preview :is(.fw-dialog,.fw-tools,.reimbursements-page,.reim-modal,.fa-form,.fa-filters,.ai-editor,.ai-filters,.iv-form,.iv-page-filters,.purchase-filter-strip,.a-operation-form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]),select) {
    min-height: 34px;
    padding: 5px 10px;
    border-radius: var(--ui-radius, 6px);
    font-size: 13px;
  }
  body.pc-ui-preview .report-workspace :is(input:not([type="checkbox"]),select) {
    height: 34px;
    min-height: 34px;
    padding: 5px 10px;
    font-size: 13px;
  }
  body.pc-ui-preview .finance-a-receivables.receivable-workspace .receivable-filter-strip :is(input,select) {
    height: 34px;
    min-height: 34px;
    padding: 5px 10px;
    font-size: 13px;
  }

  /* Detached dialogs require explicit scopes; they are not in page wrappers. */
  body.pc-ui-preview .fw-dialog,
  body.pc-ui-preview .iv-shell,
  body.pc-ui-preview .reim-modal > section,
  body.pc-ui-preview .report-workspace .rw-dialog,
  body.pc-ui-preview #receivableReceiptModal .receivable-receipt-card,
  body.pc-ui-preview .purchase-arrival-summary {
    border-radius: var(--ui-radius, 6px);
  }
  body.pc-ui-preview .fw-dialog header h3,
  body.pc-ui-preview .iv-shell h2,
  body.pc-ui-preview .reim-modal h3,
  body.pc-ui-preview .report-workspace .rw-dialog > header h3,
  body.pc-ui-preview #receivableReceiptModal .receivable-receipt-heading h3 {
    font-size: 18px;
    color: var(--ui-ink, #20344b);
  }
  body.pc-ui-preview #receivableReceiptModal .receivable-receipt-form :is(input,select) {
    min-height: 34px;
    padding: 5px 10px;
    border-radius: var(--ui-radius, 6px);
    font-size: 13px;
  }
  body.pc-ui-preview #receivableReceiptModal .receivable-receipt-footer button {
    min-height: 32px;
    padding: 5px 10px;
    border-radius: var(--ui-radius, 6px);
    font-size: 13px;
  }
}

/* 204 support/dialog fragment. Source-only preparation; merge into last-loaded system-ui.css.
   Screen desktop only. No document/iframe contents, print rules, layout or permission changes. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview :is(.ep-workspace,.payroll-workspace,.support-users-page,.support-attendance-page,.proposal-file-library,.venue-template-library,.venue-template-editor,[id^="supportSystemSection"]) {
    font-size:14px; line-height:1.55; color:var(--ui-ink);
  }
  body.pc-ui-preview :is(.ep-workspace>.panel:first-child>.ep-heading>h3,.ep-workspace>.panel:first-child>h3,.payroll-heading h2,.support-users-page>h3,.support-attendance-page>h3,.support-proposal-upload>h3,.support-proposal-list>h3,.venue-template-library>h3,.venue-template-editor>h3,#supportSystemSection1>h3) {
    font-size:18px; font-weight:600; line-height:1.4; color:var(--ui-ink);
  }
  body.pc-ui-preview :is(.ep-editor>.ep-heading>h3,.ep-detail>.ep-heading>h3,.ep-detail h4,.support-users-subtitle,.support-employee-form-section h4,.attendance-settings-title-row h4,.attendance-settings-head h4,.system-fold-toggle-row h4,[id^="supportSystemSection"]:not(#supportSystemSection1)>h3) {
    font-size:15px; font-weight:600; line-height:1.45; color:var(--ui-ink);
  }
  body.pc-ui-preview :is(.ep-filters,.ep-form,.payroll-filters) label,
  body.pc-ui-preview :is(.support-user-field,.support-employee-field,.support-proposal-field,.support-attendance-date)>span {
    font-size:13px; font-weight:500; color:var(--ui-ink);
  }
  body.pc-ui-preview :is(.ep-table-wrap,.payroll-table-wrap,.support-users-page,.support-attendance-page,.proposal-file-library,.venue-template-library,[id^="supportSystemSection"]) :is(th,td) {
    font-size:13px; line-height:1.5;
  }
  body.pc-ui-preview :is(.ep-table-wrap small,.ep-history small,.payroll-note,.payroll-status,.payroll-table-wrap td small,.payroll-heading p,.payroll-summary>span,.system-dingtalk-cards .stat-label,.proposal-file-filters label,.attendance-subtext) {
    font-size:12px; line-height:1.5;
  }
  body.pc-ui-preview :is(.ep-stats strong,.payroll-summary strong) { font-variant-numeric:tabular-nums; }
  body.pc-ui-preview .ep-stats strong { color:var(--ui-primary); }
  body.pc-ui-preview :is(.ep-menu summary,.ep-menu[open]>div,.attendance-admin-tools,.attendance-filter-strip,.attendance-settings-toggle-copy,.system-fold-toggle-copy,.attendance-pc-tip,.attendance-range-row,.system-file-picker,.support-system-nav,.support-employee-form-section,.user-permission-panel,.user-permission-group,.user-permission-item) {
    border-radius:var(--ui-radius); border-color:var(--ui-border);
  }
  body.pc-ui-preview :is(.ep-message,.ep-conflict) { border-radius:var(--ui-radius); }
  body.pc-ui-preview :is(.attendance-settings-toggle-copy,.system-fold-toggle-copy) { background:#fff; box-shadow:none; }
  body.pc-ui-preview :is(.attendance-settings-toggle,.system-fold-toggle):hover .attendance-settings-toggle-copy { border-color:var(--ui-border); box-shadow:none; }
  body.pc-ui-preview .attendance-settings-toggle-text { color:var(--ui-primary); border-color:var(--ui-border); border-radius:var(--ui-radius); }
  body.pc-ui-preview .venue-template-library .support-venue-selected>td { background:#eff4fc; }
  body.pc-ui-preview .venue-template-library .support-venue-selected>td:first-child { box-shadow:inset 3px 0 var(--ui-primary); }

  body.pc-ui-preview :is(.ep-form,.ep-filters,.payroll-filters,.proposal-file-filters,.support-user-field,.support-employee-field,.support-proposal-field,.support-attendance-date,#userForm,#userEditForm,#ourEntityForm,#ourAccountForm,#ourEntityEditForm,#ourAccountEditForm,#dingtalkConfigForm,#ownershipBackfillForm) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select):not([aria-invalid="true"]) {
    min-height:34px; padding:5px 10px; font-size:13px; border-color:var(--ui-border); border-radius:var(--ui-radius);
  }
  body.pc-ui-preview :is(.ep-form,.proposal-file-form,.venue-template-form,.support-employee-form,#ourEntityForm,#ourAccountForm,#ourEntityEditForm,#ourAccountEditForm) textarea:not([aria-invalid="true"]) {
    font-size:13px; border-color:var(--ui-border); border-radius:var(--ui-radius);
  }
  body.pc-ui-preview :is(.ep-workspace,.payroll-workspace,.support-users-page,.support-attendance-page,.proposal-file-library,.venue-template-library,.venue-template-editor,[id^="supportSystemSection"]) button:not(.attendance-settings-toggle):not(.system-fold-toggle),
  body.pc-ui-preview :is(.ep-menu summary,.support-system-nav>button,.cw-hr-toolbar button) {
    min-height:32px; font-size:13px; line-height:1.4; border-radius:var(--ui-radius);
  }
  body.pc-ui-preview .ep-menu[open]>div>button { text-align:left; white-space:normal; }
  body.pc-ui-preview .ep-workspace button:is([data-ep="export"],[data-ep="refresh"],[data-ep="detail"],[data-ep="edit"],[data-ep="close"],[data-ep="clear"],[data-ep="workflow"],[data-ep="download"],[data-ep="contract"],[data-ep="credentials"],[data-ep="offboarding"],[data-ep="payroll"]) {
    color:var(--ui-ink); background:#fff; border-color:var(--ui-border); font-weight:500;
  }
  body.pc-ui-preview .ep-workspace button:is([data-ep="export"],[data-ep="refresh"],[data-ep="detail"],[data-ep="edit"],[data-ep="close"],[data-ep="clear"],[data-ep="workflow"],[data-ep="download"],[data-ep="contract"],[data-ep="credentials"],[data-ep="offboarding"],[data-ep="payroll"]):hover {
    background:var(--ui-soft);
  }
  body.pc-ui-preview .payroll-workspace .payroll-primary { color:#fff; background:var(--ui-primary); border-color:var(--ui-primary); }
  body.pc-ui-preview .support-system-nav { background:var(--ui-soft); }
  body.pc-ui-preview .support-system-nav>button { color:var(--ui-ink); background:#fff; border-color:var(--ui-border); }
  body.pc-ui-preview :is(.cw-hr-toolbar>span,.user-permission-panel small) { font-size:12px; }

  body.pc-ui-preview .login-view { background:var(--ui-soft); }
  body.pc-ui-preview .login-view>.card { border-radius:var(--ui-radius); border-color:var(--ui-border); box-shadow:0 8px 24px #20344b0a; color:var(--ui-ink); font-size:14px; }
  body.pc-ui-preview .login-view>.card h1 { font-size:18px; line-height:1.4; color:var(--ui-ink); }
  body.pc-ui-preview .login-view :is(input,button) { min-height:34px; font-size:13px; border-radius:var(--ui-radius); }
  body.pc-ui-preview .login-view #loginBtn { background:var(--ui-primary); border-color:var(--ui-primary); }

  /* These modal shells are appended to body, outside #content. */
  body.pc-ui-preview :is(.preview-modal-card,.bf-modal .bf-shell,.cw-modal .cw-shell) { border-radius:8px; color:var(--ui-ink); font-size:14px; line-height:1.55; }
  body.pc-ui-preview :is(.preview-modal-card>h3,.system-dialog-header h3,.bf-modal .bf-header h2,.cw-modal .cw-header h2) { color:var(--ui-ink); font-size:18px; font-weight:600; line-height:1.4; }
  body.pc-ui-preview :is(.bf-modal .bf-section-heading h3,.bf-modal .bf-page-heading h3,.cw-modal .cw-body>h3,.cw-modal .cw-body>form>h3,.hr-attendance-preview h4) { font-size:15px; font-weight:600; line-height:1.45; }
  body.pc-ui-preview :is(.bf-modal .bf-field,.cw-modal .cw-field) { font-size:13px; }
  body.pc-ui-preview :is(.bf-modal .bf-table,.bf-modal .bf-table th,.cw-modal table,.cw-modal th,.hr-attendance-preview table) { font-size:13px; }
  body.pc-ui-preview :is(.bf-modal .bf-table small,.cw-modal td small,.cw-kicker) { font-size:12px; }
  body.pc-ui-preview :is(.bf-modal .bf-button,.cw-modal button) { min-height:32px; font-size:13px; line-height:1.4; border-radius:var(--ui-radius); }
  body.pc-ui-preview :is(.bf-modal .bf-primary,.cw-modal .cw-footer button[type=submit]) { background:var(--ui-primary); border-color:var(--ui-primary); color:#fff; }
  body.pc-ui-preview .bf-modal .bf-primary:hover { background:#124b9c; border-color:#124b9c; }
  body.pc-ui-preview .bf-modal .bf-tab.is-active { border-bottom-color:var(--ui-primary); color:var(--ui-primary); }
  body.pc-ui-preview .bf-modal :is(button,input,select,textarea):focus-visible { outline-color:var(--ui-primary); }
  /* WorkflowUI confirmation actions do not carry .bf-primary. */
  body.pc-ui-preview :is([id^="systemConfirm-"],[id^="systemAlert-"]) .system-dialog-actions [data-action="confirm"],
  body.pc-ui-preview [id^="systemPrompt-"] .system-dialog-actions button[type="submit"] { background:var(--ui-primary); border-color:var(--ui-primary); color:#fff; }
  body.pc-ui-preview :is(.bf-modal,.cw-modal) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select):not([aria-invalid="true"]) { min-height:34px; padding:5px 10px; font-size:13px; border-radius:var(--ui-radius); border-color:var(--ui-border); }
  body.pc-ui-preview :is(.bf-modal,.cw-modal) textarea:not([aria-invalid="true"]) { font-size:13px; border-radius:var(--ui-radius); border-color:var(--ui-border); }
  /* Neutralize close only; genuine danger, warning, success and error states retain their colors. */
  body.pc-ui-preview .preview-modal-close { color:var(--ui-ink); background:#fff; border-color:var(--ui-border); border-radius:var(--ui-radius); min-height:32px; font-size:13px; }
  body.pc-ui-preview .preview-modal-close:hover { color:var(--ui-ink); background:var(--ui-soft); border-color:var(--ui-border); }
}

/* Desktop chart uses CSS coordinates so labels and hit areas never shrink with SVG. */
.rw-trend-desktop { display:none; }

/* Company summary uses the available width, keeping both financial metric groups. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview #content:has(> .report-workspace .rw-tabs [data-rw-tab="company"][aria-current="page"]) { padding-bottom:16px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) {
    --rw-plot-height: clamp(175px, 20vh, 230px);
    max-width:none;
    padding:16px 24px;
  }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-header { margin-bottom:10px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-tabs button {
    min-height:40px; padding:7px 16px 10px;
  }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-header :is(h2,#rwExplain) { margin-bottom:6px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-dates { padding:8px 12px; gap:10px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-dates label {
    display:flex; align-items:center; gap:8px; min-width:0; white-space:nowrap;
  }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-dates input { flex:1; min-width:0; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) #rwExport { min-height:34px; padding:5px 10px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-result-head { margin:8px 0 10px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-metric-group { margin-bottom:10px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-metric-group h3 { margin-bottom:6px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-metric {
    min-height:104px; padding:12px 20px; gap:7px;
  }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-metric strong { font-size:28px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-metric-arrow { top:16px; }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-trend { position:relative; margin-top:12px; padding-top:12px; }
  body.pc-ui-preview .report-workspace .rw-trend-mobile { display:none; }
  body.pc-ui-preview .report-workspace .rw-trend-desktop { display:block; }
  body.pc-ui-preview .report-workspace .rw-trend-tools { position:absolute; top:10px; left:135px; display:flex; align-items:center; gap:20px; }
  body.pc-ui-preview .report-workspace .rw-trend-period { color:#52677f; font-size:13px; }
  body.pc-ui-preview .report-workspace .rw-trend-period > span { color:#8794a5; }
  body.pc-ui-preview .report-workspace .rw-trend-switch { display:flex; gap:3px; padding:3px; border:1px solid var(--ui-border); border-radius:6px; background:#f4f7fb; }
  body.pc-ui-preview .report-workspace .rw-trend-switch button { min-height:26px; padding:3px 10px; color:#52677f; border:0; border-radius:4px; background:transparent; font-size:13px; line-height:20px; }
  body.pc-ui-preview .report-workspace .rw-trend-switch button[aria-pressed="true"] { color:#185cbb; background:white; box-shadow:0 1px 3px #20344b16; font-weight:600; }
  body.pc-ui-preview .report-workspace .rw-plot-scroll { overflow-x:auto; overflow-y:hidden; margin-top:8px; }
  body.pc-ui-preview .report-workspace .rw-plot { display:grid; grid-template-columns:64px minmax(0,1fr); padding:12px 8px 30px 0; }
  body.pc-ui-preview .report-workspace .rw-plot-scale { position:relative; height:var(--rw-plot-height); color:#65778e; font-size:13px; font-variant-numeric:tabular-nums; }
  body.pc-ui-preview .report-workspace .rw-plot-scale > span { position:absolute; right:14px; transform:translateY(-50%); }
  body.pc-ui-preview .report-workspace .rw-plot-bars { position:relative; display:grid; grid-template-columns:repeat(var(--rw-point-count),minmax(0,1fr)); height:var(--rw-plot-height); }
  body.pc-ui-preview .report-workspace .rw-plot-line { position:absolute; left:0; right:0; border-top:1px dashed #e3eaf2; pointer-events:none; }
  body.pc-ui-preview .report-workspace .rw-zero-line { border-top-style:solid; border-top-color:#cfdbe8; }
  body.pc-ui-preview .report-workspace button.rw-plot-point { position:relative; z-index:1; display:block; padding:0; min-height:0; width:100%; height:100%; border:0; border-radius:4px; background:transparent; color:#52677f; box-shadow:none; overflow:visible; }
  body.pc-ui-preview .report-workspace button.rw-plot-point[aria-pressed="true"] { background:linear-gradient(90deg,transparent calc(50% - 46px),#eef4fb88 calc(50% - 46px),#eef4fb88 calc(50% + 46px),transparent calc(50% + 46px)); }
  body.pc-ui-preview .report-workspace button.rw-plot-point:focus-visible { outline:2px solid #185cbb; outline-offset:2px; }
  body.pc-ui-preview .report-workspace .rw-plot-bar { position:absolute; left:50%; width:min(28px,24%); border-radius:4px 4px 0 0; pointer-events:none; }
  body.pc-ui-preview .report-workspace .rw-income-bar { background:linear-gradient(0deg,#277e82,#42a1a1); transform:translateX(-110%); }
  body.pc-ui-preview .report-workspace .rw-expense-bar { background:linear-gradient(0deg,#658ab8,#8daed3); transform:translateX(10%); }
  body.pc-ui-preview .report-workspace .rw-plot:not([data-series="both"]) .rw-plot-bar { transform:translateX(-50%); }
  body.pc-ui-preview .report-workspace .rw-small-mark { position:absolute; left:50%; width:5px; height:5px; border-radius:50%; background:#658ab8; transform:translate(-50%,-50%); }
  body.pc-ui-preview .report-workspace .rw-income-bar .rw-small-mark { background:#277e82; }
  body.pc-ui-preview .report-workspace .rw-plot-date { position:absolute; top:calc(100% + 12px); left:50%; transform:translateX(-50%); white-space:nowrap; font-size:13px; font-weight:400; }
  body.pc-ui-preview .report-workspace .rw-plot-point[aria-pressed="true"] .rw-plot-date { color:#185cbb; font-weight:600; }
  body.pc-ui-preview .report-workspace .rw-trend:has([data-rw-series="expense"][aria-pressed="true"]) .rw-legend > span:first-child,
  body.pc-ui-preview .report-workspace .rw-trend:has([data-rw-series="income"][aria-pressed="true"]) .rw-legend > span:nth-child(2) { opacity:.4; }
  body.pc-ui-preview .report-workspace .rw-trend-readout { display:flex; align-items:center; flex-wrap:wrap; gap:12px 30px; min-height:40px; padding:7px 14px; background:#f5f8fc; border-radius:5px; color:#66788f; font-size:13px; font-variant-numeric:tabular-nums; }
  body.pc-ui-preview .report-workspace .rw-trend-readout b { margin-left:7px; color:#263f5c; font-size:15px; font-weight:600; }
  body.pc-ui-preview .report-workspace .rw-trend-readout .rw-income-text { color:#237d80; }
  body.pc-ui-preview .report-workspace .rw-trend-readout .rw-expense-text { color:#537cac; }
  body.pc-ui-preview .report-workspace .rw-trend-date { color:#263f5c; font-size:14px; font-weight:600; }
  body.pc-ui-preview .report-workspace .rw-trend-readout > span { white-space:nowrap; }
  @media (max-width:1300px) {
    body.pc-ui-preview .report-workspace .rw-trend-tools { gap:10px; left:120px; }
    body.pc-ui-preview .report-workspace .rw-trend-period > span { display:none; }
    body.pc-ui-preview .report-workspace .rw-trend-readout { gap:10px 18px; }
  }
  @media (max-width:1050px) {
    body.pc-ui-preview .report-workspace .rw-trend-tools { position:static; justify-content:space-between; margin-top:10px; }
    body.pc-ui-preview .report-workspace .rw-trend-readout { display:grid; grid-template-columns:1fr 1fr; }
  }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-chart-empty {
    display:grid; place-items:center; min-height:180px; padding:24px 16px; margin:8px 0 4px;
  }
  body.pc-ui-preview .report-workspace:has(.rw-tabs [data-rw-tab="company"][aria-current="page"]) .rw-secondary { margin-top:4px; padding-top:10px; }
}

/* Project report: one compact summary with explicit lifetime and period amounts. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview .report-workspace:has(.rw-project-heading) { max-width:none; }
  body.pc-ui-preview .report-workspace:has(.rw-project-heading) .rw-result-head { display:none; }
  body.pc-ui-preview .rw-project-heading { display:flex; align-items:center; justify-content:flex-start; gap:18px; margin:16px 0 14px; }
  body.pc-ui-preview .report-workspace .rw-project-heading h3 { margin:0; color:var(--ui-ink); font-size:18px; font-weight:600; line-height:1.5; }
  body.pc-ui-preview .report-workspace .rw-project-heading .rw-back { flex-shrink:0; min-height:32px; padding:5px 10px; margin:0; border:1px solid var(--ui-border); }
  body.pc-ui-preview .rw-project-detail .rw-project-section-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; }
  body.pc-ui-preview .rw-project-detail .rw-project-section-head h4 { margin:0; color:var(--ui-ink); font-size:15px; font-weight:600; line-height:1.5; }
  body.pc-ui-preview .rw-project-detail .rw-project-section-head > span { color:#697e97; font-size:13px; }
  body.pc-ui-preview .rw-project-detail .rw-project-section-head > button { margin-left:auto; }
  body.pc-ui-preview .rw-project-detail .rw-collection-summary { margin:16px 0 20px; padding:14px 18px 16px; border-radius:6px; background:#f7f9fc; }
  body.pc-ui-preview .rw-project-funds > .rw-project-section-head { justify-content:space-between; align-items:flex-start; gap:10px 18px; }
  body.pc-ui-preview .rw-project-funds .rw-funds-title { display:flex; align-items:center; flex-wrap:wrap; flex:1; gap:6px 18px; min-width:0; }
  body.pc-ui-preview .rw-project-funds .rw-funds-ranges { display:flex; align-items:center; flex-wrap:wrap; gap:4px 18px; color:#697e97; font-size:13px; }
  body.pc-ui-preview .rw-project-funds .rw-funds-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
  body.pc-ui-preview .report-workspace .rw-funds-actions button { min-height:30px; padding:4px 10px; }
  body.pc-ui-preview .rw-project-detail .rw-collection-metrics { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); margin:16px 0 0; }
  body.pc-ui-preview .rw-project-detail .rw-collection-metrics.rw-funds-period-only { grid-template-columns:repeat(3,minmax(0,1fr)); }
  body.pc-ui-preview .rw-project-detail .rw-collection-metrics > div { min-width:0; padding:0 18px; border-left:1px solid #dde5ef; }
  body.pc-ui-preview .rw-project-detail .rw-collection-metrics > div:first-child { padding-left:0; border-left:0; }
  body.pc-ui-preview .rw-project-detail .rw-collection-metrics > div:last-child { padding-right:0; }
  body.pc-ui-preview .rw-project-detail .rw-collection-metrics dt { color:#5a6f87; font-size:13px; }
  body.pc-ui-preview .rw-project-detail .rw-collection-metrics dd { margin:6px 0 0; color:#243b54; font-family:"Segoe UI","Microsoft YaHei",sans-serif; font-size:22px; font-weight:600; line-height:1.3; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
  body.pc-ui-preview .rw-project-detail .rw-collection-metrics dd.rw-collection-unknown { font-size:18px; font-weight:500; color:#79889b; }
  body.pc-ui-preview .rw-project-detail .rw-collection-metrics small { display:block; margin-top:6px; color:#73849b; font-size:12px; }
  body.pc-ui-preview .rw-project-detail .rw-collection-summary > p { margin:12px 0 0; font-size:13px; }
  body.pc-ui-preview .rw-project-detail .rw-funds-metrics dd.rw-funds-secondary { margin-top:7px; font-size:13px; font-weight:400; }
  body.pc-ui-preview .report-workspace .rw-project-funds .rw-period-amount { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; max-width:100%; min-height:0; margin:0; padding:0; border:0; border-radius:2px; background:none; box-shadow:none; color:#5a6f87; font:inherit; line-height:1.6; text-align:left; }
  body.pc-ui-preview .rw-project-funds .rw-period-amount > span { white-space:nowrap; }
  body.pc-ui-preview .rw-project-funds .rw-period-amount strong { color:#185cbb; font-size:13px; font-weight:500; white-space:nowrap; }
  body.pc-ui-preview .rw-project-funds .rw-period-amount:hover strong { text-decoration:underline; }
  body.pc-ui-preview .rw-project-funds .rw-period-amount:focus-visible { outline:2px solid #185cbb; outline-offset:3px; }
  body.pc-ui-preview .report-workspace .rw-balance.rw-positive { color:#17776a; }
  body.pc-ui-preview .report-workspace .rw-balance.rw-negative { color:#b63e35 !important; }
  body.pc-ui-preview .report-workspace .rw-balance.rw-zero { color:#718198; }
  body.pc-ui-preview .report-workspace .rw-amount-link.rw-balance { font-weight:650; }
  body.pc-ui-preview .rw-project-detail .rw-cost-heading { justify-content:space-between; margin:0 0 10px; }
  body.pc-ui-preview .rw-project-detail .rw-cost-title { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
  body.pc-ui-preview .rw-project-detail .rw-expense-explain { padding:2px 0; min-height:0; border:0; border-radius:0; background:transparent; color:#5a7595; font-size:13px; font-weight:400; }
  body.pc-ui-preview .rw-project-detail .rw-expense-explain:hover { color:#175bcc; text-decoration:underline; }
  body.pc-ui-preview .rw-project-detail .rw-expense-explain:focus-visible { outline:2px solid #175bcc; outline-offset:3px; }
  body.pc-ui-preview .rw-project-detail .rw-cost-summary { display:flex; flex-wrap:wrap; gap:8px 18px; color:#52677f; }
  body.pc-ui-preview .rw-project-detail .rw-cost-summary .page-chip { padding:0; border:0; background:none; font-size:13px; font-weight:400; }
  body.pc-ui-preview #rwProjectCostHeading { scroll-margin-top:84px; outline-offset:4px; }
  body.pc-ui-preview .rw-project-detail .project-report-detail-filter-strip :is(input,select) { flex-grow:1; }
  body.pc-ui-preview .rw-project-detail .project-report-detail-filter-strip input[type="search"] { flex-grow:1.4; }
  body.pc-ui-preview .report-workspace .rw-project-detail #resetProjectReportDetailFilter { min-height:34px; }
  body.pc-ui-preview .rw-project-detail > .table-scroll > table :is(th,td) { padding:10px 14px; }
  body.pc-ui-preview .rw-project-detail > .table-scroll > table td:nth-child(3) { min-width:130px; }
  body.pc-ui-preview .rw-project-detail > .table-scroll > table td:nth-child(4) { min-width:220px; }
  body.pc-ui-preview .rw-project-detail > .table-scroll > table td:nth-child(6) { min-width:135px; font-variant-numeric:tabular-nums; }
  body.pc-ui-preview .rw-project-detail > .table-scroll > table td:nth-child(6) .cell-sub { max-width:210px; margin-left:auto; white-space:normal; }
  body.pc-ui-preview .report-workspace .rw-project-source { display:block; margin-top:4px; min-height:24px; padding:1px 0; border:0; background:none; color:#185cbb; font-size:12px; font-weight:400; text-align:left; }
  body.pc-ui-preview .report-workspace .rw-project-source:hover { text-decoration:underline; }
  @media (max-width:1100px) {
    body.pc-ui-preview .rw-project-detail .rw-collection-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px 0; }
    body.pc-ui-preview .rw-project-detail .rw-collection-metrics > div:nth-child(4) { padding-left:0; border-left:0; }
    body.pc-ui-preview .rw-project-detail .rw-cost-summary { gap:6px 12px; }
  }
}

/* Late component refinements verified against the rendered desktop pages. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview .client-page-panel .client-page-head h3,
  body.pc-ui-preview .quote-list-panel > .section-head h3,
  body.pc-ui-preview :is(.venue-template-library,.venue-template-editor) .section-heading-row h3 { font-size:18px; font-weight:600; color:var(--ui-ink); }
  body.pc-ui-preview .dw-classic-page .dw-classic-section-head h2,
  body.pc-ui-preview .dw-classic-page .dw-classic-recent .section-head h3,
  body.pc-ui-preview .support-proposal-list h3,
  body.pc-ui-preview .ca-workspace .ca-project h3 { font-size:15px; font-weight:600; color:var(--ui-ink); }
  body.pc-ui-preview :is(.qd-dialog,.cd-shell,.cd-confirm section,.ca-dialog,.mw-modal > section,.fw-dialog,.iv-shell,.reim-modal > section,.rw-dialog,.device-scope-dialog,.dw-classic-dialog.dw-dialog) { border-radius:8px; }
  body.pc-ui-preview :is(.fw-pager,.iv-pager) button,
  body.pc-ui-preview .iv-page-filters > button,
  body.pc-ui-preview #purchaseTableClearFilters { min-height:32px; padding:5px 10px; font-size:13px; border-radius:var(--ui-radius); }
  body.pc-ui-preview :is(.fw-workspace,.fw-dialog,.iv-workspace,.iv-modal) button.secondary:not(.danger):not([aria-pressed="true"]) { border:1px solid var(--ui-border); }
  body.pc-ui-preview :is(.receivable-text-action,.mw-lifecycle-link,.client-back-to-list).secondary { border:0; }
  body.pc-ui-preview .mw-workspace .mw-service-tabs button { border-radius:var(--ui-radius); }
  body.pc-ui-preview .mw-workspace .mw-service-tabs button.active { background:var(--ui-primary); border-color:var(--ui-primary); color:#fff; }
  body.pc-ui-preview .task-workspace-header button.execution-create-toggle { background:var(--ui-primary); border-color:var(--ui-primary); color:#fff; }
  body.pc-ui-preview :is(.fw-metric,.iv-summary > div,.finance-a-funds .cards > .stat) { border-radius:var(--ui-radius); }
  body.pc-ui-preview #receivableTableClearFilters { height:34px; min-height:34px; }
  body.pc-ui-preview :is(.receive-receivable,.receivable-plan-open) { min-height:32px; }
  body.pc-ui-preview #purchaseRelatedActions.cw-purchase-related-actions > button { font-size:13px; }
  body.pc-ui-preview .quote-page-title,
  body.pc-ui-preview .project-contract-page-shell .page-hero-title { font-size:18px; color:var(--ui-ink); }
  body.pc-ui-preview .ca-workspace .ca-group-head h3 { font-size:15px; color:var(--ui-ink); }
  body.pc-ui-preview :is(.client-row-more,.quote-row-more-a) summary { color:var(--ui-primary); background:var(--ui-soft); border-color:var(--ui-border); border-radius:var(--ui-radius); font-size:13px; }
  body.pc-ui-preview :is(.project-contract-more-menu,.client-row-more-menu,.quote-row-more-menu-a) { min-width:max-content; }
  body.pc-ui-preview :is(.project-contract-more-menu,.client-row-more-menu,.quote-row-more-menu-a) button { white-space:nowrap; }
  body.pc-ui-preview .mw-modal > section > header button { min-height:32px; padding:5px 10px; border-radius:var(--ui-radius); }
  body.pc-ui-preview .mw-modal:not(:has(.mr-report,.ar-report,.ir-report)) .mw-form :is(input,select):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([multiple]) { height:34px; padding:5px 10px; font-weight:400; }
}

/* Project reports: readable scopes, compact filters and direct amount links. */
@media (min-width: 769px) {
  body.pc-ui-preview .report-workspace .rw-project-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:14px 0 10px; }
  body.pc-ui-preview .rw-project-filters > input[type=search] { width:220px; min-width:160px; flex:1 1 200px; max-width:340px; }
  body.pc-ui-preview .rw-project-filters > select { width:auto; min-width:145px; max-width:210px; }
  body.pc-ui-preview .rw-project-filters .rw-outstanding-filter { display:flex; align-items:center; gap:7px; width:auto; color:#52677f; font-size:13px; white-space:nowrap; }
  body.pc-ui-preview .rw-project-filters .rw-outstanding-filter input { width:15px; height:15px; margin:0; accent-color:var(--ui-primary); }
  body.pc-ui-preview .rw-project-list-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px 18px; margin:10px 0 12px; font-size:13px; color:#697e97; }
  body.pc-ui-preview .rw-project-list-head > span:first-child { color:var(--ui-ink); }
  body.pc-ui-preview .rw-project-list-head > button { margin-left:auto; }
  body.pc-ui-preview .report-workspace:has(.rw-project-filters) .rw-result-head { display:none; }
  body.pc-ui-preview .report-workspace .rw-project-table { max-height:max(330px,calc(100vh - 390px)); min-height:0; overflow:auto; scrollbar-gutter:stable; }
  body.pc-ui-preview .report-workspace .rw-project-table table { min-width:1340px; width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; }
  body.pc-ui-preview .report-workspace .rw-project-table-merged table { min-width:1000px; }
  body.pc-ui-preview .report-workspace .rw-project-table :is(th,td) { padding:11px 14px; }
  body.pc-ui-preview .report-workspace .rw-project-table :is(tbody,tfoot) td { padding-top:9px; padding-bottom:9px; }
  body.pc-ui-preview .report-workspace .rw-project-table thead th { position:sticky; top:0; z-index:2; background:#f5f7fb; white-space:nowrap; }
  body.pc-ui-preview .report-workspace .rw-project-table thead tr:nth-child(2) th { top:41px; font-weight:500; }
  body.pc-ui-preview .report-workspace .rw-project-table .rw-column-groups th { height:41px; box-sizing:border-box; padding-top:9px; padding-bottom:9px; color:#294361; }
  body.pc-ui-preview .report-workspace .rw-project-table .rw-column-groups th:not(:first-child) { text-align:center; border-left:1px solid #dbe4ef; }
  body.pc-ui-preview .report-workspace .rw-project-table .rw-column-groups span { margin-left:10px; font-size:12px; font-weight:400; color:#73849b; }
  body.pc-ui-preview .report-workspace .rw-project-table .rw-period-start { border-left:1px solid #dbe4ef; }
  body.pc-ui-preview .report-workspace .rw-project-table tbody td:first-child { white-space:normal; }
  body.pc-ui-preview .report-workspace .rw-project-table tbody td:not(:first-child) { font-variant-numeric:tabular-nums; }
  body.pc-ui-preview .report-workspace .rw-project-table tfoot td { position:sticky; bottom:0; z-index:2; background:#f0f5fc; border-top:1px solid #d5e0ef; }
  body.pc-ui-preview .report-workspace .rw-project-table tbody td:first-child,
  body.pc-ui-preview .report-workspace .rw-project-table tfoot td:first-child { position:sticky; left:0; z-index:1; background:#fff; }
  body.pc-ui-preview .report-workspace .rw-project-table tbody tr:nth-child(even) td:first-child { background:#fbfcfe; }
  body.pc-ui-preview .report-workspace .rw-project-table tfoot td:first-child { z-index:3; background:#f0f5fc; }
  body.pc-ui-preview .report-workspace .rw-project-table thead th[rowspan] { left:0; z-index:4; text-align:left; width:230px; }
  body.pc-ui-preview .report-workspace .rw-project-table .rw-project-link { min-height:0; padding:0; margin:0; font-size:13px; white-space:normal; text-align:left; line-height:1.6; }
  body.pc-ui-preview .rw-project-meta { display:block; margin-top:4px; color:#8190a4; font-size:12px; font-weight:400; }
  body.pc-ui-preview .report-workspace :is(.rw-amount-link,.rw-collection-note,.rw-fund-link) { min-height:0; padding:0; margin:0; border:0; border-radius:2px; background:transparent; box-shadow:none; font-weight:400; }
  body.pc-ui-preview .report-workspace .rw-amount-link { display:inline; color:#294b73; font-size:13px; font-variant-numeric:tabular-nums; white-space:nowrap; }
  body.pc-ui-preview .report-workspace .rw-amount-link.rw-negative { color:#bd493d; }
  body.pc-ui-preview .report-workspace .rw-collection-note { display:block; margin-top:5px; color:#8a6528; font-size:12px; text-align:left; }
  body.pc-ui-preview .report-workspace .rw-fund-link { font:inherit; color:inherit; }
  body.pc-ui-preview .report-workspace :is(.rw-amount-link,.rw-collection-note,.rw-fund-link):hover { color:var(--ui-primary); text-decoration:underline; }
  body.pc-ui-preview .report-workspace :is(.rw-amount-link,.rw-collection-note,.rw-fund-link):focus-visible { outline:2px solid var(--ui-primary); outline-offset:4px; }
  body.pc-ui-preview .rw-project-table .rw-unregistered { display:block; font-size:12px; font-weight:400; color:#8190a4; }
  body.pc-ui-preview .rw-advance-notice { padding:10px 12px; color:#8a6528; background:#fff9ef; border:1px solid #f0d9b2; border-radius:4px; }
  body.pc-ui-preview .rw-dialog .rw-dialog-body > details { margin-top:18px; }
  body.pc-ui-preview .rw-dialog .rw-dialog-body > details > summary { cursor:pointer; color:var(--ui-primary); }
  @media (max-width:1500px) {
    body.pc-ui-preview .report-workspace .rw-project-table :is(th,td) { padding-left:8px; padding-right:8px; }
    body.pc-ui-preview .report-workspace .rw-project-table .rw-column-groups span { display:block; margin:3px 0 0; }
    body.pc-ui-preview .report-workspace .rw-project-table .rw-column-groups th { height:59px; }
    body.pc-ui-preview .report-workspace .rw-project-table thead tr:nth-child(2) th { top:59px; }
  }
  @media (max-width:1400px) {
    body.pc-ui-preview .rw-project-detail .rw-collection-metrics:not(.rw-funds-period-only) { grid-template-columns:repeat(3,minmax(0,1fr)); row-gap:18px; }
    body.pc-ui-preview .rw-project-detail .rw-collection-metrics > div:nth-child(4) { padding-left:0; border-left:0; }
  }
}

/* Report detail exports keep the existing compact dialog header. */
.report-workspace .rw-dialog > header h3 { min-width:0; overflow-wrap:anywhere; }
.report-workspace .rw-dialog .rw-dialog-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.report-workspace .rw-dialog .rw-dialog-actions button { white-space:nowrap; }
.report-workspace .rw-dialog .rw-dialog-export-error { padding:10px 12px; margin:0 0 16px; border:1px solid #efc8c6; background:#fff5f4; color:#ad302d; border-radius:4px; }

/* Project activity: one reading workspace, preserving the shared desktop style. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview #content:has(> .activity-panel) { padding-bottom: 20px; }
  body.pc-ui-preview #content > .activity-panel {
    display: flex; flex-direction: column; gap: 12px;
    height: calc(100dvh - 104px); min-height: 460px; margin: 0; padding: 18px;
    overflow: hidden; box-sizing: border-box;
  }
  body.pc-ui-preview .activity-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; }
  body.pc-ui-preview .activity-head > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 14px; }
  body.pc-ui-preview .activity-head h3 { margin: 0; font-size: 16px; }
  body.pc-ui-preview .activity-head p { margin: 0; color: var(--ui-muted); font-size: 13px; }
  body.pc-ui-preview .activity-head-actions { display: flex; gap: 8px; flex: 0 0 auto; }
  body.pc-ui-preview .activity-head-actions button { width: auto; margin: 0; }
  body.pc-ui-preview .activity-primary-filters { display: grid; grid-template-columns: minmax(165px,1.15fr) minmax(205px,1.5fr) minmax(130px,.8fr) minmax(130px,.8fr) auto auto; align-items: end; gap: 10px; padding: 12px; border: 1px solid #e8edf4; background: var(--ui-soft); border-radius: 6px; flex: 0 0 auto; }
  body.pc-ui-preview .activity-panel :is(.activity-primary-filters,.activity-advanced-filters) label { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0; color: var(--ui-muted); font-size: 13px; }
  body.pc-ui-preview .activity-panel :is(.activity-primary-filters,.activity-advanced-filters) :is(input,select) { width: 100%; min-width: 0; margin: 0; height: 34px; }
  body.pc-ui-preview .activity-primary-filters > button { width: auto; margin: 0; white-space: nowrap; }
  body.pc-ui-preview .activity-advanced-filters { display: grid; grid-template-columns: minmax(160px,240px) minmax(160px,240px); gap: 12px; flex: 0 0 auto; }
  body.pc-ui-preview .activity-advanced-filters[hidden] { display: none; }
  body.pc-ui-preview .activity-records-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; flex: 0 0 auto; font-size: 13px; }
  body.pc-ui-preview .activity-scope { display: flex; border: 1px solid var(--ui-border); border-radius: 5px; overflow: hidden; }
  body.pc-ui-preview .activity-panel .activity-scope button { width: auto; margin: 0; min-height: 30px; padding: 3px 12px; border: 0; border-radius: 0; color: var(--ui-muted); background: #fff; }
  body.pc-ui-preview .activity-panel .activity-scope button[aria-pressed="true"] { color: var(--ui-primary); background: #eaf2ff; font-weight: 600; }
  body.pc-ui-preview .activity-history-note { color: var(--ui-muted); font-size: 12px; }
  body.pc-ui-preview .activity-panel .activity-status { margin: 0 0 0 auto; color: var(--ui-muted); font-size: 12px; }
  body.pc-ui-preview .activity-panel .activity-error { flex-basis: 100%; margin: 0; padding: 6px 10px; font-size: 13px; }
  body.pc-ui-preview .activity-export-status { color: var(--ui-muted); font-size: 13px; flex: 0 0 auto; }
  body.pc-ui-preview .activity-export-status:empty { display: none; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap { min-height: 0; flex: 1 1 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  body.pc-ui-preview .activity-panel.customer-fixed-list .execution-log-table-wrap.customer-fixed-table > table { min-width: 960px; border-spacing: 0; border-collapse: separate; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap th { position: sticky; top: 0; z-index: 1; background: var(--ui-soft); padding: 10px 12px; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap td { padding: 11px 12px; line-height: 1.6; font-size: 13px; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap th:nth-child(1) { width: 15%; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap th:nth-child(2) { width: 22%; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap th:nth-child(3) { width: 40%; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap th:nth-child(4) { width: 10%; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap th:nth-child(5) { width: 13%; }
  body.pc-ui-preview .activity-panel .activity-sub { margin-top: 4px; font-size: 12px; }
  body.pc-ui-preview .activity-event-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
  body.pc-ui-preview .activity-event-heading > span { color: var(--ui-muted); font-size: 12px; }
  body.pc-ui-preview .activity-panel .activity-content { margin-top: 4px; }
  body.pc-ui-preview .activity-content-collapsed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  body.pc-ui-preview .activity-panel button.activity-expand { display: inline; width: auto; padding: 0; margin: 4px 0 0; min-height: 0; border: 0; background: transparent; color: var(--ui-primary); font-size: 12px; }
  body.pc-ui-preview .activity-panel .activity-empty { padding: 36px 12px; color: var(--ui-muted); text-align: center; }
  body.pc-ui-preview .activity-panel .execution-log-pager { flex: 0 0 auto; margin: 0; padding-top: 0; }
  body.pc-ui-preview .activity-panel .execution-log-pager label { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; }
  body.pc-ui-preview .activity-panel .execution-log-pager select { width: 78px; min-height: 30px; height: 30px; margin: 0; padding: 3px 7px; font-size: 12px; }
}
@media screen and (min-width: 769px) and (max-width: 1170px) {
  body.pc-ui-preview .activity-primary-filters { grid-template-columns: repeat(4,minmax(0,1fr)); }
  body.pc-ui-preview .activity-primary-filters > label:nth-child(1) { grid-column: 1 / 3; }
  body.pc-ui-preview .activity-primary-filters > label:nth-child(2) { grid-column: 3 / 5; }
  body.pc-ui-preview .activity-head > div:first-child { gap: 4px; }
  body.pc-ui-preview .activity-head p { flex-basis: 100%; }
}
@media screen and (min-width: 769px) and (max-height: 650px) {
  body.pc-ui-preview:not(.mobile-ui-active) #content > .activity-panel { gap: 8px; padding: 12px; }
  body.pc-ui-preview:not(.mobile-ui-active) .activity-primary-filters { gap: 8px; padding: 8px; }
  body.pc-ui-preview:not(.mobile-ui-active) .activity-panel :is(.activity-primary-filters,.activity-advanced-filters) label { gap: 2px; }
  body.pc-ui-preview:not(.mobile-ui-active) .activity-panel :is(.activity-primary-filters,.activity-advanced-filters) :is(input,select) { height: 30px; min-height: 30px; }
  body.pc-ui-preview:not(.mobile-ui-active) .activity-records-bar { gap: 8px; }
}
@media screen and (min-width: 769px) and (max-width: 1170px) and (max-height: 650px) {
  body.pc-ui-preview:not(.mobile-ui-active) .activity-panel :is(.activity-primary-filters > label:nth-child(-n+2),.activity-advanced-filters > label) { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
  body.pc-ui-preview:not(.mobile-ui-active) .activity-panel :is(.activity-primary-filters > label:nth-child(-n+2),.activity-advanced-filters > label) :is(input,select) { flex: 1; min-width: 0; width: 0; }
  body.pc-ui-preview:not(.mobile-ui-active) .activity-panel .execution-log-table-wrap td { padding-top: 8px; padding-bottom: 8px; }
}
@media screen and (min-width: 769px) {
  body.pc-ui-preview .activity-panel button { border-radius: var(--ui-radius); font-weight: 400; box-shadow: none; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap :is(th,td) { border: 0; border-bottom: 1px solid #e6edf6; color: var(--ui-ink); }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap tbody tr:nth-child(even) { background: #fbfcfe; }
  body.pc-ui-preview .activity-panel .execution-log-table-wrap tbody tr:hover { background: #f5f8fd; }
}

/* 395: shared business lists, not report documents or mobile card layouts.
   Keep row height, pagination, widths, sticky cells and semantic state colors. */
@media screen and (min-width: 769px) {
  body.pc-ui-preview {
    --ui-row-base: #fff;
    --ui-row-stripe: #f8fafc;
    --ui-row-hover: #f0f6f8;
  }
  body.pc-ui-preview #content :is(
    .customer-fixed-table > table, .receivable-ledger-table,
    .payables-unified-table > table, .fw-table-scroll > table,
    .rw-project-table > table, .ca-table, .ai-table
  ) > tbody > tr:not(:has(> td[colspan])) {
    --ui-business-row-bg: var(--ui-row-base);
  }
  body.pc-ui-preview #content :is(
    .customer-fixed-table > table, .receivable-ledger-table,
    .payables-unified-table > table, .fw-table-scroll > table,
    .rw-project-table > table, .ca-table, .ai-table
  ) > tbody > tr:nth-child(even of :not(:has(> td[colspan]))) {
    --ui-business-row-bg: var(--ui-row-stripe);
  }
  body.pc-ui-preview #content :is(
    .customer-fixed-table > table, .receivable-ledger-table,
    .payables-unified-table > table, .fw-table-scroll > table,
    .rw-project-table > table, .ca-table, .ai-table
  ) > tbody > tr:not(:has(> td[colspan])):not(.danger,.warning,.error,.needs-nudge) > td {
    background-color: var(--ui-business-row-bg);
  }
  body.pc-ui-preview #content :is(
    .customer-fixed-table > table, .receivable-ledger-table,
    .payables-unified-table > table, .fw-table-scroll > table,
    .rw-project-table > table, .ca-table, .ai-table
  ) > tbody > tr:not(:has(> td[colspan])):not(.danger,.warning,.error,.needs-nudge):hover > td {
    background-color: var(--ui-row-hover);
  }
  body.pc-ui-preview .task-workspace-board .task-card:nth-child(even):not(.expanded,.needs-nudge)
    > .task-workspace-row { background-color: var(--ui-row-stripe); }
  body.pc-ui-preview .task-workspace-board .task-card:not(.expanded,.needs-nudge)
    > .task-workspace-row:hover { background-color: var(--ui-row-hover); }

  body.pc-ui-preview :is(#content,.preview-modal-card) button.secondary:not(
    [role="tab"],.stat-action,.system-fold-toggle,.attendance-settings-toggle,
    :where(.mr-report *,.ar-report *,.ir-report *)
  ) { border-radius: var(--ui-radius); }
  body.pc-ui-preview #content :is(
    input:not([type="file"],[type="checkbox"],[type="radio"],[type="range"],[type="color"],[type="hidden"]),
    select:not([multiple]),textarea
  ):not(:where(.mr-report *,.ar-report *,.ir-report *)) { border-radius: var(--ui-radius); }
  body.pc-ui-preview .ep-actions > button[data-ep="new"] { background-color: var(--ui-primary); }

  /* Attachment header is shared by customer, project and asset previews. */
  body.pc-ui-preview .af-dialog { border-radius: var(--ui-radius); color: var(--ui-ink); }
  body.pc-ui-preview .af-header { gap: 12px; }
  body.pc-ui-preview .af-header h3 { flex: 1 1 auto; min-width: 0; font-size: 18px; }
  body.pc-ui-preview .af-header > button[data-af-close] {
    flex: 0 0 auto; width: auto; min-height: 34px; margin: 0;
    padding: 5px 12px; font: inherit; font-size: 13px; line-height: 20px;
    color: var(--ui-primary); background: #fff; border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius); white-space: nowrap;
  }
  body.pc-ui-preview .af-header > button[data-af-close]:hover { background: var(--ui-soft); }
  body.pc-ui-preview .af-header > button[data-af-close]:focus-visible {
    outline: 2px solid #175fc655; outline-offset: 2px;
  }
}
