<script>
    async function copyResultsToClipboard() {
        const text = document.getElementById("diagnostic-console").innerText;

        try {
            await navigator.clipboard.writeText(text);
        } catch (err) {
            alert("Failed to copy text. Please try again.");
        }
    }
</script>
