 `;
            container.appendChild(newItem);
            updateCodeOutput();
        }
        
        function removeItem() {
            const container = document.getElementById('flexContainer');
            if (container.children.length > 1) {
                const lastIndex = container.children.length - 1;
                container.removeChild(container.lastElementChild);
                delete itemStyles[lastIndex];
                if (selectedItem === lastIndex) {
                    selectedItem