/* ============================================================
   WCSPL — "Workie" Chat Widget
   Uses the host page's --red / --cream / --font-* variables.
============================================================ */
#wc-bot{position:fixed;right:24px;bottom:24px;z-index:2000;font-family:var(--font-b),sans-serif}

#wc-bot-toggle{
  width:64px;height:64px;border-radius:50%;border:none;cursor:pointer;
  background:linear-gradient(135deg,var(--red-mid,#B91C1C),var(--red-deep,#7F1D1D));
  box-shadow:0 12px 32px rgba(155,28,28,.4),0 0 0 0 rgba(155,28,28,.5);
  display:flex;align-items:center;justify-content:center;position:relative;
  animation:wcPulse 2.6s ease-in-out infinite;
  transition:transform .25s var(--ease,ease);
}
#wc-bot-toggle:hover{transform:scale(1.07)}
#wc-bot-toggle svg{width:30px;height:30px;stroke:#fff;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:opacity .2s,transform .2s}
#wc-bot-toggle .wc-close-ico{position:absolute;opacity:0;transform:rotate(-45deg) scale(.6)}
#wc-bot.open #wc-bot-toggle .wc-chat-ico{opacity:0;transform:rotate(45deg) scale(.6)}
#wc-bot.open #wc-bot-toggle .wc-close-ico{opacity:1;transform:rotate(0) scale(1)}
@keyframes wcPulse{0%,100%{box-shadow:0 12px 32px rgba(155,28,28,.4),0 0 0 0 rgba(155,28,28,.35)}50%{box-shadow:0 12px 32px rgba(155,28,28,.4),0 0 0 12px rgba(155,28,28,0)}}

#wc-bot-dot{position:absolute;top:2px;right:2px;width:14px;height:14px;border-radius:50%;background:var(--gold,#C9922A);border:2px solid #fff;animation:wcBlink 2s ease-in-out infinite}
@keyframes wcBlink{0%,100%{transform:scale(1)}50%{transform:scale(1.25)}}

#wc-bot-tip{
  position:absolute;bottom:76px;right:0;background:#fff;color:var(--ink,#1A0505);
  padding:10px 16px;border-radius:12px;font-size:.82rem;font-weight:500;white-space:nowrap;
  box-shadow:0 10px 30px rgba(0,0,0,.14);opacity:0;transform:translateY(6px);
  animation:wcTipIn .5s ease 2.4s forwards, wcTipOut .5s ease 7.4s forwards;
  pointer-events:none;
}
#wc-bot-tip::after{content:'';position:absolute;bottom:-6px;right:26px;width:12px;height:12px;background:#fff;transform:rotate(45deg)}
@keyframes wcTipIn{to{opacity:1;transform:translateY(0)}}
@keyframes wcTipOut{to{opacity:0;transform:translateY(6px)}}
#wc-bot.open #wc-bot-tip{display:none}

#wc-panel{
  position:absolute;bottom:80px;right:0;width:360px;max-width:calc(100vw - 32px);
  height:520px;max-height:70vh;background:var(--cream,#FBF8F5);
  border-radius:20px;box-shadow:0 30px 80px rgba(26,5,5,.28);
  border:1px solid rgba(155,28,28,.1);
  display:flex;flex-direction:column;overflow:hidden;
  opacity:0;transform:translateY(16px) scale(.96);pointer-events:none;
  transition:opacity .3s var(--ease,ease),transform .3s var(--ease,ease);
}
#wc-bot.open #wc-panel{opacity:1;transform:none;pointer-events:auto}

#wc-panel-head{
  background:linear-gradient(135deg,#7F1D1D,#9B1C1C 55%,#5C0A0A);
  padding:18px 20px;display:flex;align-items:center;gap:12px;color:#fff;flex-shrink:0;position:relative;overflow:hidden;
}
#wc-panel-head::before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at 80% 0%,rgba(201,146,42,.25),transparent 60%)}
#wc-avatar{
  width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.15);
  display:flex;align-items:center;justify-content:center;font-size:1.3rem;flex-shrink:0;position:relative;z-index:1;
  border:1.5px solid rgba(255,255,255,.3);
}
#wc-panel-head-text{position:relative;z-index:1;line-height:1.3}
#wc-panel-head-text .name{font-weight:600;font-size:.95rem}
#wc-panel-head-text .status{font-size:.72rem;color:rgba(255,255,255,.7);display:flex;align-items:center;gap:5px}
#wc-panel-head-text .status::before{content:'';width:7px;height:7px;border-radius:50%;background:#4ADE80;box-shadow:0 0 0 2px rgba(74,222,128,.25)}

