/* Wecdew Assistant - front-end widget */
#wcda-root { --wcda-p:#1a8fff; --wcda-pd:#0b63c9; --wcda-a:#6aa600; --wcda-ink:#1c2333; --wcda-mut:#5a6275; --wcda-line:#d3e4f7; --wcda-soft:#eaf4ff; --wcda-wa:#1b7f35;
  --wcda-bottom:20px; --wcda-side:20px;
  position: fixed; right: var(--wcda-side); bottom: var(--wcda-bottom); z-index: 2147483000; font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--wcda-ink); text-align: left; }
#wcda-root.wcda-pos-left { right: auto; left: var(--wcda-side); }
#wcda-root * { box-sizing: border-box; }
#wcda-root button { font-family: inherit; margin: 0; text-transform: none; letter-spacing: normal; line-height: 1.3; min-height: 0; }

/* launcher */
#wcda-root .wcda-launch { width: 62px; height: 62px; padding: 0; border-radius: 50%; border: 0; cursor: pointer; background: linear-gradient(135deg, var(--wcda-pd), var(--wcda-p)); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(0,0,0,.25); transition: transform .2s ease; position: relative; margin-left: auto; }
#wcda-root.wcda-pos-left .wcda-launch { margin-left: 0; }
#wcda-root .wcda-launch:hover { transform: scale(1.07); }
#wcda-root .wcda-launch svg { width: 28px; height: 28px; fill: #fff; transition: transform .25s ease, opacity .2s ease; position: absolute; }
#wcda-root .wcda-launch .wcda-ic-close { opacity: 0; transform: rotate(-90deg); }
#wcda-root.wcda-open .wcda-launch .wcda-ic-chat { opacity: 0; transform: rotate(90deg); }
#wcda-root.wcda-open .wcda-launch .wcda-ic-close { opacity: 1; transform: none; }
.wcda-dot { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--wcda-a); border: 3px solid #fff; animation: wcdaPulse 2.2s infinite; }
#wcda-root.wcda-seen .wcda-dot { display: none; }
@keyframes wcdaPulse { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,.25); } 70% { box-shadow: 0 0 0 12px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }

