   .filter(c => c.trim());
                const clsLower = cls.toLowerCase();
                const index = updatedClasses.findIndex(c => c.trim().toLowerCase() === clsLower);
                if (index !== -1) {
                    // Remove the class
                    updatedClasses.splice(index, 1);
                } else {
                    // Add the class
                    updatedClasses.push(cls);
                }
                classNamesInput.value = updatedClasses.join(', ');
             