/* BSI Thread Assist 1.8.0 — responsive assistant interface. */
#bsi-thread-assist,
#bsi-thread-assist * { box-sizing: border-box; }
#bsi-thread-assist {
  --bsi-ta-blue: #16477f;
  --bsi-ta-blue-dark: #10375f;
  --bsi-ta-ink: #172536;
  --bsi-ta-muted: #526579;
  --bsi-ta-border: #d9e2ed;
  position: relative;
  z-index: 99970;
  color: var(--bsi-ta-ink);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}
#bsi-thread-assist [hidden] { display: none !important; }
#bsi-thread-assist button,
#bsi-thread-assist textarea { font-family: inherit; }
#bsi-thread-assist button:focus-visible,
#bsi-thread-assist a:focus-visible,
#bsi-thread-assist textarea:focus-visible { outline: 3px solid #f0b429 !important; outline-offset: 2px; }

.bsi-ta-launcher {
  position: fixed;
  z-index: 99970;
  right: 22px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 52px;
  min-height: 52px;
  padding: 0 17px;
  border: 1px solid var(--bsi-ta-blue);
  border-radius: 999px;
  background: var(--bsi-ta-blue);
  color: #fff !important;
  box-shadow: 0 7px 24px rgba(18, 59, 104, .24);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.bsi-ta-launcher:hover { background: var(--bsi-ta-blue-dark); color: #fff !important; box-shadow: 0 9px 28px rgba(18, 59, 104, .3); transform: translateY(-1px); }
.bsi-ta-launcher-icon { display: inline-flex; width: 28px; height: 28px; flex: 0 0 28px; align-items: center; justify-content: center; overflow: hidden; border-radius: 50%; }
.bsi-ta-launcher-icon img { display: block; width: 26px !important; height: 26px !important; max-width: 26px !important; max-height: 26px !important; margin: 0 !important; object-fit: contain !important; }
#bsi-thread-assist.is-open .bsi-ta-launcher { opacity: 0; pointer-events: none; transform: scale(.96); }

.bsi-ta-panel {
  position: fixed;
  z-index: 99980;
  right: 22px;
  bottom: 86px;
  display: flex;
  flex-direction: column;
  width: min(440px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 112px));
  height: min(680px, calc(100dvh - 112px));
  min-height: 300px;
  max-height: calc(100vh - 112px);
  overflow: hidden;
  border: 1px solid #ccd9e7;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 64px rgba(14, 35, 58, .26);
  isolation: isolate;
}
.bsi-ta-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 12px 14px;
  color: #fff !important;
  background: linear-gradient(135deg, #16477f 0%, #10375f 100%) !important;
}
#bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon {
  display: flex !important;
  flex: 0 0 42px !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
}
#bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon img {
  display: block !important;
  width: 42px !important;
  height: 42px !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: contain !important;
}
#bsi-thread-assist .bsi-ta-header .bsi-ta-brand-copy { display: block !important; flex: 1 1 auto !important; min-width: 0 !important; }
#bsi-thread-assist .bsi-ta-header .bsi-ta-brand-copy > h2#bsi-ta-title {
  all: unset !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: 20px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  letter-spacing: -.015em !important;
  text-shadow: none !important;
  text-transform: none !important;
  overflow-wrap: normal !important;
}
#bsi-thread-assist .bsi-ta-header .bsi-ta-brand-copy > p {
  display: block !important;
  margin: 4px 0 0 !important;
  padding: 0 !important;
  color: #f0f6ff !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  letter-spacing: .01em !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
