.jt2-chat {
  --jt2-primary: #16352f;
  --jt2-accent: #d4a64a;
  --jt2-bg: #f4f6f3;
  --jt2-ink: #17211f;
  --jt2-muted: #66736f;
  --jt2-danger: #a32020;
  position: fixed;
  z-index: 2147482000;
  bottom: max(22px, env(safe-area-inset-bottom));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--jt2-ink);
  line-height: 1.45;
  text-align: left;
}

.jt2-chat--right {
  right: max(22px, env(safe-area-inset-right));
}

.jt2-chat--left {
  left: max(22px, env(safe-area-inset-left));
}

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

.jt2-chat button,
.jt2-chat input,
.jt2-chat select {
  font: inherit;
}

.jt2-chat__launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  max-width: min(310px, calc(100vw - 32px));
  padding: 10px 18px 10px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--jt2-primary);
  color: #fff;
  box-shadow: 0 16px 44px rgba(10, 27, 23, .28);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.jt2-chat__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 19px 48px rgba(10, 27, 23, .34);
}

.jt2-chat__launcher:focus-visible,
.jt2-chat button:focus-visible,
.jt2-chat input:focus-visible,
.jt2-chat select:focus-visible,
.jt2-chat a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--jt2-accent) 80%, #fff);
  outline-offset: 2px;
}

.jt2-chat__launcher-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--jt2-accent);
  color: var(--jt2-primary);
}

.jt2-chat__launcher-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.jt2-chat__launcher-text {
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jt2-chat__pulse {
  position: absolute;
  top: 3px;
  left: 43px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #4bd37b;
}

.jt2-chat--open .jt2-chat__launcher {
  opacity: 0;
  pointer-events: none;
  transform: scale(.92);
}

.jt2-chat__panel {
  position: absolute;
  bottom: 0;
  width: min(410px, calc(100vw - 28px));
  height: min(690px, calc(100vh - 36px - env(safe-area-inset-top)));
  overflow: hidden;
  border: 1px solid rgba(22, 53, 47, .13);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(10, 27, 23, .28);
  animation: jt2-chat-in .22s ease-out;
}

.jt2-chat--right .jt2-chat__panel {
  right: 0;
}

.jt2-chat--left .jt2-chat__panel {
  left: 0;
}

.jt2-chat__panel[hidden],
.jt2-chat__form[hidden],
.jt2-chat [hidden] {
  display: none !important;
}

.jt2-chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 15px 14px 15px 17px;
  background: var(--jt2-primary);
  color: #fff;
}

.jt2-chat__avatar {
  display: grid;
  flex: 0 0 47px;
  width: 47px;
  height: 47px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  background: var(--jt2-accent);
  color: var(--jt2-primary);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.jt2-chat__heading {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.jt2-chat__heading strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jt2-chat__heading span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
}

.jt2-chat__heading i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4bd37b;
  box-shadow: 0 0 0 3px rgba(75, 211, 123, .16);
}

.jt2-chat__close {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 29px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.jt2-chat__body {
  height: calc(100% - 119px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 17px 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(212, 166, 74, .09), transparent 34%),
    var(--jt2-bg);
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 53, 47, .25) transparent;
}

.jt2-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.jt2-chat__message {
  display: flex;
  max-width: 90%;
  align-items: flex-end;
  gap: 7px;
  animation: jt2-message-in .22s ease-out;
}

.jt2-chat__message--owner {
  align-self: flex-start;
}

.jt2-chat__message--visitor {
  align-self: flex-end;
}

.jt2-chat__mini-avatar {
  display: grid;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--jt2-primary);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}

.jt2-chat__bubble {
  max-width: 100%;
  margin: 0;
  padding: 11px 13px;
  border-radius: 15px 15px 15px 4px;
  background: #fff;
  color: var(--jt2-ink);
  box-shadow: 0 4px 15px rgba(20, 40, 35, .07);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}

.jt2-chat__message--visitor .jt2-chat__bubble {
  border-radius: 15px 15px 4px 15px;
  background: var(--jt2-primary);
  color: #fff;
}

.jt2-chat__quick-replies {
  display: grid;
  gap: 8px;
  margin: 16px 0 13px 34px;
}

