/* ============================================================
   LiveChat Widget — v1.0.0
   ВСЕ селекторы с префиксом #lc-root — изоляция от темы livechat.widget.css
   ============================================================ */

/* --- Box-sizing для виджета (не трогаем padding!) --- */
#lc-root,
#lc-root .lc-panel,
#lc-root .lc-header,
#lc-root .lc-header-info,
#lc-root .lc-avatar,
#lc-root .lc-close-btn,
#lc-root .lc-step,
#lc-root .lc-messenger-list,
#lc-root .lc-messenger-item,
#lc-root .lc-auth-wrap,
#lc-root .lc-field,
#lc-root .lc-msgs,
#lc-root .lc-msgs-wrap,
#lc-root .lc-bg-pattern-overlay,
#lc-root .lc-msg,
#lc-root .lc-msg-bubble,
#lc-root .lc-typing,
#lc-root .lc-input-area,
#lc-root .lc-input-row,
#lc-root .lc-input-wrap,
#lc-root .lc-send-btn,
#lc-root .lc-quick-replies,
#lc-root .lc-qr-btn,
#lc-root .lc-page-ctx,
#lc-root .lc-rating-wrap,
#lc-root .lc-emojis,
#lc-root .lc-emoji,
#lc-root .lc-compose-toolbar,
#lc-root .lc-fmt-btn,
#lc-root .lc-emoji-picker,
#lc-root .lc-photo-preview,
#lc-root .lc-photo-chip,
#lc-root .lc-msg-img,
#lc-root .lc-link-preview,
#lc-root button,
#lc-root input,
#lc-root textarea,
#lc-root a {
    box-sizing: border-box;
}

/* --- Переменные темы --- */
#lc-root {
    --lc-primary:    #5b9bd5;
    --lc-primary-dk: #4a89c5;
    --lc-on-primary: #ffffff;
    --lc-bg:         #ffffff;
    --lc-bg-panel:   #f7f8fc;
    --lc-bg-user:    #5b9bd5;
    --lc-bg-bot:     #f0f1f6;
    --lc-text:       #1a1a2e;
    --lc-text-sub:   #6b7280;
    --lc-border:     rgba(0,0,0,0.08);
    --lc-shadow:     0 8px 32px rgba(0,0,0,0.18);
    --lc-radius:     18px;
    --lc-radius-sm:  10px;
    --lc-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --lc-transition: 0.22s cubic-bezier(0.4,0,0.2,1);
    --lc-z:          999999;

    position: fixed;
    font-family: var(--lc-font);
    font-size: 14px;
    z-index: var(--lc-z);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    width: auto;
    height: auto;
    pointer-events: none;
}

#lc-root #lc-btn,
#lc-root #lc-launcher,
#lc-root .lc-panel {
    pointer-events: auto;
}

/* --- Позиции --- */
#lc-root.lc-pos-bottom-right  { bottom: 104px; right: 24px; }
#lc-root.lc-pos-bottom-left   { bottom: 24px; left: 24px; }
#lc-root.lc-pos-top-right     { top: 24px; right: 24px; }
#lc-root.lc-pos-top-left      { top: 24px; left: 24px; }
#lc-root.lc-pos-bottom-center { bottom: 24px; left: 50%; transform: translateX(-50%); }


/* ============================================================
   PANEL
   ============================================================ */
#lc-root .lc-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 370px;
    height: 580px;
    max-height: calc(100vh - 120px);
    background: var(--lc-bg);
    border-radius: var(--lc-radius);
    box-shadow: var(--lc-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--lc-border);
    z-index: 999999;
    animation: lc-slide-up 0.24s cubic-bezier(0.34,1.56,0.64,1);
}

#lc-root.lc-pos-bottom-left   .lc-panel { right: auto; left: 24px; bottom: 90px; top: auto; transform: none; }
#lc-root.lc-pos-top-right     .lc-panel { bottom: auto; top: 90px; right: 24px; left: auto; transform: none; }
#lc-root.lc-pos-top-left      .lc-panel { bottom: auto; top: 90px; right: auto; left: 24px; transform: none; }
#lc-root.lc-pos-bottom-center .lc-panel { right: auto; left: 50%; bottom: 90px; top: auto; transform: translateX(-50%); }

@keyframes lc-slide-up {
    from { opacity: 0; transform: translateY(18px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}




/* --- Header --- */
#lc-root .lc-header {
    background: var(--lc-primary);
    color: var(--lc-on-primary);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#lc-root .lc-header-info { display: flex; align-items: center; gap: 12px; }
#lc-root .lc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
#lc-root .lc-avatar img { width: 100%; height: 100%; object-fit: cover; }
#lc-root .lc-avatar svg { fill: rgba(255,255,255,0.9); }
#lc-root .lc-header-title { font-weight: 700; font-size: 15px; }
#lc-root .lc-header-sub   { font-size: 12px; opacity: 0.82; margin-top: 2px; }
#lc-root .lc-close-btn {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background var(--lc-transition);
}
#lc-root .lc-close-btn:hover { background: rgba(255,255,255,0.32); }

/* ============================================================
   STEPS — КЛЮЧЕВОЙ ФИКС
   ============================================================ */

/* Все шаги — flex-контейнеры, но НЕ скроллятся сами */
#lc-root .lc-step {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Мессенджеры и авторизация — пусть скроллятся внутри себя */
#lc-root #lc-step-messenger,
#lc-root #lc-step-auth {
    overflow-y: auto;
}

/* Чат — НЕ скроллится снаружи, всё внутри .lc-msgs */
#lc-root #lc-step-chat {
    overflow: hidden;
}

/* --- Messenger chooser --- */
#lc-root .lc-messenger-list { padding: 12px 0; }
#lc-root .lc-messenger-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--lc-text-sub);
    padding: 0 18px 8px;
}
#lc-root .lc-messenger-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--lc-text);
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font: inherit;
    transition: background var(--lc-transition);
}
#lc-root .lc-messenger-item:hover { background: var(--lc-bg-panel); }
#lc-root .lc-msg-icon { width: 28px; flex-shrink: 0; display: flex; align-items: center; }
#lc-root .lc-msg-label { flex: 1; font-size: 14px; font-weight: 500; }
#lc-root .lc-arr { color: var(--lc-text-sub); flex-shrink: 0; }
#lc-root .lc-chat-btn { font-weight: 600; }
#lc-root .lc-online-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #d1d5db; flex-shrink: 0;
}
#lc-root .lc-online-dot.lc-online  { background: #22c55e; }
#lc-root .lc-online-dot.lc-offline { background: #f59e0b; }

/* --- Auth form --- */
#lc-root .lc-auth-wrap { padding: 24px 20px; }
#lc-root .lc-auth-intro { color: var(--lc-text-sub); margin-bottom: 18px; font-size: 13px; }
#lc-root .lc-field { margin-bottom: 12px; }
#lc-root .lc-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--lc-border);
    border-radius: var(--lc-radius-sm);
    font: inherit;
    font-size: 14px;
    color: var(--lc-text);
    background: var(--lc-bg);
    outline: none;
    transition: border-color var(--lc-transition);
}
#lc-root .lc-field input:focus { border-color: var(--lc-primary); }
#lc-root .lc-error { color: #ef4444; font-size: 12px; margin-bottom: 8px; }
#lc-root .lc-btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--lc-primary);
    color: #fff;
    border: none;
    border-radius: var(--lc-radius-sm);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background var(--lc-transition), transform var(--lc-transition);
}
#lc-root .lc-btn-primary:hover { background: var(--lc-primary-dk); }
#lc-root .lc-btn-primary:active { transform: scale(0.98); }
#lc-root .lc-btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

/* ============================================================
   MESSAGES — КЛЮЧЕВОЙ ФИКС
   ============================================================ */

/* Обёртка: если есть .lc-msgs-wrap — flex-контейнер, ограничен высотой */
#lc-root .lc-msgs-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Сама область сообщений — единственное, что скроллится */
#lc-root .lc-msgs {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

