.spreable-johnny6 {
  --j6-bg: #faf9f7;
  --j6-surface: #ffffff;
  --j6-surface-soft: #f4f3f1;
  --j6-surface-dark: #0f3329;
  --j6-surface-dark-strong: #08221a;
  --j6-ink: #1a1c1b;
  --j6-muted: #53605a;
  --j6-border: rgba(31, 42, 36, 0.14);
  --j6-border-strong: rgba(31, 42, 36, 0.24);
  --j6-accent: #25d366;
  --j6-accent-strong: #16a34a;
  --j6-focus: #25d366;
  --j6-shadow: 0 24px 72px rgba(8, 34, 26, 0.24);
  --j6-shadow-soft: 0 14px 34px rgba(8, 34, 26, 0.18);

  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9999;
  padding: 0 !important;
  color: var(--j6-ink);
  font-family: Inter, "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.spreable-johnny6 *,
.spreable-johnny6 *::before,
.spreable-johnny6 *::after {
  box-sizing: border-box;
}

.spreable-johnny6__toggle,
.spreable-johnny6__close,
.spreable-johnny6__contact-toggle,
.spreable-johnny6__send {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.spreable-johnny6__toggle:focus-visible,
.spreable-johnny6__close:focus-visible,
.spreable-johnny6__contact-toggle:focus-visible,
.spreable-johnny6__send:focus-visible,
.spreable-johnny6__input:focus-visible {
  outline: 3px solid rgba(99, 196, 77, 0.65);
  outline-offset: 3px;
}

.spreable-johnny6__toggle {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  max-width: min(300px, calc(100vw - 36px));
  padding: 8px 22px 8px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2bd86f, #20c763);
  color: #ffffff;
  box-shadow: 0 18px 36px rgba(37, 211, 102, 0.22);
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.spreable-johnny6__toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(37, 211, 102, 0.28);
}

.spreable-johnny6--open .spreable-johnny6__toggle {
  display: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
}

.spreable-johnny6__toggle-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(8, 34, 26, 0.06);
}

.spreable-johnny6__icon-svg {
  width: 27px;
  height: 27px;
  display: block;
  fill: currentColor;
  color: var(--j6-accent);
}

.spreable-johnny6__icon-phone {
  fill: currentColor;
  stroke: none;
}

.spreable-johnny6__toggle-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spreable-johnny6__panel {
  display: none;
  width: min(360px, calc(100vw - 32px));
  height: min(500px, calc(100vh - 104px));
  height: min(500px, calc(100svh - 104px));
  max-height: calc(100vh - 104px);
  max-height: calc(100svh - 104px);
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--j6-border);
  border-radius: 18px;
  background: var(--j6-bg);
  box-shadow: var(--j6-shadow);
}

.spreable-johnny6--open .spreable-johnny6__panel {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.spreable-johnny6__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #075e54, #06483f);
  color: #ffffff;
}

.spreable-johnny6__header-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.spreable-johnny6__avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--j6-accent);
  box-shadow: inset 0 0 0 1px rgba(8, 34, 26, 0.08);
}

.spreable-johnny6__avatar .spreable-johnny6__icon-svg {
  width: 25px;
  height: 25px;
}

.spreable-johnny6__heading {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.spreable-johnny6__title {
  overflow: hidden;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spreable-johnny6__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(241, 247, 244, 0.78);
  font-size: 0.82rem;
  font-weight: 650;
}

.spreable-johnny6__status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--j6-accent);
  box-shadow: 0 0 0 4px rgba(99, 196, 77, 0.16);
  content: "";
}

.spreable-johnny6__close {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  transition: background 160ms ease, transform 160ms ease;
}

.spreable-johnny6__close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.spreable-johnny6__close::before,
.spreable-johnny6__close::after {
  position: absolute;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.spreable-johnny6__close::before {
  transform: rotate(45deg);
}

.spreable-johnny6__close::after {
  transform: rotate(-45deg);
}

.spreable-johnny6__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(244, 243, 241, 0.92)),
    radial-gradient(circle at 16% 10%, rgba(99, 196, 77, 0.1), transparent 28%);
  scrollbar-color: rgba(83, 96, 90, 0.42) transparent;
}

.spreable-johnny6__message {
  position: relative;
  width: fit-content;
  max-width: min(88%, 29ch);
  margin: 0;
  padding: 12px 13px;
  border-radius: 16px;
  color: var(--j6-ink);
  font-size: 0.94rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.spreable-johnny6__message::before {
  display: block;
  margin-bottom: 4px;
  color: var(--j6-muted);
  content: attr(data-role);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.spreable-johnny6__message--assistant {
  align-self: flex-start;
  border: 1px solid var(--j6-border);
  border-top-left-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(31, 42, 36, 0.06);
}

.spreable-johnny6__message--user {
  align-self: flex-end;
  border-top-right-radius: 6px;
  background: linear-gradient(135deg, var(--j6-surface-dark), var(--j6-surface-dark-strong));
  color: #ffffff;
}

.spreable-johnny6__message--user::before {
  color: rgba(255, 255, 255, 0.72);
}

.spreable-johnny6__message--typing {
  color: var(--j6-muted);
  font-style: italic;
}

.spreable-johnny6__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  max-width: min(88%, 32ch);
}

.spreable-johnny6__action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--j6-accent-strong);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--j6-accent), var(--j6-accent-strong));
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 22px rgba(37, 211, 102, 0.24);
}

