.photo-picker-button {
  flex-wrap: wrap;
  column-gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.photo-steps {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.photo-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--control-height);
  min-width: 0;
  padding: 0.25rem;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--link-color);
  font: inherit;
  font-size: var(--text-small);
  line-height: var(--leading-small);
  text-align: left;
  cursor: pointer;
}

.photo-step[aria-pressed="true"] {
  color: var(--text-color);
  font-weight: 600;
}

.photo-step:hover > span:last-child { text-decoration: underline; }

.photo-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  font-size: var(--text-caption);
}

.photo-step[aria-pressed="true"] .photo-step-number {
  border-color: var(--action-background);
  background: var(--action-background);
  color: var(--color-white);
}

.photo-step-arrow { color: var(--color-slate); }

.photo-steps .photo-step-warning {
  position: absolute;
  inset: 100% 0 auto;
  margin: 0;
  color: var(--text-color);
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
  text-align: center;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .photo-step-warning:not(:empty) { animation: photo-step-warning 3s both; }
}

@keyframes photo-step-warning {
  0%, 100% { opacity: 0; }
  6%, 85% { opacity: 1; }
}

.photo-upload-step {
  display: grid;
  gap: 1rem;
}

.photo-picker-hint {
  color: var(--color-slate);
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
}

.photo-picker-drop-hint {
  display: none;
}

@media (min-width: 48rem) and (hover: hover) and (pointer: fine) {
  .photo-picker-drop-hint {
    display: block;
  }
}

.photo-selection {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-wrap: wrap;
}

.photo-selection-preview {
  width: 64px;
  height: 64px;
  border: 2px solid var(--color-crystal-blue);
  object-fit: cover;
  border-radius: var(--radius-control);
}

.photo-selection-details {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.photo-selection .ghost-link {
  padding-inline: 0.5rem;
}

.photo-picker [hidden], .photo-picker-hint:empty {
  display: none;
}

.photo-drop-zone {
  display: grid;
  grid-template-columns: auto auto;
  place-content: center;
  gap: 0.25rem 0.5rem;
  min-height: 7rem;
  border: 1px dashed var(--link-color);
  background: var(--surface-tint);
  outline-offset: 2px;
}

.photo-drop-zone > * { pointer-events: none; }
.photo-drop-zone .photo-picker-drop-hint { grid-column: 1 / -1; }

.photo-drop-zone:is(:hover, [data-dragging]) {
  background: color-mix(in srgb, var(--surface-tint), var(--color-sky-blue) 14%);
  border-style: solid;
}

@media (prefers-reduced-motion: no-preference) {
  .photo-drop-zone img { transition: transform 160ms ease-out; }
  .photo-drop-zone:is(:hover, [data-dragging]) img { transform: translateY(-3px); }
}

@media (min-width: 64rem) {
  /* Keep the card sized to the larger step without exposing the inactive controls. */
  .photo-picker:has(.photo-drop-zone):has(.engraving) > :is(.photo-upload-step, .editing-card) {
    grid-area: 2 / 1;
  }

  .photo-picker:has(.photo-drop-zone):has(.engraving) > :is(.photo-upload-step, .editing-card)[hidden] {
    display: grid;
    visibility: hidden;
  }

  .photo-picker:has(.photo-drop-zone):has(.engraving) > .photo-upload-step {
    grid-template-rows: minmax(7rem, 1fr) auto;
  }
}

.photo-picker {
  grid-area: photo;
}

.photo-picker-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 64rem) {
  .photo-picker-content:has(.photo-selection:not([hidden])):has(.people-picker) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .photo-picker-content:has(.photo-selection:not([hidden])) .people-picker {
    border-left: 1px solid var(--color-border);
    padding-left: 1rem;
  }
}

.photo-files {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.photo-history {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.photo-history p { margin: 0; }

.photo-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.photo-history-item {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--surface-tint);
  cursor: pointer;
  overflow: hidden;
}

.photo-history-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
}
