/* F38.W1 — SetupChat media controls. */
.sc-input-area.is-dragging {
  background: rgba(79, 70, 229, 0.06);
  box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.18);
}

.sc-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  max-height: 154px;
  overflow-y: auto;
  padding-right: 2px;
}

.sc-file-chip,
.sc-attachment {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-muted, #f1f5f9);
  color: var(--text, #0f172a);
  font-size: 12px;
  text-decoration: none;
}

.sc-file-chip.is-image,
.sc-attachment.is-image {
  align-items: flex-start;
  flex-direction: column;
  padding: 6px;
}

.sc-file-chip.is-image {
  width: 118px;
  gap: 5px;
}

.sc-file-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--muted, #64748b);
}

.sc-file-preview {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  color: var(--muted, #64748b);
  background: rgba(255, 255, 255, 0.7);
}

.sc-file-chip.is-image .sc-file-preview {
  width: 100%;
  height: 72px;
  border-radius: 8px;
  cursor: zoom-in;
  background: #e2e8f0;
}

.sc-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sc-file-name {
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-file-chip.is-image .sc-file-name {
  width: 100%;
  max-width: 100%;
}

.sc-file-size {
  flex-shrink: 0;
  color: var(--muted, #64748b);
}

.sc-file-chip.is-image .sc-file-size { display: none; }

.sc-file-remove {
  border: 0;
  background: transparent;
  color: var(--muted, #64748b);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sc-file-remove:hover { background: rgba(15, 23, 42, 0.08); color: var(--danger, #ef4444); }

.sc-file-chip.is-image .sc-file-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
}

.sc-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 88%;
}
.sc-attachment-list.is-user { align-self: flex-end; justify-content: flex-end; }
.sc-attachment:hover { border-color: var(--brand-primary, #4f46e5); }

.sc-attachment.is-image {
  padding: 8px;
  align-items: flex-start;
  flex-direction: column;
  width: 156px;
}

.sc-attachment.is-image .sc-file-preview {
  width: 100%;
  height: 96px;
  border-radius: 8px;
  background: #e2e8f0;
}

.sc-attachment.is-image .sc-file-name {
  max-width: 100%;
}

.sc-attachment.is-image { cursor: zoom-in; }

.sc-voice.is-recording {
  color: var(--danger, #ef4444);
  border-color: rgba(239, 68, 68, 0.45);
  animation: scPulse 1.2s ease-in-out infinite;
}

.sc-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sc-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.72);
  cursor: zoom-out;
}

.sc-preview-frame {
  position: relative;
  z-index: 1;
  width: min(920px, 96vw);
  max-height: 92vh;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.24);
  background: #0f172a;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.42);
  overflow: hidden;
}

.sc-preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.14);
  color: #f8fafc;
}

.sc-preview-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.sc-preview-close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sc-preview-image {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 45px);
  margin: 0 auto;
  object-fit: contain;
  background: #020617;
}

@media (max-width: 760px) {
  .sc-file-chip.is-image { width: calc(50% - 4px); min-width: 112px; }
  .sc-preview-modal { padding: 10px; }
  .sc-preview-frame { width: 100%; max-height: 94vh; }
  .sc-preview-image { max-height: calc(94vh - 45px); }
}