/* Overlay паттерна — фиксирован в обёртке, не уезжает при скролле */
#lc-root .lc-msgs-wrap .lc-bg-pattern-overlay,
#lc-root .lc-msgs > .lc-bg-pattern-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-repeat: repeat;
    background-position: top left;
    pointer-events: none;
    z-index: 1;
}

/* Сообщения — выше overlay */
#lc-root .lc-msg {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
#lc-root .lc-msg-user { flex-direction: row-reverse; }
#lc-root .lc-msg-bot .lc-msg-bubble   { background: var(--lc-bg-bot); color: var(--lc-text); }
#lc-root .lc-msg-user .lc-msg-bubble  { background: var(--lc-bg-user); color: var(--lc-on-primary); }
#lc-root .lc-msg-bubble {
    max-width: 80%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative; 
}
#lc-root .lc-msg-bot .lc-msg-bubble   { border-bottom-left-radius: 4px; }
#lc-root .lc-msg-user .lc-msg-bubble  { border-bottom-right-radius: 4px; }
#lc-root .lc-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--lc-bg-bot);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#lc-root .lc-msg-avatar svg { fill: var(--lc-text-sub); width: 16px; height: 16px; }
#lc-root .lc-msg-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
}
#lc-root .lc-check { font-size: 11px; opacity: 0.7; }
#lc-root .lc-check.lc-read { color: #60a5fa; opacity: 1; }
#lc-root .lc-msg-system { text-align: center; color: var(--lc-text-sub); font-size: 12px; padding: 4px 0; }
#lc-root .lc-date-sep {
    text-align: center;
    color: var(--lc-text-sub);
    font-size: 11px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
#lc-root .lc-date-sep::before,
#lc-root .lc-date-sep::after { content: ''; flex: 1; height: 1px; background: var(--lc-border); }
/* ============================================================
   Свяжитесь с нами (contact suggestions)
   ============================================================ */

#lc-root .lc-contact-suggest {
    display: block !important;
    background: #f7f8fc !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    margin: 8px 0 !important;
    font-size: 13px !important;
    color: #1a1a2e !important;
    box-sizing: border-box !important;
    width: auto !important;
    max-width: 100% !important;
    line-height: 1.5 !important;
}

#lc-root .lc-contact-suggest p {
    display: block !important;
    color: #6b7280 !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
}

#lc-root .lc-cs-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 0 6px 6px 0 !important;
    padding: 6px 12px !important;
    background: #5b9bd5 !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: background 0.15s, transform 0.15s !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(91,155,213,0.25) !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}

#lc-root .lc-cs-link:hover {
    background: #4a89c5 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(91,155,213,0.35) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

#lc-root .lc-cs-link:active {
    transform: translateY(0) !important;
}




/* --- Typing --- */
#lc-root .lc-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 8px;
    color: var(--lc-text-sub);
    font-size: 12px;
}
#lc-root .lc-typing-dots { display: flex; gap: 4px; }
#lc-root .lc-typing-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--lc-text-sub);
    animation: lc-dot 1.4s ease-in-out infinite;
}
#lc-root .lc-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
#lc-root .lc-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lc-dot {
    0%,80%,100% { transform: scale(0.7); opacity: 0.4; }
    40%          { transform: scale(1);   opacity: 1;   }
}

/* --- Input area --- */
#lc-root .lc-input-area {
    flex-shrink: 0;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--lc-border);
}
#lc-root .lc-input-row { display: flex; gap: 8px; align-items: flex-end; }
#lc-root .lc-input-wrap { flex: 1; }
#lc-root .lc-input-wrap textarea,
#lc-root #lc-input {
    width: 100%;
    resize: none;
    border: 1.5px solid var(--lc-border);
    border-radius: var(--lc-radius-sm);
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--lc-text);
    background: var(--lc-bg);
    outline: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color var(--lc-transition);
    line-height: 1.5;
}
#lc-root #lc-input:focus { border-color: var(--lc-primary); }
#lc-root .lc-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--lc-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background var(--lc-transition), transform var(--lc-transition);
}
#lc-root .lc-send-btn:hover  { background: var(--lc-primary-dk); }
#lc-root .lc-send-btn:active { transform: scale(0.93); }

#lc-root .lc-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#lc-root .lc-qr-btn {
    padding: 5px 11px;
    border-radius: 16px;
    border: 1.5px solid var(--lc-primary);
    color: var(--lc-primary);
    background: none;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    transition: all var(--lc-transition);
}
#lc-root .lc-qr-btn:hover { background: var(--lc-primary); color: #fff; }

#lc-root .lc-page-ctx {
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--lc-bg-panel);
    border-top: 1px solid var(--lc-border);
    font-size: 11px;
    color: var(--lc-text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#lc-root .lc-ctx-label { font-weight: 600; }

/* --- Rating --- */
#lc-root .lc-rating-wrap { padding: 28px 20px; text-align: center; }
#lc-root .lc-rating-wrap p { color: var(--lc-text-sub); margin-bottom: 20px; }
#lc-root .lc-emojis { display: flex; justify-content: center; gap: 16px; }
#lc-root .lc-emoji {
    font-size: 36px;
    border: none;
    background: none;
    cursor: pointer;
    transition: transform var(--lc-transition);
    border-radius: 50%;
    padding: 6px;
}
#lc-root .lc-emoji:hover       { transform: scale(1.25); }
#lc-root .lc-emoji-selected    { transform: scale(1.35); background: var(--lc-bg-panel); }
#lc-root .lc-emoji:disabled    { cursor: default; }
#lc-root .lc-rating-thanks     { color: var(--lc-primary); font-weight: 600; margin-top: 20px; }

/* ============================================================
   THEMES
   ============================================================ */
#lc-root.lc-theme-dark {
    --lc-primary:  #60a5fa;
    --lc-primary-dk: #3b82f6;
    --lc-on-primary: #0f172a;
    --lc-bg:       #1e293b;
    --lc-bg-panel: #0f172a;
    --lc-bg-user:  #3b82f6;
    --lc-bg-bot:   #334155;
    --lc-text:     #e2e8f0;
    --lc-text-sub: #94a3b8;
    --lc-border:   rgba(255,255,255,0.08);
    --lc-shadow:   0 8px 32px rgba(0,0,0,0.55);
}
#lc-root.lc-theme-dark .lc-header { background: #0f172a; color: #e2e8f0; }
#lc-root.lc-theme-dark .lc-field input { background: #334155; color: #e2e8f0; border-color: #475569; }

#lc-root.lc-theme-glass {
    --lc-primary:  #0071e3;
    --lc-primary-dk: #0057b7;
    --lc-on-primary: #ffffff;
    --lc-bg:       rgba(255,255,255,0.72);
    --lc-bg-panel: rgba(240,240,250,0.65);
    --lc-bg-user:  #0071e3;
    --lc-bg-bot:   rgba(0,0,0,0.07);
    --lc-text:     #1d1d1f;
    --lc-text-sub: #6e6e73;
    --lc-border:   rgba(0,0,0,0.12);
    --lc-shadow:   0 20px 60px rgba(0,0,0,0.25);
    --lc-radius:   22px;
}
#lc-root.lc-theme-glass .lc-panel {
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}
#lc-root.lc-theme-glass .lc-header {
    background: rgba(0,113,227,0.9);
    backdrop-filter: blur(10px);
}
#lc-root.lc-theme-glass .lc-field input {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
}

#lc-root.lc-theme-minimal {
    --lc-primary:  #111827;
    --lc-primary-dk: #000;
    --lc-on-primary: #ffffff;
    --lc-bg:       #ffffff;
    --lc-bg-panel: #f9fafb;
    --lc-bg-user:  #111827;
    --lc-bg-bot:   #f3f4f6;
    --lc-text:     #111827;
    --lc-text-sub: #9ca3af;
    --lc-border:   #e5e7eb;
    --lc-shadow:   0 4px 24px rgba(0,0,0,0.12);
    --lc-radius:   8px;
    --lc-radius-sm: 5px;
}
#lc-root.lc-theme-minimal #lc-btn { border-radius: 8px; }

