#img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ilb-img-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
}
.ilb-img-wrap.grabbing { cursor: grabbing; }

.ilb-img {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
  touch-action: none;
  border-radius: 4px;
}

.ilb-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55) 0%, transparent 100%);
  z-index: 10;
  pointer-events: none;
}
.ilb-bar button { pointer-events: auto; }

.ilb-btn {
  background: rgba(0,0,0,.4);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .88;
  transition: opacity .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.ilb-btn:hover,
.ilb-btn:active { opacity: 1; background: rgba(0,0,0,.65); }

.ilb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
.ilb-nav:hover { background: rgba(0,0,0,.7); }
.ilb-nav-prev { left: 14px; }
.ilb-nav-next { right: 14px; }

.ilb-counter {
  flex: 1;
  text-align: center;
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
}

.ilb-img {
  transition: opacity .15s ease;
}

.ilb-zoom-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.45);
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .3s;
}

@media (max-width: 640px) {
  .ilb-bar { padding: 10px; gap: 6px; }
  .ilb-btn { width: 44px; height: 44px; }
}

@media (pointer: coarse) {
  .ilb-zoom-hint { display: none; }
}
