.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 24px;
  background: var(--panel);
}

.file-card {
  width: 110px;
  height: 110px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.file-card .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.file-card .remove:hover { background: var(--danger); }

/* 画像カード */
.file-card.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* テキストカード */
.file-card.text-card { padding: 8px; }
.file-card .file-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.file-card .text-preview {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

/* チャットログ内のファイル並べ用 */
.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

/* チャット上のカードには削除ボタンを出さない */
.chat-file-card { cursor: default; }
.chat-file-card:hover { border-color: var(--accent-dim); }
