/* Chat Widget */

.cw-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  background: #698cf0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(105,140,240,.5);
  z-index: 9998;
  transition: transform .18s ease, box-shadow .18s ease;
}

.cw-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(105,140,240,.6);
}

.cw-btn.is-scroll-hidden {
  opacity: 0;
  transform: translateY(18px) scale(.92);
  pointer-events: none;
}

.cw-btn.is-open {
  background: #5a6a8a;
}

.cw-btn::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(105,140,240,.35);
  z-index: -1;
  animation: cwPulse 2.2s ease-in-out infinite;
}

.cw-btn.is-open::before {
  opacity: 0;
}

.cw-icon-open { display: flex; }
.cw-icon-close { display: none; }
.cw-btn.is-open .cw-icon-open { display: none; }
.cw-btn.is-open .cw-icon-close { display: flex; }

.cw-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  background: #d94b4b;
  color: #fff;
  border: 2px solid #fff;
  font-size: 11px;
  font-weight: 700;
}

.cw-badge.show {
  display: flex;
}

.cw-window {
  position: fixed;
  right: 26px;
  bottom: 110px;
  width: min(380px, calc(100vw - 28px));
  height: min(640px, calc(100vh - 150px));
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top right, rgba(123, 145, 229, .18), rgba(123, 145, 229, 0) 36%),
    linear-gradient(180deg, #f8f4ee 0%, #eef2fb 100%);
  border: 1px solid rgba(214, 221, 237, .9);
  box-shadow: 0 26px 80px rgba(22, 28, 44, .22);
  backdrop-filter: blur(16px);
  z-index: 9997;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(.96);
  transition: opacity .18s ease, transform .18s ease;
}

.cw-window [hidden] {
  display: none !important;
}

.cw-window.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.cw-mobile-frame-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 10050;
  display: none;
  background: #0f1117;
  overflow: hidden;
}

.cw-mobile-frame-overlay.is-open {
  display: block;
}

.cw-mobile-frame {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  display: block;
  background: #f0f2f5;
  overflow: hidden;
}

.cw-mobile-frame-composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10060;
  display: none;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(252,253,255,.96);
  border-top: 1px solid rgba(222, 228, 239, .88);
  backdrop-filter: blur(12px);
}

.cw-mobile-frame-input {
  flex: 1;
  min-height: 44px;
  max-height: 96px;
  padding: 11px 14px;
  border-radius: 20px;
  border: 1px solid rgba(212, 219, 236, .94);
  background: rgba(244,247,252,.96);
  color: #202633;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.cw-mobile-frame-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #3c63be 0%, #7393f0 100%);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 14px 24px rgba(66, 100, 190, .22);
}

