.lp004-support,
.lp004-support-launcher {
  --chat-ink: #18302a;
  --chat-muted: #50615a;
  --chat-header: #14382f;
  --chat-accent: #21624e;
  --chat-paper: #f2f5f0;
  --chat-line: #d5dfd7;
  --chat-edge: clamp(0.875rem, 2vw, 1.75rem);
  box-sizing: border-box;
  font-family: var(--font-body, system-ui, sans-serif);
  letter-spacing: normal;
}

.lp004-support[hidden],
.lp004-support [hidden],
.lp004-support-launcher[hidden],
.lp004-support-launcher [hidden],
.lp004-support-enabled .lp004-contact-launcher {
  display: none;
}

.lp004-support-launcher {
  position: fixed;
  right: max(var(--chat-edge), env(safe-area-inset-right));
  bottom: max(var(--chat-edge), env(safe-area-inset-bottom));
  z-index: 6;
  transform: translateY(calc(-1 * var(--chat-launcher-lift, 0px)));
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.38rem 0.92rem 0.38rem 0.47rem;
  border: 0;
  border-radius: 999px;
  color: var(--chat-ink);
  background: #fbfcf5;
  box-shadow: 0 5px 20px #081d1bbc;
  font-size: 0.87rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.lp004-support-launcher-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #f9fcf6;
  background: var(--chat-header);
}

.lp004-support-unread {
  position: absolute;
  inset: -0.28rem -0.2rem auto auto;
  display: grid;
  place-items: center;
  min-width: 1.35rem;
  min-height: 1.35rem;
  padding-inline: 0.24rem;
  border: 2px solid #fbfcf5;
  border-radius: 999px;
  color: #fff;
  background: #a93438;
  font-size: 0.69rem;
  font-variant-numeric: tabular-nums;
}

.lp004-support {
  position: fixed;
  right: max(var(--chat-edge), env(safe-area-inset-right));
  bottom: calc(var(--chat-viewport-gap, 0px) + max(var(--chat-edge), env(safe-area-inset-bottom)));
  z-index: 8;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(23rem, calc(100vw - var(--chat-edge) * 2));
  height: min(24rem, calc(100vh - var(--chat-edge) * 2));
  height: min(24rem, calc(var(--chat-visible-height, 100dvh) - var(--chat-edge) * 2));
  overflow: hidden;
  border-radius: 16px;
  color: var(--chat-ink);
  background: var(--chat-paper);
  box-shadow: 0 16px 50px #041710ad;
  outline: none;
  animation: lp004-support-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lp004-support.is-closing {
  pointer-events: none;
  animation: lp004-support-out 150ms ease-in both;
}

.lp004-support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 4.25rem;
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  border-bottom: 1px solid var(--chat-line);
  color: var(--chat-ink);
  background: #fff;
}

.lp004-support-header h2 {
  margin: 0;
  color: inherit;
  font-size: 1.07rem;
  font-weight: 750;
  line-height: 1.25;
}

.lp004-support-connection {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  margin-top: 0.27rem;
  color: var(--chat-muted);
  font-size: 0.73rem;
  line-height: 1.25;
}

.lp004-support-connection::before {
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #ab7025;
  content: "";
}

.lp004-support-connection[data-connected="true"]::before {
  background: #218058;
}

.lp004-support-tools {
  display: flex;
  flex: none;
  gap: 0.12rem;
  align-items: center;
}

.lp004-support button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.lp004-support button:disabled {
  cursor: default;
}

.lp004-support .lp004-support-alternate,
.lp004-support .lp004-support-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding-inline: 0.45rem;
  border-radius: 8px;
  color: #315247;
  background: transparent;
}

.lp004-support .lp004-support-alternate[hidden] {
  display: none;
}

.lp004-support .lp004-support-alternate {
  font-size: 0.77rem;
  font-weight: 650;
  white-space: nowrap;
}

.lp004-support-history {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  scrollbar-color: #9aaba0 var(--chat-paper);
}

.lp004-support-welcome,
.lp004-support-messages li {
  display: grid;
  justify-items: start;
  gap: 0.28rem;
  width: fit-content;
  max-width: 89%;
}

