.file-button.photo-source-button {
  position: relative;
  overflow: hidden;
  min-height: 46px;
}

.file-button.photo-source-button input[type="file"] {
  display: block !important;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.file-button.photo-source-button:focus-within {
  outline: 3px solid #f4ae2b;
  outline-offset: 2px;
}

.post-event-email,
.past-event-followup {
  margin: 24px 0;
  padding: 22px;
  border: 3px solid #55b7e8;
  border-radius: 18px;
  background: linear-gradient(135deg, #eef9ff, #fff);
  box-shadow: 0 12px 30px rgba(8, 59, 102, .12);
}

.post-event-email h3,
.past-event-followup h2 {
  margin: 4px 0 6px;
  color: #083b66;
}

.email-attendees-button {
  background: #08783e;
  box-shadow: 0 7px 18px rgba(8, 120, 62, .25);
}

.past-event-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-left: auto;
  flex-wrap: wrap;
}

.photo-grid {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-items: start;
  gap: 16px;
}

.photo-grid figure {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.photo-grid figure img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #eef9ff;
}

.photo-grid figure img.gallery-photo-cropped {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.admin-gallery figure {
  position: relative;
}

.admin-gallery figure > img {
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  cursor: grab;
}

.admin-gallery [data-gallery-drag-handle] {
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.admin-gallery figure > img:active {
  cursor: grabbing;
}

.photo-drag-hint {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(5, 45, 79, .88);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.gallery-order-help {
  padding: 12px 14px;
  border: 2px solid #86ccea;
  border-radius: 12px;
  background: #eef9ff;
  color: #083b66;
}

.gallery-admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}

.gallery-admin-heading .gallery-order-help {
  flex: 1;
  margin: 0;
}

.gallery-admin-heading .button {
  flex: 0 0 auto;
}

.gallery-text-card {
  grid-column: 1 / -1;
  border: 2px solid #86ccea;
  background: linear-gradient(135deg, #eef9ff, #fff);
}

.gallery-text-content {
  min-height: 90px;
  padding: 24px clamp(18px, 4vw, 46px);
  color: #083b66;
  font-size: clamp(18px, 2.3vw, 24px);
  line-height: 1.55;
  cursor: grab;
}

.gallery-edit-text,
.gallery-crop-toggle {
  align-self: flex-start;
  margin: 0 18px 14px;
  padding: 8px 14px;
  border: 1px solid #9bcce2;
  border-radius: 999px;
  background: #fff;
  color: #083b66;
  font-weight: 800;
  cursor: pointer;
}

.gallery-photo-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
}

.gallery-photo-admin-actions .gallery-crop-toggle,
.gallery-photo-admin-actions .gallery-remove-photo {
  align-self: auto;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid #9bcce2;
  border-radius: 999px;
  background: #fff;
  color: #083b66;
  font-weight: 800;
  cursor: pointer;
}

.gallery-photo-admin-actions .gallery-remove-photo {
  border-color: #dbaaaa;
  background: #fff3f3;
  color: #8b1e1e;
}

.gallery-photo-admin-actions button:disabled {
  cursor: wait;
  opacity: .65;
}

.gallery-dragging {
  opacity: .25;
  outline: 4px dashed #126ca8;
  pointer-events: none;
}

.gallery-drag-ghost {
  position: fixed;
  z-index: 10000;
  width: 150px;
  height: 110px;
  object-fit: cover;
  border: 4px solid #55b7e8;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(5, 45, 79, .4);
  pointer-events: none;
  transform: translateY(-50%);
  padding: 10px;
  overflow: hidden;
  background: #eef9ff;
  color: #083b66;
}

.gallery-photo-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #cbe5f2;
  background: #fff;
}

.gallery-photo-controls button {
  min-height: 42px;
  border: 1px solid #9bcce2;
  border-radius: 9px;
  background: #eef9ff;
  color: #083b66;
  font-weight: 800;
  cursor: pointer;
}

.gallery-photo-controls button:disabled {
  opacity: .4;
  cursor: default;
}

.gallery-photo-controls span {
  color: #5c7180;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .photo-source-button {
    flex: 1 1 100%;
    width: 100%;
  }

  .gallery-admin-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-admin-heading .button {
    width: 100%;
  }

  .past-event-actions {
    width: 100%;
    margin-left: 0;
  }

  .past-event-actions .button,
  .email-attendees-button {
    width: 100%;
    margin-left: 0 !important;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }
}
