:root {
  --impulso-chatbot-primary: #111111;
  --impulso-chatbot-accent: #c0392b;
  --impulso-chatbot-surface: #f5efe6;
  --impulso-chatbot-surface-soft: #fbf7f1;
  --impulso-chatbot-text: #111111;
  --impulso-chatbot-muted: #666666;
  --impulso-chatbot-border: rgba(0, 0, 0, 0.08);
  --impulso-chatbot-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.impulso-chatbot {
  position: fixed;
  right: 24px !important;
  bottom: 24px !important;
  left: auto !important;
  top: auto !important;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 14px;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--impulso-chatbot-text);
  pointer-events: auto;
}

.impulso-chatbot[data-position="left"] {
  left: 24px;
  right: auto;
}

.impulso-chatbot :where(button) {
  font: inherit;
}

.impulso-chatbot .impulso-chatbot__toggle,
.impulso-chatbot .impulso-chatbot__close,
.impulso-chatbot .impulso-chatbot__option,
.impulso-chatbot .impulso-chatbot__nav-button,
.impulso-chatbot .impulso-chatbot__cta-button {
  all: unset;
  box-sizing: border-box;
}

.impulso-chatbot__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  min-width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border: 0;
  box-shadow: none;
  transition: transform 180ms ease;
  pointer-events: auto;
  touch-action: manipulation;
}

.impulso-chatbot__toggle:hover {
  transform: scale(1.08);
}

.impulso-chatbot__toggle-mark {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}

.impulso-chatbot__toggle-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.impulso-chatbot__toggle-copy {
  display: none;
}

.impulso-chatbot__toggle:focus-visible,
.impulso-chatbot__close:focus-visible,
.impulso-chatbot__option:focus-visible,
.impulso-chatbot__nav-button:focus-visible,
.impulso-chatbot__cta-button:focus-visible {
  outline: 2px solid var(--impulso-chatbot-accent);
  outline-offset: 2px;
}

.impulso-chatbot__panel {
  width: 355px;
  height: auto;
  max-height: min(520px, calc(100vh - 32px));
  padding: 0;
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--impulso-chatbot-surface);
  box-shadow: var(--impulso-chatbot-shadow);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.06);
  animation: impulso-chatbot-panel-in 250ms cubic-bezier(.4, 0, .2, 1);
  transform-origin: bottom right;
  pointer-events: auto;
}

.impulso-chatbot__panel[hidden] {
  display: none;
}

@keyframes impulso-chatbot-panel-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.impulso-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #fbf7f1;
  color: #111111;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.impulso-chatbot__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.impulso-chatbot__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 2px;
}

.impulso-chatbot__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.impulso-chatbot__brand-copy {
  min-width: 0;
}

.impulso-chatbot__title {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  color: #111111;
}

.impulso-chatbot__eyebrow {
  margin-top: 1px;
  font-size: 10.5px;
  line-height: 1.2;
  color: #6d6459;
  display: flex;
  align-items: center;
  gap: 5px;
}

.impulso-chatbot__online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: #2ecc71;
  vertical-align: middle;
  animation: impulso-online-pulse 2s infinite;
}

@keyframes impulso-online-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.impulso-chatbot__close {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #777;
  transition: color 160ms ease, transform 160ms ease;
}

.impulso-chatbot__close:hover {
  color: #111111;
  transform: scale(1.06);
}

.impulso-chatbot__viewport {
  flex: 0 0 auto;
  min-height: 0;
  background: #fcf8f3;
  padding: 5px 12px 5px;
}

.impulso-chatbot__conversation {
  height: auto;
  max-height: min(340px, calc(100vh - 240px));
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
  scrollbar-width: none;
}

.impulso-chatbot__conversation::-webkit-scrollbar {
  display: none;
}

.impulso-chatbot__message-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.impulso-chatbot__message-row--user {
  justify-content: flex-end;
}

.impulso-chatbot__message-row--bot {
  justify-content: flex-start;
}

.impulso-chatbot__message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1px;
}

.impulso-chatbot__message-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.impulso-chatbot__message-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: calc(100% - 36px);
}

.impulso-chatbot__message-row--user .impulso-chatbot__message-stack {
  max-width: 86%;
}

