[data-project-photos] {
  min-width:0;
  margin:2px 0 26px;
  padding:0;
  border:0;
}
[data-project-photos] legend {
  padding:0;
  color:var(--ink);
  font-size:12px;
  font-weight:700;
}
.photo-slots {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.photo-slot {
  position:relative;
  min-width:0;
  border:1px dashed var(--line);
  border-radius:16px;
  background:var(--card);
  background:color-mix(in srgb,var(--card) 55%,transparent);
  overflow:hidden;
}
.project-form .photo-slot label {
  position:relative;
  display:flex;
  min-height:136px;
  height:100%;
  margin:0;
  padding:16px 10px;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-align:center;
  cursor:pointer;
}
.photo-slot label::before {
  content:'+';
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  border:1px solid var(--line);
  border-radius:50%;
  color:var(--ink);
  font-size:22px;
  font-weight:400;
  line-height:1;
}
.photo-slot.has-photo { border-style:solid; }
.photo-slot.has-photo label::before { content:'✓'; font-size:16px; }
.photo-slot.has-photo label { padding-top:42px; }
.photo-slot [data-photo-prompt] {
  position:relative;
  color:var(--ink);
  font-size:11px;
  line-height:1.35;
}
.photo-slot [data-photo-name] {
  position:relative;
  display:-webkit-box;
  max-width:100%;
  overflow:hidden;
  overflow-wrap:anywhere;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  color:var(--sub);
  font-size:10px;
  font-weight:500;
  line-height:1.4;
}
.photo-slot [data-photo-name]:empty { display:none; }
.project-form .photo-slot [data-project-photo] {
  position:absolute;
  width:1px;
  height:1px;
  min-height:0;
  margin:0;
  padding:0;
  border:0;
  clip-path:inset(50%);
  overflow:hidden;
}
.photo-slot:focus-within { outline:2px solid var(--ink); outline-offset:4px; }
.photo-slot [data-photo-preview] {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}
.photo-slot.has-preview label { justify-content:flex-end; }
.photo-slot.has-preview label::before { display:none; }
.photo-slot.has-preview label::after {
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(transparent 25%,#000b);
  pointer-events:none;
}
.photo-slot.has-preview [data-photo-name],
.photo-slot.has-preview [data-photo-prompt] { z-index:1; color:#fff; text-shadow:0 1px 5px #0006; }
.photo-slot [data-remove-photo] {
  position:absolute;
  z-index:2;
  top:0;
  right:0;
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  padding:0;
  border:0;
  color:var(--ink);
  background:transparent;
  cursor:pointer;
  font-size:0;
}
.photo-slot [data-remove-photo]::before {
  content:'×';
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border:1px solid var(--line);
  border-radius:50%;
  background:var(--card);
  box-shadow:0 2px 8px #0001;
  font-size:20px;
  line-height:1;
}
.photo-slot [data-remove-photo]:focus-visible { outline:2px solid var(--ink); outline-offset:-5px; border-radius:12px; }
.photo-slot [hidden] { display:none!important; }
#project-photos-help { margin:10px 0 0; color:var(--sub); font-size:11px; line-height:1.65; }
[data-photo-error] { margin:10px 0 0; color:#a43526; font-size:12px; line-height:1.5; }
:root[data-theme=dark] [data-photo-error] { color:#ffb5a7; }
@media (hover:hover) and (pointer:fine) {
  .photo-slot:hover { border-color:var(--sub); }
  .photo-slot [data-remove-photo]:hover::before { border-color:var(--sub); }
}
@media (max-width:380px) {
  .photo-slots { gap:7px; }
  .project-form .photo-slot label { min-height:126px; padding-left:6px; padding-right:6px; }
  .photo-slot [data-photo-prompt] { font-size:10px; }
}
