:root {
  --js-widget-accent: #184dee;
  --js-widget-accent-dark: #102f91;
  --js-widget-ink: #0d1d44;
  --js-widget-ink-soft: rgba(13, 29, 68, 0.68);
  --js-widget-tint: #e9f0ff;
  --js-widget-gold: #d4b269;
  --js-widget-surface: #fff;
  --js-widget-border: #e7e7e7;
  --js-widget-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
  --js-widget-radius: 16px;
  --js-widget-font-text: var(--_font---family--text), "Satoshi Variable", "Satoshi", Arial, sans-serif;
  --js-widget-font-display: var(--_font---family--display), "Saans Trial", "Saans-TRIAL", Arial, sans-serif;
}

#chatbot-widget-root[hidden],
#voicebot-widget-root[hidden] {
  display: none !important;
}

#js-widget-stack {
  align-items: flex-end;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  position: fixed;
  right: 16px;
  z-index: 2147483000;
}

#chatbot-widget-root,
#voicebot-widget-root {
  pointer-events: none;
  position: static;
}

#chatbot-widget-root {
  width: min(392px, calc(100vw - 32px));
}

#voicebot-widget-root {
  width: min(332px, calc(100vw - 32px));
}

.js-widget-root {
  color: var(--js-widget-ink);
  font-family: var(--js-widget-font-text);
}

.js-widget-root [hidden] {
  display: none !important;
}

.js-widget-shell {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.js-widget-launcher,
.js-widget-panel {
  pointer-events: auto;
}

.js-widget-launcher {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 9999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  text-align: center;
  transition: background 0.15s ease, transform 0.15s ease;
  width: auto;
  max-width: 100%;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
}

.js-widget-launcher:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.js-widget-launcher__main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.js-widget-launcher__copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.js-widget-launcher__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.js-widget-launcher__meta,
.js-widget-launcher__meta:empty {
  display: none;
}

.js-widget-launcher__arrow {
  display: none;
}

.js-widget-launcher__tile {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  height: 16px;
  justify-content: center;
  width: 16px;
}

.js-widget-launcher__tile svg {
  display: block;
  height: 16px;
  width: 16px;
}

.js-widget-launcher--secondary {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
}

.js-widget-launcher--secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.js-widget-launcher--secondary .js-widget-launcher__title {
  color: #fff;
}

.js-widget-launcher--secondary .js-widget-launcher__meta {
  color: rgba(255, 255, 255, 0.6);
}

.js-widget-launcher--secondary .js-widget-launcher__tile {
  color: #fff;
}

.js-widget-launcher--secondary .js-widget-launcher__arrow {
  color: #fff;
}

/* ---------- panel ---------- */
.js-widget-panel {
  bottom: calc(100% + 8px);
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 200ms ease, transform 200ms ease;
  visibility: hidden;
  width: 100%;
}
.js-widget-root.is-open .js-widget-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}
.js-widget-panel__surface {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* ---------- header ---------- */
.js-widget-header {
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
}
.js-widget-header__brand {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}
.js-widget-brand-mark {
  display: block;
  flex: 0 0 auto;
  height: 32px;
  object-fit: contain;
  width: 32px;
  display: none;
}
.js-widget-header__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.js-widget-header__title {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  margin: 0;
}
.js-widget-header__subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 18px;
  margin: 0;
}
.js-widget-header__subtitle:empty {
  display: none;
}
.js-widget-header__actions {
  align-items: center;
  display: flex;
  gap: 8px;
}
.js-widget-close {
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  padding: 8px 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.js-widget-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---------- panel body ---------- */
.js-widget-panel__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
}

/* ---------- notes / status ---------- */
.js-widget-note {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
}
.js-widget-note__title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}
.js-widget-note__meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.js-widget-status-pill {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  padding: 6px 10px;
}
.js-widget-status-pill--ready {
  background: rgba(30, 64, 216, 0.4);
  color: #93c5fd;
}
.js-widget-status-pill--warn {
  background: rgba(212, 178, 105, 0.3);
  color: #fbbf24;
}
.js-widget-inline-copy {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.5;
}

