.circuit-mosaic {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-auto-rows:minmax(0,1fr);
  gap:3px;
  aspect-ratio:1.85;
  overflow:hidden;
  background:#edf4f2;
}
.circuit-mosaic img {
  display:block;
  width:100%;
  height:100%;
  min-height:0;
  min-width:0;
  object-fit:cover;
}
.photo .circuit-mosaic { width:100%; height:100%; }
.circuit-detail-mosaic {
  width:100%;
  height:clamp(200px,35vw,460px);
  aspect-ratio:auto;
}
.circuit-mosaic-row {
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(0,1fr);
  gap:3px;
  min-height:0;
}

#circuit-mosaic-preview:empty { display:none; }
#circuit-mosaic-preview { margin-block:12px; max-width:420px; }
.circuit-stop-photo-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(90px,1fr));
  gap:8px;
  margin-block:6px 14px;
}
.circuit-stop-photo-grid img {
  width:100%;
  aspect-ratio:4 / 3;
  object-fit:cover;
  border-radius:6px;
}

.circuit-photo-carousel { width:100%; }
.circuit-photo-carousel .carousel-slide { height:clamp(200px,35vw,460px); }
.circuit-photo-carousel .circuit-mosaic { width:100%; height:100%; aspect-ratio:auto; }
.circuit-slide-caption { position:absolute; bottom:12px; left:50%; transform:translateX(-50%); max-width:calc(100% - 32px); padding:5px 12px; border-radius:6px; background:#10282fe8; color:white; font-weight:700; text-align:center; pointer-events:none; }
.circuit-expanded-caption { text-align:center; margin:8px 0 0; }

.place-blend, .place-blend .circuit-mosaic-row { gap:0; }
.place-blend { --blend:clamp(10px,2vw,42px); }
.photo .place-blend { --blend:12px; }
.place-blend .circuit-mosaic-row > span { position:relative; min-width:0; min-height:0; }
.place-blend .circuit-mosaic-row > span > span { position:absolute; inset:0; }
.place-blend .circuit-mosaic-row > span + span > span {
  left:calc(0px - var(--blend));
  -webkit-mask-image:linear-gradient(to right,transparent,black var(--blend));
  mask-image:linear-gradient(to right,transparent,black var(--blend));
}
.place-blend .circuit-mosaic-row + .circuit-mosaic-row > span > span { top:calc(0px - var(--blend)); }
.place-blend .circuit-mosaic-row + .circuit-mosaic-row img {
  -webkit-mask-image:linear-gradient(to bottom,transparent,black var(--blend));
  mask-image:linear-gradient(to bottom,transparent,black var(--blend));
}
