/* One camera over one desk. Desk objects are positioned in world pixels
   (origin: page 1's top-left corner); a view is only this transform, so the
   arrangement never changes when the point of view does. Outside the Desk the
   wrapper disappears from layout. */
#desk-world { display: contents; }
/* Sideways swipes pan a wide page; they must not turn into history navigation. */
body.desk-enabled { overscroll-behavior-x: none; }
body.desk-enabled #desk-world {
  display: block; position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 1;
  transform-origin: 0 0;
  transform: translate(var(--cam-x, 0px), var(--cam-y, 0px)) scale(var(--cam-s, 1));
  transition: transform 480ms cubic-bezier(.22,.72,.2,1);
}
/* The manuscript scrolls inside its own place on the desk. That place begins
   just above page 1, so the brass and the wood above it stay where they are. */
body.desk-enabled #desk-world > #deck {
  position: absolute; z-index: 1; box-sizing: border-box;
  left: -2592px; width: 6000px; top: -24px; height: var(--deck-h, 900px);
  padding: 24px 0 160px !important; margin: 0 !important;
  overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: none;
  background: none !important; clip-path: none !important; animation: none !important;
}
body.desk-enabled #deck::-webkit-scrollbar { display: none; }
/* The camera carries the writer's zoom; the manuscript is always true size. */
body.desk-enabled #zoomwrap { transform: none !important; margin-inline: 2592px 0 !important; width: var(--manuscript-width, 816px) !important; min-width: var(--manuscript-width, 816px) !important; left: 0 !important; transition: none !important; }
body.desk-enabled .ground-aperture { z-index: 2; }
/* The brass sits on the wood, centred above page 1, 45 world px clear of it. */
body.desk-enabled #desk-nav { position: absolute; left: calc(var(--manuscript-width, 816px) / 2); top: -88px; height: 44px; translate: -50% 0; z-index: 3; }
body.desk-enabled .ground-aperture[hidden] { display: none !important; }
#desk-nav[hidden], .desk-enabled .xd-close[hidden], .desk-enabled .ground-close[hidden] { display: none !important; }
body.desk-enabled #workspace-ground-hint { display: none; }
body.desk-enabled.desk-zooming #desk-world { transition-duration: 220ms; }
body.desk-enabled:is(.desk-instant, .pref-reduced-motion) #desk-world { transition: none !important; }
@media (prefers-reduced-motion: reduce) { body:not(.pref-full-motion).desk-enabled #desk-world { transition: none !important; } }
@media print {
  #desk-nav, .desk-surface, .desk-page-light { display: none !important; }
  body.desk-enabled #desk-world { display: contents !important; transform: none !important; }
  /* As specific as the framing above, which also applies in print. */
  body.desk-enabled #desk-world > #deck { position: static !important; width: auto !important; height: auto !important; overflow: visible !important; padding: 0 !important; }
}
