/* ===== Messaging Sidebar ===== */
.msg-sidebar {
  width: 260px;
  min-width: 260px;
  display: none;
  flex-direction: column;
  padding: 0;
  background: #dce1e8;
  overflow: hidden;
  animation: slideUpFadeIn 0.3s ease backwards;
}

.msg-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 8px;
}

.msg-back-btn {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #555;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.msg-back-btn:hover {
  background: rgba(0, 0, 0, 0.12);
}

.msg-sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.msg-sidebar-search {
  padding: 8px 14px;
}

.msg-sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.03);
  color: #333;
  outline: none;
  transition: border-color 0.15s;
}

.msg-sidebar-search input::placeholder {
  color: #999;
}

.msg-sidebar-search input:focus {
  border-color: var(--color-accent-light);
}

.msg-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 16px;
}

/* ===== Sidebar Filter Buttons ===== */
.msg-sidebar-filters {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 8px;
}

.msg-sidebar-filter-btn {
  display: block;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.msg-sidebar-filter-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.msg-sidebar-filter-btn.active {
  background: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
  font-weight: 500;
}

/* ===== Sidebar Action Buttons ===== */
.msg-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 4px;
}

.msg-sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.msg-sidebar-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}

/* ===== Conversation List (Left Pane) ===== */
.msg-conversations {
  width: 340px;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  height: 100%;
  overflow: hidden;
}

.msg-conv-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 10px;
  flex-shrink: 0;
}

.msg-conv-search input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.03);
  color: #222;
  outline: none;
  transition: border-color 0.15s;
}

.msg-conv-search input:focus {
  border-color: var(--color-accent-light);
}

.msg-conv-search input::placeholder {
  color: #999;
}

.msg-conv-new-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.msg-conv-new-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-accent-light);
}

.msg-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 6px 12px;
}

/* ===== New Conversation Menu ===== */
.msg-new-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 50;
  overflow: hidden;
  min-width: 180px;
}

.msg-new-menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.msg-new-menu-item:hover {
  background: rgba(245, 166, 35, 0.1);
}

/* ===== Conversation Row ===== */
.msg-conv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.msg-conv-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.msg-conv-row.active {
  background: rgba(0, 0, 0, 0.06);
}

/* Conversation Avatar */
.msg-conv-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #999;
}

.msg-conv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.msg-conv-avatar-emoji {
  font-size: 18px;
  line-height: 1;
}

/* Conversation Info */
.msg-conv-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msg-conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.msg-conv-name {
  font-size: var(--font-size-body);
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.msg-conv-time {
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
  white-space: nowrap;
}

.msg-conv-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.msg-conv-preview {
  font-size: var(--font-size-small);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* ===== Unread Badge ===== */
.msg-unread-badge {
  background: linear-gradient(to top, var(--color-accent-light), var(--color-accent-dark));
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  min-width: 18px;
  text-align: center;
}

/* ===== Chat Pane (Right Pane) ===== */
.msg-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

/* ===== Chat Header ===== */
.msg-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.msg-chat-back-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.msg-chat-back-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.msg-chat-header-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #999;
  font-size: 16px;
}

.msg-chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.msg-chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.msg-chat-header-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-chat-header-sub {
  font-size: 12px;
  color: #888;
}

/* ===== People Toggle Button ===== */
.msg-people-toggle {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.msg-people-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #333;
}

.msg-people-toggle.active {
  background: rgba(245, 166, 35, 0.12);
  color: var(--color-accent-dark);
}

/* ===== Chat Wrapper (main + people panel) ===== */
.msg-chat-wrapper {
  display: flex;
  flex: 1;
  height: 100%;
  min-width: 0;
}

.msg-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== People Panel ===== */
.msg-people-panel {
  width: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.02);
  border-left: 0 solid rgba(0, 0, 0, 0.08);
  transition: width 0.25s ease, padding 0.25s ease, border-width 0.25s ease;
  display: flex;
  flex-direction: column;
}

