/* Conversations: inbox, conversation page, navigation dropdown, recipient autocomplete. */

/* ---------- Navigation dropdown ---------- */
.conv-nav .dropdown-menu.conv-popup { min-width: 320px; max-width: min(380px, calc(100vw - 24px)); padding: 0; }
.conv-popup-head, .conv-popup-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 14px; background: var(--surface-alt); font-size: 0.9em; }
.conv-popup-head { border-bottom: 1px solid var(--border); font-weight: 600; }
.conv-popup-foot { border-top: 1px solid var(--border); justify-content: center; }
.p-nav .conv-popup a { color: var(--link); padding: 0; display: inline; border-radius: 0; font-weight: inherit; }
.p-nav .conv-popup a:hover { background: none; text-decoration: underline; }
.conv-popup-body { max-height: 360px; overflow-y: auto; }
.p-nav .conv-popup a.conv-popup-item { display: flex; gap: 10px; align-items: center; padding: 8px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.p-nav .conv-popup a.conv-popup-item:last-child { border-bottom: 0; }
.p-nav .conv-popup a.conv-popup-item:hover { background: var(--surface-alt); text-decoration: none; }
.conv-popup-item.is-unread { box-shadow: inset 3px 0 0 var(--unread); }
.conv-popup-item.is-unread .conv-popup-title { font-weight: 700; }
.conv-popup-text { display: flex; flex-direction: column; min-width: 0; }
.conv-popup-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Inbox ---------- */
.conv-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.conv-tabs a { padding: 8px 14px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.conv-tabs a:hover { color: var(--text); text-decoration: none; }
.conv-tabs a.is-active { color: var(--text); border-bottom-color: var(--primary); }
.conv-row { display: grid; grid-template-columns: 44px 1fr 130px 170px 64px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.conv-row:last-child { border-bottom: 0; }
.conv-row.is-unread { box-shadow: inset 3px 0 0 var(--unread); }
.conv-row-title { font-weight: 500; }
.conv-row.is-unread .conv-row-title a { font-weight: 700; }
.conv-row-meta { font-size: 0.86em; color: var(--text-muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.conv-row-people { min-width: 0; }
.conv-left { text-decoration: line-through; opacity: 0.75; }
.conv-row-stats { font-size: 0.86em; color: var(--text-muted); display: grid; grid-template-columns: auto auto; gap: 0 8px; margin: 0; }
.conv-row-stats dd { margin: 0; text-align: right; color: var(--text); }
.conv-row-last { font-size: 0.86em; text-align: right; }
.conv-row-actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.conv-row-actions form { display: inline; }
.conv-icon-button { background: none; border: 0; cursor: pointer; font: inherit; font-size: 1.1em; line-height: 1; padding: 4px 6px; border-radius: var(--radius); color: var(--text-muted); }
.conv-icon-button:hover { background: var(--surface-alt); color: var(--text); }
.conv-star.is-starred { color: var(--warning); }
.conv-star-form { display: inline; }

/* ---------- Conversation page ---------- */
.conv-layout { align-items: start; }
.conv-main { min-width: 0; }
.conv-participants { list-style: none; margin: 0; padding: 6px 0; }
.conv-participants li { display: flex; align-items: center; gap: 8px; padding: 5px 14px; }
.conv-participants li.conv-left { text-decoration: none; }
.conv-participants li.conv-left .username { text-decoration: line-through; }
.conv-new { background: var(--unread); border-color: var(--unread); color: var(--primary-contrast); }
.conv-attachments { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; font-size: 0.9em; }
.conv-attachments img { max-width: 160px; max-height: 120px; border-radius: var(--radius); border: 1px solid var(--border); display: block; }

/* ---------- Recipient autocomplete ---------- */
.conv-recipients-field { position: relative; }
.member-suggest { position: absolute; left: 0; right: 0; z-index: 70; list-style: none; margin: 2px 0 0; padding: 4px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); border-radius: var(--radius-lg); max-width: 360px; }
.member-suggest li { padding: 6px 12px; cursor: pointer; }
.member-suggest li:hover, .member-suggest li.is-active { background: var(--surface-alt); }

@media (max-width: 900px) {
  .conv-row { grid-template-columns: 36px 1fr 64px; }
  .conv-row-stats, .conv-row-last { display: none; }
  .conv-nav .dropdown-menu.conv-popup { position: fixed; left: 12px; right: 12px; top: 52px; min-width: 0; max-width: none; }
}
