/* R123: dashboard is main-page-only; batch results become a dedicated record-center tab. */
body.r123-batch-results-center .r123-dashboard-route-hidden,
body.r123-batch-results-center:not([data-active-page="dashboard"]) #dashboardHome,
body.r123-batch-results-center:not([data-active-page="dashboard"]) #dashboardStatusBar,
body.r123-batch-results-center:not([data-active-page="dashboard"]) #overviewStrip,
body.r123-batch-results-center:not([data-active-page="dashboard"]) #workflowProgress,
body.r123-batch-results-center:not([data-active-page="dashboard"]) [data-app-page="dashboard"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* The dashboard is no longer repeated as a floating-dock module. The rail Home icon and the compact Main page button remain. */
body.r123-batch-results-center .r119-bottom-dock .r119-dock-button[data-page="dashboard"],
body.r123-batch-results-center .r119-bottom-dock .r119-dock-button[data-page="home"] { display: none !important; }
body.r123-batch-results-center .r122-home-button span { white-space: nowrap; }

.r123-dashboard-record-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.r123-dashboard-record-actions button {
  min-height: 34px;
  border-radius: 999px !important;
  padding: 0 13px !important;
  font-size: .72rem !important;
  font-weight: 780 !important;
}

.r123-record-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(760px, calc(100% - 16px));
  margin: 24px auto 12px;
  padding: 7px;
  border: 1px solid var(--r122-line, rgba(126, 108, 178, .22));
  border-radius: 22px;
  background: color-mix(in srgb, var(--r122-panel, #0d0b18) 88%, transparent);
  box-shadow: 0 20px 46px rgba(14, 7, 38, .18);
  position: relative;
  z-index: 3;
}
.r123-record-switcher button {
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border: 1px solid transparent !important;
  border-radius: 16px !important;
  background: transparent !important;
  color: var(--r122-muted, rgba(255,255,255,.58)) !important;
  box-shadow: none !important;
  text-align: left;
}
.r123-record-switcher button span { font-weight: 820; letter-spacing: -.015em; }
.r123-record-switcher button small { font-size: .68rem; color: inherit; opacity: .72; white-space: nowrap; }
.r123-record-switcher button:hover {
  background: color-mix(in srgb, var(--r122-panel-strong, #171329) 82%, transparent) !important;
  color: var(--r122-text, #fff) !important;
}
.r123-record-switcher button.active {
  color: #fff !important;
  background: linear-gradient(135deg, #7448ff, #9a59f7 56%, #c14fe5) !important;
  border-color: rgba(255,255,255,.22) !important;
  box-shadow: 0 12px 28px rgba(112, 60, 255, .28) !important;
}
.r123-record-panel-hidden { display: none !important; }
#priorProductHistorySection,
#batchResultsSection { scroll-margin-top: 120px; }

.r123-batch-results-heading,
.r123-batch-heading-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.r123-batch-heading-actions { justify-content: flex-end; }
.r123-back-history { min-height: 36px !important; border-radius: 999px !important; }

.r123-batch-retention {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--r122-line, rgba(126,108,178,.22));
  border-radius: 18px;
  background: color-mix(in srgb, var(--r122-panel-strong, #171329) 82%, transparent);
}
.r123-auto-clear-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-width: 0;
  cursor: pointer;
}
.r123-auto-clear-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.r123-toggle-track {
  width: 48px;
  height: 28px;
  padding: 3px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  background: rgba(125, 121, 151, .34);
  border: 1px solid rgba(138, 125, 185, .28);
  transition: .2s ease;
}
.r123-toggle-track i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
  transform: translateX(0);
  transition: .2s ease;
}
.r123-auto-clear-toggle input:checked + .r123-toggle-track {
  background: linear-gradient(135deg, #7448ff, #b553ef);
  border-color: rgba(255,255,255,.2);
}
.r123-auto-clear-toggle input:checked + .r123-toggle-track i { transform: translateX(20px); }
.r123-auto-clear-toggle input:focus-visible + .r123-toggle-track { outline: 3px solid rgba(116,72,255,.32); outline-offset: 3px; }
.r123-auto-clear-toggle strong,
.r123-auto-clear-toggle small { display: block; }
.r123-auto-clear-toggle strong { color: var(--r122-text, #fff); font-size: .84rem; }
.r123-auto-clear-toggle small { margin-top: 3px; color: var(--r122-muted, rgba(255,255,255,.58)); font-size: .72rem; line-height: 1.45; }
.r123-batch-download-actions { margin-top: 0 !important; }

/* Complete light-mode treatment for the new record center. */
html[data-theme="light"] .r123-record-switcher {
  background: rgba(255,255,255,.88);
  border-color: rgba(55, 38, 96, .14);
  box-shadow: 0 18px 44px rgba(65, 43, 109, .12);
}
html[data-theme="light"] .r123-record-switcher button {
  color: #716b7d !important;
}
html[data-theme="light"] .r123-record-switcher button:hover {
  color: #18131f !important;
  background: #f4f0fb !important;
}
html[data-theme="light"] .r123-record-switcher button.active { color: #fff !important; }
html[data-theme="light"] .r123-batch-retention {
  background: rgba(255,255,255,.82);
  border-color: rgba(55,38,96,.14);
  box-shadow: 0 14px 34px rgba(62, 43, 100, .08);
}
html[data-theme="light"] .r123-auto-clear-toggle strong { color: #19141f; }
html[data-theme="light"] .r123-auto-clear-toggle small { color: #716b7d; }
html[data-theme="light"] .r123-toggle-track { background: #dcd7e5; border-color: #cbc3d8; }
html[data-theme="light"] #batchResultsSection,
html[data-theme="light"] #priorProductHistorySection {
  background: rgba(255,255,255,.9) !important;
  color: #19141f !important;
  border-color: rgba(55,38,96,.13) !important;
}
html[data-theme="light"] #batchResultsSection .help,
html[data-theme="light"] #priorProductHistorySection .help { color: #716b7d !important; }

@media (max-width: 860px) {
  .r123-record-switcher { grid-template-columns: 1fr; width: calc(100% - 8px); }
  .r123-record-switcher button { min-height: 54px; }
  .r123-batch-retention { grid-template-columns: 1fr; }
  .r123-batch-retention > button { width: 100%; }
  .r123-dashboard-record-actions { width: 100%; justify-content: flex-start; }
}

/* Dark mode only: the dashboard action tiles currently render as white surfaces,
   so their labels must use black text for readable contrast. */
html[data-theme="dark"] body.r120-rice-ui .r120-pipeline-card .r120-pipeline-list > button,
html[data-theme="dark"] body.r120-rice-ui .r120-pipeline-card .r120-pipeline-list > button > span,
html[data-theme="dark"] body.r120-rice-ui .r120-pipeline-card .r120-pipeline-list > button b,
html[data-theme="dark"] body.r120-rice-ui .r120-pipeline-card .r120-pipeline-list > button small,
html[data-theme="dark"] body.r120-rice-ui .r120-quick-launch .r120-module-grid > button,
html[data-theme="dark"] body.r120-rice-ui .r120-quick-launch .r120-module-grid > button > span,
html[data-theme="dark"] body.r120-rice-ui .r120-quick-launch .r120-module-grid > button b,
html[data-theme="dark"] body.r120-rice-ui .r120-quick-launch .r120-module-grid > button small {
  color: #111111 !important;
}

/* Dark mode only: this Digital Product Direction panel keeps a light surface,
   so every text element inside this one panel must remain black and readable. */
html[data-theme="dark"] body .global-digital-controls .digital-relationship-panel,
html[data-theme="dark"] body .global-digital-controls .digital-relationship-panel *,
body.dark .global-digital-controls .digital-relationship-panel,
body.dark .global-digital-controls .digital-relationship-panel * {
  color: #111111 !important;
}

/* Light mode only: make every interactive button/card inside the Digital Product
   Direction panel black with white text. Dark mode and all other sections stay unchanged. */
html[data-theme="light"] body .global-digital-controls .digital-relationship-panel button,
html[data-theme="light"] body .global-digital-controls .digital-relationship-panel .digital-relationship-option,
html[data-theme="light"] body .global-digital-controls .digital-relationship-panel .digital-preserve-seo-option,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-relationship-panel button,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-relationship-panel .digital-relationship-option,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-relationship-panel .digital-preserve-seo-option {
  background: #111111 !important;
  color: #ffffff !important;
  border-color: #111111 !important;
}

html[data-theme="light"] body .global-digital-controls .digital-relationship-panel button *,
html[data-theme="light"] body .global-digital-controls .digital-relationship-panel .digital-relationship-option *,
html[data-theme="light"] body .global-digital-controls .digital-relationship-panel .digital-preserve-seo-option *,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-relationship-panel button *,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-relationship-panel .digital-relationship-option *,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-relationship-panel .digital-preserve-seo-option * {
  color: #ffffff !important;
}

/* Keep the selected state visible while retaining the requested black surface. */
html[data-theme="light"] body .global-digital-controls .digital-relationship-panel .digital-relationship-option:has(input:checked),
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-relationship-panel .digital-relationship-option:has(input:checked) {
  border-color: #6f8d73 !important;
  box-shadow: 0 0 0 3px rgba(111, 141, 115, .22) !important;
}

html[data-theme="light"] body .global-digital-controls .digital-relationship-panel .digital-prompt-family-button.same.active,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-relationship-panel .digital-prompt-family-button.same.active {
  border-color: #5f9c6d !important;
  box-shadow: 0 0 0 3px rgba(95, 156, 109, .22) !important;
}

html[data-theme="light"] body .global-digital-controls .digital-relationship-panel .digital-prompt-family-button.related.active,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-relationship-panel .digital-prompt-family-button.related.active {
  border-color: #8b72ff !important;
  box-shadow: 0 0 0 3px rgba(139, 114, 255, .22) !important;
}

/* R123 targeted light-mode button contrast fix.
   ONLY the three button groups shown by the user are changed:
   dashboard Prior products / Batch results pills, Digital prompt-family buttons,
   and the Prior Product History / Batch Product Results record switcher. */
html[data-theme="light"] body .r123-dashboard-record-actions > button,
html[data-theme="light"] body .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button,
html[data-theme="light"] body .r123-record-switcher > button,
html:not([data-theme="dark"]) body:not(.dark) .r123-dashboard-record-actions > button,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button,
html:not([data-theme="dark"]) body:not(.dark) .r123-record-switcher > button {
  background: #111111 !important;
  background-color: #111111 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #111111 !important;
  opacity: 1 !important;
}

html[data-theme="light"] body .r123-dashboard-record-actions > button *,
html[data-theme="light"] body .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button *,
html[data-theme="light"] body .r123-record-switcher > button *,
html:not([data-theme="dark"]) body:not(.dark) .r123-dashboard-record-actions > button *,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button *,
html:not([data-theme="dark"]) body:not(.dark) .r123-record-switcher > button * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

/* Keep hover, focus, selected, and active states black instead of reverting to white/gradient. */
html[data-theme="light"] body .r123-dashboard-record-actions > button:hover,
html[data-theme="light"] body .r123-dashboard-record-actions > button:focus-visible,
html[data-theme="light"] body .r123-dashboard-record-actions > button:active,
html[data-theme="light"] body .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button:hover,
html[data-theme="light"] body .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button:focus-visible,
html[data-theme="light"] body .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button:active,
html[data-theme="light"] body .r123-record-switcher > button:hover,
html[data-theme="light"] body .r123-record-switcher > button:focus-visible,
html[data-theme="light"] body .r123-record-switcher > button:active,
html[data-theme="light"] body .r123-record-switcher > button.active,
html:not([data-theme="dark"]) body:not(.dark) .r123-dashboard-record-actions > button:hover,
html:not([data-theme="dark"]) body:not(.dark) .r123-dashboard-record-actions > button:focus-visible,
html:not([data-theme="dark"]) body:not(.dark) .r123-dashboard-record-actions > button:active,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button:hover,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button:focus-visible,
html:not([data-theme="dark"]) body:not(.dark) .global-digital-controls .digital-prompt-family-buttons > .digital-prompt-family-button:active,
html:not([data-theme="dark"]) body:not(.dark) .r123-record-switcher > button:hover,
html:not([data-theme="dark"]) body:not(.dark) .r123-record-switcher > button:focus-visible,
html:not([data-theme="dark"]) body:not(.dark) .r123-record-switcher > button:active,
html:not([data-theme="dark"]) body:not(.dark) .r123-record-switcher > button.active {
  background: #111111 !important;
  background-color: #111111 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* R123 history multi-select and selected-result viewing. */
.product-history-selection-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 14px 0 4px;
  padding: 13px 14px;
  border: 1px solid var(--r122-line, rgba(126,108,178,.22));
  border-radius: 16px;
  background: color-mix(in srgb, var(--r122-panel-strong, #171329) 82%, transparent);
}
.product-history-select-all {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: max-content;
  cursor: pointer;
  font-weight: 760;
}
.product-history-select-all input,
.history-card-selector input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #7448ff;
  cursor: pointer;
}
.product-history-selection-actions {
  margin: 0 !important;
  justify-content: flex-end;
}
.product-history-selection-actions button { min-height: 42px; }
.product-history-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.product-history-card.history-selected {
  border-color: rgba(116,72,255,.64) !important;
  box-shadow: 0 0 0 3px rgba(116,72,255,.13), 0 14px 34px rgba(29,14,72,.12) !important;
}
.history-card-selector {
  align-self: start;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding-top: 3px;
  cursor: pointer;
}
.history-card-selector em {
  font-size: .66rem;
  font-style: normal;
  font-weight: 760;
  color: var(--r122-muted, rgba(255,255,255,.58));
}
.r123-history-result-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 13px 14px;
  border: 1px solid rgba(116,72,255,.32);
  border-radius: 16px;
  background: rgba(116,72,255,.09);
}
.r123-history-result-filter.hidden { display: none !important; }
.r123-history-result-filter span { font-weight: 760; }
.r123-history-result-filter button { min-height: 40px; }

html[data-theme="light"] .product-history-selection-toolbar {
  background: rgba(255,255,255,.84);
  border-color: rgba(55,38,96,.14);
  box-shadow: 0 12px 30px rgba(62,43,100,.07);
}
html[data-theme="light"] .history-card-selector em { color: #716b7d; }
html[data-theme="light"] .r123-history-result-filter {
  background: rgba(116,72,255,.07);
  border-color: rgba(116,72,255,.24);
  color: #19141f;
}

@media (max-width: 900px) {
  .product-history-selection-toolbar { grid-template-columns: 1fr; }
  .product-history-selection-actions { justify-content: stretch; }
  .product-history-selection-actions button { flex: 1 1 220px; }
  .product-history-card { grid-template-columns: auto minmax(0, 1fr); }
  .product-history-actions { grid-column: 1 / -1; }
}
