/* =============================================================================
 * FIX79E7V2 — Contacts button styling + form-control dark-on-dark fix
 * Loaded after fix79e6 / fix79e7 v1, so cascade favours us.
 * ============================================================================= */

/* ── 1. Contacts button on the inbox header ── */
/* Mirror .ibx__compose-btn geometry but ghost/outline (Compose stays primary) */
.ibx.ibx .ibx__contacts-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary, #1a1a2e);
    border: 1.5px solid var(--border-light, #e5e7eb);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .15s;
    cursor: pointer;
    line-height: 1;
}
.ibx.ibx .ibx__contacts-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--ai-primary, #6366f1);
    color: var(--ai-primary, #6366f1);
    transform: translateY(-1px);
}
.ibx.ibx .ibx__contacts-btn svg { stroke: currentColor; flex-shrink: 0; }

/* On very narrow screens the label hides — icon-only stays usable */
@media (max-width: 380px) {
    .ibx.ibx .ibx__contacts-btn span { display: none; }
    .ibx.ibx .ibx__contacts-btn { padding: 8px 10px; }
}

/* Header layout — let the title flex so the buttons sit cleanly to the right */
.ibx.ibx .ibx__top {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}
.ibx.ibx .ibx__title { flex: 1 1 auto; min-width: 0; }

/* ── 2. Carry-over from fix79e7 v1 — /contact/{id} form controls ── */
select#rel-type,
select#rel-trust,
textarea#rel-notes,
input.tag-input {
    background: #ffffff !important;
    color: #1a1a2e !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
    font-family: inherit !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

textarea#rel-notes {
    min-height: 84px !important;
    resize: vertical !important;
    line-height: 1.4 !important;
}

select#rel-type,
select#rel-trust {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%231a1a2e' d='M6 8L0 0h12z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 10px 7px !important;
    padding-right: 32px !important;
}

select#rel-type:focus,
select#rel-trust:focus,
textarea#rel-notes:focus,
input.tag-input:focus {
    outline: none !important;
    border-color: var(--ai-primary, #6366f1) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18) !important;
}

textarea#rel-notes::placeholder,
input.tag-input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.theme-light select#rel-type,
.theme-light select#rel-trust,
.theme-light textarea#rel-notes,
.theme-light input.tag-input {
    background-color: #ffffff !important;
    color: #1a1a2e !important;
    border-color: #e5e7eb !important;
}
