Why does my site show a mobile layout on a large monitor?
Because the media query is reacting to the real viewport width (window.innerWidth), not the monitor resolution: if the browser window only occupies half the screen, in a split view or side by side with another app, the viewport can fall below the mobile breakpoint even though the monitor is 4K.
Does innerWidth include the scrollbar?
No: window.innerWidth already subtracts the vertical scrollbar width whenever it is visible, so the value reflects the area truly available to the page content, unlike outerWidth, which measures the entire browser window including all of its chrome.
Is screen.availWidth different from screen.width?
Yes: screen.availWidth subtracts areas reserved by the operating system, such as the Windows taskbar or the macOS dock, while screen.width reports the panel raw resolution; neither one, though, reflects the size of the browser window itself.
Should I ever use screen.width?
Only when the goal is to learn the physical monitor capability, such as choosing the maximum video resolution to offer a user; for layout, spacing and breakpoint decisions, window.innerWidth is always the correct measurement because it reflects the real space available to the content.