:root {
  --lead-chat-bg: #f5f6f8;
  --lead-chat-surface: #ffffff;
  --lead-chat-border: #e7e9ee;
  --lead-chat-text: #111827;
  --lead-chat-muted: #667085;
  --lead-chat-accent: #f97316;
  --lead-chat-accent-soft: #fff0e5;
  --lead-chat-success: #22c55e;
}

html.lead-chat-open,
body.lead-chat-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.lead-chat-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.lead-chat {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  pointer-events: none;
}

.lead-chat__toast {
  max-width: min(86vw, 280px);
  border: 0;
  border-radius: 18px;
  padding: 10px 14px;
  background: rgba(17, 24, 39, 0.96);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 24px 50px -34px rgba(17, 24, 39, 0.8);
  pointer-events: auto;
}

.lead-chat__nudge {
  position: relative;
  max-width: min(50vw, 420px);
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  background: #ffffff;
  color: #101828;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
  text-align: left;
  box-shadow: 0 18px 38px -26px rgba(15, 23, 42, 0.34);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.lead-chat__nudge:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.lead-chat__nudge::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-right: 1px solid rgba(17, 24, 39, 0.1);
  border-bottom: 1px solid rgba(17, 24, 39, 0.1);
  transform: rotate(45deg);
}

.lead-chat__panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: var(--lead-chat-bg);
  box-shadow: none;
  display: none;
  flex-direction: column;
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: auto;
}

.lead-chat.is-open .lead-chat__panel {
  display: flex;
}

.lead-chat__head {
  padding: max(16px, env(safe-area-inset-top)) clamp(16px, 2.4vw, 28px) 14px;
  background: var(--lead-chat-surface);
  color: var(--lead-chat-text);
  border-bottom: 1px solid var(--lead-chat-border);
}

.lead-chat__head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lead-chat__head-agent {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lead-chat__head-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.lead-chat__head-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lead-chat__head-status {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lead-chat-success);
  box-shadow: 0 0 0 2px var(--lead-chat-surface);
}

.lead-chat__head-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lead-chat__head-copy strong {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
}

.lead-chat__head-copy small {
  margin-top: 2px;
  font-size: 12px;
  color: var(--lead-chat-muted);
}

.lead-chat__close {
  border: 1px solid var(--lead-chat-border);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--lead-chat-surface);
  color: var(--lead-chat-text);
  font-size: 22px;
  font-weight: 400;
  cursor: pointer;
  line-height: 1;
}

.lead-chat__status {
  padding: 8px clamp(16px, 2.4vw, 28px);
  font-size: 12px;
  line-height: 1.35;
  border-bottom: 1px solid var(--lead-chat-border);
  background: var(--lead-chat-surface);
  color: #7a5a00;
}

.lead-chat__status[data-tone="error"] {
  color: #b42318;
  background: rgba(254, 242, 242, 0.96);
}

.lead-chat__messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

.lead-chat__messages {
  height: 100%;
  overflow-y: auto;
  padding: 18px clamp(16px, 2.4vw, 28px) 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--lead-chat-bg);
  overscroll-behavior: contain;
  scroll-padding-bottom: 112px;
}

.lead-chat__empty {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: auto 0 0;
  color: var(--lead-chat-muted);
}

.lead-chat__empty-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--lead-chat-surface);
  border: 1px solid var(--lead-chat-border);
}

.lead-chat__empty-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lead-chat__empty-avatar::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lead-chat-success);
  box-shadow: 0 0 0 2px var(--lead-chat-surface);
}

.lead-chat__empty-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--lead-chat-surface);
  border: 1px solid var(--lead-chat-border);
}

.lead-chat__typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c4c9d3;
  animation: lead-chat-typing 1.2s infinite ease-in-out;
}

.lead-chat__typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.lead-chat__typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes lead-chat-typing {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }

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

.lead-chat__message {
  display: flex;
  width: 100%;
}

.lead-chat__message--visitor {
  justify-content: flex-end;
}

.lead-chat__message--operator,
.lead-chat__message--system {
  justify-content: flex-start;
}

.lead-chat__message--system {
  justify-content: center;
}

.lead-chat__bubble {
  max-width: min(480px, 56%);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.55;
  box-shadow: none;
}

.lead-chat__bubble--visitor {
  background: #ffffff;
  color: var(--lead-chat-text);
  border: 1px solid #f3c27a;
  border-bottom-right-radius: 6px;
}

.lead-chat__bubble--operator,
.lead-chat__bubble--system {
  background: var(--lead-chat-surface);
  color: var(--lead-chat-text);
  border: 1px solid var(--lead-chat-border);
  border-bottom-left-radius: 6px;
}

.lead-chat__bubble--operator {
  background: #fff6d8;
  border-color: #f2d47a;
}