/* ---------- quick reply chips ---------- */
.js-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.js-chip {
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  padding: 8px 12px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.js-chip:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ---------- chat messages ---------- */
.js-chat-log {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  min-height: 180px;
  overflow-y: auto;
  padding: 12px;
}
.js-chat-bubble {
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  max-width: 88%;
  padding: 10px 12px;
  white-space: pre-wrap;
}
.js-chat-bubble--agent {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}
.js-chat-bubble--user {
  align-self: flex-end;
  background: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #fff;
}
.js-chat-bubble--system {
  align-self: center;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  max-width: 100%;
}

/* ---------- chat input ---------- */
.js-chat-compose {
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  padding: 10px;
}
.js-chat-compose:focus-within {
  border-color: rgba(59, 130, 246, 0.5);
}
.js-chat-textarea {
  appearance: none;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  flex: 1 1 auto;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  max-height: 220px;
  min-height: 72px;
  padding: 12px 14px;
  resize: none;
  width: 100%;
}
.js-chat-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.js-chat-textarea:disabled,
.js-chat-send:disabled,
.js-voice-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.js-chat-textarea:focus {
  outline: 0;
}

/* ---------- send / voice buttons ---------- */
.js-chat-send,
.js-voice-button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  min-height: 44px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.js-chat-send:hover:not(:disabled),
.js-voice-button:hover:not(:disabled) {
  transform: translateY(-1px);
}
.js-chat-send {
  background: #1d4ed8;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 48px;
  width: 48px;
  padding: 0;
}
.js-chat-send svg {
  display: block;
  height: 18px;
  width: 18px;
}
.js-chat-send.is-busy svg {
  animation: js-widget-send-spin 0.9s linear infinite;
}

/* ---------- voice stage ---------- */
.js-voice-stage {
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  display: flex;
  gap: 12px;
  padding: 14px;
}
.js-voice-orb {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 48px;
  justify-content: center;
  position: relative;
  width: 48px;
}
.js-voice-orb__core {
  background: #1d4ed8;
  border-radius: inherit;
  inset: 0;
  position: absolute;
}
.js-voice-bars {
  align-items: center;
  display: flex;
  gap: 4px;
  position: relative;
  z-index: 1;
}
.js-voice-bars span {
  animation: js-widget-bars 1.8s ease-in-out infinite;
  background: #fff;
  border-radius: 8px;
  display: block;
  height: 14px;
  transform-origin: center bottom;
  width: 4px;
}
.js-voice-bars span:nth-child(2) { animation-delay: 0.18s; }
.js-voice-bars span:nth-child(3) { animation-delay: 0.36s; }
.js-widget-root:not(.is-agent-talking) .js-voice-bars span {
  animation-play-state: paused;
  opacity: 0.5;
  transform: scaleY(0.58);
}
.js-voice-stage__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.js-voice-stage__status {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 24px;
  margin: 0;
}
.js-voice-stage__hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

/* ---------- voice transcript ---------- */
.js-voice-transcript {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 8px;
  line-height: 1.6;
  max-height: 220px;
  min-height: 116px;
  overflow-y: auto;
  padding: 12px;
}
.js-voice-transcript__placeholder {
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}
.js-voice-turn {
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 88%;
  padding: 10px 12px;
}
.js-voice-turn--agent {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.js-voice-turn--user {
  align-self: flex-end;
  background: rgba(30, 64, 216, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.js-voice-turn__label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.js-voice-turn__text {
  color: #fff;
  margin: 0;
  white-space: pre-wrap;
}

/* ---------- voice actions ---------- */
.js-voice-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1.4fr 1fr;
}
.js-voice-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 14px;
}
.js-voice-button--primary {
  background: #1d4ed8;
  border-color: transparent;
  color: #fff;
}
.js-voice-button--danger {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}
.js-voice-button--danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.js-widget-sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@keyframes js-widget-bars {
  0%,
  100% {
    transform: scaleY(0.42);
  }

  50% {
    transform: scaleY(1);
  }
}

@media (max-width: 767px) {
  #js-widget-stack {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
    right: 10px;
  }

  #chatbot-widget-root,
  #voicebot-widget-root {
    width: calc(100vw - 20px);
  }

  .js-widget-panel {
    bottom: calc(100% + 8px);
  }

  .js-widget-panel__body {
    gap: 12px;
    padding: 16px;
  }

  .js-widget-shell {
    align-items: stretch;
  }

  .js-widget-launcher {
    padding: 8px 14px;
  }

  .js-chat-log {
    max-height: 44vh;
  }

  .js-chat-send {
    width: 48px;
  }

  .js-voice-stage {
    align-items: flex-start;
    flex-direction: column;
  }

  .js-voice-actions {
    grid-template-columns: 1fr;
  }
}

@keyframes js-widget-send-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
