/* Procedure dialogs are portaled outside ProfessionalLayout. Follow its active theme. */
@media screen {
  html[data-professional-theme="dark"] .professional-procedure-modal.MuiPaper-root {
    --professional-surface: #111827;
    --professional-surface-soft: #1f2937;
    --professional-text: #e5e7eb;
    --professional-muted: #b0bdd0;
    --professional-border: #475569;
    color: var(--professional-text);
    background: var(--professional-surface);
    background-image: none;
    border: 1px solid #334155;
    color-scheme: dark;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal :is(.MuiDialogTitle-root, .MuiDialogContent-root, .MuiDialogActions-root) {
    color: var(--professional-text);
    background: var(--professional-surface);
    border-color: #334155;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiTypography-root {
    color: inherit;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal :is(.MuiTypography-caption, .MuiFormHelperText-root, .MuiInputLabel-root, .professional-procedure-modal__loading) {
    color: var(--professional-muted);
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiOutlinedInput-root {
    color: var(--professional-text);
    background: var(--professional-surface-soft);
    color-scheme: dark;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal :is(.MuiInputBase-input, .MuiInputBase-input::placeholder) {
    color: var(--professional-text);
    -webkit-text-fill-color: var(--professional-text);
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiInputBase-input::placeholder {
    opacity: 0.65;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiOutlinedInput-notchedOutline {
    border-color: var(--professional-border);
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
    border-color: #94a3b8;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
    border-color: #34d399;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiInputLabel-root.Mui-focused {
    color: #6ee7b7;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal :is(.MuiIconButton-root, .MuiAutocomplete-popupIndicator, .MuiAutocomplete-clearIndicator) {
    color: #b0bdd0;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal :is(.MuiButton-text, .MuiButton-outlined) {
    color: #a7f3d0;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiButton-outlined {
    border-color: #475569;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .professional-procedure-modal__acceptance-button.MuiButton-outlined {
    color: var(--professional-text);
    background: var(--professional-surface-soft);
  }

  html[data-professional-theme="dark"] .professional-procedure-modal :is(.MuiButton-text, .MuiButton-outlined, .MuiIconButton-root):hover {
    background: #29394a;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal :is(.MuiButton-root, .MuiIconButton-root):focus-visible {
    outline: 2px solid #6ee7b7;
    outline-offset: 3px;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal :is(.MuiButton-root, .MuiIconButton-root).Mui-disabled {
    color: #94a3b8;
    border-color: #334155;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiButton-contained.Mui-disabled {
    background: #253247;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiInputBase-root.Mui-disabled {
    color: #94a3b8;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiInputBase-input.Mui-disabled {
    color: #94a3b8;
    -webkit-text-fill-color: #94a3b8;
  }

  html[data-professional-theme="dark"] body:has(.professional-procedure-modal) .MuiAutocomplete-popper .MuiPaper-root {
    color: #e5e7eb;
    background: #1f2937;
    background-image: none;
    border: 1px solid #475569;
    color-scheme: dark;
  }

  html[data-professional-theme="dark"] body:has(.professional-procedure-modal) .MuiAutocomplete-popper :is(.MuiAutocomplete-noOptions, .MuiAutocomplete-loading) {
    color: #b0bdd0;
  }

  html[data-professional-theme="dark"] body:has(.professional-procedure-modal) .MuiAutocomplete-popper .MuiAutocomplete-option:is(.Mui-focused, [aria-selected="true"]) {
    color: #ecfdf5;
    background: #173d35;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiAlert-standardError {
    color: #fecaca;
    background: #3b202b;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiAlert-standardWarning {
    color: #fde68a;
    background: #352b1f;
  }

  html[data-professional-theme="dark"] .professional-procedure-modal .MuiAlert-standardInfo {
    color: #bfdbfe;
    background: #182d44;
  }
}
