.hp-chatbot {
  --hp-chatbot-mobile-offset: 104px;
  position: fixed;
  inset: auto 24px 24px auto;
  right: 24px;
  bottom: 24px;
  z-index: 280;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  box-sizing: border-box;
  font-family: var(--hp-font-primary);
  pointer-events: none;
}

.hp-chatbot *,
.hp-chatbot *::before,
.hp-chatbot *::after {
  box-sizing: border-box;
}

.hp-chatbot > * {
  pointer-events: auto;
}

.hp-chatbot .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hp-chatbot__launcher,
.hp-chatbot__submit,
.hp-chatbot__chip,
.hp-chatbot__close,
.hp-chatbot__source {
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.hp-chatbot__launcher {
  min-height: 72px;
  padding: 12px 14px 12px 12px;
  border: 1px solid rgba(0, 39, 69, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 56px rgba(0, 39, 69, 0.16);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-width: 214px;
  color: var(--hp-dark);
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hp-chatbot__launcher:hover,
.hp-chatbot.is-open .hp-chatbot__launcher {
  transform: translateY(-1px);
  box-shadow: 0 30px 60px rgba(0, 39, 69, 0.2);
}

.hp-chatbot__launcher.is-hidden-docked {
  display: none;
}

.hp-chatbot__launcher-icon,
.hp-chatbot__brand-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, #33a455 0%, #2d8c46 60%, #1f6e35 100%);
  display: block;
  flex: 0 0 auto;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(45, 140, 70, 0.24);
}

.hp-chatbot__launcher-icon::before,
.hp-chatbot__launcher-icon::after,
.hp-chatbot__brand-icon::before,
.hp-chatbot__brand-icon::after {
  content: "";
  position: absolute;
  background: #fff;
}

.hp-chatbot__launcher-icon::before,
.hp-chatbot__brand-icon::before {
  inset: 11px 9px 13px 10px;
  border-radius: 10px 10px 10px 3px;
}

.hp-chatbot__launcher-icon::after,
.hp-chatbot__brand-icon::after {
  width: 10px;
  height: 10px;
  right: 8px;
  bottom: 8px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.hp-chatbot__launcher-copy {
  display: grid;
  gap: 3px;
  text-align: left;
}

.hp-chatbot__launcher-mobile-label {
  display: none;
  min-width: 0;
}

.hp-chatbot__launcher-copy small {
  font-size: 0.69rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 39, 69, 0.56);
}

.hp-chatbot__launcher-copy strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.hp-chatbot__launcher-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(45, 140, 70, 0.1);
  color: var(--hp-primary);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.hp-chatbot__panel {
  width: min(408px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 128px));
  border: 1px solid rgba(0, 39, 69, 0.1);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 34px 80px rgba(0, 39, 69, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  transform-origin: right bottom;
}

.hp-chatbot.is-open .hp-chatbot__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hp-chatbot__panel-header {
  padding: 18px 18px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(0, 39, 69, 0.08);
  background:
    radial-gradient(circle at top right, rgba(45, 140, 70, 0.14), transparent 38%),
    linear-gradient(180deg, #f8fcf9 0%, #ffffff 100%);
}

.hp-chatbot__brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.hp-chatbot__brand-icon {
  align-self: flex-start;
}

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

.hp-chatbot__eyebrow {
  margin: 0 0 6px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0, 39, 69, 0.56);
}

.hp-chatbot__title {
  margin: 0;
  font-family: var(--hp-font-primary);
  font-size: 1.08rem;
  line-height: 1.3;
  color: var(--hp-dark);
}

.hp-chatbot__lead {
  margin: 6px 0 0;
  color: var(--hp-text-light);
  font-size: 0.84rem;
  line-height: 1.7;
}

.hp-chatbot__header-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.hp-chatbot__status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(45, 140, 70, 0.08);
  color: var(--hp-primary);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.hp-chatbot__close {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(0, 39, 69, 0.12);
  background: #fff;
  color: var(--hp-dark);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.hp-chatbot__close:hover {
  background: rgba(45, 140, 70, 0.06);
}

.hp-chatbot__messages {
  min-height: 250px;
  max-height: 360px;
  padding: 18px 18px 12px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(248, 252, 249, 0.8) 0%, rgba(255, 255, 255, 0) 24%),
    #ffffff;
}

.hp-chatbot__message {
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 8px;
}

.hp-chatbot__message--assistant {
  align-items: flex-start;
  padding-left: 34px;
}

.hp-chatbot__message--assistant::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: linear-gradient(135deg, #33a455 0%, #2d8c46 100%);
  box-shadow: 0 10px 18px rgba(45, 140, 70, 0.2);
}

.hp-chatbot__message--assistant::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 8px;
  width: 10px;
  height: 8px;
  border-radius: 4px;
  background: #fff;
}

.hp-chatbot__message--user {
  align-items: flex-end;
}

.hp-chatbot__bubble {
  max-width: min(100%, 304px);
  padding: 14px 16px;
  border-radius: 18px;
  background: #f5f7f8;
  border: 1px solid rgba(0, 39, 69, 0.06);
  color: var(--hp-dark);
  font-size: 0.92rem;
  line-height: 1.78;
  box-shadow: 0 12px 22px rgba(0, 39, 69, 0.05);
}

.hp-chatbot__message--assistant .hp-chatbot__bubble {
  border-top-left-radius: 8px;
}

.hp-chatbot__message--user .hp-chatbot__bubble {
  border-top-right-radius: 8px;
  background: linear-gradient(135deg, #2d8c46 0%, #37a257 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 28px rgba(45, 140, 70, 0.2);
}

.hp-chatbot__bubble p {
  margin: 0;
}

.hp-chatbot__meta-text {
  margin-top: 8px;
  color: rgba(0, 39, 69, 0.6);
  font-size: 0.79rem;
}

.hp-chatbot__sources {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding-left: 34px;
  padding-right: 2px;
  padding-bottom: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: min(100%, 336px);
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.hp-chatbot__message--user .hp-chatbot__sources {
  padding-left: 0;
  max-width: min(100%, 304px);
}

.hp-chatbot__sources::-webkit-scrollbar {
  display: none;
}

.hp-chatbot__source {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(45, 140, 70, 0.18);
  background: #fff;
  color: var(--hp-primary);
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 18px rgba(0, 39, 69, 0.04);
  scroll-snap-align: start;
}

.hp-chatbot__source:hover {
  transform: translateY(-1px);
  background: rgba(45, 140, 70, 0.08);
}

.hp-chatbot__bubble--typing {
  padding: 13px 15px;
}

.hp-chatbot__typing-body {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.hp-chatbot__typing-orb {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(45, 140, 70, 0.1) 0%, rgba(45, 140, 70, 0.18) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hp-chatbot__typing-orb span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hp-primary);
  opacity: 0.34;
  animation: hp-chatbot-bounce 1.2s ease-in-out infinite;
}

.hp-chatbot__typing-orb span:nth-child(2) {
  animation-delay: 0.15s;
}

.hp-chatbot__typing-orb span:nth-child(3) {
  animation-delay: 0.3s;
}

.hp-chatbot__typing-copy {
  display: grid;
  gap: 2px;
}

.hp-chatbot__typing-label {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--hp-dark);
}

.hp-chatbot__typing-text {
  margin: 0;
  font-size: 0.76rem;
  color: rgba(0, 39, 69, 0.56);
}

.hp-chatbot__quicklist {
  padding: 0 18px 14px;
}

.hp-chatbot__quicklist-title {
  margin: 0 0 10px;
  color: rgba(0, 39, 69, 0.62);
  font-size: 0.78rem;
  font-weight: 700;
}

.hp-chatbot__suggestions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.hp-chatbot__suggestions::-webkit-scrollbar {
  display: none;
}

.hp-chatbot__chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 39, 69, 0.09);
  background: #ffffff;
  color: var(--hp-dark);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  scroll-snap-align: start;
}

