/* ===================== SOHBET WIDGET ===================== */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--green-2); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 4px rgba(46,160,67,.18);
  transition: transform .18s, background .2s;
}
.chat-fab:hover { background: var(--green); transform: translateY(-2px); }
.chat-fab svg { width: 28px; height: 28px; }
.chat-fab__close { display: none; }
.chat-fab.is-open .chat-fab__open { display: none; }
.chat-fab.is-open .chat-fab__close { display: block; }

.chat-panel {
  position: fixed; right: 22px; bottom: 94px; z-index: 80;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 140px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.chat-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.chat-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: linear-gradient(120deg, var(--green-soft), transparent 70%);
  border-bottom: 1px solid var(--border);
}
.chat-head__logo { height: 26px; width: auto; }
.chat-head__title { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 15px; }
.chat-head__sub { font-size: 12px; color: var(--green); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.chat-msg { max-width: 84%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.chat-msg--bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-msg--user { align-self: flex-end; background: var(--green-2); color: #fff; border-bottom-right-radius: 4px; }

.chat-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: chatBlink 1.2s infinite both; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatBlink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.chat-note { align-self: center; font-size: 12.5px; color: var(--muted); text-align: center; padding: 4px 8px; }

.chat-foot { border-top: 1px solid var(--border); padding: 12px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-input {
  flex: 1; resize: none; max-height: 96px; min-height: 44px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 13px; font-family: inherit; font-size: 14.5px; line-height: 1.4;
}
.chat-input:focus { outline: none; border-color: var(--green); }
.chat-input:disabled { opacity: .5; cursor: not-allowed; }
.chat-send {
  flex: none; width: 44px; height: 44px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--green-2); color: #fff; display: grid; place-items: center; transition: background .2s;
}
.chat-send:hover:not(:disabled) { background: var(--green); }
.chat-send:disabled { opacity: .4; cursor: not-allowed; }
.chat-foot__hint { margin-top: 7px; font-size: 11px; color: var(--muted); text-align: center; }

@media (max-width: 480px) {
  .chat-fab { right: 16px; bottom: 16px; }
  .chat-panel { right: 12px; left: 12px; bottom: 84px; width: auto; height: min(70vh, 520px); }
}
