.natasha-chat {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 10000;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.natasha-chat * {
  box-sizing: border-box;
}

.natasha-chat__button {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.8rem 0.55rem 0.55rem;
  color: #fff;
  background: #0d6f57;
  box-shadow: 0 16px 36px rgba(6, 45, 35, 0.25);
  cursor: pointer;
}

.natasha-chat__avatar,
.natasha-chat__avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
}

.natasha-chat__avatar {
  position: relative;
  background: #f8fafc;
  border: 2px solid rgba(255,255,255,0.7);
  overflow: hidden;
  flex: 0 0 auto;
}

.natasha-chat__status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.natasha-chat__button-text {
  display: grid;
  text-align: left;
  line-height: 1.1;
}

.natasha-chat__button-text strong {
  font-size: 0.9rem;
}

.natasha-chat__button-text span {
  font-size: 0.74rem;
  opacity: 0.84;
}

.natasha-chat__nudge {
  position: absolute;
  right: 0;
  bottom: 64px;
  display: none;
  max-width: min(320px, calc(100vw - 36px));
  border: 1px solid rgba(13, 111, 87, 0.18);
  border-radius: 16px 16px 4px 16px;
  padding: 0.78rem 0.88rem;
  color: #0f3f34;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.18);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.natasha-chat.has-nudge:not(.is-open) .natasha-chat__nudge {
  display: block;
}

.natasha-chat__panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: min(380px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 160px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

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

.natasha-chat.is-open .natasha-chat__button,
.natasha-chat.is-open .natasha-chat__nudge {
  display: none;
}

.natasha-chat__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, #0d6f57, #0f8b6d);
}

.natasha-chat__header h3 {
  margin: 0;
  color: #fff !important;
  font-size: 0.98rem;
}

.natasha-chat__header p {
  margin: 0.15rem 0 0;
  color: rgba(255,255,255,0.9) !important;
  font-size: 0.75rem;
  opacity: 0.86;
}

.natasha-chat__close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,0.14);
  cursor: pointer;
}

.natasha-chat__messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow-y: auto;
  padding: 0.9rem;
  background: #f8fafc;
}

.natasha-chat__msg {
  max-width: 86%;
  padding: 0.68rem 0.78rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.natasha-chat__msg--assistant {
  align-self: flex-start;
  color: #243042;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
}

.natasha-chat__msg--user {
  align-self: flex-end;
  color: #fff;
  background: #0d6f57;
}

.natasha-chat__typing {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 64px;
}

.natasha-chat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
  animation: natashaTyping 1s infinite ease-in-out;
}

.natasha-chat__typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.natasha-chat__typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes natashaTyping {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.natasha-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 0.9rem 0.75rem;
  background: #f8fafc;
}

.natasha-chat__chip {
  border: 1px solid rgba(13,111,87,0.18);
  border-radius: 999px;
  padding: 0.42rem 0.62rem;
  color: #0d6f57;
  background: #fff;
  font-size: 0.76rem;
  cursor: pointer;
}

.natasha-chat__lead {
  display: none;
  margin: 0.75rem 0.9rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.8rem;
}

.natasha-chat.has-lead .natasha-chat__lead {
  display: block;
}

.natasha-chat__form {
  display: flex;
  gap: 0.55rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(15,23,42,0.08);
  background: #fff;
}

.natasha-chat__input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 1px solid #dbe3ea;
  border-radius: 999px;
  padding: 0.72rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
}

.natasha-chat__send {
  border: 0;
  border-radius: 999px;
  padding: 0 0.95rem;
  color: #fff;
  background: #0d6f57;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 560px) {
  .natasha-chat {
    right: 12px;
    bottom: max(74px, calc(68px + env(safe-area-inset-bottom, 0px)));
  }

  .natasha-chat__button-text {
    display: none;
  }

  .natasha-chat__button {
    padding: 0.48rem;
  }

  .natasha-chat__nudge {
    right: 0;
    bottom: 58px;
    max-width: calc(100vw - 86px);
    font-size: 0.8rem;
  }

  .natasha-chat__panel {
    position: fixed;
    inset: auto 8px max(8px, env(safe-area-inset-bottom, 0px)) 8px;
    width: auto;
    height: min(620px, calc(100dvh - 22px));
    max-height: 78dvh;
    border-radius: 16px;
  }

  .natasha-chat__messages {
    padding: 0.78rem;
  }

  .natasha-chat__chips {
    padding: 0 0.78rem 0.65rem;
  }

  .natasha-chat__form {
    padding: 0.65rem;
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  }

  .natasha-chat__input {
    font-size: 16px;
  }

  .natasha-chat__send {
    min-width: 64px;
  }
}
