query() takes one string and auto-detects the engine: a plain string runs as a CSS selector, one starting with /, ./ or (/ runs as XPath. Type a selector into the argument and the matches light up.
Leading /, ./ or (/ → XPath. Anything else → CSS. It runs the same querySelectorAll / XPath the browser does, so what matches here matches in your automation.