/* ============================================================
   Sunny — A Geek & His Camera chat widget (ported from ECW, recolored).
   Mounts only when /api/chat reports configured:true.
   ============================================================ */
#ecwc,#ecwc *{box-sizing:border-box}
#ecwc{position:fixed;right:22px;bottom:22px;z-index:400;font-family:'Instrument Sans',system-ui,sans-serif}

/* launcher */
#ecwc-btn{display:flex;align-items:center;gap:10px;border:1.5px solid #231F1A;
  background:rgba(255,251,245,.95);backdrop-filter:blur(12px);color:#231F1A;
  border-radius:100px;padding:12px 18px 12px 14px;cursor:pointer;box-shadow:0 14px 40px rgba(60,40,10,.18);
  transition:transform .3s cubic-bezier(.19,1,.22,1),border-color .3s,box-shadow .3s}
#ecwc-btn:hover{transform:translateY(-2px);border-color:#FF8A3D;box-shadow:0 20px 50px rgba(60,40,10,.25)}
#ecwc-btn .dot{width:9px;height:9px;border-radius:50%;background:#FF8A3D;flex-shrink:0;
  box-shadow:0 0 0 0 rgba(201,169,97,.6);animation:ecwc-pulse 2.6s ease-out infinite}
#ecwc-btn .lbl{font-size:14px;font-weight:500;letter-spacing:.01em}
@keyframes ecwc-pulse{0%{box-shadow:0 0 0 0 rgba(201,169,97,.5)}70%{box-shadow:0 0 0 10px rgba(201,169,97,0)}100%{box-shadow:0 0 0 0 rgba(201,169,97,0)}}

/* first-visit nudge */
#ecwc-nudge{position:absolute;right:0;bottom:64px;width:250px;background:#FFFFFF;
  border:1.5px solid #231F1A;border-radius:14px;padding:14px 16px;
  box-shadow:0 18px 44px rgba(60,40,10,.18);color:#6E6659;font-size:13.5px;line-height:1.45;
  transform-origin:bottom right;animation:ecwc-pop .4s cubic-bezier(.19,1,.22,1)}
#ecwc-nudge b{color:#231F1A;font-weight:600}
#ecwc-nudge .x{position:absolute;top:8px;right:10px;color:#6E6659;cursor:pointer;font-size:15px;line-height:1;border:none;background:none;padding:2px}
@keyframes ecwc-pop{from{opacity:0;transform:scale(.9) translateY(6px)}to{opacity:1;transform:none}}

/* panel */
#ecwc-panel{position:absolute;right:0;bottom:0;width:380px;max-width:calc(100vw - 44px);height:560px;max-height:calc(100vh - 120px);
  display:none;flex-direction:column;overflow:hidden;border:1px solid var(--line,rgba(242,237,226,.1));
  border-radius:20px;background:#FFFBF5;backdrop-filter:blur(18px);box-shadow:0 30px 70px rgba(60,40,10,.25)}
#ecwc.open #ecwc-panel{display:flex;animation:ecwc-rise .34s cubic-bezier(.19,1,.22,1)}
#ecwc.open #ecwc-btn,#ecwc.open #ecwc-nudge{display:none}
@keyframes ecwc-rise{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}

#ecwc-head{display:flex;align-items:center;gap:12px;padding:18px 20px;border-bottom:1px solid var(--line,rgba(242,237,226,.1));flex-shrink:0}
#ecwc-head .av{width:34px;height:34px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;
  background:radial-gradient(circle at 35% 30%,#FFC46B,#FF8A3D);color:#fff;font-weight:700;font-size:15px;font-family:'Bricolage Grotesque',sans-serif}
#ecwc-head .t{flex:1;min-width:0}
#ecwc-head .t b{display:block;font-family:'Bricolage Grotesque',sans-serif;font-weight:500;font-size:15px;color:#231F1A}
#ecwc-head .t span{font-size:11.5px;color:#6E6659;display:flex;align-items:center;gap:6px}
#ecwc-head .t span::before{content:"";width:6px;height:6px;border-radius:50%;background:#3FAE7C}
#ecwc-close{border:none;background:none;color:#6E6659;font-size:22px;line-height:1;cursor:pointer;padding:4px 6px;border-radius:8px;transition:.2s}
#ecwc-close:hover{color:#231F1A;background:#FFF4E6}

#ecwc-log{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:14px;scrollbar-width:thin}
#ecwc-log::-webkit-scrollbar{width:6px}#ecwc-log::-webkit-scrollbar-thumb{background:rgba(35,31,26,.15);border-radius:3px}
.ecwc-msg{max-width:86%;font-size:14px;line-height:1.5;padding:11px 15px;border-radius:14px;white-space:pre-wrap;word-wrap:break-word}
.ecwc-msg.bot{align-self:flex-start;background:#FFF4E6;color:#3A342B;border-bottom-left-radius:4px}
.ecwc-msg.me{align-self:flex-end;background:#FF8A3D;color:#fff;font-weight:500;border-bottom-right-radius:4px}
.ecwc-msg a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.ecwc-msg.bot a{color:#FF8A3D}
.ecwc-typing{align-self:flex-start;display:flex;gap:4px;padding:14px 16px;background:#FFF4E6;border-radius:14px;border-bottom-left-radius:4px}
.ecwc-typing i{width:6px;height:6px;border-radius:50%;background:#6E6659;animation:ecwc-blink 1.2s infinite both}
.ecwc-typing i:nth-child(2){animation-delay:.2s}.ecwc-typing i:nth-child(3){animation-delay:.4s}
@keyframes ecwc-blink{0%,80%,100%{opacity:.3}40%{opacity:1}}

#ecwc-chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 20px 4px}
.ecwc-chip{border:1.5px solid #231F1A;background:transparent;color:#6E6659;
  font-size:12.5px;font-family:inherit;padding:8px 13px;border-radius:100px;cursor:pointer;transition:.2s}
.ecwc-chip:hover{color:#231F1A;border-color:#FF8A3D;background:rgba(255,138,61,.1)}

#ecwc-form{display:flex;gap:8px;padding:14px 16px;border-top:1px solid var(--line,rgba(242,237,226,.1));flex-shrink:0}
#ecwc-in{flex:1;background:#fff;border:1px solid rgba(35,31,26,.15);border-radius:100px;
  padding:12px 16px;color:#231F1A;font-size:14px;font-family:inherit;resize:none;max-height:100px;line-height:1.4}
#ecwc-in:focus{outline:none;border-color:#FF8A3D}
#ecwc-in::placeholder{color:#6E6659}
#ecwc-send{flex-shrink:0;width:44px;border:none;border-radius:50%;background:#FF8A3D;color:#fff;
  cursor:pointer;font-size:18px;transition:.2s;display:flex;align-items:center;justify-content:center}
#ecwc-send:hover{filter:brightness(1.08)}
#ecwc-send:disabled{opacity:.4;cursor:default}
#ecwc-foot{text-align:center;font-size:10.5px;color:#6E6659;padding:0 0 10px}

@media (max-width:520px){
  #ecwc{right:14px;bottom:14px}
  #ecwc-panel{width:calc(100vw - 28px);height:calc(100vh - 90px)}
}
@media (prefers-reduced-motion:reduce){
  #ecwc-btn .dot{animation:none}
  #ecwc.open #ecwc-panel,#ecwc-nudge{animation:none}
  #ecwc-btn:hover{transform:none}
}
