#varex-sales-agent-root {
  --vsa-navy: #0a1431;
  --vsa-blue: #356df3;
  --vsa-gold: #d9ad54;
  --vsa-ink: #172554;
  --vsa-muted: #6f7c93;
  --vsa-line: #dfe6f0;
  --vsa-soft: #f3f6fb;
  position: fixed;
  z-index: 2147482000;
  inset-inline-start: 22px;
  bottom: 22px;
  direction: rtl;
  color: var(--vsa-ink);
  font-family: Kufi, Tahoma, Arial, sans-serif;
  font-weight: 700;
  line-height: 1.7;
}

#varex-sales-agent-root[dir="ltr"] {
  direction: ltr;
}

#varex-sales-agent-root *,
#varex-sales-agent-root *::before,
#varex-sales-agent-root *::after {
  box-sizing: border-box;
}

.vsa-launch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vsa-launcher {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 21px;
  background: linear-gradient(145deg, #0a1431, #172f67);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 15px 38px rgba(10, 20, 49, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vsa-launcher:hover,
.vsa-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 19px 44px rgba(10, 20, 49, 0.38);
  outline: 3px solid rgba(53, 109, 243, 0.25);
  outline-offset: 3px;
}

.vsa-launcher svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vsa-launcher::after {
  content: "";
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #35c886;
}

.vsa-launch-label,
.vsa-nudge {
  max-width: 230px;
  padding: 11px 14px;
  border: 1px solid var(--vsa-line);
  border-radius: 15px;
  background: #fff;
  color: var(--vsa-ink);
  box-shadow: 0 12px 32px rgba(10, 20, 49, 0.16);
  font-size: 13px;
  text-align: start;
}

.vsa-launch-label small {
  display: block;
  margin-top: 2px;
  color: var(--vsa-muted);
  font-size: 11px;
}

.vsa-nudge {
  position: absolute;
  inset-inline-start: 0;
  bottom: 76px;
  width: 260px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.vsa-nudge.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.vsa-nudge strong {
  display: block;
  font-size: 13px;
}

.vsa-nudge span {
  display: block;
  margin-top: 3px;
  color: var(--vsa-muted);
  font-size: 11px;
}

.vsa-panel {
  position: absolute;
  inset-inline-start: 0;
  bottom: 78px;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 112px));
  min-height: 480px;
  display: grid;
  grid-template-rows: auto 4px minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(23, 37, 84, 0.14);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 75px rgba(10, 20, 49, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom left;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

#varex-sales-agent-root[dir="rtl"] .vsa-panel {
  transform-origin: bottom right;
}

#varex-sales-agent-root[data-open="true"] .vsa-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#varex-sales-agent-root[data-open="true"] .vsa-launch-label,
#varex-sales-agent-root[data-open="true"] .vsa-nudge {
  display: none;
}

.vsa-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 16px 17px;
  background: linear-gradient(145deg, #08122e, #172f67);
  color: #fff;
}

.vsa-avatar {
  position: relative;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--vsa-gold);
  font: 900 18px/1 Arial, sans-serif;
  letter-spacing: 1px;
}

.vsa-header-copy {
  min-width: 0;
}

.vsa-header-copy strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vsa-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: #c8d4ea;
  font-size: 10.5px;
}

.vsa-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35c886;
  box-shadow: 0 0 0 4px rgba(53, 200, 134, 0.14);
}

.vsa-header-actions {
  display: flex;
  gap: 5px;
}

.vsa-icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.vsa-icon-button:hover,
.vsa-icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: 2px solid rgba(255, 255, 255, 0.3);
}

.vsa-icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vsa-progress {
  overflow: hidden;
  background: #dfe6f0;
}

.vsa-progress span {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--vsa-gold), #f0cf84);
  transition: width 0.3s ease;
}

.vsa-messages {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 17px;
  background: linear-gradient(180deg, #f8faff, #f3f6fb);
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.vsa-message {
  max-width: 88%;
  margin: 0 0 11px;
  padding: 11px 13px;
  border: 1px solid var(--vsa-line);
  border-radius: 16px 16px 5px 16px;
  background: #fff;
  color: #33415f;
  box-shadow: 0 6px 18px rgba(23, 37, 84, 0.06);
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-line;
}

#varex-sales-agent-root[dir="ltr"] .vsa-message {
  border-radius: 16px 16px 16px 5px;
}

.vsa-message.is-user {
  margin-inline-start: auto;
  border-color: #c8d5fb;
  border-radius: 16px 16px 16px 5px;
  background: #eaf0ff;
  color: var(--vsa-ink);
}

#varex-sales-agent-root[dir="ltr"] .vsa-message.is-user {
  border-radius: 16px 16px 5px 16px;
}

