/* SCUZO ONE RC6734 — source-of-truth contrast contract, applied LAST.
   Observed in user recording 2026-10-23 17:33 IST: dark labels on dark
   Create/Edit Store canvas. Nested RC6722 CSS had hardcoded white manager text
   inside sometimes-white input fields. These selectors intentionally pair
   foreground with an explicit background; scoped to prevent POS checkout change.
   WCAG normal-text contrast target >= 4.5:1 in QA/browser measurements.
 */
:root {
  --scuzo-contrast-dark-bg: #171c22;
  --scuzo-contrast-dark-text: #f3f8f5;
  --scuzo-contrast-muted-dark: #ccdad4;
  --scuzo-contrast-light-bg: #fff;
  --scuzo-contrast-light-text: #182b3e;
  --scuzo-contrast-placeholder: #516476;
}
/* Main store panels and all visible labels — dark on dark was RC6733's regression. */
#appView #adminView #storeForm {
  background: var(--scuzo-contrast-dark-bg) !important;
  color: var(--scuzo-contrast-dark-text) !important;
  -webkit-text-fill-color: var(--scuzo-contrast-dark-text) !important;
}
#appView #adminView #storeForm :is(label,.store-wizard-heading,.store-wizard-panel,.card-head,h3,h4,summary,.muted) {
  color: var(--scuzo-contrast-dark-text) !important;
  -webkit-text-fill-color: var(--scuzo-contrast-dark-text) !important;
  opacity: 1;
}
#appView #adminView #storeForm .card-head :is(p,small),
#appView #adminView #storeForm .store-wizard-heading p {
  color: var(--scuzo-contrast-muted-dark) !important;
  -webkit-text-fill-color: var(--scuzo-contrast-muted-dark) !important;
  opacity: 1 !important;
}
/* Do not put white labels on the former off-white Manager/Cashier panels. */
#appView #adminView #storeForm :is(.manager-login-block,.store-advanced,.invoice-settings-block) {
  background: #222a30 !important;
  border-color: #53656a !important;
  color: var(--scuzo-contrast-dark-text) !important;
  -webkit-text-fill-color: var(--scuzo-contrast-dark-text) !important;
}
#appView #adminView #storeForm :is(.manager-login-block,.store-advanced,.invoice-settings-block) label,
#appView #adminView #storeForm .store-advanced summary {
  color: var(--scuzo-contrast-dark-text) !important;
  -webkit-text-fill-color: var(--scuzo-contrast-dark-text) !important;
}
/* Every text input/select/textarea in Create and Edit uses WHITE with DARK text.
   This also fixes the RC6722 always-white Safari -webkit-text-fill fallback.
   Password eye and action buttons are intentionally excluded. */
#appView #adminView #storeForm :is(
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]),
  select, textarea
) {
  background: var(--scuzo-contrast-light-bg) !important;
  color: var(--scuzo-contrast-light-text) !important;
  -webkit-text-fill-color: var(--scuzo-contrast-light-text) !important;
  caret-color: var(--scuzo-contrast-light-text) !important;
  border-color: #8195a8 !important;
  color-scheme: light;
  opacity: 1;
}
#appView #adminView #storeForm :is(input,textarea)::placeholder {
  color: var(--scuzo-contrast-placeholder) !important;
  -webkit-text-fill-color: var(--scuzo-contrast-placeholder) !important;
  opacity: 1 !important;
}
#appView #adminView #storeForm select option {
  background: #fff !important;
  color: var(--scuzo-contrast-light-text) !important;
  -webkit-text-fill-color: var(--scuzo-contrast-light-text) !important;
}
#appView #adminView #storeForm input:-webkit-autofill {
  -webkit-text-fill-color: var(--scuzo-contrast-light-text) !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  caret-color: var(--scuzo-contrast-light-text) !important;
}
/* Accessibility in status/assistance surfaces: readable without changing
   the brand status semantics or applying generic button/color overrides. */
#appView #adminView #storeForm .rule-banner {
  background: #1b353a !important;
  color: #e6f5f5 !important;
  -webkit-text-fill-color: #e6f5f5 !important;
  border-color: #5c898d !important;
}
#appView #adminView #storeForm .check-label {
  background: #222a30 !important;
  color: #f3f8f5 !important;
  -webkit-text-fill-color: #f3f8f5 !important;
}
#appView #adminView #storeForm :is(.primary,.secondary,.ghost,.soft-danger) {
  -webkit-text-fill-color: currentColor !important;
}
/* Generic reusable semantic surfaces for all future modules: paired tokens
   rather than blanket text overrides; apply as semantic utility classes. */
#appView .scuzo-surface-dark {
  background: var(--scuzo-contrast-dark-bg);
  color: var(--scuzo-contrast-dark-text);
}
#appView .scuzo-surface-light {
  background: var(--scuzo-contrast-light-bg);
  color: var(--scuzo-contrast-light-text);
}
#appView .scuzo-surface-dark :is(label,p,small,h1,h2,h3,h4,li),
#appView .scuzo-surface-light :is(label,p,small,h1,h2,h3,h4,li) { color: inherit; }

/* Read-only diagnostics found light receipt/setup cards with inherited white labels.
   Pair dark text with their existing explicit light-background surfaces. */
#appView #posView #platformCashoutFields label {
  color: #192b3e !important;
  -webkit-text-fill-color: #192b3e !important;
  opacity: 1 !important;
}
#appView #adminView .store-activation-box {
  background: #f3f7ff !important;
  color: #192b3e !important;
  -webkit-text-fill-color: #192b3e !important;
}
#appView #adminView .store-activation-box :is(h4,p,label,small) {
  color: #253a4f !important;
  -webkit-text-fill-color: #253a4f !important;
  opacity: 1 !important;
}
#appView #adminView .store-activation-box input:not([type=checkbox]) {
  background: #fff !important;
  color: #192b3e !important;
  -webkit-text-fill-color: #192b3e !important;
  caret-color: #192b3e !important;
}
#appView #adminView #storeMasterList .store-legal-status strong {
  color: #ffbec8 !important;
  -webkit-text-fill-color: #ffbec8 !important;
}
/* Secondary actions retain the dark button background; inherited card text
   must never make their labels dark-on-dark. */
#appView #adminView .store-activation-box button.secondary {
  background: #262d33 !important;
  color: #f3f8f5 !important;
  -webkit-text-fill-color: #f3f8f5 !important;
}
#appView #adminView .store-activation-box button.primary {
  color: #091812 !important;
  -webkit-text-fill-color: #091812 !important;
  background: #76c99c !important;
}
