@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Manrope:wght@200..800&display=swap');
*,*::before,*::after{box-sizing:border-box}

/* ── Bubble (Кнопка) ── */
.lc-bubble{
  position:fixed;bottom:60px;right:15px;z-index:9999;
  width:40px;height:40px;border-radius:50%;
  /* Белый фон, розовая обводка */
  background:#ffffff;
  border:1.6px solid #ff749f;
  cursor:pointer;
  color:#ff749f;
  display:flex;align-items:center;justify-content:center;
  /* Без теней по ТЗ */
  box-shadow:none;
  transition:transform .2s cubic-bezier(.34,1.56,.64,1), background .2s;
  font-family:"Inter",sans-serif;
}
.lc-bubble:hover{transform:scale(1.08);background:#fff0f4}
.lc-bubble:active{transform:scale(.95)}
.lc-bubble svg{width:22px;height:22px;fill:currentColor}

.lc-badge{
  position:absolute;top:-5px;right:-5px;
  min-width:20px;height:20px;border-radius:10px;padding:0 5px;
  background:#ff4d6d;color:#fff;font-size:11px;font-weight:700;
  display:none;align-items:center;justify-content:center;
  border:2px solid #fff;font-family:"Inter",sans-serif;
}
.lc-badge.show{display:flex}

/* ── Window (Окно чата) ── */
.lc-window{
  position:fixed;
  /* Позиционируем нижний правый угол окна ровно в центр кнопки (right: 20+22=42, bottom: 60+22=82) */
  bottom:82px;right:42px;z-index:9998;
  width:380px;max-height:calc(100vh - 100px);
  border-radius:20px;overflow:hidden;
  background:#ffffff;
  display:flex;flex-direction:column;
  /* Мягкая современная тень */
  box-shadow:0 25px 60px -15px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.03);
  /* Точка трансформации в правом нижнем углу, чтобы "вырастать" из кнопки */
  transform-origin:100% 100%;
  transform:scale(0);
  opacity:0;pointer-events:none;
  transition:transform .35s cubic-bezier(.34,1.56,.64,1),opacity .2s ease;
  font-family:"Inter",sans-serif;
}
.lc-window.open{transform:scale(1);opacity:1;pointer-events:auto}