.msg-people-panel.msg-people--visible {
  width: 260px;
  padding: 20px;
  border-left-width: 1px;
}

.msg-people-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.msg-people-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.msg-people-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg-people-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}

.msg-people-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.msg-people-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  color: #aaa;
}

.msg-people-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-people-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.msg-people-name {
  font-size: 13px;
  color: #333;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-people-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-accent-light);
  margin-top: 1px;
}

.msg-people-invite-btn {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  background: transparent;
  color: #888;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.msg-people-invite-btn:hover {
  border-color: var(--color-accent-dark);
  color: var(--color-accent-dark);
  background: rgba(245, 166, 35, 0.08);
}

/* Responsive: hide people panel on small screens */
@media (max-width: 900px) {
  .msg-people-panel.msg-people--visible {
    width: 220px;
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .msg-people-panel.msg-people--visible {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 260px;
    background: #ffffff;
    z-index: 20;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  }
}

/* ===== Welcome Screen ===== */
.msg-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  gap: 12px;
  padding: 40px;
}

.msg-welcome-icon {
  opacity: 0.3;
}

.msg-welcome-title {
  font-size: var(--font-size-subtitle);
  font-weight: 500;
  color: #999;
}

.msg-welcome-desc {
  font-size: var(--font-size-body);
  color: #999;
}

/* ===== Messages ===== */
.msg-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 80%;
  animation: slideUpFadeIn 0.2s ease backwards;
}

.msg-bubble-own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-bubble-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.msg-initials-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
  background: #64748b;
  user-select: none;
  text-transform: uppercase;
}

.msg-bubble-avatar.msg-initials-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.msg-conv-avatar .msg-initials-avatar {
  font-size: 14px;
}

.msg-people-avatar .msg-initials-avatar {
  font-size: 11px;
}

.msg-bubble-body {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 60px;
}

.msg-bubble-own .msg-bubble-body {
  background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent-dark));
  color: #fff;
}

.msg-bubble-own .msg-bubble-sender {
  color: rgba(255, 255, 255, 0.85);
}

.msg-bubble-own .msg-bubble-time {
  color: rgba(255, 255, 255, 0.65);
}

.msg-bubble-own .msg-bubble-content {
  color: #fff;
}

.msg-bubble-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.msg-bubble-sender {
  font-size: var(--font-size-small);
  font-weight: 600;
  color: #333;
}

.msg-bubble-time {
  font-size: 11px;
  color: #999;
}

.msg-bubble-content {
  font-size: var(--font-size-body);
  color: #222;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-pin-indicator {
  color: var(--color-accent-light);
}

/* ===== Mentions ===== */
.msg-mention {
  background: rgba(245, 166, 35, 0.2);
  color: var(--color-accent-light);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 13px;
}

/* ===== Attachments ===== */
.msg-attachment {
  margin-top: 6px;
}

.msg-attachment-img {
  max-width: 240px;
  max-height: 180px;
  border-radius: 8px;
  cursor: pointer;
}

.msg-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-accent-light);
  font-size: 13px;
  text-decoration: none;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  transition: background 0.15s;
}

.msg-attachment-link:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* ===== Message Input ===== */
.msg-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  position: relative;
}

.msg-textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.03);
  color: #222;
  outline: none;
  max-height: 120px;
  line-height: 1.4;
  transition: border-color 0.15s;
}

.msg-textarea:focus {
  border-color: var(--color-accent-light);
}

.msg-textarea::placeholder {
  color: #999;
}

.msg-attach-btn,
.msg-send-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.msg-attach-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #555;
}

.msg-send-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.msg-send-btn.active {
  background: linear-gradient(to top, var(--color-accent-light), var(--color-accent-dark));
  color: #fff;
}

.msg-send-btn.active:hover {
  filter: brightness(1.1);
}

