:root {
  --nsa-primary: #fbb01e;
  --nsa-primary-rgb: 251,176,30;
  --nsa-pulse-color-rgb: 255,207,107;
  --nsa-text: #1f2937;
  --nsa-bg: #f4f7f8;
}
#nsa-widget {
  position: fixed;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 99999;
  font-family: Arial, Helvetica, sans-serif;
}
#nsa-toggle {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--nsa-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px 10px 14px;
  box-shadow: 0 12px 28px rgba(var(--nsa-primary-rgb), .28);
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  min-height: 66px;
  overflow: visible;
}
#nsa-toggle.nsa-pulse::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  border: 2px solid rgba(var(--nsa-pulse-color-rgb), .55);
  z-index: -1;
  pointer-events: none;
  animation: nsaPulseRing 2.4s ease-out infinite;
}
#nsa-toggle.nsa-pulse::after {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 999px;
  border: 2px solid rgba(var(--nsa-pulse-color-rgb), .28);
  z-index: -1;
  pointer-events: none;
  animation: nsaPulseRingOuter 2.4s ease-out infinite;
}
@keyframes nsaPulseRing {
  0% { transform: scale(0.98); opacity: .95; }
  65% { transform: scale(1.12); opacity: .15; }
  100% { transform: scale(1.16); opacity: 0; }
}
@keyframes nsaPulseRingOuter {
  0% { transform: scale(0.94); opacity: .65; }
  65% { transform: scale(1.18); opacity: .10; }
  100% { transform: scale(1.24); opacity: 0; }
}
#nsa-toggle .nsa-toggle-inner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
#nsa-toggle .nsa-avatar,
#nsa-toggle .nsa-avatar-fallback {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
#nsa-toggle .nsa-toggle-label {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
}
#nsa-panel {
  width: min(390px, calc(100vw - 20px));
  height: min(660px, calc(100vh - 88px));
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(15, 23, 42, .08);
  display: flex;
  flex-direction: column;
}
.nsa-hidden { display: none !important; }
#nsa-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 14px;
  background: var(--nsa-primary);
  color: #fff;
}
.nsa-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.nsa-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.65);
  background: rgba(255,255,255,.15);
  flex: 0 0 auto;
}
.nsa-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}
.nsa-header-text { min-width: 0; }
.nsa-header-name {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nsa-header-title {
  font-size: 12px;
  opacity: .95;
  margin-top: 3px;
}
#nsa-header .nsa-sub {
  font-size: 12px;
  opacity: .92;
  margin-top: 3px;
}
#nsa-close {
  background: rgba(255,255,255,.16);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
#nsa-close:hover { background: rgba(255,255,255,.24); }
#nsa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: radial-gradient(circle at top left, rgba(var(--nsa-primary-rgb), .06), transparent 34%), var(--nsa-bg);
}
.nsa-message {
  display: flex;
  margin-bottom: 12px;
}
.nsa-assistant { justify-content: flex-start; }
.nsa-user { justify-content: flex-end; }
.nsa-bubble {
  max-width: 88%;
  padding: 13px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.48;
  background: #fff;
  color: var(--nsa-text);
  border: 1px solid rgba(15,23,42,.06);
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
  overflow-wrap: break-word;
  word-break: normal;
  white-space: pre-wrap;
  hyphens: none;
}
.nsa-bubble a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}
.nsa-user .nsa-bubble {
  background: var(--nsa-primary);
  color: #fff;
  border-color: transparent;
}
#nsa-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) 156px;
  align-items: stretch;
  gap: 12px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.96);
}
#nsa-input {
  min-height: 54px;
  max-height: 120px;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  padding: 13px 14px;
  resize: none;
  font-size: 15px;
  line-height: 1.4;
  color: var(--nsa-text);
  box-sizing: border-box;
}
#nsa-send {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  background: var(--nsa-primary) !important;
  color: #fff !important;
  border-radius: 16px !important;
  padding: 0 20px !important;
  min-width: 156px !important;
  width: 156px !important;
  min-height: 54px !important;
  height: 54px !important;
  font-weight: 700 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  cursor: pointer;
  align-self: stretch;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
