
  /* ── ВИДЖЕТ ── */
  #lsChat {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  }

  /* ── КНОПКА ── */
  #lsChatFab {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid #c9a24b;
    cursor: pointer;
    padding: 15px 24px 15px 18px;
    border-radius: 999px;
    background: #16181d;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .2px;
    box-shadow: 0 10px 34px rgba(0,0,0,.4), 0 0 0 0 rgba(201,162,75,.55);
    transition: background .15s, transform .15s, box-shadow .15s;
    position: relative;
    animation: lsFabPulse 2.6s ease-in-out infinite;
  }
  #lsChatFab:hover {
    background: #24262d;
    transform: translateY(-2px) scale(1.03);
    animation-play-state: paused;
    box-shadow: 0 14px 38px rgba(0,0,0,.45);
  }
  @keyframes lsFabPulse {
    0%   { box-shadow: 0 10px 34px rgba(0,0,0,.4), 0 0 0 0 rgba(201,162,75,.5); }
    50%  { box-shadow: 0 10px 34px rgba(0,0,0,.4), 0 0 0 10px rgba(201,162,75,0); }
    100% { box-shadow: 0 10px 34px rgba(0,0,0,.4), 0 0 0 0 rgba(201,162,75,0); }
  }
  #lsFabIcon { display: flex; align-items: center; }
  #lsFabIcon svg { stroke: #d9b563; width: 28px; height: 28px; }

  /* значок непрочитанных */
  #lsUnread {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e74c3c;
    border: 2px solid #fff;
  }
  #lsUnread.show { display: block; }

  /* ── ПАНЕЛЬ ЧАТА ── */
  #lsChatPanel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: 370px;
    max-width: calc(100vw - 24px);
    height: 520px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(.97);
    transition: opacity .2s ease, transform .2s ease;
  }
  #lsChatPanel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  /* ── ШАПКА ── */
  #lsChatHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #16181d 0%, #2b2e37 100%);
    flex-shrink: 0;
  }
  #lsChatHeadLeft { display: flex; align-items: center; gap: 10px; }
  #lsChatAvatar {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 4px;
  }
  #lsChatAvatarImg {
    width: 100%; height: 100%;
    object-fit: contain;
  }
  #lsChatName { font-weight: 800; font-size: 14px; color: #fff; }
  #lsChatStatus { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: rgba(255,255,255,.85); margin-top: 2px; }
  #lsStatusDot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #7fff9a;
    box-shadow: 0 0 6px rgba(127,255,154,.8);
  }
  #lsChatClose {
    border: 0; background: rgba(255,255,255,.15);
    color: #fff; cursor: pointer;
    width: 30px; height: 30px; border-radius: 50%;
    font-size: 15px; display: flex; align-items: center; justify-content: center;
    transition: background .15s;
  }
  #lsChatClose:hover { background: rgba(255,255,255,.3); }

  /* ── СООБЩЕНИЯ ── */
  #lsChatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f5f5f6;
    scroll-behavior: smooth;
  }
  #lsChatMessages::-webkit-scrollbar { width: 4px; }
  #lsChatMessages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

  /* пузыри */
  .ls-msg {
    max-width: 85%;
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: lsMsgIn .18s ease;
  }
  @keyframes lsMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .ls-msg-bot {
    background: #fff;
    color: #16181d;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    align-self: flex-start;
  }
  .ls-msg-user {
    background: #16181d;
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
  }

  /* индикатор набора */
  .ls-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    align-self: flex-start;
    width: fit-content;
  }
  .ls-typing span {
    width: 7px; height: 7px; border-radius: 50%;
    background: #aaa;
    animation: lsDot 1.2s infinite ease-in-out;
  }
  .ls-typing span:nth-child(2) { animation-delay: .2s; }
  .ls-typing span:nth-child(3) { animation-delay: .4s; }
  @keyframes lsDot {
    0%, 60%, 100% { transform: translateY(0); background: #bbb; }
    30% { transform: translateY(-5px); background: #16181d; }
  }

  /* ── ВВОД ── */
  #lsChatInputWrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.07);
    flex-shrink: 0;
  }
  #lsChatInput {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 13.5px;
    color: #16181d;
    background: #fafafa;
    resize: none;
    outline: none;
    line-height: 1.45;
    max-height: 100px;
    overflow-y: auto;
    transition: border .15s;
    font-family: inherit;
  }
  #lsChatInput:focus { border-color: #16181d; background: #fff; }
  #lsChatInput::placeholder { color: #999; }
  #lsChatSend {
    width: 38px; height: 38px; flex-shrink: 0;
    border: 0; border-radius: 12px;
    background: #16181d; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .1s;
  }
  #lsChatSend:hover { background: #2b2e37; transform: scale(1.05); }
  #lsChatSend:disabled { background: #b5b6ba; cursor: default; transform: none; }

  /* Кнопки мессенджеров */
  #lsChatHint { font-size:12px; color:#666; text-align:center; padding:4px 14px 0; background:#fff; }
  #lsChatMessengers .ls-direct { font-size:12px; color:#16181d; padding:8px 4px; text-decoration:underline; }
  #lsChatMessengers { display:flex; align-items:center; gap:8px; padding:8px 14px 12px; background:#fff; border-top:1px solid rgba(0,0,0,.05); flex-shrink:0; flex-wrap:wrap; }
  #lsMsgLabel { font-size:11px; color:#888; flex-basis:100%; margin-bottom:2px; }
  #lsTgBtn { display:flex; align-items:center; gap:5px; padding:6px 12px; border-radius:20px; font-size:12px; font-weight:700; text-decoration:none; transition:opacity .15s; background:#2AABEE; color:#fff; }
  #lsTgBtn:hover { opacity:.85; }

  /* ── МОБИЛКА ── */
  @media (max-width: 480px) {
    #lsChat { right: 12px; bottom: 12px; }
    #lsChatFab { padding: 11px 14px 11px 12px; font-size: 13px; }
    #lsFabLabel { display: none; }
    #lsChatPanel { width: calc(100vw - 24px); height: min(480px, calc(100dvh - 90px)); }
  }
