.wrapper {
  flex: 1;
  padding: 4px 0;
  position: relative;
}

.editor {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
  min-height: 24px;
  max-height: 202px;
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.placeholder {
  position: absolute;
  top: 4px;
  left: 0;
  color: #5a5a6a;
  font-size: 14px;
  line-height: 1.6;
  pointer-events: none;
  font-family: 'Noto Sans SC', system-ui, sans-serif;
}

/* @ mention tag (inserted as contentEditable=false span) */
.mention {
  display: inline-block;
  white-space: nowrap;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 4px;
  background: rgba(108, 99, 255, 0.12);
  color: rgba(108, 99, 255, 0.7);
  font-size: 13px;
  cursor: grab;
  user-select: none;
  transition: background 0.15s, opacity 0.15s;
}

.mentionAudioIcon {
  display: inline-block;
  margin-right: 3px;
  font-size: 13px;
  vertical-align: middle;
  pointer-events: none;
}

.mentionAudioIcon::before {
  content: '\266B'; /* ♫ rendered via CSS, not textContent — avoids polluting prompt text */
}

.mentionImg {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 3px;
  display: inline-block;
  pointer-events: none;
}

.dragging {
  opacity: 0.4;
}

.mention:hover {
  background: rgba(108, 99, 255, 0.22);
  color: rgba(108, 99, 255, 0.9);
}

/* Mention popup — appears above cursor */
.mentionPopup {
  position: absolute;
  z-index: 100;
  background: rgba(13, 13, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 6px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px) saturate(180%);
  transform: translateY(-100%);
  animation: fadeInUp 0.12s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(-100%) translateY(4px); }
  to { opacity: 1; transform: translateY(-100%); }
}

.mentionHeader {
  padding: 4px 8px 6px;
  font-size: 11px;
  color: #5a5a6a;
  border-bottom: 1px solid #2a2a3a;
  margin-bottom: 4px;
}

.mentionItem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
}

.mentionItem:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mentionItemActive {
  background: rgba(108, 99, 255, 0.15);
  color: #f1f0ff;
}

.mentionThumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #2a2a3a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbMedia {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mentionLabel {
  flex: 1;
  color: var(--color-text-primary);
  font-size: 13px;
}

.mentionType {
  color: #5a5a6a;
  font-size: 11px;
}

/* Hover preview tooltip */
.previewTooltip {
  position: absolute;
  z-index: 200;
  transform: translate(-50%, -100%);
  background: #1e1e2e;
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: fadeIn 0.1s ease;
}

.previewMedia {
  display: block;
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
}

.previewLabel {
  text-align: center;
  color: #8a8a9a;
  font-size: 11px;
  margin-top: 4px;
}
