:root {
  --emc-primary: #163B6D;
  --emc-secondary: #0F2748;
  --emc-accent: #C6A45D;
  --emc-bg: #ffffff;
  --emc-soft: #f4f7fb;
  --emc-text: #1b2430;
  --emc-muted: #657083;
  --emc-border: #d9e1ef;
  --emc-shadow: 0 18px 50px rgba(16, 39, 72, 0.20);
}

#emc-chatbot,
#emc-chatbot * {
  box-sizing: border-box;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

#emc-chatbot-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0;
  background: var(--emc-primary);
  color: #fff;
  box-shadow: var(--emc-shadow);
  cursor: pointer;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
}

#emc-chatbot-panel {
  position: fixed;
  right: 22px;
  bottom: 98px;
  width: 380px;
  max-width: calc(100vw - 28px);
  height: 590px;
  max-height: calc(100vh - 120px);
  background: var(--emc-bg);
  border: 1px solid var(--emc-border);
  border-radius: 22px;
  box-shadow: var(--emc-shadow);
  overflow: hidden;
  z-index: 99999;
  display: none;
}

#emc-chatbot-panel.emc-open {
  display: flex;
  flex-direction: column;
}

.emc-chat-header {
  padding: 18px 18px 14px;
  background: linear-gradient(135deg, var(--emc-secondary), var(--emc-primary));
  color: #fff;
}

.emc-chat-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.emc-chat-subtitle {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: rgba(255,255,255,0.82);
}

.emc-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.emc-chat-body {
  flex: 1;
  padding: 15px 14px;
  overflow-y: auto;
  background: var(--emc-soft);
}

.emc-message {
  max-width: 88%;
  padding: 11px 13px;
  margin: 8px 0;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.emc-message.bot {
  background: #fff;
  color: var(--emc-text);
  border: 1px solid var(--emc-border);
  border-bottom-left-radius: 6px;
}

.emc-message.user {
  background: var(--emc-primary);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 6px;
}

.emc-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 6px;
}

.emc-chip {
  border: 1px solid var(--emc-border);
  background: #fff;
  color: var(--emc-primary);
  padding: 8px 10px;
  font-size: 12.5px;
  border-radius: 999px;
  cursor: pointer;
}

.emc-chip:hover {
  border-color: var(--emc-accent);
}

.emc-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--emc-border);
  background: #fff;
}

#emc-chatbot-input {
  flex: 1;
  border: 1px solid var(--emc-border);
  border-radius: 13px;
  padding: 12px 12px;
  font-size: 13.5px;
  outline: none;
}

#emc-chatbot-input:focus {
  border-color: var(--emc-primary);
}

#emc-chatbot-send {
  border: 0;
  border-radius: 13px;
  background: var(--emc-primary);
  color: #fff;
  padding: 0 15px;
  font-size: 14px;
  cursor: pointer;
}

.emc-lead-form {
  background: #fff;
  border: 1px solid var(--emc-border);
  border-radius: 16px;
  padding: 12px;
  margin: 10px 0;
}

.emc-lead-form label {
  display: block;
  font-size: 12px;
  color: var(--emc-muted);
  margin: 8px 0 4px;
}

.emc-lead-form input,
.emc-lead-form select,
.emc-lead-form textarea {
  width: 100%;
  border: 1px solid var(--emc-border);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  outline: none;
}

.emc-lead-form textarea {
  min-height: 70px;
  resize: vertical;
}

.emc-hidden-field {
  display: none !important;
}

.emc-lead-form button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--emc-primary);
  color: #fff;
  margin-top: 10px;
  padding: 11px;
  cursor: pointer;
  font-weight: 700;
}

.emc-lead-form button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.emc-form-note {
  color: var(--emc-muted);
  font-size: 11.5px;
  line-height: 1.35;
  margin-top: 8px;
}

@media (max-width: 520px) {
  #emc-chatbot-panel {
    right: 14px;
    bottom: 88px;
    height: 72vh;
  }

  #emc-chatbot-toggle {
    right: 16px;
    bottom: 16px;
  }
}
