/* Floating help cluster: WhatsApp button + FAQ assistant chat panel.
   Sits bottom-right; lifted above the back-to-top button when a page has one. */
.sw { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040; font-family: inherit; }
.sw.sw-above-btt { bottom: 4.75rem; }
.sw-launchers { display: flex; flex-direction: column; gap: .6rem; align-items: flex-end; }

.sw-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center;
  color: #fff !important; font-size: 1.5rem; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(10, 15, 61, .28); transition: transform .15s ease, box-shadow .15s ease; }
.sw-btn:hover, .sw-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(10, 15, 61, .35); color: #fff !important; }
.sw-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px #6D1FCB; }
.sw-wa { background: #25D366; }
.sw-wa:hover { background: #1EBE5A; }
.sw-chat { background: #6D1FCB; }
.sw-chat:hover { background: #4B0F9E; }
.sw.sw-open .sw-chat { background: #4B0F9E; }

.sw-panel { position: absolute; right: 0; bottom: calc(100% + .75rem); width: min(380px, calc(100vw - 2rem)); height: min(540px, calc(100vh - 8rem));
  display: flex; flex-direction: column; background: #fff; color: #0A0F3D; border-radius: 1rem; overflow: hidden;
  border: 1px solid #ECEAFD; box-shadow: 0 12px 40px rgba(10, 15, 61, .28); }
.sw-panel[hidden] { display: none; }
.sw:not(.sw-above-btt) .sw-panel { bottom: calc(100% + .75rem); }

.sw-head { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; background: linear-gradient(135deg, #6D1FCB, #4B0F9E); color: #fff; }
.sw-head-icon { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sw-head-text { flex: 1 1 auto; min-width: 0; }
.sw-title { margin: 0; font-size: .98rem; font-weight: 700; line-height: 1.2; color: #fff; }
.sw-sub { margin: 0; font-size: .74rem; opacity: .85; }
.sw-close { background: transparent; border: 0; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex: 0 0 auto; }
.sw-close:hover, .sw-close:focus-visible { background: rgba(255, 255, 255, .2); outline: none; }

.sw-messages { flex: 1 1 auto; overflow-y: auto; padding: .9rem; background: #F8F7FE; display: flex; flex-direction: column; gap: .6rem; scroll-behavior: smooth; }
.sw-msg { max-width: 88%; padding: .6rem .8rem; border-radius: .9rem; font-size: .88rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.sw-msg.bot { background: #fff; border: 1px solid #ECEAFD; border-bottom-left-radius: .25rem; align-self: flex-start; }
.sw-msg.user { background: #6D1FCB; color: #fff; border-bottom-right-radius: .25rem; align-self: flex-end; }
.sw-msg.typing { color: #6B6790; font-style: italic; }

.sw-actions { display: flex; flex-direction: column; gap: .4rem; align-self: flex-start; max-width: 92%; }
.sw-link, .sw-handoff { display: inline-flex; align-items: center; gap: .4rem; font-size: .84rem; font-weight: 600; text-decoration: none; padding: .45rem .8rem; border-radius: 2rem; }
.sw-link { color: #4B0F9E; background: #F3ECFE; border: 1px solid #D8C7F5; }
.sw-link:hover { background: #E7D9FA; color: #4B0F9E; }
.sw-handoff { color: #fff !important; background: #25D366; }
.sw-handoff:hover { background: #1EBE5A; }

.sw-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-self: flex-start; max-width: 100%; }
.sw-chip { font-size: .8rem; text-align: left; color: #4B0F9E; background: #fff; border: 1.5px solid #D8D5F7; border-radius: 1rem; padding: .35rem .7rem; cursor: pointer; }
.sw-chip:hover, .sw-chip:focus-visible { border-color: #6D1FCB; background: #F3ECFE; outline: none; }

.sw-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid #ECEAFD; background: #fff; }
.sw-input { flex: 1 1 auto; min-width: 0; border: 1.5px solid #D8D5F7; border-radius: 2rem; padding: .55rem 1rem; font-size: .9rem; }
.sw-input:focus { outline: none; border-color: #6D1FCB; box-shadow: 0 0 0 .2rem rgba(109, 31, 203, .12); }
.sw-send { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #6D1FCB; color: #fff; cursor: pointer; }
.sw-send:hover, .sw-send:focus-visible { background: #4B0F9E; outline: none; }
.sw-send:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 480px) {
  .sw { right: .85rem; bottom: .85rem; }
  .sw.sw-above-btt { bottom: 4.4rem; }
  .sw-btn { width: 48px; height: 48px; font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { .sw-btn, .sw-messages { transition: none; scroll-behavior: auto; } }
@media print { .sw { display: none !important; } }
