/* Express Logistics Cargo — live chat widget */
:root {
  --elc-chat-primary: #f47f6b;
  --elc-chat-primary-dark: #e36955;
  --elc-chat-bg: #282a3e;
  --elc-chat-bg-light: #ffffff;
  --elc-chat-text: #1f2131;
  --elc-chat-muted: #6b7280;
  --elc-chat-border: #e5e7eb;
  --elc-chat-bubble-visitor-bg: #f47f6b;
  --elc-chat-bubble-visitor-text: #ffffff;
  --elc-chat-bubble-admin-bg: #f1f5f9;
  --elc-chat-bubble-admin-text: #1f2131;
}

#elc-chat-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--elc-chat-primary);
  color: #fff;
  border: none;
  box-shadow: 0 8px 22px rgba(40, 42, 62, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform .2s ease, background .2s ease;
}
#elc-chat-button:hover { background: var(--elc-chat-primary-dark); transform: scale(1.06); }
#elc-chat-button svg { width: 28px; height: 28px; }
#elc-chat-button .elc-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
  display: none;
}
#elc-chat-button .elc-chat-badge.visible { display: block; }

#elc-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--elc-chat-bg-light);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(40, 42, 62, 0.25);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
}
#elc-chat-panel.open { display: flex; }

#elc-chat-header {
  background: var(--elc-chat-bg);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
#elc-chat-header .elc-chat-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--elc-chat-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
#elc-chat-header .elc-chat-title { flex: 1; }
#elc-chat-header .elc-chat-title strong { display: block; font-size: 15px; }
#elc-chat-header .elc-chat-title small { font-size: 12px; opacity: .8; }
#elc-chat-header .elc-chat-close {
  background: none; border: none; color: #fff; font-size: 22px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
#elc-chat-header .elc-chat-close:hover { background: rgba(255,255,255,0.1); }

#elc-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#elc-chat-body .elc-msg {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}
#elc-chat-body .elc-msg.visitor {
  align-self: flex-end;
  background: var(--elc-chat-bubble-visitor-bg);
  color: var(--elc-chat-bubble-visitor-text);
  border-bottom-right-radius: 4px;
}
#elc-chat-body .elc-msg.admin {
  align-self: flex-start;
  background: var(--elc-chat-bubble-admin-bg);
  color: var(--elc-chat-bubble-admin-text);
  border-bottom-left-radius: 4px;
}
#elc-chat-body .elc-msg .elc-msg-meta {
  font-size: 11px; opacity: .7; margin-top: 4px;
}
#elc-chat-body .elc-msg.system {
  align-self: center;
  background: transparent;
  color: var(--elc-chat-muted);
  font-style: italic;
  font-size: 12px;
}

#elc-chat-intro {
  padding: 16px;
  border-top: 1px solid var(--elc-chat-border);
  background: #fff;
  display: none;
}
#elc-chat-intro.visible { display: block; }
#elc-chat-intro p { font-size: 13px; color: var(--elc-chat-muted); margin: 0 0 10px; }
#elc-chat-intro input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--elc-chat-border);
  border-radius: 8px; font-size: 14px; margin-bottom: 8px; font-family: inherit; box-sizing: border-box;
}
#elc-chat-intro input:focus { outline: none; border-color: var(--elc-chat-primary); }

#elc-chat-form {
  padding: 12px;
  border-top: 1px solid var(--elc-chat-border);
  background: #fff;
  display: flex;
  gap: 8px;
}
#elc-chat-form textarea {
  flex: 1;
  border: 1px solid var(--elc-chat-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 40px; max-height: 120px;
  outline: none;
}
#elc-chat-form textarea:focus { border-color: var(--elc-chat-primary); }
#elc-chat-form button {
  background: var(--elc-chat-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
#elc-chat-form button:hover { background: var(--elc-chat-primary-dark); }
#elc-chat-form button:disabled { opacity: .5; cursor: not-allowed; }
#elc-chat-form button svg { width: 18px; height: 18px; }

#elc-chat-status {
  padding: 6px 16px; font-size: 12px; color: var(--elc-chat-muted);
  background: #fff; border-top: 1px solid var(--elc-chat-border);
  display: none;
}
#elc-chat-status.visible { display: block; }
#elc-chat-status.error { color: #b91c1c; }
