/* SimpleWebs13 Chatbot. Every rule is scoped to #sw13cb so theme styles don't leak in or out. */
#sw13cb {
  --sw13cb-accent: #6b21a8;
  --sw13cb-ink: #000;
  --sw13cb-text: #1d1924;
  --sw13cb-muted: #625b6e;
  --sw13cb-line: #e4dfeb;
  --sw13cb-soft: #f5f2f9;
  --sw13cb-error: #b42318;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--sw13cb-text);
  text-align: left;
}
#sw13cb *, #sw13cb *::before, #sw13cb *::after { box-sizing: border-box; }
#sw13cb p { margin: 0; }
#sw13cb button, #sw13cb input, #sw13cb textarea {
  font-family: inherit; margin: 0; text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0;
}
#sw13cb button:focus-visible, #sw13cb input:focus-visible, #sw13cb textarea:focus-visible, #sw13cb a:focus-visible {
  outline: 3px solid var(--sw13cb-accent); outline-offset: 2px;
}

/* Launcher */
#sw13cb .sw13cb-launcher {
  width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%;
  background: var(--sw13cb-accent); color: #fff; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(45, 12, 80, .32);
  transition: transform .15s ease;
}
#sw13cb .sw13cb-launcher:hover { transform: scale(1.06); }

/* Panel */
#sw13cb .sw13cb-panel {
  position: absolute; right: 0; bottom: 76px;
  width: 370px; max-width: calc(100vw - 32px);
  height: 580px; max-height: calc(100vh - 110px);
  background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 22px 60px rgba(25, 8, 45, .28);
  transform-origin: bottom right;
  animation: sw13cb-in .18s ease-out;
}
#sw13cb .sw13cb-panel[hidden] { display: none; }
@keyframes sw13cb-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

#sw13cb .sw13cb-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 16px 14px 18px;
  background: var(--sw13cb-ink); color: #fff;
  border-bottom: 4px solid var(--sw13cb-accent);
}
#sw13cb .sw13cb-head-text { flex: 1; min-width: 0; }
#sw13cb .sw13cb-title { font-size: 17px; font-weight: 700; line-height: 1.2; }
#sw13cb .sw13cb-sub { margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, .72); }
#sw13cb .sw13cb-close {
  background: none; border: 0; padding: 0 4px; color: #fff; opacity: .8;
  font-size: 26px; line-height: 1; cursor: pointer;
}
#sw13cb .sw13cb-close:hover { opacity: 1; }

/* Conversation */
#sw13cb .sw13cb-log {
  flex: 1; overflow-y: auto; padding: 16px;
  background: var(--sw13cb-soft);
  display: flex; flex-direction: column; gap: 10px;
}
#sw13cb .sw13cb-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; overflow-wrap: anywhere; }
#sw13cb .sw13cb-msg p { margin: 0 0 8px; }
#sw13cb .sw13cb-msg p:last-child { margin-bottom: 0; }
#sw13cb .sw13cb-msg ul { margin: 4px 0 8px 18px; padding: 0; }
#sw13cb .sw13cb-msg li { margin: 2px 0; }
#sw13cb .sw13cb-bot {
  align-self: flex-start; background: #fff; border: 1px solid var(--sw13cb-line); border-bottom-left-radius: 4px;
}
#sw13cb .sw13cb-bot a { color: var(--sw13cb-accent); font-weight: 600; text-decoration: underline; }
#sw13cb .sw13cb-user {
  align-self: flex-end; background: var(--sw13cb-accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap;
}
#sw13cb .sw13cb-note { align-self: center; max-width: 100%; padding: 2px 8px; font-size: 12px; color: var(--sw13cb-error); text-align: center; }

#sw13cb .sw13cb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#sw13cb .sw13cb-chip {
  padding: 7px 12px; border: 1px solid var(--sw13cb-accent); border-radius: 999px;
  background: #fff; color: var(--sw13cb-accent); font-size: 13px; line-height: 1.25; cursor: pointer; text-align: left;
}
#sw13cb .sw13cb-chip:hover { background: var(--sw13cb-accent); color: #fff; }

#sw13cb .sw13cb-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
#sw13cb .sw13cb-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--sw13cb-muted);
  animation: sw13cb-blink 1.6s infinite ease-in-out;
}
#sw13cb .sw13cb-dots i:nth-child(2) { animation-delay: .25s; }
#sw13cb .sw13cb-dots i:nth-child(3) { animation-delay: .5s; }
@keyframes sw13cb-blink { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

/* Footer: intake form and composer */
#sw13cb .sw13cb-foot { padding: 12px; border-top: 1px solid var(--sw13cb-line); background: #fff; }
#sw13cb .sw13cb-field { margin-bottom: 9px; }
#sw13cb .sw13cb-field label { display: block; margin: 0 0 3px; font-size: 13px; font-weight: 600; color: var(--sw13cb-text); }
#sw13cb .sw13cb-intake input, #sw13cb .sw13cb-compose textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cbc3d6; border-radius: 10px;
  background: #fff; color: var(--sw13cb-text); font-size: 16px; line-height: 1.3;
}
#sw13cb .sw13cb-intake input[aria-invalid="true"] { border-color: var(--sw13cb-error); }
#sw13cb .sw13cb-err { margin-top: 3px; font-size: 12px; color: var(--sw13cb-error); }
#sw13cb .sw13cb-err:empty { display: none; }
#sw13cb .sw13cb-privacy { margin: 2px 0 10px; font-size: 12px; color: var(--sw13cb-muted); }
#sw13cb .sw13cb-notice { margin: 0 0 10px; font-size: 13px; }
#sw13cb .sw13cb-primary {
  width: 100%; padding: 11px; border: 0; border-radius: 10px;
  background: var(--sw13cb-accent); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
#sw13cb .sw13cb-primary[disabled] { opacity: .6; cursor: default; }
#sw13cb .sw13cb-compose { display: flex; gap: 8px; align-items: flex-end; }
#sw13cb .sw13cb-compose textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; border-radius: 12px; }
#sw13cb .sw13cb-send {
  flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: var(--sw13cb-accent); color: #fff; cursor: pointer; display: grid; place-items: center;
}
#sw13cb .sw13cb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Phones: full-screen panel */
@media (max-width: 480px) {
  #sw13cb { right: 14px; bottom: 14px; }
  #sw13cb .sw13cb-panel {
    position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0;
  }
  #sw13cb.sw13cb-open .sw13cb-launcher { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #sw13cb .sw13cb-panel, #sw13cb .sw13cb-dots i { animation: none; }
  #sw13cb .sw13cb-launcher { transition: none; }
}
