.chat-page .message {
    position: relative;
}

.chat-page .message-body {
    min-width: 0;
}

.chat-page .message.assistant .message-body {
    padding-right: 4.5rem;
}

.chat-page .message-copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
    color: #49668f;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition:
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0.16s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-page .message-copy-button:hover {
    background: rgba(255, 255, 255, 0.95);
}

.chat-page .message.assistant:hover .message-copy-button,
.chat-page .message.assistant:focus .message-copy-button,
.chat-page .message.assistant:focus-within .message-copy-button {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-page .message-copy-button:focus-visible {
    outline: 2px solid #6ea0e8;
    outline-offset: 2px;
}
