#garyit-chatbot-root {
  --garyit-chatbot-brand: #1267d6;
  position: fixed;
  z-index: 999999;
  bottom: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}
#garyit-chatbot-root *, #garyit-chatbot-root *::before, #garyit-chatbot-root *::after { box-sizing: border-box; }
#garyit-chatbot-root.garyit-chatbot-position-right { right: 22px; }
#garyit-chatbot-root.garyit-chatbot-position-left { left: 22px; }

.garyit-chatbot-launcher {
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: var(--garyit-chatbot-brand);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.24);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.garyit-chatbot-launcher:hover { transform: translateY(-2px); box-shadow: 0 15px 38px rgba(0,0,0,.30); }
.garyit-chatbot-launcher:focus-visible, .garyit-chatbot-close:focus-visible, .garyit-chatbot-send:focus-visible, .garyit-chatbot-form textarea:focus-visible { outline: 3px solid rgba(18,103,214,.28); outline-offset: 2px; }
.garyit-chatbot-launcher svg { width: 28px; height: 28px; fill: currentColor; }

.garyit-chatbot-panel {
  position: absolute;
  bottom: 76px;
  width: 380px;
  height: min(610px, calc(100vh - 120px));
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(15,23,42,.22);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}
.garyit-chatbot-position-right .garyit-chatbot-panel { right: 0; }
.garyit-chatbot-position-left .garyit-chatbot-panel { left: 0; }
.garyit-chatbot-panel.is-open { opacity: 1; transform: translateY(0) scale(1); display: flex; flex-direction: column; }

.garyit-chatbot-header {
  min-height: 72px;
  padding: 14px 16px;
  background: var(--garyit-chatbot-brand);
  background: linear-gradient(135deg, var(--garyit-chatbot-brand), color-mix(in srgb, var(--garyit-chatbot-brand) 72%, #0f172a));
  color: #fff;
  display: flex;
  align-items: center;
  gap: 11px;
}
.garyit-chatbot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.26);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
}
.garyit-chatbot-title-wrap { min-width: 0; flex: 1; }
.garyit-chatbot-title { font-weight: 750; line-height: 1.2; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.garyit-chatbot-status { margin-top: 4px; font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 5px; }
.garyit-chatbot-status .garyit-chatbot-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #5ee59a; box-shadow: 0 0 0 3px rgba(94,229,154,.16); flex: 0 0 7px; }
.garyit-chatbot-status.is-busy .garyit-chatbot-status-dot { background: #facc15; box-shadow: 0 0 0 3px rgba(250,204,21,.16); }
.garyit-chatbot-status.is-error .garyit-chatbot-status-dot { background: #fecaca; box-shadow: 0 0 0 3px rgba(254,202,202,.16); }
.garyit-chatbot-close { border: 0; background: transparent; color: #fff; font-size: 29px; line-height: 1; cursor: pointer; padding: 4px; opacity: .88; }

.garyit-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 10px;
  background: #f8fafc;
  scroll-behavior: smooth;
}
.garyit-chatbot-row { display: flex; margin-bottom: 10px; }
.garyit-chatbot-row-user { justify-content: flex-end; }
.garyit-chatbot-row-assistant { justify-content: flex-start; }
.garyit-chatbot-bubble {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.46;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.garyit-chatbot-row-assistant .garyit-chatbot-bubble { background: #fff; color: #1e293b; border: 1px solid #e5e7eb; border-bottom-left-radius: 5px; box-shadow: 0 2px 8px rgba(15,23,42,.05); }
.garyit-chatbot-row-user .garyit-chatbot-bubble { background: var(--garyit-chatbot-brand); color: #fff; border-bottom-right-radius: 5px; }

.garyit-chatbot-typing { padding: 5px 18px 8px; background: #f8fafc; }
.garyit-chatbot-typing span { display: inline-block; width: 7px; height: 7px; margin-right: 3px; border-radius: 50%; background: #94a3b8; animation: garyit-bounce 1.2s infinite ease-in-out; }
.garyit-chatbot-typing span:nth-child(2) { animation-delay: .14s; }
.garyit-chatbot-typing span:nth-child(3) { animation-delay: .28s; }
@keyframes garyit-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .55; } 40% { transform: translateY(-5px); opacity: 1; } }

.garyit-chatbot-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 11px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.garyit-chatbot-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 112px;
  resize: none;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 11px;
  font: inherit;
  line-height: 1.35;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
}
.garyit-chatbot-form textarea:focus { border-color: var(--garyit-chatbot-brand); outline: none; }
.garyit-chatbot-send {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--garyit-chatbot-brand);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.garyit-chatbot-send:disabled { opacity: .55; cursor: default; }
.garyit-chatbot-send svg { width: 21px; height: 21px; fill: currentColor; }
.garyit-chatbot-privacy { padding: 0 12px 10px; background: #fff; color: #64748b; font-size: 10px; line-height: 1.35; text-align: center; }

@media (max-width: 520px) {
  #garyit-chatbot-root { right: 12px !important; left: 12px !important; bottom: 12px; }
  .garyit-chatbot-launcher { margin-left: auto; }
  .garyit-chatbot-position-left .garyit-chatbot-launcher { margin-left: 0; }
  .garyit-chatbot-panel, .garyit-chatbot-position-right .garyit-chatbot-panel, .garyit-chatbot-position-left .garyit-chatbot-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 84px;
    width: auto;
    height: min(620px, calc(100vh - 104px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .garyit-chatbot-panel, .garyit-chatbot-launcher { transition: none; }
  .garyit-chatbot-typing span { animation: none; }
}
.garyit-chatbot-contact-wrap { padding: 0 12px 8px; background: #fff; text-align: center; }
.garyit-chatbot-contact { display: inline-block; font-size: 12px; font-weight: 650; color: var(--garyit-chatbot-brand); text-decoration: none; }
.garyit-chatbot-contact:hover { text-decoration: underline; }
