.highlighter-rouge {
    position: relative;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin: 16px 0;
    padding-top: 40px; /* Space for the button */
}

pre.highlight {
    /* CODE BLOCK STYLE */
    background: #0d1117;
    margin: 0;
    padding: 16px;
    font-size: 0.85em;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    line-height: 1.45;
    color: #e6edf3;
    border-radius: 0 0 6px 6px; /* Only round bottom corners */
    tab-size: 4;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: pre-wrap; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
}

pre.highlight code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    white-space: pre-wrap; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
}

@media only screen and (max-width: 900px) {
    .highlighter-rouge {
        border-radius: 6px;
        margin: 16px -16px;
    }
    
    pre.highlight {
        font-size: 0.8em;
        padding: 12px 16px;
    }
}

/* Copy button styling - positioned outside scrollable area */
.copy-code-button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    cursor: pointer;
    border: 1px solid #30363d;
    background: #21262d;
    color: #c9d1d9;
    border-radius: 6px;
    transition: background 0.2s, border-color 0.2s;
    z-index: 10;
}

.copy-code-button:hover {
    background: #30363d;
    border-color: #8b949e;
}

.copy-code-button.copied {
    background: #238636;
    color: #ffffff;
    border-color: #238636;
}

.copy-code-button:active {
    background: #1f6feb;
    border-color: #1f6feb;
}