.lc-chat-root {
  position: fixed;
  bottom: 18px;
  z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.lc-chat-root.lc-left { left: 22px; }
.lc-chat-root.lc-right { right: 22px; }

.lc-chat-toggle {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 2px solid #22c55e;
  background: #16a34a;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55), 0 12px 24px rgba(2, 6, 23, 0.24);
  animation: lcPulse 2.8s ease-in-out infinite;
}
.lc-chat-toggle i {
  color: #fff;
}
@keyframes lcPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55), 0 12px 24px rgba(2, 6, 23, 0.24); }
  50% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0.10), 0 12px 24px rgba(2, 6, 23, 0.24); }
}
.lc-chat-root.is-open .lc-chat-toggle {
  opacity: 0;
  transform: scale(0.75);
  pointer-events: none;
}

.lc-chat-toggle-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.lc-chat-toggle-badge.is-hidden { display: none; }

.lc-chat-window {
  width: 352px;
  height: min(650px, 80vh);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.28);
  margin-bottom: 12px;
}
.lc-chat-window.is-open { display: flex; }

.lc-chat-header {
  color: #fff;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lc-chat-header-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 42px;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid #94a3b8;
  box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.28);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.lc-chat-header-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lc-chat-header-avatar-wrap.is-online {
  border-color: #22c55e;
  animation: lcAvatarPulse 1.8s ease-in-out infinite;
}
@keyframes lcAvatarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14); }
}
.lc-chat-header-meta { min-width: 0; flex: 1; }
.lc-chat-header-name {
  font-size: 16px;
  line-height: 1.1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-chat-header-role { margin-top: 3px; font-size: 13px; opacity: 0.94; }
.lc-chat-header-close {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  cursor: pointer;
}

.lc-chat-messages {
  padding: 12px 10px;
  overflow: auto;
  flex: 1;
  background: #dbeafe;
  background-image:
    radial-gradient(circle at 18px 18px, rgba(255, 255, 255, 0.34) 1.3px, transparent 1.3px),
    radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.08) 1px, transparent 1px);
  background-size: 30px 30px, 18px 18px;
}

.lc-msg {
  max-width: 86%;
  margin-bottom: 10px;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.38;
}
.lc-msg-time {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: rgba(51, 65, 85, 0.62);
  text-align: right;
}
.lc-msg.me {
  margin-left: auto;
  color: #0f172a;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-top-right-radius: 6px;
}
.lc-msg.them {
  margin-right: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1f2937;
  border-top-left-radius: 6px;
}

.lc-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 10px 10px;
  background: #dbeafe;
}
.lc-chat-quick.is-hidden { display: none; }
.lc-chat-quick-btn {
  border: 1px solid #3b82f6;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 999px;
  font-size: 13px;
  padding: 7px 11px;
  cursor: pointer;
}

.lc-chat-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #dbeafe;
  background: #fff;
}
.lc-chat-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.lc-chat-tool {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
}
.lc-chat-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 15px;
  outline: none;
}
.lc-chat-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.14);
}
.lc-chat-send {
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  width: 36px;
  height: 36px;
  font-size: 14px;
  line-height: 1;
}
.lc-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lc-contact-help {
  font-size: 15px;
  color: #64748b;
  margin: 6px 4px 10px;
}

.lc-contact-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  margin: 0 2px 6px;
}

.lc-contact-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lc-contact-input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid #e5e7eb;
  background: transparent;
  padding: 8px 2px;
  font-size: 16px;
  color: #334155;
  outline: none;
}

.lc-contact-input:focus {
  border-bottom-color: #22c55e;
}

.lc-contact-btn {
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  height: 50px;
  cursor: pointer;
}

@media (max-width: 480px) {
  .lc-chat-root.lc-left,
  .lc-chat-root.lc-right {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  .lc-chat-window {
    width: 100%;
    height: min(78vh, 660px);
  }
  .lc-chat-toggle {
    margin-left: auto;
    display: block;
  }
}
