.detail-photo-frame {
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.detail-photo {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  background: var(--surface-muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.photo-tile {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-bg);
}

.photo-link {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--surface-muted);
}

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

.photo-meta {
  padding: .75rem;
}

.photo-title-row {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.photo-title-row h2 {
  min-width: 0;
  flex: 1;
}

.photo-delete-button {
  flex: 0 0 auto;
  line-height: 1;
}

.photo-delete-button user-icon {
  pointer-events: none;
}

.comment-thumb {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-muted);
}

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

.recent-comment {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: .75rem;
}

.min-w-0 {
  min-width: 0;
}

.image-upload-modal .modal-dialog {
  max-width: 560px;
}

.image-upload-picker {
  display: grid;
  gap: .75rem;
}

.image-upload-dropzone {
  width: 100%;
  min-height: 156px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-color);
  display: grid;
  place-items: center;
  gap: .35rem;
  padding: 1.25rem;
  text-align: center;
}

.image-upload-dropzone:hover,
.image-upload-dropzone:focus {
  border-color: var(--link-color);
  outline: none;
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--link-color) 18%, transparent);
}

.image-upload-dropzone:disabled {
  cursor: wait;
  opacity: .7;
}

.image-upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  font-size: 1.55rem;
}

.image-upload-prompt,
.image-upload-file {
  display: block;
}

.image-upload-prompt {
  font-weight: 600;
}

.image-upload-file {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-upload-preview {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-muted);
}

.image-upload-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

@media (max-width: 575.98px) {
  #imageUploadOpenButton {
    width: 100%;
  }

  .image-upload-dropzone {
    min-height: 132px;
  }

  .image-upload-preview img {
    max-height: 240px;
  }
}
