/* Meow Lightbox / Flat Dark. Opt in by adding 'pororin-prompt-gallery' to a gallery block. */
@media (min-width: 1200px) {
  body:has(.pororin-prompt-gallery, .pororin-prompt-test) .mwl.mwl-theme-flat .pswp__dynamic-caption--aside {
    position: fixed !important;
    /* Vertically center captions regardless of prompt length. */
    top: 50% !important;
    right: 145px !important;
    left: auto !important;
    bottom: auto !important;
    width: 410px !important;
    max-width: 410px !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: calc(100dvh - 100px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    box-sizing: border-box;
    background: #202024 !important;
    padding: 16px !important;
    border-radius: 6px;
    color: #f5f5f5 !important;
  }
}
body:has(.pororin-prompt-gallery, .pororin-prompt-test) .mwl .mwl__metadata .description .caption-wrapper {
  background: #202024 !important;
  max-height: none !important;
  height: auto !important;
  overflow-y: visible !important;
  overflow-x: visible !important;
}
body:has(.pororin-prompt-gallery, .pororin-prompt-test) .mwl .mwl__metadata .description .caption {
  color: #f5f5f5 !important;
  display: block !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere;
  line-height: 1.55;
  font-size: 14px;
}
/* Added dynamically to the caption's existing container; no article inline scripts. */
body:has(.pororin-prompt-gallery, .pororin-prompt-test) .mwl .pororin-prompt-copy-button {
  display: block;
  width: max-content;
  margin: 0 0 10px auto;
  padding: 7px 12px;
  background-color: #eeeeef;
  color: #17171a;
  border: 0;
  border-radius: 4px;
  font: 600 13px/1.4 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}
body:has(.pororin-prompt-gallery, .pororin-prompt-test) .mwl .pororin-prompt-copy-button:hover,
body:has(.pororin-prompt-gallery, .pororin-prompt-test) .mwl .pororin-prompt-copy-button:focus-visible {
  background: #fff;
  outline: 2px solid #999;
  outline-offset: 2px;
}

/* Keep incomplete last gallery rows the same card width as complete rows.
   WordPress core's flex-grow:1 otherwise stretches the final 1–2 cards. */
.wp-block-gallery.has-nested-images.pororin-prompt-gallery > figure.wp-block-image {
  flex-grow: 0 !important;
}