#lc-root.lc-theme-bubble {
    --lc-primary:  #f97316;
    --lc-primary-dk: #ea6a0a;
    --lc-on-primary: #ffffff;
    --lc-bg:       #fff7ed;
    --lc-bg-panel: #fef3c7;
    --lc-bg-user:  #f97316;
    --lc-bg-bot:   #fef3c7;
    --lc-text:     #7c2d12;
    --lc-text-sub: #a16207;
    --lc-border:   rgba(249,115,22,0.15);
    --lc-shadow:   0 8px 40px rgba(249,115,22,0.3);
    --lc-radius:   24px;
}
#lc-root.lc-theme-bubble #lc-btn { box-shadow: 0 4px 20px rgba(249,115,22,0.5); }





/* ============================================================
   Дополнительные темы
   ============================================================ */

/* Neon */
#lc-root.lc-theme-neon {
    --lc-primary:  #00ffe7;
    --lc-primary-dk: #00d4c1;
    --lc-on-primary: #0a0a1a;
    --lc-bg:       #0a0a1a;
    --lc-bg-panel: #1a1a2e;
    --lc-bg-user:  #7c3aed;
    --lc-bg-bot:   rgba(0,255,231,0.1);
    --lc-text:     #00ffe7;
    --lc-text-sub: #7c8aff;
    --lc-border:   rgba(0,255,231,0.2);
    --lc-shadow:   0 8px 40px rgba(0,255,231,0.4);
}
#lc-root.lc-theme-neon .lc-header {
    background: linear-gradient(135deg, #00ffe7, #7c3aed);
    color: #0a0a1a;
}
#lc-root.lc-theme-neon .lc-msg-user .lc-msg-bubble {
    background: #7c3aed;
    color: #fff;
}
#lc-root.lc-theme-neon .lc-msg-bot .lc-msg-bubble,
#lc-root.lc-theme-neon .lc-msg-operator .lc-msg-bubble {
    background: rgba(0,255,231,0.1);
    color: #00ffe7;
}

/* Sunset */
#lc-root.lc-theme-sunset {
    --lc-primary:  #f97316;
    --lc-primary-dk: #e11d48;
    --lc-on-primary: #ffffff;
    --lc-bg:       #fff5f5;
    --lc-bg-panel: #ffe4e6;
    --lc-bg-user:  #f97316;
    --lc-bg-bot:   #ffe4e6;
    --lc-text:     #881337;
    --lc-text-sub: #b91c1c;
    --lc-border:   rgba(249,115,22,0.2);
    --lc-shadow:   0 8px 40px rgba(249,115,22,0.35);
}
#lc-root.lc-theme-sunset .lc-header {
    background: linear-gradient(135deg, #f97316, #e11d48);
    color: #ffffff;
}
#lc-root.lc-theme-sunset .lc-msg-user .lc-msg-bubble {
    background: linear-gradient(135deg, #f97316, #e11d48);
    color: #fff;
}
#lc-root.lc-theme-sunset .lc-msg-bot .lc-msg-bubble,
#lc-root.lc-theme-sunset .lc-msg-operator .lc-msg-bubble {
    background: #ffe4e6;
    color: #881337;
}

/* Forest */
#lc-root.lc-theme-forest {
    --lc-primary:  #2d6a4f;
    --lc-primary-dk: #1b4332;
    --lc-on-primary: #ffffff;
    --lc-bg:       #f0faf4;
    --lc-bg-panel: #d1fae5;
    --lc-bg-user:  #2d6a4f;
    --lc-bg-bot:   #d1fae5;
    --lc-text:     #064e3b;
    --lc-text-sub: #52796f;
    --lc-border:   rgba(45,106,79,0.15);
    --lc-shadow:   0 8px 40px rgba(45,106,79,0.25);
}
#lc-root.lc-theme-forest .lc-header {
    background: #2d6a4f;
    color: #fff;
}
#lc-root.lc-theme-forest .lc-msg-user .lc-msg-bubble {
    background: #2d6a4f;
    color: #fff;
}
#lc-root.lc-theme-forest .lc-msg-bot .lc-msg-bubble,
#lc-root.lc-theme-forest .lc-msg-operator .lc-msg-bubble {
    background: #d1fae5;
    color: #064e3b;
}



/* ============================================================
   COMPOSER
   ============================================================ */
#lc-root .lc-compose-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 0 6px;
    position: relative;
}
#lc-root .lc-fmt-btn {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: none;
    color: var(--lc-text-sub);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background var(--lc-transition), border-color var(--lc-transition);
}
#lc-root .lc-fmt-btn:hover { background: var(--lc-bg-panel); border-color: var(--lc-border); }
#lc-root .lc-toolbar-sep { width: 1px; height: 16px; background: var(--lc-border); margin: 0 4px; }

/* ============================================================
   EMOJI PICKER — УЛУЧШЕННЫЙ
   ============================================================ */
#lc-root .lc-emoji-picker {
    position: absolute;
    bottom: 40px;
    left: 0;
    z-index: 100;
    
    /* ✅ Шире — 320px, чтобы поместилось 8 колонок */
    width: 320px;
    max-width: calc(100vw - 40px);
    
    /* ✅ Больше по высоте — 260px */
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    
    /* ✅ Непрозрачный фон — эмодзи видны всегда */
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18),
                0 2px 8px rgba(0, 0, 0, 0.08);
    
    /* ✅ Больше отступы */
    padding: 10px;
    
    /* ✅ 8 колонок, крупные */
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    
    /* Красивый скроллбар */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

/* Скроллбар в WebKit */
#lc-root .lc-emoji-picker::-webkit-scrollbar {
    width: 6px;
}
#lc-root .lc-emoji-picker::-webkit-scrollbar-track {
    background: transparent;
}
#lc-root .lc-emoji-picker::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}
#lc-root .lc-emoji-picker::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* Каждый эмодзи */
#lc-root .lc-emoji-item {
    border: none;
    background: transparent;
    cursor: pointer;
    
    /* ✅ Крупнее */
    font-size: 22px;
    line-height: 1;
    
    /* ✅ Квадратные ячейки, ровные */
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 36px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    border-radius: 8px;
    padding: 0;
    margin: 0;
    
    transition: background 0.15s, transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#lc-root .lc-emoji-item:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: scale(1.15);
}

#lc-root .lc-emoji-item:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================================
   ТЁМНАЯ ТЕМА
   ============================================================ */
#lc-root.lc-theme-dark .lc-emoji-picker {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55),
                0 2px 8px rgba(0, 0, 0, 0.3);
}

#lc-root.lc-theme-dark .lc-emoji-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

#lc-root.lc-theme-dark .lc-emoji-picker::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   GLASS ТЕМА — непрозрачный фон для читаемости
   ============================================================ */
#lc-root.lc-theme-glass .lc-emoji-picker {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ============================================================
   NEON ТЕМА
   ============================================================ */
#lc-root.lc-theme-neon .lc-emoji-picker {
    background: #0a0a1a;
    border-color: rgba(0, 255, 231, 0.3);
    box-shadow: 0 12px 40px rgba(0, 255, 231, 0.25);
}

#lc-root.lc-theme-neon .lc-emoji-item:hover {
    background: rgba(0, 255, 231, 0.15);
}

/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ — крупнее и удобнее
   ============================================================ */
@media (max-width: 480px) {
    #lc-root .lc-emoji-picker {
        width: calc(100vw - 24px);
        max-width: 360px;
        max-height: 220px;
        bottom: 50px;
        padding: 8px;
        grid-template-columns: repeat(7, 1fr);
        gap: 3px;
    }

    #lc-root .lc-emoji-item {
        font-size: 24px;
        min-height: 40px;
    }
}

/* ============================================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ
   ============================================================ */
