/* September30: Office Parts joins the approved five-scheme palette.
   Appearance only. The existing Card/Table renderer owns every dimension,
   font metric, column, gap, disclosure and control. Never theme the enclosing
   appliance header, Notes/Diagnosis or AUTHO through inherited aliases. */
@media screen {
  /* Dispatch's unassigned list is itself the readonly Parts root; unlike
     appliance-linked Parts it has no separate ancestor Parts container. */
  html body.afix-compact .office-appliance-card.office-readonly-parts[data-parts-list],
  html body.afix-compact .office-appliance-card :is(
    .manager-parts-block-v2, .office-appliance-parts, .office-readonly-parts
  ) {
    --oc-row: var(--afix-surface);
    --oc-head: var(--afix-surface-muted);
    --oc-field: var(--afix-field);
    --oc-line: var(--afix-border);
    --oc-input-line: var(--afix-input-border);
    --oc-text: var(--afix-text);
    --oc-muted: var(--afix-muted);
    --oc-link: var(--afix-accent);
    --apv2-card: var(--afix-surface);
    --apv2-parts-heading: var(--afix-surface);
    --apv2-grid-heading: var(--afix-surface-muted);
    --apv2-row: var(--afix-surface);
    --apv2-row-alt: var(--afix-surface);
    --apv2-field: var(--afix-field);
    --apv2-line: var(--afix-border);
    --apv2-cell-line: var(--afix-rule);
    --apv2-text: var(--afix-text);
    --apv2-muted: var(--afix-muted);
    --apv2-link: var(--afix-accent);
    --apv2-focus: var(--afix-accent);
    --apv2-focus-bg: var(--afix-field);
    --shared-control: var(--afix-field);
    --shared-control-hover: var(--afix-surface-muted);
    /* Do not remap draft/danger/stock/Marcone, generic status-blue aliases
       or save-state palettes. Neutral links are targeted individually below. */
  }

  /* Fixed reference radii are paint-only; generic theme metrics must not
     resize this dense component or its touch/readonly variants. */
  html body.afix-compact .office-appliance-card.office-readonly-parts[data-parts-list],
  html body.afix-compact .office-appliance-card :is(
    .manager-parts-block-v2, .office-appliance-parts
  ),
  html body.afix-compact .office-appliance-card .office-part-card {
    border-radius: 9px !important;
  }
  html body.afix-compact .office-appliance-card.office-readonly-parts[data-parts-list][data-office-parts-layout="table"]
    .office-part-card,
  html body.afix-compact .office-appliance-card
    .office-readonly-parts[data-office-parts-layout="table"] .office-part-card {
    border-radius: 0 !important;
  }
  /* Readonly Cards already have fixed-height value boxes. Keep long text
     inside those boxes instead of painting over the next row's labels.
     This changes neither box geometry nor the full selectable text. Table
     cells retain their existing wrapped presentation. */
  html body.afix-compact .office-appliance-card.office-readonly-parts[data-parts-list]:not([data-office-parts-layout="table"])
    .office-part-value,
  html body.afix-compact .office-appliance-card
    .office-readonly-parts:not([data-office-parts-layout="table"]) .office-part-value {
    white-space: nowrap;
    overflow: hidden;
  }
  html body.afix-compact .office-appliance-card .office-part-card :is(
    .manager-part-control-v2, .office-part-value,
    .supplier-compact-options > select, .supplier-link-button, .vendor-invoice-control
  ) {
    border-radius: 6px !important;
  }
  html body.afix-compact .office-appliance-card .office-part-card :is(
    .manager-part-control-v2, .office-part-value,
    .supplier-compact-options > select, .supplier-link-button, .vendor-invoice-control
  ):not([aria-invalid="true"]):not(.afix-field-invalid):not(.error):not(.invalid) {
    border-color: var(--afix-input-border) !important;
  }
  html body.afix-compact .office-appliance-card :is(
    .manager-parts-title-v2, .office-readonly-parts-toolbar
  ) .office-parts-sort select {
    background-color: var(--afix-field);
    border-color: var(--afix-input-border);
    border-radius: 6px;
  }
  /* Legacy Manager dark-mode headings set a literal blue background and
     descendant ink. The Parts heading must use the selected scheme too. */
  html body.afix-compact .office-appliance-card .manager-parts-title-v2 {
    background-color: var(--afix-surface) !important;
    border-color: var(--afix-border) !important;
  }
  html body.afix-compact .office-appliance-card .manager-parts-title-v2
    .manager-parts-toggle-v2,
  html body.afix-compact .office-appliance-card .manager-parts-title-v2
    .manager-parts-toggle-v2 > :is(span, b) {
    color: var(--afix-muted) !important;
  }
  html body.afix-compact .office-appliance-card :is(
    .manager-parts-title-v2, .office-readonly-parts-toolbar
  ) :is(.manager-add-part-v2, .office-parts-layout-toggle),
  html body.afix-compact .office-appliance-card :is(
    .manager-parts-block-v2, .office-appliance-parts
  ) .vendor-invoice-control :is(.vendor-invoice-link, .vendor-invoice-retry) {
    color: var(--afix-accent) !important;
  }
  html body.afix-compact .office-appliance-card .office-parts-table
    > .manager-part-row-v2:not(.office-part-card):not(.draft)
    .manager-part-control-v2:not([aria-invalid="true"]):not(.afix-field-invalid):not(.error):not(.invalid) {
    background-color: var(--afix-field) !important;
  }

  /* Classic's blue-gray PANEL needs stronger shades of the same evidence
     colors. Keep the original checked/current/available selectors: no theme
     may turn an unchecked mark red or an unavailable stock state green. */
  html[data-office-theme="classic"] body.afix-compact .office-appliance-card
    .office-parts-table .marcone-reference[data-lookup-checked="true"] .marcone-mark {
    color: var(--afix-danger);
  }
  html[data-office-theme="classic"] body.afix-compact .office-appliance-card
    .office-part-card :is(button.office-part-stock-action, .office-part-stock-action.is-available),
  html[data-office-theme="classic"] body.afix-compact .office-appliance-card
    .office-parts-table .marcone-reference[data-state="in-stock"],
  html[data-office-theme="classic"] body.afix-compact .office-appliance-card
    .office-parts-table .marcone-reference .marcone-stock-check {
    color: var(--afix-success);
  }
  html[data-office-theme="classic"] body.afix-compact .office-appliance-card
    .office-parts-table button.marcone-reference:not(:disabled):not([data-state="in-stock"]) {
    color: var(--afix-accent);
  }
}
