/* Image content only. Host safe areas and composer geometry are unchanged. */
/* Generic button:active scaling must not replace the centered close button's translation. */
#image-lightbox .imglb__close:active { transform: translateX(-50%); }
html body #app-container #chat-messages .chat-image {
  display: block !important;
  width: var(--image-width, 360px) !important;
  max-width: 100% !important;
  min-width: 0;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
html body #app-container #chat-messages .agent-media-block:has(.chat-image) { width: min(100%, 620px) !important; }
html body #app-container #chat-messages .chat-image__viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: 8px;
  background: var(--chat-raised);
}
html body #app-container #chat-messages .chat-image :is(.agent-generated-image, .user-uploaded-image) {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  object-fit: contain;
  cursor: zoom-in;
  box-shadow: none !important;
}
html body #app-container #chat-messages .chat-image--compact { width: 100% !important; }
html body #app-container #chat-messages .chat-image[data-state="ready"] img { animation: image-arrive .18s ease-out; }
html body #app-container #chat-messages .chat-image--compact .chat-image__viewport { aspect-ratio: 1; }
html body #app-container #chat-messages .chat-image--compact img { height: 100% !important; object-fit: contain; }
html body #app-container #chat-messages :is(.chat-image__loading, .chat-image__error) {
  min-height: 200px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--chat-muted);
  font: 14px/1.5 var(--chat-font);
  text-align: center;
  overflow-wrap: anywhere;
}
html body #app-container #chat-messages .chat-image__loading { aspect-ratio: 1; animation: image-wait 2.4s ease-in-out infinite; }
html body #app-container #chat-messages .chat-image__actions { display: flex; align-items: center; gap: 2px; min-height: 40px; padding-block: 3px; }
html body #app-container #chat-messages .chat-image__action {
  display: inline-flex;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0 !important;
  border-radius: 6px;
  background: transparent !important;
  color: var(--chat-muted) !important;
  box-shadow: none !important;
  font: 500 11px/1 var(--chat-font);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
html body #app-container #chat-messages .chat-image__action:hover { background: var(--chat-hover) !important; color: var(--chat-text) !important; }
html body #app-container #chat-messages .chat-image__action:disabled { opacity: .45; cursor: wait; }
html body #app-container #chat-messages .chat-image :focus-visible { outline: 2px solid var(--chat-focus); outline-offset: -3px; }
html body #app-container #chat-messages .chat-image [hidden] { display: none !important; }
html body #app-container #chat-messages .agent-processing-indicator--image { width: 100%; opacity: 1; }
html body #app-container #chat-messages .chat-image-progress { width: var(--image-width, 360px) !important; max-width: 100% !important; color: var(--chat-text) !important; font-family: var(--chat-font); letter-spacing: 0; }
.chat-image-progress__tile { display: grid; place-items: center; aspect-ratio: var(--image-ratio, 1); background: var(--chat-raised); border: 1px solid var(--chat-line); border-radius: 8px; color: var(--chat-muted); animation: image-wait 2.4s ease-in-out infinite; }
.chat-image-progress__tile svg { width: 26px; height: 26px; opacity: .7; }
.chat-image-progress__caption { padding: 12px 0 4px; display: flex; flex-direction: column; gap: 3px; }
.chat-image-progress__label { font-size: 14px; line-height: 20px; font-weight: 500; }
.chat-image-progress__detail { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; font-size: 12px; line-height: 18px; color: var(--chat-muted); }
.chat-image-progress__time { font-variant-numeric: tabular-nums; }
@keyframes image-wait { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes image-arrive { from { opacity: 0; } to { opacity: 1; } }
@media (pointer: coarse) { html body #app-container #chat-messages .chat-image__action { width: 44px; height: 44px; flex-basis: 44px; } }
@media (prefers-reduced-motion: reduce) { .chat-image-progress__tile, html body #app-container #chat-messages .chat-image__loading, html body #app-container #chat-messages .chat-image[data-state="ready"] img { animation: none; } }