html.cw-embed-html,
body.cw-embed-body {
  width: var(--cw-vw, 100vw);
  max-width: var(--cw-vw, 100vw);
  height: var(--cw-vh, 100dvh);
  max-height: var(--cw-vh, 100dvh);
  overflow: hidden !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.cw-embed-html {
  margin: 0;
  padding: 0;
  background: #f0f2f5;
  overscroll-behavior: none;
  scroll-behavior: auto;
}

body.cw-embed-body {
  position: relative;
  margin: 0;
  padding: 0;
  background: #f0f2f5;
  overscroll-behavior: none;
  scroll-behavior: auto;
}

.cw-window-embed {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.cw-window-standalone {
  position: absolute;
  inset: 0;
  right: auto;
  bottom: auto;
  width: var(--cw-vw, 100vw);
  min-width: var(--cw-vw, 100vw);
  max-width: var(--cw-vw, 100vw);
  height: var(--cw-vh, 100dvh);
  min-height: var(--cw-vh, 100dvh);
  max-height: var(--cw-vh, 100dvh);
  border-radius: 0;
  box-sizing: border-box;
  transform: none !important;
  box-shadow: none;
  border: 0;
  opacity: 1;
  pointer-events: auto;
  overflow: hidden;
  background: #f0f2f5;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.cw-window-standalone .cw-body {
  min-height: 0;
  overflow: hidden;
}

.cw-window-standalone .cw-messages,
.cw-window-standalone .cw-preform,
.cw-window-standalone .cw-loader {
  min-height: 0;
}

.cw-window-embed .cw-body {
  min-height: 0;
  overflow: hidden;
}

.cw-window-embed .cw-input-area {
  display: none !important;
}

.cw-window-embed .cw-messages,
.cw-window-embed .cw-preform,
.cw-window-embed .cw-loader {
  min-height: 0;
}

.cw-window-embed.has-parent-composer .cw-body,
.cw-window-embed.has-parent-composer .cw-topics,
.cw-window-embed.has-parent-composer .cw-case-status,
.cw-window-embed.has-parent-composer .cw-choose {
  padding-bottom: calc(var(--cw-parent-composer, 0px) + env(safe-area-inset-bottom));
}

.cw-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  background: linear-gradient(135deg, #2f4b89 0%, #6f90ef 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.cw-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24);
  font-size: 20px;
  flex: 0 0 auto;
}

.cw-header-copy {
  flex: 1;
  min-width: 0;
}

.cw-header-video {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.16);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: background .16s ease, transform .12s ease;
}

.cw-header-video:hover {
  background: rgba(255,255,255,.22);
}

.cw-header-video:active {
  transform: scale(.98);
}

.cw-header-video svg {
  flex: 0 0 auto;
}

.cw-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-header-status {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,.86);
}

.cw-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #84f3a7;
  box-shadow: 0 0 0 6px rgba(132,243,167,.14);
  vertical-align: middle;
}

.cw-close-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.cw-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cw-preform,
.cw-loader,
.cw-messages {
  flex: 1;
  min-height: 0;
}

.cw-preform {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 18px 18px;
  overflow-y: auto;
}

.cw-panel-intro {
  padding: 16px 16px 14px;
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(220, 227, 241, .9);
  box-shadow: 0 14px 28px rgba(63, 78, 119, .08);
}

.cw-panel-kicker {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #698cf0;
}

.cw-panel-intro p {
  margin: 0;
  color: #50576a;
  font-size: 14px;
  line-height: 1.65;
}

.cw-preform input[type="text"] {
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(211, 219, 236, .96);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px rgba(64, 80, 120, .07);
  outline: none;
  font: inherit;
  font-size: 16px;
}

.cw-preform input[type="text"]:focus {
  border-color: #698cf0;
}

.cw-start-btn {
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #3c63be 0%, #7393f0 100%);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(66, 100, 190, .26);
}

.cw-start-btn:disabled,
.cw-send:disabled {
  opacity: .55;
  cursor: default;
}

.cw-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
}

.cw-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(206, 213, 231, .95);
  border-top-color: #698cf0;
  border-radius: 50%;
  animation: cwSpin .8s linear infinite;
}

.cw-loader-copy {
  color: #6b7388;
  font-size: 14px;
}