/* ── Header (Современный Glassmorphism) ── */
.lc-head{
  background:rgba(255,255,255,0.85);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  color:#1f2937;padding:14px 16px;
  display:flex;align-items:center;justify-content:space-between;flex-shrink:0;
  border-bottom:1px solid rgba(255,116,159,0.1);
}
.lc-head-left{display:flex;align-items:center;gap:12px}
.lc-head-av{
  width:40px;height:40px;border-radius:50%;
  background:#fff0f4;border:2px solid #ff749f;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:16px;flex-shrink:0;overflow:hidden;
  color:#ff749f;
}
.lc-head-av img{width:100%;height:100%;object-fit:cover}
.lc-head-name{font-size:14px;font-weight:700;line-height:1.2;color:#111827}
.lc-head-sub{font-size:11px;opacity:.7;margin-top:2px;display:flex;align-items:center;gap:5px;color:#4b5563}
.lc-online-dot{width:7px;height:7px;border-radius:50%;background:#34d399;display:inline-block;flex-shrink:0}
.lc-head-close{
  background:#f3f4f6;border:none;color:#6b7280;
  width:30px;height:30px;border-radius:10px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:background .15s, color .15s;flex-shrink:0;
}
.lc-head-close:hover{background:#fee2e2;color:#ff4d6d}
.lc-head-close svg{width:14px;height:14px;fill:currentColor}


/* ── Language switcher ── */
.lc-lang-sw{display:flex;gap:2px;background:rgba(255,255,255,.15);border-radius:8px;padding:2px}
.lc-lang-btn{
  background:transparent;border:none;color:rgba(255,255,255,.7);
  font-size:10px;font-weight:700;padding:3px 7px;border-radius:6px;
  cursor:pointer;font-family:inherit;transition:all .15s;letter-spacing:.04em;
}
.lc-lang-btn:hover{color:#fff;background:rgba(255,255,255,.15)}
.lc-lang-btn.active{background:rgba(255,255,255,.25);color:#fff}
/* ── Messages ── */
.lc-msgs{
  flex:1;overflow-y:auto;padding:16px;
  display:flex;flex-direction:column;gap:8px;min-height:200px;
  background:#fafafa;
}
.lc-msgs::-webkit-scrollbar{width:3px}
.lc-msgs::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:3px}

.lc-msg-row{display:flex;flex-direction:column}
.lc-msg-row.visitor{align-items:flex-end}
.lc-msg-row.operator,.lc-msg-row.bot{align-items:flex-start}

.lc-msg-sender{font-size:10px;font-weight:600;color:#9ca3af;margin-bottom:3px;padding:0 4px}
.lc-msg-bbl{
  max-width:82%;padding:10px 14px;border-radius:18px;
  font-size:13.5px;line-height:1.55;word-break:break-word;
  animation:lcIn .25s cubic-bezier(.22,.68,0,1.2);
}
@keyframes lcIn{from{opacity:0;transform:translateY(8px) scale(.96)}to{opacity:1;transform:none}}

/* Пузырь пользователя */
.lc-msg-bbl.visitor{
  background:linear-gradient(135deg,#ff5a8a,#ff749f);color:#fff;
  border-bottom-right-radius:4px;
  box-shadow:0 4px 15px rgba(255,116,159,0.25);
}
/* Пузырь оператора */
.lc-msg-bbl.operator,.lc-msg-bbl.bot{
  background:#ffffff;color:#1f2937;border-bottom-left-radius:4px;
  border:1px solid #f3f4f6;
  box-shadow:0 2px 8px rgba(0,0,0,0.04);
}
.lc-msg-time{font-size:10px;color:#9ca3af;margin-top:3px;padding:0 4px}

/* ── Input ── */
.lc-inp{
  padding:12px 14px;border-top:1px solid #f3f4f6;
  display:flex;gap:10px;flex-shrink:0;background:#ffffff;align-items:center;
}
.lc-inp input{
  flex:1;border:1.5px solid #e5e7eb;border-radius:14px;
  padding:10px 16px;font-size:13.5px;outline:none;
  transition:border-color .2s,box-shadow .2s;font-family:"Inter",sans-serif;
  background:#f9fafb;color:#111827;
}
.lc-inp input::placeholder{color:#9ca3af}
.lc-inp input:focus{
  border-color:#ff749f;background:#ffffff;
  box-shadow:0 0 0 3px rgba(255,116,159,0.12);
}
.lc-inp-btn{
  width:40px;height:40px;border-radius:12px;border:none;flex-shrink:0;
  background:#ff749f;color:#ffffff;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:transform .15s,box-shadow .15s, background .15s;
  box-shadow:0 4px 12px rgba(255,116,159,0.3);
}
.lc-inp-btn:hover{transform:scale(1.05);background:#ff5a8a;box-shadow:0 6px 16px rgba(255,116,159,0.4)}
.lc-inp-btn:active{transform:scale(.96)}
.lc-inp-btn:disabled{opacity:.4;cursor:not-allowed;transform:none;box-shadow:none}
.lc-inp-btn svg{width:18px;height:18px;fill:currentColor}

/* ── Rating ── */
.lc-rating{
  padding:14px 16px;border-top:1px solid #f3f4f6;background:#ffffff;
  flex-shrink:0;text-align:center;position:relative;z-index:5;
}
.lc-rating p{font-size:13px;color:#4b5563;font-weight:600;margin:0 0 10px}
.lc-stars-row{display:flex;gap:6px;justify-content:center;position:relative;z-index:6}
.lc-star-btn{
  background:none;border:none;cursor:pointer;padding:6px 4px;
  font-size:28px;line-height:1;transition:transform .15s;
  color:#e5e7eb;display:inline-block;position:relative;z-index:7;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
.lc-star-btn:hover{transform:scale(1.2);color:#ffb347}
.lc-star-btn.active{color:#ff749f}

/* ── Closed banner ── */
.lc-closed-banner{
  padding:12px 14px;background:#fff0f4;border-radius:12px;
  text-align:center;font-size:12px;color:#ff749f;font-weight:500;margin-top:4px;
}
.lc-new-chat-btn{
  display:inline-block;margin:8px auto 0;
  padding:7px 20px;border:1.5px solid #ff749f;border-radius:10px;
  background:#ffffff;color:#ff749f;font-weight:600;cursor:pointer;
  font-family:"Inter",sans-serif;font-size:12px;transition:all .15s;
}
.lc-new-chat-btn:hover{background:#ff749f;color:#ffffff}

/* ── Мобильная адаптация ── */
@media(max-width:440px){
  /* На мобилках возвращаем стандартное позиционирование, так как кнопка может быть в другом месте */
  .lc-window{
    width:calc(100vw - 32px);right:16px;bottom:110px;
    transform-origin: bottom right;
    transform: scale(.92) translateY(16px);
  }
  .lc-window.open{transform: scale(1) translateY(0)}
}
/* ── Welcome screen ── */
.lc-welcome{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:28px 20px;gap:12px;text-align:center;flex:1;
  background:linear-gradient(180deg,#fff7f9 0%,#fafafa 100%);
  min-height:180px;
}
.lc-welcome-icon{
  width:56px;height:56px;border-radius:50%;
  background:linear-gradient(135deg,#ff5a8a,#ff749f4d);
  display:flex;align-items:center;justify-content:center;
  color:#fff;
  box-shadow:0 8px 24px rgba(255,116,159,.3);
}
.lc-welcome-title{font-size:15px;font-weight:700;color:#111827;margin:0}
.lc-welcome-text{font-size:13px;color:#6b7280;margin:0;line-height:1.55;max-width:280px}

/* ── Operator join card ── */
.lc-op-join{
  display:flex;align-items:center;gap:10px;padding:8px 12px;
  background:rgba(255,116,159,.06);border:1px solid rgba(255,116,159,.18);
  border-radius:12px;margin:6px auto;max-width:90%;
  animation:lcIn .25s cubic-bezier(.22,.68,0,1.2);
}
.lc-op-join-av{
  width:34px;height:34px;border-radius:50%;overflow:hidden;flex-shrink:0;
  background:#fff0f4;border:2px solid #ff749f;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:13px;color:#ff749f;
}
.lc-op-join-av img{width:100%;height:100%;object-fit:cover}
.lc-op-join-name{font-size:12px;font-weight:700;color:#ff749f}
.lc-op-join-txt{font-size:11px;color:#9ca3af;margin-top:1px}

/* ── Name form ── */
.lc-name-form{
  display:flex;flex-direction:column;align-items:center;
  padding:28px 20px 24px;gap:12px;text-align:center;
  flex:1;background:#fff;
  min-height:220px;
}
.lc-name-icon{
  width:56px;height:56px;border-radius:50%;
  background:linear-gradient(135deg,#ff5a8a,#ff749f);
  display:flex;align-items:center;justify-content:center;color:#fff;
  box-shadow:0 6px 20px rgba(255,116,159,.3);flex-shrink:0;
}
.lc-name-title{
  font-size:15px;font-weight:700;color:#111827;margin:0;
}
.lc-name-inp{
  width:100%;padding:10px 14px;
  border:1.5px solid #e5e7eb;border-radius:10px;
  font-size:13.5px;outline:none;color:#111827;
  font-family:inherit;transition:border-color .2s,box-shadow .2s;
  background:#f9fafb;
}
.lc-name-inp:focus{border-color:#ff749f;background:#fff;box-shadow:0 0 0 3px rgba(255,116,159,.12)}
.lc-name-inp::placeholder{color:#9ca3af}
.lc-name-btn{
  width:100%;padding:11px 0;border-radius:10px;border:none;
  background:linear-gradient(135deg,#ff5a8a,#ff749f);color:#fff;
  font-size:14px;font-weight:600;cursor:pointer;
  font-family:inherit;transition:opacity .15s,transform .15s;
  box-shadow:0 4px 14px rgba(255,116,159,.35);
}
.lc-name-btn:hover{opacity:.92;transform:translateY(-1px)}
.lc-name-btn:active{opacity:.85;transform:translateY(0)}
