/* Business Lab Assistant v1.0.0: mobile first, 44px targets, no layout shift (everything is position:fixed). */
.blai, .blai *, .blai *::before, .blai *::after { box-sizing: border-box; }
.blai, .blai-launch { --blai-ink: var(--ink, #210b49); --blai-brand: var(--purple, #6631db); --blai-line: var(--line, #e4e0ed); --blai-bg: var(--bg, #f4f6fc); --blai-wa: #128c4a; --blai-safe: env(safe-area-inset-bottom, 0px); font-family: inherit; }
.blai-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Launcher: sits above the mobile bottom bar / beside the WhatsApp button, never over them */
.blai-launch { position: fixed; z-index: 9991; right: 16px; bottom: calc(16px + var(--blai-safe)); display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: var(--blai-brand); color: #fff; font: inherit; font-weight: 800; font-size: 15px;
  box-shadow: 0 8px 24px rgba(33, 11, 73, .25); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.blai-launch svg { width: 22px; height: 22px; }
.blai-launch:focus-visible, .blai :focus-visible { outline: 3px solid #ffb703; outline-offset: 2px; }
html.blm-on .blai-launch { bottom: calc(var(--blm-bar-h, 64px) + var(--blai-safe) + 12px); }
html:not(.blm-on) .blai-launch { bottom: calc(88px + var(--blai-safe)); } /* above the floating WhatsApp button */
html.blai-open .blai-launch, html.blm-typing .blai-launch, html.blm-lock .blai-launch { visibility: hidden; }

/* Dialog: bottom sheet on phones */
.blai[hidden] { display: none !important; }
.blai-backdrop { position: fixed; inset: 0; z-index: 10010; background: rgba(20, 10, 40, .45); opacity: 0; transition: opacity .18s ease; }
.blai-dlg { position: fixed; z-index: 10011; left: 0; right: 0; bottom: 0; height: min(88dvh, 680px); display: flex; flex-direction: column; background: #fff; color: var(--blai-ink);
  border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(33, 11, 73, .25); transform: translateY(24px); opacity: 0; transition: transform .2s cubic-bezier(.22, 1, .36, 1), opacity .18s ease;
  padding-bottom: var(--blai-safe); font-size: 15px; line-height: 1.45; }
.blai.blai-in .blai-backdrop { opacity: 1; } .blai.blai-in .blai-dlg { transform: none; opacity: 1; }
html.blai-open { overflow: hidden; }
.blai-head { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--blai-line); }
.blai-avatar { flex: 0 0 36px; height: 36px; border-radius: 50%; background: var(--blai-brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.blai-ht { flex: 1; min-width: 0; } .blai-ht h2 { margin: 0; font-size: 16px; line-height: 1.2; color: var(--blai-ink); } .blai-ht p { margin: 2px 0 0; font-size: 12.5px; color: #5b5470; }
.blai-ic { flex: 0 0 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--blai-ink); font-size: 20px; display: grid; place-items: center; cursor: pointer; }
.blai-ic svg { width: 22px; height: 22px; } .blai-ic:hover { background: var(--blai-bg); }
.blai-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--blai-bg); }
.blai-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; word-wrap: break-word; }
.blai-bot { align-self: flex-start; background: #fff; border: 1px solid var(--blai-line); border-bottom-left-radius: 4px; }
.blai-me { align-self: flex-end; background: var(--blai-brand); color: #fff; border-bottom-right-radius: 4px; }
.blai-card { max-width: 100%; width: 100%; padding: 12px 14px; }
.blai-card p { margin: 0 0 6px; } .blai-k { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--blai-brand); }
.blai-k small { text-transform: none; letter-spacing: 0; font-weight: 600; color: #6b6480; }
.blai-read { margin: 0; display: grid; gap: 6px; } .blai-read dt { font-weight: 800; font-size: 13px; } .blai-read dd { margin: 0 0 2px; }
.blai-note, .blai-warn { padding: 8px 10px; border-radius: 10px; font-size: 14px; margin-top: 8px !important; }
.blai-note { background: #f3effd; } .blai-warn { background: #fff4e0; border: 1px solid #f3c06b; }
.blai-res { font-size: 13px; color: #4b4560; margin-top: 8px !important; } .blai-res span { white-space: nowrap; font-style: italic; }
.blai-on { font-weight: 800; font-size: 16px; } .blai-os { font-size: 14px; color: #3f3955; }
.blai-price { display: inline-block; font-weight: 800; margin-bottom: 4px; } .blai-price s { color: #807a92; font-weight: 600; margin-left: 4px; }
.blai-add { border-style: dashed; }
.blai-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; }
.blai-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--blai-brand);
  color: var(--blai-brand); background: #fff; font-weight: 800; font-size: 15px; text-decoration: none; }
.blai-btn svg { width: 20px; height: 20px; }
.blai-primary { background: var(--blai-brand); color: #fff; }
.blai-wa { background: var(--blai-wa); border-color: var(--blai-wa); color: #fff; }
.blai-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--blai-brand); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.blai-name { display: grid; gap: 4px; font-size: 13px; font-weight: 700; } .blai-name small { font-weight: 500; color: #6b6480; }
.blai-name input { min-height: 44px; padding: 0 12px; border: 1px solid #b9b2cc; border-radius: 10px; font: inherit; font-size: 16px; }
.blai-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 4px; max-height: 34dvh; overflow-y: auto; border-top: 1px solid var(--blai-line); }
.blai-chips:empty { display: none; }
.blai-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--blai-brand); border-radius: 999px; background: #fff; color: var(--blai-brand);
  font: inherit; font-weight: 700; font-size: 14.5px; line-height: 1.15; text-align: start; text-decoration: none; cursor: pointer; }
.blai-chip:hover { background: #f3effd; } .blai-chip svg { width: 18px; height: 18px; }
.blai-chip-wa { border-color: var(--blai-wa); color: var(--blai-wa); }
.blai-privacy { margin: 0; padding: 0 14px 10px; font-size: 12px; color: #5b5470; } .blai-privacy a { color: inherit; display: inline-block; padding: 14px 4px; margin: -14px 0; }
@keyframes blai-b { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* Desktop: floating panel bottom-right, no backdrop */
@media (min-width: 768px) {
  .blai-launch { right: 24px; }
  html:not(.blm-on) .blai-launch { bottom: 96px; }
  .blai-backdrop { background: transparent; }
  .blai-dlg { left: auto; right: 24px; bottom: 24px; width: 390px; height: min(680px, calc(100vh - 48px)); border-radius: 18px; box-shadow: 0 16px 48px rgba(33, 11, 73, .28); }
  html.blai-open { overflow: auto; }
}
@media (prefers-reduced-motion: reduce) { .blai-dlg, .blai-backdrop { transition: none; } }
body.motion-off .blai-dlg, body.motion-off .blai-backdrop { transition: none; }
@media print { .blai, .blai-launch { display: none !important; } }
/* Phones: icon-only launcher (less text, smaller footprint over page content) */
@media (max-width: 767px) {
  .blai-launch { width: 52px; height: 52px; min-height: 52px; padding: 0; justify-content: center; }
  .blai-launch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .blai-launch svg { width: 26px; height: 26px; }
}
/* Guard against theme heading/link styles leaking into the widget */
.blai h2, .blai p, .blai dt, .blai dd, .blai label, .blai a, .blai button, .blai input, .blai textarea, .blai summary { letter-spacing: normal; word-spacing: normal; text-transform: none; font-family: inherit; }
.blai .blai-ht h2 { font-size: 16px; font-weight: 800; line-height: 1.2; margin: 0; }
.blai .blai-k { text-transform: uppercase; letter-spacing: .04em; }

/* v2: hand-off fields, details, notes */
.blai-field { display: block; margin: 8px 0 0; font-size: 14px; font-weight: 700; color: var(--blai-ink); }
.blai-field small { font-weight: 500; color: #6b6480; }
.blai-field input, .blai-field textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; min-height: 44px; padding: 10px 12px; border: 1px solid #b9b2cc; border-radius: 10px; font: inherit; font-size: 16px; color: var(--blai-ink); background: #fff; resize: vertical; }
.blai-field input:focus-visible, .blai-field textarea:focus-visible, .blai-more summary:focus-visible { outline: 3px solid var(--blai-brand); outline-offset: 2px; }
.blai-more { margin-top: 6px; } .blai-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--blai-brand); }
.blai-more ul { margin: 0 0 4px 18px; padding: 0; } .blai-more li { margin: 0 0 4px; }
.blai-note-msg { background: #f1edf8; }
.blai-privacy { padding-bottom: max(10px, env(safe-area-inset-bottom)); }

/* v2.1: Bublab avatar + WhatsApp hours */
.blai-av { display: block; border-radius: 50%; background: #efe9fb; object-fit: contain; flex: 0 0 auto; }
.blai-av-h { width: 40px; height: 40px; }
.blai-av-l { width: 40px; height: 40px; background: #fff; margin: -6px 0 -6px -8px; }
.blai-row { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.blai-av-m { width: 28px; height: 28px; margin-bottom: 2px; }
.blai-row .blai-msg { max-width: calc(100% - 34px); }
.blai-row .blai-card { flex: 1; min-width: 0; }
.blai-hours { margin: 6px 0 2px !important; padding: 6px 10px; border-radius: 10px; background: #e9f7ef; color: #0d5c31; font-size: 14px; font-weight: 600; }
.blai-hours[data-open="0"] { background: #fff4e0; color: #6b4a00; }
@media (max-width: 767px) { .blai-av-l { margin: 0; width: 44px; height: 44px; } }