.vsa-message.is-note {
  max-width: 100%;
  border-color: #eadcbf;
  background: #fffaf0;
  color: #715722;
  font-size: 11.5px;
}

.vsa-typing {
  width: 55px;
  display: flex;
  gap: 5px;
  padding: 13px 15px;
}

.vsa-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8793aa;
  animation: vsaTyping 1.1s ease-in-out infinite;
}

.vsa-typing i:nth-child(2) { animation-delay: 0.15s; }
.vsa-typing i:nth-child(3) { animation-delay: 0.3s; }

.vsa-composer {
  max-height: 48vh;
  overflow-y: auto;
  padding: 13px 14px 14px;
  border-top: 1px solid var(--vsa-line);
  background: #fff;
}

.vsa-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.vsa-option {
  min-height: 46px;
  padding: 8px 9px;
  border: 1px solid #cfd9e8;
  border-radius: 12px;
  background: #fff;
  color: var(--vsa-ink);
  cursor: pointer;
  font: 700 11.5px/1.65 Kufi, Tahoma, Arial, sans-serif;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.vsa-option:hover,
.vsa-option:focus-visible {
  border-color: var(--vsa-blue);
  background: #f0f4ff;
  outline: none;
  transform: translateY(-1px);
}

.vsa-contact-form {
  display: grid;
  gap: 9px;
}

.vsa-field {
  display: grid;
  gap: 5px;
}

.vsa-field label {
  color: #43506b;
  font-size: 11px;
}

.vsa-field input,
.vsa-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid #cfd9e8;
  border-radius: 11px;
  background: #fff;
  color: #1c2946;
  font: 700 13px/1.6 Tahoma, Arial, sans-serif;
  outline: none;
}

.vsa-field textarea {
  min-height: 70px;
  resize: vertical;
}

.vsa-field input:focus,
.vsa-field textarea:focus {
  border-color: var(--vsa-blue);
  box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.12);
}

.vsa-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.vsa-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  color: #5d6b83;
  font-size: 10.5px;
  line-height: 1.75;
}

.vsa-consent input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--vsa-blue);
}

.vsa-submit {
  min-height: 48px;
  padding: 10px 15px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #0a1431, #172f67);
  color: #fff;
  cursor: pointer;
  font: 700 12.5px/1.6 Kufi, Tahoma, Arial, sans-serif;
  box-shadow: 0 10px 24px rgba(23, 37, 84, 0.18);
}

.vsa-submit:disabled {
  cursor: wait;
  opacity: 0.66;
}

.vsa-form-error {
  min-height: 18px;
  margin: 0;
  color: #b42318;
  font-size: 10.5px;
}

.vsa-actions {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 8px;
}

.vsa-action {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 11px;
  border: 1px solid var(--vsa-navy);
  border-radius: 12px;
  background: var(--vsa-navy);
  color: #fff !important;
  font-size: 11.5px;
  text-align: center;
  text-decoration: none !important;
}

.vsa-action.is-call {
  background: #fff;
  color: var(--vsa-navy) !important;
}

.vsa-direct {
  display: flex;
  justify-content: center;
  gap: 13px;
  margin-top: 9px;
}

.vsa-direct a {
  color: #64718a !important;
  font-size: 10.5px;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

@keyframes vsaTyping {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.48; }
  35% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 560px) {
  #varex-sales-agent-root {
    inset-inline-start: 12px;
    bottom: 12px;
  }

  .vsa-launcher {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    border-radius: 19px;
  }

  .vsa-launch-label {
    display: none;
  }

  .vsa-panel {
    bottom: 68px;
    width: calc(100vw - 24px);
    height: min(680px, calc(100dvh - 94px));
    min-height: 430px;
    border-radius: 21px;
  }

  .vsa-header {
    padding: 13px 14px;
  }

  .vsa-messages {
    padding: 14px;
  }

  .vsa-options {
    grid-template-columns: 1fr;
  }

  .vsa-nudge {
    bottom: 68px;
    width: min(260px, calc(100vw - 24px));
  }
}

@media (prefers-reduced-motion: reduce) {
  #varex-sales-agent-root *,
  #varex-sales-agent-root *::before,
  #varex-sales-agent-root *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

