.c-texty_input {
  border: 1px solid $button;
  background: $contrast;
}

.c-texty_input {
  &.focus {
    border-color: $primary;

    .c-texty_input__button {
      color: $fg;
    }
  }

  &.c-texty_input--use_focus_ring.focus {
    box-shadow:
      0 0 0 1px $primary,
      0 0 0 5px $primaryT;

    &:-moz-placeholder,
    &:-ms-input-placeholder,
    &::-moz-placeholder,
    &::-webkit-input-placeholder {
      color: $disabled;
    }
  }

  &.c-texty_input--double_decker.focus:after,
  &.c-texty_input--expanded.focus:after {
    background-color: $primary;
  }

  code {
    color: $accent2;
  }
}

.c-texty_autocomplete {
  background: $contrast;
}

.c-texty_autocomplete--nightshade_elevation {
  background: $hl;
}

.c-texty_autocomplete__result_context {
  color: $text;
}

.c-texty_autocomplete__help {
  background: $bg2;
  border-bottom: 1px solid $border;
  color: $text;
}

.c-texty_autocomplete__result {
  .c-team_icon {
    border: 1px solid $borderLight;
  }
}

.c-texty_autocomplete__result_highlight {
  background: $hl;
  color: $primary;
}

.c-texty_autocomplete__result_highlight--selected {
  background: $accent;
  color: $selectFg;
}

.c-texty_autocomplete--emoji {
  .c-texty_autocomplete__result--selected {
    background: $selectBg;
    color: $selectFg;

    .c-texty_autocomplete__result_highlight {
      background: $accent;
      color: $selectFg;
    }
  }
}

.c-texty_autocomplete--commands .c-texty_autocomplete__result--selected,
.c-texty_autocomplete--emoji .c-texty_autocomplete__result--selected,
.c-texty_autocomplete__result--selected {
  background: $selectBg;
  color: $selectFg;
}

.c-texty_autocomplete--commands {
  .c-texty_autocomplete__result {
    &:not(.c-texty_autocomplete__result--selected) .c-texty_autocomplete__result_description {
      color: $text;
    }
  }

  .c-texty_autocomplete__result_icon {
    background: $excluded;
  }

  .c-texty_autocomplete__result--selected .c-texty_autocomplete__result_icon {
    background: $accent;
  }

  .c-texty_autocomplete__group {
    background: $bg;
    color: $fg;
  }
}

.c-icon_button {
  &.c-texty_input__button {
    background: $button;
    color: $text;
  }

  &.c-texty_input__button--send {
    background: $accentT;
    color: $selectFg;

    &:hover {
      color: $selectFg;
      background: $accent;
    }

    &.c-texty_input__button--disabled {
      background: $button;
      color: $disabled;
    }
  }
}

.sk-client-scheme--purple .c-icon_button.c-texty_input__button--send {
  background: $accentT;

  &:hover {
    background: $accent;
  }

  &.c-texty_input__button--disabled {
    background: $button;
    color: $disabled;
  }
}

.c-texty_workflow_token {
  > button {
    background: $accentT;
    border: solid 1px $accentT;

    &:hover {
      background: $accent;
    }
  }

  &.is-missing {
    > button {
      color: $red;
      background: $button;
      border: 1px solid $button;

      &:hover {
        background: $active;
        border: 1px solid $active;
      }
    }
  }

  .c-texty_workflow_token__property {
    border-left: solid 1px $accentT;
    color: $fg;
  }
}

.c-texty_input__container--use_focus_ring {
  .c-texty_input.focus {
    box-shadow:
      0 0 0 1px $primary,
      0 0 0 5px $primaryT;

    &:-moz-placeholder,
    &:-ms-input-placeholder,
    &::-moz-placeholder,
    &::-webkit-input-placeholder {
      color: $disabled;
    }
  }

  &.c-texty_input__container--invalid .c-texty_input.focus {
    box-shadow:
      0 0 0 1px $red,
      0 0 0 5px $red;
  }
}

.c-texty_input_unstyled {
  .c-texty_workflow_token {
    > button {
      background: $button;
      color: $fg;
      border: 1px solid $button;

      &:hover {
        background: $hl;
        color: $selectFg;
      }
    }

    &.is-missing {
      > button {
        color: $red2;
        background: $button;
        border: 1px solid $button;

        &:hover {
          cursor: text;
          background: $hl;
          border: 1px solid $hl;
        }
      }

      .c-texty_workflow_token__content {
        color: $red2;
        background: $button;

        &:hover {
          background: $hl;
        }
      }
    }

    .c-texty_workflow_token__property {
      border-left: 1px solid $accent;
      color: $text;
    }

    .c-texty_workflow_token__content {
      background: $accentT;
      color: $fg;

      &:hover {
        background: $accent;
        color: $selectFg;
      }
    }

    &.is-not-clickable {
      .c-texty_workflow_token__content:hover {
        color: $selectFg;
        background: $accent;
      }
    }
  }
}

.sk-client-theme--dark .c-texty_input_unstyled__container .ql-editor blockquote:before {
  background: $bg2;
}

.c-texty_input_unstyled__container .ql-editor {
  ol[class*='ql-border-']:before,
  ul[class*='ql-border-']:before {
    background-color: $borderLight;
  }
}

.sk-client-theme--dark .c-texty_input_unstyled__container .ql-editor {
  ol[class*='ql-border-']:before,
  ul[class*='ql-border-']:before {
    background-color: $borderLight;
  }
}

.c-texty_input__container--sticky_composer {
  .c-texty_input.focus .ql-bp-texty_sticky_formatting_baruttons,
  .c-texty_input.focus ~ .c-texty_buttons,
  .c-texty_input.focus ~ .p-texty_sticky_formatting_bar {
    background: $contrast;
  }
}

.p-texty_sticky_formatting_bar {
  border-color: $bg2;
}

.c-texty_input_unstyled__warning {
  background: $red;
  color: $selectFg;
}

.p-emoji_picker__group_tab_dot,
.c-texty_input__button_badge {
  background: $accent;
  border-color: $bg;
}

.c-texty_input .c-texty_workflow_token {
  .c-texty_workflow_token__content {
    background: $accentT;
    color: $fg;

    &:hover {
      background: $accent;
      color: $selectFg;
    }
  }

  .c-texty_workflow_token__property {
    border-left: solid 1px $accent;
    color: $text;
  }

  &.is-missing .c-texty_workflow_token__content {
    color: $red;
    background: $excluded;

    &:hover {
      background: $excluded;
    }
  }

  &.is-not-clickable {
    .c-texty_workflow_token__content:hover {
      color: $selectFg;
      background: $accent;
    }
  }
}

.c-icon_button.c-texty_input__button--schedule_send.c-texty_input__button--disabled {
  color: $disabled;
}

.c-texty_buttons--overflow {
  background: $button;
  box-shadow:
    0 0 0 1px $border,
    0 1px 3px 0 $overlay;
}
