.nvc-root,
.nvc-root * {
  box-sizing: border-box;
}

.nvc-root {
  --nvc-ink: #172033;
  --nvc-muted: #647086;
  --nvc-line: #dce4ef;
  --nvc-panel: #ffffff;
  --nvc-soft: #f6f8fb;
  --nvc-navy: #1a2b4c;
  --nvc-cyan: #16a6b7;
  /* קצה הגרדיאנט של הכותרת בלבד. לבן על הציאן המותגי נותן 2.93 ונכשל ב-WCAG. */
  --nvc-cyan-deep: #0d7280;
  --nvc-coral: #f06449;
  --nvc-gold: #f4b63d;
  --nvc-shadow: 0 22px 70px rgba(18, 30, 54, 0.25);
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 2147483000;
  direction: rtl;
  font-family: "Heebo", "Assistant", "Segoe UI", Arial, sans-serif;
  color: var(--nvc-ink);
  text-align: right;
}

.nvc-root button,
.nvc-root input,
.nvc-root textarea {
  font: inherit;
  letter-spacing: 0;
}

.nvc-root button {
  cursor: pointer;
  border: 0;
}

.nvc-root textarea,
.nvc-root input {
  width: 100%;
  min-width: 0;
  border-radius: 8px;
}

.nvc-launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 58px;
  padding: 6px 7px 6px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--nvc-navy);
  box-shadow: 0 14px 36px rgba(26, 43, 76, 0.22);
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.nvc-launcher:hover,
.nvc-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(26, 43, 76, 0.28);
  outline: 2px solid rgba(22, 166, 183, 0.35);
  outline-offset: 3px;
}

.nvc-launcher-avatar,
.nvc-avatar,
.nvc-message-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #ffffff 0 14%, var(--nvc-cyan) 15% 54%, var(--nvc-navy) 55% 100%);
  color: #ffffff;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.nvc-launcher-avatar {
  width: 46px;
  height: 46px;
  font-size: 24px;
}

.nvc-launcher-copy {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.nvc-launcher-dot {
  position: absolute;
  top: 8px;
  right: 43px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #23c56f;
  border: 2px solid #ffffff;
}

.nvc-panel {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(392px, calc(100vw - 28px));
  height: min(640px, calc(100vh - 34px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 18px;
  background: var(--nvc-soft);
  box-shadow: var(--nvc-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transform-origin: bottom left;
  transition: opacity 0.2s ease, transform 0.24s ease;
}

.nvc-is-open .nvc-panel {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.nvc-is-open .nvc-launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.92);
}

.nvc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--nvc-navy), #243b6a 54%, var(--nvc-cyan-deep));
  color: #ffffff;
}

.nvc-avatar {
  width: 46px;
  height: 46px;
  font-size: 24px;
}

.nvc-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.nvc-root .nvc-title {
  /* חוק הזוג: התמה צובעת h2 ישירות ומנצחת ירושה מהמכולה. צבע מפורש חובה. */
  color: #ffffff;
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.nvc-root .nvc-subtitle {
  margin: 3px 0 0;
  color: #ffffff;
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 600;
}

.nvc-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
}

.nvc-close:hover,
.nvc-close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: 2px solid rgba(255, 255, 255, 0.36);
}

.nvc-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 10px;
  scroll-behavior: smooth;
}

.nvc-message-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.nvc-message-row-user {
  justify-content: flex-start;
}

.nvc-message-row-bot {
  justify-content: flex-end;
}

.nvc-message-avatar {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.nvc-message {
  max-width: min(292px, 82%);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nvc-message-bot {
  border-bottom-right-radius: 4px;
  background: #ffffff;
  color: var(--nvc-ink);
  border: 1px solid var(--nvc-line);
}

.nvc-message-user {
  border-bottom-left-radius: 4px;
  background: var(--nvc-navy);
  color: #ffffff;
}

.nvc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 36px 4px 0;
}

.nvc-chip {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid rgba(22, 166, 183, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: var(--nvc-navy);
  font-size: 13px;
  font-weight: 800;
}

.nvc-chip:hover,
.nvc-chip:focus-visible {
  border-color: var(--nvc-cyan);
  outline: 2px solid rgba(22, 166, 183, 0.18);
}

.nvc-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 54px;
  padding: 12px 14px;
  border: 1px solid var(--nvc-line);
  border-radius: 12px 12px 4px 12px;
  background: #ffffff;
}

.nvc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nvc-cyan);
  animation: nvc-typing 0.9s infinite ease-in-out;
}

.nvc-typing span:nth-child(2) {
  animation-delay: 0.12s;
}

.nvc-typing span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes nvc-typing {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.nvc-composer {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--nvc-line);
  background: #ffffff;
}

.nvc-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.nvc-input {
  resize: none;
  max-height: 112px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--nvc-line);
  background: var(--nvc-soft);
  color: var(--nvc-ink);
  line-height: 1.45;
  outline: 0;
}

.nvc-input:focus {
  border-color: var(--nvc-cyan);
  box-shadow: 0 0 0 3px rgba(22, 166, 183, 0.14);
}

.nvc-root button.nvc-send[type="submit"] {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #c9401f;
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
}

.nvc-send:disabled {
  cursor: default;
  opacity: 0.55;
}

.nvc-lead {
  margin: 4px 36px 6px 0;
  padding: 12px;
  border: 1px solid rgba(22, 166, 183, 0.24);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(26, 43, 76, 0.08);
}

.nvc-lead-title {
  margin-bottom: 9px;
  color: var(--nvc-navy);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 900;
}

.nvc-lead-label {
  display: block;
  margin-top: 8px;
  color: var(--nvc-muted);
  font-size: 12px;
  font-weight: 800;
}

.nvc-lead-input {
  display: block;
  margin-top: 4px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--nvc-line);
  background: var(--nvc-soft);
  color: var(--nvc-ink);
  outline: 0;
}

.nvc-lead-input:focus {
  border-color: var(--nvc-cyan);
  box-shadow: 0 0 0 3px rgba(22, 166, 183, 0.12);
}

.nvc-lead-message {
  min-height: 64px;
  resize: vertical;
}

.nvc-lead-error {
  min-height: 20px;
  margin-top: 7px;
  color: #b42318;
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 800;
}

.nvc-lead-submit {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  background: var(--nvc-cyan);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.nvc-lead-submit:disabled {
  opacity: 0.62;
  cursor: default;
}

.nvc-turnstile {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 300px;
  height: 70px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 520px) {
  .nvc-root {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .nvc-launcher {
    margin-right: auto;
  }

  .nvc-panel {
    left: 0;
    right: 0;
    width: auto;
    height: min(620px, calc(100vh - 24px));
    border-radius: 16px;
  }

  .nvc-message {
    max-width: 86%;
  }

  .nvc-chips,
  .nvc-lead {
    margin-right: 0;
  }
}