#nsa-send:disabled { opacity: .75; cursor: default; }
#nsa-debug-badge {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 99998;
  background: #111827;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font: 12px/1 Arial, Helvetica, sans-serif;
  box-shadow: 0 8px 22px rgba(0,0,0,.15);
}
@media (max-width: 640px) {
  #nsa-widget {
    right: 8px;
    left: 8px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }
  #nsa-toggle {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: auto;
    padding: 9px 16px 9px 12px;
    min-height: 60px;
    font-size: 17px;
  }
  #nsa-toggle .nsa-avatar, #nsa-toggle .nsa-avatar-fallback {
    width: 42px;
    height: 42px;
  }
  #nsa-panel {
    width: calc(100vw - 16px);
    height: min(78vh, 700px);
    margin-bottom: 64px;
    border-radius: 22px;
  }
  #nsa-header {
    padding-right: 14px;
  }
  .nsa-header-name {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }
  .nsa-bubble {
    max-width: 92%;
    font-size: 15px;
  }
  #nsa-form {
    grid-template-columns: minmax(0,1fr) 136px;
    gap: 10px;
  }
  #nsa-input {
    min-width: 0;
    width: 100%;
  }
  #nsa-send {
    width: 136px !important;
    min-width: 136px !important;
    min-height: 52px !important;
    height: 52px !important;
    padding: 0 14px !important;
    font-size: 18px !important;
  }
}


/* v2.11 layout fixes */
.nueden-sales-agent-input,
.nueden-sales-agent-input textarea,
.nueden-sales-agent-input input,
.pixie-input,
.pixie-input textarea,
.pixie-input input,
.nueden-chat-input,
.nueden-chat-input textarea,
.nueden-chat-input input {
  overflow: hidden !important;
  resize: none !important;
  scrollbar-width: none !important;
}
.nueden-sales-agent-input textarea::-webkit-scrollbar,
.nueden-sales-agent-input input::-webkit-scrollbar,
.pixie-input textarea::-webkit-scrollbar,
.pixie-input input::-webkit-scrollbar,
.nueden-chat-input textarea::-webkit-scrollbar,
.nueden-chat-input input::-webkit-scrollbar {
  display: none !important;
}

.nueden-sales-agent-footer,
.nueden-sales-agent-composer,
.pixie-footer,
.pixie-composer,
.nueden-chat-footer,
.nueden-chat-composer {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
}

.nueden-sales-agent-send,
.nueden-sales-agent-send button,
.pixie-send,
.pixie-send button,
.nueden-chat-send,
.nueden-chat-send button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-width: 150px !important;
  width: 150px !important;
  height: 64px !important;
  line-height: 1 !important;
  padding: 0 20px !important;
  border-radius: 20px !important;
  box-sizing: border-box !important;
  align-self: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  position: relative !important;
  top: 0 !important;
  margin: 0 !important;
}

@media (max-width: 640px) {
  .nueden-sales-agent-footer,
  .nueden-sales-agent-composer,
  .pixie-footer,
  .pixie-composer,
  .nueden-chat-footer,
  .nueden-chat-composer {
    gap: 12px !important;
  }

  .nueden-sales-agent-send,
  .nueden-sales-agent-send button,
  .pixie-send,
  .pixie-send button,
  .nueden-chat-send,
  .nueden-chat-send button {
    min-width: 142px !important;
    width: 142px !important;
    height: 62px !important;
    border-radius: 18px !important;
  }
}


/* v2.11 welcome message consistency + spacing */
.nueden-sales-agent-message,
.nueden-sales-agent-message-text,
.pixie-message,
.pixie-message-text,
.nueden-chat-message,
.nueden-chat-message-text {
  white-space: pre-line !important;
  line-height: 1.45 !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}





.nsa-starters{display:flex;flex-wrap:wrap;gap:10px;padding:4px 0 10px;}
.nsa-starter{border:none;background:var(--nsa-primary);color:#fff;border-radius:999px;padding:10px 14px;font:600 14px/1.2 Arial,Helvetica,sans-serif;cursor:pointer;box-shadow:0 10px 22px rgba(var(--nsa-primary-rgb),.18);}
.nsa-starter:hover{filter:brightness(1.05);}
@media (max-width:640px){.nsa-starters{gap:8px}.nsa-starter{font-size:13px;padding:9px 12px}}
