.penny-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9990;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #2356d7, #1391aa);
  color: #fff;
  box-shadow: 0 8px 24px rgba(35, 86, 215, 0.45);
  font-size: 1.35rem;
  cursor: pointer;
}
.penny-chat-launcher .badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 50%;
}
.penny-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5rem;
  z-index: 9989;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - 7rem));
  display: none;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.penny-chat-panel.open {
  display: flex;
}
.penny-chat-head {
  background: linear-gradient(135deg, #2356d7, #1e40af);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.penny-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  min-height: 200px;
}
.penny-chat-foot {
  padding: 0.75rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.penny-chat-foot .row-input {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.penny-chat-foot .row-input .form-control {
  flex: 1;
  min-width: 0;
}
.penny-chat-attach {
  display: block;
  color: inherit;
  text-decoration: none;
}
.penny-chat-attach-image img {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  margin-bottom: 0.25rem;
}
.penny-chat-attach-name {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  word-break: break-word;
}
.penny-chat-attach-file {
  font-weight: 500;
}
.penny-chat-attach-file .fa-file-pdf {
  color: #dc2626;
  margin-right: 0.25rem;
}
.penny-chat-msg {
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  font-size: 0.875rem;
  max-width: 90%;
}
.penny-chat-msg.me {
  margin-left: auto;
  background: #2356d7;
  color: #fff;
}
.penny-chat-msg.them,
.penny-chat-msg.system {
  background: #fff;
  border: 1px solid #e2e8f0;
}
.penny-chat-msg.system {
  font-size: 0.8rem;
  color: #64748b;
  font-style: italic;
}
.penny-chat-offline {
  padding: 2rem 1rem;
  text-align: center;
  color: #64748b;
}
.penny-chat-offline-hint {
  line-height: 1.4;
  margin: 0;
}
.penny-chat-foot input:disabled {
  opacity: 1;
  background: #fff;
}
.penny-chat-typing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.5rem;
  padding: 0.4rem 0.65rem;
  max-width: 90%;
  font-size: 0.8rem;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.penny-chat-typing.d-none {
  display: none !important;
}
.penny-chat-typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.penny-chat-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: penny-chat-typing-bounce 1.2s infinite ease-in-out;
}
.penny-chat-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.penny-chat-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes penny-chat-typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
