/* Avantis Assistant chat widget */
.kba, .kba * { box-sizing: border-box; }
.kba { position: fixed; right: 20px; bottom: 20px; z-index: 2147483000; font-family: Manrope, sans-serif; color: #0b0014; }
.kba[hidden] { display: none; }

.kba__pill { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; background: #fff; border: 1px solid #e3e1ea;
  border-radius: 20px; box-shadow: 0 2px 10px rgba(11,0,20,.16); cursor: pointer; font: 500 13px/1 Manrope, sans-serif; color: #33313d; }
.kba__pill:hover { box-shadow: 0 3px 14px rgba(11,0,20,.24); }
.kba__pill svg { width: 15px; height: 15px; flex: none; }
.kba__pill > svg:first-child { color: #4921cd; width: 18px; height: 17px; }   /* the Avantis mark */
.kba__pill-send { margin-left: 14px; opacity: .6; }

.kba__panel { display: none; flex-direction: column; width: 448px; height: min(732px, calc(100vh - 40px)); max-width: calc(100vw - 24px);
  background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 40px rgba(11,0,20,.28); }
.kba--open .kba__panel { display: flex; }
.kba--open .kba__pill { display: none; }
.kba--wide .kba__panel { width: min(760px, calc(100vw - 24px)); }

.kba__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #4921cd; color: #fff; }
.kba__avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center; flex: none; }
.kba__avatar svg { width: 18px; height: 18px; color: #fff; }
.kba__title { flex: 1; min-width: 0; }
.kba__title strong { display: block; font-size: 15px; font-weight: 700; }
.kba__title span { display: block; font-size: 11px; opacity: .85; }
.kba__icon { background: none; border: 0; color: #fff; width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.kba__icon:hover { background: rgba(255,255,255,.16); }
.kba__icon svg { width: 18px; height: 18px; }

.kba__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.kba__row { display: flex; gap: 10px; align-items: flex-start; }
.kba__row--user { justify-content: flex-end; }
.kba__bot { width: 28px; height: 28px; border-radius: 50%; background: #4921cd; display: grid; place-items: center; flex: none; }
.kba__bot svg { width: 15px; height: 15px; color: #fff; }
.kba__msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; background: #f1f0f4; color: #33313d; overflow-wrap: anywhere; }
.kba__row--user .kba__msg { background: #4921cd; color: #fff; }
.kba__msg p { margin: 0 0 8px; } .kba__msg p:last-child { margin: 0; }
.kba__msg ol, .kba__msg ul { margin: 0 0 8px; padding-left: 20px; }
.kba__msg a { color: #4921cd; font-weight: 600; text-decoration: underline; }
.kba__row--user .kba__msg a { color: #fff; }
.kba__msg--err { background: #fdecec; color: #8a1f1f; }
.kba__dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.kba__dots i { width: 6px; height: 6px; border-radius: 50%; background: #8a86a0; animation: kba-b 1.1s infinite ease-in-out; }
.kba__dots i:nth-child(2) { animation-delay: .15s; } .kba__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes kba-b { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.kba__form { padding: 8px 16px 0; }
.kba__box { display: flex; align-items: center; gap: 6px; border: 1px solid #8a86a0; border-radius: 22px; padding: 0 8px 0 16px; height: 40px; }
.kba__box:focus-within { border-color: #4921cd; box-shadow: 0 0 0 2px rgba(73,33,205,.18); }
.kba__input { flex: 1; border: 0; outline: 0; background: none; font: 14px Manrope, sans-serif; color: #0b0014; min-width: 0; }
.kba__send { background: none; border: 0; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; color: #4921cd; border-radius: 50%; }
.kba__send:disabled { color: #b5b2c4; cursor: default; }
.kba__send svg { width: 18px; height: 18px; }
.kba__note { text-align: center; font-size: 12px; color: #33313d; padding: 6px 0 10px; }

@media (max-width: 520px) {
  html.kba-lock, html.kba-lock body { overflow: hidden; }
  .kba__expand { display: none; }
  .kba__input { font-size: 16px; }
  .kba__msg { max-width: 88%; }
  .kba { right: 12px; bottom: 12px; }
  .kba--open { right: 0; bottom: 0; left: 0; }
  .kba--open .kba__panel { width: 100vw; max-width: 100vw; height: 100vh; border-radius: 0; }
}