/* ===== Mention Dropdown ===== */
.msg-mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 48px;
  right: 48px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
}

.msg-mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.1s;
}

.msg-mention-item:hover,
.msg-mention-item.active {
  background: rgba(245, 166, 35, 0.15);
}

.msg-mention-item-name {
  font-size: 13px;
  color: #222;
  font-weight: 500;
}

.msg-mention-item-username {
  font-size: 12px;
  color: #999;
}

/* ===== Loading / Empty States ===== */
.msg-loading,
.msg-empty {
  color: #999;
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
  font-style: italic;
}

/* ===== Modals ===== */
.msg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.msg-modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.msg-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.msg-modal-row {
  margin-bottom: 14px;
}

.msg-modal-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  margin-bottom: 6px;
}

.msg-modal-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.03);
  color: #222;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.msg-modal-input:focus {
  border-color: var(--color-accent-light);
}

.msg-emoji-trigger {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: border-color 0.15s;
}

.msg-emoji-trigger:hover {
  border-color: var(--color-accent-light);
}

.msg-modal-member-list {
  max-height: 180px;
  overflow-y: auto;
  margin-top: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
}

.msg-modal-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: background 0.1s;
}

.msg-modal-member-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.msg-modal-member-row input[type="checkbox"] {
  accent-color: var(--color-accent-light);
}

.msg-modal-person-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
  border-radius: 6px;
}

.msg-modal-person-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.msg-modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.msg-modal-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: filter 0.15s;
}

.msg-modal-btn-cancel {
  background: rgba(0, 0, 0, 0.06);
  color: #666;
}

.msg-modal-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.1);
}

.msg-modal-btn-create {
  background: linear-gradient(to top, var(--color-accent-light), var(--color-accent-dark));
  color: #fff;
}

.msg-modal-btn-create:hover {
  filter: brightness(1.1);
}

/* ===== Emoji Picker ===== */
.emoji-picker-container {
  position: fixed;
  width: 290px;
  height: 340px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.emoji-picker-search {
  padding: 8px;
}

.emoji-picker-search-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.03);
  color: #222;
  outline: none;
}

.emoji-picker-search-input:focus {
  border-color: var(--color-accent-light);
}

.emoji-picker-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.emoji-picker-tab {
  flex: 1;
  padding: 8px;
  background: none;
  border: none;
  color: #666;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-bottom-color 0.15s;
  border-bottom: 2px solid transparent;
}

.emoji-picker-tab.active {
  color: var(--color-accent-light);
  border-bottom-color: var(--color-accent-light);
}

.emoji-picker-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.emoji-picker-cat {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  padding: 6px 4px 4px;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-picker-grid-icons {
  grid-template-columns: repeat(6, 1fr);
}

.emoji-picker-cell {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.1s;
  color: #333;
}

.emoji-picker-cell:hover {
  background: rgba(0, 0, 0, 0.06);
}

.emoji-picker-icon-cell {
  font-size: 14px;
}

.emoji-picker-empty {
  color: #999;
  font-size: 13px;
  text-align: center;
  padding: 20px;
  font-style: italic;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .msg-conversations {
    width: 280px;
    min-width: 280px;
  }
}

@media (max-width: 768px) {
  .msg-conversations {
    width: 100%;
    min-width: 100%;
    border-right: none;
  }

  .msg-chat {
    display: none;
    width: 100%;
  }

  .msg-sidebar {
    width: 220px;
    min-width: 220px;
  }
}

@media (max-width: 480px) {
  .msg-sidebar {
    width: 100%;
    min-width: 100%;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: #dce1e8;
  }

  .msg-conv-search {
    padding: 10px;
  }

  .msg-conv-row {
    padding: 10px 12px;
  }
}

/* Mobile Phase 1 — touch-target minimum for the back button. */
@media (max-width: 768px) {
  .msg-back-btn {
    width: 40px;
    height: 40px;
  }
}