.hp-chatbot__chip:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 140, 70, 0.2);
  background: rgba(45, 140, 70, 0.05);
}

.hp-chatbot.has-conversation .hp-chatbot__quicklist {
  padding-top: 2px;
}

.hp-chatbot__form {
  padding: 0 18px 12px;
}

.hp-chatbot__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid rgba(0, 39, 69, 0.1);
  background: #fff;
  box-shadow: 0 16px 28px rgba(0, 39, 69, 0.06);
}

.hp-chatbot__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--hp-dark);
  font-size: 0.94rem;
  line-height: 1.5;
  padding: 0 6px;
}

.hp-chatbot__input::placeholder {
  color: rgba(0, 39, 69, 0.42);
}

.hp-chatbot__input:focus {
  outline: none;
}

.hp-chatbot__submit {
  min-width: 90px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #2d8c46 0%, #37a257 100%);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(45, 140, 70, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hp-chatbot__submit:hover {
  transform: translateY(-1px);
}

.hp-chatbot__submit:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.hp-chatbot__submit-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
  display: none;
}

.hp-chatbot.is-busy .hp-chatbot__submit-spinner {
  display: inline-block;
  animation: hp-chatbot-spin 0.8s linear infinite;
}

.hp-chatbot__disclaimer {
  margin: 0;
  padding: 0 18px 18px;
  color: rgba(0, 39, 69, 0.56);
  font-size: 0.76rem;
  line-height: 1.7;
}