.cw-messages {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 12px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cw-window.has-topics .cw-messages,
.cw-window.has-status .cw-messages,
.cw-window.has-choose .cw-messages {
  padding-bottom: 26px;
}

.cw-msg {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 79%;
  margin-bottom: 2px;
}

.cw-msg.in {
  align-self: flex-start;
}

.cw-msg.out {
  align-self: flex-end;
}

.cw-sender {
  margin-left: 9px;
  margin-bottom: 0;
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: .01em;
  color: #98a0b4;
}

.cw-msg.out .cw-sender {
  margin-left: 0;
  margin-right: 9px;
  text-align: right;
}

.cw-bubble {
  padding: 8px 12px 6px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.33;
  word-break: break-word;
  box-shadow: 0 2px 6px rgba(37, 47, 73, .03);
}

.cw-msg.in .cw-bubble {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(227, 232, 242, .95);
  color: #202633;
  border-top-left-radius: 6px;
}

.cw-msg.out .cw-bubble {
  background: linear-gradient(135deg, #466dcb 0%, #7b99f2 100%);
  color: #fff;
  border-top-right-radius: 6px;
}

.cw-bubble-reply {
  margin-bottom: 5px;
  padding: 7px 9px;
  border-left: 4px solid rgba(105,140,240,.78);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(228, 235, 250, .96), rgba(238, 243, 252, .92));
  color: #425170;
  opacity: .98;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

.cw-msg.out .cw-bubble-reply {
  border-left-color: rgba(255,255,255,.82);
  background: rgba(19, 34, 82, .18);
  color: rgba(255,255,255,.92);
}

.cw-bubble-reply-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .82;
}

.cw-bubble-reply-text {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.26;
  font-weight: 500;
}

.cw-bubble-text {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.36;
}

.cw-time {
  margin-top: 0;
  margin-left: 9px;
  font-size: 9px;
  line-height: 1.1;
  color: #a7aec1;
}

.cw-msg.out .cw-time {
  margin-left: 0;
  margin-right: 9px;
  text-align: right;
}

.cw-sys {
  align-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(223,228,240,.85);
  color: #667087;
  text-align: center;
  font-size: 11px;
  max-width: 90%;
}

.cw-actions {
  display: flex;
  margin-top: 0;
}

.cw-msg.out .cw-actions {
  justify-content: flex-end;
}

.cw-reply-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: #6d83d4;
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.cw-input-area {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(222, 228, 239, .88);
  background: rgba(252,253,255,.92);
  backdrop-filter: blur(12px);
}

.cw-reply-box {
  width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  background: rgba(232, 238, 251, .92);
  border: 1px solid rgba(203, 214, 242, .95);
}

.cw-reply-copy {
  min-width: 0;
}

.cw-reply-label {
  font-size: 10px;
  font-weight: 700;
  color: #5168a9;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.cw-reply-text {
  margin-top: 2px;
  color: #33405d;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-reply-cancel {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  color: #7381a0;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.cw-textarea {
  flex: 1;
  min-height: 44px;
  max-height: 96px;
  padding: 11px 14px;
  border-radius: 20px;
  border: 1px solid rgba(212, 219, 236, .94);
  background: rgba(244,247,252,.96);
  color: #202633;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.cw-textarea:focus {
  border-color: #698cf0;
  background: #fff;
}

.cw-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #3c63be 0%, #7393f0 100%);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 14px 24px rgba(66, 100, 190, .22);
}

.cw-menu {
  position: fixed;
  right: 18px;
  bottom: 108px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9997;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(.96);
  transition: opacity .18s ease, transform .18s ease;
}

.cw-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.cw-menu.is-scroll-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(.96);
}

.cw-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 11px 18px 11px 12px;
  border: 0;
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 34px rgba(26, 34, 55, .14);
  color: #202633;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-align: left;
}

.cw-menu-item-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3c63be 0%, #7393f0 100%);
  color: #fff;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}

.cw-menu-item-mark.video {
  background: linear-gradient(135deg, #43629c 0%, #6d83d4 100%);
}

.cw-menu-item-mark svg {
  display: block;
}

.cw-hint {
  position: fixed;
  right: 24px;
  bottom: 112px;
  max-width: 270px;
  padding: 16px 42px 16px 18px;
  border: 0;
  border-radius: 20px 20px 8px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 36px rgba(26, 34, 55, .14);
  text-align: left;
  cursor: pointer;
  z-index: 9996;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(.96);
  transition: opacity .18s ease, transform .18s ease;
}

@media (min-width: 769px) {
  .cw-window {
    right: 22px;
    bottom: 22px;
    width: min(420px, calc(100vw - 36px));
    height: min(590px, calc(100vh - 210px));
    max-height: 590px;
    border-radius: 28px;
  }
  .cw-hint{display:none!important;}

  .cw-menu {
    right: 24px;
    bottom: 118px;
  }

  .cw-hint-title {
    font-size: 14px;
    line-height: 1.3;
  }

  .cw-hint-sub {
    font-size: 12px;
    line-height: 1.35;
  }
}

.cw-hint-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8c95ab;
  font-size: 14px;
  line-height: 1;
  background: rgba(232, 237, 249, .92);
}