.lead-chat__bubble--system {
  background: #fff3bf;
  color: #6b5300;
  border-color: #f1cf58;
  max-width: min(420px, 50%);
  text-align: left;
}

.lead-chat__sender-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #475467;
}

.lead-chat__sender-badge--operator {
  gap: 8px;
  margin-bottom: 8px;
}

.lead-chat__sender-avatar {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
}

.lead-chat__sender-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lead-chat__sender-status-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px #fff;
}

.lead-chat__sender-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.lead-chat__sender-copy strong {
  font-size: 11px;
  line-height: 1.1;
}

.lead-chat__sender-copy small {
  font-size: 10px;
  color: var(--lead-chat-muted);
}

.lead-chat__sender-badge--system {
  color: #7c6214;
}

.lead-chat__sender-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex: 0 0 auto;
}

.lead-chat__meta {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.68;
}

.lead-chat__bubble--starter {
  background: #fff8e0;
  border-color: #f1d280;
}

.lead-chat__starter-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  color: #3d3420;
}

.lead-chat__starter-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.lead-chat__starter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #f2d47a;
  background: #ffffff;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 18px -16px rgba(15, 23, 42, 0.2);
}

.lead-chat__starter-btn--tertiary {
  justify-content: center;
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #6b7280;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lead-chat__bubble--followup {
  background: #fff6d1;
}

.lead-chat__starter-actions--followup {
  margin-top: 12px;
}

.lead-chat__starter-btn--primary {
  border-color: #efb600;
  background: #ffcc2f;
  color: #111827;
  box-shadow: 0 14px 24px -18px rgba(239, 182, 0, 0.45);
}

.lead-chat__photo-link {
  display: inline-block;
  margin-top: 8px;
  max-width: 104px;
}

.lead-chat__photo {
  display: block;
  width: 104px;
  max-width: 104px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.lead-chat__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.lead-chat__gallery .lead-chat__photo-link {
  margin-top: 0;
}

.lead-chat__scroll-bottom {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--lead-chat-surface);
  color: var(--lead-chat-text);
  cursor: pointer;
  border: 1px solid var(--lead-chat-border);
  box-shadow: 0 8px 24px -20px rgba(15, 23, 42, 0.32);
}

.lead-chat__scroll-count:empty {
  display: none;
}

.lead-chat__scroll-icon {
  font-size: 18px;
  line-height: 1;
}

.lead-chat__composer {
  padding: 10px clamp(16px, 2.4vw, 28px) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--lead-chat-border);
  background: var(--lead-chat-surface);
}

.lead-chat__composer.is-starter-mode {
  padding-top: 0;
  border-top-color: transparent;
}

.lead-chat__assist {
  margin-bottom: 10px;
  padding: 14px 12px 12px;
  border-radius: 16px;
  border: 1px solid #f1d280;
  background: #fff8e0;
  color: #3d3420;
}

.lead-chat__assist-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lead-chat__assist-head strong {
  font-size: 13px;
  line-height: 1.25;
}

.lead-chat__assist-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.lead-chat__assist-copy {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #5f6672;
}

.lead-chat__assist-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.lead-chat__phone-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid #e5d9b1;
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: #111827;
}

.lead-chat__phone-input:focus {
  outline: none;
  border-color: #efb600;
  box-shadow: 0 0 0 3px rgba(255, 204, 47, 0.18);
}

.lead-chat__phone-save,
.lead-chat__telegram-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.lead-chat__phone-save {
  border: 1px solid #efb600;
  background: #ffcc2f;
  color: #111827;
  padding: 0 14px;
  white-space: nowrap;
}

.lead-chat__phone-save:disabled {
  opacity: 0.65;
  cursor: wait;
}

.lead-chat__telegram-link {
  margin-top: 8px;
  width: 100%;
  border: 1px solid #d6e4ff;
  background: #ffffff;
  color: #1d4ed8;
}

.lead-chat__preview-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 8px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.lead-chat__preview-list::-webkit-scrollbar {
  display: none;
}

.lead-chat__draft {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 18px 28px -24px rgba(15, 23, 42, 0.34);
}

.lead-chat__draft-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lead-chat__draft-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.86);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.lead-chat__composer-card {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--lead-chat-border);
  background: var(--lead-chat-surface);
  box-shadow: none;
}

.lead-chat__composer-card[hidden] {
  display: none;
}

