.jn-live-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.jn-live-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: #137f15;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(19, 127, 21, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jn-live-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(19, 127, 21, 0.45);
}

.jn-live-chat-panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(380px, calc(100vw - 40px));
  max-height: min(520px, calc(100vh - 120px));
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(19, 0, 154, 0.15);
  overflow: hidden;
  flex-direction: column;
}

.jn-live-chat.is-open .jn-live-chat-panel {
  display: flex;
}

.jn-live-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(90deg, #0000ae, #13009a);
  color: #fff;
}

.jn-live-chat-title {
  display: block;
  font-size: 1rem;
}

.jn-live-chat-sub {
  display: block;
  font-size: 0.72rem;
  opacity: 0.85;
  margin-top: 2px;
}

.jn-live-chat-close {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.jn-live-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9fafb;
  min-height: 240px;
  max-height: 340px;
}

.jn-live-chat-welcome {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}

.jn-live-chat-welcome.is-hidden {
  display: none;
}

.jn-live-chat-welcome-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #13009a;
}

.jn-live-chat-welcome-lead {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: #1b1b1b;
  font-weight: 600;
}

.jn-live-chat-welcome-list {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.5;
}

.jn-live-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.jn-live-chat-quick-btn {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #13009a;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.jn-live-chat-quick-btn:hover:not(:disabled) {
  background: #fff;
  border-color: #13009a;
}

.jn-live-chat-quick-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.jn-live-chat-quick-btn--support {
  background: rgba(19, 127, 21, 0.1);
  border-color: rgba(19, 127, 21, 0.35);
  color: #137f15;
}

.jn-live-chat-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}

.jn-live-chat-bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #1b1b1b;
}

.jn-live-chat-bubble--user {
  align-self: flex-end;
  background: #13009a;
  color: #fff;
}

.jn-live-chat-bubble--typing {
  opacity: 0.7;
  font-style: italic;
}

.jn-live-chat-bubble a {
  color: #137f15;
  font-weight: 600;
}

.jn-live-chat-bubble--user a {
  color: #b8f5bc;
}

.jn-live-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.jn-live-chat-input {
  flex: 1;
  resize: none;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.88rem;
}

.jn-live-chat-input:focus {
  outline: 2px solid rgba(19, 0, 154, 0.25);
  border-color: #13009a;
}

.jn-live-chat-send {
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  background: #137f15;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.jn-live-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.jn-live-chat-foot {
  margin: 0;
  padding: 8px 12px 12px;
  font-size: 0.72rem;
  color: #6b7280;
  background: #fff;
}

.jn-live-chat-foot a {
  color: #13009a;
  font-weight: 600;
}

@media (max-width: 480px) {
  .jn-live-chat {
    right: 12px;
    bottom: 12px;
  }

  .jn-live-chat-launcher-text {
    display: none;
  }

  .jn-live-chat-launcher {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}
