.lk-notice-chat-message-new[data-message-id],
.lk-notice-chat-message[data-message-id] {
    position: relative;
}
.lk-notice-chat-message-new[data-message-id] .text,
.lk-notice-chat-message[data-message-id] .text {
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    will-change: transform;
}

.message-reply-action {
    position: absolute;
    left: 16px;
    bottom: -10px;
    z-index: 3;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.message-reply-action button {
    border: 0;
    border-radius: 999px;
    padding: 6px 12px;
    background: #4471fb;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.lk-notice-chat-message-new.your .message-reply-action,
.lk-notice-chat-message.user .message-reply-action {
    left: 20px;
    top: auto;
}

.lk-notice-chat-message-new:hover .message-reply-action,
.lk-notice-chat-message:hover .message-reply-action,
.lk-notice-chat-message-new:focus-within .message-reply-action,
.lk-notice-chat-message:focus-within .message-reply-action {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.message-reply-preview {
    display: flex;
    align-items: stretch;
    gap: 10px;
    border-radius: 10px;
    background: #e1ebff;
    margin-bottom: 12px;
    padding: 6px 12px;
    position: relative;
    overflow: hidden;
}

.message-reply-preview.clickable {
    cursor: pointer;
}

.message-reply-preview-line {
    width: 3px;
    border-radius: 999px;
    background: #042eb0;
    flex-shrink: 0;
    position: absolute;
    left: 0;
    height: 100%;
    top: 0;
}

.message-reply-preview-body {
    min-width: 0;
    flex: 1;
}

.message-reply-preview-author {
    color: #042eb0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

.message-reply-preview-text {
    color: #222;
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.message-reply-preview-file {
    color: #222;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.message-reply-preview-image {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.message-reply-preview-image img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.message-compose-reply[hidden] {
    display: none !important;
}

.message-compose-reply {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.message-compose-reply .message-reply-preview {
    margin-bottom: 0;
}

.message-reply-cancel {
    align-self: flex-start;
    border: 0;
    background: #6b7280;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
}

.message-source-highlight .text {
    box-shadow: 0 0 0 2px rgba(4, 46, 176, 0);
    animation: message-source-highlight 1.4s ease;
}

@keyframes message-source-highlight {
    0% {
        transform: scale(0.995);
        box-shadow: 0 0 0 0 rgba(4, 46, 176, 0.32);
    }
    35% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(4, 46, 176, 0.16);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(4, 46, 176, 0);
    }
}

@media (max-width: 767px) {
    .message-reply-action {
        display: none;
    }
    .message-compose-reply {
        position: relative;
    }
    .message-compose-reply [data-reply-preview-content] {
        flex: 1;
    }
    .message-reply-cancel {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translate(0, -50%);
    }
    .message-compose-reply .message-reply-preview {
        padding-right: 40px;
    }
}
