/* Multi-line code blocks */
pre,
.md-content pre,
.md-typeset pre {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    max-width: 100%;
    overflow-x: hidden !important;
    position: relative !important; /* Changed from static to relative */
}

pre code,
.md-content pre code,
.md-typeset pre code {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    width: 100%;
    display: inline-block;
}

/* Copy button positioning fix */
.md-typeset .copy {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
}

/* Inline code blocks */
p code,
.md-content p code,
.md-typeset p code {
    white-space: normal !important;
    word-break: normal !important;
    width: auto !important;
    display: inline !important;
    background-color: rgba(175, 184, 193, 0.2);
    padding: 0.2em 0.4em;
    border-radius: 6px;
}

/* Target the popup container specifically */
div[role="dialog"],
.md-dialog,
.md-tooltip,
.md-overlay {
    position: relative !important;
    z-index: 100000 !important; /* Very high z-index */
}

/* Ensure code blocks inside popups behave properly */
div[role="dialog"] pre,
.md-dialog pre {
    position: relative !important;
    z-index: 1 !important;
}