.image-frame { display: inline-block; position: relative; max-width: 100%; vertical-align: middle; line-height: 0; }
.image-frame:not(.image-frame-full) { width: fit-content; align-self: flex-start; justify-self: start; }
.image-frame-full { display: block; width: 100%; }
.image-frame:has(> a[hidden]), .image-frame:has(> img[hidden]) { display: none !important; }
.image-frame .upload-thumbnail { margin: 0; }
.image-actions { position: absolute; inset: 6px 6px auto auto; z-index: 2; display: inline-flex; border-radius: 5px; overflow: hidden; line-height: 1; }
:is(.admin-app,.trading-app) .image-actions button,
:is(.admin-app,.trading-app) .kyc-thumb-actions button,
:is(.admin-app,.trading-app) .rich-image-actions button {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px;
  width: 32px; min-width: 32px; max-width: 32px; height: 32px; min-height: 32px;
  margin: 0; padding: 5px; border: 0; border-radius: 0; color: white; background: #101b2ed9; cursor: pointer;
}
:is(.admin-app,.trading-app) .image-actions [data-image-remove],
:is(.admin-app,.trading-app) .kyc-thumb-actions [data-document-remove],
:is(.admin-app,.trading-app) .rich-image-actions [data-inline-remove] { background: #8f2443eb; color: #ffd8e2; }
.image-actions button:hover, .rich-image-actions button:hover { filter: brightness(1.3); }
.image-actions button:focus-visible, .rich-image-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rich-editor { position: relative; }
.rich-image-actions { position: absolute; z-index: 5; display: flex; line-height: 1; border-radius: 5px; overflow: hidden; }
.rich-image-actions[hidden] { display: none !important; }
dialog.image-viewer {
  box-sizing: border-box; width: min(1200px,96vw); max-width: 96vw; height: 90dvh; max-height: 90dvh;
  padding: 18px; border: 1px solid var(--line,#334155); border-radius: 12px; background: #101720; color: #edf2f7; overflow: hidden;
}
.image-viewer > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.image-viewer > header h2 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer > header button { background: transparent; color: white; font-size: 26px; border: 0; padding: 0 8px; }
.image-viewer-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.image-viewer-tools button { background: #253244; border: 1px solid #46546a; color: white; border-radius: 6px; min-width: 36px; height: 34px; padding: 4px 8px; font-size: 19px; }
.image-viewer-tools output { min-width: 52px; font-size: 13px; }
.image-viewer-tools a { margin-inline-start: auto; color: #d4e4ff; font-size: 12px; }
.image-viewer-viewport { height: calc(100% - 100px); overflow: hidden; display: flex; align-items: center; justify-content: center; background: #080d14; touch-action: none; cursor: grab; }
.image-viewer-viewport > img { display: block; flex: none; max-width: 95%; max-height: 95%; object-fit: contain; transform-origin: center; user-select: none; }
.image-viewer-viewport > iframe { width: 100%; height: 100%; border: 0; background: white; }
.image-viewer-viewport > [hidden] { display: none !important; }
.has-document .kyc-thumb-actions { display: flex; inset: 6px 6px auto auto; gap: 0; background: transparent; pointer-events: auto; border-radius: 5px; overflow: hidden; }
@media(max-width:650px) { dialog.image-viewer { padding: 12px; } .image-viewer-tools { gap: 5px; } }
