/* One owner for the photo field: preview, native picker, help and feedback. */
.photo-editor {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}
.photo-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  overflow: hidden;
}
.photo-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#photo-placeholder {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 12px;
  font-size: .875rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
#photo-placeholder svg { width: 28px; height: 28px; }
.photo-controls { min-width: 0; }
.photo-picker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  gap: 8px;
  padding: 10px 8px;
  border: 1px solid var(--control-line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}
.photo-picker > svg { width: 18px; height: 18px; flex: 0 0 auto; }
.photo-picker:hover { background: var(--paper); }
.photo-picker:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.photo-picker:has([aria-invalid="true"]) { border-color: var(--danger); }
#photo-file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.photo-controls .field-help { margin: 10px 0 0; text-align: center; }
#photo-help { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 8px; }
#photo-help span { white-space: nowrap; }
#photo-status:empty { display: none; }
@media (max-width: 760px) {
  .photo-editor { grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 16px; margin-bottom: 24px; }
  .photo-preview { border-radius: 14px; }
  .photo-controls { max-width: 224px; }
  .photo-controls .field-help { text-align: left; }
  #photo-help { justify-content: flex-start; }
}
@media (max-width: 360px) {
  .photo-editor { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
}