body.is-menu-open .hp-chatbot {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.hp-fixed-cta__chat-slot {
  display: none;
}

@media (min-width: 768px) {
  .hp-chatbot {
    inset: auto 28px 28px auto;
    left: auto;
    right: 28px;
    bottom: 28px;
    align-items: flex-end;
  }

  .hp-chatbot__panel {
    transform-origin: right bottom;
  }
}

@media (min-width: 900px) and (max-width: 1099px) {
  .hp-chatbot {
    inset: auto 84px 28px auto;
    right: 84px;
  }
}

@media (min-width: 1100px) {
  .hp-chatbot {
    inset: auto 112px 28px auto;
    right: 112px;
  }
}

@keyframes hp-chatbot-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.28;
  }

  40% {
    transform: translateY(-3px);
    opacity: 0.76;
  }
}

@keyframes hp-chatbot-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  .hp-chatbot {
    inset: auto 12px calc(var(--hp-chatbot-mobile-offset, 104px) + env(safe-area-inset-bottom, 0px)) 12px;
    left: 12px;
    right: 12px;
    bottom: calc(var(--hp-chatbot-mobile-offset, 104px) + env(safe-area-inset-bottom, 0px));
    align-items: stretch;
    top: auto;
  }

  .hp-fixed-cta__chat-slot {
    display: block;
    padding: 0 0 8px;
  }

  .hp-chatbot__launcher {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 16px;
    grid-template-columns: auto 1fr auto;
    justify-items: stretch;
    gap: 10px;
    box-shadow: 0 18px 34px rgba(0, 39, 69, 0.14);
  }

  .hp-chatbot__launcher.is-mobile-docked {
    margin: 0;
  }

  .hp-chatbot__panel {
    width: min(392px, calc(100vw - 24px));
    max-height: min(74vh, calc(100vh - 154px));
    border-radius: 24px;
    transform-origin: left bottom;
  }

  .hp-chatbot:not(.is-mobile-ready):not(.is-open) .hp-chatbot__launcher {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
  }

  .hp-chatbot__launcher-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 28px;
    max-height: 28px;
    border-radius: 10px;
    box-shadow: 0 10px 18px rgba(45, 140, 70, 0.18);
  }

  .hp-chatbot__launcher-icon::before {
    inset: 7px 6px 8px 7px;
    border-radius: 6px 6px 6px 2px;
  }

  .hp-chatbot__launcher-icon::after {
    width: 7px;
    height: 7px;
    right: 5px;
    bottom: 5px;
  }

  .hp-chatbot__launcher-copy {
    display: none;
  }

  .hp-chatbot__launcher-mobile-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--hp-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hp-chatbot__launcher-tag {
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .hp-chatbot__panel-header {
    padding: 16px 16px 14px;
  }

  .hp-chatbot__messages {
    max-height: 42vh;
    padding: 16px 16px 10px;
  }

  .hp-chatbot__quicklist,
  .hp-chatbot__form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hp-chatbot__disclaimer {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 16px;
  }

  .hp-chatbot__message--assistant {
    padding-left: 30px;
  }

  .hp-chatbot__message--assistant::before {
    width: 22px;
    height: 22px;
    border-radius: 8px;
  }

  .hp-chatbot__message--assistant::after {
    top: 15px;
    left: 6px;
    width: 10px;
    height: 7px;
  }

  .hp-chatbot__sources {
    padding-left: 30px;
    max-width: min(100%, 100%);
  }

  .hp-chatbot__chip {
    width: auto;
  }
}
