/* Nine-patch art stretches only its center/edges; corner decorations keep their size. */
.message-bubble.message-bubble-custom,
.message-row.mine .message-bubble.message-bubble-custom,
body.theme-liquid .message-bubble.message-bubble-custom {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  min-width: min(var(--chat-bubble-min-width, 64px), 100%);
  min-height: var(--chat-bubble-min-height, 56px);
  padding: var(--chat-bubble-padding, 12px 16px);
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--chat-bubble-text, #263449);
}
.message-bubble-custom::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  box-sizing: border-box;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: var(--chat-bubble-border);
  /* The catalog keeps corners at their native scale; only the center and
     edge strips extend with the text. This layer preserves PNG transparency. */
  border-image-source: var(--chat-bubble-image);
  border-image-slice: var(--chat-bubble-slice) fill;
  border-image-width: var(--chat-bubble-border);
  border-image-repeat: stretch;
}
.message-bubble-custom > * { position: relative; z-index: 1; }
.message-bubble-custom > .message-text { min-width: 0; overflow-wrap: anywhere; }
.message-bubble-custom .message-link,
.message-row.mine .message-bubble-custom .message-link { color: var(--chat-bubble-link, #285fac); }
.message-bubble-custom .quote-block,
.message-row.mine .message-bubble-custom .quote-block { color: inherit; background: rgba(255,255,255,.5); border-left-color: currentColor; }
.message-bubble-custom .quote-block strong,
.message-row.mine .message-bubble-custom .quote-block strong { color: inherit; }
.message-bubble-custom .file-card { min-width: 0; max-width: 100%; }
