html.image-viewer-open { overflow: hidden; }
.image-viewer {
  width: calc(100vw - 32px);
  height: calc(100dvh - 32px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid #226078;
  border-radius: 16px;
  color: #e2e8f0;
  background: #020617;
  box-shadow: 0 24px 90px #0009;
  overflow: hidden;
}
.image-viewer[open] { display: flex; flex-direction: column; }
.image-viewer::backdrop { background: #000d; backdrop-filter: blur(5px); }
.image-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
}
.image-viewer-header strong { min-width: 0; font-size: 15px; line-height: 1.4; }
.image-viewer button {
  flex-shrink: 0;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border: 1px solid #334155;
  border-radius: 9px;
  background: #0f172a;
  color: #e2e8f0;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.image-viewer button:hover { border-color: #22d3ee; color: #67e8f9; }
.image-viewer :focus-visible { outline: 2px solid #22d3ee; outline-offset: -3px; }
.image-viewer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 12px; }
.image-viewer-zoom { min-width: 55px; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.image-viewer-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #060b15;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.image-viewer-stage.is-dragging { cursor: grabbing; }
.image-viewer-image {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  max-height: none;
  margin: 0;
  transform-origin: 0 0;
  pointer-events: none;
}
.image-viewer-status { position: absolute; inset: 20px; margin: 0; pointer-events: none; }
#image-viewer-help { flex-shrink: 0; margin: 0; padding: 10px 16px; color: #94a3b8; font-size: 12px; line-height: 1.5; }
@media (max-width: 600px) {
  .image-viewer { width: calc(100vw - 8px); height: calc(100dvh - 8px); border-radius: 12px; }
  .image-viewer-header { padding: 8px; gap: 8px; }
  .image-viewer-header strong { font-size: 12px; max-height: 3.5em; overflow: auto; }
  .image-viewer-tools { padding: 0 8px 8px; gap: 4px; }
  .image-viewer button { padding-inline: 10px; }
  #image-viewer-help { padding: 8px; font-size: 11px; }
}
