html.lightbox-open { overflow: hidden; }
.lightbox-link { cursor: zoom-in; }
.image-lightbox {
  width: min(1280px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px #0006;
}
.image-lightbox::backdrop { background: #08130ee6; }
.lightbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.lightbox-count { font-size: 14px; color: var(--muted); }
.lightbox-controls { display: flex; gap: 8px; }
.lightbox-controls button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 24px; line-height: 1; }
.lightbox-controls button:hover:not(:disabled) { background: var(--tint); }
.lightbox-controls button:disabled { opacity: .35; cursor: default; }
.lightbox-controls button[hidden], .lightbox-image[hidden], .lightbox-status[hidden] { display: none; }
.lightbox-figure { margin: 0; }
.lightbox-canvas { display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 16px; background: var(--screenshot-surround); }
.lightbox-image { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 200px); object-fit: contain; border-radius: 4px; }
.lightbox-status { margin: 24px; color: var(--muted); text-align: center; }
.lightbox-figure figcaption { padding: 12px 16px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .image-lightbox { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 12px; }
  .lightbox-toolbar { padding: 8px 12px; }
  .lightbox-canvas { padding: 8px; }
  .lightbox-image { max-height: calc(100dvh - 180px); }
}
@media print {
  html.lightbox-open { overflow: visible; }
  .image-lightbox { display: none; }
}
