.imagePreviewDialog { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; width: calc(100vw - 160px); height: calc(100vh - 160px); max-width: none !important; padding: 12px; overflow: hidden; background: color-mix(in oklab, var(--ds-surface-raised) 88%, transparent); } .imagePreviewToolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; } .imagePreviewTitle { display: grid; min-width: 0; gap: 1px; } .imagePreviewTitle span, .imagePreviewTitle small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .imagePreviewTitle span { color: var(--ds-text-1); font-size: var(--ds-text-sm); font-weight: 500; line-height: var(--ds-text-sm-lh); } .imagePreviewTitle small { color: var(--ds-text-3); font-size: var(--ds-text-xs); line-height: var(--ds-text-xs-lh); } .imagePreviewActions { display: inline-flex; align-items: center; gap: 6px; flex: none; } .imagePreviewStage { display: grid; place-items: center; min-width: 0; min-height: 0; overflow: hidden; border-radius: var(--ds-radius-3); background: var(--ds-gray-a2); } .imagePreviewStage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; } .imagePreviewLoading { display: grid; place-items: center; color: var(--ds-text-3); } @media (max-width: 640px) { /* Anchor to the edges with the bottom raised by the native composer inset (0 on desktop / web) so the preview never hides under the mobile composer overlaying the WebView. Replaces the centered transform with inset bounds. */ .imagePreviewDialog { /* 16px gap + 20px to clear the native composer's chat-log overlap (CHAT_COMPOSER_OVERLAP) — the inset var is reduced by that overlap, so the preview would otherwise touch the composer's true top (iOS). */ inset: 16px 16px calc(36px + var(--mobile-chat-bottom-inset, 0px)) 16px; width: auto; height: auto; max-height: none; transform: none; } .imagePreviewDialog[data-starting-style], .imagePreviewDialog[data-ending-style] { transform: none; } }