/* SONARA — Producer Messaggi */

.mp-page { padding-top: 18px; padding-bottom: 18px; max-width: 1480px; }

.mp-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  height: calc(100vh - 100px);
  min-height: 600px;
}
@media (max-width: 980px) {
  .mp-layout { grid-template-columns: 1fr; height: auto; }
  .mp-feed { max-height: 50vh; }
}

/* ─────── FEED ─────── */
.mp-feed {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.mp-feed-head {
  padding: 16px 18px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.mp-feed-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 8px;
}
.mp-feed-title .c {
  font-family: var(--font-sans);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--violet);
  color: white;
  font-weight: 600;
  letter-spacing: 0;
}
.mp-feed-search {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 10px;
  padding: 0 12px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
}
.mp-feed-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0;
  background: transparent;
  color: var(--foreground);
  font-family: inherit;
  font-size: 13px;
}
.mp-feed-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
  display: flex; flex-direction: column;
  gap: 2px;
}

/* ─────── THREAD ROW ─────── */
.mp-thread {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: background 120ms;
  position: relative;
}
.mp-thread:hover { background: var(--background); }
.mp-thread.active {
  background: color-mix(in oklab, var(--card) 86%, var(--violet) 14%);
}
.mp-thread.unread::before {
  content: '';
  position: absolute;
  left: 4px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 28px;
  border-radius: 2px;
  background: var(--violet);
}

.mp-thread-av {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6b4bb8, #2e1866);
  color: white;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.mp-thread-av.big { width: 44px; height: 44px; font-size: 14px; }
.mp-online {
  position: absolute;
  bottom: 0; right: 0;
  width: 11px; height: 11px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid var(--card);
}
.mp-online.big {
  width: 12px; height: 12px;
}
.mp-online-txt {
  font-size: 11px;
  color: #22c55e;
  font-weight: 500;
  margin-left: 6px;
}
.mp-thread-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-thread-row1 {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.mp-thread-who {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  display: inline-flex; align-items: center; gap: 4px;
}
.mp-verif { color: var(--violet-bright, #7b55d0); display: inline-flex; }
.mp-thread-time {
  font-size: 11px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.mp-thread-project {
  font-size: 11.5px;
  color: var(--violet-bright, #7b55d0);
  font-weight: 500;
}
.mp-thread-preview {
  font-size: 12.5px;
  color: var(--muted-foreground);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-thread.unread .mp-thread-preview {
  color: var(--foreground);
  font-weight: 500;
}
.mp-thread-foot {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.mp-thread-foot .mp-spacer { flex: 1; }
.mp-waits {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245,158,11,0.14);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.28);
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 3px;
}
.mp-predeal {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(123,85,208,0.10);
  color: var(--violet-bright, #7b55d0);
  border: 1px solid rgba(123,85,208,0.25);
  font-weight: 500;
}
.mp-unread-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--violet);
  color: white;
  min-width: 20px;
  text-align: center;
}

/* ─────── CHAT VIEW ─────── */
.mp-chat-wrap {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.mp-chat {
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 0;
}
.mp-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 14px;
  flex-wrap: wrap;
}
.mp-chat-head-l {
  display: flex; align-items: center; gap: 12px;
}
.mp-chat-who {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--foreground);
  display: inline-flex; align-items: center; gap: 4px;
}
.mp-chat-project {
  font-size: 12px;
  color: var(--violet-bright, #7b55d0);
  font-weight: 500;
  margin-top: 2px;
}
.mp-chat-head-r { display: inline-flex; gap: 8px; align-items: center; }

.mp-banner {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 18px;
  background: rgba(123,85,208,0.07);
  border-bottom: 1px solid rgba(123,85,208,0.20);
  font-size: 12.5px;
  color: var(--foreground);
  line-height: 1.5;
}
.mp-banner svg { color: var(--violet-bright, #7b55d0); margin-top: 2px; }

.mp-thread-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 8px;
  display: flex; flex-direction: column;
  gap: 6px;
  background:
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(123,85,208,0.06), transparent 60%);
}
.mp-day-sep {
  align-self: center;
  margin: 14px 0 8px;
  font-size: 11px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.mp-day-sep span {
  padding: 3px 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.mp-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  position: relative;
  display: flex; flex-direction: column;
}
.mp-bubble.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-light, #6b4bb8) 100%);
  color: white;
  border-bottom-right-radius: 6px;
}
.mp-bubble.theirs {
  align-self: flex-start;
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--foreground);
  border-bottom-left-radius: 6px;
}
.mp-bubble-text { word-wrap: break-word; }
.mp-bubble-time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
  align-self: flex-end;
}
.mp-bubble.theirs .mp-bubble-time { align-self: flex-start; color: var(--muted-foreground); }

.mp-bubble.voice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-width: 220px;
}
.mp-bubble.voice .mp-bubble-time {
  grid-column: 1 / -1;
}
.mp-voice-play {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  color: #1a0e3e;
  border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.mp-bubble.theirs .mp-voice-play {
  background: var(--violet);
  color: white;
}
.mp-voice-wave {
  display: flex; align-items: center;
  gap: 2px;
  height: 22px;
  width: 100%;
}
.mp-voice-wave > span {
  flex: 1;
  background: currentColor;
  opacity: 0.6;
  border-radius: 1px;
}
.mp-voice-dur {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

/* ─────── COMPOSER ─────── */
.mp-composer-wrap {
  border-top: 1px solid var(--border);
  background: var(--card);
}
.mp-quick {
  padding: 12px 18px 6px;
  border-bottom: 1px dashed var(--border);
  background:
    radial-gradient(ellipse 60% 80% at 0% 100%, rgba(245,158,11,0.06), transparent 60%);
}
.mp-quick-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  font-weight: 600;
  margin-bottom: 8px;
}
.mp-quick-head svg { color: #f59e0b; }
.mp-quick-hint {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted-foreground);
  margin-left: auto;
}
.mp-quick-list {
  display: flex; gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.mp-quick-item {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 120ms;
}
.mp-quick-item:hover {
  border-color: var(--violet-bright, #7b55d0);
  background: rgba(123,85,208,0.06);
}
.mp-quick-add {
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted-foreground);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.mp-quick-add:hover { color: var(--violet-bright, #7b55d0); border-color: var(--violet-bright, #7b55d0); }

.mp-composer {
  display: grid;
  grid-template-columns: 34px 34px 1fr 34px 38px;
  gap: 8px;
  padding: 12px 18px;
  align-items: center;
}
.mp-composer textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  resize: none;
  outline: none;
  transition: border-color 150ms;
  min-height: 40px;
  max-height: 120px;
}
.mp-composer textarea:focus { border-color: var(--violet-bright, #7b55d0); }
.mp-composer .cat-icon-btn { width: 34px; height: 34px; }
.mp-composer .cat-icon-btn.active {
  background: rgba(245,158,11,0.14);
  color: #f59e0b;
}
.mp-send {
  width: 38px; height: 38px;
  border-radius: 999px;
  background: var(--violet);
  color: white;
  border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 120ms;
}
.mp-send:hover { background: var(--violet-light, #6b4bb8); }
.mp-send:disabled { opacity: 0.4; cursor: not-allowed; }
