/* Messagerie acheteur / vendeur */
.nx-chat {
  background: #ffffff;
  border: 1px solid #e6e1d8;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'Karla', 'Helvetica Neue', Arial, sans-serif;
  color: #191c1a;
  margin: 34px 0;
  max-width: 100%;
}
.nx-chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid #eceae4; background: #faf9f6;
}
.nx-chat-ident { display: flex; align-items: center; gap: 12px; }
.nx-chat-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #1b4d3e; color: #f4f7f2;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.nx-chat-name { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.2; }
.nx-chat-status { display: block; font-size: 12px; color: #2e7d4f; line-height: 1.4; }
.nx-chat-sujet { font-size: 12.5px; color: #8a8378; text-align: right; }

.nx-chat-body {
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
  min-height: 220px; max-height: 460px; overflow-y: auto; background: #ffffff;
}
.nx-chat-vide { margin: auto; text-align: center; font-size: 14px; color: #8a8378; line-height: 1.6; max-width: 340px; }
.nx-chat-erreur { margin: 4px 0 0; font-size: 13px; color: #b04a3a; }

.nx-msg { display: flex; flex-direction: column; gap: 3px; max-width: 82%; }
.nx-msg--client { align-self: flex-end; align-items: flex-end; }
.nx-msg--vendeur { align-self: flex-start; align-items: flex-start; }
.nx-bulle { padding: 11px 15px; font-size: 14.5px; line-height: 1.52; border-radius: 13px; word-break: break-word; }
.nx-msg--client .nx-bulle { background: #1b4d3e; color: #f4f7f2; border-bottom-right-radius: 3px; }
.nx-msg--vendeur .nx-bulle { background: #f0eee8; color: #2b2f2c; border-bottom-left-radius: 3px; }
.nx-msg-heure { font-size: 11px; color: #a59c8f; padding: 0 4px; }

.nx-piece {
  display: flex; align-items: center; gap: 11px; border: 1px solid #e0dbd2;
  border-radius: 5px; padding: 11px 14px; background: #faf9f6;
}
.nx-piece-nom { display: block; font-size: 13.5px; color: #2b2f2c; }
.nx-piece-taille { display: block; font-size: 11.5px; color: #8a8378; }

.nx-chat-form { display: flex; align-items: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid #eceae4; background: #faf9f6; }
.nx-chat-form textarea {
  flex-grow: 1; resize: none; border: 1px solid #e0dbd2; border-radius: 18px;
  padding: 12px 16px; font-size: 14.5px; line-height: 1.45; font-family: inherit;
  background: #ffffff; color: #191c1a; max-height: 160px; overflow-y: auto;
}
.nx-chat-form textarea:focus { outline: none; border-color: #1b4d3e; }
.nx-chat-form button { flex-shrink: 0; }
.nx-chat-note { font-size: 12.5px; color: #8a8378; padding: 0 18px 14px; margin: 0; background: #faf9f6; }
.nx-chat-note a { color: #1b4d3e; text-decoration: underline; }

.nx-chat-guest { padding: 26px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.nx-chat-guest p { margin: 0; font-size: 15px; line-height: 1.62; color: #52574f; max-width: 560px; }
.nx-chat-guest-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.nx-chat-form--demo { align-items: center; }
.nx-chat-fakeinput {
  flex-grow: 1; border: 1px solid #e0dbd2; border-radius: 18px; padding: 12px 16px;
  font-size: 14.5px; color: #a59c8f; background: #ffffff;
}
.nx-chat--demo .nx-chat-body { min-height: 0; }

/* conversations dans « Mon compte » */
.nx-threads { display: flex; flex-direction: column; gap: 12px; }
.nx-thread {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  background: #ffffff; border: 1px solid #e6e1d8; border-radius: 5px; color: inherit;
}
.nx-thread:hover { border-color: #1b4d3e; color: inherit; }
.nx-thread-img img { width: 74px; height: 54px; object-fit: cover; border-radius: 3px; display: block; background: #e8e3da; margin: 0; }
.nx-thread-body { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nx-thread-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.nx-thread-title { font-family: 'Newsreader', Georgia, serif; font-size: 18px; font-weight: 600; }
.nx-thread-date { font-size: 12px; color: #8a8378; white-space: nowrap; }
.nx-thread-last { font-size: 13.5px; color: #6c716a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nx-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 52px 26px; background: #ffffff; border: 1px solid #e6e1d8; border-radius: 5px; color: #8a8378;
}
.nx-empty h3 { font-family: 'Newsreader', Georgia, serif; font-size: 22px; margin: 0; color: #191c1a; }
.nx-empty p { margin: 0; font-size: 14.5px; line-height: 1.6; max-width: 400px; }
.nx-empty .nx-btn { margin-top: 6px; }

/* côté administration */
.nx-chat--admin { max-width: 780px; margin-top: 18px; }
.nx-chat--admin .nx-chat-body { min-height: 320px; }

@media (max-width: 720px) {
  .nx-chat-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .nx-chat-sujet { text-align: left; }
  .nx-msg { max-width: 92%; }
  .nx-thread-img img { width: 56px; height: 42px; }
}
