/* Sharkbook sales assistant widget. Matches the theme's navy + red, but stands on its own. */
.sbsa-launcher,
.sbsa-panel,
.sbsa-teaser {
  --sbsa-bg: #1d2742;
  --sbsa-bg-deep: #141b30;
  --sbsa-fg: #eef1f6;
  --sbsa-muted: #aab3c5;
  --sbsa-red: #E94560;
  --sbsa-border: rgba(255, 255, 255, 0.1);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}
.sbsa-panel *, .sbsa-launcher * { box-sizing: border-box; }

.sbsa-launcher {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--sbsa-lift, 0px)); /* lift is set by the script so the footer links stay visible */
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 6px 6px;
  border: 1px solid var(--sbsa-border);
  border-radius: 999px;
  background: var(--sbsa-bg);
  color: var(--sbsa-fg);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sbsa-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(0, 0, 0, 0.7); }
.sbsa-launcher:focus-visible { outline: 3px solid var(--sbsa-red); outline-offset: 3px; }
.sbsa-launcher img { border-radius: 50%; display: block; }
.sbsa-launcher--hidden { display: none; }

/* One-time hello above the launcher */
.sbsa-teaser {
  position: fixed;
  right: 20px;
  bottom: calc(88px + var(--sbsa-lift, 0px));
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  max-width: 300px;
  padding: 12px 6px 12px 14px;
  border: 1px solid var(--sbsa-border);
  border-radius: 14px 14px 4px 14px;
  background: var(--sbsa-bg);
  color: var(--sbsa-fg);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
  animation: sbsa-teaser-in 0.3s ease-out;
}
.sbsa-teaser button {
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.sbsa-teaser-msg { padding: 0; text-align: left; font-size: 14px; line-height: 1.45; }
.sbsa-teaser-close { padding: 0 6px; font-size: 18px; line-height: 1; color: var(--sbsa-muted); }
.sbsa-teaser-msg:focus-visible,
.sbsa-teaser-close:focus-visible { outline: 2px solid var(--sbsa-red); outline-offset: 2px; border-radius: 4px; }
.sbsa-teaser-close:hover { color: var(--sbsa-fg); }
@keyframes sbsa-teaser-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.sbsa-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 380px;
  height: min(600px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  background: var(--sbsa-bg);
  color: var(--sbsa-fg);
  border: 1px solid var(--sbsa-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  animation: sbsa-in 0.2s ease;
}
.sbsa-panel[hidden] { display: none; }
@keyframes sbsa-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.sbsa-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid var(--sbsa-border);
  background: var(--sbsa-bg-deep);
}
.sbsa-header img { border-radius: 50%; }
.sbsa-titles { display: flex; flex-direction: column; line-height: 1.2; margin-right: auto; }
.sbsa-titles strong { font-size: 15px; }
.sbsa-titles span { font-size: 12px; color: var(--sbsa-muted); }
.sbsa-icon-btn {
  width: 34px; height: 34px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--sbsa-muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.sbsa-icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--sbsa-fg); }
.sbsa-icon-btn:focus-visible { outline: 2px solid var(--sbsa-red); }

.sbsa-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sbsa-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sbsa-msg--bot { align-self: flex-start; background: #26325a; border-bottom-left-radius: 4px; }
.sbsa-msg--me { align-self: flex-end; background: var(--sbsa-red); color: #fff; border-bottom-right-radius: 4px; }

.sbsa-typing { display: flex; gap: 4px; padding: 14px; }
.sbsa-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--sbsa-muted); animation: sbsa-dot 1s infinite ease-in-out; }
.sbsa-typing span:nth-child(2) { animation-delay: 0.15s; }
.sbsa-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes sbsa-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.sbsa-slots { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px; }
.sbsa-slots:not(:empty) { padding-bottom: 12px; }
.sbsa-slot {
  border: 1px solid rgba(233, 69, 96, 0.6);
  background: rgba(233, 69, 96, 0.1);
  color: var(--sbsa-fg);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sbsa-slot:hover, .sbsa-slot:focus-visible { background: var(--sbsa-red); outline: none; }

.sbsa-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--sbsa-border);
  background: var(--sbsa-bg-deep);
}
.sbsa-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--sbsa-border);
  border-radius: 10px;
  background: var(--sbsa-bg);
  color: var(--sbsa-fg);
  padding: 9px 11px;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.4;
  max-height: 120px;
}
.sbsa-form textarea:focus { outline: none; border-color: var(--sbsa-red); box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2); }
.sbsa-send {
  border: 0;
  border-radius: 10px;
  background: var(--sbsa-red);
  color: #fff;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
}
.sbsa-send:disabled, .sbsa-form textarea:disabled { opacity: 0.6; cursor: default; }
.sbsa-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.sbsa-note { margin: 0; padding: 0 14px 10px; font-size: 11.5px; color: var(--sbsa-muted); background: var(--sbsa-bg-deep); }

@media (max-width: 520px) {
  .sbsa-panel { inset: 0; width: auto; height: 100%; border-radius: 0; border: 0; }
  .sbsa-launcher { right: 14px; bottom: calc(14px + var(--sbsa-lift, 0px)); }
  .sbsa-launcher-text { display: none; }
  .sbsa-launcher { padding: 6px; }
  .sbsa-teaser { right: 14px; bottom: calc(76px + var(--sbsa-lift, 0px)); max-width: 250px; }
}
@media (prefers-reduced-motion: reduce) {
  .sbsa-panel, .sbsa-typing span { animation: none; }
  .sbsa-launcher { transition: none; }
  .sbsa-teaser { animation: none; }
}

.sbsa-sources {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  color: var(--sbsa-muted);
  white-space: normal;
}
