#blac-root {
  --blac-accent: #6c5ce7;
  --blac-ink: #15151c;
  --blac-muted: #6f7180;
  --blac-surface: #ffffff;
  --blac-soft: #f5f5fa;
  --blac-border: rgba(20, 20, 32, .1);
  position: fixed;
  z-index: 2147483000;
  bottom: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--blac-ink);
  line-height: 1.45;
  text-align: left;
}
#blac-root.blac-position-right { right: 22px; }
#blac-root.blac-position-left { left: 22px; }
#blac-root *, #blac-root *::before, #blac-root *::after { box-sizing: border-box; }

.blac-launcher {
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: var(--blac-accent);
  color: #fff;
  box-shadow: 0 12px 35px rgba(31, 31, 48, .22), 0 4px 12px rgba(31, 31, 48, .16);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.blac-launcher:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 40px rgba(31, 31, 48, .26); }
.blac-launcher:focus-visible, .blac-minimize:focus-visible, .blac-send:focus-visible, .blac-quick-prompts button:focus-visible { outline: 3px solid color-mix(in srgb, var(--blac-accent) 35%, white); outline-offset: 3px; }
.blac-launcher-logo { font-size: 25px; font-weight: 800; letter-spacing: -.04em; }
.blac-status-dot { position: absolute; width: 14px; height: 14px; right: 1px; bottom: 4px; background: #2ed573; border: 3px solid #fff; border-radius: 50%; }
.blac-close-icon { display: none; width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.blac-open .blac-launcher-logo, .blac-open .blac-status-dot { display: none; }
.blac-open .blac-close-icon { display: block; }

.blac-panel {
  position: absolute;
  bottom: 78px;
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  min-height: 460px;
  background: var(--blac-surface);
  border: 1px solid var(--blac-border);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(25, 25, 40, .22), 0 8px 24px rgba(25, 25, 40, .1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.97);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  pointer-events: none;
}
.blac-position-right .blac-panel { right: 0; }
.blac-position-left .blac-panel { left: 0; transform-origin: bottom left; }
.blac-open .blac-panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }

.blac-header {
  min-height: 78px;
  padding: 16px 15px 15px 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--blac-accent), color-mix(in srgb, var(--blac-accent) 78%, #141429));
  position: relative;
  overflow: hidden;
}
.blac-header::after { content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,.08); top: -115px; right: -35px; }
.blac-avatar { width: 43px; height: 43px; flex: 0 0 43px; display: grid; place-items: center; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.24); border-radius: 14px; font-size: 19px; font-weight: 800; backdrop-filter: blur(8px); }
.blac-header-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.blac-header-copy strong { color: #fff; font-size: 16px; line-height: 1.25; }
.blac-header-copy span { color: rgba(255,255,255,.82); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.blac-header-copy i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #45ed8e; box-shadow: 0 0 0 3px rgba(69,237,142,.14); }
.blac-minimize { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; position: relative; z-index: 1; }
.blac-minimize:hover { background: rgba(255,255,255,.2); }
.blac-minimize svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.blac-messages { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 15px 10px; background: linear-gradient(180deg, #fafafd 0%, #fff 22%); scrollbar-width: thin; scrollbar-color: rgba(20,20,35,.18) transparent; }
.blac-row { width: 100%; display: flex; margin: 0 0 11px; animation: blac-in .18s ease both; }
.blac-row.blac-user { justify-content: flex-end; }
.blac-bubble { max-width: 84%; padding: 11px 13px; border-radius: 15px 15px 15px 5px; background: var(--blac-soft); border: 1px solid rgba(20,20,32,.055); color: #292934; font-size: 14px; line-height: 1.52; overflow-wrap: anywhere; box-shadow: 0 2px 8px rgba(20,20,35,.035); }
.blac-user .blac-bubble { background: var(--blac-accent); color: #fff; border-color: transparent; border-radius: 15px 15px 5px 15px; }
.blac-error .blac-bubble { background: #fff3f2; color: #a8241e; border-color: #ffd4d0; }
.blac-bubble a { color: var(--blac-accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 650; }
.blac-user .blac-bubble a { color: #fff; }

.blac-typing { display: flex; align-items: center; gap: 4px; min-width: 112px; }
.blac-typing span { width: 6px; height: 6px; border-radius: 50%; background: #8c8e9c; animation: blac-dot 1.1s infinite ease-in-out; }
.blac-typing span:nth-child(2) { animation-delay: .14s; }
.blac-typing span:nth-child(3) { animation-delay: .28s; }
.blac-typing em { font-size: 11px; color: var(--blac-muted); font-style: normal; margin-left: 5px; }

.blac-quick-prompts { display: flex; gap: 7px; padding: 5px 14px 10px; overflow-x: auto; scrollbar-width: none; background: #fff; }
.blac-quick-prompts::-webkit-scrollbar { display: none; }
.blac-quick-prompts button { flex: 0 0 auto; border: 1px solid color-mix(in srgb, var(--blac-accent) 23%, #ddd); background: color-mix(in srgb, var(--blac-accent) 5%, white); color: color-mix(in srgb, var(--blac-accent) 85%, #111); border-radius: 999px; padding: 7px 10px; font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer; }
.blac-quick-prompts button:hover { background: color-mix(in srgb, var(--blac-accent) 10%, white); }

.blac-form { display: flex; align-items: flex-end; gap: 9px; padding: 11px 12px 8px; border-top: 1px solid var(--blac-border); background: #fff; }
.blac-input { flex: 1; min-width: 0; height: 43px; max-height: 112px; resize: none; border: 1px solid rgba(20,20,32,.12); border-radius: 14px; background: #f8f8fb; color: var(--blac-ink); padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.45; box-shadow: none; outline: none; }
.blac-input:focus { border-color: color-mix(in srgb, var(--blac-accent) 55%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blac-accent) 10%, transparent); background: #fff; }
.blac-input::placeholder { color: #9496a2; }
.blac-send { width: 43px; height: 43px; flex: 0 0 43px; border: 0; border-radius: 13px; background: var(--blac-accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .15s ease, opacity .15s ease; }
.blac-send:hover { transform: translateY(-1px); }
.blac-send:disabled, .blac-input:disabled { opacity: .58; cursor: not-allowed; }
.blac-send svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.blac-footer { padding: 0 12px 8px; background: #fff; color: #9698a5; text-align: center; font-size: 10px; }

@keyframes blac-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blac-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 600px) {
  #blac-root { right: 14px !important; left: auto !important; bottom: 14px; }
  .blac-launcher { width: 58px; height: 58px; }
  .blac-panel { position: fixed; left: 10px !important; right: 10px !important; bottom: 82px; width: auto; height: min(72vh, 610px); min-height: 430px; border-radius: 20px; transform-origin: bottom right; }
  .blac-header { min-height: 72px; padding: 13px 13px 13px 15px; }
  .blac-messages { padding: 15px 12px 8px; }
  .blac-bubble { max-width: 88%; font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  #blac-root *, #blac-root *::before, #blac-root *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
