.wans-ai-attachments {
  border-top: 1px solid #d8e1eb;
  padding-top: 8px;
}

.wans-ai-attachments.is-dragging {
  background: #eef6ff;
  outline: 2px solid #2271b1;
  outline-offset: 2px;
}

.wans-ai-attachment-queue,
.wans-ai-message-attachments {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0 0 8px;
}

.wans-ai-attachment-chip,
.wans-ai-message-attachments > a {
  align-items: center;
  background: #f6f8fb;
  border: 1px solid #d8e1eb;
  border-radius: 6px;
  color: #172235;
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 6px;
  text-decoration: none;
}

.wans-ai-attachment-chip img,
.wans-ai-attachment-chip > span,
.wans-ai-message-attachments img,
.wans-ai-message-attachments .is-file > span {
  align-items: center;
  background: #e7eef6;
  border-radius: 4px;
  display: flex;
  flex: 0 0 42px;
  height: 42px;
  justify-content: center;
  object-fit: cover;
  width: 42px;
}

.wans-ai-attachment-chip > span,
.wans-ai-message-attachments .is-file > span {
  color: #36506d;
  font-size: 9px;
  font-weight: 700;
}

.wans-ai-attachment-chip > div,
.wans-ai-message-attachments .is-file > div {
  min-width: 0;
}

.wans-ai-attachment-chip strong,
.wans-ai-message-attachments strong,
.wans-ai-attachment-chip small,
.wans-ai-message-attachments small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wans-ai-attachment-chip button {
  background: transparent;
  border: 0;
  color: #53657a;
  cursor: pointer;
  flex: 0 0 30px;
  font-size: 20px;
  height: 30px;
  margin-left: auto;
  padding: 0;
}

.wans-ai-attachment-tools {
  align-items: center;
  display: flex;
  gap: 10px;
}

.wans-ai-attachment-tools button {
  background: transparent;
  border: 1px solid #aebdcd;
  border-radius: 6px;
  color: #1f4f7c;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  min-height: 30px;
  padding: 4px 10px;
}

.wans-ai-attachment-tools small {
  color: #62748a;
  font-size: 11px;
  line-height: 1.3;
}

.wans-ai-message-attachments {
  margin-top: 8px;
}

.wans-ai-message-attachments > a:not(.is-file) {
  align-items: flex-start;
  flex-direction: column;
}

.wans-ai-message-attachments > a:not(.is-file) img {
  aspect-ratio: 4 / 3;
  height: auto;
  max-height: 180px;
  width: 100%;
}

.wans-ai-message-attachments > a:not(.is-file) span {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

@media (max-width: 600px) {
  .wans-ai-message-attachments {
    grid-template-columns: 1fr;
  }

  .wans-ai-attachment-queue {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 3px;
    scroll-snap-type: x proximity;
  }

  .wans-ai-attachment-chip {
    flex: 0 0 min(250px, calc(100vw - 86px));
    scroll-snap-align: start;
  }

  .wans-ai-attachment-tools {
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
  }
}
