.pe-chat-widget {
  --pe-chat-green: #0b6d41;
  --pe-chat-dark: #174a39;
  --pe-chat-ink: #132a24;
  --pe-chat-muted: #60726b;
  --pe-chat-cream: #f5f4ec;
  --pe-chat-paper: #fffef9;
  --pe-chat-line: #dedfd2;
  --pe-chat-lime: #d7f05c;
  color: var(--pe-chat-ink);
  font-family: inherit;
}

.pe-chat-widget *,
.pe-chat-widget *::before,
.pe-chat-widget *::after {
  box-sizing: border-box;
}

.pe-chat-toggle,
.pe-chat-close,
.pe-chat-suggestion,
.pe-chat-send {
  font: inherit;
  cursor: pointer;
}

.pe-chat-toggle {
  position: fixed;
  z-index: 11;
  right: 23px;
  bottom: 82px;
  min-height: 49px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--pe-chat-dark);
  color: white;
  font-size: .9rem;
  font-weight: 700;
  box-shadow: 0 7px 22px #10251d30;
  transition: transform .18s ease, background .18s ease;
}

.pe-chat-toggle:hover {
  transform: translateY(-2px);
  background: var(--pe-chat-green);
}

.pe-chat-toggle:focus-visible,
.pe-chat-close:focus-visible,
.pe-chat-suggestion:focus-visible,
.pe-chat-send:focus-visible,
.pe-chat-input:focus-visible,
.pe-chat-privacy a:focus-visible {
  outline: 3px solid var(--pe-chat-lime);
  outline-offset: 3px;
}

.pe-chat-panel {
  position: fixed;
  z-index: 19;
  right: 22px;
  bottom: 143px;
  display: flex;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100dvh - 175px));
  min-height: 410px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--pe-chat-line);
  border-radius: 20px;
  background: var(--pe-chat-paper);
  box-shadow: 0 18px 48px #10251d24;
  transform-origin: bottom right;
  animation: pe-chat-in .16s ease-out;
}

.pe-chat-panel[hidden] {
  display: none;
}

.pe-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px 15px;
  background: var(--pe-chat-dark);
  color: white;
}

.pe-chat-title-group {
  min-width: 0;
}

.pe-chat-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--pe-chat-lime);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.pe-chat-title {
  margin: 0;
  color: white;
  font-size: 1.1rem;
  line-height: 1.3;
}

.pe-chat-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid #ffffff55;
  border-radius: 50%;
  background: transparent;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
}

.pe-chat-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  padding: 17px 16px 12px;
  overscroll-behavior: contain;
}

.pe-chat-message {
  display: flex;
  width: 100%;
}

.pe-chat-message-user {
  justify-content: flex-end;
}

.pe-chat-bubble {
  max-width: 88%;
  margin: 0;
  padding: 11px 13px;
  border-radius: 15px 15px 15px 4px;
  background: var(--pe-chat-cream);
  font-size: .92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.pe-chat-message-user .pe-chat-bubble {
  border-radius: 15px 15px 4px 15px;
  background: var(--pe-chat-green);
  color: white;
}

.pe-chat-pending {
  align-self: flex-start;
  margin: 0 0 0 3px;
  color: var(--pe-chat-muted);
  font-size: .82rem;
}

.pe-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 12px;
}

.pe-chat-suggestion {
  padding: 7px 10px;
  border: 1px solid var(--pe-chat-line);
  border-radius: 999px;
  background: transparent;
  color: var(--pe-chat-dark);
  font-size: .78rem;
  line-height: 1.3;
}

.pe-chat-suggestion:hover {
  border-color: var(--pe-chat-green);
  background: #f3f8f2;
}

.pe-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--pe-chat-line);
}

.pe-chat-input {
  width: 100%;
  min-height: 43px;
  max-height: 100px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--pe-chat-line);
  border-radius: 12px;
  background: white;
  color: var(--pe-chat-ink);
  font: inherit;
  font-size: .9rem;
  line-height: 1.35;
}

.pe-chat-input::placeholder {
  color: #77857f;
}

.pe-chat-send {
  min-height: 43px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  background: var(--pe-chat-lime);
  color: var(--pe-chat-ink);
  font-size: .85rem;
  font-weight: 700;
}

.pe-chat-send:disabled {
  cursor: wait;
  opacity: .7;
}

.pe-chat-privacy {
  margin: 0;
  padding: 0 16px 12px;
  color: var(--pe-chat-muted);
  font-size: .72rem;
  text-align: center;
}

.pe-chat-privacy a {
  color: var(--pe-chat-dark);
  text-underline-offset: 2px;
}

@keyframes pe-chat-in {
  from { opacity: 0; transform: translateY(7px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .pe-chat-toggle {
    right: 17px;
    bottom: 81px;
  }

  .pe-chat-panel {
    right: 10px;
    bottom: 140px;
    width: calc(100vw - 20px);
    height: min(590px, calc(100dvh - 160px));
    min-height: 370px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pe-chat-toggle,
  .pe-chat-panel {
    animation: none;
    transition: none;
  }
}