@media (max-width: 360px) {
    #lc-root .lc-emoji-picker {
        grid-template-columns: repeat(6, 1fr);
        gap: 2px;
    }
    #lc-root .lc-emoji-item {
        font-size: 22px;
        min-height: 36px;
    }
}#lc-root .lc-emoji-item:hover { background: var(--lc-bg-panel); }

#lc-root .lc-photo-preview { padding: 0 0 6px; }
#lc-root .lc-photo-chip {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid var(--lc-border);
}
#lc-root .lc-photo-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
#lc-root .lc-photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
#lc-root .lc-photo-remove:hover { background: rgba(0,0,0,.75); }

#lc-root .lc-msg-img {
    display: block;
    max-width: 220px;
    max-height: 220px;
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    cursor: zoom-in;
    background: #ffffff;   /* ✅ белый фон для прозрачных PNG/GIF */
}
#lc-root .lc-msg-caption { margin-top: 6px; font-size: 13px; line-height: 1.45; }
#lc-root .lc-msg-body b, #lc-root .lc-msg-caption b { font-weight: 700; }
#lc-root .lc-msg-body i, #lc-root .lc-msg-caption i { font-style: italic; }
#lc-root .lc-msg-body s, #lc-root .lc-msg-caption s { text-decoration: line-through; }
#lc-root .lc-msg-body a, #lc-root .lc-msg-caption a {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}

#lc-root .lc-link-preview {
    display: block;
    margin-top: 8px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,.5);
    max-width: 260px;
}
#lc-root .lc-msg-user .lc-link-preview {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.25);
}
#lc-root .lc-lp-img {
    height: 110px;
    background-size: cover;
    background-position: center;
    background-color: var(--lc-bg-bot);
}
#lc-root .lc-lp-body { padding: 8px 10px; }
#lc-root .lc-lp-site {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .03em;
    opacity: .7;
    margin-bottom: 2px;
}
#lc-root .lc-lp-title { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
#lc-root .lc-lp-desc {
    font-size: 11px;
    opacity: .8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}











/* ============================================================
   Сообщения от оператора (менеджера)
   ============================================================ */

/* Оператор — слева, как бот */
#lc-root .lc-msg-operator {
    justify-content: flex-start;
    flex-direction: row;
}

#lc-root .lc-msg-operator .lc-msg-bubble,
#lc-root .lc-msg-bot .lc-msg-bubble {
    background: var(--lc-bg-bot);
    color: var(--lc-text);
    border: 1px solid var(--lc-border);
    border-bottom-left-radius: 4px;
}
/* Ободок чуть контрастнее для светлых тем */
#lc-root .lc-msg-operator .lc-msg-bubble {
    box-shadow: 0 0 0 1px var(--lc-border);
}

/* ─── Тема Dark ─── */
#lc-root.lc-theme-dark .lc-msg-operator .lc-msg-bubble {
    background: #334155;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
}

/* ─── Тема Glass ─── */
#lc-root.lc-theme-glass .lc-msg-operator .lc-msg-bubble {
    background: rgba(255, 255, 255, 0.55);
    color: #1d1d1f;
    border-color: rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ─── Тема Minimal ─── */
#lc-root.lc-theme-minimal .lc-msg-operator .lc-msg-bubble {
    background: #f3f4f6;
    color: #111827;
    border-color: #e5e7eb;
}

/* ─── Тема Bubble ─── */
#lc-root.lc-theme-bubble .lc-msg-operator .lc-msg-bubble {
    background: #fef3c7;
    color: #7c2d12;
    border-color: rgba(249, 115, 22, 0.2);
}

/* ─── Тема Neon ─── */
#lc-root.lc-theme-neon .lc-msg-operator .lc-msg-bubble {
    background: rgba(0, 255, 231, 0.1);
    color: #00ffe7;
    border-color: rgba(0, 255, 231, 0.35);
    box-shadow: 0 0 8px rgba(0, 255, 231, 0.15);
}

/* ─── Тема Sunset ─── */
#lc-root.lc-theme-sunset .lc-msg-operator .lc-msg-bubble {
    background: #ffe4e6;
    color: #881337;
    border-color: rgba(225, 29, 72, 0.2);
}

/* ─── Тема Forest ─── */
#lc-root.lc-theme-forest .lc-msg-operator .lc-msg-bubble {
    background: #d1fae5;
    color: #064e3b;
    border-color: rgba(45, 106, 79, 0.25);
}











/* ============================================================
   Адаптивность шрифта
   ============================================================ */

@media (max-width: 480px) {
    /* Чуть уменьшаем все */
    #lc-root {
        font-size: 13px;
    }
    #lc-root .lc-header-title { font-size: 14px; }
    #lc-root .lc-header-sub   { font-size: 11px; }
    #lc-root .lc-msg-bubble,
    #lc-root .lc-msg-body     { font-size: 13px; }
    #lc-root .lc-msg-time     { font-size: 9.5px; }
    #lc-root .lc-messenger-item { padding: 10px 14px; }
    #lc-root .lc-header       { padding: 12px 14px; }
    #lc-root .lc-msgs         { padding: 12px; }
    #lc-root .lc-input-area   { padding: 8px 10px 10px; }
    #lc-root .lc-input-wrap textarea,
    #lc-root #lc-input        { font-size: 13px; padding: 8px 10px; }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    #lc-root { font-size: 12.5px; }
    #lc-root .lc-header-title { font-size: 13.5px; }
    #lc-root .lc-msg-bubble,
    #lc-root .lc-msg-body     { font-size: 12.5px; }
}








/* ============================================================
   Статус оператора — базовые переменные
   ============================================================ */
#lc-root .lc-header-status {
    margin-top: 5px;
}

#lc-root .lc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.4;
    white-space: nowrap;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: background 0.25s, box-shadow 0.25s;
    border: none;
}

#lc-root .lc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
    background: #ffffff;
    position: relative;
}

/* Пульсация для онлайн */
#lc-root .lc-status-badge.lc-status-online .lc-status-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: #ffffff;
    opacity: 0;
    animation: lcStatusPulse 2s ease-out infinite;
}

@keyframes lcStatusPulse {
    0%   { opacity: 0.8; transform: scale(0.8); }
    80%  { opacity: 0;   transform: scale(2); }
    100% { opacity: 0; }
}

/* ---- Онлайн — ЯРКО-ЗЕЛЁНЫЙ ---- */
#lc-root .lc-status-badge.lc-status-online {
    background: #22c55e;
}

/* ---- Отошёл — ЯРКО-ЖЁЛТЫЙ ---- */
#lc-root .lc-status-badge.lc-status-away {
    background: #f59e0b;
}

/* ---- Занят — ЯРКО-КРАСНЫЙ ---- */
#lc-root .lc-status-badge.lc-status-busy {
    background: #ef4444;
}

/* ---- Офлайн — НАСЫЩЕННЫЙ СЕРЫЙ ---- */
#lc-root .lc-status-badge.lc-status-offline {
    background: #64748b;
}



/* ============================================================
   Компоновки (chat_layout)
   ============================================================ */

#lc-root .lc-panel.lc-layout-compact {
    width: 320px !important;
    height: 480px !important;
}

#lc-root .lc-panel.lc-layout-sidebar {
    width: 340px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    border-radius: 0 !important;
    transform: none !important;
}

#lc-root .lc-panel.lc-layout-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
}




/* ============================================================
   Соцсети под шапкой — 2 строки: надпись + цветные кружки
   ============================================================ */

#lc-root .lc-social-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    background: #f7f8fc !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
    position: relative !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
}
@keyframes lcSocialIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

#lc-root .lc-social-bar[style*="display: none"] {
    display: none !important;
}

#lc-root .lc-social-hint {
    font-size: 12px;
    line-height: 1.35;
    color: var(--lc-text-sub);
    text-align: center;
    margin: 0;
    white-space: nowrap;     /* ← одна строка, без переносов */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

