/* bitmall · онлайн-чат «Вопрос по детали». Цвета макета: #1F2937 тёмный, #F6F7F9 лента, #16A34A на связи, #F59E0B вне графика, #1F8F4E подтверждение.
   Всё под #bm-chat, чтобы стили темы (button{border:none!important} и т.п.) не мешали и наружу ничего не протекало. */
#bm-chat{--bmc-ink:#1F2937;--bmc-ink2:#4B5563;--bmc-muted:#6B7280;--bmc-line:#E5E7EB;--bmc-feed:#F6F7F9;--bmc-on:#16A34A;--bmc-off:#F59E0B;--bmc-ok:#1F8F4E;--bmc-lift:0px;
	font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;font-size:14px;line-height:1.42;color:var(--bmc-ink);-webkit-font-smoothing:antialiased}
#bm-chat *,#bm-chat *::before,#bm-chat *::after{box-sizing:border-box}
#bm-chat button{font-family:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
#bm-chat svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;display:block}
#bm-chat [hidden]{display:none!important}
#bm-chat:not(.bmc-ready){display:none}

/* точка статуса */
#bm-chat .bmc-dot{display:inline-block;flex:none;width:8px;height:8px;border-radius:50%;background:var(--bmc-on)}
#bm-chat.bmc-off .bmc-dot{background:var(--bmc-off)}
#bm-chat .bmc-hs .bmc-dot{box-shadow:0 0 0 0 rgba(22,163,74,.55);animation:bmc-pulse 2s infinite}
#bm-chat.bmc-off .bmc-hs .bmc-dot{animation:none}
@keyframes bmc-pulse{0%{box-shadow:0 0 0 0 rgba(22,163,74,.55)}70%{box-shadow:0 0 0 7px rgba(22,163,74,0)}100%{box-shadow:0 0 0 0 rgba(22,163,74,0)}}

#bm-chat .bmc-ava{flex:none;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:#fff;color:var(--bmc-ink)}

/* плавающая кнопка */
#bm-chat .bmc-launch{position:fixed;right:22px;bottom:calc(22px + var(--bmc-lift));z-index:1030;display:flex;align-items:center;gap:10px;height:56px;margin:0;padding:0 18px 0 8px;border:0!important;border-radius:28px;background:var(--bmc-ink);color:#fff;text-align:left;box-shadow:0 10px 26px rgba(17,24,39,.3);transition:transform .15s,box-shadow .15s,bottom .2s}
#bm-chat .bmc-launch:hover{transform:translateY(-1px);box-shadow:0 14px 30px rgba(17,24,39,.36)}
#bm-chat .bmc-launch:focus-visible{outline:2px solid #93C5FD;outline-offset:3px}
#bm-chat .bmc-launch .bmc-ava svg{width:22px;height:22px}
#bm-chat .bmc-ltxt b{display:block;font-size:14.5px;font-weight:600;line-height:1.2;white-space:nowrap}
#bm-chat .bmc-ltxt small{display:flex;align-items:center;gap:6px;margin-top:2px;font-size:12px;line-height:1.2;color:#CBD5E1;white-space:nowrap}
#bm-chat .bmc-mdot{display:none}
#bm-chat .bmc-badge{position:absolute;top:-6px;left:-4px;min-width:22px;height:22px;padding:0 6px;border:2px solid #fff;border-radius:11px;background:#DC2626;color:#fff;font-size:12px;font-weight:700;line-height:18px;text-align:center}
#bm-chat.bmc-open .bmc-launch{display:none}

