.my-ai-chat {
  width: 100%;
  max-width: 880px;
  margin: 24px auto;
  font-family: Arial, Helvetica, sans-serif;
  color: #111827;
}

.my-ai-chat__card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}

.my-ai-chat__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid #eef2f7;
  background: #fafafa;
}

.my-ai-chat__avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.my-ai-chat__header-text {
  min-width: 0;
}

.my-ai-chat__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.my-ai-chat__subtitle {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.my-ai-chat__messages {
  height: 460px;
  overflow-y: auto;
  padding: 20px;
  background: #f9fafb;
}

.my-ai-chat__bubble {
  max-width: 82%;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.55;
  word-break: break-word;
}

.my-ai-chat__bubble--assistant {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  margin-right: auto;
  border-bottom-left-radius: 6px;
}

.my-ai-chat__bubble--user {
  background: #111827;
  color: #ffffff;
  margin-left: auto;
  border-bottom-right-radius: 6px;
}

.my-ai-chat__bubble-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  opacity: 0.72;
}

.my-ai-chat__bubble-content h3,
.my-ai-chat__bubble-content h4 {
  margin: 10px 0 6px;
}

.my-ai-chat__bubble-content strong {
  display: inline-block;
  margin-top: 8px;
}

.my-ai-chat__bubble-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.my-ai-chat__bubble-gallery img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.my-ai-chat__preview-area {
  display: none;
  gap: 12px;
  padding: 14px 20px 0;
  flex-wrap: wrap;
  background: #ffffff;
}

.my-ai-chat__preview-area.is-active {
  display: flex;
}

.my-ai-chat__preview-item {
  width: 96px;
  position: relative;
}

.my-ai-chat__preview-item img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  display: block;
}

.my-ai-chat__preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.my-ai-chat__preview-name {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-ai-chat__composer {
  padding: 16px 20px 18px;
  border-top: 1px solid #eef2f7;
  background: #ffffff;
}

.my-ai-chat__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.my-ai-chat__icon-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
}

.my-ai-chat__icon-btn:hover,
.my-ai-chat__send-btn:hover {
  transform: translateY(-1px);
}

.my-ai-chat__helper {
  font-size: 13px;
  color: #6b7280;
}

.my-ai-chat__file-input {
  display: none;
}

.my-ai-chat__textarea-wrap {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.my-ai-chat__textarea {
  flex: 1;
  resize: none;
  min-height: 52px;
  max-height: 180px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  background: #ffffff;
}

.my-ai-chat__textarea:focus {
  border-color: #111827;
}

.my-ai-chat__send-btn {
  border: none;
  background: #111827;
  color: #ffffff;
  padding: 14px 18px;
  min-width: 92px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}

.my-ai-chat__send-btn:disabled,
.my-ai-chat__icon-btn:disabled,
.my-ai-chat__textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.my-ai-chat__footer-note {
  margin-top: 12px;
  font-size: 12px;
  color: #6b7280;
}

.my-ai-chat__typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 24px;
}

.my-ai-chat__typing span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9ca3af;
  animation: my-ai-chat-bounce 1.2s infinite ease-in-out;
}

.my-ai-chat__typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.my-ai-chat__typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes my-ai-chat-bounce {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.55;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .my-ai-chat {
    margin: 12px auto;
  }

  .my-ai-chat__messages {
    height: 420px;
    padding: 14px;
  }

  .my-ai-chat__bubble {
    max-width: 92%;
  }

  .my-ai-chat__textarea-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .my-ai-chat__send-btn {
    width: 100%;
  }

  .my-ai-chat__toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