.cw-hint.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.cw-hint.is-scroll-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(.96);
}

.cw-hint-title {
  color: #1d2230;
  font-size: 15px;
  font-weight: 700;
}

.cw-hint-sub {
  color: #6a7288;
  font-size: 13px;
  line-height: 1.45;
}

.cw-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 16, 28, .48);
  backdrop-filter: blur(10px);
  z-index: 10000;
}

.cw-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  color: #667087;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 12px 24px rgba(25, 32, 50, .12);
}

@keyframes cwPulse {
  0% { transform: scale(1); opacity: .9; }
  60% { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1.28); opacity: 0; }
}

@keyframes cwSpin {
  to { transform: rotate(360deg); }
}

@media (min-width: 769px) {
  .cw-menu {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .cw-btn {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: 64px;
    height: 64px;
  }

  .cw-window {
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--cw-vw, 100vw);
    min-width: var(--cw-vw, 100vw);
    max-width: var(--cw-vw, 100vw);
    height: var(--cw-vh, 100dvh);
    min-height: var(--cw-vh, 100dvh);
    max-height: var(--cw-vh, 100dvh);
    border-radius: 0;
    box-sizing: border-box;
    transform: none !important;
    box-shadow: none;
    border: 0;
    overscroll-behavior: none;
    touch-action: none;
    background: #f0f2f5;
    overflow: hidden;
  }

  .cw-window.is-open {
    transform: none !important;
  }

  .cw-window,
  .cw-window * {
    box-sizing: border-box;
  }

  .cw-header {
    padding: max(12px, env(safe-area-inset-top)) 12px 10px;
    border-radius: 0;
  }

  .cw-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .cw-preform {
    padding: 16px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .cw-messages {
    padding: 8px 10px 6px;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
  }

  .cw-input-area {
    width: 100%;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    overflow: hidden;
    background: #fff;
    position: relative;
    z-index: 2;
  }

  .cw-textarea {
    font-size: 16px;
    min-width: 0;
  }

  .cw-msg {
    max-width: 88%;
    margin-bottom: 1px;
  }

  .cw-bubble {
    font-size: 14px;
    line-height: 1.42;
    padding: 7px 11px 6px;
  }

  .cw-topics,
  .cw-case-status,
  .cw-choose {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(251, 252, 255, .98), rgba(243, 246, 255, .98));
  }

  .cw-topics-label,
  .cw-status-label,
  .cw-choose-label {
    font-size: 11px;
    margin-bottom: 0;
  }

  .cw-choose {
    gap: 6px;
    box-shadow: 0 -8px 18px rgba(42, 54, 92, .08);
  }

  .cw-choose-btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 12px;
  }

  .cw-window.is-composer-mode {
    left: 0;
    right: 0;
    top: 0 !important;
    bottom: 0;
    border-radius: 0;
  }

  .cw-window.is-keyboard-open {
    left: 0;
    right: 0;
    top: 0 !important;
    bottom: 0 !important;
    border-radius: 0;
    height: var(--cw-vh, 100dvh);
    min-height: var(--cw-vh, 100dvh);
    max-height: var(--cw-vh, 100dvh);
  }

  .cw-window.is-composer-mode .cw-header {
    padding: max(10px, env(safe-area-inset-top)) 10px 8px;
  }

  .cw-window.is-composer-mode .cw-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 16px;
  }

  .cw-window.is-composer-mode .cw-title {
    font-size: 13px;
  }

  .cw-window.is-composer-mode .cw-header-status {
    font-size: 10px;
  }

  .cw-window.is-composer-mode .cw-close-btn {
    width: 34px;
    height: 34px;
  }

  .cw-window.is-composer-mode .cw-topics,
  .cw-window.is-composer-mode .cw-case-status,
  .cw-window.is-composer-mode .cw-choose {
    display: none !important;
  }

  .cw-window.is-keyboard-open .cw-preform {
    padding: 14px 12px 10px;
  }

  .cw-window.is-keyboard-open .cw-panel-intro {
    padding: 14px 14px 12px;
    border-radius: 18px;
  }

  .cw-window.is-keyboard-open .cw-start-btn,
  .cw-window.is-keyboard-open .cw-preform input[type="text"] {
    min-height: 52px;
  }

  .cw-window-embed.is-keyboard-open .cw-topics,
  .cw-window-embed.is-keyboard-open .cw-case-status,
  .cw-window-embed.is-keyboard-open .cw-choose {
    display: none !important;
  }

  .cw-window-embed.is-keyboard-open {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .cw-window-embed.is-keyboard-open .cw-input-area {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 8;
  }

  .cw-window-embed.is-keyboard-open .cw-body {
    padding-bottom: 0;
  }

  .cw-window-embed.is-keyboard-open .cw-messages,
  .cw-window-embed.is-keyboard-open .cw-preform,
  .cw-window-embed.is-keyboard-open .cw-loader {
    padding-bottom: 12px;
  }

  .cw-window.is-keyboard-open .cw-messages,
  .cw-window.is-keyboard-open .cw-preform,
  .cw-window.is-keyboard-open .cw-input-area {
    touch-action: pan-y manipulation;
  }

  .cw-menu {
    right: 14px;
    bottom: calc(102px + env(safe-area-inset-bottom));
  }

  .cw-hint {
    right: 12px;
    bottom: calc(106px + env(safe-area-inset-bottom));
    max-width: 220px;
  }

  html,
  body {
    overflow-x: hidden;
  }
}