#lc-root .lc-social-list {
    display: flex;
    flex-wrap: nowrap;       /* ← не переносим, всё в одну строку */
    justify-content: center;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

#lc-root .lc-social-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    color: #fff;
    background: #64748b;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#lc-root .lc-social-item:hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

#lc-root .lc-social-item:active {
    transform: translateY(0) scale(0.96);
}

#lc-root .lc-social-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

/* Кастомный мессенджер с картинкой — img на всю площадь */
#lc-root .lc-social-item.lc-social-custom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* --- Тёмная тема --- */
#lc-root.lc-theme-dark .lc-social-bar {
    background: #0f172a;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* --- Glass --- */
#lc-root.lc-theme-glass .lc-social-bar {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
}

/* --- Адаптив --- */
@media (max-width: 480px) {
    #lc-root .lc-social-bar {
        padding: 8px 10px;
        gap: 6px;
    }
    #lc-root .lc-social-hint {
        font-size: 11.5px;
    }
    #lc-root .lc-social-list {
        gap: 6px;
    }
    #lc-root .lc-social-item {
        width: 32px;
        height: 32px;
    }
    #lc-root .lc-social-item svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 360px) {
    #lc-root .lc-social-item {
        width: 30px;
        height: 30px;
    }
    #lc-root .lc-social-item svg {
        width: 16px;
        height: 16px;
    }
    #lc-root .lc-social-list {
        gap: 5px;
    }
}




/* ============================================================
   Примечание под иконками соцсетей
   ============================================================ */

#lc-root .lc-social-note {
    font-size: 11px;
    line-height: 1.4;
    color: var(--lc-text-sub);
    text-align: center;
    margin: 0;
    padding: 0 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    opacity: 0.85;
}














/* ============================================================
   Карточка «Позвоните нам» — КОМПАКТНАЯ
   ============================================================ */

#lc-root .lc-contact-suggest {
    display: block !important;
    margin: 6px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    width: auto !important;
    max-width: 100% !important;
}

#lc-root .lc-cs-phone-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 10px 4px 4px !important;
    background: #ffffff !important;
    border: 1.5px solid #22c55e !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    color: #1a1a2e !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 4px rgba(34, 197, 94, 0.15) !important;
    cursor: pointer !important;
    max-width: 100% !important;
}

#lc-root .lc-cs-phone-btn:hover {
    background: #f0fdf4 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(34, 197, 94, 0.25) !important;
    text-decoration: none !important;
    color: #1a1a2e !important;
}

#lc-root .lc-cs-phone-btn:active {
    transform: translateY(0) !important;
}

/* Маленькая зелёная иконка */
#lc-root .lc-cs-phone-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    border-radius: 50% !important;
    background: #22c55e !important;
    color: #ffffff !important;
    flex-shrink: 0 !important;
}

#lc-root .lc-cs-phone-icon svg {
    width: 12px !important;
    height: 12px !important;
    fill: currentColor !important;
    display: block !important;
}

/* Текст */
#lc-root .lc-cs-phone-text {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 5px !important;
    flex: 1 !important;
    min-width: 0 !important;
    text-align: left !important;
}

#lc-root .lc-cs-phone-label {
    display: inline-block !important;
    font-size: 10px !important;
    color: #22c55e !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

#lc-root .lc-cs-phone-number {
    display: inline-block !important;
    font-size: 12px !important;
    color: #1a1a2e !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Тёмная тема */
#lc-root.lc-theme-dark .lc-cs-phone-btn {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}
#lc-root.lc-theme-dark .lc-cs-phone-btn:hover {
    background: #334155 !important;
}
#lc-root.lc-theme-dark .lc-cs-phone-number {
    color: #f1f5f9 !important;
}









/* ============================================================
   Цитата сообщения (reply) — как в WhatsApp
   ============================================================ */

#lc-root .lc-msg-quote {
    display: block !important;
    margin: 0 0 6px 0 !important;
    padding: 5px 8px 5px 10px !important;
    border-left: 3px solid rgba(0, 0, 0, 0.25) !important;
    background: rgba(0, 0, 0, 0.06) !important;
    border-radius: 5px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

#lc-root .lc-msg-quote-text {
    display: block !important;
    color: #1a1a2e !important;      /* тёмный текст по умолчанию */
    opacity: 0.85 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

/* ============================================================
   USER (синий пузырь) — светлая цитата
   ============================================================ */
#lc-root .lc-msg-user .lc-msg-quote {
    border-left-color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(255, 255, 255, 0.22) !important;
}
#lc-root .lc-msg-user .lc-msg-quote-text {
    color: #ffffff !important;
    opacity: 0.95 !important;
}

/* ============================================================
   OPERATOR / BOT (серый/светлый пузырь) — тёмная цитата
   ============================================================ */
#lc-root .lc-msg-operator .lc-msg-quote,
#lc-root .lc-msg-bot .lc-msg-quote {
    border-left-color: rgba(0, 0, 0, 0.25) !important;
    background: rgba(0, 0, 0, 0.06) !important;
}
#lc-root .lc-msg-operator .lc-msg-quote-text,
#lc-root .lc-msg-bot .lc-msg-quote-text {
    color: #1a1a2e !important;
    opacity: 0.85 !important;
}

/* ============================================================
   Тёмная тема (lc-theme-dark)
   ============================================================ */
#lc-root.lc-theme-dark .lc-msg-operator .lc-msg-quote,
#lc-root.lc-theme-dark .lc-msg-bot .lc-msg-quote {
    border-left-color: rgba(255, 255, 255, 0.35) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}
#lc-root.lc-theme-dark .lc-msg-operator .lc-msg-quote-text,
#lc-root.lc-theme-dark .lc-msg-bot .lc-msg-quote-text {
    color: #e2e8f0 !important;
    opacity: 0.95 !important;
}

/* ============================================================
   NEON (тёмная неоновая)
   ============================================================ */
#lc-root.lc-theme-neon .lc-msg-operator .lc-msg-quote,
#lc-root.lc-theme-neon .lc-msg-bot .lc-msg-quote {
    border-left-color: rgba(0, 255, 231, 0.5) !important;
    background: rgba(0, 255, 231, 0.08) !important;
}
#lc-root.lc-theme-neon .lc-msg-operator .lc-msg-quote-text,
#lc-root.lc-theme-neon .lc-msg-bot .lc-msg-quote-text {
    color: #00ffe7 !important;
}

/* ============================================================
   GLASS
   ============================================================ */
#lc-root.lc-theme-glass .lc-msg-operator .lc-msg-quote,
#lc-root.lc-theme-glass .lc-msg-bot .lc-msg-quote {
    background: rgba(0, 0, 0, 0.08) !important;
}








/* Кастомная иконка мессенджера */
#lc-root .lc-msg-custom-img {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

/* Также для иконок в полоске соцсетей (если нужно) */
#lc-root .lc-social-item.lc-social-custom img {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
}







/* ============================================================
   Рейтинг чата — звёзды
   ============================================================ */

#lc-root .lc-rating-wrap {
    padding: 20px 16px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

#lc-root .lc-rating-question {
    font-size: 14px;
    font-weight: 600;
    color: var(--lc-text, #1a1a2e);
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.4;
    text-align: center;
}

#lc-root .lc-stars {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#lc-root .lc-star {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    font-size: 34px !important;
    line-height: 1 !important;
    color: #d1d5db !important;
    transition: color 0.15s ease, transform 0.15s ease !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: Arial, sans-serif !important;
}

#lc-root .lc-star:hover,
#lc-root .lc-star.lc-star-hover {
    transform: scale(1.15) !important;
    color: #fbbf24 !important;
}

#lc-root .lc-star.lc-star-selected {
    color: #fbbf24 !important;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.5) !important;
}

#lc-root .lc-star:disabled {
    cursor: default !important;
}

#lc-root .lc-rating-label {
    font-size: 12px;
    color: var(--lc-text-sub, #6b7280);
    margin: 4px 0 0 0;
    padding: 0;
    line-height: 1.4;
    text-align: center;
    min-height: 16px;
}