.bsi-ta-close {
  display: flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0 0 2px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff !important;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.bsi-ta-close:hover { background: rgba(255, 255, 255, .18); }

.bsi-ta-chat-view { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; padding: 12px 12px 10px; background: #fff; }
.bsi-ta-messages { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 10px; scroll-behavior: smooth; scrollbar-gutter: stable; }
.bsi-ta-message {
  max-width: 96%;
  width: fit-content;
  margin: 5px 0;
  padding: 10px 12px;
  border: 1px solid #e2e9f1;
  border-radius: 14px 14px 14px 5px;
  background: #f6f8fb;
  color: #24374a;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}
.bsi-ta-message.is-user { align-self: flex-end; margin-left: auto; border-color: #16477f; border-radius: 14px 14px 5px 14px; background: #16477f; color: #fff; }
.bsi-ta-message.is-error { border-color: #e9c1c1; background: #fff6f6; color: #7a2222; }
.bsi-ta-inline-link { color: #0756a0; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.bsi-ta-message.is-user .bsi-ta-inline-link { color: #fff; }
.bsi-ta-typing { flex: 0 0 auto; padding: 7px 10px 9px; color: #526579; font-size: 12px; }
.bsi-ta-chat-form { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid #e8edf2; background: #fff; }
.bsi-ta-chat-form textarea {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  max-height: 112px;
  margin: 0;
  padding: 12px 13px;
  resize: none;
  border: 1px solid #cad6e2;
  border-radius: 12px;
  background: #fff;
  color: #172536;
  box-shadow: inset 0 1px 2px rgba(23, 37, 54, .025);
  font-size: 14px;
  line-height: 1.45;
  -webkit-appearance: none;
  appearance: none;
}
.bsi-ta-chat-form textarea::placeholder { color: #627387; opacity: 1; }
.bsi-ta-send {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid #16477f;
  border-radius: 12px;
  background: #16477f;
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color .15s ease;
}
.bsi-ta-send:hover { background: #10375f; }
.bsi-ta-send:disabled { opacity: .58; cursor: wait; }

@media (max-width: 700px) {
  /* The theme's fixed Call / WhatsApp bar occupies the lower edge on phones.
     JS measures its real height so the assistant never sits on top of those CTAs. */
  .bsi-ta-launcher {
    right: 14px;
    bottom: calc(var(--bsi-ta-mobile-cta-gap, 0px) + env(safe-area-inset-bottom, 0px) + 16px);
    min-height: 50px;
    padding: 0 14px;
  }
  .bsi-ta-panel {
    right: 8px;
    bottom: calc(var(--bsi-ta-visual-bottom-gap, 0px) + env(safe-area-inset-bottom, 0px) + var(--bsi-ta-mobile-cta-gap, 0px) + 8px);
    width: calc(100vw - 16px);
    height: min(720px, calc(var(--bsi-ta-visual-height, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - var(--bsi-ta-mobile-cta-gap, 0px) - 24px));
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - var(--bsi-ta-mobile-cta-gap, 0px) - 24px);
    min-height: 260px;
    border-radius: 17px;
  }
  .bsi-ta-header { min-height: 68px; padding: 9px 11px; gap: 9px; }
  #bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon,
  #bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon img { width: 40px !important; height: 40px !important; flex-basis: 40px !important; }
  #bsi-thread-assist .bsi-ta-header .bsi-ta-brand-copy > h2#bsi-ta-title { font-size: 19px !important; }
  #bsi-thread-assist .bsi-ta-header .bsi-ta-brand-copy > p { font-size: 10px !important; }
  .bsi-ta-chat-view { padding: 9px 9px 8px; }
  .bsi-ta-messages { padding-bottom: 6px; }
  .bsi-ta-chat-form { gap: 7px; padding-top: 8px; }
  .bsi-ta-chat-form textarea { min-height: 46px; max-height: 92px; padding: 11px; font-size: 16px; }
  .bsi-ta-send { min-width: 60px; min-height: 46px; padding: 0 12px; }
}
@media (max-width: 360px) {
  .bsi-ta-panel { right: 5px; width: calc(100vw - 10px); border-radius: 14px; }
  #bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon,
  #bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon img { width: 36px !important; height: 36px !important; flex-basis: 36px !important; }
  #bsi-thread-assist .bsi-ta-header .bsi-ta-brand-copy > h2#bsi-ta-title { font-size: 18px !important; }
  .bsi-ta-header { gap: 7px; }
  .bsi-ta-close { flex-basis: 36px; width: 36px; height: 36px; }
  .bsi-ta-chat-form { gap: 6px; }
  .bsi-ta-send { min-width: 56px; padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  #bsi-thread-assist *, #bsi-thread-assist *::before, #bsi-thread-assist *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Explicit screen-reader-only utility so the field label remains accessible even if the theme omits WP's helper CSS. */
#bsi-thread-assist .bsi-ta-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@media (max-width: 700px) {
  .bsi-ta-panel { min-height: 0; }
  .bsi-ta-close { flex-basis: 44px; width: 44px; height: 44px; }
}
@media (max-width: 360px) {
  .bsi-ta-close { flex-basis: 40px; width: 40px; height: 40px; }
}
#bsi-thread-assist .bsi-ta-support-shortcut{margin:8px 2px 0!important;padding:0!important;text-align:center;color:#5b6b7e!important;font-size:11px!important;line-height:1.4!important}
#bsi-thread-assist .bsi-ta-support-shortcut a{color:#16477f!important;font-weight:650!important;text-decoration:underline!important;text-underline-offset:2px}
#bsi-thread-assist .bsi-ta-support-shortcut a:hover{color:#10375f!important}

/* In-chat ticket creation — v1.4.7 */
#bsi-thread-assist .bsi-ta-support-shortcut {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 5px 10px !important;
  margin: 8px 2px 0 !important;
  padding: 0 !important;
  text-align: center !important;
  color: #5b6b7e !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
}
#bsi-thread-assist .bsi-ta-support-shortcut a {
  color: #16477f !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}
#bsi-thread-assist .bsi-ta-ticket-trigger {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 30px !important;
  padding: 5px 10px !important;
  border: 1px solid #d4e1f0 !important;
  border-radius: 8px !important;
  background: #f4f8fd !important;
  color: #16477f !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  line-height: 1.3 !important;
  cursor: pointer !important;
}
#bsi-thread-assist .bsi-ta-ticket-trigger:hover { background: #e8f1fb !important; border-color: #a9c1df !important; }
#bsi-thread-assist .bsi-ta-ticket-card {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  margin: 7px 0 10px;
  padding: 14px;
  border: 1px solid #d8e4f2;
  border-radius: 15px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fd 100%);
  color: #1b2c40;
  box-shadow: 0 5px 18px rgba(20, 58, 97, .07);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}
#bsi-thread-assist .bsi-ta-ticket-card .bsi-ta-ticket-eyebrow {
  margin: 0 0 5px;
  color: #52739b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1.4;
  text-transform: uppercase;
}
#bsi-thread-assist .bsi-ta-ticket-card h3 {
  margin: 0 0 5px !important;
  padding: 0 !important;
  color: #173f6d !important;
  font-size: 17px !important;
  line-height: 1.28 !important;
  letter-spacing: -.015em;
  text-transform: none !important;
}
#bsi-thread-assist .bsi-ta-ticket-intro {
  margin: 0 0 12px !important;
  padding: 0 !important;
  color: #586c82 !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
}
#bsi-thread-assist .bsi-ta-ticket-form { display: block; margin: 0; padding: 0; border: 0; background: transparent; }
#bsi-thread-assist .bsi-ta-ticket-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px 10px;
  width: 100%;
}
#bsi-thread-assist .bsi-ta-ticket-field {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 4px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #344b65 !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
}
#bsi-thread-assist .bsi-ta-ticket-field.is-full { grid-column: 1 / -1; }
#bsi-thread-assist .bsi-ta-ticket-field[hidden],
#bsi-thread-assist .bsi-ta-ticket-actions [hidden],
#bsi-thread-assist .bsi-ta-ticket-privacy[hidden] { display: none !important; }
#bsi-thread-assist .bsi-ta-ticket-progress { margin: 0 0 9px !important; color: #526b85 !important; font-size: 10px !important; font-weight: 750 !important; }
#bsi-thread-assist .bsi-ta-ticket-field > span { display: block; margin: 0; padding: 0; color: #344b65; }
#bsi-thread-assist .bsi-ta-ticket-field input,
#bsi-thread-assist .bsi-ta-ticket-field select,
#bsi-thread-assist .bsi-ta-ticket-field textarea {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 8px 9px !important;
  border: 1px solid #cdd9e7 !important;
  border-radius: 8px !important;
  outline-offset: 1px;
  background: #fff !important;
  color: #192b3e !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
#bsi-thread-assist .bsi-ta-ticket-field textarea { min-height: 75px !important; max-height: 130px; resize: vertical; }
#bsi-thread-assist .bsi-ta-ticket-field input::placeholder,
#bsi-thread-assist .bsi-ta-ticket-field textarea::placeholder { color: #8090a1 !important; opacity: 1; }
#bsi-thread-assist .bsi-ta-ticket-field input:focus,
#bsi-thread-assist .bsi-ta-ticket-field select:focus,
#bsi-thread-assist .bsi-ta-ticket-field textarea:focus { border-color: #477fb8 !important; box-shadow: 0 0 0 3px rgba(22, 71, 127, .1) !important; }
#bsi-thread-assist .bsi-ta-ticket-privacy { margin: 9px 0 0 !important; padding: 0 !important; color: #697c90 !important; font-size: 10px !important; line-height: 1.45 !important; }
#bsi-thread-assist .bsi-ta-ticket-alert { margin: 9px 0 0 !important; padding: 8px 9px !important; border: 1px solid #f0cbcb; border-radius: 8px; background: #fff5f5; color: #8a2828; font-size: 11px; line-height: 1.45; white-space: normal; }
#bsi-thread-assist .bsi-ta-ticket-alert[hidden] { display: none !important; }
#bsi-thread-assist .bsi-ta-ticket-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
#bsi-thread-assist .bsi-ta-ticket-submit,
#bsi-thread-assist .bsi-ta-ticket-cancel,
#bsi-thread-assist .bsi-ta-ticket-track {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 8px 12px !important;
  border: 1px solid #16477f !important;
  border-radius: 9px !important;
  background: #16477f !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
}
#bsi-thread-assist .bsi-ta-ticket-cancel { border-color: #d2dce7 !important; background: #fff !important; color: #41566e !important; }
#bsi-thread-assist .bsi-ta-ticket-submit:hover,
#bsi-thread-assist .bsi-ta-ticket-track:hover { background: #10375f !important; }
#bsi-thread-assist .bsi-ta-ticket-cancel:hover { background: #f3f6fa !important; }
#bsi-thread-assist .bsi-ta-ticket-submit:disabled,
#bsi-thread-assist .bsi-ta-ticket-cancel:disabled { cursor: wait !important; opacity: .65; }
#bsi-thread-assist .bsi-ta-ticket-honey { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
#bsi-thread-assist .bsi-ta-ticket-success-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0 0 10px; border-radius: 50%; background: #e3f5ec; color: #16724b; font-size: 21px; font-weight: 800; }
#bsi-thread-assist .bsi-ta-ticket-reference { margin: 8px 0 12px !important; padding: 11px 12px !important; border: 1px dashed #9eb8d8; border-radius: 9px; background: #eaf2fd; color: #16477f; font-size: 15px; font-weight: 850; letter-spacing: .025em; text-align: center; }
#bsi-thread-assist .bsi-ta-ticket-track { width: 100%; min-height: 42px !important; }
#bsi-thread-assist .bsi-ta-ticket-card.is-complete { border-color: #b9dfcc; background: linear-gradient(180deg, #fbfffd 0%, #f0faf4 100%); }
@media (max-width: 380px) {
  #bsi-thread-assist .bsi-ta-ticket-card { padding: 11px; }
  #bsi-thread-assist .bsi-ta-ticket-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #bsi-thread-assist .bsi-ta-ticket-field.is-full { grid-column: auto; }
  #bsi-thread-assist .bsi-ta-ticket-field input,
  #bsi-thread-assist .bsi-ta-ticket-field select,
  #bsi-thread-assist .bsi-ta-ticket-field textarea { font-size: 16px !important; }
  #bsi-thread-assist .bsi-ta-ticket-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
}


/* Helpful chat shortcuts and accessible answer actions (v1.5.0). */
.bsi-ta-quick-prompts { display: flex; flex-wrap: wrap; gap: 6px; max-width: 98%; margin: 3px 0 10px; }
.bsi-ta-quick-prompt { appearance: none; border: 1px solid #cbd9e8; border-radius: 999px; padding: 7px 10px; background: #fff; color: #16477f; font: inherit; font-size: 11px; line-height: 1.35; cursor: pointer; }
.bsi-ta-quick-prompt:hover, .bsi-ta-quick-prompt:focus-visible { border-color: #16477f; background: #f1f6fb; }
.bsi-ta-message-actions { display: flex; justify-content: flex-end; margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(90, 110, 130, .15); }
.bsi-ta-copy-answer { appearance: none; border: 0; border-radius: 5px; padding: 3px 6px; background: transparent; color: #526579; font: inherit; font-size: 10px; cursor: pointer; }
.bsi-ta-copy-answer:hover, .bsi-ta-copy-answer:focus-visible { background: #eaf1f8; color: #16477f; }
.bsi-ta-message.is-user .bsi-ta-message-actions { display: none; }

/* Guided FAQ categories and question lists */
.bsi-ta-faq-heading { flex-basis: 100%; width: 100%; margin: 2px 0 7px; color: #334b65; font-size: 12px; font-weight: 700; line-height: 1.4; }
.bsi-ta-faq-categories, .bsi-ta-faq-questions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; width: 100%; }
.bsi-ta-faq-category { min-height: 38px; border-radius: 10px; text-align: left; white-space: normal; }
.bsi-ta-faq-questions { grid-template-columns: minmax(0, 1fr); }
.bsi-ta-faq-question { width: 100%; border-radius: 9px; text-align: left; white-space: normal; }
.bsi-ta-faq-back { margin-bottom: 6px; }
@media (max-width: 420px) { .bsi-ta-faq-categories { grid-template-columns: minmax(0, 1fr); } .bsi-ta-faq-category { width: 100%; } }


/* Post-answer satisfaction choices (v1.6.0). */
#bsi-thread-assist .bsi-ta-satisfaction { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 12px; padding: 9px 10px; border: 1px solid #dce5ef; border-radius: 10px; background: #f7faff; }
#bsi-thread-assist .bsi-ta-satisfaction-label { flex-basis: 100%; color: #334b65; font-size: 12px; font-weight: 700; }
#bsi-thread-assist .bsi-ta-satisfaction-button { appearance: none; min-height: 32px; padding: 6px 12px; border: 1px solid #cbd9e8; border-radius: 999px; background: #fff; color: #16477f; font: inherit; font-size: 12px; cursor: pointer; }
#bsi-thread-assist .bsi-ta-satisfaction-button:hover, #bsi-thread-assist .bsi-ta-satisfaction-button:focus-visible { border-color: #16477f; background: #eaf2fd; }
#bsi-thread-assist .bsi-ta-satisfaction-button.is-yes { border-color: #b8ddc8; color: #176545; }


/* Official company logo sizing — 1.6.5. No stretching or cropping. */
#bsi-thread-assist .bsi-ta-launcher-icon { width:28px; height:28px; flex-basis:28px; border-radius:5px; background:#fff; }
#bsi-thread-assist .bsi-ta-launcher-icon img { width:26px !important; height:26px !important; max-width:26px !important; max-height:26px !important; object-fit:contain !important; border-radius:2px !important; }
#bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon { width:44px !important; height:44px !important; flex-basis:44px !important; border-radius:6px !important; background:#fff !important; padding:2px !important; box-sizing:border-box !important; }
#bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon img { width:40px !important; height:40px !important; max-width:40px !important; max-height:40px !important; object-fit:contain !important; border-radius:3px !important; }
@media(max-width:700px) { #bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon { width:40px !important; height:40px !important; flex-basis:40px !important; } #bsi-thread-assist .bsi-ta-header .bsi-ta-brand-icon img { width:36px !important; height:36px !important; max-width:36px !important; max-height:36px !important; } }


/* Compact privacy reminder beneath chat controls. */
.bsi-ta .bsi-ta-privacy-note {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   BSI Thread Assist 1.8.0 — responsive interface polish
   Appended overrides keep the existing chat, FAQ and ticket behaviour intact.
   -------------------------------------------------------------------------- */
#bsi-thread-assist {
  --bsi-ta-blue: #174b82;
  --bsi-ta-blue-dark: #103b68;
  --bsi-ta-border: #d9e3ee;
  color: #17283b;
}

.bsi-ta-launcher {
  min-height: 54px;
  padding-inline: 18px;
  border-color: #174b82;
  background: linear-gradient(135deg, #1b568f 0%, #123c69 100%);
  box-shadow: 0 8px 26px rgba(16, 55, 95, .27), 0 2px 5px rgba(16, 55, 95, .12);
}
.bsi-ta-launcher:hover { box-shadow: 0 11px 30px rgba(16, 55, 95, .32); }
.bsi-ta-panel {
  width: min(470px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - 112px));
  border-color: #d6e0eb;
  border-radius: 22px;
  box-shadow: 0 24px 72px rgba(13, 33, 56, .28), 0 3px 10px rgba(13, 33, 56, .08);
}
.bsi-ta-header {
  min-height: 80px;
  padding: 14px 16px;
  background: linear-gradient(125deg, #1b568f 0%, #123c69 72%, #0f345b 100%) !important;
}
.bsi-ta-close { transition: background-color .16s ease, transform .16s ease; }
.bsi-ta-close:hover { transform: rotate(3deg); }
.bsi-ta-chat-view { padding: 15px 15px 12px; background: #fff; }
.bsi-ta-messages {
  gap: 3px;
  padding: 3px 5px 14px 2px;
  scrollbar-width: thin;
  scrollbar-color: #c4d1df transparent;
}
.bsi-ta-messages::-webkit-scrollbar { width: 7px; }
.bsi-ta-messages::-webkit-scrollbar-thumb { border: 2px solid #fff; border-radius: 99px; background: #c4d1df; }
.bsi-ta-message {
  max-width: min(91%, 390px);
  margin: 5px 0;
  padding: 11px 14px;
  border-color: #e1e8f0;
  border-radius: 16px 16px 16px 6px;
  background: #f4f7fb;
  color: #24364a;
  font-size: 14px;
  line-height: 1.62;
}
.bsi-ta-message.is-user {
  border-color: #174b82;
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(135deg, #1b568f, #17477f);
  color: #fff;
}
.bsi-ta-message.is-error { border-color: #f0caca; background: #fff6f5; color: #812b2b; }
.bsi-ta-typing { padding: 8px 10px 11px; color: #607286; font-size: 12px; }
.bsi-ta-chat-form {
  gap: 9px;
  padding: 12px 0 0;
  border-top-color: #e6ecf2;
}
.bsi-ta-chat-form textarea {
  min-height: 48px;
  padding: 12px 14px;
  border-color: #cbd7e4;
  border-radius: 14px;
  background: #fbfcfe;
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.bsi-ta-chat-form textarea:focus {
  border-color: #477eae;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 75, 130, .11);
  outline: 0;
}
.bsi-ta-send {
  min-width: 74px;
  min-height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1b568f, #123c69);
  font-size: 13px;
  box-shadow: 0 3px 9px rgba(16, 55, 95, .15);
}
.bsi-ta-send:hover { background: #10375f; }
.bsi-ta-send:focus-visible,
.bsi-ta-ticket-trigger:focus-visible,
.bsi-ta-quick-prompt:focus-visible,
.bsi-ta-satisfaction-button:focus-visible,
.bsi-ta-copy-answer:focus-visible { outline: 3px solid #e0a32e !important; outline-offset: 3px; }
.bsi-ta-quick-prompts { gap: 8px; margin: 6px 0 12px; }
.bsi-ta-quick-prompt {
  min-height: 38px;
  padding: 8px 12px;
  border-color: #d3dfec;
  background: #fff;
  color: #174b82;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.bsi-ta-quick-prompt:hover { border-color: #9db6d2; background: #f3f7fc; transform: translateY(-1px); }
.bsi-ta-faq-heading { color: #304963; font-size: 13px; }
.bsi-ta-faq-categories { gap: 8px; }
.bsi-ta-faq-category { min-height: 44px; padding: 10px 12px; border-radius: 11px; }
.bsi-ta-faq-question { min-height: 42px; padding: 10px 12px; border-radius: 10px; }
.bsi-ta-support-shortcut {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 10px !important;
  color: #5b6d80 !important;
  font-size: 12px !important;
}
.bsi-ta-support-shortcut .bsi-ta-ticket-trigger {
  min-height: 38px !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
  background: #f4f8fd !important;
  font-size: 12px !important;
}
.bsi-ta-privacy-note { margin-top: 9px !important; font-size: 11px; }
.bsi-ta-message-actions { margin-top: 8px; padding-top: 7px; }
.bsi-ta-copy-answer { min-height: 30px; padding: 5px 8px; font-size: 11px; }

@media (min-width: 701px) and (max-height: 620px) {
  .bsi-ta-panel { height: calc(100dvh - 100px); min-height: 260px; }
  .bsi-ta-header { min-height: 66px; padding-block: 9px; }
  .bsi-ta-chat-view { padding-top: 9px; }
}
@media (max-width: 700px) {
  .bsi-ta-launcher {
    right: 12px;
    min-height: 52px;
    padding-inline: 15px;
    box-shadow: 0 7px 22px rgba(16, 55, 95, .28);
  }
  .bsi-ta-panel {
    right: 8px;
    width: calc(100vw - 16px);
    border-radius: 18px;
  }
  .bsi-ta-header { min-height: 68px; padding: 9px 12px; }
  .bsi-ta-close { flex-basis: 44px; width: 44px; height: 44px; }
  .bsi-ta-chat-view { padding: 10px 10px 9px; }
  .bsi-ta-message { max-width: 94%; padding: 10px 12px; font-size: 14px; }
  .bsi-ta-chat-form { gap: 8px; padding-top: 9px; }
  .bsi-ta-chat-form textarea { min-height: 48px; max-height: 104px; padding: 11px 12px; font-size: 16px; }
  .bsi-ta-send { min-width: 66px; min-height: 48px; padding-inline: 11px; }
  .bsi-ta-faq-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bsi-ta-faq-category { min-height: 44px; }
  /* Ticket fields are deliberately stacked on phones to avoid narrow controls. */
  #bsi-thread-assist .bsi-ta-ticket-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #bsi-thread-assist .bsi-ta-ticket-field.is-full { grid-column: auto; }
  #bsi-thread-assist .bsi-ta-ticket-field { font-size: 12px !important; }
  #bsi-thread-assist .bsi-ta-ticket-field input,
  #bsi-thread-assist .bsi-ta-ticket-field select,
  #bsi-thread-assist .bsi-ta-ticket-field textarea {
    min-height: 46px !important;
    padding: 11px 12px !important;
    font-size: 16px !important;
  }
  #bsi-thread-assist .bsi-ta-ticket-field textarea { min-height: 104px !important; }
  #bsi-thread-assist .bsi-ta-ticket-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #bsi-thread-assist .bsi-ta-ticket-actions > button { width: 100%; min-height: 44px !important; }
}
@media (max-width: 560px) {
  /* Full-height mobile sheet uses the visual viewport so it stays above the keyboard. */
  .bsi-ta-panel {
    inset-inline: 0;
    right: 0;
    bottom: calc(var(--bsi-ta-visual-bottom-gap, 0px) + env(safe-area-inset-bottom, 0px) + var(--bsi-ta-mobile-cta-gap, 0px));
    width: 100vw;
    height: calc(var(--bsi-ta-visual-height, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - var(--bsi-ta-mobile-cta-gap, 0px));
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: 0 0 0 1px rgba(12, 35, 60, .08);
  }
  .bsi-ta-header { min-height: 66px; padding: 9px 14px; }
  .bsi-ta-chat-view { padding: 11px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .bsi-ta-messages { padding-inline: 1px 4px; }
  .bsi-ta-support-shortcut { align-items: flex-start; }
}
@media (max-width: 380px) {
  .bsi-ta-faq-categories { grid-template-columns: minmax(0, 1fr); }
  .bsi-ta-faq-category { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .bsi-ta-launcher, .bsi-ta-quick-prompt, .bsi-ta-close, .bsi-ta-chat-form textarea { transition: none !important; }
}

/* 1.9.0 — contextual next steps and human handoff actions */
#bsi-thread-assist .bsi-ta-next-steps {
  width: min(96%, 560px);
  margin: 8px 0 12px;
  padding: 11px 12px;
  border: 1px solid #dce5ef;
  border-radius: 13px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
  box-shadow: 0 2px 8px rgba(24, 54, 86, .045);
  animation: bsi-ta-next-steps-in .18s ease-out both;
}
#bsi-thread-assist .bsi-ta-next-steps-title {
  margin: 0 0 8px;
  color: #263e59;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .01em;
}
#bsi-thread-assist .bsi-ta-smart-suggestions,
#bsi-thread-assist .bsi-ta-handoff-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 7px;
}
#bsi-thread-assist .bsi-ta-smart-suggestion,
#bsi-thread-assist .bsi-ta-handoff-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid #d3dfeb;
  border-radius: 9px;
  background: #fff;
  color: #174a7b;
  font: inherit;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
#bsi-thread-assist .bsi-ta-smart-suggestion:hover,
#bsi-thread-assist .bsi-ta-handoff-link:hover {
  border-color: #9eb7d1;
  background: #f0f6fc;
}
#bsi-thread-assist .bsi-ta-handoff-actions { margin-top: 9px; padding-top: 8px; border-top: 1px solid #e1e8f0; }
#bsi-thread-assist .bsi-ta-handoff-link.is-primary {
  border-color: #16477f;
  background: #16477f;
  color: #fff;
  font-weight: 700;
}
#bsi-thread-assist .bsi-ta-handoff-link.is-primary:hover { border-color: #10365f; background: #103e70; }
#bsi-thread-assist .bsi-ta-smart-suggestion:focus-visible,
#bsi-thread-assist .bsi-ta-handoff-link:focus-visible {
  outline: 3px solid rgba(35, 112, 185, .3);
  outline-offset: 2px;
}
@keyframes bsi-ta-next-steps-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 700px) {
  #bsi-thread-assist .bsi-ta-next-steps { width: 100%; margin-block: 7px 10px; padding: 10px; }
  #bsi-thread-assist .bsi-ta-smart-suggestions,
  #bsi-thread-assist .bsi-ta-handoff-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  #bsi-thread-assist .bsi-ta-smart-suggestion,
  #bsi-thread-assist .bsi-ta-handoff-link { width: 100%; min-height: 42px; padding: 10px 12px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #bsi-thread-assist .bsi-ta-next-steps { animation: none; }
  #bsi-thread-assist .bsi-ta-smart-suggestion,
  #bsi-thread-assist .bsi-ta-handoff-link { transition: none; }
}
