/* Red Ass shared form-field rule (1.128.4). ONE place decides how every text box looks in the game, the admin page and the wiki,
   so typed text can never be dark on a dark box again. Brand-kit colours only: cream #FBF8F3 fill, ink #1A1F2B text, ink-muted #4F5868 placeholder.
   Every pair is at least 4.5:1 (WCAG AA); tests/fieldcontrast.test.js checks the numbers and fails if they drop.
   It is deliberately theme-independent: the fill and the text are both set here, so no theme or panel colour can pull them apart.
   Covers: text, password/PIN, email, number, search, tel, url, date, textarea, select (and its list), placeholder, focus, autofill, disabled, read-only.
   Not covered on purpose: checkbox, radio, range, colour, file and button inputs (they are not text boxes). */
:root{
  --fld-bg:#fbf8f3; --fld-fg:#1a1f2b; --fld-ph:#4f5868; --fld-line:#7d7260;
  --fld-dis-bg:#ece6da; --fld-dis-fg:#4f5868;
  --fld-ring-in:#1a1f2b; --fld-ring-out:#e8ab35;
}
:root :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=button]):not([type=submit]):not([type=reset]):not([type=image]):not([type=hidden]),select,textarea){
  background-color:var(--fld-bg)!important;
  background-image:none;
  color:var(--fld-fg)!important;
  -webkit-text-fill-color:var(--fld-fg);
  caret-color:var(--fld-fg);
  border-color:var(--fld-line);
  color-scheme:light;
  opacity:1;
  text-shadow:none;
}
:root :is(input,textarea)::placeholder{color:var(--fld-ph)!important;-webkit-text-fill-color:var(--fld-ph);opacity:1}
:root select option,:root select optgroup{background-color:var(--fld-bg);color:var(--fld-fg)}
:root :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=button]):not([type=submit]):not([type=reset]):not([type=image]):not([type=hidden]),select,textarea):is(:disabled,[readonly]){
  background-color:var(--fld-dis-bg)!important;
  color:var(--fld-dis-fg)!important;
  -webkit-text-fill-color:var(--fld-dis-fg);
  opacity:1;
}
:root :is(input,textarea):disabled::placeholder{color:var(--fld-dis-fg)!important;-webkit-text-fill-color:var(--fld-dis-fg)}
:root :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=button]):not([type=submit]):not([type=reset]):not([type=image]):not([type=hidden]),select,textarea):focus-visible{
  outline:2px solid var(--fld-ring-in);outline-offset:0;box-shadow:0 0 0 4px var(--fld-ring-out);
}
/* Browser autofill paints its own fill and text colour; paint ours over it. */
:root :is(input,textarea,select):-webkit-autofill,
:root :is(input,textarea,select):-webkit-autofill:hover,
:root :is(input,textarea,select):-webkit-autofill:focus,
:root :is(input,textarea,select):-webkit-autofill:active{
  -webkit-text-fill-color:var(--fld-fg)!important;
  caret-color:var(--fld-fg);
  box-shadow:0 0 0 1000px var(--fld-bg) inset!important;
  transition:background-color 99999s ease-out 0s;
}
