/* Чат Натальи. Открывается красной кнопкой «Задать вопрос». */
.natalya {
  position: fixed;
  z-index: 55;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100% - 32px));
  height: min(620px, calc(100dvh - 32px));
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 30px 60px -28px rgba(18, 16, 14, 0.55);
  overflow: hidden;
}
.natalya[hidden] { display: none; }

.natalya-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: var(--ink);
  color: var(--cream);
}
.natalya-ava-wrap {
  position: relative;
  flex: none;
  width: 48px;
  height: 48px;
}
.natalya-ava {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink-3);
}
.natalya-online {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #2fce5a;
}
.natalya-who { min-width: 0; }
.natalya-who strong {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}
.natalya-who .natalya-status {
  display: block;
  margin-top: 2px;
  color: #3ddc6e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.natalya-x {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(252, 249, 244, 0.08);
  color: var(--cream);
  cursor: pointer;
}
.natalya-x:hover { background: var(--red); }
.natalya-x svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; }

.natalya-log {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.natalya-msg {
  max-width: 88%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.natalya-msg a { color: inherit; }
.natalya-photo-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--red);
  border-radius: 12px;
  background: #fff;
  color: var(--red-dark);
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  white-space: normal;
  cursor: pointer;
}
.natalya-photo-btn:hover { background: var(--red); color: #fff; }
.natalya-photo-send { background: var(--red); color: #fff; }
.natalya-photo-send:hover { background: var(--red-dark); }
.natalya-photo-btn:disabled { opacity: 0.55; cursor: default; }
.natalya-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.natalya-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.natalya-user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--cream);
  border-bottom-right-radius: 6px;
}
.natalya-user a { color: var(--cream); }
.natalya-typing { color: var(--soft); }
.natalya-typing i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--red);
  animation: natalya-dot 1s infinite ease-in-out;
}
.natalya-typing i:nth-child(2) { animation-delay: 0.15s; }
.natalya-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes natalya-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.natalya-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}
.natalya-hint {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 7px 12px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.natalya-hint:hover { border-color: var(--red); color: var(--red-dark); }

.natalya-form {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.natalya-form input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
}
.natalya-form input:focus { outline: 2px solid var(--red-hot); outline-offset: 1px; }
.natalya-send {
  flex: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
}
.natalya-send:hover { background: var(--red-dark); }
.natalya-send:disabled { opacity: 0.55; cursor: default; }
.natalya-send svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.natalya-previews { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 10px; }
.natalya-previews[hidden] { display: none; }
.natalya-shot { position: relative; width: 56px; height: 56px; }
.natalya-shot img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--paper); }
.natalya-shot button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.natalya-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--soft);
}
.natalya-foot button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--red-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.natalya-foot a { color: var(--red-dark); font-weight: 800; }

@media (max-width: 980px) {
  .natalya {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: min(640px, calc(100dvh - 24px - env(safe-area-inset-bottom)));
  }
  body.dock-on .natalya {
    bottom: calc(108px + env(safe-area-inset-bottom));
    height: min(620px, calc(100dvh - 128px - env(safe-area-inset-bottom)));
  }
}
@media (prefers-reduced-motion: reduce) {
  .natalya-typing i { animation: none; }
}