html.cw-chat-open-mobile,
body.cw-chat-open-mobile {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

body.cw-chat-open-mobile {
  width: 100%;
}

html.cw-chat-keyboard-open,
body.cw-chat-keyboard-open {
  overflow: hidden !important;
}

/* ── Выбор способа связи с адвокатом ─────────────────────────── */
.cw-choose {
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(225, 230, 240, .95);
  background: linear-gradient(180deg, rgba(251, 252, 255, .98), rgba(243, 246, 255, .98));
  box-shadow: 0 -10px 24px rgba(45, 58, 95, .08);
  position: relative;
  z-index: 3;
}
.cw-choose-label {
  font-size: 12px;
  color: #7a7f9a;
  text-align: left;
  margin-bottom: 0;
  padding-left: 2px;
}
.cw-choose-btn {
  min-height: 44px;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -.01em;
  transition: opacity .15s, transform .1s, box-shadow .15s;
}
.cw-choose-btn:active { transform: scale(.97); }
.cw-choose-chat {
  background: linear-gradient(135deg, #4d72d2 0%, #7996f4 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(73, 108, 204, .22);
}
.cw-choose-chat:hover { opacity: .88; }
.cw-choose-video {
  background: rgba(255,255,255,.92);
  color: #5d7fe3;
  border: 1px solid rgba(105,140,240,.42);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.cw-choose-video:hover { background: #f0f4ff; }

/* ── ИИ-помощник ──────────────────────────────────────────────── */
.cw-msg.in.ai .cw-bubble,
.msg.in.ai .msg-bubble {
  background: #f0f4ff;
  border: 1px solid #c8d4f8;
  color: #222;
}
.cw-msg.in.ai .cw-sender {
  color: #698cf0;
  font-weight: 600;
}
.cw-ai-disclaimer {
  font-size: 10px;
  color: #a0a8c8;
  margin-top: 3px;
  margin-left: 3px;
  font-style: italic;
}

/* ── Баннер-приглашение в чат ─────────────────────────────────── */
.cw-invite {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 300px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(22, 30, 55, .18);
  padding: 20px 18px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  z-index: 9997;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(.96);
  transition: opacity .22s ease, transform .22s ease;
}
.cw-invite.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.cw-invite-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #f0f2f8;
  color: #7a7f9a;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cw-invite-close:hover { background: #e2e6f3; color: #333; }
.cw-invite-avatar {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.cw-invite-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cw-invite-title {
  font-size: 15px;
  font-weight: 700;
  color: #1d2230;
  padding-right: 20px;
}
.cw-invite-text {
  font-size: 13px;
  color: #6a7288;
  line-height: 1.5;
}
.cw-invite-btn {
  margin-top: 4px;
  background: #698cf0;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  align-self: flex-start;
}
.cw-invite-btn:hover { opacity: .88; }
@media (max-width: 768px) {
  .cw-invite {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 90px;
  }
}

/* ── Кнопки направлений ────────────────────────────────────────── */
.cw-topics {
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid #e8eaf0;
  background: #f8f9ff;
}
.cw-topics-label {
  font-size: 12px;
  color: #7a7f9a;
  font-weight: 600;
  margin-bottom: 2px;
}
.cw-topics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.cw-topic-btn {
  background: #fff;
  border: 1.5px solid #d0d6f0;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  text-align: left;
  transition: background .12s, border-color .12s, transform .1s;
  line-height: 1.25;
}
.cw-topic-btn:hover {
  background: #f0f4ff;
  border-color: #698cf0;
  color: #3a5bcc;
}
.cw-topic-btn:active { transform: scale(.97); }

/* ── Карточка видеозвонка ────────────────────────────────────────── */
.cw-video-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #4a6cf7 0%, #2b4acb 100%);
  border-radius: 16px;
  padding: 20px 16px;
  margin: 8px 0;
  text-align: center;
  animation: cwSlideIn .3s ease;
}
.cw-video-icon { font-size: 36px; line-height: 1; }
.cw-video-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.cw-video-sub {
  font-size: 12px;
  color: rgba(255,255,255,.8);
  line-height: 1.4;
}
.cw-video-btn {
  display: inline-block;
  margin-top: 4px;
  background: #fff;
  color: #2b4acb;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.cw-video-btn:hover { opacity: .9; }
.cw-video-btn:active { transform: scale(.97); }
@keyframes cwSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Панель статусов ─────────────────────────────────────────── */
.cw-case-status { display:flex; flex-direction:column; gap:8px; padding:10px 14px 14px; border-top:1px solid #e8eaf0; background:#f8f9ff; }
.cw-status-label { font-size:12px; color:#7a7f9a; font-weight:600; margin-bottom:2px; }
.cw-status-grid { display:flex; flex-direction:column; gap:6px; }
.cw-status-btn { background:#fff; border:1.5px solid #d0d6f0; border-radius:10px; padding:9px 12px; font-size:12px; font-weight:500; color:#333; cursor:pointer; text-align:left; transition:background .12s,border-color .12s,transform .1s; }
.cw-status-btn:hover { background:#f0f4ff; border-color:#698cf0; color:#3a5bcc; }
.cw-status-btn:active { transform:scale(.98); }

@media (max-width: 768px) {
  .cw-header {
    padding: max(12px, env(safe-area-inset-top)) 12px 10px;
    gap: 10px;
  }

  .cw-avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    font-size: 18px;
  }

  .cw-title {
    font-size: 14px;
  }

  .cw-header-status {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .cw-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 18px;
    flex: 0 0 auto;
  }

  .cw-header-video {
    height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 12px;
  }

  .cw-actions {
    display: none !important;
  }
}
