.photo-upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photo-upload-preview[hidden],
.photo-upload-clear[hidden] {
  display: none;
}

.photo-preview-item {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(7, 27, 44, 0.14);
  border-radius: 10px;
  background: #f4f7f9;
  box-shadow: 0 5px 16px rgba(7, 27, 44, 0.08);
}

.photo-preview-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dfe8ee;
}

.photo-preview-info {
  padding: 9px 10px 10px;
}

.photo-preview-name {
  display: block;
  overflow: hidden;
  color: #071b2c;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-preview-size {
  display: block;
  margin-top: 3px;
  color: #66798a;
  font-size: 0.72rem;
  line-height: 1.3;
}

.photo-preview-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(7, 27, 44, 0.86);
  color: #fff;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(5px);
}

.photo-preview-remove:hover,
.photo-preview-remove:focus-visible {
  background: #078fd6;
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.photo-upload-clear {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #078fd6;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}

.photo-upload-clear:hover,
.photo-upload-clear:focus-visible {
  color: #071b2c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 520px) {
  .photo-upload-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}
