/* Code Snippet Box (Telegram / IDE style matching Image 2) */
.code-snippet-box {
    margin: 0.85rem auto !important;
    border-radius: 10px !important;
    background: #e6eef5 !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    text-align: left !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05) !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

[data-theme="dark"] .code-snippet-box,
body.dark-mode .code-snippet-box,
body.space-theme .code-snippet-box,
body.night-theme .code-snippet-box {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.code-snippet-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.4rem 0.85rem !important;
    background: #cbdce8 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    user-select: none !important;
}

[data-theme="dark"] .code-snippet-header,
body.dark-mode .code-snippet-header,
body.space-theme .code-snippet-header,
body.night-theme .code-snippet-header {
    background: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.code-lang-label {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: lowercase !important;
    letter-spacing: 0.5px !important;
}

[data-theme="dark"] .code-lang-label,
body.dark-mode .code-lang-label,
body.space-theme .code-lang-label,
body.night-theme .code-lang-label {
    color: #94a3b8 !important;
}

.code-copy-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    cursor: pointer !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    padding: 3px 8px !important;
    border-radius: 5px !important;
    transition: all 0.15s ease !important;
}

.code-copy-btn:hover {
    background: rgba(0, 0, 0, 0.07) !important;
    color: #1e293b !important;
}

[data-theme="dark"] .code-copy-btn,
body.dark-mode .code-copy-btn,
body.space-theme .code-copy-btn,
body.night-theme .code-copy-btn {
    color: #94a3b8 !important;
}

[data-theme="dark"] .code-copy-btn:hover,
body.dark-mode .code-copy-btn:hover,
body.space-theme .code-copy-btn:hover,
body.night-theme .code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

.code-copy-btn.copied {
    color: #10b981 !important;
}

.code-snippet-pre {
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    font-family: 'Fira Code', 'Cascadia Code', Consolas, Menlo, Monaco, 'Courier New', monospace !important;
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
    color: #0f172a !important;
    background: transparent !important;
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    max-height: 480px !important;
    text-align: left !important;
}

[data-theme="dark"] .code-snippet-pre,
body.dark-mode .code-snippet-pre,
body.space-theme .code-snippet-pre,
body.night-theme .code-snippet-pre {
    color: #f8fafc !important;
}

.code-snippet-pre code {
    font-family: inherit !important;
    font-size: inherit !important;
    background: transparent !important;
    padding: 0 !important;
    color: inherit !important;
    white-space: inherit !important;
}
