:root{
  --imk-navy:#0F172A;
  --imk-teal:#0F766E;
  --imk-gold:#D4A017;
  --imk-cream:#F8F9FA;
  --imk-ink:#111827;
}

#imk-chat-bubble{
  position:fixed;bottom:150px;right:20px;width:60px;height:60px;border-radius:50%;
  border:3px solid var(--imk-teal);background:var(--imk-teal) center/cover no-repeat;
  cursor:pointer;z-index:99998;padding:0;box-shadow:0 6px 18px rgba(0,0,0,.22);
  transition:box-shadow .2s ease,bottom .2s ease;
}
/* IMK has a sticky estimate bar WhatsAppButton.astro doesn't have on IMB, which
   pushes the WhatsApp fab up to bottom:128px/64px (vs IMB's 80px/24px) — raise
   Amy by the same delta so she keeps IMB's original ~70-72px clearance above it. */
body.has-sticky-estimate-bar #imk-chat-bubble{
  bottom:198px;
}
#imk-chat-bubble img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block;}
#imk-chat-bubble:hover,#imk-chat-bubble:focus-visible{
  box-shadow:0 6px 18px rgba(0,0,0,.22),0 0 0 4px rgba(212,160,23,.5);outline:none;
}
#imk-chat-bubble.imk-bounce{animation:imk-bounce .6s ease 2;}
@keyframes imk-bounce{
  0%,100%{transform:translateY(0);}
  20%{transform:translateY(-10px);}
  40%{transform:translateY(0);}
  60%{transform:translateY(-6px);}
  80%{transform:translateY(0);}
}
@media (min-width:768px){
  #imk-chat-bubble{bottom:96px;right:24px;}
  body.has-sticky-estimate-bar #imk-chat-bubble{bottom:136px;}
}
@media (prefers-reduced-motion:reduce){
  #imk-chat-bubble.imk-bounce{animation:none;}
}

#imk-chat-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:99999;
  display:flex;align-items:center;justify-content:center;
  opacity:0;pointer-events:none;transition:opacity .15s ease;
}
#imk-chat-overlay.imk-open{opacity:1;pointer-events:auto;}

#imk-chat-modal{
  width:420px;max-width:calc(100vw - 24px);max-height:640px;height:min(640px,80vh);
  background:#fff;border-radius:16px;overflow:hidden;display:flex;flex-direction:column;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
  transform:scale(.94);opacity:0;transition:transform .15s ease,opacity .15s ease;
  font-family:'Inter',ui-sans-serif,system-ui,sans-serif;
}
#imk-chat-overlay.imk-open #imk-chat-modal{transform:scale(1);opacity:1;}

@media (max-width:480px){
  #imk-chat-modal{width:calc(100vw - 24px);height:min(640px,85vh);}
}

#imk-chat-header{
  display:flex;align-items:center;gap:.7rem;padding:.9rem 1rem;background:var(--imk-navy);
  color:#fff;border-bottom:3px solid var(--imk-gold);flex-shrink:0;position:relative;
}
#imk-chat-header img{width:40px;height:40px;border-radius:50%;object-fit:cover;flex-shrink:0;}
#imk-chat-header-text{display:flex;flex-direction:column;line-height:1.25;}
#imk-chat-header-text strong{font-size:.95rem;font-weight:600;}
#imk-chat-header-text span{font-size:.75rem;color:rgba(248,249,250,.75);}
#imk-chat-details-btn{
  margin-left:auto;background:transparent;border:1px solid rgba(255,255,255,.4);color:#fff;
  font-size:.7rem;border-radius:999px;padding:.25rem .6rem;cursor:pointer;
}
#imk-chat-close{
  background:transparent;border:0;color:#fff;font-size:1.3rem;line-height:1;
  cursor:pointer;padding:.25rem .5rem;opacity:.85;
}
#imk-chat-close:hover{opacity:1;}

#imk-chat-messages{
  flex:1;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.6rem;
  background:var(--imk-cream);
}
.imk-msg{max-width:82%;padding:.55rem .8rem;border-radius:14px;font-size:.88rem;line-height:1.45;
  word-wrap:break-word;white-space:pre-wrap;}
.imk-msg-agent{align-self:flex-start;background:#e9e6e0;color:var(--imk-ink);border-bottom-left-radius:4px;}
.imk-msg-user{align-self:flex-end;background:var(--imk-navy);color:#fff;border-bottom-right-radius:4px;}

.imk-typing{align-self:flex-start;display:flex;gap:4px;padding:.6rem .8rem;background:#e9e6e0;
  border-radius:14px;border-bottom-left-radius:4px;}
.imk-typing span{width:6px;height:6px;border-radius:50%;background:#8a8a86;animation:imk-typing 1s infinite ease-in-out;}
.imk-typing span:nth-child(2){animation-delay:.15s;}
.imk-typing span:nth-child(3){animation-delay:.3s;}
@keyframes imk-typing{0%,60%,100%{transform:translateY(0);opacity:.5;}30%{transform:translateY(-4px);opacity:1;}}

#imk-chat-lead-form{
  display:flex;flex-direction:column;gap:.5rem;padding:.75rem;border-top:1px solid #e5e7eb;background:#fff;flex-shrink:0;
}
#imk-chat-lead-form.imk-hidden{display:none;}
#imk-chat-lead-form input{
  border:1px solid #d9cfbf;border-radius:10px;padding:.55rem .7rem;font-size:.85rem;font-family:inherit;outline:none;
}
#imk-chat-lead-form input:focus{border-color:var(--imk-gold);}
#imk-chat-lead-form button{
  background:var(--imk-teal);color:#fff;border:0;border-radius:10px;padding:.55rem;
  font-weight:600;font-size:.85rem;cursor:pointer;
}

#imk-chat-form{
  display:flex;gap:.5rem;padding:.75rem;border-top:1px solid #e2dccf;background:#fff;flex-shrink:0;
}
#imk-chat-input{
  flex:1;border:1px solid #d9cfbf;border-radius:10px;padding:.6rem .75rem;font-size:.88rem;
  font-family:inherit;outline:none;
}
#imk-chat-input:focus{border-color:var(--imk-gold);}
#imk-chat-send{
  background:var(--imk-gold);color:#1f2421;border:0;border-radius:10px;padding:0 1rem;
  font-weight:600;font-size:.88rem;cursor:pointer;flex-shrink:0;
}
#imk-chat-send:hover{opacity:.92;}
#imk-chat-send:disabled{opacity:.5;cursor:not-allowed;}
