.widget-multiupload label {
  display: inline-block;
  border: 1px solid #ccc;
  background-color: #eee;
  color: #333;
  padding: 8px 16px;
  font: 400 14px/1 Arial, sans-serif;
}

.widget-multiupload input {
  display: none;
}

.widget-multiupload .filelist {
  margin: 16px -8px 0;
  padding: 0;
  width: calc(100% + 16px);
}

.widget-multiupload .filelist.empty {
  display: none;
}

.widget-multiupload .file {
  padding: 4px 0;
  display: grid;
  grid-template-columns: 24px auto 24px;
  font-size: 14px;
  line-height: 1.5;
  color: #999;
  transition: grid-template-columns 0.3s, color 0.3s;
}

.widget-multiupload .file:hover {
  background-color: #f6f6f6;
}

.widget-multiupload .file.done {
  color: #000;
  grid-template-columns: 0 auto 24px;
}

.widget-multiupload .file.error {
  color: #c00;
}

.widget-multiupload .progress {
  --size: 16px;
  --line: 4px;
  --background: #eee;
  --color: #eb0;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

.widget-multiupload .file.done .progress {
  transform: translateX(-32px);
  opacity: 0;
  visibility: hidden;
}

.widget-multiupload .file.error .progress {
  --color: #c00;
}

.widget-multiupload .progress i {
  width: var(--size);
  height: var(--size);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--background);
  --mask-image: radial-gradient(closest-side, transparent calc(100% - var(--line, 100%) - 1px), white calc(100% - var(--line, 100%)), white calc(100% - 1px), transparent 100%);
  -webkit-mask-image: var(--mask-image);
  mask-image: var(--mask-image);
  margin: 3px 8px 0;
}

.widget-multiupload .progress i::before {
  content: "";
  background: linear-gradient(calc(90deg + max(0.5, var(--progress, 0)) * 360deg), var(--color) 50%, transparent 50%) 0 0/200% 100%;
}

.widget-multiupload .progress i::after {
  content: "";
  background: linear-gradient(calc(-90deg + min(0.5, var(--progress, 0)) * 360deg), transparent 50%, var(--color) 50%) -100% 0/200% 100%;
}

.widget-multiupload .filename {
  padding-left: 8px;
}

.widget-multiupload .delete {
  opacity: 0;
  visibility: hidden;
}

.widget-multiupload .file:hover .delete {
  opacity: 1;
  visibility: visible;
}

.widget-multiupload .delete button {
  all: unset;
  font-size: 0;
  line-height: 0;
  color: transparent;
  display: block;
  width: 8px;
  height: 8px;
  border: 4px solid #c00;
  background: linear-gradient(45deg, transparent 40%, #fff 40%, #fff 60%, transparent 60%), linear-gradient(135deg, #c00 40%, #fff 40%, #fff 60%, #c00 60%);
  cursor: pointer;
  margin-top: 3px;
}
