/* Reply quotes, emoji reactions, edit, and the message toolbar. */

.ll-msg-row,
.ll-msg-item {
    position: relative;
}

.ll-msg-row:hover,
.ll-msg-item:hover,
.ll-msg-row:focus-within,
.ll-msg-item:focus-within {
    z-index: 5;
}

.ll-msg-block {
    position: relative;
}

.ll-msg-quote {
    display: block;
    max-width: 100%;
    margin: 0 0 6px;
    padding: 4px 8px;
    border: 0;
    border-left: 3px solid #94a3b8;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.05);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ll-msg-quote-author {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    line-height: 1.3;
}

.ll-msg-quote-text {
    display: block;
    max-width: 320px;
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ll-msg-reactions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    clear: both;
}

.ll-msg-organizer .ll-msg-reactions,
.ll-msg-item.me .ll-msg-reactions {
    justify-content: flex-end;
}

.ll-react-pill {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 1px 8px;
    color: #334155;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

.ll-react-pill.is-mine {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.ll-react-pill:hover {
    border-color: #94a3b8;
}

.ll-msg-edited {
    margin-left: 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}

.ll-msg-tools {
    display: none;
    position: absolute;
    z-index: 4;
    top: calc(100% - 2px);
    left: 0;
    width: fit-content;
    max-width: 100%;
    gap: 2px;
    padding: 2px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.ll-msg-organizer .ll-msg-tools,
.ll-msg-item.me .ll-msg-tools {
    left: auto;
    right: 0;
}

.ll-thread-messages-box,
.ll-support-messages {
    padding-bottom: 48px;
}

.ll-msg-row:hover .ll-msg-tools,
.ll-msg-item:hover .ll-msg-tools,
.ll-msg-tools.is-open,
.ll-msg-row:focus-within .ll-msg-tools,
.ll-msg-item:focus-within .ll-msg-tools {
    display: inline-flex;
}

.ll-msg-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.ll-msg-tool i {
    pointer-events: none;
}

.ll-msg-tool:hover,
.ll-msg-tool:focus {
    background: #f1f5f9;
    color: #0f172a;
}

.ll-react-pop {
    position: absolute;
    z-index: 6;
    bottom: calc(100% + 4px);
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 32px);
    gap: 4px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.ll-react-choice {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 18px;
    line-height: 32px;
    cursor: pointer;
}

.ll-react-choice:hover,
.ll-react-choice.is-mine {
    background: #e0f2fe;
}

.ll-msg-organizer .ll-react-pop,
.ll-msg-item.me .ll-react-pop {
    left: auto;
    right: 0;
}

.ll-msg-editor {
    display: block;
    width: 100%;
    min-width: 180px;
    min-height: 52px;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    text-align: left;
    white-space: pre-wrap;
}

.ll-msg-editor-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.ll-msg-editor-actions button {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    color: #334155;
    font-size: 12px;
    cursor: pointer;
}

.ll-msg-editor-actions .ll-msg-save {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.ll-reply-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    padding: 8px 10px;
    border-left: 3px solid #0284c7;
    border-radius: 6px;
    background: #f0f9ff;
}

.ll-reply-banner-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.ll-reply-banner-author {
    display: block;
    color: #0c4a6e;
    font-size: 12px;
    font-weight: 700;
}

.ll-reply-banner-text {
    display: block;
    overflow: hidden;
    color: #334155;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ll-reply-banner-cancel {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #0369a1;
    font-size: 16px;
    line-height: 24px;
    cursor: pointer;
}

.ll-msg-linked {
    outline: 2px solid #38bdf8;
    outline-offset: 3px;
    border-radius: 8px;
}

.ll-msg-row.ll-msg-system {
    display: flex;
    justify-content: center;
}

.ll-msg-system-line {
    display: inline-flex;
    align-items: baseline;
    max-width: 100%;
    min-width: 0;
    gap: 6px;
}

.ll-msg-system-jump {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 500;
    line-height: inherit;
    text-align: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.ll-msg-system-jump:hover,
.ll-msg-system-jump:focus {
    color: #0369a1;
    text-decoration: underline;
}

.ll-msg-system-line .ll-msg-age {
    flex: 0 0 auto;
}

@media (hover: none) {
    .ll-msg-tools {
        display: inline-flex;
    }
}