.spreable-johnny6__action:hover {
  border-color: var(--j6-accent);
  background: linear-gradient(135deg, #2ee875, var(--j6-accent-strong));
  color: #ffffff;
}

.spreable-johnny6__action--status {
  background: rgba(37, 211, 102, 0.08);
  color: var(--j6-surface-dark);
}

.spreable-johnny6__form {
  display: grid;
  gap: 9px;
  padding: 11px;
  border-top: 1px solid var(--j6-border);
  background: rgba(255, 255, 255, 0.94);
}

.spreable-johnny6__contact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.spreable-johnny6__contact-hint {
  min-width: 0;
  color: var(--j6-muted);
  font-size: 0.78rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.spreable-johnny6--identity-required .spreable-johnny6__contact-bar {
  display: none;
}

.spreable-johnny6--identity-required .spreable-johnny6__contact-hint {
  color: var(--j6-surface-dark);
  font-weight: 850;
}

.spreable-johnny6__contact-toggle {
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  color: var(--j6-surface-dark);
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.spreable-johnny6__identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.spreable-johnny6__identity[hidden] {
  display: none;
}

.spreable-johnny6__field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.spreable-johnny6__field-label {
  color: var(--j6-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.spreable-johnny6--identity-required .spreable-johnny6__field-label {
  color: var(--j6-surface-dark);
}

.spreable-johnny6--identity-required .spreable-johnny6__field-label::after {
  color: var(--j6-accent-strong);
  content: " *";
}

.spreable-johnny6--identity-required .spreable-johnny6__identity .spreable-johnny6__input {
  border-color: rgba(22, 163, 74, 0.48);
  background: #fbfffc;
}

.spreable-johnny6__consent {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--j6-muted);
  font-size: 0.66rem;
  font-weight: 650;
  line-height: 1.3;
}

.spreable-johnny6__consent-check {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--j6-accent);
}

.spreable-johnny6__consent-text {
  min-width: 0;
}

.spreable-johnny6__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
}

.spreable-johnny6--identity-required .spreable-johnny6__composer {
  grid-template-columns: 1fr;
}

.spreable-johnny6--identity-required .spreable-johnny6__textarea {
  display: none;
}

.spreable-johnny6__input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--j6-border-strong);
  border-radius: 12px;
  background: #ffffff;
  color: var(--j6-ink);
  font: inherit;
  line-height: 1.35;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.spreable-johnny6__input::placeholder {
  color: rgba(83, 96, 90, 0.7);
}

.spreable-johnny6__input:focus {
  border-color: rgba(63, 143, 44, 0.62);
  box-shadow: 0 0 0 4px rgba(99, 196, 77, 0.12);
}

input.spreable-johnny6__input {
  min-height: 42px;
  padding: 9px 11px;
}

.spreable-johnny6__textarea {
  min-height: 48px;
  max-height: 112px;
  padding: 13px 14px;
  resize: vertical;
}

.spreable-johnny6__send {
  display: inline-flex;
  min-width: 92px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--j6-surface-dark), var(--j6-surface-dark-strong));
  color: #ffffff;
  font-weight: 850;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.spreable-johnny6__send::after {
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.spreable-johnny6__send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(8, 34, 26, 0.18);
}

.spreable-johnny6__send:disabled {
  cursor: progress;
  opacity: 0.72;
}

.spreable-johnny6--sending .spreable-johnny6__send::after {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spreable-johnny6-spin 760ms linear infinite;
  transform: none;
}

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

@media (max-width: 560px) {
  .spreable-johnny6 {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .spreable-johnny6__panel {
    width: calc(100vw - 24px);
    height: min(640px, calc(100vh - 88px));
    height: min(640px, calc(100svh - 88px));
    max-height: calc(100vh - 88px);
    max-height: calc(100svh - 88px);
    margin-bottom: 10px;
    border-radius: 16px;
  }

  .spreable-johnny6__toggle {
    min-height: 58px;
    padding-right: 20px;
  }

  .spreable-johnny6__identity {
    grid-template-columns: 1fr;
  }

  .spreable-johnny6__composer {
    grid-template-columns: 1fr;
  }

  .spreable-johnny6__send {
    width: 100%;
  }
}

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