/* подсказка */
#bm-chat .bmc-tip{position:fixed;right:22px;bottom:calc(90px + var(--bmc-lift));z-index:1030;max-width:270px;padding:12px 34px 12px 14px;border:1px solid var(--bmc-line);border-radius:14px 14px 4px 14px;background:#fff;box-shadow:0 10px 26px rgba(17,24,39,.16);font-size:14px;line-height:1.4;cursor:pointer;animation:bmc-up .25s ease-out}
#bm-chat .bmc-tip-x{position:absolute;top:5px;right:5px;width:26px;height:26px;padding:0;border:0!important;border-radius:6px;background:transparent;color:var(--bmc-muted);font-size:19px;line-height:26px}
#bm-chat .bmc-tip-x:hover{background:#F3F4F6;color:var(--bmc-ink)}
@keyframes bmc-up{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* окно */
#bm-chat .bmc-win{position:fixed;right:22px;bottom:22px;z-index:1040;display:flex;flex-direction:column;width:370px;height:540px;max-height:calc(100vh - 44px);background:#fff;border-radius:18px;box-shadow:0 18px 50px rgba(17,24,39,.3);overflow:hidden;opacity:0;transform:translateY(14px) scale(.98);transform-origin:bottom right;transition:opacity .18s ease,transform .18s ease}
#bm-chat .bmc-win.bmc-shown{opacity:1;transform:none}
#bm-chat .bmc-head{flex:none;display:flex;align-items:center;gap:10px;padding:14px 12px 12px 14px;background:var(--bmc-ink);color:#fff}
#bm-chat .bmc-head .bmc-ava{width:38px;height:38px}
#bm-chat .bmc-ht{min-width:0}
#bm-chat .bmc-ht b{display:block;font-size:15px;font-weight:600;line-height:1.25}
#bm-chat .bmc-hs{display:flex;align-items:center;gap:7px;margin-top:2px;font-size:12.5px;line-height:1.25;color:#CBD5E1}
#bm-chat .bmc-x{flex:none;margin-left:auto;width:34px;height:34px;padding:0;border:0!important;border-radius:9px;background:rgba(255,255,255,.12);color:#fff;font-size:22px;line-height:34px}
#bm-chat .bmc-x:hover{background:rgba(255,255,255,.22)}

#bm-chat .bmc-feed{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;display:flex;flex-direction:column;gap:8px;padding:14px;background:var(--bmc-feed)}
#bm-chat .bmc-msg{max-width:85%;padding:9px 12px 6px;border-radius:14px;font-size:14px;line-height:1.42;word-wrap:break-word;overflow-wrap:anywhere}
#bm-chat .bmc-tx{white-space:pre-wrap}
#bm-chat .bmc-tx a{color:inherit;text-decoration:underline}
#bm-chat .bmc-them{align-self:flex-start;background:#fff;border:1px solid var(--bmc-line);border-bottom-left-radius:4px}
#bm-chat .bmc-me{align-self:flex-end;background:var(--bmc-ink);color:#fff;border-bottom-right-radius:4px}
#bm-chat .bmc-sys{align-self:center;max-width:92%;padding:6px 10px;background:#E8F5EC;color:#14532D;border-radius:10px;font-size:13px;text-align:center}
#bm-chat .bmc-meta{margin-top:2px;font-size:11px;line-height:1.3;text-align:right;color:var(--bmc-muted)}
#bm-chat .bmc-me .bmc-meta{color:#9CA3AF}
#bm-chat .bmc-failed{background:#7F1D1D}
#bm-chat .bmc-err{margin-top:4px;font-size:12px;color:#FECACA}
#bm-chat .bmc-err button{padding:0;border:0!important;background:none;color:#fff;font-size:12px;font-weight:600;text-decoration:underline}
#bm-chat .bmc-has-ph{padding:4px 4px 5px}
#bm-chat .bmc-has-ph .bmc-tx,#bm-chat .bmc-has-ph .bmc-meta,#bm-chat .bmc-has-ph .bmc-err{padding:0 6px}
#bm-chat .bmc-has-ph .bmc-tx{padding-top:5px}
#bm-chat .bmc-ph{display:block;width:auto;max-width:100%;height:auto;max-height:230px;border-radius:11px;object-fit:cover;cursor:zoom-in;background:#E5E7EB}

#bm-chat .bmc-quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
#bm-chat .bmc-quick button{height:32px;padding:0 11px;border:1px solid #CFD5DD!important;border-radius:16px;background:#fff;color:var(--bmc-ink);font-size:13px;font-weight:500;line-height:30px;white-space:nowrap}
#bm-chat .bmc-quick button:hover{border-color:var(--bmc-ink)!important}

/* форма контакта в ленте */
#bm-chat .bmc-prompt{max-width:94%}
#bm-chat .bmc-cf{margin:8px 0 2px}
#bm-chat .bmc-seg{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:6px}
#bm-chat .bmc-seg button{height:28px;padding:0 9px;border:1px solid #CFD5DD!important;border-radius:14px;background:#fff;color:var(--bmc-ink2);font-size:12.5px;line-height:26px}
#bm-chat .bmc-seg button.on{border-color:var(--bmc-ink)!important;background:var(--bmc-ink);color:#fff}
#bm-chat .bmc-cf-row{display:flex;gap:6px}
#bm-chat .bmc-cf-row input{flex:1;min-width:0;height:38px;margin:0;padding:0 10px;border:1px solid #CFD5DD;border-radius:9px;background:#fff;color:var(--bmc-ink);font-size:15px;line-height:1.2;font-family:inherit;outline:0;box-shadow:none}
#bm-chat .bmc-cf-row input:focus{border-color:var(--bmc-ink)}
#bm-chat .bmc-cf-go{flex:none;height:38px;padding:0 13px;border:0!important;border-radius:9px;background:var(--bmc-ok);color:#fff;font-size:13.5px;font-weight:600}
#bm-chat .bmc-cf-go:hover{background:#18763F}
#bm-chat .bmc-cf-go:disabled{opacity:.6}
#bm-chat .bmc-cf-err{margin-top:5px;font-size:12.5px;color:#B91C1C}
#bm-chat .bmc-cf-note{margin-top:6px;font-size:11px;line-height:1.35;color:var(--bmc-muted)}
#bm-chat .bmc-cf-note a{color:var(--bmc-ink2);text-decoration:underline}

/* ввод */
#bm-chat .bmc-form{flex:none;display:flex;align-items:flex-end;gap:6px;margin:0;padding:10px;border-top:1px solid var(--bmc-line);background:#fff}
#bm-chat .bmc-att,#bm-chat .bmc-send{flex:none;display:flex;align-items:center;justify-content:center;width:42px;height:42px;padding:0;border:0!important;border-radius:11px}
#bm-chat .bmc-att{background:#F3F4F6;color:var(--bmc-ink2)}
#bm-chat .bmc-att:hover{background:#E5E7EB}
#bm-chat .bmc-send{background:var(--bmc-ink);color:#fff}
#bm-chat .bmc-send svg{width:20px;height:20px}
#bm-chat .bmc-in{flex:1;min-width:0;height:42px;min-height:42px;max-height:110px;margin:0;padding:10px 10px;border:1px solid #CFD5DD;border-radius:11px;background:#fff;color:var(--bmc-ink);font-size:14px;line-height:1.4;font-family:inherit;font-weight:400;resize:none;outline:0;box-shadow:none;overflow-y:auto}
#bm-chat .bmc-in:focus{border-color:var(--bmc-ink)}
#bm-chat .bmc-in::placeholder{color:#9CA3AF;opacity:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#bm-chat .bmc-foot{flex:none;padding:0 12px 10px;background:#fff;font-size:11.5px;color:var(--bmc-muted);text-align:center}
#bm-chat .bmc-drop{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;margin:8px;border:2px dashed #9CA3AF;border-radius:14px;background:rgba(246,247,249,.94);color:var(--bmc-ink);font-weight:600;pointer-events:none}

/* лайтбокс */
#bm-chat .bmc-lb{position:fixed;inset:0;z-index:1070;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(17,24,39,.88);cursor:zoom-out}
#bm-chat .bmc-lb img{max-width:100%;max-height:100%;border-radius:8px;box-shadow:0 10px 40px rgba(0,0,0,.4)}
#bm-chat .bmc-lb-x{position:absolute;top:12px;right:12px;width:42px;height:42px;padding:0;border:0!important;border-radius:21px;background:rgba(255,255,255,.15);color:#fff;font-size:26px;line-height:42px}

/* телефон: компактная кнопка над нижней панелью, окно — bottom sheet */
@media (max-width:700px){
	#bm-chat .bmc-launch{right:12px;bottom:calc(14px + var(--bmc-lift) + env(safe-area-inset-bottom,0px));width:54px;height:54px;padding:0;justify-content:center;border-radius:27px}
	#bm-chat .bmc-launch .bmc-ava{width:54px;height:54px;background:transparent;color:#fff}
	#bm-chat .bmc-launch .bmc-ava svg{width:26px;height:26px}
	#bm-chat .bmc-ltxt{display:none}
	#bm-chat .bmc-mdot{display:block;position:absolute;top:6px;right:6px;width:11px;height:11px;border:2px solid var(--bmc-ink)}
	#bm-chat .bmc-badge{top:-5px;left:-5px}
	#bm-chat .bmc-tip{right:12px;left:auto;bottom:calc(78px + var(--bmc-lift) + env(safe-area-inset-bottom,0px));max-width:calc(100vw - 24px);font-size:13.5px}
	#bm-chat .bmc-win{left:0;right:0;bottom:0;width:auto;height:82vh;height:82dvh;max-height:none;border-radius:18px 18px 0 0;transform-origin:bottom center;transform:translateY(30px)}
	#bm-chat .bmc-win.bmc-shown{transform:none}
	#bm-chat .bmc-in{font-size:16px} /* 16px — iOS не увеличивает страницу при фокусе */
	#bm-chat .bmc-cf-row input{font-size:16px}
	#bm-chat .bmc-form{padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))}
	#bm-chat .bmc-foot{display:none}
	#bm-chat .bmc-msg{max-width:88%}
	#bm-chat.bmc-open::before{content:'';position:fixed;inset:0;z-index:1035;background:rgba(17,24,39,.38)}
	html.bmc-lock,html.bmc-lock body{overflow:hidden!important}
}
@media (prefers-reduced-motion:reduce){
	#bm-chat .bmc-win,#bm-chat .bmc-launch,#bm-chat .bmc-tip{transition:none;animation:none}
	#bm-chat .bmc-hs .bmc-dot{animation:none}
}
@media print{#bm-chat{display:none!important}}