#lc-root .lc-rating-thanks {
    color: #22c55e !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    text-align: center !important;
}

/* Тёмная тема */
#lc-root.lc-theme-dark .lc-rating-question {
    color: #e2e8f0 !important;
}
#lc-root.lc-theme-dark .lc-star {
    color: #475569 !important;
}
#lc-root.lc-theme-dark .lc-star.lc-star-selected {
    color: #fbbf24 !important;
}
#lc-root.lc-theme-dark .lc-rating-label {
    color: #94a3b8 !important;
}











/* ============================================================
   Меню бота — иконка в composer + выпадающее меню
   ============================================================ */

/* Иконка меню (☰) — как остальные fmt-btn */
#lc-root #lc-bot-menu-btn {
    /* наследует стили .lc-fmt-btn */
    font-size: 15px !important;
    font-weight: 700 !important;
}

#lc-root #lc-bot-menu-btn.active {
    background: var(--lc-bg-panel, #f0f4fa) !important;
    border-color: var(--lc-primary, #5b9bd5) !important;
    color: var(--lc-primary, #5b9bd5) !important;
}

/* Выпадающее меню */
#lc-root .lc-bot-menu-picker {
    position: absolute !important;
    bottom: 32px !important;
    left: 0 !important;
    z-index: 40 !important;
    min-width: 220px !important;
    max-width: 300px !important;
    max-height: 260px !important;
    overflow-y: auto !important;
    background: var(--lc-bg, #ffffff) !important;
    border: 1px solid var(--lc-border, #e2e8f0) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18) !important;
    padding: 6px !important;
   
    flex-direction: column;
    gap: 2px !important;
    box-sizing: border-box !important;
}

/* Пункт меню */
#lc-root .lc-bot-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 9px 12px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 7px !important;
    color: var(--lc-text, #1a1a2e) !important;
    font: inherit !important;
    font-size: 13px !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: background 0.15s, color 0.15s !important;
    box-sizing: border-box !important;
    width: 100% !important;
    outline: none !important;
    line-height: 1.35 !important;
}

#lc-root .lc-bot-menu-item:hover {
    background: var(--lc-primary, #5b9bd5) !important;
    color: #ffffff !important;
}

#lc-root .lc-bot-menu-item-icon {
    font-size: 14px !important;
    flex-shrink: 0 !important;
    opacity: 0.8 !important;
}

#lc-root .lc-bot-menu-item-text {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Тёмная тема */
#lc-root.lc-theme-dark .lc-bot-menu-picker {
    background: #1e293b !important;
    border-color: rgba(255,255,255,0.1) !important;
}

#lc-root.lc-theme-dark .lc-bot-menu-item {
    color: #e2e8f0 !important;
}

#lc-root.lc-theme-dark .lc-bot-menu-item:hover {
    background: #60a5fa !important;
    color: #0f172a !important;
}

/* Glass */
#lc-root.lc-theme-glass .lc-bot-menu-picker {
    background: rgba(255,255,255,0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-color: rgba(0,0,0,0.1) !important;
}

/* Neon */
#lc-root.lc-theme-neon .lc-bot-menu-picker {
    background: #1a1a2e !important;
    border-color: rgba(0,255,231,0.3) !important;
    box-shadow: 0 8px 32px rgba(0,255,231,0.2) !important;
}
#lc-root.lc-theme-neon .lc-bot-menu-item {
    color: #00ffe7 !important;
}
#lc-root.lc-theme-neon .lc-bot-menu-item:hover {
    background: #00ffe7 !important;
    color: #0a0a1a !important;
}

/* Адаптив */
@media (max-width: 480px) {
    #lc-root .lc-bot-menu-picker {
        min-width: 180px !important;
        max-width: 260px !important;
        bottom: 30px !important;
    }
    #lc-root .lc-bot-menu-item {
        padding: 8px 10px !important;
        font-size: 12.5px !important;
    }
}







/* Компактный блок соцсетей — только иконки */
.lc-welcome-social {
    padding: 8px 12px 10px;
    background: #f8fafc;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
    line-height: 0;
}

.lc-welcome-social-list {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.lc-welcome-social .lc-social-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    background: #64748b;
    overflow: hidden;
    flex-shrink: 0;
}

.lc-welcome-social .lc-social-item:hover {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.lc-welcome-social .lc-social-item svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.lc-welcome-social .lc-social-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}



/* Заголовок — не используем, скрываем */
.lc-welcome-social-title {
    display: none;
}

/* ✅ Примечание — показываем на шаге messenger */
.lc-welcome-social-note {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    margin-top: 6px;
    padding: 0 4px;
    text-align: center;
    white-space: pre-line;   /* ✅ \n переносим как <br> */
}

/* Тёмная тема */
.lc-theme-dark .lc-welcome-social-note {
    color: #94a3b8;
}








/* =========================================================
   Модалка для просмотра фото (клиент) — полный префикс lc-
   ========================================================= */

/* Оверлей */
#lc-photo-modal.lc-photo-modal,
#lc-photo-modal.lc-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    background: rgba(0, 0, 0, 0.88) !important;
    
    align-items: center !important;
    justify-content: center !important;
    cursor: zoom-out !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: lc-fade-in 0.15s ease;
}

@keyframes lc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Изображение */
#lc-photo-modal img,
#lc-photo-modal .lc-photo-modal-img {
    max-width: 90vw !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    border-radius: 4px !important;
    cursor: default !important;
     /* ✅ Шахматный фон для прозрачных PNG/GIF — как в Photoshop */
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    pointer-events: auto !important;
    animation: lc-zoom-in 0.2s ease;
    
    /* ✅ ФИКС: не выделять как текст */
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    
    /* ✅ ФИКС: не перетаскивать */
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    
    /* ✅ ФИКС: курсор обычный, не I-beam */
    cursor: default !important;
    
    /* ✅ ФИКС: отключить выделение при двойном клике */
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

@keyframes lc-zoom-in {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* Кнопка закрытия */
#lc-photo-modal-close,
#lc-photo-modal .lc-photo-modal-close,
#lc-photo-modal .lc-modal-close-btn {
    position: absolute !important;
    top: 20px !important;
    right: 24px !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: none !important;
    color: #fff !important;
    font-size: 28px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s, transform 0.15s !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-sizing: border-box !important;
    /* ✅ КРИТИЧНО: клики работают */
    pointer-events: auto !important;
    z-index: 2147483647 !important;
    /* Защита от тем */
    opacity: 1 !important;
    visibility: visible !important;
    transform: none;
    text-shadow: none !important;
    text-decoration: none !important;
    font-family: Arial, sans-serif !important;
}

#lc-photo-modal-close:hover,
#lc-photo-modal .lc-photo-modal-close:hover,
#lc-photo-modal .lc-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.05) !important;
}

#lc-photo-modal-close:active,
#lc-photo-modal .lc-photo-modal-close:active {
    transform: scale(0.98) !important;
}

/* Курсор-лупа на превью в чате */
.lc-msg-img {
    cursor: zoom-in;
}

/* Мобильные */
@media (max-width: 480px) {
    #lc-photo-modal img,
    #lc-photo-modal .lc-photo-modal-img {
        max-width: 96vw !important;
        max-height: 80vh !important;
	 background: #ffffff !important;
    }
    #lc-photo-modal-close,
    #lc-photo-modal .lc-photo-modal-close {
        top: 12px !important;
        right: 12px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 24px !important;
    }
}

/* Блокировка скролла body */
body.lc-photo-modal-open {
    overflow: hidden !important;
}







/* =========================================================
   Блок цитаты в composer (клиент)
   ========================================================= */
.lc-reply-bar {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 0 0 8px 0;
    padding: 8px 10px;
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    font-size: 13px;
    animation: lc-reply-in 0.15s ease;
}

@keyframes lc-reply-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lc-reply-bar-inner {
    flex: 1;
    min-width: 0;   /* чтобы ellipsis работал */
}

