/* Онлайн-чат Webchat (webchat.planfix.pro): перекраска под стиль сайта.
   Виджет сам вставляет <style> в #webchat-root позже этого файла, поэтому у нас префикс body + !important. */

body #webchat-root{
	--pc-primary:#3913a5;--pc-primary-rgb:57,19,165;--pc-primary-strong:#000;
	--pc-ink:#000;--pc-muted:#6b6b6b;--pc-border:#ddd;--pc-bg:#fff;
	--pc-client-bg:#f4f4f4;--pc-client-color:#000;--pc-agent-bg:#efeaff;--pc-agent-color:#000;
	--pc-shadow:none;--pc-shadow-soft:none;--pc-radius:0;
	--wc-din:'DINCondensedC',Arial,sans-serif;
	font-family:Arial,Helvetica,sans-serif;
}

/* --- окно --- */
#webchat-root .pc-window{border-radius:0!important;box-shadow:none!important;border:1px solid #3913a5!important}

/* --- шапка --- */
#webchat-root .pc-header{background:#3913a5!important;color:#fff!important;border-radius:0!important;border:0!important;padding:16px 56px 16px 20px!important;font-family:var(--wc-din)!important}
#webchat-root .pc-header-title{color:#fff!important;font-family:var(--wc-din)!important;font-size:24px!important;font-weight:400!important;letter-spacing:0!important;line-height:1.1!important;text-transform:uppercase}
/* статус: текст виджета («На связи» / «Нет соединения») скрыт, вместо него фиксированный текст */
#webchat-root .pc-header-status{font-size:0!important;line-height:0!important;color:#fff!important}
#webchat-root .pc-header-status::before{display:none!important}
#webchat-root .pc-header-status::after{content:"Отвечаем в рабочее время, пн–пт 9–18";font-family:var(--wc-din);font-size:16px;line-height:1.2;color:rgba(255,255,255,.8)}
/* крестик: белая плитка 44x44 с чёрным крестиком вверху справа, поверх шапки и формы «Представьтесь» (на фоне шапки и светлой формы виден одинаково) */
#webchat-root .pc-window-close{top:0!important;right:0!important;bottom:auto!important;left:auto!important;width:44px!important;height:44px!important;min-width:44px;padding:0!important;border:0!important;border-radius:0!important;background:#fff!important;color:#000!important;font-size:28px!important;line-height:1!important;box-shadow:none!important;z-index:2147483000!important;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
#webchat-root .pc-window-close:hover{transform:none!important;background:#efeaff!important}
@media screen and (max-width:480px){
	#webchat-root .pc-window-close{position:fixed!important;top:0!important;right:0!important}
}

/* --- сообщения --- */
#webchat-root .pc-messages{background:#fff!important}
#webchat-root .pc-date-divider{color:#6b6b6b!important;background:#f4f4f4!important;border:0!important;border-radius:0!important;box-shadow:none!important}
#webchat-root .pc-msg{border-radius:0!important;box-shadow:none!important;border:0!important;color:#000!important;font-size:15px!important;text-align:left!important}
#webchat-root .pc-msg--agent{background:#efeaff!important}
#webchat-root .pc-msg--client{background:#f4f4f4!important}
#webchat-root .pc-msg-footer{color:#6b6b6b!important}

/* --- ввод --- */
#webchat-root .pc-input-area{background:#fff!important;border-top:1px solid #ddd!important}
#webchat-root .pc-input{border:1px solid #ddd!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;font-family:Arial,Helvetica,sans-serif!important;color:#000!important}
#webchat-root .pc-input:focus{border-color:#3913a5!important;outline:none!important;box-shadow:none!important}
#webchat-root .pc-send,#webchat-root .pc-attach{border-radius:0!important;box-shadow:none!important}
#webchat-root .pc-send{background:#3913a5!important;color:#fff!important}

/* --- форма «Представьтесь» --- */
#webchat-root .pc-name-overlay h3{font-family:var(--wc-din)!important;font-size:24px!important;font-weight:400!important;text-transform:uppercase;color:#000!important}
#webchat-root .pc-name-input,#webchat-root .pc-phone-input,#webchat-root .pc-email-input{border:1px solid #ddd!important;border-radius:0!important;box-shadow:none!important}
#webchat-root .pc-name-input:focus,#webchat-root .pc-phone-input:focus,#webchat-root .pc-email-input:focus{border-color:#3913a5!important;outline:none!important}
#webchat-root .pc-name-btn{border-radius:0!important;box-shadow:none!important;background:#3913a5!important;color:#fff!important;font-family:var(--wc-din)!important;font-size:20px!important;font-weight:400!important;text-transform:uppercase}
#webchat-root .pc-name-btn.pc-name-btn--disabled{background:#ddd!important;color:#6b6b6b!important}

