.media-card {
  display: grid;
  gap: 10px;
  width: min(360px, 100%);
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 52, 96, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #16304f;
}

.outbound .media-card {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.media-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.media-card-heading > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.media-card-heading strong,
.media-card-heading small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card-heading strong {
  font-size: 12px;
}

.media-card-heading small {
  opacity: 0.72;
  font-size: 10px;
}

.media-kind-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: rgba(20, 104, 227, 0.12);
  font-size: 17px;
  font-weight: 800;
}

.outbound .media-kind-icon {
  background: rgba(255, 255, 255, 0.16);
}

.media-status-copy {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  opacity: 0.84;
}

.media-card.status-failed,
.media-card.status-too_large,
.media-card.status-expired {
  border-color: rgba(205, 48, 48, 0.3);
}

.media-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-action,
.selected-file-remove,
.attachment-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.media-action {
  padding: 8px 11px;
  border-radius: 10px;
  background: #1769e0;
  color: white;
  font-size: 10px;
  font-weight: 800;
}

.media-action.secondary {
  border: 1px solid rgba(23, 105, 224, 0.25);
  background: transparent;
  color: #1769e0;
}

.outbound .media-action.secondary {
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.media-action:disabled,
.attachment-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.media-preview {
  overflow: hidden;
  border-radius: 12px;
  background: rgba(3, 18, 39, 0.08);
}

.media-preview img,
.media-preview video {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.media-preview audio {
  display: block;
  width: 100%;
  min-width: 240px;
}

.attachment-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.selected-file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 9px 11px;
  border: 1px solid rgba(23, 105, 224, 0.18);
  border-radius: 11px;
  background: rgba(23, 105, 224, 0.06);
  color: #24425f;
  font-size: 10px;
  font-weight: 700;
}

.selected-file-bar.uploading {
  opacity: 0.65;
}

.selected-file-remove {
  padding: 5px 8px;
  border-radius: 8px;
  background: transparent;
  color: #b72828;
  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .media-card {
    width: 100%;
  }

  .media-preview img,
  .media-preview video {
    max-height: 280px;
  }
}
