/* Brintage R758 — Create Post mobile tools: at most 80% of usable viewport.
   Keep the sheet header/drag handle and close button visible. Scroll INSIDE
   the sheet, not the collage. Keep desktop and final-video exporter unchanged. */
@media (max-width:768px){
  #cp-animation-menu .cp-animation-sheet,
  #cp-global-effect-menu .cp-global-effect-sheet,
  #cp-motion-menu .cp-motion-sheet,
  #createpost .cp-start-photo-sheet,
  #createpost .cp-unlock-sheet,
  #createpost .cp-free-photo-card,
  #createpost .cp-thematic-visual-panel,
  body > .cp-thematic-visual-panel,
  #cp-mobile-text-style-sheet .cp-mobile-text-style-panel,
  body > #cp-overlay-emoji-picker.cp-mobile-subpicker-floating,
  body > #cp-overlay-font-picker.cp-mobile-subpicker-floating,
  body > #cp-overlay-style-picker.cp-mobile-subpicker-floating,
  #createpost > #cp-overlay-emoji-picker.cp-mobile-emoji-inline,
  .br-credit-editor-modal .br-credit-purchase-sheet {
    max-height:80vh!important;
    max-height:80dvh!important;
    min-height:0!important;
    box-sizing:border-box!important;
  }
  #cp-animation-menu .cp-animation-sheet,
  #cp-global-effect-menu .cp-global-effect-sheet,
  #cp-motion-menu .cp-motion-sheet,
  #createpost .cp-free-photo-card,
  .br-credit-editor-modal .br-credit-purchase-sheet {
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
  }
  #cp-animation-menu .cp-animation-grid,
  #createpost .cp-start-photo-grid,
  #cp-global-effect-menu .cp-global-effect-categories,
  #cp-motion-menu .cp-motion-grid,
  #createpost .cp-free-photo-card .cp-free-photo-list,
  .br-credit-editor-modal .br-credit-editor-content {
    min-height:0!important;
    max-height:100%!important;
    overflow-y:auto!important;
    overscroll-behavior-y:contain!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body > #cp-overlay-emoji-picker.cp-mobile-subpicker-floating,
  body > #cp-overlay-font-picker.cp-mobile-subpicker-floating,
  body > #cp-overlay-style-picker.cp-mobile-subpicker-floating {
    overflow-y:auto!important;
    overscroll-behavior-y:contain!important;
  }
}

/* Web: the design sheet itself moves from the bottom; preserve its
   dynamically calculated smaller height when the collage needs more room. */
@media(max-width:768px){
  #createpost.mobile-createpost.cp-editor-step > .cp-mobile-design-sheet {
    max-height:min(var(--cp-mobile-sheet-max-height,55vh),80vh)!important;
    max-height:min(var(--cp-mobile-sheet-max-height,55dvh),80dvh)!important;
    min-height:0!important;
  }
  #createpost .cp-mobile-design-sheet-shell{
    max-height:80vh!important;max-height:80dvh!important;min-height:0!important;
  }
  #createpost .cp-mobile-design-sheet-body{
    min-height:0!important;overflow-y:auto!important;overscroll-behavior-y:contain!important;
  }
}
