/* Shared screen-only entry surfaces. Loaded last because legacy menus have
   independent ID-scoped skins. Priority is limited to field appearance; native
   controls, validation, geometry, visibility, and print reports stay intact. */
@media screen {
  body :is(input:not(:where([type="hidden"], [type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="image"])), textarea, select, [contenteditable="true"]) {
    --entry-bg: var(--crm-card);
    --entry-ink: var(--crm-text);
    --entry-border: var(--crm-line);
    background-color: var(--entry-bg) !important;
    color: var(--entry-ink) !important;
    -webkit-text-fill-color: var(--entry-ink) !important;
    border-color: var(--entry-border) !important;
    caret-color: var(--crm-gold);
    color-scheme: dark;
  }
  body :is(input, textarea)::placeholder {
    color: var(--crm-muted) !important;
    -webkit-text-fill-color: var(--crm-muted) !important;
    opacity: 1;
  }
  body :is(input[readonly], textarea[readonly]) {
    --entry-bg: var(--crm-navy);
    --entry-ink: var(--crm-beige);
    --entry-border: var(--crm-gold-line);
  }
  body :is(input:disabled, textarea:disabled, select:disabled) {
    --entry-bg: var(--crm-raised);
    --entry-ink: var(--crm-muted);
    --entry-border: var(--crm-line);
    opacity: 1 !important;
  }
  body :is(input, textarea, select, [contenteditable="true"]):focus-visible {
    --entry-border: var(--crm-gold);
    outline: 2px solid var(--crm-gold) !important;
    outline-offset: 2px !important;
  }
  body :is(input, textarea, select, [contenteditable="true"]):is([aria-invalid="true"], :user-invalid) {
    --entry-border: var(--crm-danger-text);
    outline-color: var(--crm-danger-text) !important;
  }
  body :is(input, textarea, [contenteditable="true"])::selection {
    background: var(--crm-gold);
    color: var(--crm-bg);
    -webkit-text-fill-color: var(--crm-bg);
  }
  body select :is(option, optgroup) { background: var(--crm-card); color: var(--crm-text); }
  body input[type="file"]::file-selector-button {
    background: var(--crm-raised);
    color: var(--crm-text);
    border: 1px solid var(--crm-gold-line);
    border-radius: 6px;
    cursor: pointer;
  }
  body input[type="file"]::file-selector-button:hover { background: var(--crm-navy); }
}
