/* ============================================================
   Messages — Inbox & Conversation
   ============================================================ */

[x-cloak] { display: none !important; }

/* ---------- Retract confirmation overlay ---------- */
.retract-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1050;
}

.retract-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1051;
    width: min(320px, 90vw);
}

.remove-conversation-dialog {
    position: fixed;
    top: 22vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1051;
    width: min(360px, calc(100vw - 2rem));
}

.retract-dialog .btn-danger {
    background-color: #dc2626;
    border-color: #dc2626;
}

.remove-conversation-dialog .btn-danger {
    background-color: #dc2626;
    border-color: #dc2626;
}

/* ---------- Conversation wrapper ---------- */
.conversation-wrapper {
    display: flex;
    flex-direction: column;
    /* Desktop: fill the left-section height minus its padding */
    height: calc(100dvh - 3rem);
}

/* On mobile the bottom-nav is fixed (~4rem), subtract an extra 4rem */
@media (max-width: 767.98px) {
    .conversation-wrapper {
        height: calc(100dvh - 12rem);
    }
}

/* ---------- Conversation header ---------- */
.conversation-header {
    flex-shrink: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.75rem !important;
}

.conv-user-link:hover .conv-display-name {
    text-decoration: underline;
}

.conv-avatar {
    width: 46px;
    height: 46px;
    border: 2px solid #e5e7eb;
    object-fit: cover;
}

.conv-display-name {
    font-size: 1rem;
    line-height: 1.2;
}

.conv-username {
    font-size: 0.78rem;
}

/* ---------- Messages thread ---------- */
.messages-thread {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ---------- Bubble ---------- */
.msg-bubble {
    max-width: 72%;
}

.msg-bubble-body {
    word-break: break-word;
}

.msg-bubble-mine {
    background-color: #6d28d9 !important;
    color: #fff !important;
}

.msg-bubble-meta {
    font-size: 0.65rem;
}

.msg-time {
    font-size: 0.65rem;
}

.msg-retract-btn {
    font-size: 0.65rem;
    line-height: 1;
}

/* ---------- Compose form ---------- */
.conversation-compose {
    flex-shrink: 0;
    padding-top: 0.5rem;
}
