                 modal.style.margin = '';
                    modal.style.maxWidth = 'min(95vw, 1200px)';
                    modal.style.width = '100%';
                    modal.style.maxHeight = '85vh';
                }
            } else if (modal.parentElement.id === 'caseDevicesModal') {
                // Special handling for the Case Devices modal
                if (isMobile) {
                    modal.style.margin = '5px';
                    modal.style.maxWidth = 'calc(100vw - 10px)';
        