/* 聊天：照片 / 表情 */
.chat-tool {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
}
.chat-tool:hover { color: var(--brand); background: #fff1f2; }
.chat-tool:active { transform: scale(.96); }
.chat-tool svg { display: block; }

.chat-send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #e11d48, #fb7185);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(225,29,72,.28);
  padding: 0;
}
.chat-send:hover { filter: brightness(1.05); }
.chat-send:active { transform: scale(.96); }
.chat-send svg { display: block; margin-left: 2px; }

.chat-input {
  align-items: center;
  gap: 6px;
}
.chat-input #chat-text {
  min-width: 0;
  flex: 1;
  padding: 11px 14px;
}

.emoji-panel {
  background: #fff;
  border-top: 1px solid var(--line);
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px 8px;
}
.emoji-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
}
.emoji-tabs button {
  border: 0;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.emoji-tabs button.on {
  background: #ffe4e6;
  color: var(--brand);
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.emoji-grid button {
  border: 0;
  background: transparent;
  font-size: 24px;
  padding: 6px 0;
  cursor: pointer;
  border-radius: 8px;
  line-height: 1.2;
}
.emoji-grid button:hover { background: #f3f4f6; }
.emoji-grid.stickers {
  grid-template-columns: repeat(4, 1fr);
}
.emoji-grid.stickers button {
  font-size: 40px;
  padding: 10px 0;
  background: #fafbfc;
  border: 1px solid #f1f3f7;
}

.bubble.image-bubble {
  padding: 4px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  max-width: 62% !important;
}
.bubble.image-bubble img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  cursor: zoom-in;
  background: #eee;
}
.bubble.emoji-bubble {
  font-size: 42px;
  line-height: 1.1;
  padding: 6px 8px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.msg-row.mine .bubble.emoji-bubble,
.msg-row.theirs .bubble.emoji-bubble {
  background: transparent !important;
}

.chat-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.chat-lightbox.show { display: flex; }
.chat-lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}

@media (min-width: 768px) {
  .emoji-grid { grid-template-columns: repeat(10, 1fr); }
}
