/* Each side uses the same rendering path in the transcript and draft preview. */
:is(#chat,.bubble-theme-preview) .bubble{--bubble-surface:var(--appearance-other,#FFFFFF)}
:is(#chat,.bubble-theme-preview) .message.me .bubble{--bubble-surface:var(--appearance-mine,#DCEEFF)}
:is(#chat,.bubble-theme-preview)[data-other-bubble="color"] .message:not(.me) .bubble,:is(#chat,.bubble-theme-preview)[data-other-bubble="image"] .message:not(.me) .bubble{--bubble-surface:var(--bubble-other-color);--code-surface:var(--bubble-other-code-surface);--code-ink:var(--bubble-other-code-text)}
:is(#chat,.bubble-theme-preview)[data-mine-bubble="color"] .message.me .bubble,:is(#chat,.bubble-theme-preview)[data-mine-bubble="image"] .message.me .bubble{--bubble-surface:var(--bubble-mine-color);--code-surface:var(--bubble-mine-code-surface);--code-ink:var(--bubble-mine-code-text)}
:is(#chat,.bubble-theme-preview) .message { --bubble-color:var(--bubble-other-color);--bubble-text:var(--bubble-other-text);--bubble-image:var(--bubble-other-image);--bubble-slice:var(--bubble-other-slice);--bubble-caps:var(--bubble-other-caps);--bubble-padding:var(--bubble-other-padding);--bubble-repeat:var(--bubble-other-repeat);--bubble-min-width:var(--bubble-other-min-width);--bubble-min-height:var(--bubble-other-min-height); }
:is(#chat,.bubble-theme-preview) .message.me { --bubble-color:var(--bubble-mine-color);--bubble-text:var(--bubble-mine-text);--bubble-image:var(--bubble-mine-image);--bubble-slice:var(--bubble-mine-slice);--bubble-caps:var(--bubble-mine-caps);--bubble-padding:var(--bubble-mine-padding);--bubble-repeat:var(--bubble-mine-repeat);--bubble-min-width:var(--bubble-mine-min-width);--bubble-min-height:var(--bubble-mine-min-height); }
:is(#chat,.bubble-theme-preview)[data-other-bubble="color"] .message:not(.me) .bubble,
:is(#chat,.bubble-theme-preview)[data-mine-bubble="color"] .message.me .bubble { background:var(--bubble-color);color:var(--bubble-text); }
:is(#chat,.bubble-theme-preview)[data-other-bubble="image"] .message:not(.me) .bubble,
:is(#chat,.bubble-theme-preview)[data-mine-bubble="image"] .message.me .bubble { position:relative;isolation:isolate;background:transparent;box-shadow:none;border-radius:0;color:var(--bubble-text);padding:var(--bubble-padding);min-width:min(100%,var(--bubble-min-width));min-height:var(--bubble-min-height);box-sizing:border-box; }
:is(#chat,.bubble-theme-preview)[data-other-bubble="image"] .message:not(.me) .bubble::before,
:is(#chat,.bubble-theme-preview)[data-mine-bubble="image"] .message.me .bubble::before { content:"";position:absolute;inset:0;pointer-events:none;z-index:-1;border-style:solid;border-color:transparent;border-width:var(--bubble-caps);border-image-source:var(--bubble-image);border-image-slice:var(--bubble-slice);border-image-width:1;border-image-repeat:var(--bubble-repeat); }
/* Keep process-only placeholders clear, matching the existing transcript rule. */
:is(#chat,.bubble-theme-preview) .message{--bubble-fill:var(--bubble-other-fill);--bubble-alpha:var(--bubble-other-alpha);--bubble-blur:var(--bubble-other-blur);--bubble-border:var(--bubble-other-border);--bubble-text-shadow:var(--bubble-other-text-shadow)}
:is(#chat,.bubble-theme-preview) .message.me{--bubble-fill:var(--bubble-mine-fill);--bubble-alpha:var(--bubble-mine-alpha);--bubble-blur:var(--bubble-mine-blur);--bubble-border:var(--bubble-mine-border);--bubble-text-shadow:var(--bubble-mine-text-shadow)}
:is(#chat,.bubble-theme-preview)[data-other-bubble="color"] .message:not(.me) .bubble,:is(#chat,.bubble-theme-preview)[data-mine-bubble="color"] .message.me .bubble{background:var(--bubble-fill)}
:is(#chat,.bubble-theme-preview)[data-other-bubble="color"] .message:not(.me) .bubble,:is(#chat,.bubble-theme-preview)[data-mine-bubble="color"] .message.me .bubble,:is(#chat,.bubble-theme-preview)[data-other-bubble="image"] .message:not(.me) .bubble,:is(#chat,.bubble-theme-preview)[data-mine-bubble="image"] .message.me .bubble{border:var(--bubble-border);backdrop-filter:blur(var(--bubble-blur));-webkit-backdrop-filter:blur(var(--bubble-blur));text-shadow:var(--bubble-text-shadow);box-sizing:border-box}
:is(#chat,.bubble-theme-preview)[data-other-bubble="image"] .message:not(.me) .bubble::before,:is(#chat,.bubble-theme-preview)[data-mine-bubble="image"] .message.me .bubble::before{opacity:var(--bubble-alpha)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){:is(#chat,.bubble-theme-preview)[data-other-bubble="color"] .message:not(.me) .bubble,:is(#chat,.bubble-theme-preview)[data-mine-bubble="color"] .message.me .bubble{background:var(--bubble-color)}:is(#chat,.bubble-theme-preview) .bubble::before{opacity:1}}
#chat .message:has(.process-summary):not(:has(.message-markdown)) .bubble { background:transparent;box-shadow:none;border:0;backdrop-filter:none;-webkit-backdrop-filter:none;text-shadow:none; }
#chat .message:has(.process-summary):not(:has(.message-markdown)) .bubble::before { content:none; }
.bubble-theme-editor { display:grid;gap:12px;min-width:0;border-top:1px solid #e1e5ea;padding-top:18px; }
.bubble-theme-editor h3,.bubble-theme-editor p { margin:0; }
.bubble-theme-editor p { font-size:12px;line-height:1.7; }
.bubble-theme-controls { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
.bubble-theme-controls label { display:grid;gap:5px;min-width:0; }
.bubble-theme-editor input,.bubble-theme-editor select { box-sizing:border-box;width:100%;min-width:0;min-height:40px;border:1px solid #d9dfe6;border-radius:8px;padding:8px;color:#172332;background:#fff; }
.bubble-theme-controls small,.bubble-theme-controls>label:has(input[type="file"]),.bubble-crop { grid-column:1/-1; }
.bubble-crop { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
.bubble-crop[hidden] { display:none; }
.bubble-crop img { grid-column:1/-1;display:block;max-width:100%;max-height:180px;justify-self:center;background:repeating-conic-gradient(#ddd 0% 25%,#fff 0% 50%) 0 / 16px 16px; }
.bubble-theme-preview { display:grid;gap:14px;padding:16px;border:1px solid #d9dfe6;border-radius:12px;background-color:#F2F5FC;background-position:center;background-size:cover;overflow-wrap:anywhere;min-width:0; }
.bubble-theme-preview .message { display:block;width:100%;min-width:0; }
.bubble-theme-preview .message.me .bubble { margin-left:auto; }
.bubble-theme-preview .bubble { max-width:100%;width:fit-content;white-space:pre-wrap;background:var(--appearance-other,#f0efeb);color:#172332; }
.bubble-theme-preview .message.me .bubble { background:var(--appearance-mine,#f4ece8); }
.bubble-theme-actions { display:flex;flex-wrap:wrap;gap:10px; }
.bubble-theme-editor button { min-height:44px; }
:is(#chat,.bubble-theme-preview)[data-other-bubble="color"] .message:not(.me) .bubble a,
:is(#chat,.bubble-theme-preview)[data-mine-bubble="color"] .message.me .bubble a,
:is(#chat,.bubble-theme-preview)[data-other-bubble="image"] .message:not(.me) .bubble a,
:is(#chat,.bubble-theme-preview)[data-mine-bubble="image"] .message.me .bubble a { color:inherit;text-decoration:underline; }
