.sitechat [hidden] { display: none !important; }
.sitechat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100050;
  font-family: Roboto, Arial, sans-serif;
}
.sitechat-fab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  width: 58px;
  height: 58px;
  padding: 0 15px;
  border: 0;
  border-radius: 29px;
  background: #7266f3;
  color: #fff;
  box-shadow: 0 10px 24px rgba(114, 102, 243, .35);
  cursor: pointer;
  transition: width .28s ease, padding .28s ease;
}
.sitechat-fab svg { width: 28px; height: 28px; flex: 0 0 28px; display: block; }
.sitechat-fab-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  transition: max-width .28s ease, opacity .2s ease, margin .28s ease;
}
.sitechat-fab:hover,
.sitechat-fab:focus-visible {
  width: 360px;
  padding-left: 18px;
}
.sitechat-fab:hover .sitechat-fab-label,
.sitechat-fab:focus-visible .sitechat-fab-label {
  max-width: 290px;
  opacity: 1;
  margin-right: 10px;
}
.sitechat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #e23d3d;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
}
.sitechat-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  display: flex;
  flex-direction: column;
  width: 340px;
  height: 480px;
  max-height: calc(100vh - 110px);
  background: #fff;
  color: #1d1b2a;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 50px rgba(29, 27, 42, .22);
}
.sitechat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 16px;
  background: #7266f3;
  color: #fff;
}
.sitechat-head strong { display: block; font-size: 15px; font-weight: 700; }
.sitechat-head span { display: block; font-size: 12px; opacity: .85; }
.sitechat-head div { flex: 1; min-width: 0; }
.sitechat-end,
.sitechat-hide,
.sitechat-new,
.sitechat-form button {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.sitechat-end {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
}
.sitechat-end:disabled { opacity: .6; cursor: default; }
.sitechat-hide {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
}
.sitechat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: #f6f5fb;
}
.sitechat-msg { max-width: 85%; margin: 0 0 10px; }
.sitechat-msg-text {
  padding: 10px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
}
.sitechat-msg time { display: block; margin-top: 3px; color: #8b879c; font-size: 11px; }
.sitechat-msg--manager { margin-right: auto; }
.sitechat-msg--manager .sitechat-msg-text { background: #fff; border-bottom-left-radius: 4px; }
.sitechat-msg--customer { margin-left: auto; }
.sitechat-msg--customer .sitechat-msg-text { background: #7266f3; color: #fff; border-bottom-right-radius: 4px; }
.sitechat-msg--customer time { text-align: right; }
.sitechat-msg--system { max-width: 100%; text-align: center; }
.sitechat-msg--system .sitechat-msg-text { background: transparent; color: #6d6982; font-size: 12px; padding: 2px 8px; }
.sitechat-gate { display: flex; flex-shrink: 0; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid #eceaf3; background: #fff; }
.sitechat-gate p { margin: 0; color: #3c3850; font-size: 13px; line-height: 1.35; }
.sitechat-gate input {
  border: 1px solid #e1deee;
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}
.sitechat-gate button {
  border: 0;
  border-radius: 12px;
  background: #7266f3;
  color: #fff;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}
.sitechat-error { color: #e23d3d !important; }
.sitechat-form {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eceaf3;
  background: #fff;
}
.sitechat-form textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  resize: none;
  border: 1px solid #e1deee;
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}
.sitechat-send,
.sitechat-new {
  border: 0;
  border-radius: 12px;
  background: #7266f3;
  color: #fff;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.sitechat-send { width: 100%; }
.sitechat-send:disabled { opacity: .6; cursor: default; }
.sitechat-done { flex-shrink: 0; padding: 12px; text-align: center; background: #fff; border-top: 1px solid #eceaf3; }
.sitechat-done p { margin: 0 0 8px; color: #6d6982; font-size: 13px; }
@media (max-width: 480px) {
  .sitechat { right: 12px; bottom: 12px; }
  .sitechat-panel { width: calc(100vw - 24px); height: min(70vh, 520px); }
  .sitechat-fab:hover,
  .sitechat-fab:focus-visible { width: calc(100vw - 24px); }
}