.lp004-support-welcome p,
.lp004-support-messages p {
  margin: 0;
  padding: 0.63rem 0.78rem;
  border: 1px solid var(--chat-line);
  border-radius: 3px 12px 12px;
  color: var(--chat-ink);
  background: #fff;
  font-size: 0.88rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.lp004-support-meta {
  color: var(--chat-muted);
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
}

.lp004-support-messages {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp004-support-messages li[data-sender="visitor"] {
  justify-self: end;
  justify-items: end;
}

.lp004-support-messages li[data-sender="visitor"] p {
  border-color: #c9dfd1;
  border-radius: 12px 3px 12px 12px;
  background: #daede1;
}

.lp004-support-problem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.35rem 0.8rem;
  color: #782a20;
  background: #fff0ec;
  font-size: 0.8rem;
}

.lp004-support-problem p {
  margin: 0;
}

.lp004-support-problem button {
  flex-shrink: 0;
  min-height: 2.75rem;
  padding-inline: 0.7rem;
  border-radius: 8px;
  color: inherit;
  background: #f4d9d1;
  font-weight: 740;
}

.lp004-support-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.65rem;
  border-top: 1px solid var(--chat-line);
  background: #fff;
}

.lp004-support-composer textarea {
  display: block;
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 6rem;
  padding: 0.61rem 0.7rem;
  border: 1px solid #aabbb0;
  border-radius: 9px;
  color: var(--chat-ink);
  background: #fafbf8;
  caret-color: var(--chat-accent);
  font: 16px/1.4 var(--font-body, system-ui, sans-serif);
  resize: none;
}

@supports (field-sizing: content) {
  .lp004-support-composer textarea {
    height: auto;
    field-sizing: content;
  }
}

.lp004-support-composer textarea::placeholder {
  color: var(--chat-muted);
}

.lp004-support .lp004-support-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.75rem;
  padding-inline: 0.68rem;
  border-radius: 9px;
  color: #fff;
  background: var(--chat-accent);
  font-size: 0.83rem;
  font-weight: 720;
  white-space: nowrap;
}

.lp004-support .lp004-support-send:disabled {
  color: #51645a;
  background: #ebf0eb;
}

@media (hover: hover) {
  .lp004-support-launcher:hover { background: #e4f0e6; }
  .lp004-support .lp004-support-alternate:hover,
  .lp004-support .lp004-support-close:hover { background: #eaf2eb; }
  .lp004-support .lp004-support-send:hover:not(:disabled) { background: var(--chat-header); }
  .lp004-support-problem button:hover { background: #edc4ba; }
}

.lp004-support-launcher:focus-visible,
.lp004-support button:focus-visible {
  outline: 2px solid var(--chat-accent);
  outline-offset: 2px;
}

.lp004-support-launcher:focus-visible { outline-color: #f7d588; }

.lp004-support button.lp004-support-send:focus-visible,
.lp004-support-problem button:focus-visible,
.lp004-support textarea:focus-visible {
  outline: 2px solid var(--chat-accent);
  outline-offset: 1px;
}

.lp004-support-history:focus-visible {
  outline: 2px solid var(--chat-accent);
  outline-offset: -2px;
}

.lp004-support ::selection {
  color: var(--chat-ink);
  background: #d2e8d9;
}

@media (max-width: 600px) {
  .lp004-support {
    right: 0;
    bottom: var(--chat-viewport-gap, 0px);
    width: 100%;
    height: min(22rem, calc(100vh - 0.75rem));
    height: min(22rem, calc(var(--chat-visible-height, 100dvh) - 0.75rem));
    border-radius: 16px 16px 0 0;
  }

  .lp004-support-header {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(0.6rem, env(safe-area-inset-right));
  }

  .lp004-support-composer {
    padding: 0.65rem max(0.75rem, env(safe-area-inset-right)) max(0.65rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }
}

@keyframes lp004-support-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lp004-support-out {
  to { opacity: 0; transform: translateY(10px); }
}

@media (prefers-reduced-motion: reduce) {
  .lp004-support,
  .lp004-support.is-closing { animation: none; }
  .lp004-support-launcher { transition: none; }
}