.impulso-chatbot__message-bubble {
  border-radius: 18px 18px 18px 6px;
  padding: 8px 11px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.impulso-chatbot__message-bubble p {
  margin: 0;
  font-size: 13px;
  line-height: 1.44;
  font-weight: 400;
}

.impulso-chatbot__message-bubble p + p {
  margin-top: 6px;
}

.impulso-chatbot__message-bubble--bot {
  background: #fffefb;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #111111;
  border-bottom-left-radius: 6px;
}

.impulso-chatbot__message-bubble--user {
  background: linear-gradient(180deg, #c94d3c 0%, #b8382b 100%);
  color: #fff;
  border-bottom-right-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.impulso-chatbot__options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.impulso-chatbot__option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #111111;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.impulso-chatbot__option:hover {
  transform: translateY(-1px);
  border-color: rgba(192, 57, 43, 0.8);
  background: rgba(192, 57, 43, 0.05);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.impulso-chatbot__option-emoji {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(192, 57, 43, 0.12);
  border: 1px solid rgba(192, 57, 43, 0.14);
  color: #111111;
  font-size: 15px;
  line-height: 1;
}

.impulso-chatbot__option-media {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(192, 57, 43, 0.12);
  border: 1px solid rgba(192, 57, 43, 0.14);
}

.impulso-chatbot__option-media img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.impulso-chatbot__option-label {
  font-size: 12.5px;
  line-height: 1.22;
  font-weight: 600;
  text-align: left;
  flex: 1 1 auto;
  color: #111111;
}

.impulso-chatbot__option--media {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  justify-items: start;
}

.impulso-chatbot__option--media .impulso-chatbot__option-media {
  grid-column: 1;
}

.impulso-chatbot__option--media .impulso-chatbot__option-label {
  grid-column: 2;
  min-width: 0;
  line-height: 1.2;
  transform: translateY(0);
}

.impulso-chatbot__option--back .impulso-chatbot__option-label {
  margin-left: 2px;
}

.impulso-chatbot__option--back .impulso-chatbot__option-emoji {
  margin-right: 2px;
}

.impulso-chatbot__cta-label {
  font-size: 12.5px;
  line-height: 1.3;
  font-weight: 600;
  color: #111111;
}

.impulso-chatbot__cta-note {
  font-size: 10.5px;
  line-height: 1.3;
  color: #6a6a6a;
  white-space: pre-line;
}

.impulso-chatbot__cta-button {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  cursor: pointer;
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.impulso-chatbot__cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

.impulso-chatbot__cta-button--wodbuster {
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.impulso-chatbot__cta-button--wodbuster:hover {
  background: #fafafa;
  color: #111111;
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.impulso-chatbot__cta-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 2px;
}

.impulso-chatbot__cta-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.impulso-chatbot__cta-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.impulso-chatbot__cta-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.impulso-chatbot__footer {
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fbf7f1;
}

.impulso-chatbot__nav-button {
  flex: 1 1 auto;
  min-height: 58px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fffaf5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #111111;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.impulso-chatbot__nav-button:hover {
  border-color: rgba(192, 57, 43, 0.45);
  color: #c0392b;
  background: rgba(192, 57, 43, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.impulso-chatbot__nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(192, 57, 43, 0.12);
  border: 1px solid rgba(192, 57, 43, 0.14);
  color: #111111;
  font-size: 15px;
  line-height: 1;
}

.impulso-chatbot__nav-label {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
  color: #111111;
}

.impulso-chatbot__nav-button--ghost {
  background: #fbf7f1;
}

.impulso-chatbot__privacy {
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.35;
  color: #666666;
}

.impulso-chatbot__privacy a {
  color: #c0392b;
  text-decoration: none;
  font-weight: 700;
}

.impulso-chatbot__back-symbol {
  font-size: 14px;
  line-height: 1;
  opacity: 0.8;
}

.impulso-chatbot__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.impulso-chatbot__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.impulso-chatbot-editor-notice {
  padding: 16px;
  border: 1px solid var(--impulso-chatbot-border);
  border-radius: 12px;
  background: #fff;
  color: var(--impulso-chatbot-text);
}

@media (max-width: 640px) {
  body.has-mobile-cta .impulso-chatbot {
    right: 12px !important;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .impulso-chatbot[data-position="left"] {
    left: 12px !important;
    right: auto !important;
  }

  .impulso-chatbot__toggle {
    width: 52px;
    min-width: 52px;
    height: 52px;
  }

  .impulso-chatbot__toggle-mark {
    width: 52px;
    height: 52px;
  }

  .impulso-chatbot__panel {
    width: calc(100vw - 24px);
    height: auto;
    max-height: min(88vh, 700px);
  }

  .impulso-chatbot__header {
    padding: 8px 11px;
  }

  .impulso-chatbot__viewport {
    padding: 3px 9px 4px;
  }

  .impulso-chatbot__conversation {
    max-height: min(430px, calc(100vh - 184px));
    gap: 6px;
  }

  .impulso-chatbot__options {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .impulso-chatbot__options--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .impulso-chatbot__option {
    min-height: 46px;
    padding: 8px 11px;
  }

  .impulso-chatbot__options--compact .impulso-chatbot__option {
    min-height: 42px;
    padding: 7px 10px;
  }

  .impulso-chatbot__option-emoji,
  .impulso-chatbot__option-media {
    width: 30px;
    height: 30px;
  }

  .impulso-chatbot__options--compact .impulso-chatbot__option-emoji,
  .impulso-chatbot__options--compact .impulso-chatbot__option-media {
    width: 28px;
    height: 28px;
  }

  .impulso-chatbot__option-media img {
    width: 18px;
    height: 18px;
  }

  .impulso-chatbot__options--compact .impulso-chatbot__option-media img {
    width: 16px;
    height: 16px;
  }

  .impulso-chatbot__option-label {
    font-size: 12px;
  }

  .impulso-chatbot__options--compact .impulso-chatbot__option-label {
    font-size: 11px;
    line-height: 1.12;
  }
}

@media (max-width: 390px) {
  .impulso-chatbot__message-row--user .impulso-chatbot__message-stack {
    max-width: 92%;
  }
}