.lc-reply-bar-label {
    font-size: 11px;
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 2px;
}

.lc-reply-bar-preview {
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
}

.lc-reply-bar-cancel {
    align-self: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.lc-reply-bar-cancel:hover {
    background: rgba(148, 163, 184, 0.15);
    color: #475569;
}

/* Тёмная тема */
.lc-theme-dark .lc-reply-bar {
    background: rgba(59, 130, 246, 0.15);
    border-left-color: #60a5fa;
}
.lc-theme-dark .lc-reply-bar-label {
    color: #60a5fa;
}
.lc-theme-dark .lc-reply-bar-preview {
    color: #cbd5e1;
}

#lc-root.lc-theme-dark .lc-msg-img {
    background: #ffffff !important;
}








/* =========================================================
   Кликабельная цитата (переход к сообщению)
   ========================================================= */
.lc-msg-quote-clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.lc-msg-quote-clickable:hover {
    background: rgba(59, 130, 246, 0.12) !important;
    border-left-color: #3b82f6 !important;
}

.lc-msg-quote-clickable:hover .lc-msg-quote-text {
    color: #3b82f6 !important;
}

.lc-msg-quote-clickable:active {
    background: rgba(59, 130, 246, 0.2) !important;
}





/* ═══════════════════════════════════════════════════════════
   Подсветка сообщения при переходе к цитате
   Используем box-shadow + outline — они НЕ конфликтуют
   с background пузыря и работают на всех темах.
   ═══════════════════════════════════════════════════════════ */

#lc-root .lc-msg-highlight .lc-msg-bubble {
    animation: lc-msg-flash 2.5s ease !important;
    position: relative !important;
    z-index: 3;
}

@keyframes lc-msg-flash {
    0% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.9),
                    0 0 24px 4px rgba(34, 197, 94, 0.55) !important;
        outline: 2px solid rgba(34, 197, 94, 1);
        outline-offset: 2px;
    }
    35% {
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.6),
                    0 0 16px 2px rgba(34, 197, 94, 0.35) !important;
        outline: 2px solid rgba(34, 197, 94, 0.7);
        outline-offset: 2px;
    }
    100% {
        box-shadow: none !important;
        outline: none;
    }
}

/* Тёмные темы — неоновое свечение ярче */
#lc-root.lc-theme-dark .lc-msg-highlight .lc-msg-bubble,
#lc-root.lc-theme-neon .lc-msg-highlight .lc-msg-bubble {
    animation: lc-msg-flash-neon 2.5s ease !important;
}

@keyframes lc-msg-flash-neon {
    0% {
        box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.95),
                    0 0 22px 4px rgba(0, 255, 136, 0.7),
                    0 0 40px 8px rgba(0, 255, 136, 0.35) !important;
        outline: 2px solid rgba(0, 255, 136, 1);
        outline-offset: 2px;
    }
    40% {
        box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.6),
                    0 0 14px 2px rgba(0, 255, 136, 0.4) !important;
        outline: 2px solid rgba(0, 255, 136, 0.7);
        outline-offset: 2px;
    }
    100% {
        box-shadow: none !important;
        outline: none;
    }
}






















/* =========================================================
   КЛИКАБЕЛЬНАЯ ЦИТАТА — lcapp-quote-link
   ========================================================= */
#lc-root .lcapp-quote-link {
    cursor: pointer !important;
    transition: background 0.15s, border-color 0.15s !important;
}

#lc-root .lcapp-quote-link:hover {
    background: rgba(59, 130, 246, 0.12) !important;
    border-left-color: #3b82f6 !important;
}

#lc-root .lcapp-quote-link:hover .lc-msg-quote-text {
    color: #3b82f6 !important;
}

#lc-root .lcapp-quote-link:active {
    background: rgba(59, 130, 246, 0.2) !important;
}

/* =========================================================
   ПОДСВЕТКА СООБЩЕНИЯ ПРИ ПЕРЕХОДЕ — lcapp-flash
   ========================================================= */
#lc-root .lcapp-flash .lc-msg-bubble {
    animation: lcapp-flash-anim 2s ease !important;
}

@keyframes lcapp-flash-anim {
    0% {
        background: rgba(34, 197, 94, 0.45) !important;
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.6),
                    0 0 16px rgba(34, 197, 94, 0.4) !important;
    }
    40% {
        background: rgba(34, 197, 94, 0.25) !important;
        box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4),
                    0 0 8px rgba(34, 197, 94, 0.25) !important;
    }
    100% {
        background: transparent !important;
        box-shadow: none !important;
    }
}

/* Тёмная тема — неон */
#lc-root.lc-theme-dark .lcapp-flash .lc-msg-bubble,
#lc-root.lc-theme-neon .lcapp-flash .lc-msg-bubble {
    animation: lcapp-flash-neon 2s ease !important;
}

@keyframes lcapp-flash-neon {
    0% {
        background: rgba(0, 255, 136, 0.25) !important;
        box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.9),
                    0 0 20px rgba(0, 255, 136, 0.7),
                    0 0 40px rgba(0, 255, 136, 0.4) !important;
    }
    40% {
        background: rgba(0, 255, 136, 0.15) !important;
        box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.6),
                    0 0 12px rgba(0, 255, 136, 0.4) !important;
    }
    100% {
        background: transparent !important;
        box-shadow: none !important;
    }
}







.cb--person .cb__icon { width: 46%; height: 46%; }

/* Размер по умолчанию для виджета — как было в старом #lc-btn */
#lc-root .cb { --size: 58px; }











/* iOS Safari — детект через @supports */
@supports (-webkit-touch-callout: none) {
    html body #lc-root #lc-input,
    html body #lc-root .lc-input-wrap textarea,
    html body #lc-root .lc-field input,
    html body #lc-root #lc-name,
    html body #lc-root #lc-phone {
        font-size: 16px !important;
    }
}




/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ — КОМПАКТНОЕ ОКНО
   ============================================================ */
@media (max-width: 768px) {
    #lc-root .lc-panel {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        top: auto !important;
        width: auto !important;
        height: auto !important;
        max-height: 85vh !important;      /* ← 75% высоты экрана */
        max-height: 85dvh !important;     /* ← iOS-версия */
        border-radius: 18px !important;
        transform: none !important;
        box-shadow: 0 8px 40px rgba(0,0,0,0.25) !important;
        animation: lc-slide-up 0.3s cubic-bezier(0.34,1.56,0.64,1) !important;
    }

    /* Учитываем «чёлку» и жестовую полосу iPhone */
    #lc-root .lc-header {
        padding-top: calc(14px + env(safe-area-inset-top, 0px)) !important;
        border-radius: 18px 18px 0 0 !important;
    }

    #lc-root .lc-input-area {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 0 0 18px 18px !important;
    }

    /* Скругления внутри */
    #lc-root .lc-step {
        border-radius: 0 0 18px 18px !important;
        overflow: hidden !important;
    }

    /* Кнопка закрытия — крупнее для пальца */
    #lc-root .lc-close-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 20px !important;
    }

    /* Форсируем 16px — iOS не зумит */
    #lc-root #lc-input,
    #lc-root .lc-input-wrap textarea,
    #lc-root .lc-field input {
        font-size: 16px !important;
    }

    /* Скрываем лаунчер, когда чат открыт */
    #lc-root.lc-open #lc-btn,
    #lc-root.lc-open #lc-launcher {
        display: none !important;
    }
}





/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ — КОМПАКТНОЕ ОКНО 85%
   ============================================================ */
@media (max-width: 480px) {
    #lc-root .lc-panel,
    #lc-root .lc-panel.lc-layout-classic,
    #lc-root .lc-panel.lc-layout-compact {
        position: fixed !important;
        left: 6px !important;
        right: 6px !important;
        bottom: 6px !important;
        top: auto !important;
        width: auto !important;
        height: auto !important;              /* ← ВАЖНО: auto, не calc */
        max-height: 85vh !important;
        max-height: 85dvh !important;
        border-radius: 16px !important;
        transform: none !important;
    }
}







