/* Image-only preview shell. Table/account dialogs and thumbnail deletion keep their own controls. */
.image-preview {
  --preview-close-bg: #191b1e;
  --preview-close-hover: #35393e;
  --preview-close-ink: #fff;
  box-sizing: border-box;
  color: var(--ink);
  background: var(--surface, #fff);
}
.image-preview[open] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 92dvh;
  max-height: calc(100dvh - 24px);
  max-width: calc(100vw - 24px);
  padding: 16px;
  overflow: hidden;
}
.image-preview .image-preview-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  flex: 0 0 auto;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
}
.image-preview-head > :not(.image-preview-close) { grid-column: 1; min-width: 0; }
.image-preview .image-preview-head > strong {
  max-width: none;
  margin: 0;
  align-self: center;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
  /* The native title attribute and dialog name expose the full long filename. */
  max-height: 3em;
  overflow: auto;
}
.image-preview .image-preview-head .image-preview-close {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 80px;
  min-height: 44px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--preview-close-bg);
  border-radius: 8px;
  color: var(--preview-close-ink);
  background: var(--preview-close-bg);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  touch-action: manipulation;
}
.image-preview .image-preview-head .image-preview-close:hover {
  color: var(--preview-close-ink);
  background: var(--preview-close-hover);
  border-color: var(--preview-close-hover);
}
.image-preview .image-preview-head .image-preview-close:active { background: #08090b; }
.image-preview .image-preview-head .image-preview-close:focus-visible {
  outline: 3px solid var(--accent, #506577);
  outline-offset: 3px;
}
.image-preview-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.image-preview .image-preview-head select { justify-self: start; min-height: 44px; max-width: 100%; }
.image-preview .image-preview-body { flex: 1 1 auto; min-height: 0; height: auto; overflow: auto; margin: 0; }
.workspace-image-viewer .image-preview-body,
.suite-lightbox .image-preview-body { display: grid; place-items: center; }
.workspace-image-viewer .image-preview-body img,
.suite-lightbox .image-preview-body img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; }
.image-preview > p { flex: 0 0 auto; margin: 0; }
@media (max-height: 500px) {
  .image-preview[open] { gap: 8px; padding: 12px; }
}
