/* Neutral Account text; preserve status colors and light-surface contrast. */
@media (forced-colors: none) {
  :root[data-account-theme="dark"] {
    --account-text: #FFFFFF;
    --account-muted: #FFFFFF;
    --muted: #FFFFFF;
  }

  :root[data-account-theme="dark"] .app :is(h1,h2,h3,h4,.brand,.auth-title,.account-menu-trigger,.account-menu-item,.language-trigger,.regional-option,.regional-search input,.scope-name,.step-index,.qr-countdown,.qr-countdown span,.trusted-device-about,.account-card-preview-number,.real-name-material-illustration) { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app .trusted-device-about:is(:hover,:active,:focus-visible,[aria-expanded="true"]) { color: #BDBDBD; }
  :root[data-account-theme="dark"] .app :is(a:not(.button),.text-button,.back-link,.code-action,.provider-callback-retry):not(:is(.trusted-device-remove,.danger,.text-danger)) { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app :is(a:not(.button),.text-button,.back-link,.code-action,.provider-callback-retry):not(:is(.trusted-device-remove,.danger,.text-danger)) > .icon { color: inherit; }

  /* These selectors also override the separate hosted authentication palette. */
  :root[data-account-theme="dark"] .app.account-auth-app :is(.auth-title h1,.auth-form h1,.auth-form h2,.auth-form h3,.button.secondary,.providers .button,.provider-name,.alternative-title) { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app.account-auth-app .field:not(:has([aria-invalid="true"])) > label { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app.account-auth-app :is(.auth-title p,.field-help,.provider-notice,.provider-status,.qr-caption,.qr-status,.qr-login-code,.auth-form small,.account-theme-choice > span,.qr-countdown span):not(:is(.feedback,.field-error,.registration-field-error,.registration-error,.real-name-error,.profile-over-limit,.feedback-error-message,.subject-status-pending,.subject-status-approved,.subject-status-rejected)) { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app.account-auth-app :is(.field input,.field select,.field textarea,.auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"])) { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app :is(input,select,textarea):not(:where([type="checkbox"],[type="radio"],[type="range"],[type="file"])) { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app.account-auth-app :is(.field input,.field textarea)::placeholder { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app :is(input,textarea)::placeholder { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app :is(.site-footer,.site-footer > span,.site-footer .language-trigger,.site-footer .language-trigger > span,.footer-links > span) { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app.account-auth-app :is(.site-footer > span,.site-footer .language-trigger > span) { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app :is(.account-history-time,.account-history-result,.account-history-detail dt,.account-history-detail p,.account-history-caption,.account-history-entry summary > .icon) { color: #FFFFFF; }

  /* A field's border remains an accent; its focused text label is white. */
  :root[data-account-theme="dark"] .app :is(.field-floating,.field:has(> textarea[placeholder])) { --field-label-color: #FFFFFF; }
  :root[data-account-theme="dark"] .app :is(.field-floating,.field:has(> textarea[placeholder])):not(:has([aria-invalid="true"])):has(> .input-wrap > input:focus:not(:disabled),> textarea:focus:not(:disabled)) > label { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app .field.subject-select-field:not(:has([aria-invalid="true"])):focus-within > label { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app .field.subject-select-field:has(select[aria-invalid="true"]) { --field-focus: var(--field-error, #f2b8b5); --field-label-color: var(--field-error, #f2b8b5); }
  :root[data-account-theme="dark"] .app .subject-review .subject-review-note .field:not(:has([aria-invalid="true"])):has(> .input-wrap > input:focus) > label { color: #FFFFFF; }

  /* The welcome page has its own space palette and illustrative text. */
  :root[data-account-theme="dark"] .app .account-welcome { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app :is(.welcome-hero-copy > p,.welcome-description-line,.welcome-section-title p,.welcome-feature p,.welcome-feature-icon,.welcome-discover,.welcome-footnotes) { color: #FFFFFF; }
  :root[data-account-theme="dark"] .app .account-background-tile > .account-block,
  :root[data-account-theme="dark"] .app .account-background-tile :is(strong,span,.account-block-fields,.account-service-node,.account-service-connection,.account-medical-lines,.account-block-brand,.account-block-shield) { color: #FFFFFF; }

  /* White text must never be painted on these existing light surfaces. */
  :root[data-account-theme="dark"] .app .button:not(.secondary):not(.providers .button) { color: #181818; }
  :root[data-account-theme="dark"] .app.account-auth-app .button:not(.secondary):not(.providers .button) { color: #202124; }
  :root[data-account-theme="dark"] .app .real-name-kind button.selected { color: #181818; }
  :root[data-account-theme="dark"] .app .qr-frame .qr-frame-message,
  :root[data-account-theme="dark"] .app .qr-login-code.is-active strong { color: #3c4043; }
}
