#nho-sale-assistant-root {
  --nsa-green: #236847;
  --nsa-green-dark: #184c34;
  --nsa-grape: #593779;
  --nsa-ink: #202522;
  --nsa-muted: #68736d;
  --nsa-paper: #ffffff;
  --nsa-line: #e6ebe7;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  color: var(--nsa-ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
}

#nho-sale-assistant-root *,
#nho-sale-assistant-root *::before,
#nho-sale-assistant-root *::after {
  box-sizing: border-box;
}

#nho-sale-assistant-root button,
#nho-sale-assistant-root input {
  font: inherit;
}

#nho-sale-assistant-root button:focus-visible,
#nho-sale-assistant-root input:focus-visible,
#nho-sale-assistant-root a:focus-visible {
  outline: 3px solid #b8df74;
  outline-offset: 2px;
}

#nho-sale-assistant-root [hidden] {
  display: none !important;
}

.nsa-launcher {
  display: block;
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  padding: 13px 19px;
  min-height: 50px;
  color: #fff;
  background: var(--nsa-green);
  box-shadow: 0 6px 22px rgba(21, 63, 43, 0.28);
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.nsa-launcher:hover {
  background: var(--nsa-green-dark);
  transform: translateY(-1px);
}

.nsa-panel {
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 28px));
  height: min(590px, calc(100vh - 94px));
  height: min(590px, calc(100dvh - 94px));
  min-height: 360px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(23, 72, 49, 0.14);
  border-radius: 18px;
  background: var(--nsa-paper);
  box-shadow: 0 18px 52px rgba(18, 44, 30, 0.24);
}

.nsa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(115deg, var(--nsa-green-dark), var(--nsa-green) 64%, var(--nsa-grape));
}

.nsa-heading-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nsa-title {
  font-size: 17px;
  line-height: 1.25;
}

.nsa-status {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.nsa-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.nsa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  background: #f7faf8;
  overscroll-behavior: contain;
}

.nsa-message-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
}

.nsa-assistant-body {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.nsa-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(35, 104, 71, 0.18);
  border-radius: 50%;
  background: #edf5ee;
  object-fit: cover;
}

.nsa-assistant-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.nsa-assistant-name {
  padding-left: 2px;
  color: var(--nsa-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.nsa-from-user {
  align-items: flex-end;
}

.nsa-message {
  max-width: 88%;
  padding: 10px 13px;
  border: 1px solid var(--nsa-line);
  border-radius: 15px 15px 15px 4px;
  background: #fff;
  color: var(--nsa-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nsa-from-user .nsa-message {
  border-color: var(--nsa-green);
  border-radius: 15px 15px 4px 15px;
  color: #fff;
  background: var(--nsa-green);
}

.nsa-zalo {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #b9daca;
  border-radius: 999px;
  color: var(--nsa-green-dark);
  background: #ecf7f0;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.nsa-product-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  max-width: 92%;
}

.nsa-product-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #c9d9ce;
  border-radius: 12px;
  color: var(--nsa-green-dark);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.nsa-product-link:hover {
  border-color: var(--nsa-green);
  color: var(--nsa-green-dark);
  background: #eff7f2;
}

.nsa-zalo:hover {
  color: #fff;
  background: var(--nsa-green);
}

.nsa-typing {
  width: fit-content;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--nsa-muted);
  background: #fff;
  font-size: 14px;
}

.nsa-typing-row .nsa-typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 38px;
}

.nsa-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 12px;
}

.nsa-typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7f9085;
  animation: nsa-typing-pulse 900ms ease-in-out infinite;
}

.nsa-typing-dot:nth-child(2) {
  animation-delay: 120ms;
}

.nsa-typing-dot:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes nsa-typing-pulse {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.nsa-footnote {
  margin: 0;
  padding: 8px 14px 3px;
  color: var(--nsa-muted);
  background: #fff;
  font-size: 12px;
}

.nsa-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 13px;
  border-top: 1px solid var(--nsa-line);
  background: #fff;
}

.nsa-input {
  flex: 1;
  width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #ccd7d0;
  border-radius: 12px;
  color: var(--nsa-ink);
  background: #fff;
}

.nsa-input::placeholder {
  color: #7a857e;
}

.nsa-send {
  min-width: 62px;
  min-height: 44px;
  padding: 8px 13px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--nsa-green);
  font-weight: 700;
  cursor: pointer;
}

.nsa-voice {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #b9daca;
  border-radius: 12px;
  color: var(--nsa-green-dark);
  background: #ecf7f0;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.nsa-voice:hover {
  background: #dff0e5;
}

.nsa-voice[aria-pressed="true"] {
  border-color: #c34b42;
  color: #fff;
  background: #c34b42;
}

.nsa-voice:disabled {
  cursor: wait;
  opacity: 0.6;
}

.nsa-send:disabled {
  cursor: wait;
  opacity: 0.6;
}

@media (max-width: 520px) {
  #nho-sale-assistant-root {
    right: 12px;
    bottom: 12px;
  }

  .nsa-panel {
    width: calc(100vw - 24px);
    height: min(620px, calc(100vh - 82px));
    height: min(620px, calc(100dvh - 82px));
    min-height: 320px;
    margin-bottom: 10px;
    border-radius: 16px;
  }

  .nsa-launcher {
    min-height: 48px;
    padding: 11px 16px;
  }

  .nsa-message {
    max-width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nsa-launcher,
  .nsa-typing-dot {
    transition: none;
    animation: none;
  }
}
