Targeting Dynamic Chatbox in for Chrome Extension

I’m working on a Chrome extension for my university project, and I’m almost done (about 90% completed). The extension opens Messenger.com and navigates to a specific chat link, but I’m having trouble targeting the chatbox (typing area). The issue is that the CSS Selector/XPath/JS Path seems to be dynamic, and I can’t get a reliable way to select the chat input field.

I’ve tried various solutions and watched tons of videos, but I can’t find a working approach to input text into the chatbox and trigger the send button.

Any advice or suggestions on how to handle dynamic elements like this would be greatly appreciated. This is the final step of my project!