.copy-button { position: absolute; top: 8px; right: 8px; padding: 4px 10px; font-size: 0.8rem; font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace; background: var(--accent); color: var(--background); border: none; border-radius: 3px; cursor: pointer; opacity: 0; transition: opacity 0.2s ease; z-index: 1; &:hover { opacity: 1; } &.copied { background: #4caf50; } } pre:hover .copy-button { opacity: 0.8; } pre:hover .copy-button:hover { opacity: 1; }