/* =========================================
   BV CHAT UI SKELETON (Theme Engine Native)
   ========================================= */
:root {
  --bv-chat-gap: 12px;
  --bv-chat-gap-focus: 14px;
  --bv-chat-radius-user: 16px;
  --bv-chat-radius-user-tail: 6px;
  --bv-chat-radius-ai: 16px;
  --bv-chat-radius-system: 12px;
  
  /* Type Scale */
  --bv-chat-font-sm: 13px;
  --bv-chat-font-md: 14.5px;
  --bv-chat-font-lg: 16px;
}

#bvAIChat, #bvAIFocusChat { display: flex; flex-direction: column; align-items: stretch; width: 100%; box-sizing: border-box; }
#bvAIChat { gap: var(--bv-chat-gap); padding-bottom: 28px; }
#bvAIFocusChat { gap: var(--bv-chat-gap-focus); padding-bottom: 28px; }

.bv-chat-msg { display: flex; width: 100%; margin: 0; padding: 0; box-sizing: border-box; }
.bv-chat-msg--user { justify-content: flex-end; }
.bv-chat-msg--ai { justify-content: flex-start; display: block; }
.bv-chat-msg--system { justify-content: center; }

/* THE USER BUBBLE */
.bv-chat-bubble--user {
  display: inline-block; max-width: min(360px, 72%); margin: 0 0 0 auto; padding: 14px 16px;
  border-radius: var(--bv-chat-radius-user); border-bottom-right-radius: var(--bv-chat-radius-user-tail);
  background: var(--bv-accent-primary); /* Syncs with theme accent! */
  color: #ffffff; /* Always white text on the accent bubble */
  font-size: var(--bv-chat-font-md); line-height: 1.68; white-space: pre-wrap; word-break: break-word;
}

#bvAIFocusChat .bv-chat-bubble--user { max-width: min(420px, 64%); padding: 16px 20px; }

/* THE SYSTEM MESSAGE */
.bv-chat-system {
  width: auto; max-width: 100%; margin: 0 auto; padding: 10px 14px;
  border-radius: var(--bv-chat-radius-system); border: 1px dashed var(--bv-border-main);
  background: var(--bv-bg-input); color: var(--bv-text-subtle);
  font-size: 12px; line-height: 1.45; text-align: center; font-style: italic;
}

/* Sizing Modifiers */
.bv-side-assist[data-chat-size="sm"] { --bv-chat-font-md: var(--bv-chat-font-sm); }
.bv-side-assist[data-chat-size="lg"] { --bv-chat-font-md: var(--bv-chat-font-lg); }