.floating-controls{
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.fab{
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px -12px rgba(43,38,34,0.5);
  transition: transform 0.15s ease;
}
.fab:hover{ transform: scale(1.05); }

.fab-whatsapp{ background: #25D366; }
.fab-chat{ background: var(--ink); position: relative; }
.fab-chat .icon-close{ position: absolute; opacity: 0; transform: rotate(-90deg) scale(0.6); }
.fab-chat.is-open .icon-open{ opacity: 0; transform: rotate(90deg) scale(0.6); }
.fab-chat.is-open .icon-close{ opacity: 1; transform: rotate(0) scale(1); }
.fab-chat svg{ transition: opacity 0.15s ease, transform 0.15s ease; }

.chat-panel{
  position: fixed;
  bottom: 90px;
  right: 22px;
  width: 368px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: 0 30px 70px -28px rgba(43,38,34,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 95;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.chat-panel.is-open{ opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.chat-panel-header{
  padding: 16px 18px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-panel-header .mark{
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--stone);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; color: var(--ink);
  flex-shrink: 0;
}
.chat-panel-header .title{ font-size: 14px; font-weight: 500; }
.chat-panel-header .subtitle{ font-size: 11.5px; opacity: 0.7; }
.chat-panel-close{
  margin-left: auto;
  background: none; border: none; color: var(--paper); cursor: pointer;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
}

.chat-messages{
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 380px;
  overflow-y: auto;
  background: var(--paper);
}
.chat-msg{
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.chat-msg.bot{ align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.chat-msg.user{ align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.chat-msg.typing{ align-self: flex-start; display: flex; gap: 4px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg.typing span{ width: 6px; height: 6px; border-radius: 50%; background: var(--taupe); opacity: 0.5; animation: chatBounce 1.1s infinite; }
.chat-msg.typing span:nth-child(2){ animation-delay: 0.15s; }
.chat-msg.typing span:nth-child(3){ animation-delay: 0.3s; }
@keyframes chatBounce{ 0%,60%,100%{ transform: translateY(0); opacity: 0.5; } 30%{ transform: translateY(-4px); opacity: 1; } }

.chat-composer{
  border-top: 1px solid var(--line);
  padding: 12px;
  display: flex;
  gap: 8px;
  background: var(--card);
}
.chat-composer input{
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
}
.chat-composer input:focus{ outline: none; border-color: var(--clay); }
.chat-composer button{
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--ink); color: var(--paper); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-composer button:disabled{ opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px){
  .chat-panel{ right: 16px; bottom: 84px; width: calc(100vw - 32px); }
  .floating-controls{ right: 16px; bottom: 16px; }
}
