.lead-chat {
  --float-size: 64px;
  --float-gap: 18px;
  --float-right: 22px;
  --float-bottom: 22px;
  position: fixed;
  right: var(--float-right);
  bottom: calc(var(--float-bottom) + (var(--float-size) * 2) + var(--float-gap) + 18px);
  z-index: 60;
  width: min(360px, calc(100vw - 28px));
  color: #071d3a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.lead-chat__panel {
  overflow: hidden;
  border: 1px solid rgba(216, 180, 106, 0.42);
  border-radius: 18px;
  background: #f8fbff;
  box-shadow: 0 24px 64px rgba(4, 22, 44, 0.26);
}

.lead-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 14px;
  background: linear-gradient(135deg, #04162c, #08264a);
  color: #fff;
}

.lead-chat__head strong { display: block; font-size: 15px; line-height: 1.2; }
.lead-chat__head span { display: block; margin-top: 3px; color: #dbe8f4; font-size: 12px; line-height: 1.35; }

.lead-chat__close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lead-chat__body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.lead-chat__bubble {
  width: fit-content;
  max-width: 100%;
  padding: 10px 13px;
  border-radius: 14px 14px 14px 5px;
  background: #e8f1fa;
  color: #08264a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.lead-chat__bubble.is-success {
  background: rgba(216, 180, 106, 0.18);
  color: #6d501d;
}

.lead-chat__success {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(8, 38, 74, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(8, 38, 74, 0.08);
}

.lead-chat__success strong {
  color: #071d3a;
  font-size: 17px;
  line-height: 1.25;
}

.lead-chat__success p {
  margin: 0;
  color: #496176;
  font-size: 13px;
  line-height: 1.5;
}

.lead-chat__success .lead-chat__btn {
  width: 100%;
  margin-top: 2px;
}

.lead-chat__field {
  display: grid;
  gap: 8px;
}

.lead-chat__field label {
  color: #496176;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lead-chat__field input,
.lead-chat__field select,
.lead-chat__field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #b9c9d8;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #071d3a;
  outline: 0;
}

.lead-chat__field textarea { min-height: 82px; resize: vertical; }

.lead-chat__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.lead-chat__btn {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 10px 15px;
  background: #08264a;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.lead-chat__btn.secondary {
  background: #d9e8f7;
  color: #08264a;
}

.lead-chat__status {
  min-height: 18px;
  color: #496176;
  font-size: 11px;
  line-height: 1.4;
}

.lead-chat__launcher {
  --float-size: 64px;
  --float-gap: 18px;
  --float-right: 22px;
  --float-bottom: 22px;
  position: fixed;
  right: var(--float-right);
  bottom: calc(var(--float-bottom) + var(--float-size) + var(--float-gap));
  z-index: 59;
  width: var(--float-size);
  height: var(--float-size);
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: url("buttons/chat-floating-button.png") center / 100% 100% no-repeat;
  color: #fff;
  line-height: 0;
  box-shadow: 0 18px 42px rgba(4, 22, 44, 0.22);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.lead-chat__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(4, 22, 44, 0.3);
}

.lead-chat__launcher svg {
  display: none;
}

@media (max-width: 760px) {
  .lead-chat {
    --float-size: 58px;
    --float-gap: 14px;
    --float-right: 14px;
    --float-bottom: 16px;
    right: var(--float-right);
    left: 12px;
    bottom: calc(var(--float-bottom) + (var(--float-size) * 2) + var(--float-gap) + 16px);
    width: auto;
  }

  .lead-chat__head { padding: 14px; }
  .lead-chat__body { padding: 14px; }

  .lead-chat__launcher {
    --float-size: 58px;
    --float-gap: 14px;
    --float-right: 14px;
    --float-bottom: 16px;
    right: var(--float-right);
    bottom: calc(var(--float-bottom) + var(--float-size) + var(--float-gap));
  }
}
