/* Чат-консультант «мокапинг» — виджет на всех страницах сайта.
   Стиль — те же токены, что у сайта: Inter, #1d1d1f, акцент #0071e3, радиусы 20px. */

.fmt-agent{position:fixed;right:24px;bottom:24px;z-index:80;font-family:var(--font-display,"Inter",system-ui,sans-serif);color:#1d1d1f}

/* кнопка */
.fmt-agent__btn{display:flex;align-items:center;gap:10px;height:54px;padding:0 20px 0 16px;border:0;border-radius:999px;
  background:#1d1d1f;color:#f5f5f7;font:inherit;font-size:15px;font-weight:500;letter-spacing:-.01em;cursor:pointer;
  box-shadow:0 10px 30px rgba(0,0,0,.22);transition:transform .2s cubic-bezier(.2,.7,.3,1),background .2s}
.fmt-agent__btn:hover{transform:translateY(-1px);background:#000}
.fmt-agent__btn svg{width:22px;height:22px}
.fmt-agent__dot{width:8px;height:8px;border-radius:50%;background:#30d158;box-shadow:0 0 0 3px rgba(48,209,88,.18)}

/* панель */
.fmt-agent__panel{position:absolute;right:0;bottom:66px;width:382px;max-height:min(620px,calc(100vh - 120px));
  display:flex;flex-direction:column;background:#fff;border-radius:22px;overflow:hidden;
  box-shadow:0 24px 70px rgba(0,0,0,.22),0 2px 8px rgba(0,0,0,.08);
  opacity:0;transform:translateY(12px) scale(.98);pointer-events:none;transform-origin:100% 100%;
  transition:opacity .22s cubic-bezier(.2,.7,.3,1),transform .22s cubic-bezier(.2,.7,.3,1)}
.fmt-agent.is-open .fmt-agent__panel{opacity:1;transform:none;pointer-events:auto}

.fmt-agent__head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid #e8e8ed;background:#fbfbfd}
.fmt-agent__ava{width:34px;height:34px;border-radius:50%;background:#1d1d1f;color:#fff;display:grid;place-items:center;
  font-size:13px;font-weight:600;letter-spacing:-.02em;flex:0 0 auto}
.fmt-agent__who{display:grid;gap:1px;line-height:1.2}
.fmt-agent__who b{font-size:14px;font-weight:600}
.fmt-agent__who span{font-size:12px;color:#86868b}
.fmt-agent__close{margin-left:auto;width:32px;height:32px;border:0;border-radius:50%;background:transparent;cursor:pointer;
  font-size:20px;line-height:1;color:#86868b}
.fmt-agent__close:hover{background:#f0f0f2;color:#1d1d1f}

/* лента */
.fmt-agent__log{flex:1 1 auto;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px;background:#fff;
  overscroll-behavior:contain}
.fmt-agent__msg{max-width:86%;padding:11px 14px;border-radius:16px;font-size:14.5px;line-height:1.42;white-space:pre-wrap;word-break:break-word}
.fmt-agent__msg--bot{background:#f5f5f7;border-bottom-left-radius:6px;align-self:flex-start}
.fmt-agent__msg--me{background:#0071e3;color:#fff;border-bottom-right-radius:6px;align-self:flex-end}
.fmt-agent__typing{display:inline-flex;gap:4px;padding:14px 16px;background:#f5f5f7;border-radius:16px;align-self:flex-start}
.fmt-agent__typing i{width:6px;height:6px;border-radius:50%;background:#b0b0b5;animation:fmtDot 1.1s infinite}
.fmt-agent__typing i:nth-child(2){animation-delay:.15s}
.fmt-agent__typing i:nth-child(3){animation-delay:.3s}
@keyframes fmtDot{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-2px)}}

/* расчёт */
.fmt-agent__quote{align-self:stretch;border:1px solid #e8e8ed;border-radius:16px;padding:14px;display:grid;gap:8px;background:#fff}
.fmt-agent__quote .q-brief{font-size:13px;color:#6e6e73;line-height:1.35}
.fmt-agent__quote .q-rows{display:grid;gap:4px}
.fmt-agent__quote .q-row{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:#424245}
.fmt-agent__quote .q-row b{font-weight:500;white-space:nowrap;font-variant-numeric:tabular-nums}
.fmt-agent__quote .q-total{display:flex;align-items:baseline;justify-content:space-between;gap:12px;
  border-top:1px solid #e8e8ed;padding-top:10px;font-size:22px;font-weight:600;letter-spacing:-.02em}
.fmt-agent__quote .q-note{font-size:11.5px;color:#86868b}
.fmt-agent__quote .q-cta{height:42px;border:0;border-radius:12px;background:#0071e3;color:#fff;font:inherit;font-size:14px;
  font-weight:500;cursor:pointer}
.fmt-agent__quote .q-cta:hover{background:#0069d2}

/* подсказки */
.fmt-agent__chips{display:flex;flex-wrap:wrap;gap:6px;padding:0 16px 12px}
.fmt-agent__chips button{border:1px solid #e8e8ed;background:#fff;border-radius:999px;padding:7px 12px;font:inherit;
  font-size:12.5px;color:#424245;cursor:pointer}
.fmt-agent__chips button:hover{border-color:#1d1d1f;color:#1d1d1f}

/* ввод */
.fmt-agent__form{display:flex;gap:8px;padding:12px 12px 14px;border-top:1px solid #e8e8ed;background:#fbfbfd}
.fmt-agent__input{flex:1;height:44px;border:1px solid #d2d2d7;border-radius:12px;padding:0 14px;font:inherit;font-size:14.5px;
  background:#fff;color:#1d1d1f;outline:none}
.fmt-agent__input:focus{border-color:#0071e3;box-shadow:0 0 0 3px rgba(0,113,227,.12)}
.fmt-agent__send{width:44px;height:44px;border:0;border-radius:12px;background:#0071e3;color:#fff;cursor:pointer;display:grid;place-items:center}
.fmt-agent__send:disabled{background:#c7c7cc;cursor:default}
.fmt-agent__send svg{width:18px;height:18px}

/* форма заявки внутри панели */
.fmt-agent__lead{display:grid;gap:8px;padding:12px 16px 16px;border-top:1px solid #e8e8ed;background:#fbfbfd}
.fmt-agent__lead p{margin:0;font-size:12.5px;color:#6e6e73}
.fmt-agent__lead input{height:42px;border:1px solid #d2d2d7;border-radius:11px;padding:0 12px;font:inherit;font-size:14px}
.fmt-agent__lead button{height:42px;border:0;border-radius:11px;background:#0071e3;color:#fff;font:inherit;font-size:14px;font-weight:500;cursor:pointer}
.fmt-agent__ok{font-size:13px;color:#1d7f3a}

@media (max-width:734px){
  .fmt-agent{right:12px;bottom:12px;left:12px}
  .fmt-agent__btn{margin-left:auto;height:50px;padding:0 16px;font-size:14px}
  .fmt-agent__panel{position:fixed;inset:auto 0 0 0;width:auto;max-height:none;height:calc(100dvh - 56px);
    border-radius:22px 22px 0 0}
  .fmt-agent__log{padding:14px}
  .fmt-agent__msg{max-width:92%}
}
@media (prefers-reduced-motion:reduce){
  .fmt-agent__panel{transition:none}
  .fmt-agent__typing i{animation:none}
}
