.media-dropzone {
  border-radius: 8px;
  padding: 4px;
  margin: -4px 0 0;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.media-dropzone.media-dropzone--over {
  background: rgba(124, 58, 237, 0.14);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.45);
}

.media-upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: none;
}
.media-upload-overlay__text {
  font-size: calc(13 / 17 * 1rem);
  color: #f4f4f5;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
}
.media-upload-overlay__track {
  width: 78%;
  max-width: 260px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.media-upload-overlay__fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.85), rgba(167, 139, 250, 0.95));
  transition: width 0.12s ease-out;
}
.media-upload-overlay__track.media-upload-overlay__track--indeterminate .media-upload-overlay__fill {
  width: 42%;
  animation: media-upload-indet 0.9s ease-in-out infinite alternate;
}
@keyframes media-upload-indet {
  from {
    transform: translateX(-30%);
    opacity: 0.65;
  }
  to {
    transform: translateX(170%);
    opacity: 1;
  }
}

.media-slot {
  margin-top: 6px;
}
.media-slot > label {
  font-size: calc(15 / 17 * 1rem);
}
.media-slot__preview {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
/* Audio: compact strip — not 16:9 like image/video */
.media-slot__preview--audio {
  aspect-ratio: unset;
  max-width: 560px;
  min-height: 0;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}
.media-slot__preview--audio .media-slot__placeholder--audio {
  min-height: unset;
  height: auto;
  padding: 10px 12px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}
.media-slot__preview--audio .media-slot__audio {
  width: 100%;
  margin-top: 0;
  flex: 0 0 auto;
  vertical-align: middle;
}
.media-slot__preview:focus {
  outline: 2px solid rgba(124, 58, 237, 0.55);
  outline-offset: 2px;
}
.media-slot__del {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  font-size: calc(20 / 17 * 1rem);
  line-height: 0;
  font-weight: 800;
  border-radius: 7px;
  border: 1px solid rgba(239, 68, 68, 0.92);
  background: rgba(239, 68, 68, 0.72);
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.65),
    0 0 2px rgba(0, 0, 0, 0.65);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.18);
  display: none;
}
.media-slot__preview.has-media .media-slot__del {
  display: flex;
}
.media-slot__del:hover {
  border-color: rgba(239, 68, 68, 1);
  background: rgba(239, 68, 68, 0.82);
}
.media-slot__download {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 4;
  width: 38px;
  height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.75);
  color: #f4f4f5;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  line-height: 0;
}
.media-slot__preview.has-media .media-slot__download {
  display: flex;
}
.media-slot__download:hover {
  background: rgba(124, 58, 237, 0.45);
  border-color: rgba(124, 58, 237, 0.65);
  color: #fff;
}
.media-slot__download svg {
  display: block;
  pointer-events: none;
}
.media-slot__placeholder {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-size: calc(13 / 17 * 1rem);
  color: var(--muted);
}
.media-slot__preview .imgpreview {
  margin-top: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  display: block;
  object-fit: cover;
}
.media-slot__video {
  width: 100%;
  height: 100%;
  max-height: none;
  display: block;
  background: #000;
}
.media-slot__audio {
  width: 100%;
  margin-top: 4px;
}
.media-slot__actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
