.photo-grid img,
.rail-grid img {
  box-sizing: border-box;
  background: #05080d;
  object-fit: contain;
  cursor: zoom-in;
}

.photo-grid img {
  padding: 4px;
}

.profile-photo-viewer[hidden] {
  display: none;
}

.profile-photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 4, 9, .68);
  backdrop-filter: blur(3px);
}

.profile-photo-viewer__stage {
  position: relative;
  display: grid;
  width: min(1400px, 92vw);
  height: 86vh;
  place-items: center;
}

.profile-photo-viewer__media {
  position:absolute; inset:0; display:grid; place-items:center; overflow:auto;
  overscroll-behavior:contain; touch-action:pan-x pan-y pinch-zoom;
}
.profile-photo-viewer__media.is-zoomed { cursor:zoom-out; }
.profile-photo-viewer__image {
  display: block;
  max-width: 100%;
  max-height: calc(100% - 82px);
  object-fit: contain;
  transform-origin:center;
  transition:transform .16s ease;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .65);
}
.profile-photo-viewer__zoom{position:absolute;right:18px;top:74px;z-index:3;display:flex;gap:6px;padding:5px;border:1px solid rgba(255,255,255,.16);border-radius:999px;background:rgba(4,7,13,.76);backdrop-filter:blur(10px)}
.profile-photo-viewer__zoom button{position:static!important;min-width:38px;height:34px;padding:0 10px;border-radius:999px}.profile-photo-viewer__zoom .icon{width:16px;height:16px}
.profile-photo-viewer__provenance{position:absolute;left:18px;bottom:82px;z-index:3;max-width:min(620px,calc(100% - 36px));display:flex;gap:8px;align-items:baseline;padding:9px 12px;border:1px solid rgba(255,255,255,.14);border-radius:10px;background:rgba(4,7,13,.78);font-size:12px}.profile-photo-viewer__provenance span{color:#c4cad5}
.profile-photo-viewer__actions .icon{width:17px;height:17px}.profile-photo-viewer__actions button{display:inline-flex;align-items:center;justify-content:center;gap:7px}.profile-photo-viewer__actions button.is-active{color:#ff70bd;border-color:#ff70bd}

.profile-photo-viewer button {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(3, 9, 18, .82);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.profile-photo-viewer__close {
  top: 0;
  right: 0;
}

.profile-photo-viewer__previous {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.profile-photo-viewer__next {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.profile-photo-viewer__counter {
  position: absolute;
  bottom: 72px;
  left: 50%;
  padding: 7px 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(3, 9, 18, .82);
  color: #fff;
  font-size: 13px;
}

.profile-photo-viewer__actions {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.profile-photo-viewer .profile-photo-viewer__actions button {
  position: static;
  display: inline-flex;
  width: auto;
  height: 44px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}

.profile-photo-viewer .profile-photo-viewer__actions button.danger {
  border-color: rgba(255, 84, 112, .55);
  color: #ff7189;
}

.profile-photo-viewer .profile-photo-viewer__actions button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.profile-photo-viewer__notice {
  position: absolute;
  right: 0;
  bottom: -22px;
  left: 0;
  color: #fff;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 700px) {
  .profile-photo-viewer {
    padding: 10px;
  }

  .profile-photo-viewer__stage {
    width: 96vw;
    height: 88vh;
  }

  .profile-photo-viewer button {
    width: 42px;
    height: 42px;
  }

  .profile-photo-viewer__actions {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .profile-photo-viewer .profile-photo-viewer__actions button {
    flex: 0 0 auto;
  }
}
@media(max-width:700px){.profile-photo-viewer__zoom{top:62px;right:10px}.profile-photo-viewer__provenance{left:10px;bottom:132px;display:grid;gap:2px}.profile-photo-viewer__actions{flex-wrap:wrap}}
