/* The fixed outline is the viewport aperture, not another scrolling container. */
:root {
  --viewport-frame-top: 16px;
  --viewport-frame-right: 30px;
  --viewport-frame-bottom: 16px;
  --viewport-frame-left: 16px;
}

.page-outline {
  inset: var(--viewport-frame-top) var(--viewport-frame-right)
    var(--viewport-frame-bottom) var(--viewport-frame-left);
  z-index: 1000;
  border: 1px solid var(--wine);
  border-radius: 0;
  background: transparent;
  box-shadow: 0 0 0 100vmax var(--pink);
  pointer-events: none;
}

/* Keep the progress rail inside the aperture, clear of the content column. */
.page-progress {
  right: calc(var(--viewport-frame-right) + 14px);
  width: 12px;
  padding-block: 8px;
  background: var(--pink);
}

.skip {
  top: calc(var(--viewport-frame-top) + 12px);
  left: calc(var(--viewport-frame-left) + 14px);
}

/* Modal backdrops paint in the top layer, above the ordinary frame. Repeat the
   opaque surround there so opening a project never exposes content outside it. */
dialog::backdrop {
  inset: var(--viewport-frame-top) var(--viewport-frame-right)
    var(--viewport-frame-bottom) var(--viewport-frame-left);
  border: 1px solid var(--wine);
  box-shadow: 0 0 0 100vmax var(--pink);
}
dialog {
  max-width: calc(100% - var(--viewport-frame-left) - var(--viewport-frame-right) - 24px);
}

/* Shared-card snapshots occupy a browser overlay. Clip that overlay too,
   including the intermediate frames while the card changes size and position. */
::view-transition {
  clip-path: inset(var(--viewport-frame-top) var(--viewport-frame-right)
    var(--viewport-frame-bottom) var(--viewport-frame-left));
}

@media (max-width: 700px) {
  :root {
    --viewport-frame-top: 10px;
    --viewport-frame-right: 19px;
    --viewport-frame-bottom: 10px;
    --viewport-frame-left: 10px;
  }
  .page-progress {
    right: calc(var(--viewport-frame-right) + 7px);
    width: 9px;
  }
}

