.web-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1050;
  font-family: Inter, Arial, sans-serif;
  color: #181818;
  pointer-events: none;
}
.web-chat[hidden],
.web-chat__panel[hidden],
.web-chat__notice[hidden],
.web-chat__badge[hidden],
.web-chat__typing[hidden] {
  display: none !important;
}
.web-chat__launcher,
.web-chat__panel,
.web-chat__notice {
  pointer-events: auto;
}
.web-chat__launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: #181818;
  color: #fff;
  padding: 11px 15px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 34px rgba(0,0,0,.22);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .16s ease;
}
.web-chat__launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(0,0,0,.26);
}
.web-chat.is-open .web-chat__launcher {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
}
.web-chat__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fd4a22;
  box-shadow: 0 0 0 4px rgba(253,74,34,.16);
}
.web-chat__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fd4a22;
  color: #fff;
  border: 2px solid #fff;
  font-size: 10px;
  font-weight: 800;
}
.web-chat__notice {
  position: absolute;
  right: 0;
  bottom: 56px;
  width: min(300px, calc(100vw - 28px));
  border: 1px solid #e5e3de;
  border-radius: 14px;
  background: #fff;
  color: #181818;
  padding: 11px 13px;
  text-align: left;
  box-shadow: 0 14px 38px rgba(0,0,0,.16);
  cursor: pointer;
  opacity: 0;
  transform: translateY(7px) scale(.99);
  transition: opacity .18s ease, transform .18s ease;
}
.web-chat__notice.is-visible {
  opacity: 1;
  transform: none;
}
.web-chat__notice strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}
.web-chat__notice span {
  display: block;
  color: #666;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.web-chat__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(348px, calc(100vw - 28px));
  max-height: min(520px, calc(100dvh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto auto;
  background: #f4f4f0;
  border: 1px solid rgba(24,24,24,.12);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 68px rgba(0,0,0,.27);
  transform-origin: bottom right;
  animation: webChatOpen .18s cubic-bezier(.2,.8,.2,1) both;
}
.web-chat:not(.has-conversation) .web-chat__panel {
  height: auto;
}
.web-chat.has-conversation .web-chat__panel {
  height: min(500px, calc(100dvh - 40px));
}
@keyframes webChatOpen {
  from { opacity: 0; transform: translateY(8px) scale(.988); }
  to { opacity: 1; transform: none; }
}
.web-chat__head {
  min-height: 62px;
  background: #181818;
  color: #fff;
  padding: 11px 12px 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.web-chat__head strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}
.web-chat__head span {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  color: #c8c8c8;
  font-size: 10px;
}
.web-chat__head i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #47b566;
}
.web-chat__close {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  color: #fff;
  font: inherit;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.web-chat__close:hover { background: rgba(255,255,255,.17); }
.web-chat__body {
  min-height: 0;
  max-height: 292px;
  overflow: auto;
  padding: 12px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.web-chat.has-conversation .web-chat__body {
  max-height: none;
}
.web-chat__intro {
  margin: 0 0 9px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  line-height: 1.42;
}
.web-chat__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.web-chat__quick button {
  max-width: 100%;
  border: 1px solid #dcdad4;
  border-radius: 999px;
  background: #fff;
  color: #222;
  padding: 7px 10px;
  text-align: left;
  font: inherit;
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.web-chat__quick button:hover {
  border-color: #bbb8b1;
  background: #fcfcfa;
  transform: translateY(-1px);
}
.web-chat.has-conversation .web-chat__intro,
.web-chat.has-conversation .web-chat__quick {
  display: none;
}
.web-chat__messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.web-chat__message {
  position: relative;
  max-width: 84%;
  align-self: flex-start;
  border-radius: 13px 13px 13px 4px;
  background: #fff;
  padding: 8px 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
  animation: webChatMessageIn .16s ease both;
}
.web-chat__message--customer {
  align-self: flex-end;
  border-radius: 13px 13px 4px 13px;
  background: #181818;
  color: #fff;
}
.web-chat__message--automation {
  background: #fff0eb;
  border: 1px solid #ffd3c5;
}
.web-chat__message.is-pending { opacity: .56; }
.web-chat__message small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  opacity: .55;
}
@keyframes webChatMessageIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.web-chat__typing {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 0 0 2px;
  color: #777;
  font-size: 10px;
}
.web-chat__typing-dots { display: inline-flex; gap: 3px; }
.web-chat__typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: webChatTyping 1s infinite ease-in-out;
}
.web-chat__typing-dots i:nth-child(2) { animation-delay: .12s; }
.web-chat__typing-dots i:nth-child(3) { animation-delay: .24s; }
@keyframes webChatTyping {
  0%,60%,100% { opacity: .25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}
.web-chat__form {
  display: grid;
  grid-template-columns: minmax(0,1fr) 42px;
  gap: 7px;
  align-items: end;
  padding: 9px 10px;
  background: #fff;
  border-top: 1px solid #e5e3de;
}
.web-chat__form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  max-height: 104px;
  resize: none;
  overflow-y: auto;
  border: 1px solid #d8d6d0;
  border-radius: 11px;
  background: #fff;
  padding: 10px 11px;
  color: #181818;
  outline: none;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
}
.web-chat__form textarea:focus {
  border-color: #9f9d98;
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.web-chat__form button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: #fd4a22;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .14s ease, opacity .14s ease;
}
.web-chat__form button:active { transform: scale(.96); }
.web-chat__form button:disabled { opacity: .55; cursor: wait; }
.web-chat__lead {
  width: 100%;
  border: 0;
  border-top: 1px solid #eceae5;
  background: #fff;
  color: #222;
  padding: 9px 12px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.web-chat__error {
  margin-top: 6px;
  border-radius: 9px;
  background: #fff1ed;
  color: #a53520;
  padding: 7px 8px;
  text-align: center;
  font-size: 10px;
}
body.menu-open .web-chat {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@media (max-height: 700px) and (min-width: 761px) {
  .web-chat.has-conversation .web-chat__panel { height: calc(100dvh - 28px); }
  .web-chat__panel { max-height: calc(100dvh - 28px); }
}
@media (max-width: 760px) {
  .web-chat {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }
  .web-chat__launcher {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 12px;
  }
  .web-chat__panel {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    border: 0;
    border-top: 1px solid rgba(24,24,24,.12);
    border-radius: 18px 18px 0 0;
    transform-origin: bottom center;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .web-chat:not(.has-conversation) .web-chat__panel { height: auto; }
  .web-chat.has-conversation .web-chat__panel { height: min(74dvh, 620px); }
  .web-chat__body { max-height: min(42dvh, 320px); padding: 11px 12px; }
  .web-chat.has-conversation .web-chat__body { max-height: none; }
  .web-chat__head { min-height: 58px; padding-left: 14px; padding-right: 10px; }
  .web-chat__form { padding: 8px 10px; }
  .web-chat__message { max-width: 88%; }
  .web-chat__notice {
    position: fixed;
    right: 10px;
    bottom: calc(60px + env(safe-area-inset-bottom));
    width: min(300px, calc(100vw - 20px));
  }
}
@media (max-width: 380px) {
  .web-chat.has-conversation .web-chat__panel { height: min(78dvh, 620px); }
  .web-chat__quick button { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .web-chat *, .web-chat *::before, .web-chat *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
