.chat-toggle-btn {
  position: absolute; bottom: 14px; left: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: #151515; border: 1px solid #222;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; z-index: 10;
}
.chat-toggle-btn:hover { background: #1e1e1e; transform: scale(1.08); }
.chat-toggle-btn.has-unread {
  animation: chatNotif 0.6s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(37,99,235,0.6);
}
.chat-panel {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 300px; background: #0d0d0d; border-right: 1px solid #1a1a1a;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 120;
}
.chat-panel.open {
  transform: translateX(0);
}
.chat-header {
  padding: 10px 14px; border-bottom: 1px solid #1a1a1a;
  font-size: 12px; font-weight: 700; color: #555;
  text-transform: uppercase; letter-spacing: 2px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.chat-close-btn {
  background: none; border: none; color: #444;
  font-size: 14px; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; transition: all 0.12s;
}
.chat-close-btn:hover { background: #1e1e1e; color: #aaa; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
  scrollbar-width: thin; scrollbar-color: #222 transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: #222; border-radius: 2px; }
.chat-msg {
  font-size: 12px; line-height: 1.4;
  padding: 6px 8px; border-radius: 6px;
  max-width: 100%; word-break: break-word;
  animation: chatMsgIn 0.18s ease both;
}
.chat-msg.mine { background: #172554; color: #93c5fd; align-self: flex-end; }
.chat-msg.theirs { background: #1a0a0a; color: #fca5a5; align-self: flex-start; }
.chat-msg.system { background: transparent; color: #333; align-self: center; font-style: italic; font-size: 11px; }
.chat-msg .chat-msg-name { font-size: 10px; font-weight: 700; margin-bottom: 2px; opacity: 0.6; }
.chat-input-row {
  padding: 8px 10px; border-top: 1px solid #1a1a1a;
  display: flex; gap: 6px; flex-shrink: 0;
}
.chat-input {
  flex: 1; background: #111; border: 1px solid #222; border-radius: 6px;
  color: #ddd; font-size: 12px; padding: 7px 10px;
  outline: none; transition: border-color 0.12s;
}
.chat-input:focus { border-color: #2563eb; }
.chat-input::placeholder { color: #333; }
.chat-send-btn {
  background: #2563eb; border: none; border-radius: 6px;
  color: #fff; font-size: 13px; padding: 7px 12px;
  cursor: pointer; transition: background 0.12s;
}
.chat-send-btn:hover { background: #1d4ed8; }
.chat-rate-limit { font-size: 11px; color: #f59e0b; text-align: center; padding: 4px; display: none; }
.chat-bubble-opp {
  position: absolute;
  top: -8px; left: 60px;
  background: #1a0a0a;
  border: 1px solid #3a1515;
  border-radius: 12px;
  padding: 8px 14px;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 45;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: chatBubbleIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
  transition: opacity 0.3s, transform 0.3s;
}
.chat-bubble-opp::before {
  content: '';
  position: absolute;
  left: -6px; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-style: solid;
  border-width: 6px 6px 6px 0;
  border-color: transparent #1a0a0a transparent transparent;
}

@media (max-width: 768px) {
  .chat-toggle-btn {
    bottom: 80px;
    left: 10px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .chat-panel {
    width: 100%;
    max-width: 280px;
  }
}
