/* ==========================================================
   Самодостаточная версия для встраивания (neoplan-skl.ru):
   переменные, кнопки и подписи заданы внутри виджета и не трогают стили сайта.
   Шрифты: если на сайте нет Tektur / Golos Text / IBM Plex Mono — подключить
   https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500&family=IBM+Plex+Mono:wght@500&family=Tektur:wdth,wght@75,800&display=swap
   или заменить переменные --f-* на шрифты сайта.
   ========================================================== */
.nk, .nk-chat {
  --bg: #F3F6FA; --ink: #173047; --blue: #005AA0; --y: #FFC20E; --plate: #DCE6F0;
  --line: rgba(23, 48, 71, .16);
  --f-head: Onest, system-ui, sans-serif;
  --f-text: Onest, system-ui, sans-serif;
  --f-mono: Onest, system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-sheet: cubic-bezier(0.76, 0, 0.24, 1);
  color: var(--ink); font: 400 16px/1.45 var(--f-text); box-sizing: border-box;
}
.nk *, .nk-chat * { box-sizing: border-box; }
.nk button, .nk-chat button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.nk p, .nk-chat p { margin: 0; }
.nk .mono, .nk-chat .mono { font-family: var(--f-mono); font-size: 12px; line-height: 1.3; letter-spacing: .02em; text-transform: uppercase; }
.nk .btn, .nk-chat .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 52px; padding: 0 24px; border-radius: 999px; font: 500 16px/1 var(--f-text); white-space: nowrap;
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.nk .btn-yellow, .nk-chat .btn-yellow { background: var(--y); color: var(--ink); }
.nk .btn-yellow:hover, .nk-chat .btn-yellow:hover { background: #F5B800; }
.nk .btn-ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.nk .btn-ghost:hover { background: var(--ink); color: #fff; }
.nk .btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nk .btn-pair .btn { width: 100%; }
.nk .fork, .nk-chat .fork { width: 16px; height: 16px; fill: currentColor; flex: none; overflow: visible; }
.nk .fork-tine, .nk-chat .fork-tine { transition: transform .55s var(--ease-out); }
.nk .btn:hover .fork-tine, .nk-chat .btn:hover .fork-tine { transform: translateY(-8px); }

/* ==========================================================
   Ника — виртуальный помощник. Та же система, что у сайта:
   бетон, тёмно-синий, один жёлтый, появление снизу вверх.
   ========================================================== */

.nk { position: fixed; right: 28px; bottom: 28px; z-index: 110; display: flex; align-items: flex-end; gap: 16px; pointer-events: none; }
.nk > * { pointer-events: auto; }

/* кружок: поднимается снизу, как вилы с грузом */
.nk-face {
  position: relative; flex: none;
  width: 132px; height: 132px; border-radius: 50%;
  transform: translate3d(0, 180%, 0);
  transition: transform .95s var(--ease-sheet), width .6s var(--ease-out), height .6s var(--ease-out);
  cursor: pointer;
}
.nk.in .nk-face { transform: none; }
.nk-face .nk-media { position: absolute; inset: 6px; border-radius: 50%; overflow: hidden; background: var(--plate); }
.nk-face img, .nk-face video { width: 100%; height: 100%; object-fit: cover; display: block; }
.nk-face video { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.nk-face.has-video video { opacity: 1; }
.nk-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: scale(var(--lvl, 1)); transition: transform .08s linear; }
.nk-ring circle { fill: none; stroke: var(--y); stroke-width: 4; }
.nk-ring .nk-ring-bg { stroke: #fff; stroke-width: 6; }
.nk-sound {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--ink); color: #fff;
  transition: opacity .4s ease;
}
.nk-face.talking .nk-sound { opacity: 0; }
.nk.mini .nk-face { width: 76px; height: 76px; }
.nk.mini .nk-sound { display: none; }

/* карточка с приветствием */
.nk-card {
  width: 330px; padding: 20px 20px 18px;
  background: #fff; border-radius: 24px 24px 6px 24px;
  border: 1px solid var(--line);
  opacity: 0; transform: translate3d(0, 28px, 0);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  margin-bottom: 30px;
}
.nk.in .nk-card { opacity: 1; transform: none; transition-delay: .45s; }
.nk.mini .nk-card { opacity: 0; transform: translate3d(0, 28px, 0); pointer-events: none; transition-delay: 0s; }
.nk-card .mono { color: var(--blue); display: block; margin-bottom: 8px; }
.nk-hello { font-size: 16px; line-height: 1.45; margin-bottom: 16px; min-height: 4.4em; }
.nk-card .btn-pair { gap: 8px; }
.nk-card .btn { height: 46px; padding: 0 12px; font-size: 15px; }
.nk-x { position: absolute; right: 16px; top: 16px; color: rgba(23, 48, 71, .5); }
.nk-x:hover { color: var(--ink); }
.nk-card { position: relative; }

/* окно чата: шторка снизу */
.nk-chat {
  position: fixed; right: 28px; bottom: 28px; z-index: 115;
  width: 420px; height: min(640px, calc(100vh - 120px));
  display: grid; grid-template-rows: auto 1fr auto auto;
  background: var(--bg); border-radius: 28px; overflow: hidden;
  border: 1px solid var(--line);
  transform: translate3d(0, calc(100% + 60px), 0);
  transition: transform .9s var(--ease-sheet);
}
.nk-chat.open { transform: none; }
.nk-head { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 16px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.nk-head img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.nk-head b { display: block; font: 800 24px/.9 var(--f-head); font-stretch: 75%; text-transform: uppercase; }
.nk-head .mono { color: var(--blue); font-size: 11px; }
.nk-head-tools { display: flex; gap: 6px; }
.nk-tool {
  height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  font: 500 12px/1 var(--f-mono); text-transform: uppercase; color: rgba(23, 48, 71, .7);
}
.nk-tool:hover { border-color: var(--ink); color: var(--ink); }
.nk-tool.is-on { background: var(--y); border-color: var(--y); color: var(--ink); }

.nk-log { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.nk-msg {
  max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45;
  animation: nkRise .6s var(--ease-out) both;
}
.nk-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.nk-msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.nk-msg.wait { color: rgba(23, 48, 71, .5); }
.nk-msg .btn { margin-top: 10px; height: 40px; font-size: 14px; padding: 0 16px; }
@keyframes nkRise { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
.nk-dots span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: currentColor; animation: nkDot 1s infinite ease-in-out; }
.nk-dots span:nth-child(2) { animation-delay: .15s; } .nk-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes nkDot { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(-5px); opacity: 1; } }

.nk-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }
.nk-chips button { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; background: #fff; }
.nk-chips button:hover { border-color: var(--ink); }

.nk-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 12px 14px 14px; background: #fff; border-top: 1px solid var(--line); }
.nk-form input {
  height: 48px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  font: 400 15px/1 var(--f-text); color: var(--ink); outline: none; min-width: 0;
}
.nk-form input:focus { border-color: var(--ink); }
.nk-mic, .nk-send { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.nk-mic { border: 1.5px solid var(--line); }
.nk-mic:hover { border-color: var(--ink); }
.nk-mic.rec { background: var(--y); border-color: var(--y); animation: nkPulse 1.2s infinite var(--ease-out); }
@keyframes nkPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 194, 14, .55); } 100% { box-shadow: 0 0 0 14px rgba(255, 194, 14, 0); } }
.nk-send { background: var(--y); }
.nk-mic svg, .nk-send svg { width: 20px; height: 20px; fill: var(--ink); }
.nk-mic[hidden] { display: none; }
.nk-note { padding: 0 18px 10px; font-size: 11px; color: rgba(23, 48, 71, .5); }

/* окно чата — не «экран» сайта: общее правило section { min-height: 100vh } здесь не действует */
.nk-chat { min-height: 0; }
.nk-log { min-height: 0; }
.nk-msg .btn { display: flex; width: max-content; }

/* телефоны: кружок и карточка компактнее, чат во весь экран */
@media (max-width: 640px) {
  .nk { right: 12px; bottom: 12px; left: 12px; justify-content: flex-end; }
  .nk-face { width: 92px; height: 92px; }
  .nk.mini .nk-face { width: 64px; height: 64px; }
  .nk-card { width: auto; flex: 1; min-width: 0; padding: 14px; margin-bottom: 18px; }
  .nk-card .mono { padding-right: 64px; }
  body:has(.nk-chat.open) .nm-fab { display: none !important; } /* кнопки мессенджеров сайта не перекрывают чат */
  .nk-card .btn-pair { grid-template-columns: 1fr; } /* две кнопки в столбик, иначе карточка вылезает за левый край */
  .nk-hello { font-size: 14px; min-height: 0; }
  .nk-card .btn { height: 42px; font-size: 14px; }
  .nk-chat { right: 0; bottom: 0; left: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; }
  .nk-form input { font-size: 16px; } /* иначе iOS увеличивает страницу при фокусе */
}
@media (prefers-reduced-motion: reduce) {
  .nk-face, .nk-card, .nk-chat, .nk-msg { transition: none !important; animation: none !important; }
}

/* ---------- оформление v5: свой шрифт сайта, мягкая карточка, без служебных подписей ---------- */
.nk .mono, .nk-chat .mono { text-transform: none; letter-spacing: 0; }
.nk-card {
  width: 316px; padding: 18px 18px 16px; border: 0; border-radius: 22px 22px 6px 22px;
  box-shadow: 0 18px 50px rgba(6, 52, 92, .2), 0 2px 8px rgba(6, 52, 92, .08);
}
.nk-name { display: flex; align-items: center; gap: 8px; margin: 0 28px 8px 0; font: 700 17px/1.2 var(--f-head); color: #06345C; }
.nk-name i { width: 9px; height: 9px; border-radius: 50%; background: #2BB673; box-shadow: 0 0 0 3px rgba(43, 182, 115, .2); }
.nk-hello { font-size: 15px; line-height: 1.45; color: #2B4358; margin-bottom: 14px; min-height: 5.8em; }
.nk-x { right: 10px; top: 8px; width: 30px; height: 30px; border-radius: 50%; font: 400 24px/30px var(--f-text); text-align: center; color: rgba(23, 48, 71, .45); }
.nk-x:hover { background: rgba(23, 48, 71, .07); color: var(--ink); }
.nk-card .btn-pair { grid-template-columns: 1fr; gap: 8px; }
.nk-card .btn { height: 44px; font: 600 15px/1 var(--f-text); }
.nk-card .btn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.nk .btn-ghost { border: 1.5px solid rgba(0, 90, 160, .35); color: var(--blue); }
.nk .btn-ghost:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.nk-sound { font: 600 12px/1 var(--f-text); padding: 6px 11px; background: #06345C; }

.nk-chat { border: 0; border-radius: 24px; box-shadow: 0 24px 70px rgba(6, 52, 92, .28), 0 2px 10px rgba(6, 52, 92, .1); }
.nk-head { grid-template-columns: 44px 1fr auto; padding: 14px 16px; border-bottom: 1px solid rgba(23, 48, 71, .08); }
.nk-head img { width: 44px; height: 44px; }
.nk-head b { font: 700 18px/1.1 var(--f-head); text-transform: none; font-stretch: normal; color: #06345C; }
.nk-tool { height: 32px; padding: 0 12px; font: 600 13px/1 var(--f-text); text-transform: none; }
.nk-tool.nk-close { width: 32px; padding: 0; font: 400 22px/30px var(--f-text); text-align: center; }
.nk-msg { font-size: 15px; }
.nk-msg.bot { border: 0; box-shadow: 0 1px 3px rgba(6, 52, 92, .1); }
.nk-msg.me { background: var(--blue); }
.nk-msg .btn { font: 600 14px/1 var(--f-text); }
.nk-chips button { font: 500 13px/1 var(--f-text); border-color: rgba(0, 90, 160, .25); color: #06345C; }
.nk-form input { font-family: var(--f-text); }
.nk-note { font-size: 11px; }
@media (max-width: 640px) {
  .nk-card { width: auto; padding: 16px 14px 14px; }
  .nk-hello { min-height: 0; }
}

.nk .nk-x { font-size: 26px; line-height: 28px; color: rgba(23, 48, 71, .5); }
.nk-chat .nk-tool.nk-close { font-size: 26px; line-height: 30px; }

.nk-chat .nk-tool { padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; }
.nk-chat .nk-tool.nk-close { width: 32px; padding: 0; }
