html, body { min-height: 100%; }
body { background: #eef2f5; }
.chat-shell { max-width: 980px; margin: 0 auto; background: #fff; border-radius: 18px; overflow: hidden; }
.chat-header { padding: 18px 22px; background: #075e54; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.chat-messages { height: 62vh; overflow-y: auto; padding: 22px; background: #efeae2; }
.message-row { display: flex; margin-bottom: 14px; }
.message-row.mine { justify-content: flex-end; }
.message-row.other { justify-content: flex-start; }
.message-bubble { max-width: min(75%, 680px); padding: 10px 12px; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.mine .message-bubble { background: #d9fdd3; border-bottom-right-radius: 3px; }
.other .message-bubble { background: #fff; border-bottom-left-radius: 3px; }
.message-meta { display: flex; gap: 12px; justify-content: space-between; font-size: .75rem; color: #667781; margin-bottom: 5px; }
.message-text { white-space: pre-wrap; word-break: break-word; }
.attachment-card { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid rgba(0,0,0,.1); border-radius: 10px; margin-top: 8px; background: rgba(255,255,255,.6); }
.chat-image { max-width: 180px; max-height: 140px; border-radius: 8px; object-fit: cover; }
.chat-compose { padding: 14px; border-top: 1px solid #ddd; background: #f7f8fa; }
.compose-actions { display: flex; gap: 10px; margin-top: 10px; }
@media (max-width: 700px) {
  .chat-messages { height: 65vh; padding: 12px; }
  .message-bubble { max-width: 90%; }
  .compose-actions { flex-direction: column; }
}

/* Emoji picker */
.composer-input-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.composer-textarea {
  min-height: 54px;
  resize: vertical;
  padding-right: 12px;
}
.emoji-trigger {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.55rem;
  line-height: 1;
  transition: background-color .15s ease, transform .15s ease;
}
.emoji-trigger:hover,
.emoji-trigger.active {
  background: #e2e6ea;
  transform: scale(1.04);
}
.emoji-picker {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 1050;
  width: min(360px, calc(100vw - 48px));
  height: 390px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d9dee3;
  border-radius: 16px;
  background: #fff;
}
.emoji-picker[hidden] { display: none !important; }
.emoji-picker-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #edf0f2;
}
.emoji-categories {
  display: flex;
  gap: 3px;
  padding: 7px 9px;
  overflow-x: auto;
  border-bottom: 1px solid #edf0f2;
  scrollbar-width: thin;
}
.emoji-category {
  min-width: 39px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 1.25rem;
}
.emoji-category:hover { background: #f1f3f5; }
.emoji-category.active {
  background: #d9fdd3;
  box-shadow: inset 0 -2px 0 #128c7e;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 10px;
  overflow-y: auto;
}
.emoji-item {
  aspect-ratio: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 1.55rem;
  line-height: 1;
  transition: background-color .1s ease, transform .1s ease;
}
.emoji-item:hover,
.emoji-item:focus-visible {
  background: #edf7f5;
  transform: scale(1.12);
  outline: none;
}
.emoji-empty {
  margin: auto;
  padding: 25px;
  color: #667781;
  text-align: center;
}
@media (max-width: 700px) {
  .emoji-picker {
    left: -2px;
    width: min(350px, calc(100vw - 40px));
    height: 360px;
  }
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
}
