/* ==========================================================================
   EstateLenz Chat Assistant Widget
   ========================================================================== */

.el-chat-fab{
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 199;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(21,20,15,0.28);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  border: none;
  cursor: pointer;
}
.el-chat-fab:hover{ transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 28px rgba(21,20,15,0.34); }
.el-chat-fab svg{ width: 26px; height: 26px; stroke: var(--paper); fill: none; stroke-width: 1.8; }
.el-chat-fab .el-chat-dot{
  position: absolute; top: -2px; right: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brass-bright);
  border: 2px solid var(--paper);
}
.el-chat-fab.el-chat-open svg.el-chat-icon-open{ display: none; }
.el-chat-fab:not(.el-chat-open) svg.el-chat-icon-close{ display: none; }

.el-chat-panel{
  position: fixed;
  right: 24px;
  bottom: 164px;
  z-index: 199;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 210px);
  background: var(--paper);
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(21,20,15,0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.el-chat-panel.el-chat-open{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.el-chat-head{
  background: var(--ink);
  color: var(--paper);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.el-chat-head-avatar{
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brass);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 15px;
  flex-shrink: 0;
}
.el-chat-head-text h4{ font-family: var(--display); font-size: 14.5px; font-weight: 500; margin: 0; }
.el-chat-head-text span{ font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: rgba(246,244,238,0.6); }

.el-chat-body{
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
}
.el-chat-msg{
  max-width: 84%;
  font-size: 13.5px;
  line-height: 1.55;
  padding: 10px 13px;
  border-radius: 12px;
  white-space: pre-wrap;
}
.el-chat-msg.el-chat-bot{
  align-self: flex-start;
  background: var(--paper-dim);
  color: var(--ink);
  border-bottom-left-radius: 3px;
}
.el-chat-msg.el-chat-user{
  align-self: flex-end;
  background: var(--ink);
  color: var(--paper);
  border-bottom-right-radius: 3px;
}
.el-chat-msg.el-chat-typing{
  align-self: flex-start;
  background: var(--paper-dim);
  padding: 12px 14px;
  display: flex; gap: 4px;
}
.el-chat-msg.el-chat-typing span{
  width: 6px; height: 6px; border-radius: 50%; background: var(--stone);
  animation: elChatBounce 1.2s infinite ease-in-out;
}
.el-chat-msg.el-chat-typing span:nth-child(2){ animation-delay: .15s; }
.el-chat-msg.el-chat-typing span:nth-child(3){ animation-delay: .3s; }
@keyframes elChatBounce{ 0%,60%,100%{ transform: translateY(0); opacity:.5; } 30%{ transform: translateY(-4px); opacity:1; } }

.el-chat-suggestions{
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.el-chat-chip{
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em;
  padding: 6px 11px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.el-chat-chip:hover{ background: var(--ink); color: var(--paper); }

.el-chat-form{
  display: flex; align-items: center; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
}
.el-chat-input{
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  padding: 10px 15px;
  font-family: var(--body);
  font-size: 13.5px;
  outline: none;
  background: #fff;
}
.el-chat-input:focus{ border-color: var(--brass); }
.el-chat-send{
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ink);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .2s var(--ease);
}
.el-chat-send:disabled{ opacity: .4; cursor: default; }
.el-chat-send svg{ width: 16px; height: 16px; stroke: var(--paper); fill: none; stroke-width: 2; }

.el-chat-foot-note{
  font-size: 10.5px;
  color: var(--stone);
  text-align: center;
  padding: 0 12px 10px;
  flex-shrink: 0;
}
.el-chat-foot-note a{ color: var(--ink-soft); }

@media (max-width: 700px){
  .el-chat-fab{ right: 16px; bottom: 82px; width: 50px; height: 50px; }
  .el-chat-panel{
    right: 12px; left: 12px; width: auto;
    bottom: 142px;
    height: 62vh;
    max-height: none;
  }
}