.lead-chat__attach {
  position: relative;
  width: 124px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0 12px;
  border: 1px solid #ffd1b3;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff7f1 0%, #ffefe2 100%);
  color: #111827;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.lead-chat__attach:hover {
  border-color: #f6b27f;
  background: linear-gradient(180deg, #fff5ed 0%, #ffe7d6 100%);
  box-shadow: 0 10px 18px -16px rgba(249, 115, 22, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.lead-chat__attach:active {
  transform: translateY(0);
  background: #ffe4cf;
}

.lead-chat__attach-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #111827;
  flex: 0 0 auto;
}

.lead-chat__attach-label {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #7c2d12;
  pointer-events: none;
}

.lead-chat__attach-icon svg,
.lead-chat__send svg {
  width: 100%;
  height: 100%;
}

.lead-chat__field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.lead-chat__input {
  width: 100%;
  min-height: 42px;
  max-height: 124px;
  resize: none;
  border: 0;
  background: transparent;
  padding: 9px 0 7px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: var(--lead-chat-text);
}

.lead-chat__input::placeholder {
  color: var(--lead-chat-muted);
}

.lead-chat__input:focus {
  outline: none;
}

.lead-chat__send {
  width: 46px;
  height: 46px;
  border: 1px solid #efb600;
  border-radius: 12px;
  background: #ffcc2f;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: none;
}

.lead-chat__send:disabled {
  background: #ffe98c;
  color: rgba(17, 24, 39, 0.45);
}

.lead-chat__picker-help {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 214, 67, 0.34);
  background: rgba(255, 248, 214, 0.98);
  color: #6b5510;
  font-size: 12px;
  line-height: 1.45;
}

.lead-chat__picker-help-copy {
  margin-bottom: 8px;
}

.lead-chat__picker-help-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-chat__picker-help-link,
.lead-chat__picker-help-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.lead-chat__picker-help-dismiss {
  background: transparent;
}

.lead-chat__attach.is-disabled,
.lead-chat__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.lead-chat__attach.is-disabled {
  transform: none;
}

.lead-chat__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  width: 100%;
  min-height: 50px;
  border-radius: 0;
  background: #ffcc2f;
  color: #101828;
  padding: 7px 18px calc(7px + env(safe-area-inset-bottom));
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 -1px 0 rgba(17, 24, 39, 0.08);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: auto;
}

.lead-chat.is-nudging .lead-chat__toggle {
  animation: lead-chat-toggle-ring 1s ease 2;
}

.lead-chat.is-nudging .lead-chat__toggle-dot {
  animation: lead-chat-dot-pulse 1s ease 3;
}

.lead-chat.is-toggle-collapsed {
  right: 0;
  left: 0;
  align-items: center;
}

.lead-chat.is-toggle-collapsed .lead-chat__toggle {
  width: 100%;
  min-height: 50px;
  padding: 7px 18px calc(7px + env(safe-area-inset-bottom));
  border-radius: 0;
  background: #ffcc2f;
  box-shadow: 0 -1px 0 rgba(17, 24, 39, 0.08);
}

.lead-chat.is-toggle-collapsed .lead-chat__toggle-copy {
  align-items: center;
  text-align: center;
}

.lead-chat.is-toggle-collapsed .lead-chat__toggle-subtitle {
  display: block;
}

.lead-chat.is-toggle-collapsed .lead-chat__toggle-title {
  font-size: 14px;
  white-space: normal;
}

.lead-chat__toggle-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
  align-items: center;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lead-chat__toggle-copy.is-changing {
  opacity: 0;
  transform: translateY(-6px);
}

.lead-chat__toggle-copy.is-single {
  justify-content: center;
}

.lead-chat__toggle-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
  white-space: normal;
}

.lead-chat__toggle-subtitle {
  display: block;
  min-height: 0;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(16, 24, 40, 0.72);
  white-space: normal;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lead-chat__toggle-subtitle.is-changing {
  opacity: 0;
  transform: translateY(-6px);
}

.lead-chat__toggle-subtitle:empty {
  display: none;
}

.lead-chat__toggle-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
  flex: 0 0 auto;
}

.lead-chat__toggle-close {
  display: none;
  font-size: 28px;
  line-height: 1;
}

.lead-chat__toggle-badge {
  position: absolute;
  top: 10px;
  right: 18px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.7);
}

.lead-chat__toggle-badge[hidden] {
  display: none;
}

.lead-chat.is-picker-mode {
  z-index: 1;
}

