01Why are there four different widths?
Because they measure four different things. innerWidth is the layout viewport and MDN is explicit that it includes the vertical scrollbar. documentElement.clientWidth is that viewport without the scrollbar. outerWidth is the whole browser window including its chrome. visualViewport is what is actually visible, which changes with pinch-zoom and an on-screen keyboard.