/* чекбокс согласия: глобальный стиль сайта button,input{appearance:none;border:none} обнуляет родной чекбокс (0x0), рисуем свой */
#webchat-root .pc-consent{align-items:flex-start!important;gap:10px!important;margin:12px 0 0!important}
#webchat-root .pc-consent input[type=checkbox]{-webkit-appearance:none!important;appearance:none!important;display:block!important;flex:none!important;position:relative;box-sizing:border-box!important;width:24px!important;height:24px!important;min-width:24px;margin:0!important;padding:0!important;border:2px solid #3913a5!important;border-radius:0!important;background:#fff center/80% no-repeat!important;box-shadow:none!important;cursor:pointer;opacity:1!important;left:auto!important}
#webchat-root .pc-consent input[type=checkbox]:checked{background:#3913a5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='%23fff' stroke-width='2.2'/%3E%3C/svg%3E") center/80% no-repeat!important}
#webchat-root .pc-consent input[type=checkbox]:focus-visible{outline:2px solid #000!important;outline-offset:2px}
#webchat-root .pc-consent label{flex:1;min-width:0;font-size:13px!important;line-height:1.4!important;cursor:pointer;padding:2px 0}

/* --- скрыть подпись «webchat.planfix.pro» --- */
#webchat-root .pc-footer,#webchat-root .pc-name-footer{display:none!important}

/* --- мессенджер-кнопки и QR (если включены в кабинете) --- */
#webchat-root .pc-fab-btn,#webchat-root .pc-qr-overlay,#webchat-root .pc-qr-img{border-radius:0!important;box-shadow:none!important}

/* --- локальное приветствие --- */
#webchat-root .wc-greet .pc-msg-footer{color:#6b6b6b!important}

/* --- кнопка «Задать вопрос» (десктоп по умолчанию) --- */
/* пока окно открыто, кнопку прячем (класс ставит webchat.js) */
html.wc-open #webchat-root .pc-bubble{display:none!important}
#webchat-root .pc-bubble{border-radius:0!important;box-shadow:none!important;background:#3913a5!important;color:#fff!important;font-family:var(--wc-din)!important;transition:background-color .8s ease!important}
#webchat-root .pc-bubble:hover{background:#000!important;box-shadow:none!important}
#webchat-root .pc-bubble-text{font-family:var(--wc-din)!important;font-weight:400!important;font-size:1.33rem!important;line-height:1!important;text-transform:uppercase;white-space:nowrap}
#webchat-root .pc-bubble svg{width:1.2rem!important;height:1.2rem!important}
#webchat-root .pc-unread{box-shadow:none!important;color:#3913a5!important}

/* десктоп ≥1024: под колонкой круглых кнопок, по её оси; координаты ставит webchat.js */
@media screen and (min-width:1024px){
	html.wc-placed #webchat-root .pc-bubble{right:auto!important;bottom:auto!important;left:var(--wc-cx)!important;top:var(--wc-top)!important;height:var(--wc-h)!important;padding:0 1.2rem!important;gap:.6rem!important;transform:translateX(-50%)!important;z-index:11}
	html.wc-placed #webchat-root .pc-bubble:hover{transform:translateX(-50%)!important}
	/* колонку иконок сайта поднимаем на высоту кнопки, чтобы поместилась под ней */
	html.wc-placed .sidebar .soc-icons-new > div{bottom:calc(var(--wc-h) + .7rem)!important}
}

/* ≤1023: круглая кнопка в колонке круглых кнопок сайта, без текста */
@media screen and (max-width:1023px){
	#webchat-root .pc-bubble{right:5px!important;bottom:15px!important;width:40px!important;height:40px!important;padding:0!important;gap:0!important;justify-content:center;border-radius:50%!important}
	#webchat-root .pc-bubble-text{display:none!important}
	#webchat-root .pc-bubble svg{width:50%!important;height:50%!important}
	#webchat-root .pc-unread{top:-4px!important;right:-4px!important}
	html.wc-placed #webchat-root .pc-bubble{right:auto!important;bottom:auto!important;left:var(--wc-left)!important;top:var(--wc-top)!important;width:var(--wc-size)!important;height:var(--wc-size)!important}
}

/* ≤768: окно на весь экран */
@media screen and (max-width:768px){
	#webchat-root .pc-window-wrap{right:0!important;bottom:0!important}
	#webchat-root .pc-window{width:100vw!important;height:100vh!important;height:100dvh!important;border:0!important}
	#webchat-root .pc-input{font-size:16px!important}
	#webchat-root .pc-input-area{padding-bottom:calc(10px + env(safe-area-inset-bottom))!important}
}