/* teaser */
.wcda-teaser { position: absolute; right: 0; bottom: 76px; width: 270px; background: #fff; border-radius: 14px; padding: 14px 34px 14px 16px; box-shadow: 0 12px 32px rgba(20,40,80,.22);
  border: 1px solid var(--wcda-line); cursor: pointer; opacity: 0; transform: translateY(10px) scale(.96); transform-origin: bottom right; pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.wcda-pos-left .wcda-teaser { right: auto; left: 0; transform-origin: bottom left; }
.wcda-teaser.wcda-show { opacity: 1; transform: none; pointer-events: auto; }
.wcda-teaser::after { content: ""; position: absolute; right: 24px; bottom: -7px; width: 14px; height: 14px; background: #fff; border-right: 1px solid var(--wcda-line); border-bottom: 1px solid var(--wcda-line); transform: rotate(45deg); }
.wcda-pos-left .wcda-teaser::after { right: auto; left: 24px; }
.wcda-teaser strong { display: block; margin-bottom: 2px; color: var(--wcda-ink); }
.wcda-teaser span { color: var(--wcda-mut); font-size: 14px; }
#wcda-root .wcda-teaser-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--wcda-mut); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 50%; }
#wcda-root .wcda-teaser-x:hover { background: var(--wcda-soft); }

/* panel */
.wcda-panel { position: absolute; right: 0; bottom: 76px; width: 370px; height: min(580px, calc(100vh - 100px - var(--wcda-bottom))); background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(20,40,80,.28); display: flex; flex-direction: column; opacity: 0; transform: translateY(16px) scale(.97); transform-origin: bottom right;
  pointer-events: none; visibility: hidden; transition: opacity .25s ease, transform .25s ease, visibility 0s .25s; }
.wcda-pos-left .wcda-panel { right: auto; left: 0; transform-origin: bottom left; }
#wcda-root.wcda-open .wcda-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .25s ease, transform .25s ease; }
.wcda-head { background: linear-gradient(135deg, var(--wcda-pd), var(--wcda-p)); color: #fff; padding: 16px 16px 16px 18px; display: flex; align-items: center; gap: 12px; }
.wcda-avatar { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex: none; position: relative; color: #fff; }
.wcda-avatar::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: #8bd33a; border: 2px solid var(--wcda-pd); }
.wcda-head-t { flex: 1; min-width: 0; }
.wcda-head-t strong { display: block; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcda-head-t span { font-size: 13px; opacity: .9; color: #fff; }
#wcda-root .wcda-hbtn { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
#wcda-root .wcda-hbtn:hover { background: rgba(255,255,255,.28); }
.wcda-hbtn svg { width: 17px; height: 17px; fill: #fff; }

.wcda-body { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: #f5f8fc; }
.wcda-msg { display: flex; margin-bottom: 10px; animation: wcdaIn .3s ease both; }
@keyframes wcdaIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wcda-bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.wcda-bot .wcda-bubble { background: #fff; border: 1px solid var(--wcda-line); border-bottom-left-radius: 5px; color: var(--wcda-ink); }
.wcda-user { justify-content: flex-end; }
.wcda-user .wcda-bubble { background: var(--wcda-pd); color: #fff; border-bottom-right-radius: 5px; }
.wcda-typing .wcda-bubble { display: flex; gap: 4px; padding: 14px; }
.wcda-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9db6d3; animation: wcdaDot 1s infinite; }
.wcda-typing i:nth-child(2) { animation-delay: .15s; } .wcda-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes wcdaDot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.wcda-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; animation: wcdaIn .3s ease both; }
#wcda-root .wcda-opt { display: inline-block; border: 1.5px solid var(--wcda-p); background: #fff; color: var(--wcda-pd); border-radius: 20px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .15s ease, color .15s ease; line-height: 1.3; box-shadow: none; }
#wcda-root .wcda-opt:hover { background: var(--wcda-p); color: #fff; }
#wcda-root .wcda-opt.wcda-primary { background: var(--wcda-a); border-color: var(--wcda-a); color: #fff; }
#wcda-root .wcda-opt.wcda-primary:hover { filter: brightness(.9); }
#wcda-root .wcda-opt.wcda-whatsapp { border-color: #25a244; color: var(--wcda-wa); }
#wcda-root .wcda-opt.wcda-whatsapp:hover { background: #25a244; color: #fff; }
#wcda-root .wcda-opt.wcda-subtle { border-color: var(--wcda-line); color: var(--wcda-mut); }
#wcda-root .wcda-opt.wcda-subtle:hover { background: var(--wcda-soft); color: var(--wcda-ink); }
.wcda-opts.wcda-used button.wcda-opt { opacity: .45; pointer-events: none; }

.wcda-foot { border-top: 1px solid var(--wcda-line); padding: 10px; display: flex; gap: 8px; background: #fff; margin: 0; }
#wcda-root .wcda-foot input { flex: 1; min-width: 0; height: 42px; margin: 0; border: 1px solid var(--wcda-line); border-radius: 22px; padding: 10px 14px; font-size: 15px; font-family: inherit; color: var(--wcda-ink); background: #fff; outline: none; box-shadow: none; }
#wcda-root .wcda-foot input:focus { border-color: var(--wcda-p); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
#wcda-root .wcda-send { width: 42px; height: 42px; padding: 0; border-radius: 50%; border: 0; background: var(--wcda-a); cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
#wcda-root .wcda-send:hover { filter: brightness(.9); }
.wcda-send svg { width: 18px; height: 18px; fill: #fff; }
.wcda-note { font-size: 11.5px; color: var(--wcda-mut); text-align: center; padding: 0 12px 8px; background: #fff; }
.wcda-note:empty { display: none; }
.wcda-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 480px) {
  #wcda-root { right: min(var(--wcda-side), 14px); }
  #wcda-root.wcda-pos-left { left: min(var(--wcda-side), 14px); }
  .wcda-panel, .wcda-pos-left .wcda-panel { position: fixed; right: 8px; left: 8px; bottom: calc(var(--wcda-bottom) + 72px); width: auto; height: calc(100vh - 96px - var(--wcda-bottom)); height: calc(100dvh - 96px - var(--wcda-bottom)); }
  .wcda-teaser { width: min(270px, calc(100vw - 40px)); }
  #wcda-root.wcda-no-mobile-teaser .wcda-teaser { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #wcda-root *, #wcda-root *::before, #wcda-root *::after { animation: none !important; transition: none !important; }
}
