/* =============================================================================
 * FIX79E6 — Contact card overhaul
 * Loaded after bridge.css. Targets only .contact-item / .contact-actions so
 * other .toolbar-btn uses (e.g. AI Draft) are untouched.
 * ============================================================================= */

/* ── 1. Card itself: tighter padding & gap ── */
.contact-item {
    padding: 10px 12px !important;
    gap: 10px !important;
    margin-bottom: 4px;
    align-items: center !important;
}

/* ── 2. Action toolbar: ALWAYS horizontal, including on mobile ── */
.contact-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
    align-items: center !important;
}

/* The bridge.css mobile media query forces column at <=768px. Defeat it. */
@media (max-width: 768px) {
    .contact-actions {
        flex-direction: row !important;
        gap: 4px !important;
    }
}

/* ── 3. Compact toolbar buttons inside the contact card ── */
.contact-actions .toolbar-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
    border-radius: 9px !important;
    text-decoration: none !important;  /* for the <a> profile-details button */
}

/* The "Unblock" text-only variant (no title attr, only renders when blocked) */
.contact-actions .toolbar-btn:not([title]) {
    width: auto !important;
    min-width: 0 !important;
    padding: 0 12px !important;
    font-size: 0.78rem !important;
    height: 32px !important;
}

/* ── 4. Avatar: 44×44 in this context (defaults across the app are larger) ── */
.contact-item .thread-avatar,
.contact-item > .thread-avatar {
    flex-shrink: 0 !important;
    width: 44px !important;
    height: 44px !important;
}

.contact-item .thread-avatar .avatar,
.contact-item .thread-avatar img,
.contact-item .thread-avatar > * {
    width: 44px !important;
    height: 44px !important;
    font-size: 17px !important;
    line-height: 44px !important;
}

/* ── 5. Block button hover: red tint ── */
.contact-actions .toolbar-btn.btn-del:hover {
    color: var(--danger, #f87171) !important;
    border-color: rgba(248, 113, 113, 0.4) !important;
    background: rgba(248, 113, 113, 0.08) !important;
}

/* ── 6. Density: shrink name/meta slightly to match the new compactness ── */
.contact-item .contact-name {
    font-size: 0.92rem !important;
    gap: 6px !important;
}
.contact-item .contact-meta {
    font-size: 0.78rem !important;
    margin-top: 1px !important;
}

/* ── 7. Light-theme equivalents (existing .theme-light .toolbar-btn rules
       in bridge.css use !important for padding/font-size, so re-assert here) ── */
.theme-light .contact-item {
    padding: 10px 12px !important;
    gap: 10px !important;
}

.theme-light .contact-actions {
    flex-direction: row !important;
    gap: 4px !important;
}

.theme-light .contact-actions .toolbar-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    font-size: 15px !important;
    border-radius: 9px !important;
}

.theme-light .contact-actions .toolbar-btn:not([title]) {
    width: auto !important;
    min-width: 0 !important;
    padding: 0 12px !important;
    height: 32px !important;
    font-size: 0.78rem !important;
}

/* ── 8. Filter input above the list — slight breathing room ── */
.contact-item + .contact-item { margin-top: 0; }
