#commentForm > .comment-image-picker {
  min-width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #40514d;
  background: #202b2b;
  color: #c4ead0;
}
.comment-image-draft {
  flex: 1 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 12px;
  background: #202b2b;
  color: #d1ded4;
}
.comment-image-draft[hidden] { display: none; }
.comment-image-draft img { width: 58px; height: 44px; object-fit: cover; border-radius: 8px; }
.comment-image-draft span { flex: 1; font-size: 13px; }
.comment-image-draft button, .comment-image-toolbar button, .composer-note .comment-image-delete {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #42554e;
  border-radius: 12px;
  background: #242f30;
  color: #d9efe0;
  font: inherit;
  cursor: pointer;
}
.composer-note .comment-image-delete { min-height: 32px; color: #ffc0b6; }
.comment-image-thumb {
  display: block;
  width: 224px;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #121918;
  cursor: zoom-in;
}
.message-bubble p + .comment-image-thumb { margin-top: 8px; }
.comment-image-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 224 / 144;
  object-fit: contain;
}
.comment-image-viewer {
  box-sizing: border-box;
  width: min(94vw, 1100px);
  height: min(90dvh, 840px);
  max-height: calc(100dvh - 24px);
  padding: 10px;
  border: 1px solid #354746;
  border-radius: 18px;
  background: #111718;
  color: #ecf4ef;
}
.comment-image-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}
.comment-image-viewer::backdrop { background: #000b; }
.comment-image-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.comment-image-toolbar button { min-width: 44px; min-height: 44px; }
.comment-image-toolbar button[data-image-close] { margin-left: auto; }
.comment-image-toolbar button:disabled, #commentForm > .comment-image-picker:disabled { opacity: .5; cursor: default; }
.comment-image-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #080b0c;
  touch-action: none;
  user-select: none;
}
.comment-image-stage.is-zoomed { cursor: grab; }
.comment-image-stage.is-zoomed:active { cursor: grabbing; }
.comment-image-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.comment-image-view-status, .comment-image-hint { margin: 0; text-align: center; font-size: 13px; color: #bacac2; }
.comment-image-view-status:empty { display: none; }
.comment-image-thumb, .comment-image-toolbar button, .comment-image-draft button,
#commentForm > .comment-image-picker, .composer-note .comment-image-delete {
  -webkit-tap-highlight-color: transparent;
}
.comment-image-thumb:focus-visible, .comment-image-toolbar button:focus-visible,
.comment-image-draft button:focus-visible, #commentForm > .comment-image-picker:focus-visible,
.composer-note .comment-image-delete:focus-visible {
  outline: 2px solid #b8f097;
  outline-offset: 2px;
}
.message.own .comment-image-thumb:focus-visible { outline-color: #234826; }
.comment-image-thumb:active, .comment-image-toolbar button:active, .comment-image-draft button:active,
#commentForm > .comment-image-picker:active, .composer-note .comment-image-delete:active {
  transform: scale(.97);
  filter: brightness(.9);
}
