/* Same distinction in modules, editable tables, dialogs and drop-downs. */
body :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="color"]), textarea, select, [contenteditable="true"]):not(.product-risk):not([data-risk="bajo"]):not([data-risk="medio"]):not([data-risk="alto"]):not(#workspaceSearch):not(.temp-impact-select):not(:disabled):not([readonly]):not([aria-disabled="true"]):not([aria-readonly="true"]):not(.vp-field-invalid):not([aria-invalid="true"]) {
  background-color: #fff !important;
  color: #193b55 !important;
  font-family: inherit; border-radius: 10px;
  border: 1.5px solid color-mix(in srgb,var(--module-accent,#5789b4) 65%,white) !important;
  opacity: 1;
}
body :is(input, textarea, select, [contenteditable="true"]):focus-visible:not(:disabled):not([readonly]) {
  outline: 2px solid var(--module-accent,#2378b9);
  outline-offset: 2px;
}
body :is(input, textarea, select):is(:disabled, [readonly]):not(.product-risk):not([data-risk="bajo"]):not([data-risk="medio"]):not([data-risk="alto"]), body [aria-readonly="true"], body [role="combobox"][aria-disabled="true"] {
  background-color: #e6ebf0 !important;
  color: #475665 !important;
  border: 1.5px dashed #98a7b4 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
body :is(input, textarea)[readonly] { cursor: default; }
body :is(input, textarea, select):disabled { cursor: not-allowed; }
body select option { background-color: #fff; color: #193b55; }
body select option:disabled { background-color: #e6ebf0; color: #626e79; }
body select.product-risk option[data-risk="bajo"], body :is(#samplingRisk, #ariRisk, select.product-risk):has(option[data-risk="bajo"]:checked):not(.vp-field-invalid):not([aria-invalid="true"]) {
  background-color: #d9f0df !important; color: #155a2b !important; border-color: #268343 !important;
}
body select.product-risk option[data-risk="medio"], body :is(#samplingRisk, #ariRisk, select.product-risk):has(option[data-risk="medio"]:checked):not(.vp-field-invalid):not([aria-invalid="true"]) {
  background-color: #fff0b3 !important; color: #674d00 !important; border-color: #bb8a08 !important;
}
body select.product-risk option[data-risk="alto"], body :is(#samplingRisk, #ariRisk, select.product-risk):has(option[data-risk="alto"]:checked):not(.vp-field-invalid):not([aria-invalid="true"]) {
  background-color: #f9dddd !important; color: #8f2228 !important; border-color: #bd424a !important;
}
body .product-risk { font-weight: 700; }
@media print {
  body :is(input, textarea, select) { box-shadow: none !important; }
}

/* Form controls inherit their module, including dialogs outside the section. */
@media screen {
  body.authenticated :is(form.card,.card:has(> form),dialog,.modal,.med-dialog,.study-form,.mc-phase,.controls-panel) {
    border-color:color-mix(in srgb,var(--module-accent,#126a6c) 28%,white);
    border-radius:18px;
    background:linear-gradient(125deg,color-mix(in srgb,var(--module-accent,#126a6c) 5%,#f8fcff),color-mix(in srgb,var(--module-accent,#126a6c) 10%,#edf5fb));
    color:var(--module-ink,#25484f);
  }
  body.authenticated :is(form,dialog,.modal,.med-dialog) :is(legend,.legend,.field>label,.field>span,form>h3) {
    color:var(--module-ink,#25484f); font-family:inherit; font-weight:650;
  }
  body.authenticated :is(dialog,.modal,.med-dialog) :is(h2,h3,h4) {color:var(--module-ink,#25484f);}
  body.authenticated :is(dialog,.modal,.med-dialog) .btn.primary {
    background:linear-gradient(115deg,var(--module-accent,#126a6c),var(--module-end,#25484f));
    color:#fff;border-color:transparent;
  }
  body.authenticated :is(dialog,.modal,.med-dialog) .btn.secondary {
    background:color-mix(in srgb,var(--module-accent,#126a6c) 7%,white);
    color:var(--module-ink,#25484f);border-color:color-mix(in srgb,var(--module-accent,#126a6c) 35%,white);
  }
  body.authenticated :is(dialog,.modal,.med-dialog) input:is([type=checkbox],[type=radio]) {accent-color:var(--module-accent,#126a6c);}
  :root[data-ui-theme=modulos] :is([id^=matrixDialog]) {--module-accent:#6551ad;--module-end:#3c326d;--module-ink:#3c326d;--module-glow:#b89cff;}
  :is([id^=cleaningPanel-],#vlDatabase,dialog[id^=vl]) {--module-accent:#a85e70;--module-end:#754454;--module-ink:#793f4e;--module-glow:#e8b2c2;}
  #improvementRoot.mc-busy {pointer-events:none;cursor:wait;}
  body.authenticated .vp-step-locked {color:#657583;}
  body .vp-step-locked :is(input,select,textarea),body .vp-step-locked input:focus {
    background:#e6ebf0 !important;color:#475665 !important;border:1.5px dashed #98a7b4 !important;box-shadow:none !important;
  }
  body :is(.journey-step,[data-med-step],[data-mc-stage]):disabled {
    background:#e6ebf0 !important;color:#61707c !important;border-color:#b5c0c9 !important;box-shadow:none !important;cursor:not-allowed;opacity:1;
  }
  body :is(.journey-step,[data-med-step],[data-mc-stage]):disabled :is(b,small,.step-number) {color:#61707c;background:transparent;}
}
