/* Viewport lock — never reflow composition; scale the fixed canvas instead. */

html.viewport-lock-fill,
html.viewport-lock-fill body {
  height: 100%;
  overflow: hidden;
}

body[data-viewport-lock="fill"] {
  margin: 0;
  box-sizing: border-box;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}

[data-viewport-stage] {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

[data-viewport-lock="fill"] [data-viewport-canvas] {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  transform-origin: center center;
}

body[data-viewport-lock="width"] {
  margin-left: 0;
  margin-right: 0;
}

body[data-viewport-lock="width"]:not(.viewport-lock-ready) {
  /* Avoid flash of unscaled wide layout before JS runs */
  max-width: 100vw;
  overflow-x: hidden;
}
