.material-drop {
  position: relative;
  gap: 14px;
  min-height: 170px;
  padding: 22px;
  border-width: 2px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.material-drop-heading {
  display: grid;
  gap: 3px;
}

.material-drop-heading strong {
  font-size: 17px;
}

.material-drop-heading span {
  color: var(--muted);
  font-size: 13px;
}

#material-files {
  display: none !important;
}

#lesson-attachment-files {
  display: none !important;
}

.choose-material-files {
  justify-self: center;
  min-width: 170px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.choose-material-files:hover,
.choose-material-files:focus-visible {
  background: var(--navy);
  border-color: var(--navy);
}

.lesson-files {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 2px dashed #8da9a5;
  border-left: 5px solid var(--gold);
  background: #fff;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.lesson-files.dragging {
  border-color: var(--teal);
  background: #e8f5f2;
  box-shadow: inset 0 0 0 4px rgba(0, 139, 126, 0.12);
}

.lesson-files-heading,
.lesson-files-heading > div,
.lesson-files-list article,
.lesson-files-list article > div {
  display: flex;
  align-items: center;
}

.lesson-files-heading,
.lesson-files-list article {
  justify-content: space-between;
  gap: 16px;
}

.lesson-files-heading > div {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.lesson-files-heading span,
.lesson-files-status,
.lesson-files-list span {
  color: var(--muted);
  font-size: 12px;
}

#choose-lesson-files,
.lesson-files-list button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

#choose-lesson-files {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

#choose-lesson-files:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.lesson-files-list {
  display: grid;
  gap: 8px;
}

.lesson-files-list article {
  padding: 10px 12px;
  border: 1px solid #d7e2e0;
  background: #f5f8f7;
}

.lesson-files-list article > div {
  gap: 7px;
}

.lesson-files-list article > div:first-child {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
}

.lesson-files-list strong {
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-upload-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #bfd1ce;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.material-upload-status strong {
  color: var(--teal);
  font-size: 14px;
}

.material-review-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.material-review-actions[hidden] {
  display: none;
}

.material-review-actions button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

#review-material-photos {
  border-color: var(--teal);
  color: var(--teal);
}

#remove-all-material-photos {
  border-color: #e3b3ad;
  color: #a52a22;
}

.material-drop.dragging {
  border-color: var(--gold);
  background: #fff7de;
  box-shadow: inset 0 0 0 4px rgba(245, 186, 61, 0.2);
}

.material-drop.processing {
  cursor: progress;
}

.material-previews {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 0;
}

.material-previews figure {
  position: relative;
  width: auto;
  height: auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #b9cbc8;
  background: #dfe9e7;
}

.material-previews img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.material-previews figcaption {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 3px 7px;
  background: rgba(11, 48, 56, 0.88);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-ready {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #168365;
  color: #fff;
  font-weight: 900;
}

.material-previews button {
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 1px solid #e3b3ad;
  border-radius: 0;
  box-shadow: 0 3px 10px rgba(16, 34, 54, 0.16);
}

@media (max-width: 700px) {
  .material-previews {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .material-previews {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-upload-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    text-align: left;
  }

  .choose-material-files {
    width: 100%;
  }

  .material-review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lesson-files-heading,
  .lesson-files-list article {
    align-items: stretch;
    flex-direction: column;
  }

  #choose-lesson-files {
    width: 100%;
  }

  .lesson-files-list article > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
