html, body { margin: 0; height: 100%; overflow: hidden; background: #000; overscroll-behavior-x: none; }
.artifact-frame {
  position: fixed; inset: 0; width: 100%; height: 100%;
  border: 0; background: #0b0d12; color-scheme: light dark; z-index: 2;
}
.artifact-frame.staged { opacity: 0; pointer-events: none; }
.artifact-frame.outgoing { z-index: 1; pointer-events: none; }
#touch-pages { display: none; }
@media (any-pointer: coarse) {
  #touch-pages:not([hidden]) {
    display: flex; gap: .25rem; position: fixed; z-index: 3;
    left: max(.5rem, env(safe-area-inset-left)); bottom: max(.5rem, env(safe-area-inset-bottom));
  }
  #touch-pages button {
    width: 44px; height: 44px; border: 0; border-radius: .4rem;
    font: 500 28px system-ui, sans-serif; color: #fff; background: rgba(10, 12, 18, .78);
    touch-action: manipulation;
  }
  #touch-pages button:disabled { opacity: .42; }
}
#status, #progress {
  position: fixed; left: 50%; transform: translateX(-50%);
  max-width: min(42rem, calc(100vw - 2rem));
  padding: .45rem .8rem; border-radius: 999px;
  font: 500 14px/1.35 system-ui, sans-serif; text-align: center;
  background: rgba(12, 16, 24, .82); color: #f5f7fb;
  pointer-events: none; z-index: 3; white-space: pre-wrap;
  backdrop-filter: blur(6px);
}
#status { top: 1rem; }
#progress { top: 3.2rem; color: #ffe0a8; }
#pagecount {
  position: fixed; right: .8rem; bottom: .7rem;
  font: 600 13px/1 ui-monospace, monospace; color: #fff;
  background: rgba(10, 12, 18, .6); padding: .35rem .5rem;
  border-radius: .4rem; pointer-events: none; z-index: 3;
  opacity: 0; transition: opacity .25s;
}
#pagecount.show { opacity: 1; }
#status.full {
  top: 50%; transform: translate(-50%, -50%);
  font-size: 16px; padding: .9rem 1.2rem; border-radius: .7rem;
}
