.psaiw-widget {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9999;
  font-family: Arial, sans-serif;
  pointer-events: none;
  width: auto;
  height: auto;
}

.psaiw-widget * {
  pointer-events: auto;
}

.psaiw-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  pointer-events: none;
}

.psaiw-entry > * {
  pointer-events: auto;
}

.psaiw-widget--panel-open .psaiw-entry {
  display: none;
}

.psaiw-launcher {
  position: relative;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #14d876 0%, #04bb61 100%);
  box-shadow: 0 12px 30px rgba(11, 181, 99, 0.22);
  cursor: pointer;
}

.psaiw-launcher__badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 27px;
  height: 27px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef5248;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(239, 82, 72, 0.26);
}

.psaiw-launcher__icon {
  width: 34px;
  height: 34px;
  background: #fff;
  border-radius: 50% 50% 50% 15%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transform: translateY(1px);
}

.psaiw-launcher__icon span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #18b86d;
}

.psaiw-cta {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  max-width: min(355px, calc(100vw - 108px));
  padding: 0 22px;
  border: 2px solid #1fb86d;
  border-radius: 22px;
  background: #fff;
  color: #1f2f4f;
  box-shadow: 0 10px 28px rgba(18, 40, 29, 0.12);
  cursor: pointer;
  text-align: left;
}

.psaiw-cta__text {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 500;
}

.psaiw-panel {
  width: min(340px, calc(100vw - 24px));
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 48px rgba(14, 32, 53, 0.15);
}

.psaiw-panel__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
  padding: 6px 10px;
  background: #102b57;
  color: #fff;
}

.psaiw-panel__close {
  border: 0;
  background: transparent;
  color: #fff;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
}

.psaiw-panel__intro {
  padding: 16px 18px 14px;
  text-align: center;
  background: #fff;
}

.psaiw-panel__intro--compact {
  padding-top: 10px;
  padding-bottom: 12px;
}

.psaiw-panel__intro-copy {
  margin: 0;
  color: #27344a;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

.psaiw-panel__intro-copy--compact {
  font-size: 11px;
  line-height: 1.35;
  font-weight: 400;
  color: #62718c;
}

.psaiw-panel__intro-copy[hidden] {
  display: none;
}

.psaiw-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4ad96e 0%, #21b954 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(33, 185, 84, 0.18);
}

.psaiw-panel__intro--compact .psaiw-whatsapp {
  margin-top: 8px;
  min-height: 40px;
}

.psaiw-whatsapp__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
}

.psaiw-whatsapp__icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

.psaiw-messages {
  min-height: 170px;
  max-height: 300px;
  overflow-y: auto;
  padding: 14px 14px 16px;
  background: linear-gradient(180deg, #f7fafc 0%, #eef3f7 100%);
  border-top: 1px solid #edf2f6;
  border-bottom: 1px solid #edf2f6;
}

.psaiw-message {
  margin-bottom: 14px;
}

.psaiw-message--user {
  text-align: right;
}

.psaiw-bubble {
  display: inline-block;
  max-width: 84%;
  padding: 12px 15px;
  border-radius: 18px;
  background: #fff;
  color: #1f2f41;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(26, 42, 63, 0.07);
}

.psaiw-message--user .psaiw-bubble {
  background: #102b57;
  color: #fff;
}

.psaiw-form {
  padding: 12px 14px 14px;
  background: #fff;
}

.psaiw-conversation-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px 0;
  background: #fff;
}

.psaiw-conversation-feedback__label {
  color: #607086;
  font-size: 11px;
  line-height: 1.35;
}

.psaiw-conversation-feedback__thanks {
  color: #607086;
  font-size: 11px;
}

.psaiw-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.psaiw-form textarea {
  flex: 1 1 auto;
  height: 46px;
  min-height: 46px;
  max-height: 120px;
  resize: none;
  border: 2px solid #2b76b1;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  color: #24324b;
}

.psaiw-send {
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #102b57;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.psaiw-feedback {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.psaiw-feedback--conversation {
  margin-top: 0;
}

.psaiw-feedback__button {
  width: 28px;
  height: 28px;
  border: 1px solid #d9e2ea;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #7a8798;
  opacity: 0.72;
  transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.psaiw-feedback__button:hover,
.psaiw-feedback__button:focus {
  opacity: 1;
  color: #20314f;
  border-color: #b8c6d4;
  outline: none;
}

.psaiw-feedback__icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
}

.psaiw-feedback__icon svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: currentColor;
}

.psaiw-feedback__thanks {
  color: #607086;
  font-size: 11px;
}

.psaiw-send[disabled],
.psaiw-form textarea[disabled] {
  opacity: 0.7;
  cursor: wait;
}

@media (max-width: 767px) {
  .psaiw-widget {
    left: 12px;
    bottom: 12px;
  }

  .psaiw-launcher {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  .psaiw-cta {
    min-height: 52px;
    max-width: calc(100vw - 92px);
    padding: 0 16px;
  }

  .psaiw-cta__text {
    font-size: 14px;
  }

  .psaiw-panel {
    width: min(100vw - 24px, 340px);
  }

  .psaiw-conversation-feedback {
    align-items: flex-start;
  }
}
