/* SmartPABX concierge widget — themeable via CSS vars set by each site. */
.spx-concierge {
  --spx-bg: #14171d;
  --spx-panel: #1c1f26;
  --spx-panel-2: #23262e;
  --spx-line: rgba(255, 255, 255, 0.08);
  --spx-text: #e9edf3;
  --spx-dim: #9aa3b2;
  --spx-green: #50eb97;
  --spx-blue: #308fff;
  --spx-user: #308fff;
  --spx-radius: 16px;
  --spx-font: "Space Grotesk", system-ui, sans-serif;
  font-family: var(--spx-font);
  color: var(--spx-text);
  display: flex;
  flex-direction: column;
  background: var(--spx-panel);
  border: 1px solid var(--spx-line);
  border-radius: var(--spx-radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.spx-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(80, 235, 151, 0.12), rgba(48, 143, 255, 0.12));
  border-bottom: 1px solid var(--spx-line);
}
.spx-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--spx-green);
  box-shadow: 0 0 0 0 rgba(80, 235, 151, 0.6);
  animation: spx-pulse 2s infinite;
}
@keyframes spx-pulse {
  0% { box-shadow: 0 0 0 0 rgba(80, 235, 151, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(80, 235, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(80, 235, 151, 0); }
}
.spx-head strong { font-size: 14px; font-weight: 600; letter-spacing: 0.2px; }
.spx-head span { font-size: 12px; color: var(--spx-dim); }
.spx-head .spx-title { display: flex; flex-direction: column; line-height: 1.3; }
.spx-head .spx-close {
  margin-left: auto; background: none; border: none; color: var(--spx-dim);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 4px;
}
.spx-head .spx-close:hover { color: var(--spx-text); }

.spx-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  scroll-behavior: smooth;
}
.spx-msg {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: spx-in 0.25s ease;
}
@keyframes spx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.spx-msg.bot {
  align-self: flex-start;
  background: var(--spx-panel-2);
  border: 1px solid var(--spx-line);
  border-bottom-left-radius: 4px;
}
.spx-msg.user {
  align-self: flex-end;
  background: var(--spx-user);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.spx-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.spx-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--spx-dim);
  animation: spx-blink 1.2s infinite both;
}
.spx-typing i:nth-child(2) { animation-delay: 0.2s; }
.spx-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes spx-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.spx-lead-ok {
  align-self: center;
  text-align: center;
  font-size: 13px;
  color: var(--spx-green);
  border: 1px dashed rgba(80, 235, 151, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(80, 235, 151, 0.06);
}

.spx-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 4px; }
.spx-quick button {
  font-family: inherit; font-size: 12.5px; color: var(--spx-text);
  background: var(--spx-panel-2); border: 1px solid var(--spx-line);
  border-radius: 999px; padding: 7px 12px; cursor: pointer; transition: 0.15s;
}
.spx-quick button:hover { border-color: var(--spx-green); color: var(--spx-green); }

.spx-input {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--spx-line); background: var(--spx-bg);
}
.spx-input textarea {
  flex: 1; resize: none; font-family: inherit; font-size: 14.5px;
  color: var(--spx-text); background: var(--spx-panel-2);
  border: 1px solid var(--spx-line); border-radius: 12px;
  padding: 11px 13px; max-height: 120px; line-height: 1.4;
}
.spx-input textarea:focus { outline: none; border-color: var(--spx-blue); }
.spx-input textarea::placeholder { color: var(--spx-dim); }
.spx-send {
  flex: none; width: 44px; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--spx-green), var(--spx-blue));
  color: #06210f; font-size: 18px; display: grid; place-items: center;
  transition: 0.15s;
}
.spx-send:disabled { opacity: 0.4; cursor: default; }
.spx-send:not(:disabled):hover { filter: brightness(1.08); }

/* Docked floating variant */
.spx-dock { position: fixed; right: 22px; bottom: 22px; z-index: 9000; }
.spx-launcher {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 13px 18px 13px 14px; border-radius: 999px; border: none;
  font-family: var(--spx-font); font-weight: 600; font-size: 14px; color: #06210f;
  background: linear-gradient(135deg, var(--spx-green), var(--spx-blue));
  box-shadow: 0 12px 30px rgba(48, 143, 255, 0.35);
  animation: spx-float 3.5s ease-in-out infinite;
}
@keyframes spx-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.spx-launcher .spx-av { width: 26px; height: 26px; display: grid; place-items: center; }
.spx-panel-wrap {
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  display: none;
}
.spx-dock.open .spx-panel-wrap { display: flex; }
.spx-dock.open .spx-launcher { display: none; }
.spx-dock .spx-concierge { height: 100%; }

@media (max-width: 480px) {
  .spx-dock { right: 12px; bottom: 12px; left: 12px; }
  .spx-panel-wrap { width: 100%; height: min(75vh, 560px); }
}
