/* R036: keep the paper wrapper in normal flow so only .preview-area scrolls.
   This overrides both the legacy auto overflow and R026's nested scroller. */
body:has(#page-resume.active) #page-resume .editor-workspace .resume-canvas-wrap {
  min-height: 0 !important;
  overflow: visible !important;
}

/* Preserve the preview as the single scroll container and its reserved
   15px native scrollbar rail. */
body:has(#page-resume.active) #page-resume .preview-area {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* At the 1280px mobile-shell breakpoint there is still room for the fixed
   paper plus its native 15px scrollbar rail. Keep the content track at 820px. */
@media (min-width: 836px) and (max-width: 1280px) {
  body:has(#page-resume.active) #page-resume .preview-area {
    box-sizing: border-box;
    width: 835px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
  }

  body:has(#page-resume.active) #page-resume .resume-canvas-wrap {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0;
  }
}

/* Fit the module list into the short desktop viewport so it does not create
   a second, unrelated vertical scrollbar beside the preview scroller. */
@media (min-width: 1281px) and (max-height: 800px) {
  body:has(#page-resume.active) #resume-form-panel:not(.editing) .module-row {
    height: 51px;
    min-height: 51px;
  }
}
