/* The existing Dr.Water launcher remains the only floating contact button. */
.dw-bitrix-enabled .b24-widget-button-wrapper,
.dw-bitrix-enabled .b24-widget-button-shadow,
.dw-bitrix-enabled .b24-widget-button-popup { display: none !important; }
.dw-chat-intro[hidden] { display: none; }
/* The portal's uploaded image styles its public page only. Reuse that artwork
   for the inline widget; the image is requested only once the widget exists. */
.dw-bitrix-enabled .bx-livechat-body {
  background-color: #eef6f8;
  background-image: linear-gradient(rgba(248, 251, 252, .24), rgba(248, 251, 252, .24)), url('drwater-chat-water-light-v1.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.dw-bitrix-enabled .bx-livechat-box { border-radius: 16px; box-shadow: 0 14px 50px rgba(23, 55, 71, .18); }
.dw-bitrix-enabled .bx-livechat-help-title { color: #173747; opacity: 1; }
.dw-bitrix-enabled .bx-livechat-help-subtitle,
.dw-bitrix-enabled .bx-livechat-help-user .bx-livechat-user-name { color: #344f5e; }
.dw-bitrix-enabled .bx-im-message-type-system .bx-im-message-content { background: rgba(248, 251, 252, .94); color: #344f5e; }
/* Brand the embedded form and its genuine success state. All visibility,
   validation, consent and submission remain controlled by Bitrix. */
.dw-bitrix-enabled .bx-livechat-head { background-image: linear-gradient(110deg, #174b64, #246b80); }
.dw-bitrix-enabled .bx-livechat-wrapper { --ui-font-family-primary: 'DrWater Manrope', Arial, sans-serif; --ui-font-family-secondary: 'DrWater Manrope', Arial, sans-serif; }
.dw-bitrix-enabled .bx-imopenlines-form-wrapper { box-sizing: border-box; width: 100%; max-width: 100%; margin: 0; padding: 12px; }
.dw-bitrix-enabled .bx-imopenlines-form-content { min-width: 0; width: 100%; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-wrapper {
  --b24-primary-color: #174b64;
  --b24-primary-text-color: #fff;
  --b24-text-color: #173747;
  --b24-background-color: rgba(255, 255, 255, .96);
  --b24-font-family: 'DrWater Manrope', Arial, sans-serif;
  min-height: 0;
  border: 1px solid #dbe8ed;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(23, 55, 71, .06);
}
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-padding-side { padding-left: 18px; padding-right: 18px; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-content form { padding: 0; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-header { padding-top: 18px; padding-bottom: 0; border-bottom: 0; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-header-title { margin-bottom: 8px; color: #173747; font-size: 19px; line-height: 1.35; letter-spacing: -.3px; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-header-description { margin-bottom: 0; color: #526b79; font-size: 13px; line-height: 1.5; opacity: 1; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-field { margin-bottom: 14px; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-control { border-radius: 10px; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-control:focus { border-color: #246b80; box-shadow: 0 0 0 2px rgba(36, 107, 128, .16); }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-control-desc { font-size: 12px; line-height: 1.55; color: #526b79; opacity: 1; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-field-agreement-link { font-size: 12px; line-height: 1.55; opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-control-agreement input[type="checkbox"] { width: 18px; height: 18px; accent-color: #174b64; vertical-align: top; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-btn { border-radius: 11px; background: #174b64; color: #fff; box-shadow: none; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-btn:hover { background: #123c51; }
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-btn:focus-visible,
.dw-bitrix-enabled .bx-livechat-wrapper .b24-form-control-agreement input:focus-visible { outline: 2px solid #246b80; outline-offset: 3px; }
.dw-bitrix-enabled .bx-imopenlines-form-result-container.bx-imopenlines-form-success {
  box-sizing: border-box;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 16px;
  border: 1px solid #cbdfe3;
  border-radius: 14px;
  background: rgba(248, 251, 252, .97);
  box-shadow: 0 4px 16px rgba(23, 55, 71, .06);
}
.dw-bitrix-enabled .bx-imopenlines-form-success .bx-imopenlines-form-result-icon { flex: 0 0 30px; position: relative; width: 30px; height: 30px; margin: 1px 0 0; border-radius: 50%; background: #e0efe9; }
.dw-bitrix-enabled .bx-imopenlines-form-success .bx-imopenlines-form-result-icon::before { content: ''; position: absolute; left: 8px; top: 9px; width: 12px; height: 7px; border-left: 2px solid #2e7063; border-bottom: 2px solid #2e7063; transform: rotate(-45deg); }
.dw-bitrix-enabled .bx-imopenlines-form-success .bx-imopenlines-form-result-title { min-width: 0; margin: 0; color: #173747; font-size: 14px; font-weight: 500; line-height: 1.55; text-align: left; overflow-wrap: anywhere; }
/* Reserve two readable lines plus padding, keeping the native send/attachment
   controls and the widget's user-resizable composer intact. */
.dw-bitrix-enabled .bx-livechat-textarea { min-height: 112px; }
.dw-bitrix-enabled .bx-livechat-wrapper .bx-im-textarea-box { min-height: 0; }
.dw-bitrix-enabled .bx-livechat-wrapper .bx-im-textarea-input { box-sizing: border-box; min-width: 0; min-height: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.dw-bitrix-enabled .bx-livechat-wrapper .bx-im-textarea-input:focus { outline: 2px solid #246b80; outline-offset: 1px; box-shadow: none; }
/* The earlier compact home layout hid all floating tools on phones. */
.dw-premium:has(.dw-home-099) .dw-page-tools { display: flex; }
html:has(dialog[open]) .dw-premium .dw-page-tools { display: none; }
.dw-help-panel .dw-chat-intro > p:first-child { margin: 8px 0 18px; color: #45616e; font-size: 15px; line-height: 1.55; }
.dw-help-panel .dw-chat-open { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 52px; padding: 12px 18px; border: 1px solid #174b64; border-radius: 14px; background: #174b64; color: #fff; font: 700 15px/1.4 'DrWater Manrope', Arial, sans-serif; cursor: pointer; }
.dw-chat-open svg { flex: 0 0 24px; width: 24px; height: 24px; }
.dw-help-panel .dw-chat-open:hover { background: #123c51; }
.dw-help-panel .dw-chat-open:disabled { cursor: wait; opacity: .7; }
.dw-chat-open:focus-visible, .dw-chat-fallback > summary:focus-visible { outline: 3px solid #2d87ab; outline-offset: 4px; }
.dw-help-panel .dw-chat-note { margin: 10px 0 0; color: #526c79; font-size: 12px; line-height: 1.6; }
.dw-chat-status:empty { display: none; }
.dw-help-panel .dw-chat-status { margin: 12px 0; color: #174b64; font-size: 13px; line-height: 1.5; }
.dw-help-panel .dw-chat-fallback { margin-top: 20px; padding-top: 16px; border-top: 1px solid #dbe8ed; }
.dw-chat-fallback > summary { padding: 6px 0; color: #173747; font-weight: 700; font-size: 14px; cursor: pointer; }
.dw-help-panel .dw-chat-fallback .dw-inquiry { margin-top: 14px; }
.dw-bitrix-open .dw-page-tools, .dw-bitrix-open .dw-purchase-dock { visibility: hidden; }
.dw-help-launch[data-chat-unread] { position: relative; }
.dw-help-launch[data-chat-unread]::after { content: ''; position: absolute; width: 10px; height: 10px; right: 8px; top: 6px; background: #b5e5d4; border: 2px solid #174b64; border-radius: 50%; }
@media (max-width: 640px) {
  .dw-bitrix-enabled .bx-livechat-wrapper .bx-im-textarea-input { font-size: 16px; line-height: 1.4; }
  /* Bitrix's desktop minimum is wider than a 320px viewport. This also
     covers small desktop windows, independently of user-agent detection. */
  .dw-bitrix-enabled .bx-livechat-wrapper.bx-livechat-show { inset: 0 !important; width: 100% !important; max-width: 100% !important; height: 100vh !important; height: 100dvh !important; max-height: 100dvh !important; margin: 0 !important; transform: none !important; }
  .dw-bitrix-enabled .bx-livechat-wrapper.bx-livechat-show .bx-livechat-box { border-radius: 0; }
  .dw-bitrix-enabled .bx-livechat-widget-resize-handle { display: none; }
}
@media (max-width: 480px) {
  .dw-help-panel .dw-chat-intro > p:first-child { font-size: 14px; }
  .dw-help-panel .dw-chat-fallback { margin-top: 16px; padding-top: 12px; }
}
