/* Ask-about-Bo assistant: a long chat bar floating at the bottom of every page.
   Colors follow the site tokens in _sass/_modern-site.scss. */
.bo-ai {
  --bo-ai-ink: #0f1d2d;
  --bo-ai-body: #253649;
  --bo-ai-muted: #5a6d82;
  --bo-ai-surface: #ffffff;
  --bo-ai-surface-alt: #eef3f8;
  --bo-ai-border: #dbe4ee;
  --bo-ai-border-strong: #c4d2e1;
  --bo-ai-accent: #0f766e;
  --bo-ai-accent-hover: #0d9488;
  --bo-ai-accent-tint: #e6f7f5;
  --bo-ai-shadow: 0 18px 48px rgba(15, 29, 45, 0.18), 0 2px 6px rgba(15, 29, 45, 0.08);

  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  z-index: 1000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--bo-ai-body);
  font-size: 15px;
  line-height: 1.55;
}
.bo-ai *, .bo-ai *::before, .bo-ai *::after { box-sizing: border-box; }

/* Leave room so the bar never hides the end of the page */
body.has-bo-ai { padding-bottom: 96px; }

.bo-ai__shell {
  background: var(--bo-ai-surface);
  border: 1px solid var(--bo-ai-border-strong);
  border-radius: 26px;
  box-shadow: var(--bo-ai-shadow);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bo-ai__shell:focus-within { border-color: var(--bo-ai-accent); }

/* Conversation panel, shown above the input once the bar is opened */
.bo-ai__panel {
  display: none;
  border-bottom: 1px solid var(--bo-ai-border);
}
.bo-ai.is-open .bo-ai__panel { display: block; }

.bo-ai__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px 18px;
  border-bottom: 1px solid var(--bo-ai-border);
}
.bo-ai__title {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--bo-ai-ink);
  margin: 0;
}
.bo-ai__badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--bo-ai-accent);
  background: var(--bo-ai-accent-tint);
  border-radius: 999px;
  padding: 2px 8px;
}
.bo-ai__spacer { flex: 1; }
.bo-ai__iconbtn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--bo-ai-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.bo-ai__iconbtn:hover { background: var(--bo-ai-surface-alt); color: var(--bo-ai-ink); }
.bo-ai__iconbtn:focus-visible, .bo-ai__send:focus-visible, .bo-ai__chip:focus-visible, .bo-ai__fab:focus-visible {
  outline: 2px solid var(--bo-ai-accent);
  outline-offset: 2px;
}

.bo-ai__log {
  max-height: min(52vh, 460px);
  overflow-y: auto;
  padding: 16px 18px 8px;
  overscroll-behavior: contain;
}
.bo-ai__msg { margin: 0 0 14px; max-width: 100%; overflow-wrap: anywhere; }
.bo-ai__msg p { margin: 0 0 8px; }
.bo-ai__msg p:last-child { margin-bottom: 0; }
.bo-ai__msg ul { margin: 4px 0 8px; padding-left: 20px; }
.bo-ai__msg a { color: var(--bo-ai-accent); text-decoration: underline; text-underline-offset: 2px; }
.bo-ai__msg--user {
  margin-left: auto;
  width: fit-content;
  max-width: 85%;
  background: var(--bo-ai-surface-alt);
  color: var(--bo-ai-ink);
  border-radius: 16px 16px 4px 16px;
  padding: 8px 14px;
}
.bo-ai__msg--bot { color: var(--bo-ai-body); }
.bo-ai__msg--error { color: #b42318; }
.bo-ai__typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.bo-ai__typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--bo-ai-border-strong);
  animation: bo-ai-blink 1.2s infinite ease-in-out;
}
.bo-ai__typing span:nth-child(2) { animation-delay: 0.15s; }
.bo-ai__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bo-ai-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.bo-ai__intro { color: var(--bo-ai-muted); margin: 0 0 12px; }
.bo-ai__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.bo-ai__chip {
  appearance: none;
  border: 1px solid var(--bo-ai-border-strong);
  background: var(--bo-ai-surface);
  color: var(--bo-ai-ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.bo-ai__chip:hover { border-color: var(--bo-ai-accent); color: var(--bo-ai-accent); }

.bo-ai__note {
  margin: 0;
  padding: 6px 18px 10px;
  font-size: 12px;
  color: var(--bo-ai-muted);
}

/* The long input bar itself */
.bo-ai__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 18px;
}
.bo-ai__spark { color: var(--bo-ai-accent); flex: none; align-self: center; display: inline-flex; }
.bo-ai__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font: inherit;
  color: var(--bo-ai-ink);
  padding: 8px 0;
  max-height: 140px;
  line-height: 1.5;
}
.bo-ai__input::placeholder { color: var(--bo-ai-muted); }
.bo-ai__send {
  appearance: none;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--bo-ai-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.bo-ai__send:hover { background: var(--bo-ai-accent-hover); }
.bo-ai__send:disabled { opacity: 0.4; cursor: default; }

/* Minimized: a small round button in the corner */
.bo-ai__fab {
  display: none;
  appearance: none;
  border: 1px solid var(--bo-ai-border-strong);
  background: var(--bo-ai-surface);
  color: var(--bo-ai-accent);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: var(--bo-ai-shadow);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  align-items: center;
  gap: 8px;
}
.bo-ai.is-min {
  left: auto;
  right: max(16px, env(safe-area-inset-right));
  transform: none;
  width: auto;
}
.bo-ai.is-min .bo-ai__shell { display: none; }
.bo-ai.is-min .bo-ai__fab { display: inline-flex; }
body.has-bo-ai.bo-ai-min { padding-bottom: 0; }

@media (max-width: 600px) {
  .bo-ai { width: calc(100% - 24px); bottom: max(12px, env(safe-area-inset-bottom)); font-size: 15px; }
  .bo-ai__shell { border-radius: 22px; }
  .bo-ai__log { max-height: 55vh; }
}
@media (prefers-reduced-motion: reduce) {
  .bo-ai__typing span { animation: none; opacity: 0.6; }
  .bo-ai__shell, .bo-ai__send { transition: none; }
}
@media print { .bo-ai { display: none !important; } body.has-bo-ai { padding-bottom: 0; } }