.jt2-chat__quick-reply {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--jt2-primary) 24%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  color: var(--jt2-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.jt2-chat__quick-reply:hover {
  border-color: var(--jt2-accent);
  background: #fff;
  transform: translateX(2px);
}

.jt2-chat__quick-reply:disabled {
  opacity: .5;
  cursor: default;
  transform: none;
}

.jt2-chat__lead-trigger,
.jt2-chat__submit {
  width: calc(100% - 34px);
  margin: 0 0 0 34px;
  padding: 12px 15px;
  border: 0;
  border-radius: 12px;
  background: var(--jt2-accent);
  color: #14251f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--jt2-accent) 26%, transparent);
}

.jt2-chat__form {
  position: relative;
  display: grid;
  gap: 11px;
  margin-top: 15px;
  padding: 16px;
  border: 1px solid rgba(22, 53, 47, .12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(20, 40, 35, .07);
}

.jt2-chat__form-intro {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 2px;
}

.jt2-chat__form-intro strong {
  color: var(--jt2-primary);
  font-size: 15px;
}

.jt2-chat__form-intro span,
.jt2-chat__hint {
  color: var(--jt2-muted);
  font-size: 10px;
}

.jt2-chat__form label:not(.jt2-chat__consent):not(.jt2-chat__website) {
  display: grid;
  gap: 5px;
}

.jt2-chat__form label > span:first-child {
  color: #38433f;
  font-size: 10px;
  font-weight: 750;
}

.jt2-chat__form input[type="text"],
.jt2-chat__form input[type="tel"],
.jt2-chat__form input[type="email"],
.jt2-chat__form select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #ccd3cf;
  border-radius: 9px;
  background: #fff;
  color: var(--jt2-ink);
  font-size: 12px;
}

.jt2-chat__form input:focus,
.jt2-chat__form select:focus {
  border-color: var(--jt2-accent);
  outline: 2px solid color-mix(in srgb, var(--jt2-accent) 25%, transparent);
}

.jt2-chat__form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.jt2-chat__consent {
  display: grid;
  grid-template-columns: 17px 1fr;
  align-items: start;
  gap: 8px;
  margin-top: 2px;
  cursor: pointer;
}

.jt2-chat__consent input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--jt2-primary);
}

.jt2-chat__consent span {
  color: var(--jt2-muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.45;
}

.jt2-chat__consent a {
  color: var(--jt2-primary);
  font-weight: 700;
}

.jt2-chat__website {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.jt2-chat__status {
  min-height: 15px;
  color: var(--jt2-muted);
  font-size: 10px;
}

.jt2-chat__status--error {
  color: var(--jt2-danger);
  font-weight: 700;
}

.jt2-chat__submit {
  display: flex;
  width: 100%;
  min-height: 43px;
  margin: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
}

.jt2-chat__submit:disabled {
  opacity: .72;
  cursor: wait;
}

.jt2-chat__spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(20, 37, 31, .3);
  border-top-color: #14251f;
  border-radius: 50%;
  animation: jt2-spin .7s linear infinite;
}

.jt2-chat__submit.is-loading .jt2-chat__spinner {
  display: block;
}

.jt2-chat__footer {
  display: grid;
  height: 37px;
  place-items: center;
  border-top: 1px solid rgba(22, 53, 47, .1);
  background: #fff;
  color: #7d8884;
  font-size: 9px;
  letter-spacing: .02em;
}

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

@keyframes jt2-message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 540px) {
  .jt2-chat {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 14px;
  }

  .jt2-chat__launcher {
    margin-left: auto;
  }

  .jt2-chat--left .jt2-chat__launcher {
    margin-right: auto;
    margin-left: 0;
  }

  .jt2-chat__panel,
  .jt2-chat--right .jt2-chat__panel,
  .jt2-chat--left .jt2-chat__panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(730px, calc(100vh - 28px - env(safe-area-inset-top)));
    margin: auto;
    border-radius: 20px;
  }
}

@media (max-width: 360px) {
  .jt2-chat__launcher-text {
    max-width: 190px;
  }

  .jt2-chat__form-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jt2-chat *,
  .jt2-chat *::before,
  .jt2-chat *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
