.photo-source-picker {
  position: relative;
  display: grid;
  width: 100%;
  gap: 9px;
  margin-top: 8px;
}

.upload-box:has(.photo-source-picker),
.action-upload:has(.photo-source-picker) { cursor: default; }

.photo-source-native {
  position: absolute !important;
  inset: auto !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.photo-source-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.photo-source-button {
  display: flex;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1.5px solid #6e93ac;
  border-radius: 11px;
  background: #fff;
  color: #315b74;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.photo-source-button--camera {
  border-color: #b98a2b;
  background: #b98a2b;
  color: #fff;
}

.photo-source-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 17px rgba(32, 48, 63, .13);
}

.photo-source-button--camera:hover { background: #9f7620; border-color: #9f7620; }
.photo-source-button--library:hover { background: #f3f7f8; border-color: #527b96; }
.photo-source-button:focus-visible { outline: 3px solid rgba(110, 147, 172, .48); outline-offset: 3px; }
.photo-source-button svg { flex: 0 0 22px; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.photo-source-button span { display: grid; gap: 1px; min-width: 0; }
.photo-source-button strong { color: inherit; font-size: .78rem !important; line-height: 1.35; }
.photo-source-button small { min-height: 0 !important; color: inherit !important; font-size: .65rem; font-weight: 500; line-height: 1.35; opacity: .82; }

.photo-source-selection {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #c8dbd2;
  border-radius: 10px;
  background: #f3f9f6;
  text-align: left;
}

.photo-source-selection[hidden] { display: none !important; }
.photo-source-selection img { width: 56px; height: 56px; border-radius: 8px; background: #e8eeeb; object-fit: cover; }
.photo-source-selection img[hidden] { display: none; }
.photo-source-selection-copy { display: grid; min-width: 0; gap: 2px; }
.photo-source-selection-copy small { color: #51705f; font-size: .68rem; line-height: 1.35; }
.photo-source-selection-copy strong { overflow: hidden; color: #294738; font-size: .75rem !important; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.photo-source-message { min-height: 1.3em; margin: 0; color: #667782; font-size: .7rem; line-height: 1.45; text-align: center; }

.photo-source-picker.is-invalid .photo-source-actions { padding: 3px; border: 2px solid #b65f58; border-radius: 13px; }
.photo-source-picker.is-invalid .photo-source-message { color: #963f39; font-weight: 700; }
.upload-box:has(.photo-source-native.input-error),
.action-upload:has(.photo-source-native.input-error) { border-color: #b65f58; background: #fff8f7; }

@media (hover: hover) and (pointer: fine) {
  .photo-source-button--camera { display: none; }
  .photo-source-actions { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .photo-source-actions { grid-template-columns: 1fr 1fr; }
  .photo-source-button { min-height: 60px; padding-inline: 10px; }
}

@media (max-width: 370px) {
  .photo-source-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-source-button { transition: none; }
}