#lc-root .lcapp-unread {
    position: absolute;
    bottom: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 10;
    pointer-events: none;
    box-sizing: border-box;
}








/* Живое превью форматирования под полем ввода */
#lc-root .lc-input-preview {
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.03);
    border-left: 3px solid rgba(91, 155, 213, 0.4);
    border-radius: 4px;
    font-size: 12px;
    color: var(--lc-text-sub, #6b7280);
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 80px;
    overflow-y: auto;
    pointer-events: none;
    user-select: none;
}

/* Стили внутри превью — чтобы визуально совпадало с сообщениями */
#lc-root .lc-input-preview b,
#lc-root .lc-input-preview strong { font-weight: 700; color: var(--lc-text, #1a1a2e); }
#lc-root .lc-input-preview i,
#lc-root .lc-input-preview em { font-style: italic; }
#lc-root .lc-input-preview s,
#lc-root .lc-input-preview strike { text-decoration: line-through; }
#lc-root .lc-input-preview a {
    color: var(--lc-primary, #5b9bd5);
    text-decoration: underline;
    word-break: break-all;
}



/*для смещения кастомного фото*/

#lc-root #lc-btn .lc-btn-img {
    transition: transform 0.2s ease;
    will-change: transform;
}



/* Обёртка для смещения содержимого — не ломает компоновку */
#sim-btn > .cb__offset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* НЕ используем position: absolute */
}









/* ============================================================
   Кастомный HTML-блок под именем/телефоном (auth)
   ============================================================ */
#lc-root .lc-auth-custom-html {
    margin: 12px 0 16px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--lc-text-sub, #6b7280);
    background: var(--lc-bg-panel, #f7f8fc);
    border-radius: 8px;
    border-left: 3px solid var(--lc-primary, #5b9bd5);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ссылки внутри блока */
#lc-root .lc-auth-custom-html a {
    color: var(--lc-primary, #5b9bd5);
    text-decoration: underline;
    cursor: pointer;
}

#lc-root .lc-auth-custom-html a:hover {
    color: var(--lc-primary-dk, #4a89c5);
    text-decoration: none;
}

/* Абзацы */
#lc-root .lc-auth-custom-html p {
    margin: 0 0 6px;
}
#lc-root .lc-auth-custom-html p:last-child {
    margin-bottom: 0;
}

/* Списки */
#lc-root .lc-auth-custom-html ul,
#lc-root .lc-auth-custom-html ol {
    margin: 4px 0 4px 18px;
    padding: 0;
}
#lc-root .lc-auth-custom-html li {
    margin-bottom: 2px;
}

/* Жирный, курсив */
#lc-root .lc-auth-custom-html b,
#lc-root .lc-auth-custom-html strong {
    color: var(--lc-text, #1a1a2e);
    font-weight: 600;
}

/* Тёмная тема */
#lc-root.lc-theme-dark .lc-auth-custom-html {
    background: #1e293b;
    color: #cbd5e1;
    border-left-color: #60a5fa;
}
#lc-root.lc-theme-dark .lc-auth-custom-html a {
    color: #60a5fa;
}

/* Glass */
#lc-root.lc-theme-glass .lc-auth-custom-html {
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Neon */
#lc-root.lc-theme-neon .lc-auth-custom-html {
    background: rgba(0,255,231,0.08);
    color: #00ffe7;
    border-left-color: #00ffe7;
}
#lc-root.lc-theme-neon .lc-auth-custom-html a {
    color: #7c8aff;
}







/* ============================================================
   Телефон в списке способов связи
   ============================================================ */
#lc-root .lc-messenger-item.lc-messenger-phone {
    color: var(--lc-text, #1a1a2e);
    text-decoration: none;
    font-weight: 600;
}

#lc-root .lc-messenger-item.lc-messenger-phone:hover {
    background: var(--lc-bg-panel, #f7f8fc);
}

#lc-root .lc-messenger-item.lc-messenger-phone .lc-msg-icon {
    color: #22c55e;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lc-root .lc-messenger-item.lc-messenger-phone .lc-msg-icon svg {
    display: block;
}

#lc-root .lc-messenger-item.lc-messenger-phone .lc-msg-label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
}







/* =========================================================
   Кнопка btn_soc + полоса соцсетей — фиксированные размеры
   ========================================================= */

/* Панель — фиксированная высота, без фона */
#lc-root .lc-social-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    margin: 0;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Кнопка btn_soc — 32×32, без фона */
#lc-root .lc-social-toggle {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s;
}

#lc-root .lc-social-toggle:hover,
#lc-root .lc-social-toggle:focus,
#lc-root .lc-social-toggle:active {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
    transform: scale(1.06);
}

#lc-root .lc-social-toggle img {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Полоса соцсетей — скрыта по умолчанию, фиксированной высоты */
#lc-root .lc-social-bar {
    display: none;
    flex: 1;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden;
    box-sizing: border-box;
}

/* Список иконок */
#lc-root .lc-social-bar-list {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0;
    margin: 0;
}

/* Иконка соцсети — строго 28×28 */
#lc-root .lc-social-bar .lc-social-item {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #64748b;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.12s;
}

#lc-root .lc-social-bar .lc-social-item:hover {
    transform: scale(1.1);
}

/* SVG-иконка внутри — 16×16, центрирована */
#lc-root .lc-social-bar .lc-social-item svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    display: block;
    flex-shrink: 0;
}

/* Картинка (img) внутри — на всю площадь кружка */
#lc-root .lc-social-bar .lc-social-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    margin: 0;
    padding: 0;
}

/* Телефонная кнопка — зелёный фон, тот же размер */
#lc-root .lc-social-bar .lc-social-item.lc-social-phone {
    background-color: #22c55e !important;
}

#lc-root .lc-social-bar .lc-social-item.lc-social-phone svg {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
}

#lc-root .lc-social-empty {
    font-size: 12px;
    color: #94a3b8;
    padding: 4px 8px;
}

/* ============================================================
   Панель соцсетей — плавает поверх области сообщений.
   Не занимает места в потоке → под шапкой сразу чат.
   ============================================================ */

#lc-root .lc-social-panel,
#lc-root .lc-social-panel.is-open {
    position: absolute;
    top: 80px;
    left: auto;             /* ← было left: 6px */
    right: 18px;             /* ← теперь справа */
    z-index: 20;
    display: flex;
    flex-direction: row-reverse;   /* ← полоса разворачивается ВЛЕВО от кнопки */
    align-items: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    width: auto !important;
    pointer-events: none;
}

/* Кнопка и полоса — кликабельны */
#lc-root .lc-social-panel > * {
    pointer-events: auto;
}

/* Кнопка btn_soc — голая, 36×36 */
#lc-root .lc-social-toggle,
#lc-root .lc-social-toggle:hover,
#lc-root .lc-social-toggle:focus,
#lc-root .lc-social-toggle:active {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s;
}

#lc-root .lc-social-toggle:hover {
    transform: scale(1.08);
}

#lc-root .lc-social-toggle img {
    width: 36px !important;
    height: 36px !important;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Полоса соцсетей — скрыта, пока не открыта */
#lc-root .lc-social-bar {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    background: transparent !important;         /* ← прозрачный */
    background-color: transparent !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;                 /* ← убираем «овал» */
    box-shadow: none !important;                 /* ← убираем тень */
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    box-sizing: border-box;
    overflow: visible;
}
#lc-root .lc-social-bar-list {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}

/* Иконки соцсетей */
#lc-root .lc-social-bar .lc-social-item {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.12s;
}

#lc-root .lc-social-bar .lc-social-item:hover {
    transform: scale(1.1);
}

#lc-root .lc-social-bar .lc-social-item svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    display: block;
    flex-shrink: 0;
}

#lc-root .lc-social-bar .lc-social-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin: 0;
    padding: 0;
}