.image-preview-thumb {
  position: relative;
  display: inline-flex;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: zoom-in;
}
.image-preview-thumb::after {
  content: '⤢';
  position: absolute;
  inset-inline-end: 3px;
  bottom: 3px;
  padding: 0 3px;
  border-radius: 3px;
  background: #121319d9;
  color: white;
  font: 14px/17px system-ui, sans-serif;
  pointer-events: none;
}
.image-preview-thumb:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

dialog.image-preview[open] {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(960px, calc(100vw - 20px));
  height: min(760px, calc(100dvh - 20px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffff30;
  border-radius: 12px;
  background: #181920;
  color: #fafafa;
  box-shadow: 0 12px 54px #0008;
}
dialog.image-preview::backdrop { background: #08090cbb; }
.image-preview [hidden] { display: none; }
.image-preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 12px;
  font: 500 14px/1.4 system-ui, sans-serif;
}
.image-preview-bar button {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 10px;
  border: 1px solid #ffffff33;
  border-radius: 7px;
  background: #ffffff12;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.image-preview-bar button:hover:enabled { background: #ffffff26; }
.image-preview-bar button:disabled { opacity: .45; cursor: default; }
.image-preview-bar button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.image-preview-nav { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.image-preview-nav button, .image-preview-bar .image-preview-close { font-size: 22px; line-height: 1; }
.image-preview-bar [data-zoom] { margin-inline-start: auto; }
.image-preview-stage {
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  overflow: auto;
  overscroll-behavior: contain;
  background: #101116;
}
.image-preview-stage img {
  flex: none;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.image-preview-stage img.is-zoomed { max-width: none; max-height: none; }
.image-preview-stage p { padding: 16px; text-align: center; }
