/* Form fields keep their normal border while typing. Button and link focus is unchanged. */
html body :is(
  input:not(:is([type="checkbox" i], [type="radio" i], [type="range" i], [type="color" i], [type="file" i], [type="button" i], [type="submit" i], [type="reset" i], [type="hidden" i])),
  textarea,
  select,
  [contenteditable]:not([contenteditable="false" i]),
  [role="textbox"],
  [role="combobox"],
  .fui-input[data-slot="select-trigger"]
):is(:focus, :focus-visible) {
  outline: none !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  --tw-ring-color: transparent !important;
  --tw-ring-offset-color: transparent !important;
  --tw-ring-offset-width: 0px !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  border-color: var(--border) !important;
}

html body :is(
  input:not(:is([type="checkbox" i], [type="radio" i], [type="range" i], [type="color" i], [type="file" i], [type="button" i], [type="submit" i], [type="reset" i], [type="hidden" i])),
  textarea,
  select,
  [contenteditable]:not([contenteditable="false" i]),
  [role="textbox"],
  [role="combobox"],
  .fui-input[data-slot="select-trigger"]
)[aria-invalid="true"]:is(:focus, :focus-visible) {
  border-color: var(--destructive) !important;
}

/* This composer draws its field border on the parent of the textarea. */
html body .support-composer:has(textarea:focus) {
  border-color: var(--border) !important;
}

html body .support-composer:has(textarea[aria-invalid="true"]:focus) {
  border-color: var(--destructive) !important;
}
