/* R497 final-loaded low-end PC performance and stable rendering layer. */
html {
  scroll-behavior: auto !important;
  background: var(--premium-bg, var(--bg, #f4f5f9)) !important;
}
html[data-theme="dark"] { background: #0f1117 !important; }
body,
body.light,
body.dark,
html[data-theme="light"] body,
html[data-theme="dark"] body {
  min-height: 100vh;
  background-color: var(--premium-bg, var(--bg, #f4f5f9)) !important;
  background-image: none !important;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
html[data-theme="dark"] body { background-color: #0f1117 !important; }
body::before,
body::after,
.r119-ambient,
.r119-page-grain { display: none !important; }

/* Never skip card painting: this prevents white/empty rectangles during fast scroll. */
#batchResultsList > *,
#automationApprovalList > *,
.product-history-list > *,
.batch-result-card,
.approval-product-card,
.product-history-card,
.automation-card,
.history-card {
  content-visibility: visible !important;
  contain: none !important;
}

/* Stable solid surfaces avoid blur/transparency repaint flashes. */
.app-header,
.card,
.workspace-card,
.batch-result-card,
.approval-product-card,
.product-history-card,
.generation-sheet-card,
.batch-live-image-tracker,
.status,
.panel {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background-image: none !important;
  background-color: var(--premium-surface, var(--panel-solid, #fff)) !important;
}
html[data-theme="dark"] .app-header,
html[data-theme="dark"] .card,
html[data-theme="dark"] .workspace-card,
html[data-theme="dark"] .batch-result-card,
html[data-theme="dark"] .approval-product-card,
html[data-theme="dark"] .product-history-card,
html[data-theme="dark"] .generation-sheet-card,
html[data-theme="dark"] .batch-live-image-tracker,
html[data-theme="dark"] .status,
html[data-theme="dark"] .panel {
  background-color: var(--premium-surface, var(--panel-solid, #171a22)) !important;
}

.card,
.workspace-card,
.batch-result-card,
.approval-product-card,
.product-history-card,
.app-header {
  box-shadow: 0 2px 12px rgba(31,35,56,.07) !important;
}

button,
a.button,
[role="button"],
input,
select,
textarea { touch-action: manipulation; }
button,
a.button,
.nav-item,
.r119-dock-button {
  animation: none !important;
  transition: none !important;
}
button:hover:not(:disabled),
button:active,
a.button:hover,
a.button:active,
.nav-item:hover,
.nav-item:active { transform: none !important; }

img {
  background-color: var(--premium-surface-soft, var(--panel-solid, #fff));
  image-rendering: auto;
}
html[data-theme="dark"] img { background-color: #1d2029; }

/* Keep all controls clickable as soon as their markup exists. */
button:not(:disabled),
a[href],
input:not(:disabled),
select:not(:disabled),
textarea:not(:disabled) { pointer-events: auto; }

@media (prefers-reduced-motion: reduce), (max-resolution: 1.25dppx) {
  * { animation: none !important; transition: none !important; }
}

/* R635: isolate each visible batch card so one live update cannot invalidate the
   layout and paint tree for every neighboring product. Cards remain painted to
   preserve the no-blank-placeholder behavior introduced in R497. */
#batchResultsList > .batch-product-card {
  contain: layout paint style !important;
  transform: none !important;
}
#batchResultsList > .batch-product-card:hover {
  transform: none !important;
}
.batch-live-image-tracker,
.buyer-pdf-live-timing,
.buyer-pdf-process-breakdown,
.batch-progress-tracker {
  contain: layout paint style;
}
