/* Чат denti-hehe.ru: кнопка в правом нижнем углу и светлое окно переписки в цветах сайта.
   Разметку создаёт chat.js (копия виджета tecnt.ru). Префикс ntchat, свои переменные: от стилей сайта не зависит. */
.ntchat{
  --c-bg:#f4f8f9;--c-panel:#fff;--c-card:#fff;--c-line:#dbe6ea;--c-ink:#0f2a44;--c-muted:#5b6f82;
  --c-accent:#0e7c7b;--c-accent-soft:#d6efee;--c-grad:linear-gradient(135deg,#0e7c7b,#14a39f);
  position:fixed;right:24px;bottom:24px;z-index:90;font:15px/1.5 "Manrope","Segoe UI",Arial,sans-serif;color:var(--c-ink)
}
.ntchat[hidden]{display:none}

/* Кнопка: бирюзовый градиент, мягкая тень, два кольца-волны */
.ntchat-fab{position:relative;display:grid;place-items:center;width:64px;height:64px;padding:0;border:0;border-radius:50%;background:var(--c-grad);color:#fff;cursor:pointer;box-shadow:0 10px 26px rgba(14,124,123,.35);transition:transform .2s ease,box-shadow .2s ease}
.ntchat-fab:hover{transform:translateY(-2px) scale(1.04);box-shadow:0 14px 32px rgba(14,124,123,.45)}
.ntchat-fab:focus-visible{outline:3px solid var(--c-accent);outline-offset:4px}
.ntchat-fab.is-calling::before,.ntchat-fab.is-calling::after{content:"";position:absolute;inset:0;border-radius:50%;border:2px solid #14a39f;pointer-events:none;opacity:0;animation:ntchat-wave 3s ease-out infinite}
.ntchat-fab.is-calling::after{animation-delay:1.5s}
/* Пришёл ответ: волны чаще */
.ntchat-fab.is-unread::before,.ntchat-fab.is-unread::after{animation-duration:1.6s}
.ntchat-fab.is-unread::after{animation-delay:.8s}
@keyframes ntchat-wave{0%{transform:scale(1);opacity:.7}70%{transform:scale(1.7);opacity:0}100%{transform:scale(1.7);opacity:0}}
.ntchat-fab svg{width:28px;height:28px}
.ntchat-badge{position:absolute;top:-4px;right:-4px;min-width:24px;height:24px;padding:0 6px;display:grid;place-items:center;border-radius:12px;background:#e5484d;color:#fff;font-size:12px;font-weight:800;border:2px solid #fff}
.ntchat-badge[hidden]{display:none}
.ntchat.is-open .ntchat-fab{visibility:hidden}

/* Окно */
.ntchat-panel{position:absolute;right:0;bottom:0;display:grid;grid-template-rows:auto 1fr auto;width:390px;height:min(640px,calc(100dvh - 48px));background:var(--c-panel);border:1px solid var(--c-line);border-radius:22px;box-shadow:0 24px 60px rgba(15,42,68,.18);overflow:hidden;animation:ntchat-in .22s ease-out}
.ntchat-panel[hidden]{display:none}
@keyframes ntchat-in{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}

.ntchat-head{display:flex;align-items:center;gap:12px;padding:14px 12px 14px 16px;border-bottom:1px solid var(--c-line);background:var(--c-panel)}
.ntchat-logo{flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--c-grad);color:#fff}
.ntchat-logo svg{width:24px;height:24px}
.ntchat-who{display:grid;gap:1px;flex:1;min-width:0}
.ntchat-name{font-weight:800;font-size:16px;line-height:1.25}
.ntchat-status{font-size:12.5px;color:var(--c-muted)}
.ntchat .ntchat-close{flex:none;display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:12px;background:none;color:var(--c-ink);cursor:pointer}
.ntchat .ntchat-close:hover{background:var(--c-bg)}

.ntchat-body{overflow-y:auto;overscroll-behavior:contain;padding:16px 14px;background:var(--c-bg);scrollbar-width:thin;scrollbar-color:var(--c-line) transparent}
.ntchat-list{display:grid;gap:10px}
.ntchat-day{justify-self:center;padding:3px 12px;border-radius:20px;background:var(--c-card);border:1px solid var(--c-line);font-size:12px;color:var(--c-muted)}
.ntchat-msg{max-width:84%;padding:10px 13px 7px;border-radius:16px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14.5px;line-height:1.5}
.ntchat-msg--out{justify-self:start;background:var(--c-card);border:1px solid var(--c-line);border-bottom-left-radius:6px}
.ntchat-msg--in{justify-self:end;background:var(--c-accent);color:#fff;border-bottom-right-radius:6px}
.ntchat-author{display:block;margin-bottom:2px;font-size:12px;font-weight:800;color:var(--c-accent)}
.ntchat-time{display:block;margin-top:3px;font-size:11px;opacity:.7;text-align:right}
.ntchat-msg img{display:block;max-width:100%;max-height:240px;margin-bottom:4px;border-radius:10px}
.ntchat-file{color:inherit;font-weight:700;text-decoration:underline;text-underline-offset:3px}

.ntchat-contact{display:grid;gap:8px;margin-top:12px;padding:14px;border-radius:16px;background:var(--c-card);border:1px dashed var(--c-accent);font-size:14px}
.ntchat-contact[hidden]{display:none}
.ntchat-contact p{margin:0}
.ntchat .ntchat-contact input{width:100%;margin:0;padding:10px 12px;border:1px solid var(--c-line);border-radius:10px;font:inherit;font-size:14.5px;background:var(--c-panel);color:var(--c-ink)}
.ntchat .ntchat-contact input:focus{border-color:var(--c-accent);outline:none;box-shadow:0 0 0 3px var(--c-accent-soft)}
.ntchat .ntchat-contact button{width:100%;min-height:44px;margin:0;padding:10px 16px;border:0;border-radius:12px;background:var(--c-accent);color:#fff;font:inherit;font-weight:800;font-size:14px;cursor:pointer}

.ntchat-foot{display:grid;gap:8px;padding:10px 12px 12px;border-top:1px solid var(--c-line);background:var(--c-panel)}
.ntchat-consent{display:flex;gap:8px;align-items:flex-start;font-size:12.5px;line-height:1.4;color:var(--c-muted);cursor:pointer}
.ntchat-consent[hidden]{display:none}
.ntchat .ntchat-consent input{flex:none;width:16px;height:16px;margin:2px 0 0;accent-color:var(--c-accent)}
.ntchat-consent a{color:var(--c-accent);text-decoration:underline}
.ntchat-error{margin:0;font-size:12.5px;color:#b42318}
.ntchat-error[hidden]{display:none}
.ntchat-form{display:flex;gap:8px;align-items:flex-end}
.ntchat-attach,.ntchat .ntchat-send{flex:none;display:grid;place-items:center;width:44px;height:44px;padding:0;border-radius:12px;cursor:pointer}
.ntchat-attach{position:relative;border:1px solid var(--c-line);color:var(--c-muted)}
.ntchat-attach:hover{color:var(--c-accent);border-color:var(--c-accent)}
.ntchat-attach input{position:absolute;inset:0;opacity:0;cursor:pointer}
.ntchat .ntchat-send{border:0;background:var(--c-accent);color:#fff}
.ntchat .ntchat-send:disabled{background:var(--c-line);color:var(--c-muted)}
.ntchat .ntchat-form textarea{flex:1;min-width:0;min-height:44px;max-height:132px;margin:0;padding:11px 12px;resize:none;overflow-y:hidden;border:1px solid var(--c-line);border-radius:12px;font:inherit;font-size:15px;line-height:1.4;background:var(--c-panel);color:var(--c-ink)}
.ntchat .ntchat-form textarea::placeholder{color:var(--c-muted)}
.ntchat .ntchat-form textarea:focus{border-color:var(--c-accent);outline:none;box-shadow:0 0 0 3px var(--c-accent-soft)}
.ntchat-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Телефон: окно на весь экран; кнопка над нижней панелью сайта (.mobile-bar, около 68px) */
@media (max-width:640px){
  .ntchat{right:16px;bottom:calc(84px + env(safe-area-inset-bottom))}
  .ntchat-fab{width:56px;height:56px}
  .ntchat-fab svg{width:26px;height:26px}
  .ntchat.is-open{inset:0}
  .ntchat-panel{position:fixed;left:0;right:0;top:var(--ntchat-top,0px);bottom:auto;width:auto;height:var(--ntchat-h,100dvh);border:0;border-radius:0;animation-name:ntchat-up;animation-duration:.25s}
  body .ntchat .ntchat-panel{height:var(--ntchat-h,100dvh)}
  .ntchat-head{padding-top:max(14px,env(safe-area-inset-top))}
  .ntchat-foot{padding-bottom:max(12px,env(safe-area-inset-bottom))}
  .ntchat .ntchat-form textarea,.ntchat .ntchat-contact input{font-size:16px}
}
/* Окно выезжает снизу; высота и верх из visualViewport (chat.js), чтобы поле ввода было над клавиатурой */
@keyframes ntchat-up{from{transform:translateY(100%)}to{transform:none}}
/* Пока чат открыт на телефоне, страница под ним заморожена */
html.ntchat-locked,html.ntchat-locked body{overflow:hidden}
html.ntchat-locked body{position:fixed;left:0;right:0;width:100%}
@media (prefers-reduced-motion:reduce){
  .ntchat-panel{animation:none}
  .ntchat-fab{transition:none}
  .ntchat-fab.is-calling::before,.ntchat-fab.is-calling::after{animation:none}
}