.lead-chat.is-picker-mode .lead-chat__panel,
.lead-chat.is-picker-mode .lead-chat__toggle,
.lead-chat.is-picker-mode .lead-chat__toast {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.lead-chat.is-open .lead-chat__toggle {
  display: none;
}

.lead-chat.is-open .lead-chat__nudge {
  display: none;
}

@media (min-width: 1024px) {
  .lead-chat {
    left: auto;
    right: 24px;
    bottom: 24px;
    align-items: flex-end;
    width: auto;
    gap: 12px;
  }

  .lead-chat__toggle {
    display: inline-flex !important;
    width: min(332px, calc(100vw - 48px));
    min-height: 62px;
    padding: 12px 18px;
    border-radius: 22px;
    box-shadow: 0 22px 48px -28px rgba(15, 23, 42, 0.42);
  }

  .lead-chat.is-open .lead-chat__toggle {
    display: none !important;
  }

  .lead-chat__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    inset: auto 0 calc(100% + 12px) auto;
    display: flex;
    width: min(410px, calc(100vw - 48px));
    height: min(760px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    border: 1px solid var(--lead-chat-border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 34px 90px -44px rgba(15, 23, 42, 0.46);
    opacity: 0;
    visibility: hidden;
    transform: translateX(28px);
    pointer-events: none;
  }

  .lead-chat.is-open .lead-chat__panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
  }

  .lead-chat__head {
    padding: 16px 18px 14px;
  }

  .lead-chat__status {
    padding: 8px 18px;
  }

  .lead-chat__messages {
    padding: 18px 18px 12px;
    scroll-padding-bottom: 96px;
  }

  .lead-chat__composer {
    padding: 10px 18px 16px;
  }

  .lead-chat__bubble,
  .lead-chat__bubble--system {
    max-width: 86%;
  }

  .lead-chat__scroll-bottom {
    right: 18px;
    bottom: 18px;
  }

  .lead-chat__nudge {
    max-width: 360px;
  }
}

@media (max-width: 720px) {
  .lead-chat {
    gap: 6px;
  }

  .lead-chat__nudge.is-mobile {
    max-width: min(296px, calc(100vw - 24px));
    border-radius: 16px;
    padding: 10px 14px;
    background: #fff8e0;
    color: #3d3420;
    border-color: #f1d280;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 18px 32px -24px rgba(15, 23, 42, 0.34);
  }

  .lead-chat__nudge.is-mobile::after {
    right: calc(50% - 7px);
    background: #fff8e0;
    border-right-color: #f1d280;
    border-bottom-color: #f1d280;
  }

  .lead-chat__panel {
    width: 100vw;
    height: 100dvh;
  }

  .lead-chat__assist {
    padding: 15px 12px 12px;
  }

  .lead-chat__assist-head strong {
    font-size: 14px;
  }

  .lead-chat__assist-copy {
    font-size: 13px;
    line-height: 1.4;
  }

  .lead-chat__assist-row {
    flex-direction: column;
    gap: 10px;
  }

  .lead-chat__phone-input,
  .lead-chat__phone-save {
    width: 100%;
    min-height: 48px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .lead-chat__nudge.is-mobile {
    max-width: min(284px, calc(100vw - 20px));
    padding: 9px 12px;
    font-size: 12.5px;
    line-height: 1.3;
  }

  .lead-chat__panel {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }

  .lead-chat__head {
    padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  }

  .lead-chat__toggle {
    min-height: 44px;
    padding: 5px 14px calc(5px + env(safe-area-inset-bottom));
  }

  .lead-chat__head-avatar {
    width: 40px;
    height: 40px;
  }

  .lead-chat__head-copy strong {
    font-size: 14px;
  }

  .lead-chat__toggle-title {
    font-size: 13px;
  }

  .lead-chat__toggle-subtitle {
    font-size: 10px;
  }

  .lead-chat.is-toggle-collapsed .lead-chat__toggle {
    min-height: 40px;
    padding: 4px 14px calc(4px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .lead-chat.is-toggle-collapsed .lead-chat__toggle-copy {
    line-height: 1;
  }

  .lead-chat.is-toggle-collapsed .lead-chat__toggle-title {
    font-size: 14px;
    line-height: 1;
  }

  .lead-chat.is-toggle-collapsed .lead-chat__toggle-subtitle {
    display: none;
  }

  .lead-chat__bubble,
  .lead-chat__bubble--system {
    max-width: 88%;
    font-size: 14px;
  }

  .lead-chat__starter-actions {
    flex-direction: column;
  }

  .lead-chat__starter-btn {
    width: 100%;
  }

  .lead-chat__scroll-bottom {
    right: 12px;
    bottom: 12px;
  }

  .lead-chat__attach {
    width: 112px;
    padding: 0 10px;
  }

  .lead-chat__attach-label {
    font-size: 10px;
  }
}

@keyframes lead-chat-toggle-ring {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 -1px 0 rgba(17, 24, 39, 0.08);
  }
  35% {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 18px 42px -24px rgba(249, 115, 22, 0.52);
  }
  70% {
    transform: translateY(0) scale(1);
    box-shadow: 0 8px 24px -18px rgba(249, 115, 22, 0.34);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 -1px 0 rgba(17, 24, 39, 0.08);
  }
}

@keyframes lead-chat-dot-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
  }
}
