/* Brains AI Chat widget */
#bac-root, #bac-root * { box-sizing: border-box; }
#bac-bubble {
  position: fixed; right: 22px; bottom: 22px; z-index: 999999;
  width: 60px; height: 60px; border-radius: 50%;
  background: #0B2A4A; color: #fff; border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background .2s ease;
}
#bac-bubble:hover { transform: scale(1.06); background: #0e365f; }
#bac-bubble svg { width: 28px; height: 28px; }
#bac-bubble .bac-badge {
  position: absolute; top: -3px; right: -3px; background: #F5B301; color: #0B2A4A;
  font: 700 11px/18px system-ui, sans-serif; min-width: 18px; height: 18px;
  border-radius: 9px; text-align: center; padding: 0 4px;
}
#bac-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 999999;
  width: 370px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100vh - 130px);
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 14px 44px rgba(0,0,0,.30);
  display: none; flex-direction: column;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
#bac-panel.bac-open { display: flex; }
#bac-header {
  background: #0B2A4A; color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
#bac-header .bac-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
#bac-header b { font-size: 15px; }
#bac-header small { opacity: .8; font-size: 11px; display: block; }
#bac-header .bac-x { margin-left: auto; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; opacity: .85; line-height: 1; }
#bac-msgs { flex: 1; overflow-y: auto; padding: 16px; background: #f4f7fb; display: flex; flex-direction: column; gap: 10px; }
.bac-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.bac-bot  { background: #fff; color: #17324d; align-self: flex-start; border: 1px solid #e3eaf3; border-bottom-left-radius: 4px; }
.bac-user { background: #0B2A4A; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bac-typing { display: inline-flex; gap: 4px; align-items: center; }
.bac-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9db4cc; animation: bac-b 1s infinite; }
.bac-typing span:nth-child(2){ animation-delay:.15s } .bac-typing span:nth-child(3){ animation-delay:.3s }
@keyframes bac-b { 0%,60%,100%{ opacity:.3; transform:translateY(0) } 30%{ opacity:1; transform:translateY(-3px) } }
#bac-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e6ecf3; background: #fff; }
#bac-text { flex: 1; resize: none; border: 1px solid #cfdbe8; border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit; max-height: 100px; }
#bac-text:focus { outline: none; border-color: #0B2A4A; }
#bac-send { background: #0B2A4A; color: #fff; border: none; border-radius: 10px; padding: 0 16px; cursor: pointer; font-weight: 600; }
#bac-send:disabled { opacity: .5; cursor: default; }
#bac-foot { text-align: center; font-size: 10px; color: #8ba0b6; padding: 0 0 8px; background: #fff; }
