In PDF.js, conflicts will probably not occur. However, the overlay is an implementation detail of grab-to-pan.js, so I'm inclined to not leak too much useless CSS properties to the style sheet. The library is written as a separate component, re-usable in other projects (https://github.com/Rob--W/grab-to-pan.js).

I've set a z-index of 2e9 because I've in practice seen such ridiculous z-indexes (on YouTube, I've found elements with z-indexes slightly above 2e9.)

I got a bit off-topic now, do you want me to amend the commit and move the styles to viewer.css?