#wc-body{flex:1;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
#wc-body::-webkit-scrollbar{width:4px}
#wc-body::-webkit-scrollbar-thumb{background:rgba(155,28,28,.25);border-radius:4px}

.wc-row{display:flex;gap:8px;max-width:100%;animation:wcMsgIn .35s var(--ease,ease)}
@keyframes wcMsgIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.wc-row.user{justify-content:flex-end}
.wc-bubble{
  padding:11px 15px;border-radius:15px;font-size:.86rem;line-height:1.55;max-width:82%;
}
.wc-row.bot .wc-bubble{background:#fff;color:var(--ink,#1A0505);border-bottom-left-radius:4px;box-shadow:0 3px 12px rgba(26,5,5,.06)}
.wc-row.user .wc-bubble{background:var(--red,#9B1C1C);color:#fff;border-bottom-right-radius:4px}
.wc-bubble a{color:var(--red,#9B1C1C);font-weight:600;text-decoration:underline}
.wc-row.user .wc-bubble a{color:#fff}

.wc-typing{display:flex;gap:4px;padding:13px 16px;background:#fff;border-radius:15px;border-bottom-left-radius:4px;width:fit-content;box-shadow:0 3px 12px rgba(26,5,5,.06)}
.wc-typing span{width:6px;height:6px;border-radius:50%;background:var(--light-mid,#9B7777);animation:wcTypeDot 1.1s ease-in-out infinite}
.wc-typing span:nth-child(2){animation-delay:.15s}
.wc-typing span:nth-child(3){animation-delay:.3s}
@keyframes wcTypeDot{0%,60%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-4px);opacity:1}}

.wc-opts{display:flex;flex-direction:column;gap:8px;margin-top:2px}
.wc-opt{
  text-align:left;background:#fff;border:1.5px solid rgba(155,28,28,.15);
  color:var(--red-deep,#7F1D1D);padding:10px 14px;border-radius:12px;
  font-size:.83rem;font-weight:600;cursor:pointer;transition:.2s;font-family:inherit;
}
.wc-opt:hover{background:var(--red,#9B1C1C);color:#fff;border-color:var(--red,#9B1C1C);transform:translateX(2px)}

.wc-contact-card{
  background:#fff;border:1.5px solid rgba(155,28,28,.15);border-radius:14px;padding:14px;
  display:flex;flex-direction:column;gap:10px;margin-top:2px;
}
.wc-contact-row{display:flex;align-items:center;gap:10px;font-size:.83rem;color:var(--mid,#6B4848);text-decoration:none;font-weight:600;transition:color .2s}
.wc-contact-row:hover{color:var(--red,#9B1C1C)}
.wc-contact-row .ico{width:32px;height:32px;border-radius:9px;background:var(--red-pale,#FEF2F2);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.wc-contact-row .ico svg{width:16px;height:16px;stroke:var(--red,#9B1C1C);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

#wc-footer{padding:12px 14px;border-top:1px solid rgba(155,28,28,.08);background:#fff;flex-shrink:0}
#wc-quick{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px}
#wc-quick button{
  flex-shrink:0;background:var(--cream-dk,#F3EDE8);border:none;color:var(--red-deep,#7F1D1D);
  padding:7px 13px;border-radius:20px;font-size:.75rem;font-weight:600;cursor:pointer;transition:.2s;font-family:inherit;
}
#wc-quick button:hover{background:var(--red,#9B1C1C);color:#fff}

@media(max-width:480px){
  #wc-bot{right:16px;bottom:16px}
  #wc-panel{width:calc(100vw - 24px);right:-8px;height:66vh}
  #wc-bot-toggle{width:58px;height:58px}
}
