/* Shared screenshot viewer. Overlay only — thumbnail layout stays in the page CSS. */
.iv, .iv * { box-sizing: border-box; }
.iv {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(15, 23, 42, .88);
  overflow: hidden;
}
.iv[hidden] { display: none !important; }
.iv-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 58px 12px 78px;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-out;
}
.iv-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  min-width: 0;
  min-height: 0;
  flex: 0 1 auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .4);
  transform-origin: center center;
  cursor: zoom-out;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.iv-btn {
  position: absolute;
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 10px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font: 700 30px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}
.iv-btn[hidden] { display: none !important; }
.iv-btn:hover { background: rgba(15, 23, 42, .9); }
.iv-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.iv-x { top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); }
.iv-prev { left: max(8px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); }
.iv-next { right: max(8px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }
.iv-cap, .iv-count {
  position: absolute;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: min(640px, calc(100% - 128px));
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font: 600 13px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", sans-serif;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.iv-cap { bottom: calc(40px + env(safe-area-inset-bottom)); }
.iv-count { bottom: calc(14px + env(safe-area-inset-bottom)); font-weight: 500; opacity: .95; }
.iv-cap[hidden], .iv-count[hidden] { display: none !important; }
@media (max-width: 560px) {
  .iv-stage { padding: 58px 8px 78px; }
  .iv-prev, .iv-next { top: auto; transform: none; bottom: max(10px, env(safe-area-inset-bottom)); }
  .iv-cap { bottom: calc(62px + env(safe-area-inset-bottom)); max-width: calc(100% - 24px); }
  .iv-count { bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (min-width: 561px) {
  .iv-stage { padding: 28px 72px 64px; }
  .iv-stage img {
    max-width: min(1100px, 100%);
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .iv, .iv-stage img { transition: none; }
}
@media print {
  .iv { display: none !important; }
}
