/* «Сообщения»: the project's discussion — a composer on top, then message cards with replies */
.workspace > .messages-view { display: grid; gap: 16px; align-content: start; max-width: 760px; margin: 24px auto 40px; padding: 0 24px; }

.messages-view .message-composer,
.messages-view .message-card { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 16px 20px; border: 1px solid #e6e1ee; border-radius: 12px; background: #fff; }
.messages-view .avatar { width: 32px; height: 32px; font-size: 14px; }

.messages-view .message-composer-fields { display: grid; gap: 8px; min-width: 0; }
.messages-view .message-composer input,
.messages-view .message-composer textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #ddd6e8; border-radius: 8px; background: #fff; color: #1e1f21; font: inherit; font-size: 14px; }
.messages-view .message-composer input { font-weight: 600; }
.messages-view .message-composer textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.messages-view .message-composer :is(input, textarea):focus { outline: none; border-color: #8f6ce0; box-shadow: 0 0 0 3px #efe9fd; }
.messages-view .message-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.messages-view .message-composer-foot small { color: var(--ink-2); font-size: 12px; }

.messages-view .message-list { display: grid; gap: 16px; }
.messages-view .message-card { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.messages-view .message-card.focused { border-color: #b9a4f0; box-shadow: 0 0 0 3px #efe9fd; }
.messages-view .message-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.messages-view .message-author { display: grid; min-width: 0; flex: 1; }
.messages-view .message-author strong { color: #1e1f21; font-size: 14px; }
.messages-view .message-author small { color: var(--ink-2); font-size: 12px; }
.messages-view .message-actions { display: flex; gap: 2px; }
.messages-view .message-actions button,
.messages-view .message-reply-head button { min-height: 26px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-size: 12px; cursor: pointer; }
.messages-view .message-actions button:hover,
.messages-view .message-reply-head button:hover { background: #f3f0f8; color: #3d3550; }
.messages-view .message-actions [data-delete-message]:hover,
.messages-view .message-reply-head [data-delete-reply]:hover { color: var(--ink-red); }
.messages-view .message-card h3 { margin: 0; color: #1e1f21; font-size: 17px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.messages-view .message-text { margin: 0; color: #2f2a38; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

.messages-view .message-foot { display: flex; align-items: center; gap: 12px; }
.messages-view .message-like { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px; border: 1px solid #e6e1ee; border-radius: 999px; background: #fff; color: #6d6479; font-size: 12px; cursor: pointer; }
.messages-view .message-like:hover:not(:disabled) { border-color: #cfc3e6; }
.messages-view .message-like.liked { border-color: #d9cdf7; background: #f3effc; color: #6a45cc; }
.messages-view .message-like b { font-weight: 600; }
.messages-view .message-like > span[aria-hidden] { font-size: 14px; line-height: 1; }
.messages-view .message-like:disabled { cursor: default; opacity: .7; }
.messages-view .message-reply-count { color: var(--ink-2); font-size: 12px; }

.messages-view .message-replies { display: grid; gap: 12px; padding: 12px 0 0; border-top: 1px solid #f0edf4; }
.messages-view .message-reply { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
.messages-view .message-reply .avatar { width: 28px; height: 28px; font-size: 12px; }
.messages-view .message-reply p { margin: 0; color: #2f2a38; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.messages-view .message-reply .message-reply-head { display: flex; align-items: baseline; gap: 8px; white-space: normal; }
.messages-view .message-reply-head strong { font-size: 13px; }
.messages-view .message-reply-head small { color: var(--ink-2); font-size: 12px; }
.messages-view .message-reply-head button { margin-left: auto; min-height: 22px; }

.messages-view .message-reply-form { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding-top: 12px; border-top: 1px solid #f0edf4; }
.messages-view .message-reply-form .avatar { width: 28px; height: 28px; font-size: 12px; }
.messages-view .message-reply-form textarea { width: 100%; box-sizing: border-box; min-height: 34px; padding: 6px 10px; border: 1px solid #ddd6e8; border-radius: 8px; background: #fff; color: #1e1f21; font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; }
.messages-view .message-reply-form textarea:focus { outline: none; border-color: #8f6ce0; box-shadow: 0 0 0 3px #efe9fd; }
.messages-view .message-reply-form button { min-height: 34px; padding: 0 12px; border: 1px solid #ddd6e8; border-radius: 8px; background: #fff; color: #3d3550; font-size: 13px; font-weight: 500; cursor: pointer; }
.messages-view .message-reply-form button:hover { background: #f7f5fa; }

.messages-view .messages-empty-state { display: grid; justify-items: center; gap: 8px; padding: 40px 24px; border: 1px dashed #ddd6e8; border-radius: 12px; background: #fcfbfe; text-align: center; }
.messages-view .messages-empty-state strong { color: #1e1f21; font-size: 16px; }
.messages-view .messages-empty-state p { max-width: 420px; margin: 0; color: #6d6479; font-size: 14px; line-height: 1.5; }
.messages-view .messages-empty-icon { width: 40px; height: 40px; border-radius: 50%; background: #f3effc url("/icons/lucide/message-circle.svg") center / 20px no-repeat; }

/* @-mentions: the teammate list opens under the field */
.messages-view .message-composer { position: relative; }
.messages-view .mention-picker { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; display: grid; gap: 2px; max-height: 260px; padding: 6px; overflow-y: auto; border: 1px solid #e3d9f7; border-radius: 10px; background: #fff; box-shadow: 0 14px 34px #2b20481f; }
.messages-view .mention-picker[hidden] { display: none; }
.messages-view .mention-picker p { margin: 2px 6px 4px; color: var(--ink-2); font-size: 12px; }
.messages-view .mention-picker button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: #24202c; font: 14px var(--app-font); text-align: left; cursor: pointer; }
.messages-view .mention-picker button.active,
.messages-view .mention-picker button:hover { background: #f3efff; }
.messages-view .mention-picker .avatar { width: 26px; height: 26px; font-size: 11px; }

@media (max-width: 720px) {
  .workspace > .messages-view { margin: 16px 0 32px; padding: 0 12px; gap: 12px; }
  .messages-view .message-composer,
  .messages-view .message-card { padding: 14px; }
  .messages-view .message-composer { grid-template-columns: minmax(0, 1fr); }
  .messages-view .message-composer > .avatar { display: none; }
  .messages-view .message-composer-foot { flex-wrap: wrap; }
  .messages-view .message-reply-form { grid-template-columns: minmax(0, 1fr) auto; }
  .messages-view .message-reply-form > .avatar { display: none; }
}
